diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a467214 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.anchor +.DS_Store +.vscode/ +target +**/*.rs.bk +node_modules +test-ledger/ +sdk/dist/ +sdk/node_modules diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e5791ae --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "files.insertFinalNewline": true +} \ No newline at end of file diff --git a/Anchor.toml b/Anchor.toml new file mode 100644 index 0000000..9895a7b --- /dev/null +++ b/Anchor.toml @@ -0,0 +1,17 @@ +[programs.localnet] +whirlpool = "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc" + +[registry] +url = "https://anchor.projectserum.com" + +[provider] +cluster = "localnet" +wallet = "~/.config/solana/id.json" + +# wait for update to anchor to support cloning +# [[test.genesis]] +# address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" +# program = "../metaplex-program-library/token-metadata/target/deploy/mpl_token_metadata.so" + +[scripts] +test = "ts-mocha -p sdk/tests/tsconfig.json -t 1000000 sdk/tests/**/*.ts" diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..e4cc445 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1676 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.3", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "anchor-attribute-access-control" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "105c443a613f29212755fb6c5f946fa82dcf94a80528f643e0faa9d9faeb626b" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "regex", + "syn", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdae15851aa41972e9c18c987613c50a916c48c88c97ea3316156a5c772e5faa" +dependencies = [ + "anchor-syn", + "anyhow", + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6356865217881d0bbea8aa70625937bec6d9952610f1ba2a2452a8e427000687" +dependencies = [ + "anchor-syn", + "proc-macro2", + "syn", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe998ce4e6e0cb0e291d1a1626bd30791cdfdd9d05523111bdf4fd053f08636" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5810498a20554c20354f5648b6041172f2035e58d09ad40dc051dc0d1501f80" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-interface" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac83f085b2be8b3a3412989cf96cf7f683561db7d357c5aa4aa11d48bbb22213" +dependencies = [ + "anchor-syn", + "anyhow", + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73c56be575d89abcb192afa29deb87b2cdb3c39033abc02f2d16e6af999b23b7" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-state" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ab002353b01fcb4f72cca256d5d62db39f9ff39b1d072280deee9798f1f524" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e653cdb322078d95221384c4a527a403560e509ac7cb2b53d3bd664b23c4d6" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-lang" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4815ad6334fd2f561f7ddcc3cfbeed87ed3003724171bd80ebe6383d5173ee8f" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-interface", + "anchor-attribute-program", + "anchor-attribute-state", + "anchor-derive-accounts", + "arrayref", + "base64 0.13.0", + "bincode", + "borsh", + "bytemuck", + "solana-program", + "thiserror", +] + +[[package]] +name = "anchor-spl" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea94b04fc9a0aaae4d4473b0595fb5f55b6c9b38e0d6f596df8c8060f95f096" +dependencies = [ + "anchor-lang", + "solana-program", + "spl-associated-token-account", + "spl-token", +] + +[[package]] +name = "anchor-syn" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be7bfb6991d79cce3495fb6ce0892f58a5c75a74c8d1c2fc6f62926066eb9f4" +dependencies = [ + "anyhow", + "bs58 0.3.1", + "heck", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "serde", + "serde_json", + "sha2", + "syn", + "thiserror", +] + +[[package]] +name = "anyhow" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bit-set" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake3" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882e99e4a0cb2ae6cb6e442102e8e6b7131718d94110e64c3e6a34ea9b106f37" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.1", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive", + "hashbrown", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bs58" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72957246c41db82b8ef88a5486143830adeb8227ef9837740bdec67724cf2c5b" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cc" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "cpufeatures" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +dependencies = [ + "generic-array", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" +dependencies = [ + "block-buffer 0.10.0", + "crypto-common", + "generic-array", + "subtle", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "js-sys" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "lock_api" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + +[[package]] +name = "memmap2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d" +dependencies = [ + "libc", +] + +[[package]] +name = "mpl-token-metadata" +version = "1.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8f072b3bd212fb020389e6d6244e4b35b99708193d063cf3844bac8c182ae8f" +dependencies = [ + "arrayref", + "borsh", + "mpl-token-vault", + "num-derive", + "num-traits", + "solana-program", + "spl-associated-token-account", + "spl-token", + "thiserror", +] + +[[package]] +name = "mpl-token-vault" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade4ef15bc06a6033076c4ff28cba9b42521df5ec61211d6f419415ace2746a" +dependencies = [ + "borsh", + "num-derive", + "num-traits", + "solana-program", + "spl-token", + "thiserror", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +dependencies = [ + "derivative", + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "once_cell" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[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", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "version_check", + "yansi", +] + +[[package]] +name = "proptest" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" +dependencies = [ + "bit-set", + "bitflags", + "byteorder", + "lazy_static", + "num-traits", + "quick-error 2.0.1", + "rand 0.8.4", + "rand_chacha 0.3.1", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quote" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.3", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error 1.2.3", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + +[[package]] +name = "serde" +version = "1.0.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1e6ec4d8950e5b1e894eac0d360742f3b1407a6078a604a731c4b3f49cefbc" +dependencies = [ + "rustversion", + "serde", + "serde_json", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12e47be9471c72889ebafb5e14d5ff930d89ae7a67bbdb5f8abb564f845a927e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", +] + +[[package]] +name = "smallvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" + +[[package]] +name = "solana-frozen-abi" +version = "1.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae24bb5a815c2796908b131b7e44973d6f2e0e16eb7e67e0f0b5fcd95de0da1" +dependencies = [ + "bs58 0.4.0", + "bv", + "generic-array", + "log", + "memmap2", + "rustc_version", + "serde", + "serde_derive", + "sha2", + "solana-frozen-abi-macro", + "solana-logger", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cff377ed697595d3041052940730acefca4f4bfc23eb26bb695595cee737fe5" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + +[[package]] +name = "solana-logger" +version = "1.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e3e1c7bf616aa4926d70dd9015077fcccd88c9271cef29c9038e76a2da1ac5d" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + +[[package]] +name = "solana-program" +version = "1.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36bead9a6131b48cffc3a3105a6e469592442715528d9d0187e114776533b01c" +dependencies = [ + "base64 0.13.0", + "bincode", + "bitflags", + "blake3", + "borsh", + "borsh-derive", + "bs58 0.4.0", + "bv", + "bytemuck", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.1.16", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "num-derive", + "num-traits", + "parking_lot", + "rand 0.7.3", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "sha2", + "sha3", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-logger", + "solana-sdk-macro", + "thiserror", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "333726c958386c09937aba55ca4390bcfb4621c6120f47610682a94ea4d4533c" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "spl-associated-token-account" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428" +dependencies = [ + "solana-program", + "spl-token", +] + +[[package]] +name = "spl-token" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93bfdd5bd7c869cb565c7d7635c4fafe189b988a0bdef81063cd9585c6b8dc01" +dependencies = [ + "arrayref", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "thiserror", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +dependencies = [ + "cfg-if", + "libc", + "rand 0.8.4", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde", +] + +[[package]] +name = "typenum" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" + +[[package]] +name = "uint" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-segmentation" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "version_check" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" + +[[package]] +name = "web-sys" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whirlpool" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "anchor-spl", + "borsh", + "mpl-token-metadata", + "proptest", + "serde", + "serde_json", + "serde_with", + "solana-program", + "spl-token", + "thiserror", + "uint", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "yansi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" + +[[package]] +name = "zeroize" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf68b08513768deaa790264a7fac27a58cbf2705cfcdc9448362229217d7e970" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a60de98 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,4 @@ +[workspace] +members = [ + "programs/*" +] diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb119fe --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# Whirlpool + +## Required Setup + +- Go through [Anchor install guide](https://project-serum.github.io/anchor/getting-started/installation.html#install-rust) +- Need to have a valid Solana keypair at `~/.config/solana/id.json` to do local testing with `anchor test` flows. + +## Required npm globally installed packages + +- mocha (I think? Could try just ts-mocha first) +- ts-mocha +- typescript + +Also your $NODE_PATH must be set to the `node_modules` directory of your global installs. +For me since I am using Node 16.10.0 installed through `nvm`, my $NODE_PATH is the following: + +``` +$ echo $NODE_PATH +/Users//.nvm/versions/node/v16.10.0/lib/node_modules +``` + +## Minimum Requirements + +- Node 16.4 (Anchor) +- Anchor 0.20.1 +- Solana 1.9.3 +- Rust 1.59.0 + +## Unit Tests + +- Run "cargo test --lib" to run unit tests +- Run "anchor test" to run integration tests diff --git a/migrations/deploy.js b/migrations/deploy.js new file mode 100644 index 0000000..325cf3d --- /dev/null +++ b/migrations/deploy.js @@ -0,0 +1,12 @@ +// Migrations are an early feature. Currently, they're nothing more than this +// single deploy script that's invoked from the CLI, injecting a provider +// configured from the workspace's Anchor.toml. + +const anchor = require("@project-serum/anchor"); + +module.exports = async function (provider) { + // Configure client to use the provider. + anchor.setProvider(provider); + + // Add your deploy script here. +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7446fad --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3179 @@ +{ + "name": "whirlpool", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "@project-serum/anchor": "^0.18.0", + "@solana/spl-token": "^0.1.8" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "chai": "^4.3.4", + "mocha": "^9.0.3" + } + }, + "node_modules/@babel/runtime": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", + "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@project-serum/anchor": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.18.0.tgz", + "integrity": "sha512-WTm+UB93MoxyCbjnHIibv/uUEoO/5gL4GEtE/aMioLF8Z4i0vCMPnvAN0xpk9VBu3t7ld2DcCE/L+6Z7dwU++w==", + "dependencies": { + "@project-serum/borsh": "^0.2.2", + "@solana/web3.js": "^1.17.0", + "base64-js": "^1.5.1", + "bn.js": "^5.1.2", + "bs58": "^4.0.1", + "buffer-layout": "^1.2.0", + "camelcase": "^5.3.1", + "crypto-hash": "^1.3.0", + "eventemitter3": "^4.0.7", + "find": "^0.3.0", + "js-sha256": "^0.9.0", + "pako": "^2.0.3", + "snake-case": "^3.0.4", + "toml": "^3.0.0" + }, + "engines": { + "node": ">=11" + } + }, + "node_modules/@project-serum/borsh": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.2.tgz", + "integrity": "sha512-Ms+aWmGVW6bWd3b0+MWwoaYig2QD0F90h0uhr7AzY3dpCb5e2S6RsRW02vFTfa085pY2VLB7nTZNbFECQ1liTg==", + "license": "Apache-2.0", + "dependencies": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@solana/web3.js": "^1.2.0" + } + }, + "node_modules/@solana/buffer-layout": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz", + "integrity": "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==", + "license": "MIT", + "dependencies": { + "buffer": "~6.0.3" + }, + "engines": { + "node": ">=5.10" + } + }, + "node_modules/@solana/buffer-layout/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@solana/spl-token": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.1.8.tgz", + "integrity": "sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ==", + "dependencies": { + "@babel/runtime": "^7.10.5", + "@solana/web3.js": "^1.21.0", + "bn.js": "^5.1.0", + "buffer": "6.0.3", + "buffer-layout": "^1.2.0", + "dotenv": "10.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@solana/spl-token/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@solana/web3.js": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.29.2.tgz", + "integrity": "sha512-gtoHzimv7upsKF2DIO4/vNfIMKN+cxSImBHvsdiMyp9IPqb8sctsHVU/+80xXl0JKXVKeairDv5RvVnesJYrtw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5", + "@solana/buffer-layout": "^3.0.0", + "bn.js": "^5.0.0", + "borsh": "^0.4.0", + "bs58": "^4.0.1", + "buffer": "6.0.1", + "cross-fetch": "^3.1.4", + "crypto-hash": "^1.2.2", + "jayson": "^3.4.4", + "js-sha3": "^0.8.0", + "rpc-websockets": "^7.4.2", + "secp256k1": "^4.0.2", + "superstruct": "^0.14.2", + "tweetnacl": "^1.0.0" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.24", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", + "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.14.175", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.175.tgz", + "integrity": "sha512-XmdEOrKQ8a1Y/yxQFOMbC47G/V2VDO1GvMRnl4O75M4GW/abC5tnfzadQYkqEveqRM1dEJGFFegfPNA2vvx2iw==", + "license": "MIT" + }, + "node_modules/@types/mocha": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "16.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.2.tgz", + "integrity": "sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ==", + "license": "MIT" + }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "license": "MIT" + }, + "node_modules/borsh": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.4.0.tgz", + "integrity": "sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g==", + "license": "Apache-2.0", + "dependencies": { + "@types/bn.js": "^4.11.5", + "bn.js": "^5.0.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "license": "MIT" + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "license": "MIT", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/buffer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.1.tgz", + "integrity": "sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", + "license": "MIT", + "engines": { + "node": ">=4.5" + } + }, + "node_modules/bufferutil": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.4.tgz", + "integrity": "sha512-VNxjXUCrF3LvbLgwfkTb5LsFvk6pGIn7OBb9x+3o+iJ6mKw0JTUp4chBFc88hi1aspeZGeZG9jAIbpFYPQSLZw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/circular-json": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", + "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==", + "license": "MIT" + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-fetch": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", + "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "license": "MIT", + "dependencies": { + "node-fetch": "2.6.1" + } + }, + "node_modules/crypto-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", + "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "engines": { + "node": ">=10" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "license": "MIT" + }, + "node_modules/es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "license": "MIT", + "dependencies": { + "es6-promise": "^4.0.3" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "engines": { + "node": "> 0.1.90" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", + "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", + "license": "MIT", + "dependencies": { + "traverse-chain": "~0.1.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.x" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "license": "MIT", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true, + "license": "ISC" + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/jayson": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.4.tgz", + "integrity": "sha512-GH63DsRFFlodS8krFgAhxwYvQFmSwjsFxKnPrHQtp+BJj/tpeSj3hyBGGqmTkuq043U1Gn6u8VdsVRFZX1EEiQ==", + "license": "MIT", + "dependencies": { + "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "lodash": "^4.17.20", + "uuid": "^3.4.0", + "ws": "^7.4.5" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.27.tgz", + "integrity": "sha512-qZdePUDSLAZRXXV234bLBEUM0nAQjoxbcSwp1rqSMUe1rZ47mwU6OjciR/JvF1Oo8mc0ys6GE0ks0HGgqAZoGg==", + "license": "MIT" + }, + "node_modules/js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "license": "MIT" + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "license": "ISC" + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "license": "ISC" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mocha": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.2.tgz", + "integrity": "sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true, + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "license": "MIT", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "license": "MIT", + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/node-gyp-build": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pako": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz", + "integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==", + "license": "(MIT AND Zlib)" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "license": "MIT" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rpc-websockets": { + "version": "7.4.14", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.14.tgz", + "integrity": "sha512-x/2Rwzla6bXAyE8A21yx3sHjn49JUlgBUYfnKurNeqrZQgFxfD43Udo5NkTWQp+TASrssTlks8ipcJfvswgv5g==", + "license": "LGPL-3.0-only", + "dependencies": { + "@babel/runtime": "^7.11.2", + "circular-json": "^0.5.9", + "eventemitter3": "^4.0.7", + "uuid": "^8.3.0", + "ws": "^7.4.5" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/rpc-websockets/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "license": "MIT", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/superstruct": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", + "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==", + "license": "MIT" + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "license": "MIT" + }, + "node_modules/traverse-chain": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", + "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=", + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "license": "0BSD" + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "license": "Unlicense" + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.6.tgz", + "integrity": "sha512-hoY0gOf9EkCw+nimK21FVKHUIG1BMqSiRwxB/q3A9yKZOrOI99PP77BxmarDqWz6rG3vVYiBWfhG8z2Tl+7fZA==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/workerpool": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "license": "ISC" + }, + "node_modules/ws": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@babel/runtime": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", + "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@project-serum/anchor": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.18.0.tgz", + "integrity": "sha512-WTm+UB93MoxyCbjnHIibv/uUEoO/5gL4GEtE/aMioLF8Z4i0vCMPnvAN0xpk9VBu3t7ld2DcCE/L+6Z7dwU++w==", + "requires": { + "@project-serum/borsh": "^0.2.2", + "@solana/web3.js": "^1.17.0", + "base64-js": "^1.5.1", + "bn.js": "^5.1.2", + "bs58": "^4.0.1", + "buffer-layout": "^1.2.0", + "camelcase": "^5.3.1", + "crypto-hash": "^1.3.0", + "eventemitter3": "^4.0.7", + "find": "^0.3.0", + "js-sha256": "^0.9.0", + "pako": "^2.0.3", + "snake-case": "^3.0.4", + "toml": "^3.0.0" + } + }, + "@project-serum/borsh": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.2.tgz", + "integrity": "sha512-Ms+aWmGVW6bWd3b0+MWwoaYig2QD0F90h0uhr7AzY3dpCb5e2S6RsRW02vFTfa085pY2VLB7nTZNbFECQ1liTg==", + "requires": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + } + }, + "@solana/buffer-layout": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz", + "integrity": "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==", + "requires": { + "buffer": "~6.0.3" + }, + "dependencies": { + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + } + } + }, + "@solana/spl-token": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.1.8.tgz", + "integrity": "sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ==", + "requires": { + "@babel/runtime": "^7.10.5", + "@solana/web3.js": "^1.21.0", + "bn.js": "^5.1.0", + "buffer": "6.0.3", + "buffer-layout": "^1.2.0", + "dotenv": "10.0.0" + }, + "dependencies": { + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + } + } + }, + "@solana/web3.js": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.29.2.tgz", + "integrity": "sha512-gtoHzimv7upsKF2DIO4/vNfIMKN+cxSImBHvsdiMyp9IPqb8sctsHVU/+80xXl0JKXVKeairDv5RvVnesJYrtw==", + "requires": { + "@babel/runtime": "^7.12.5", + "@solana/buffer-layout": "^3.0.0", + "bn.js": "^5.0.0", + "borsh": "^0.4.0", + "bs58": "^4.0.1", + "buffer": "6.0.1", + "cross-fetch": "^3.1.4", + "crypto-hash": "^1.2.2", + "jayson": "^3.4.4", + "js-sha3": "^0.8.0", + "rpc-websockets": "^7.4.2", + "secp256k1": "^4.0.2", + "superstruct": "^0.14.2", + "tweetnacl": "^1.0.0" + } + }, + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.24", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", + "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "@types/lodash": { + "version": "4.14.175", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.175.tgz", + "integrity": "sha512-XmdEOrKQ8a1Y/yxQFOMbC47G/V2VDO1GvMRnl4O75M4GW/abC5tnfzadQYkqEveqRM1dEJGFFegfPNA2vvx2iw==" + }, + "@types/mocha": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "dev": true + }, + "@types/node": { + "version": "16.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.2.tgz", + "integrity": "sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ==" + }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, + "@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "requires": { + "@types/node": "*" + } + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "borsh": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.4.0.tgz", + "integrity": "sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g==", + "requires": { + "@types/bn.js": "^4.11.5", + "bn.js": "^5.0.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "buffer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.1.tgz", + "integrity": "sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==" + }, + "bufferutil": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.4.tgz", + "integrity": "sha512-VNxjXUCrF3LvbLgwfkTb5LsFvk6pGIn7OBb9x+3o+iJ6mKw0JTUp4chBFc88hi1aspeZGeZG9jAIbpFYPQSLZw==", + "optional": true, + "requires": { + "node-gyp-build": "^4.2.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "circular-json": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", + "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==" + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cross-fetch": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", + "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "requires": { + "node-fetch": "2.6.1" + } + }, + "crypto-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", + "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==" + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==" + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "requires": { + "es6-promise": "^4.0.3" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", + "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", + "requires": { + "traverse-chain": "~0.1.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "requires": {} + }, + "jayson": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.4.tgz", + "integrity": "sha512-GH63DsRFFlodS8krFgAhxwYvQFmSwjsFxKnPrHQtp+BJj/tpeSj3hyBGGqmTkuq043U1Gn6u8VdsVRFZX1EEiQ==", + "requires": { + "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "lodash": "^4.17.20", + "uuid": "^3.4.0", + "ws": "^7.4.5" + }, + "dependencies": { + "@types/node": { + "version": "12.20.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.27.tgz", + "integrity": "sha512-qZdePUDSLAZRXXV234bLBEUM0nAQjoxbcSwp1rqSMUe1rZ47mwU6OjciR/JvF1Oo8mc0ys6GE0ks0HGgqAZoGg==" + } + } + }, + "js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "requires": { + "tslib": "^2.0.3" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mocha": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.2.tgz", + "integrity": "sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true + }, + "no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "requires": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + }, + "node-gyp-build": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "pako": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz", + "integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "rpc-websockets": { + "version": "7.4.14", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.14.tgz", + "integrity": "sha512-x/2Rwzla6bXAyE8A21yx3sHjn49JUlgBUYfnKurNeqrZQgFxfD43Udo5NkTWQp+TASrssTlks8ipcJfvswgv5g==", + "requires": { + "@babel/runtime": "^7.11.2", + "bufferutil": "^4.0.1", + "circular-json": "^0.5.9", + "eventemitter3": "^4.0.7", + "utf-8-validate": "^5.0.2", + "uuid": "^8.3.0", + "ws": "^7.4.5" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "superstruct": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", + "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==" + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" + }, + "traverse-chain": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", + "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=" + }, + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "utf-8-validate": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.6.tgz", + "integrity": "sha512-hoY0gOf9EkCw+nimK21FVKHUIG1BMqSiRwxB/q3A9yKZOrOI99PP77BxmarDqWz6rG3vVYiBWfhG8z2Tl+7fZA==", + "optional": true, + "requires": { + "node-gyp-build": "^4.2.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "workerpool": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "requires": {} + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + } + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..79bfc09 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "orca-whirlpools", + "private": true, + "workspaces": [ + "sdk", + "scripts" + ], + "scripts": { + "idl": "anchor build -i $INIT_CWD/sdk/src/artifacts -t $INIT_CWD/sdk/src/artifacts" + } +} diff --git a/programs/whirlpool/Cargo.toml b/programs/whirlpool/Cargo.toml new file mode 100644 index 0000000..da9008c --- /dev/null +++ b/programs/whirlpool/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "whirlpool" +version = "0.1.0" +description = "Created with Anchor" +edition = "2018" + +[lib] +crate-type = ["cdylib", "lib"] +name = "whirlpool" + +[features] +no-entrypoint = [] +no-idl = [] +cpi = ["no-entrypoint"] +default = [] + +[dependencies] +anchor-lang = "0.20.1" +anchor-spl = "0.20.1" +spl-token = { version = "3.1.1", features = ["no-entrypoint"] } +solana-program = "1.8.12" +thiserror = "1.0" +uint = { version = "0.9.1", default-features = false } +borsh = "0.9.1" +mpl-token-metadata = { version = "1.2.5", features = ["no-entrypoint"] } + +[dev-dependencies] +proptest = "1.0" +serde = "1.0.117" +serde_json = "1.0.59" + +[dev-dependencies.serde_with] +version = "1.12.0" +features = ["json"] diff --git a/programs/whirlpool/Xargo.toml b/programs/whirlpool/Xargo.toml new file mode 100644 index 0000000..475fb71 --- /dev/null +++ b/programs/whirlpool/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/programs/whirlpool/src/constants/mod.rs b/programs/whirlpool/src/constants/mod.rs new file mode 100644 index 0000000..7a14842 --- /dev/null +++ b/programs/whirlpool/src/constants/mod.rs @@ -0,0 +1,3 @@ +pub mod test_constants; + +pub use test_constants::*; diff --git a/programs/whirlpool/src/constants/test_constants.rs b/programs/whirlpool/src/constants/test_constants.rs new file mode 100644 index 0000000..6cef38a --- /dev/null +++ b/programs/whirlpool/src/constants/test_constants.rs @@ -0,0 +1,9 @@ +#[cfg(test)] +use anchor_lang::prelude::Pubkey; + +#[cfg(test)] +pub fn test_program_id() -> Pubkey { + "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc" + .parse() + .unwrap() +} diff --git a/programs/whirlpool/src/errors.rs b/programs/whirlpool/src/errors.rs new file mode 100644 index 0000000..505b301 --- /dev/null +++ b/programs/whirlpool/src/errors.rs @@ -0,0 +1,110 @@ +use std::num::TryFromIntError; + +use anchor_lang::error; + +#[error] +#[derive(PartialEq)] +pub enum ErrorCode { + #[msg("Enum value could not be converted")] + InvalidEnum, // 0x1770 + #[msg("Invalid start tick index provided.")] + InvalidStartTick, // 0x1771 + #[msg("Tick-array already exists in this whirlpool")] + TickArrayExistInPool, // 0x1772 + #[msg("Attempt to search for a tick-array failed")] + TickArrayIndexOutofBounds, // 0x1773 + #[msg("Tick-spacing is not supported")] + InvalidTickSpacing, // 0x1774 + #[msg("Position is not empty It cannot be closed")] + ClosePositionNotEmpty, // 0x1775 + + #[msg("Unable to divide by zero")] + DivideByZero, // 0x1776 + #[msg("Unable to cast number into BigInt")] + NumberCastError, // 0x1777 + #[msg("Unable to down cast number")] + NumberDownCastError, // 0x1778 + + #[msg("Tick not found within tick array")] + TickNotFound, // 0x1779 + #[msg("Provided tick index is either out of bounds or uninitializable")] + InvalidTickIndex, // 0x177a + #[msg("Provided sqrt price out of bounds")] + SqrtPriceOutOfBounds, // 0x177b + + #[msg("Liquidity amount must be greater than zero")] + LiquidityZero, // 0x177c + #[msg("Liquidity amount must be less than i64::MAX")] + LiquidityTooHigh, // 0x177d + #[msg("Liquidity overflow")] + LiquidityOverflow, // 0x177e + #[msg("Liquidity underflow")] + LiquidityUnderflow, // 0x177f + #[msg("Tick liquidity net underflowed or overflowed")] + LiquidityNetError, // 0x1780 + + #[msg("Exceeded token max")] + TokenMaxExceeded, // 0x1781 + #[msg("Did not meet token min")] + TokenMinSubceeded, // 0x1782 + + #[msg("Position token account has a missing or invalid delegate")] + MissingOrInvalidDelegate, // 0x1783 + #[msg("Position token amount must be 1")] + InvalidPositionTokenAmount, // 0x1784 + + #[msg("Timestamp should be convertible from i64 to u64")] + InvalidTimestampConversion, // 0x1785 + #[msg("Timestamp should be greater than the last updated timestamp")] + InvalidTimestamp, // 0x1786 + + #[msg("Invalid tick array sequence provided for instruction.")] + InvalidTickArraySequence, // 0x1787 + #[msg("Token Mint in wrong order")] + InvalidTokenMintOrder, // 0x1788 + + #[msg("Reward not initialized")] + RewardNotInitialized, // 0x1789 + #[msg("Invalid reward index")] + InvalidRewardIndex, // 0x178a + + #[msg("Reward vault requires amount to support emissions for at least one day")] + RewardVaultAmountInsufficient, // 0x178b + #[msg("Exceeded max fee rate")] + FeeRateMaxExceeded, // 0x178c + #[msg("Exceeded max protocol fee rate")] + ProtocolFeeRateMaxExceeded, // 0x178d + + #[msg("Multiplication with shift right overflow")] + MultiplicationShiftRightOverflow, // 0x178e + #[msg("Muldiv overflow")] + MulDivOverflow, // 0x178f + #[msg("Invalid div_u256 input")] + MulDivInvalidInput, //0x1790 + #[msg("Multiplication overflow")] + MultiplicationOverflow, //0x1791 + + #[msg("Provided SqrtPriceLimit not in the same direction as the swap.")] + InvalidSqrtPriceLimitDirection, //0x1792 + #[msg("There are no tradable amount to swap.")] + ZeroTradableAmount, //0x1793 + + #[msg("Amount out below minimum threshold")] + AmountOutBelowMinimum, //0x1794 + #[msg("Amount in above maximum threshold")] + AmountInAboveMaximum, //0x1795 + + #[msg("Invalid index for tick array sequence")] + TickArraySequenceInvalidIndex, //0x1796 + + #[msg("Amount calculated overflows")] + AmountCalcOverflow, //0x1797 + #[msg("Amount remaining overflows")] + AmountRemainingOverflow, //0x1798 +} + +impl From for ErrorCode { + fn from(_: TryFromIntError) -> Self { + ErrorCode::NumberCastError + } +} diff --git a/programs/whirlpool/src/instructions/close_position.rs b/programs/whirlpool/src/instructions/close_position.rs new file mode 100644 index 0000000..bba77a8 --- /dev/null +++ b/programs/whirlpool/src/instructions/close_position.rs @@ -0,0 +1,47 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Mint, Token, TokenAccount}; + +use crate::errors::ErrorCode; +use crate::state::*; +use crate::util::{burn_and_close_user_position_token, verify_position_authority}; + +#[derive(Accounts)] +pub struct ClosePosition<'info> { + pub position_authority: Signer<'info>, + + #[account(mut)] + pub receiver: UncheckedAccount<'info>, + + #[account(mut, close = receiver)] + pub position: Account<'info, Position>, + + #[account(mut, address = position.position_mint)] + pub position_mint: Account<'info, Mint>, + + #[account(mut, + constraint = position_token_account.amount == 1, + constraint = position_token_account.mint == position.position_mint)] + pub position_token_account: Box>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, +} + +pub fn handler(ctx: Context) -> ProgramResult { + verify_position_authority( + &ctx.accounts.position_token_account, + &ctx.accounts.position_authority, + )?; + + if !Position::is_position_empty(&ctx.accounts.position) { + return Err(ErrorCode::ClosePositionNotEmpty.into()); + } + + burn_and_close_user_position_token( + &ctx.accounts.position_authority, + &ctx.accounts.receiver, + &ctx.accounts.position_mint, + &ctx.accounts.position_token_account, + &ctx.accounts.token_program, + ) +} diff --git a/programs/whirlpool/src/instructions/collect_fees.rs b/programs/whirlpool/src/instructions/collect_fees.rs new file mode 100644 index 0000000..dcf3f45 --- /dev/null +++ b/programs/whirlpool/src/instructions/collect_fees.rs @@ -0,0 +1,68 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Token, TokenAccount}; + +use crate::{ + state::*, + util::{transfer_from_vault_to_owner, verify_position_authority}, +}; + +#[derive(Accounts)] +pub struct CollectFees<'info> { + pub whirlpool: Box>, + + pub position_authority: Signer<'info>, + + #[account(mut, has_one = whirlpool)] + pub position: Box>, + #[account( + constraint = position_token_account.mint == position.position_mint, + constraint = position_token_account.amount == 1 + )] + pub position_token_account: Box>, + + #[account(mut, constraint = token_owner_account_a.mint == whirlpool.token_mint_a)] + pub token_owner_account_a: Box>, + #[account(mut, address = whirlpool.token_vault_a)] + pub token_vault_a: Box>, + + #[account(mut, constraint = token_owner_account_b.mint == whirlpool.token_mint_b)] + pub token_owner_account_b: Box>, + #[account(mut, address = whirlpool.token_vault_b)] + pub token_vault_b: Box>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, +} + +pub fn handler(ctx: Context) -> ProgramResult { + verify_position_authority( + &ctx.accounts.position_token_account, + &ctx.accounts.position_authority, + )?; + + let position = &mut ctx.accounts.position; + + // Store the fees owed to use as transfer amounts. + let fee_owed_a = position.fee_owed_a; + let fee_owed_b = position.fee_owed_b; + + position.reset_fees_owed(); + + transfer_from_vault_to_owner( + &ctx.accounts.whirlpool, + &ctx.accounts.token_vault_a, + &ctx.accounts.token_owner_account_a, + &ctx.accounts.token_program, + fee_owed_a, + )?; + + transfer_from_vault_to_owner( + &ctx.accounts.whirlpool, + &ctx.accounts.token_vault_b, + &ctx.accounts.token_owner_account_b, + &ctx.accounts.token_program, + fee_owed_b, + )?; + + Ok(()) +} diff --git a/programs/whirlpool/src/instructions/collect_protocol_fees.rs b/programs/whirlpool/src/instructions/collect_protocol_fees.rs new file mode 100644 index 0000000..d8eca30 --- /dev/null +++ b/programs/whirlpool/src/instructions/collect_protocol_fees.rs @@ -0,0 +1,51 @@ +use crate::{state::*, util::transfer_from_vault_to_owner}; +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Token, TokenAccount}; + +#[derive(Accounts)] +pub struct CollectProtocolFees<'info> { + pub whirlpools_config: Box>, + + #[account(mut, has_one = whirlpools_config)] + pub whirlpool: Box>, + + #[account(address = whirlpools_config.collect_protocol_fees_authority)] + pub collect_protocol_fees_authority: Signer<'info>, + + #[account(mut, address = whirlpool.token_vault_a)] + pub token_vault_a: Account<'info, TokenAccount>, + + #[account(mut, address = whirlpool.token_vault_b)] + pub token_vault_b: Account<'info, TokenAccount>, + + #[account(mut, constraint = token_destination_a.mint == whirlpool.token_mint_a)] + pub token_destination_a: Account<'info, TokenAccount>, + + #[account(mut, constraint = token_destination_b.mint == whirlpool.token_mint_b)] + pub token_destination_b: Account<'info, TokenAccount>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, +} + +pub fn handler(ctx: Context) -> ProgramResult { + let whirlpool = &ctx.accounts.whirlpool; + + transfer_from_vault_to_owner( + whirlpool, + &ctx.accounts.token_vault_a, + &ctx.accounts.token_destination_a, + &ctx.accounts.token_program, + whirlpool.protocol_fee_owed_a, + )?; + + transfer_from_vault_to_owner( + whirlpool, + &ctx.accounts.token_vault_b, + &ctx.accounts.token_destination_b, + &ctx.accounts.token_program, + whirlpool.protocol_fee_owed_b, + )?; + + Ok(ctx.accounts.whirlpool.reset_protocol_fees_owed()) +} diff --git a/programs/whirlpool/src/instructions/collect_reward.rs b/programs/whirlpool/src/instructions/collect_reward.rs new file mode 100644 index 0000000..d955f35 --- /dev/null +++ b/programs/whirlpool/src/instructions/collect_reward.rs @@ -0,0 +1,114 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Token, TokenAccount}; + +use crate::{ + state::*, + util::{transfer_from_vault_to_owner, verify_position_authority}, +}; + +#[derive(Accounts)] +#[instruction(reward_index: u8)] +pub struct CollectReward<'info> { + pub whirlpool: Box>, + + pub position_authority: Signer<'info>, + + #[account(mut, has_one = whirlpool)] + pub position: Box>, + #[account( + constraint = position_token_account.mint == position.position_mint, + constraint = position_token_account.amount == 1 + )] + pub position_token_account: Box>, + + #[account(mut, + constraint = reward_owner_account.mint == whirlpool.reward_infos[reward_index as usize].mint + )] + pub reward_owner_account: Box>, + + #[account(mut, address = whirlpool.reward_infos[reward_index as usize].vault)] + pub reward_vault: Box>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, +} + +/// Collects all harvestable tokens for a specified reward. +/// +/// If the Whirlpool reward vault does not have enough tokens, the maximum number of available +/// tokens will be debited to the user. The unharvested amount remains tracked, and it can be +/// harvested in the future. +/// +/// # Parameters +/// - `reward_index` - The reward to harvest. Acceptable values are 0, 1, and 2. +/// +/// # Returns +/// - `Ok`: Reward tokens at the specified reward index have been successfully harvested +/// - `Err`: `RewardNotInitialized` if the specified reward has not been initialized +/// `InvalidRewardIndex` if the reward index is not 0, 1, or 2 +pub fn handler(ctx: Context, reward_index: u8) -> ProgramResult { + verify_position_authority( + &ctx.accounts.position_token_account, + &ctx.accounts.position_authority, + )?; + + let index = reward_index as usize; + + let position = &mut ctx.accounts.position; + let (transfer_amount, updated_amount_owed) = calculate_collect_reward( + position.reward_infos[index], + ctx.accounts.reward_vault.amount, + ); + + position.update_reward_owed(index, updated_amount_owed); + + Ok(transfer_from_vault_to_owner( + &ctx.accounts.whirlpool, + &ctx.accounts.reward_vault, + &ctx.accounts.reward_owner_account, + &ctx.accounts.token_program, + transfer_amount, + )?) +} + +fn calculate_collect_reward(position_reward: PositionRewardInfo, vault_amount: u64) -> (u64, u64) { + let amount_owed = position_reward.amount_owed; + let (transfer_amount, updated_amount_owed) = if amount_owed > vault_amount { + (vault_amount, amount_owed - vault_amount) + } else { + (amount_owed, 0) + }; + + (transfer_amount, updated_amount_owed) +} + +#[cfg(test)] +mod unit_tests { + use super::calculate_collect_reward; + use crate::state::PositionRewardInfo; + + #[test] + fn test_calculate_collect_reward_vault_insufficient_tokens() { + let (transfer_amount, updated_amount_owed) = + calculate_collect_reward(position_reward(10), 1); + + assert_eq!(transfer_amount, 1); + assert_eq!(updated_amount_owed, 9); + } + + #[test] + fn test_calculate_collect_reward_vault_sufficient_tokens() { + let (transfer_amount, updated_amount_owed) = + calculate_collect_reward(position_reward(10), 10); + + assert_eq!(transfer_amount, 10); + assert_eq!(updated_amount_owed, 0); + } + + fn position_reward(amount_owed: u64) -> PositionRewardInfo { + PositionRewardInfo { + amount_owed, + ..Default::default() + } + } +} diff --git a/programs/whirlpool/src/instructions/decrease_liquidity.rs b/programs/whirlpool/src/instructions/decrease_liquidity.rs new file mode 100644 index 0000000..3cbda6f --- /dev/null +++ b/programs/whirlpool/src/instructions/decrease_liquidity.rs @@ -0,0 +1,82 @@ +use anchor_lang::prelude::*; + +use crate::errors::ErrorCode; +use crate::manager::liquidity_manager::{ + calculate_liquidity_token_deltas, calculate_modify_liquidity, sync_modify_liquidity_values, +}; +use crate::math::convert_to_liquidity_delta; +use crate::util::{to_timestamp_u64, transfer_from_vault_to_owner, verify_position_authority}; + +use super::ModifyLiquidity; + +/* + Removes liquidity from an existing Whirlpool Position. +*/ +pub fn handler( + ctx: Context, + liquidity_amount: u128, + token_min_a: u64, + token_min_b: u64, +) -> ProgramResult { + verify_position_authority( + &ctx.accounts.position_token_account, + &ctx.accounts.position_authority, + )?; + + let clock = Clock::get()?; + + if liquidity_amount == 0 { + return Err(ErrorCode::LiquidityZero.into()); + } + let liquidity_delta = convert_to_liquidity_delta(liquidity_amount, false)?; + let timestamp = to_timestamp_u64(clock.unix_timestamp)?; + + let update = calculate_modify_liquidity( + &ctx.accounts.whirlpool, + &ctx.accounts.position, + &ctx.accounts.tick_array_lower, + &ctx.accounts.tick_array_upper, + liquidity_delta, + timestamp, + )?; + + sync_modify_liquidity_values( + &mut ctx.accounts.whirlpool, + &mut ctx.accounts.position, + &ctx.accounts.tick_array_lower, + &ctx.accounts.tick_array_upper, + update, + timestamp, + )?; + + let (delta_a, delta_b) = calculate_liquidity_token_deltas( + ctx.accounts.whirlpool.tick_current_index, + ctx.accounts.whirlpool.sqrt_price, + &ctx.accounts.position, + liquidity_delta, + )?; + + if delta_a < token_min_a { + return Err(ErrorCode::TokenMinSubceeded.into()); + } else if delta_b < token_min_b { + return Err(ErrorCode::TokenMinSubceeded.into()); + } + + transfer_from_vault_to_owner( + &ctx.accounts.whirlpool, + &ctx.accounts.token_vault_a, + &ctx.accounts.token_owner_account_a, + &ctx.accounts.token_program, + delta_a, + )?; + + transfer_from_vault_to_owner( + &ctx.accounts.whirlpool, + &ctx.accounts.token_vault_b, + &ctx.accounts.token_owner_account_b, + &ctx.accounts.token_program, + delta_b, + )?; + + Ok(()) +} diff --git a/programs/whirlpool/src/instructions/increase_liquidity.rs b/programs/whirlpool/src/instructions/increase_liquidity.rs new file mode 100644 index 0000000..7e87a2a --- /dev/null +++ b/programs/whirlpool/src/instructions/increase_liquidity.rs @@ -0,0 +1,113 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Token, TokenAccount}; + +use crate::errors::ErrorCode; +use crate::manager::liquidity_manager::{ + calculate_liquidity_token_deltas, calculate_modify_liquidity, sync_modify_liquidity_values, +}; +use crate::math::convert_to_liquidity_delta; +use crate::state::*; +use crate::util::{to_timestamp_u64, transfer_from_owner_to_vault, verify_position_authority}; + +#[derive(Accounts)] +pub struct ModifyLiquidity<'info> { + #[account(mut)] + pub whirlpool: Account<'info, Whirlpool>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, + + pub position_authority: Signer<'info>, + + #[account(mut, has_one = whirlpool)] + pub position: Account<'info, Position>, + #[account( + constraint = position_token_account.mint == position.position_mint, + constraint = position_token_account.amount == 1 + )] + pub position_token_account: Box>, + + #[account(mut, constraint = token_owner_account_a.mint == whirlpool.token_mint_a)] + pub token_owner_account_a: Box>, + #[account(mut, constraint = token_owner_account_b.mint == whirlpool.token_mint_b)] + pub token_owner_account_b: Box>, + + #[account(mut, constraint = token_vault_a.key() == whirlpool.token_vault_a)] + pub token_vault_a: Box>, + #[account(mut, constraint = token_vault_b.key() == whirlpool.token_vault_b)] + pub token_vault_b: Box>, + + #[account(mut, has_one = whirlpool)] + pub tick_array_lower: AccountLoader<'info, TickArray>, + #[account(mut, has_one = whirlpool)] + pub tick_array_upper: AccountLoader<'info, TickArray>, +} + +pub fn handler( + ctx: Context, + liquidity_amount: u128, + token_max_a: u64, + token_max_b: u64, +) -> ProgramResult { + verify_position_authority( + &ctx.accounts.position_token_account, + &ctx.accounts.position_authority, + )?; + + let clock = Clock::get()?; + + if liquidity_amount == 0 { + return Err(ErrorCode::LiquidityZero.into()); + } + let liquidity_delta = convert_to_liquidity_delta(liquidity_amount, true)?; + let timestamp = to_timestamp_u64(clock.unix_timestamp)?; + + let update = calculate_modify_liquidity( + &ctx.accounts.whirlpool, + &ctx.accounts.position, + &ctx.accounts.tick_array_lower, + &ctx.accounts.tick_array_upper, + liquidity_delta, + timestamp, + )?; + + sync_modify_liquidity_values( + &mut ctx.accounts.whirlpool, + &mut ctx.accounts.position, + &ctx.accounts.tick_array_lower, + &ctx.accounts.tick_array_upper, + update, + timestamp, + )?; + + let (delta_a, delta_b) = calculate_liquidity_token_deltas( + ctx.accounts.whirlpool.tick_current_index, + ctx.accounts.whirlpool.sqrt_price, + &ctx.accounts.position, + liquidity_delta, + )?; + + if delta_a > token_max_a { + return Err(ErrorCode::TokenMaxExceeded.into()); + } else if delta_b > token_max_b { + return Err(ErrorCode::TokenMaxExceeded.into()); + } + + transfer_from_owner_to_vault( + &ctx.accounts.position_authority, + &ctx.accounts.token_owner_account_a, + &ctx.accounts.token_vault_a, + &ctx.accounts.token_program, + delta_a, + )?; + + transfer_from_owner_to_vault( + &ctx.accounts.position_authority, + &ctx.accounts.token_owner_account_b, + &ctx.accounts.token_vault_b, + &ctx.accounts.token_program, + delta_b, + )?; + + Ok(()) +} diff --git a/programs/whirlpool/src/instructions/initialize_config.rs b/programs/whirlpool/src/instructions/initialize_config.rs new file mode 100644 index 0000000..c6c5833 --- /dev/null +++ b/programs/whirlpool/src/instructions/initialize_config.rs @@ -0,0 +1,31 @@ +use anchor_lang::prelude::*; + +use crate::state::*; + +#[derive(Accounts)] +pub struct InitializeConfig<'info> { + #[account(init, payer = funder, space = WhirlpoolsConfig::LEN)] + pub config: Account<'info, WhirlpoolsConfig>, + + #[account(mut)] + pub funder: Signer<'info>, + + pub system_program: Program<'info, System>, +} + +pub fn handler( + ctx: Context, + fee_authority: Pubkey, + collect_protocol_fees_authority: Pubkey, + reward_emissions_super_authority: Pubkey, + default_protocol_fee_rate: u16, +) -> ProgramResult { + let config = &mut ctx.accounts.config; + + Ok(config.initialize( + fee_authority, + collect_protocol_fees_authority, + reward_emissions_super_authority, + default_protocol_fee_rate, + )?) +} diff --git a/programs/whirlpool/src/instructions/initialize_fee_tier.rs b/programs/whirlpool/src/instructions/initialize_fee_tier.rs new file mode 100644 index 0000000..1bab3c5 --- /dev/null +++ b/programs/whirlpool/src/instructions/initialize_fee_tier.rs @@ -0,0 +1,35 @@ +use crate::state::*; +use anchor_lang::prelude::*; + +#[derive(Accounts)] +#[instruction(tick_spacing: u16)] +pub struct InitializeFeeTier<'info> { + pub config: Box>, + + #[account(init, + payer = funder, + seeds = [b"fee_tier", config.key().as_ref(), + tick_spacing.to_le_bytes().as_ref()], + bump, + space = FeeTier::LEN)] + pub fee_tier: Account<'info, FeeTier>, + + #[account(mut)] + pub funder: Signer<'info>, + + #[account(address = config.fee_authority)] + pub fee_authority: Signer<'info>, + + pub system_program: Program<'info, System>, +} + +pub fn handler( + ctx: Context, + tick_spacing: u16, + default_fee_rate: u16, +) -> ProgramResult { + Ok(ctx + .accounts + .fee_tier + .initialize(&ctx.accounts.config, tick_spacing, default_fee_rate)?) +} diff --git a/programs/whirlpool/src/instructions/initialize_pool.rs b/programs/whirlpool/src/instructions/initialize_pool.rs new file mode 100644 index 0000000..c02532b --- /dev/null +++ b/programs/whirlpool/src/instructions/initialize_pool.rs @@ -0,0 +1,75 @@ +use crate::state::*; +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Mint, Token, TokenAccount}; + +#[derive(Accounts)] +#[instruction(bumps: WhirlpoolBumps, tick_spacing: u16)] +pub struct InitializePool<'info> { + pub whirlpools_config: Box>, + + pub token_mint_a: Account<'info, Mint>, + pub token_mint_b: Account<'info, Mint>, + + #[account(mut)] + pub funder: Signer<'info>, + + #[account(init, + seeds = [ + b"whirlpool".as_ref(), + whirlpools_config.key().as_ref(), + token_mint_a.key().as_ref(), + token_mint_b.key().as_ref(), + tick_spacing.to_le_bytes().as_ref() + ], + bump = bumps.whirlpool_bump, + payer = funder, + space = Whirlpool::LEN)] + pub whirlpool: Box>, + + #[account(init, + payer = funder, + token::mint = token_mint_a, + token::authority = whirlpool)] + pub token_vault_a: Box>, + + #[account(init, + payer = funder, + token::mint = token_mint_b, + token::authority = whirlpool)] + pub token_vault_b: Box>, + + #[account(has_one = whirlpools_config)] + pub fee_tier: Account<'info, FeeTier>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, + pub system_program: Program<'info, System>, + pub rent: Sysvar<'info, Rent>, +} + +pub fn handler( + ctx: Context, + bumps: WhirlpoolBumps, + tick_spacing: u16, + initial_sqrt_price: u128, +) -> ProgramResult { + let token_mint_a = ctx.accounts.token_mint_a.key(); + let token_mint_b = ctx.accounts.token_mint_b.key(); + + let whirlpool = &mut ctx.accounts.whirlpool; + let whirlpools_config = &ctx.accounts.whirlpools_config; + + let default_fee_rate = ctx.accounts.fee_tier.default_fee_rate; + + Ok(whirlpool.initialize( + whirlpools_config, + bumps.whirlpool_bump, + tick_spacing, + initial_sqrt_price, + default_fee_rate, + token_mint_a, + ctx.accounts.token_vault_a.key(), + token_mint_b, + ctx.accounts.token_vault_b.key(), + )?) +} diff --git a/programs/whirlpool/src/instructions/initialize_reward.rs b/programs/whirlpool/src/instructions/initialize_reward.rs new file mode 100644 index 0000000..06c9b1b --- /dev/null +++ b/programs/whirlpool/src/instructions/initialize_reward.rs @@ -0,0 +1,42 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Mint, Token, TokenAccount}; + +use crate::state::Whirlpool; + +#[derive(Accounts)] +#[instruction(reward_index: u8)] +pub struct InitializeReward<'info> { + #[account(address = whirlpool.reward_infos[reward_index as usize].authority)] + pub reward_authority: Signer<'info>, + + #[account(mut)] + pub funder: Signer<'info>, + + #[account(mut)] + pub whirlpool: Box>, + + pub reward_mint: Box>, + + #[account( + init, + payer = funder, + token::mint = reward_mint, + token::authority = whirlpool + )] + pub reward_vault: Box>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, + pub system_program: Program<'info, System>, + pub rent: Sysvar<'info, Rent>, +} + +pub fn handler(ctx: Context, reward_index: u8) -> ProgramResult { + let whirlpool = &mut ctx.accounts.whirlpool; + + Ok(whirlpool.initialize_reward( + reward_index as usize, + ctx.accounts.reward_mint.key(), + ctx.accounts.reward_vault.key(), + )?) +} diff --git a/programs/whirlpool/src/instructions/initialize_tick_array.rs b/programs/whirlpool/src/instructions/initialize_tick_array.rs new file mode 100644 index 0000000..aadd292 --- /dev/null +++ b/programs/whirlpool/src/instructions/initialize_tick_array.rs @@ -0,0 +1,27 @@ +use anchor_lang::prelude::*; + +use crate::state::*; + +#[derive(Accounts)] +#[instruction(start_tick_index: i32)] +pub struct InitializeTickArray<'info> { + pub whirlpool: Account<'info, Whirlpool>, + + #[account(mut)] + pub funder: Signer<'info>, + + #[account( + init, + payer = funder, + seeds = [b"tick_array", whirlpool.key().as_ref(), start_tick_index.to_string().as_bytes()], + bump, + space = TickArray::LEN)] + pub tick_array: AccountLoader<'info, TickArray>, + + pub system_program: Program<'info, System>, +} + +pub fn handler(ctx: Context, start_tick_index: i32) -> ProgramResult { + let mut tick_array = ctx.accounts.tick_array.load_init()?; + Ok(tick_array.initialize(&ctx.accounts.whirlpool, start_tick_index)?) +} diff --git a/programs/whirlpool/src/instructions/mod.rs b/programs/whirlpool/src/instructions/mod.rs new file mode 100644 index 0000000..3d93f31 --- /dev/null +++ b/programs/whirlpool/src/instructions/mod.rs @@ -0,0 +1,51 @@ +pub mod close_position; +pub mod collect_fees; +pub mod collect_protocol_fees; +pub mod collect_reward; +pub mod decrease_liquidity; +pub mod increase_liquidity; +pub mod initialize_config; +pub mod initialize_fee_tier; +pub mod initialize_pool; +pub mod initialize_reward; +pub mod initialize_tick_array; +pub mod open_position; +pub mod open_position_with_metadata; +pub mod set_collect_protocol_fees_authority; +pub mod set_default_fee_rate; +pub mod set_default_protocol_fee_rate; +pub mod set_fee_authority; +pub mod set_fee_rate; +pub mod set_protocol_fee_rate; +pub mod set_reward_authority; +pub mod set_reward_authority_by_super_authority; +pub mod set_reward_emissions; +pub mod set_reward_emissions_super_authority; +pub mod swap; +pub mod update_fees_and_rewards; + +pub use close_position::*; +pub use collect_fees::*; +pub use collect_protocol_fees::*; +pub use collect_reward::*; +pub use decrease_liquidity::*; +pub use increase_liquidity::*; +pub use initialize_config::*; +pub use initialize_fee_tier::*; +pub use initialize_pool::*; +pub use initialize_reward::*; +pub use initialize_tick_array::*; +pub use open_position::*; +pub use open_position_with_metadata::*; +pub use set_collect_protocol_fees_authority::*; +pub use set_default_fee_rate::*; +pub use set_default_protocol_fee_rate::*; +pub use set_fee_authority::*; +pub use set_fee_rate::*; +pub use set_protocol_fee_rate::*; +pub use set_reward_authority::*; +pub use set_reward_authority_by_super_authority::*; +pub use set_reward_emissions::*; +pub use set_reward_emissions_super_authority::*; +pub use swap::*; +pub use update_fees_and_rewards::*; diff --git a/programs/whirlpool/src/instructions/open_position.rs b/programs/whirlpool/src/instructions/open_position.rs new file mode 100644 index 0000000..258089a --- /dev/null +++ b/programs/whirlpool/src/instructions/open_position.rs @@ -0,0 +1,73 @@ +use anchor_lang::prelude::*; +use anchor_spl::associated_token::AssociatedToken; +use anchor_spl::token::{self, Mint, Token, TokenAccount}; + +use crate::{state::*, util::mint_position_token_and_remove_authority}; + +#[derive(Accounts)] +#[instruction(bumps: OpenPositionBumps)] +pub struct OpenPosition<'info> { + #[account(mut)] + pub funder: Signer<'info>, + + pub owner: UncheckedAccount<'info>, + + #[account(init, + payer = funder, + space = Position::LEN, + seeds = [b"position".as_ref(), position_mint.key().as_ref()], + bump = bumps.position_bump, + )] + pub position: Box>, + + #[account(init, + payer = funder, + space = Mint::LEN, + mint::authority = whirlpool, + mint::decimals = 0, + )] + pub position_mint: Account<'info, Mint>, + + #[account(init, + payer = funder, + associated_token::mint = position_mint, + associated_token::authority = owner, + )] + pub position_token_account: Box>, + + pub whirlpool: Box>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, + pub system_program: Program<'info, System>, + pub rent: Sysvar<'info, Rent>, + pub associated_token_program: Program<'info, AssociatedToken>, +} + +/* + Opens a new Whirlpool Position. +*/ +pub fn handler( + ctx: Context, + _bumps: OpenPositionBumps, + tick_lower_index: i32, + tick_upper_index: i32, +) -> ProgramResult { + let whirlpool = &ctx.accounts.whirlpool; + let position_mint = &ctx.accounts.position_mint; + let position = &mut ctx.accounts.position; + + position.open_position( + whirlpool, + position_mint.key(), + tick_lower_index, + tick_upper_index, + )?; + + mint_position_token_and_remove_authority( + whirlpool, + position_mint, + &ctx.accounts.position_token_account, + &ctx.accounts.token_program, + ) +} diff --git a/programs/whirlpool/src/instructions/open_position_with_metadata.rs b/programs/whirlpool/src/instructions/open_position_with_metadata.rs new file mode 100644 index 0000000..f39c742 --- /dev/null +++ b/programs/whirlpool/src/instructions/open_position_with_metadata.rs @@ -0,0 +1,98 @@ +use anchor_lang::prelude::*; +use anchor_spl::associated_token::AssociatedToken; +use anchor_spl::token::{self, Mint, Token, TokenAccount}; + +use crate::{state::*, util::mint_position_token_with_metadata_and_remove_authority}; + +use whirlpool_nft_update_auth::ID as WP_NFT_UPDATE_AUTH; +mod whirlpool_nft_update_auth { + use super::*; + declare_id!("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr"); +} + +#[derive(Accounts)] +#[instruction(bumps: OpenPositionWithMetadataBumps)] +pub struct OpenPositionWithMetadata<'info> { + #[account(mut)] + pub funder: Signer<'info>, + + pub owner: UncheckedAccount<'info>, + + #[account(init, + payer = funder, + space = Position::LEN, + seeds = [b"position".as_ref(), position_mint.key().as_ref()], + bump = bumps.position_bump, + )] + pub position: Box>, + + #[account(init, + payer = funder, + space = Mint::LEN, + mint::authority = whirlpool, + mint::decimals = 0, + )] + pub position_mint: Account<'info, Mint>, + + /// CHECK: checked via the Metadata CPI call + /// https://github.com/metaplex-foundation/metaplex-program-library/blob/master/token-metadata/program/src/utils.rs#L873 + #[account(mut)] + pub position_metadata_account: UncheckedAccount<'info>, + + #[account(init, + payer = funder, + associated_token::mint = position_mint, + associated_token::authority = owner, + )] + pub position_token_account: Box>, + + pub whirlpool: Box>, + + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, + pub system_program: Program<'info, System>, + pub rent: Sysvar<'info, Rent>, + pub associated_token_program: Program<'info, AssociatedToken>, + + /// CHECK: checked via account constraints + #[account(address = mpl_token_metadata::ID)] + pub metadata_program: UncheckedAccount<'info>, + + /// CHECK: checked via account constraints + #[account(address = WP_NFT_UPDATE_AUTH)] + pub metadata_update_auth: UncheckedAccount<'info>, +} + +/* + Opens a new Whirlpool Position with Metadata account. +*/ +pub fn handler( + ctx: Context, + _bumps: OpenPositionWithMetadataBumps, + tick_lower_index: i32, + tick_upper_index: i32, +) -> ProgramResult { + let whirlpool = &ctx.accounts.whirlpool; + let position_mint = &ctx.accounts.position_mint; + let position = &mut ctx.accounts.position; + + position.open_position( + whirlpool, + position_mint.key(), + tick_lower_index, + tick_upper_index, + )?; + + mint_position_token_with_metadata_and_remove_authority( + whirlpool, + position_mint, + &ctx.accounts.position_token_account, + &ctx.accounts.position_metadata_account, + &ctx.accounts.metadata_update_auth, + &ctx.accounts.funder, + &ctx.accounts.metadata_program, + &ctx.accounts.token_program, + &ctx.accounts.system_program, + &ctx.accounts.rent, + ) +} diff --git a/programs/whirlpool/src/instructions/set_collect_protocol_fees_authority.rs b/programs/whirlpool/src/instructions/set_collect_protocol_fees_authority.rs new file mode 100644 index 0000000..bf35e03 --- /dev/null +++ b/programs/whirlpool/src/instructions/set_collect_protocol_fees_authority.rs @@ -0,0 +1,23 @@ +use anchor_lang::prelude::*; + +use crate::state::WhirlpoolsConfig; + +#[derive(Accounts)] +pub struct SetCollectProtocolFeesAuthority<'info> { + #[account(mut)] + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(address = whirlpools_config.collect_protocol_fees_authority)] + pub collect_protocol_fees_authority: Signer<'info>, + + pub new_collect_protocol_fees_authority: UncheckedAccount<'info>, +} + +pub fn handler(ctx: Context) -> ProgramResult { + Ok(ctx + .accounts + .whirlpools_config + .update_collect_protocol_fees_authority( + ctx.accounts.new_collect_protocol_fees_authority.key(), + )) +} diff --git a/programs/whirlpool/src/instructions/set_default_fee_rate.rs b/programs/whirlpool/src/instructions/set_default_fee_rate.rs new file mode 100644 index 0000000..7b2c554 --- /dev/null +++ b/programs/whirlpool/src/instructions/set_default_fee_rate.rs @@ -0,0 +1,24 @@ +use anchor_lang::prelude::*; + +use crate::state::{FeeTier, WhirlpoolsConfig}; + +#[derive(Accounts)] +pub struct SetDefaultFeeRate<'info> { + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(mut, has_one = whirlpools_config)] + pub fee_tier: Account<'info, FeeTier>, + + #[account(address = whirlpools_config.fee_authority)] + pub fee_authority: Signer<'info>, +} + +/* + Updates the default fee rate on a FeeTier object. +*/ +pub fn handler(ctx: Context, default_fee_rate: u16) -> ProgramResult { + Ok(ctx + .accounts + .fee_tier + .update_default_fee_rate(default_fee_rate)?) +} diff --git a/programs/whirlpool/src/instructions/set_default_protocol_fee_rate.rs b/programs/whirlpool/src/instructions/set_default_protocol_fee_rate.rs new file mode 100644 index 0000000..ed50fdb --- /dev/null +++ b/programs/whirlpool/src/instructions/set_default_protocol_fee_rate.rs @@ -0,0 +1,22 @@ +use anchor_lang::prelude::*; + +use crate::state::WhirlpoolsConfig; + +#[derive(Accounts)] +pub struct SetDefaultProtocolFeeRate<'info> { + #[account(mut)] + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(address = whirlpools_config.fee_authority)] + pub fee_authority: Signer<'info>, +} + +pub fn handler( + ctx: Context, + default_protocol_fee_rate: u16, +) -> ProgramResult { + Ok(ctx + .accounts + .whirlpools_config + .update_default_protocol_fee_rate(default_protocol_fee_rate)?) +} diff --git a/programs/whirlpool/src/instructions/set_fee_authority.rs b/programs/whirlpool/src/instructions/set_fee_authority.rs new file mode 100644 index 0000000..3da7fd4 --- /dev/null +++ b/programs/whirlpool/src/instructions/set_fee_authority.rs @@ -0,0 +1,22 @@ +use anchor_lang::prelude::*; + +use crate::state::WhirlpoolsConfig; + +#[derive(Accounts)] +pub struct SetFeeAuthority<'info> { + #[account(mut)] + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(address = whirlpools_config.fee_authority)] + pub fee_authority: Signer<'info>, + + pub new_fee_authority: UncheckedAccount<'info>, +} + +/// Set the fee authority. Only the current fee authority has permission to invoke this instruction. +pub fn handler(ctx: Context) -> ProgramResult { + Ok(ctx + .accounts + .whirlpools_config + .update_fee_authority(ctx.accounts.new_fee_authority.key())) +} diff --git a/programs/whirlpool/src/instructions/set_fee_rate.rs b/programs/whirlpool/src/instructions/set_fee_rate.rs new file mode 100644 index 0000000..00609d5 --- /dev/null +++ b/programs/whirlpool/src/instructions/set_fee_rate.rs @@ -0,0 +1,18 @@ +use anchor_lang::prelude::*; + +use crate::state::{Whirlpool, WhirlpoolsConfig}; + +#[derive(Accounts)] +pub struct SetFeeRate<'info> { + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(mut, has_one = whirlpools_config)] + pub whirlpool: Account<'info, Whirlpool>, + + #[account(address = whirlpools_config.fee_authority)] + pub fee_authority: Signer<'info>, +} + +pub fn handler(ctx: Context, fee_rate: u16) -> ProgramResult { + Ok(ctx.accounts.whirlpool.update_fee_rate(fee_rate)?) +} diff --git a/programs/whirlpool/src/instructions/set_protocol_fee_rate.rs b/programs/whirlpool/src/instructions/set_protocol_fee_rate.rs new file mode 100644 index 0000000..e8ea032 --- /dev/null +++ b/programs/whirlpool/src/instructions/set_protocol_fee_rate.rs @@ -0,0 +1,21 @@ +use anchor_lang::prelude::*; + +use crate::state::{Whirlpool, WhirlpoolsConfig}; + +#[derive(Accounts)] +pub struct SetProtocolFeeRate<'info> { + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(mut, has_one = whirlpools_config)] + pub whirlpool: Account<'info, Whirlpool>, + + #[account(address = whirlpools_config.fee_authority)] + pub fee_authority: Signer<'info>, +} + +pub fn handler(ctx: Context, protocol_fee_rate: u16) -> ProgramResult { + Ok(ctx + .accounts + .whirlpool + .update_protocol_fee_rate(protocol_fee_rate)?) +} diff --git a/programs/whirlpool/src/instructions/set_reward_authority.rs b/programs/whirlpool/src/instructions/set_reward_authority.rs new file mode 100644 index 0000000..8f4bd1c --- /dev/null +++ b/programs/whirlpool/src/instructions/set_reward_authority.rs @@ -0,0 +1,22 @@ +use anchor_lang::prelude::*; + +use crate::state::Whirlpool; + +#[derive(Accounts)] +#[instruction(reward_index: u8)] +pub struct SetRewardAuthority<'info> { + #[account(mut)] + pub whirlpool: Account<'info, Whirlpool>, + + #[account(address = whirlpool.reward_infos[reward_index as usize].authority)] + pub reward_authority: Signer<'info>, + + pub new_reward_authority: UncheckedAccount<'info>, +} + +pub fn handler(ctx: Context, reward_index: u8) -> ProgramResult { + Ok(ctx.accounts.whirlpool.update_reward_authority( + reward_index as usize, + ctx.accounts.new_reward_authority.key(), + )?) +} diff --git a/programs/whirlpool/src/instructions/set_reward_authority_by_super_authority.rs b/programs/whirlpool/src/instructions/set_reward_authority_by_super_authority.rs new file mode 100644 index 0000000..addd683 --- /dev/null +++ b/programs/whirlpool/src/instructions/set_reward_authority_by_super_authority.rs @@ -0,0 +1,29 @@ +use anchor_lang::prelude::*; + +use crate::state::{Whirlpool, WhirlpoolsConfig}; + +#[derive(Accounts)] +#[instruction(reward_index: u8)] +pub struct SetRewardAuthorityBySuperAuthority<'info> { + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(mut, has_one = whirlpools_config)] + pub whirlpool: Account<'info, Whirlpool>, + + #[account(address = whirlpools_config.reward_emissions_super_authority)] + pub reward_emissions_super_authority: Signer<'info>, + + pub new_reward_authority: UncheckedAccount<'info>, +} + +/// Set the whirlpool reward authority at the provided `reward_index`. +/// Only the current reward emissions super authority has permission to invoke this instruction. +pub fn handler( + ctx: Context, + reward_index: u8, +) -> ProgramResult { + Ok(ctx.accounts.whirlpool.update_reward_authority( + reward_index as usize, + ctx.accounts.new_reward_authority.key(), + )?) +} diff --git a/programs/whirlpool/src/instructions/set_reward_emissions.rs b/programs/whirlpool/src/instructions/set_reward_emissions.rs new file mode 100644 index 0000000..50f4e12 --- /dev/null +++ b/programs/whirlpool/src/instructions/set_reward_emissions.rs @@ -0,0 +1,48 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::TokenAccount; + +use crate::errors::ErrorCode; +use crate::manager::whirlpool_manager::next_whirlpool_reward_infos; +use crate::math::checked_mul_shift_right; +use crate::state::Whirlpool; +use crate::util::to_timestamp_u64; + +const DAY_IN_SECONDS: u128 = 60 * 60 * 24; + +#[derive(Accounts)] +#[instruction(reward_index: u8)] +pub struct SetRewardEmissions<'info> { + #[account(mut)] + pub whirlpool: Account<'info, Whirlpool>, + + #[account(address = whirlpool.reward_infos[reward_index as usize].authority)] + pub reward_authority: Signer<'info>, + + #[account(address = whirlpool.reward_infos[reward_index as usize].vault)] + pub reward_vault: Account<'info, TokenAccount>, +} + +pub fn handler( + ctx: Context, + reward_index: u8, + emissions_per_second_x64: u128, +) -> ProgramResult { + let whirlpool = &ctx.accounts.whirlpool; + let reward_vault = &ctx.accounts.reward_vault; + + let emissions_per_day = checked_mul_shift_right(DAY_IN_SECONDS, emissions_per_second_x64)?; + if reward_vault.amount < emissions_per_day { + return Err(ErrorCode::RewardVaultAmountInsufficient.into()); + } + + let clock = Clock::get()?; + let timestamp = to_timestamp_u64(clock.unix_timestamp)?; + let next_reward_infos = next_whirlpool_reward_infos(whirlpool, timestamp)?; + + Ok(ctx.accounts.whirlpool.update_emissions( + reward_index as usize, + next_reward_infos, + timestamp, + emissions_per_second_x64, + )?) +} diff --git a/programs/whirlpool/src/instructions/set_reward_emissions_super_authority.rs b/programs/whirlpool/src/instructions/set_reward_emissions_super_authority.rs new file mode 100644 index 0000000..b64312b --- /dev/null +++ b/programs/whirlpool/src/instructions/set_reward_emissions_super_authority.rs @@ -0,0 +1,23 @@ +use anchor_lang::prelude::*; + +use crate::state::WhirlpoolsConfig; + +#[derive(Accounts)] +pub struct SetRewardEmissionsSuperAuthority<'info> { + #[account(mut)] + pub whirlpools_config: Account<'info, WhirlpoolsConfig>, + + #[account(address = whirlpools_config.reward_emissions_super_authority)] + pub reward_emissions_super_authority: Signer<'info>, + + pub new_reward_emissions_super_authority: UncheckedAccount<'info>, +} + +pub fn handler(ctx: Context) -> ProgramResult { + Ok(ctx + .accounts + .whirlpools_config + .update_reward_emissions_super_authority( + ctx.accounts.new_reward_emissions_super_authority.key(), + )) +} diff --git a/programs/whirlpool/src/instructions/swap.rs b/programs/whirlpool/src/instructions/swap.rs new file mode 100644 index 0000000..d53f5b6 --- /dev/null +++ b/programs/whirlpool/src/instructions/swap.rs @@ -0,0 +1,172 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Token, TokenAccount}; + +use crate::{ + errors::ErrorCode, + manager::swap_manager::*, + state::{TickArray, Whirlpool}, + util::{ + to_timestamp_u64, transfer_from_owner_to_vault, transfer_from_vault_to_owner, + SwapTickSequence, + }, +}; + +#[derive(Accounts)] +pub struct Swap<'info> { + #[account(address = token::ID)] + pub token_program: Program<'info, Token>, + + pub token_authority: Signer<'info>, + + #[account(mut)] + pub whirlpool: Box>, + + #[account(mut, constraint = token_owner_account_a.mint == whirlpool.token_mint_a)] + pub token_owner_account_a: Box>, + #[account(mut, address = whirlpool.token_vault_a)] + pub token_vault_a: Box>, + + #[account(mut, constraint = token_owner_account_b.mint == whirlpool.token_mint_b)] + pub token_owner_account_b: Box>, + #[account(mut, address = whirlpool.token_vault_b)] + pub token_vault_b: Box>, + + #[account(mut, has_one = whirlpool)] + pub tick_array_0: AccountLoader<'info, TickArray>, + + #[account(mut, has_one = whirlpool)] + pub tick_array_1: AccountLoader<'info, TickArray>, + + #[account(mut, has_one = whirlpool)] + pub tick_array_2: AccountLoader<'info, TickArray>, + + #[account(seeds = [b"oracle", whirlpool.key().as_ref()],bump)] + /// Oracle is currently unused and will be enabled on subsequent updates + pub oracle: UncheckedAccount<'info>, +} + +pub fn handler( + ctx: Context, + amount: u64, + other_amount_threshold: u64, + sqrt_price_limit: u128, + amount_specified_is_input: bool, + a_to_b: bool, // Zero for one +) -> ProgramResult { + let whirlpool = &mut ctx.accounts.whirlpool; + let clock = Clock::get()?; + // Update the global reward growth which increases as a function of time. + let timestamp = to_timestamp_u64(clock.unix_timestamp)?; + let mut swap_tick_sequence = SwapTickSequence::new( + ctx.accounts.tick_array_0.load_mut().unwrap(), + ctx.accounts.tick_array_1.load_mut().ok(), + ctx.accounts.tick_array_2.load_mut().ok(), + ); + + let swap_update = swap( + &whirlpool, + &mut swap_tick_sequence, + amount, + sqrt_price_limit, + amount_specified_is_input, + a_to_b, + timestamp, + )?; + + if amount_specified_is_input { + if (a_to_b && other_amount_threshold > swap_update.amount_b) + || (!a_to_b && other_amount_threshold > swap_update.amount_a) + { + return Err(ErrorCode::AmountOutBelowMinimum.into()); + } + } else { + if (a_to_b && other_amount_threshold < swap_update.amount_a) + || (!a_to_b && other_amount_threshold < swap_update.amount_b) + { + return Err(ErrorCode::AmountInAboveMaximum.into()); + } + } + + whirlpool.update_after_swap( + swap_update.next_liquidity, + swap_update.next_tick_index, + swap_update.next_sqrt_price, + swap_update.next_fee_growth_global, + swap_update.next_reward_infos, + swap_update.next_protocol_fee, + a_to_b, + timestamp, + ); + + perform_swap( + &ctx.accounts.whirlpool, + &ctx.accounts.token_authority, + &ctx.accounts.token_owner_account_a, + &ctx.accounts.token_owner_account_b, + &ctx.accounts.token_vault_a, + &ctx.accounts.token_vault_b, + &ctx.accounts.token_program, + swap_update.amount_a, + swap_update.amount_b, + a_to_b, + ) +} + +fn perform_swap<'info>( + whirlpool: &Account<'info, Whirlpool>, + token_authority: &Signer<'info>, + token_owner_account_a: &Account<'info, TokenAccount>, + token_owner_account_b: &Account<'info, TokenAccount>, + token_vault_a: &Account<'info, TokenAccount>, + token_vault_b: &Account<'info, TokenAccount>, + token_program: &Program<'info, Token>, + amount_a: u64, + amount_b: u64, + a_to_b: bool, +) -> ProgramResult { + // Transfer from user to pool + let deposit_account_user; + let deposit_account_pool; + let deposit_amount; + + // Transfer from pool to user + let withdrawal_account_user; + let withdrawal_account_pool; + let withdrawal_amount; + + if a_to_b { + deposit_account_user = token_owner_account_a; + deposit_account_pool = token_vault_a; + deposit_amount = amount_a; + + withdrawal_account_user = token_owner_account_b; + withdrawal_account_pool = token_vault_b; + withdrawal_amount = amount_b; + } else { + deposit_account_user = token_owner_account_b; + deposit_account_pool = token_vault_b; + deposit_amount = amount_b; + + withdrawal_account_user = token_owner_account_a; + withdrawal_account_pool = token_vault_a; + withdrawal_amount = amount_a; + } + + transfer_from_owner_to_vault( + token_authority, + deposit_account_user, + deposit_account_pool, + token_program, + deposit_amount, + )?; + + transfer_from_vault_to_owner( + whirlpool, + withdrawal_account_pool, + withdrawal_account_user, + token_program, + withdrawal_amount, + )?; + + Ok(()) +} diff --git a/programs/whirlpool/src/instructions/update_fees_and_rewards.rs b/programs/whirlpool/src/instructions/update_fees_and_rewards.rs new file mode 100644 index 0000000..ceda291 --- /dev/null +++ b/programs/whirlpool/src/instructions/update_fees_and_rewards.rs @@ -0,0 +1,41 @@ +use anchor_lang::prelude::ProgramResult; + +use anchor_lang::prelude::*; + +use crate::{ + manager::liquidity_manager::calculate_fee_and_reward_growths, state::*, util::to_timestamp_u64, +}; + +#[derive(Accounts)] +pub struct UpdateFeesAndRewards<'info> { + #[account(mut)] + pub whirlpool: Account<'info, Whirlpool>, + + #[account(mut, has_one = whirlpool)] + pub position: Account<'info, Position>, + + #[account(has_one = whirlpool)] + pub tick_array_lower: AccountLoader<'info, TickArray>, + #[account(has_one = whirlpool)] + pub tick_array_upper: AccountLoader<'info, TickArray>, +} + +pub fn handler(ctx: Context) -> ProgramResult { + let whirlpool = &mut ctx.accounts.whirlpool; + let position = &mut ctx.accounts.position; + let clock = Clock::get()?; + let timestamp = to_timestamp_u64(clock.unix_timestamp)?; + + let (position_update, reward_infos) = calculate_fee_and_reward_growths( + whirlpool, + position, + &ctx.accounts.tick_array_lower, + &ctx.accounts.tick_array_upper, + timestamp, + )?; + + whirlpool.update_rewards(reward_infos, timestamp); + position.update(&position_update); + + Ok(()) +} diff --git a/programs/whirlpool/src/lib.rs b/programs/whirlpool/src/lib.rs new file mode 100644 index 0000000..0c11207 --- /dev/null +++ b/programs/whirlpool/src/lib.rs @@ -0,0 +1,461 @@ +//! A concentrated liquidity AMM contract powered by Orca. +use anchor_lang::prelude::*; + +declare_id!("whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"); + +#[doc(hidden)] +pub mod constants; +#[doc(hidden)] +pub mod errors; +#[doc(hidden)] +pub mod instructions; +#[doc(hidden)] +pub mod manager; +#[doc(hidden)] +pub mod math; +pub mod state; +#[doc(hidden)] +pub mod tests; +#[doc(hidden)] +pub mod util; + +use crate::state::{OpenPositionBumps, OpenPositionWithMetadataBumps, WhirlpoolBumps}; +use instructions::*; + +#[program] +pub mod whirlpool { + use super::*; + + /// Initializes a WhirlpoolsConfig account that hosts info & authorities + /// required to govern a set of Whirlpools. + /// + /// # Parameters + /// - `fee_authority` - Authority authorized to initialize fee-tiers and set customs fees. + /// - `collect_protocol_fees_authority` - Authority authorized to collect protocol fees. + /// - `reward_emissions_super_authority` - Authority authorized to set reward authorities in pools. + pub fn initialize_config( + ctx: Context, + fee_authority: Pubkey, + collect_protocol_fees_authority: Pubkey, + reward_emissions_super_authority: Pubkey, + default_protocol_fee_rate: u16, + ) -> ProgramResult { + return instructions::initialize_config::handler( + ctx, + fee_authority, + collect_protocol_fees_authority, + reward_emissions_super_authority, + default_protocol_fee_rate, + ); + } + + /// Initializes a Whirlpool account. + /// Fee rate is set to the default values on the config and supplied fee_tier. + /// + /// # Parameters + /// - `bumps` - The bump value when deriving the PDA of the Whirlpool address. + /// - `tick_spacing` - The desired tick spacing for this pool. + /// - `initial_sqrt_price` - The desired initial sqrt-price for this pool + /// + /// # Special Errors + /// `InvalidTokenMintOrder` - The order of mints have to be ordered by + /// `SqrtPriceOutOfBounds` - provided initial_sqrt_price is not between 2^-64 to 2^64 + /// + pub fn initialize_pool( + ctx: Context, + bumps: WhirlpoolBumps, + tick_spacing: u16, + initial_sqrt_price: u128, + ) -> ProgramResult { + return instructions::initialize_pool::handler( + ctx, + bumps, + tick_spacing, + initial_sqrt_price, + ); + } + + /// Initializes a tick_array account to represent a tick-range in a Whirlpool. + /// + /// # Parameters + /// - `start_tick_index` - The starting tick index for this tick-array. + /// Has to be a multiple of TickArray size & the tick spacing of this pool. + /// + /// # Special Errors + /// - `InvalidStartTick` - if the provided start tick is out of bounds or is not a multiple of + /// TICK_ARRAY_SIZE * tick spacing. + pub fn initialize_tick_array( + ctx: Context, + start_tick_index: i32, + ) -> ProgramResult { + return instructions::initialize_tick_array::handler(ctx, start_tick_index); + } + + /// Initializes a fee_tier account usable by Whirlpools in a WhirlpoolConfig space. + /// + /// # Authority + /// - "fee_authority" - Set authority in the WhirlpoolConfig + /// + /// # Parameters + /// - `tick_spacing` - The tick-spacing that this fee-tier suggests the default_fee_rate for. + /// - `default_fee_rate` - The default fee rate that a pool will use if the pool uses this + /// fee tier during initialization. + /// + /// # Special Errors + /// - `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE. + pub fn initialize_fee_tier( + ctx: Context, + tick_spacing: u16, + default_fee_rate: u16, + ) -> ProgramResult { + return instructions::initialize_fee_tier::handler(ctx, tick_spacing, default_fee_rate); + } + + /// Initialize reward for a Whirlpool. A pool can only support up to a set number of rewards. + /// + /// # Authority + /// - "reward_authority" - assigned authority by the reward_super_authority for the specified + /// reward-index in this Whirlpool + /// + /// # Parameters + /// - `reward_index` - The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS) + /// + /// # Special Errors + /// - `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized + /// index in this pool, or exceeds NUM_REWARDS, or + /// all reward slots for this pool has been initialized. + pub fn initialize_reward(ctx: Context, reward_index: u8) -> ProgramResult { + return instructions::initialize_reward::handler(ctx, reward_index); + } + + /// Set the reward emissions for a reward in a Whirlpool. + /// + /// # Authority + /// - "reward_authority" - assigned authority by the reward_super_authority for the specified + /// reward-index in this Whirlpool + /// + /// # Parameters + /// - `reward_index` - The reward index (0 <= index <= NUM_REWARDS) that we'd like to modify. + /// - `emissions_per_second_x64` - The amount of rewards emitted in this pool. + /// + /// # Special Errors + /// - `RewardVaultAmountInsufficient` - The amount of rewards in the reward vault cannot emit + /// more than a day of desired emissions. + /// - `InvalidTimestamp` - Provided timestamp is not in order with the previous timestamp. + /// - `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized + /// index in this pool, or exceeds NUM_REWARDS, or + /// all reward slots for this pool has been initialized. + pub fn set_reward_emissions( + ctx: Context, + reward_index: u8, + emissions_per_second_x64: u128, + ) -> ProgramResult { + return instructions::set_reward_emissions::handler( + ctx, + reward_index, + emissions_per_second_x64, + ); + } + + /// Open a position in a Whirlpool. A unique token will be minted to represent the position + /// in the users wallet. The position will start off with 0 liquidity. + /// + /// # Parameters + /// - `tick_lower_index` - The tick specifying the lower end of the position range. + /// - `tick_upper_index` - The tick specifying the upper end of the position range. + /// + /// # Special Errors + /// - `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of + /// the tick-spacing in this pool. + pub fn open_position( + ctx: Context, + bumps: OpenPositionBumps, + tick_lower_index: i32, + tick_upper_index: i32, + ) -> ProgramResult { + return instructions::open_position::handler( + ctx, + bumps, + tick_lower_index, + tick_upper_index, + ); + } + + /// Open a position in a Whirlpool. A unique token will be minted to represent the position + /// in the users wallet. Additional Metaplex metadata is appended to identify the token. + /// The position will start off with 0 liquidity. + /// + /// # Parameters + /// - `tick_lower_index` - The tick specifying the lower end of the position range. + /// - `tick_upper_index` - The tick specifying the upper end of the position range. + /// + /// # Special Errors + /// - `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of + /// the tick-spacing in this pool. + pub fn open_position_with_metadata( + ctx: Context, + bumps: OpenPositionWithMetadataBumps, + tick_lower_index: i32, + tick_upper_index: i32, + ) -> ProgramResult { + return instructions::open_position_with_metadata::handler( + ctx, + bumps, + tick_lower_index, + tick_upper_index, + ); + } + + /// Add liquidity to a position in the Whirlpool. + /// + /// # Authority + /// - `position_authority` - authority that owns the token corresponding to this desired position. + /// + /// # Parameters + /// - `liquidity_amount` - The total amount of Liquidity the user is willing to deposit. + /// - `token_max_a` - The maximum amount of tokenA the user is willing to deposit. + /// - `token_max_b` - The maximum amount of tokenB the user is willing to deposit. + /// + /// # Special Errors + /// - `LiquidityZero` - Provided liquidity amount is zero. + /// - `LiquidityTooHigh` - Provided liquidity exceeds u128::max. + /// - `TokenMaxExceeded` - The required token to perform this operation exceeds the user defined amount. + pub fn increase_liquidity( + ctx: Context, + liquidity_amount: u128, + token_max_a: u64, + token_max_b: u64, + ) -> ProgramResult { + return instructions::increase_liquidity::handler( + ctx, + liquidity_amount, + token_max_a, + token_max_b, + ); + } + + /// Withdraw liquidity from a position in the Whirlpool. + /// + /// # Authority + /// - `position_authority` - authority that owns the token corresponding to this desired position. + /// + /// # Parameters + /// - `liquidity_amount` - The total amount of Liquidity the user desires to withdraw. + /// - `token_min_a` - The minimum amount of tokenA the user is willing to withdraw. + /// - `token_min_b` - The minimum amount of tokenB the user is willing to withdraw. + /// + /// # Special Errors + /// - `LiquidityZero` - Provided liquidity amount is zero. + /// - `LiquidityTooHigh` - Provided liquidity exceeds u128::max. + /// - `TokenMinSubceeded` - The required token to perform this operation subceeds the user defined amount. + pub fn decrease_liquidity( + ctx: Context, + liquidity_amount: u128, + token_min_a: u64, + token_min_b: u64, + ) -> ProgramResult { + return instructions::decrease_liquidity::handler( + ctx, + liquidity_amount, + token_min_a, + token_min_b, + ); + } + + /// Update the accrued fees and rewards for a position. + /// + /// # Special Errors + /// - `TickNotFound` - Provided tick array account does not contain the tick for this position. + /// - `LiquidityZero` - Position has zero liquidity and therefore already has the most updated fees and reward values. + pub fn update_fees_and_rewards(ctx: Context) -> ProgramResult { + return instructions::update_fees_and_rewards::handler(ctx); + } + + /// Collect fees accrued for this position. + /// + /// # Authority + /// - `position_authority` - authority that owns the token corresponding to this desired position. + pub fn collect_fees(ctx: Context) -> ProgramResult { + return instructions::collect_fees::handler(ctx); + } + + /// Collect rewards accrued for this position. + /// + /// # Authority + /// - `position_authority` - authority that owns the token corresponding to this desired position. + pub fn collect_reward(ctx: Context, reward_index: u8) -> ProgramResult { + return instructions::collect_reward::handler(ctx, reward_index); + } + + /// Collect the protocol fees accrued in this Whirlpool + /// + /// # Authority + /// - `collect_protocol_fees_authority` - assigned authority in the WhirlpoolConfig that can collect protocol fees + pub fn collect_protocol_fees(ctx: Context) -> ProgramResult { + return instructions::collect_protocol_fees::handler(ctx); + } + + /// Perform a swap in this Whirlpool + /// + /// # Parameters + /// - `amount` + /// - `other_amount_threshold` + /// - `sqrt_price_limit` + /// - `exact_input` + /// - `a_to_b` + pub fn swap( + ctx: Context, + amount: u64, + other_amount_threshold: u64, + sqrt_price_limit: u128, + exact_input: bool, + a_to_b: bool, + ) -> ProgramResult { + return instructions::swap::handler( + ctx, + amount, + other_amount_threshold, + sqrt_price_limit, + exact_input, + a_to_b, + ); + } + + pub fn close_position(ctx: Context) -> ProgramResult { + return instructions::close_position::handler(ctx); + } + + /// Set the default_fee_rate for a FeeTier + /// Only the current fee authority has permission to invoke this instruction. + /// + /// # Authority + /// - "fee_authority" - Set authority in the WhirlpoolConfig + /// + /// # Parameters + /// - `default_fee_rate` - The default fee rate that a pool will use if the pool uses this + /// fee tier during initialization. + /// + /// # Special Errors + /// - `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE. + pub fn set_default_fee_rate( + ctx: Context, + default_fee_rate: u16, + ) -> ProgramResult { + return instructions::set_default_fee_rate::handler(ctx, default_fee_rate); + } + + /// Sets the default protocol fee rate for a WhirlpoolConfig + /// Protocol fee rate is represented as a basis point. + /// Only the current fee authority has permission to invoke this instruction. + /// + /// # Authority + /// - "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig + /// + /// # Parameters + /// - `default_protocol_fee_rate` - Rate that is referenced during the initialization of a Whirlpool using this config. + /// + /// # Special Errors + /// - `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE. + pub fn set_default_protocol_fee_rate( + ctx: Context, + default_protocol_fee_rate: u16, + ) -> ProgramResult { + return instructions::set_default_protocol_fee_rate::handler( + ctx, + default_protocol_fee_rate, + ); + } + + /// Sets the fee rate for a Whirlpool. + /// Fee rate is represented as hundredths of a basis point. + /// Only the current fee authority has permission to invoke this instruction. + /// + /// # Authority + /// - "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig + /// + /// # Parameters + /// - `fee_rate` - The rate that the pool will use to calculate fees going onwards. + /// + /// # Special Errors + /// - `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE. + pub fn set_fee_rate(ctx: Context, fee_rate: u16) -> ProgramResult { + return instructions::set_fee_rate::handler(ctx, fee_rate); + } + + /// Sets the protocol fee rate for a Whirlpool. + /// Protocol fee rate is represented as a basis point. + /// Only the current fee authority has permission to invoke this instruction. + /// + /// # Authority + /// - "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig + /// + /// # Parameters + /// - `protocol_fee_rate` - The rate that the pool will use to calculate protocol fees going onwards. + /// + /// # Special Errors + /// - `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE. + pub fn set_protocol_fee_rate( + ctx: Context, + protocol_fee_rate: u16, + ) -> ProgramResult { + return instructions::set_protocol_fee_rate::handler(ctx, protocol_fee_rate); + } + + /// Sets the fee authority for a WhirlpoolConfig. + /// The fee authority can set the fee & protocol fee rate for individual pools or + /// set the default fee rate for newly minted pools. + /// Only the current collect fee authority has permission to invoke this instruction. + /// + /// # Authority + /// - "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig + pub fn set_fee_authority(ctx: Context) -> ProgramResult { + return instructions::set_fee_authority::handler(ctx); + } + + /// Sets the fee authority to collect protocol fees for a WhirlpoolConfig. + /// Only the current collect protocol fee authority has permission to invoke this instruction. + /// + /// # Authority + /// - "fee_authority" - Set authority that can collect protocol fees in the WhirlpoolConfig + pub fn set_collect_protocol_fees_authority( + ctx: Context, + ) -> ProgramResult { + return instructions::set_collect_protocol_fees_authority::handler(ctx); + } + + /// Set the whirlpool reward authority at the provided `reward_index`. + /// Only the current reward authority for this reward index has permission to invoke this instruction. + /// + /// # Authority + /// - "reward_authority" - Set authority that can control reward emission for this particular reward. + pub fn set_reward_authority( + ctx: Context, + reward_index: u8, + ) -> ProgramResult { + return instructions::set_reward_authority::handler(ctx, reward_index); + } + + /// Set the whirlpool reward authority at the provided `reward_index`. + /// Only the current reward super authority has permission to invoke this instruction. + /// + /// # Authority + /// - "reward_authority" - Set authority that can control reward emission for this particular reward. + pub fn set_reward_authority_by_super_authority( + ctx: Context, + reward_index: u8, + ) -> ProgramResult { + return instructions::set_reward_authority_by_super_authority::handler(ctx, reward_index); + } + + /// Set the whirlpool reward super authority for a WhirlpoolConfig + /// Only the current reward super authority has permission to invoke this instruction. + /// This instruction will not change the authority on any `WhirlpoolRewardInfo` whirlpool rewards. + /// + /// # Authority + /// - "reward_emissions_super_authority" - Set authority that can control reward authorities for all pools in this config space. + pub fn set_reward_emissions_super_authority( + ctx: Context, + ) -> ProgramResult { + return instructions::set_reward_emissions_super_authority::handler(ctx); + } +} diff --git a/programs/whirlpool/src/manager/liquidity_manager.rs b/programs/whirlpool/src/manager/liquidity_manager.rs new file mode 100644 index 0000000..5e60793 --- /dev/null +++ b/programs/whirlpool/src/manager/liquidity_manager.rs @@ -0,0 +1,3601 @@ +use super::{ + position_manager::next_position_modify_liquidity_update, + tick_manager::{ + next_fee_growths_inside, next_reward_growths_inside, next_tick_modify_liquidity_update, + }, + whirlpool_manager::{next_whirlpool_liquidity, next_whirlpool_reward_infos}, +}; +use crate::{ + errors::ErrorCode, + math::{get_amount_delta_a, get_amount_delta_b, sqrt_price_from_tick_index}, + state::*, +}; +use anchor_lang::prelude::{AccountLoader, ProgramError}; + +#[derive(Debug)] +pub struct ModifyLiquidityUpdate { + pub whirlpool_liquidity: u128, + pub tick_lower_update: TickUpdate, + pub tick_upper_update: TickUpdate, + pub reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + pub position_update: PositionUpdate, +} + +// Calculates state after modifying liquidity by the liquidity_delta for the given positon. +// Fee and reward growths will also be calculated by this function. +// To trigger only calculation of fee and reward growths, use calculate_fee_and_reward_growths. +pub fn calculate_modify_liquidity<'info>( + whirlpool: &Whirlpool, + position: &Position, + tick_array_lower: &AccountLoader<'info, TickArray>, + tick_array_upper: &AccountLoader<'info, TickArray>, + liquidity_delta: i128, + timestamp: u64, +) -> Result { + let tick_array_lower = tick_array_lower.load()?; + let tick_lower = + tick_array_lower.get_tick(position.tick_lower_index, whirlpool.tick_spacing)?; + + let tick_array_upper = tick_array_upper.load()?; + let tick_upper = + tick_array_upper.get_tick(position.tick_upper_index, whirlpool.tick_spacing)?; + + Ok(_calculate_modify_liquidity( + whirlpool, + position, + tick_lower, + tick_upper, + position.tick_lower_index, + position.tick_upper_index, + liquidity_delta, + timestamp, + )?) +} + +pub fn calculate_fee_and_reward_growths<'info>( + whirlpool: &Whirlpool, + position: &Position, + tick_array_lower: &AccountLoader<'info, TickArray>, + tick_array_upper: &AccountLoader<'info, TickArray>, + timestamp: u64, +) -> Result<(PositionUpdate, [WhirlpoolRewardInfo; NUM_REWARDS]), ProgramError> { + let tick_array_lower = tick_array_lower.load()?; + let tick_lower = + tick_array_lower.get_tick(position.tick_lower_index, whirlpool.tick_spacing)?; + + let tick_array_upper = tick_array_upper.load()?; + let tick_upper = + tick_array_upper.get_tick(position.tick_upper_index, whirlpool.tick_spacing)?; + + // Pass in a liquidity_delta value of 0 to trigger only calculations for fee and reward growths. + // Calculating fees and rewards for positions with zero liquidity will result in an error. + let update = _calculate_modify_liquidity( + whirlpool, + position, + tick_lower, + tick_upper, + position.tick_lower_index, + position.tick_upper_index, + 0, + timestamp, + )?; + Ok((update.position_update, update.reward_infos)) +} + +// Calculates the state changes after modifying liquidity of a whirlpool position. +fn _calculate_modify_liquidity( + whirlpool: &Whirlpool, + position: &Position, + tick_lower: &Tick, + tick_upper: &Tick, + tick_lower_index: i32, + tick_upper_index: i32, + liquidity_delta: i128, + timestamp: u64, +) -> Result { + // Disallow only updating position fee and reward growth when position has zero liquidity + if liquidity_delta == 0 && position.liquidity == 0 { + return Err(ErrorCode::LiquidityZero.into()); + } + + let next_reward_infos = next_whirlpool_reward_infos(whirlpool, timestamp)?; + + let next_global_liquidity = next_whirlpool_liquidity( + whirlpool, + position.tick_upper_index, + position.tick_lower_index, + liquidity_delta, + )?; + + let tick_lower_update = next_tick_modify_liquidity_update( + tick_lower, + tick_lower_index, + whirlpool.tick_current_index, + whirlpool.fee_growth_global_a, + whirlpool.fee_growth_global_b, + &next_reward_infos, + liquidity_delta, + false, + )?; + + let tick_upper_update = next_tick_modify_liquidity_update( + tick_upper, + tick_upper_index, + whirlpool.tick_current_index, + whirlpool.fee_growth_global_a, + whirlpool.fee_growth_global_b, + &next_reward_infos, + liquidity_delta, + true, + )?; + + let (fee_growth_inside_a, fee_growth_inside_b) = next_fee_growths_inside( + whirlpool.tick_current_index, + tick_lower, + tick_lower_index, + tick_upper, + tick_upper_index, + whirlpool.fee_growth_global_a, + whirlpool.fee_growth_global_b, + ); + + let reward_growths_inside = next_reward_growths_inside( + whirlpool.tick_current_index, + tick_lower, + tick_lower_index, + tick_upper, + tick_upper_index, + &next_reward_infos, + ); + + let position_update = next_position_modify_liquidity_update( + position, + liquidity_delta, + fee_growth_inside_a, + fee_growth_inside_b, + &reward_growths_inside, + )?; + + Ok(ModifyLiquidityUpdate { + whirlpool_liquidity: next_global_liquidity, + reward_infos: next_reward_infos, + position_update, + tick_lower_update, + tick_upper_update, + }) +} + +pub fn calculate_liquidity_token_deltas( + current_tick_index: i32, + sqrt_price: u128, + position: &Position, + liquidity_delta: i128, +) -> Result<(u64, u64), ErrorCode> { + if liquidity_delta == 0 { + return Err(ErrorCode::LiquidityZero.into()); + } + + let mut delta_a: u64 = 0; + let mut delta_b: u64 = 0; + + let liquidity: u128 = liquidity_delta.abs() as u128; + let round_up = liquidity_delta > 0; + + let lower_price = sqrt_price_from_tick_index(position.tick_lower_index); + let upper_price = sqrt_price_from_tick_index(position.tick_upper_index); + + if current_tick_index < position.tick_lower_index { + // current tick below position + delta_a = get_amount_delta_a(lower_price, upper_price, liquidity, round_up)?; + } else if current_tick_index < position.tick_upper_index { + // current tick inside position + delta_a = get_amount_delta_a(sqrt_price, upper_price, liquidity, round_up)?; + delta_b = get_amount_delta_b(lower_price, sqrt_price, liquidity, round_up)?; + } else { + // current tick above position + delta_b = get_amount_delta_b(lower_price, upper_price, liquidity, round_up)?; + } + + Ok((delta_a, delta_b)) +} + +pub fn sync_modify_liquidity_values<'info>( + whirlpool: &mut Whirlpool, + position: &mut Position, + tick_array_lower: &AccountLoader<'info, TickArray>, + tick_array_upper: &AccountLoader<'info, TickArray>, + modify_liquidity_update: ModifyLiquidityUpdate, + reward_last_updated_timestamp: u64, +) -> Result<(), ProgramError> { + position.update(&modify_liquidity_update.position_update); + + tick_array_lower.load_mut()?.update_tick( + position.tick_lower_index, + whirlpool.tick_spacing, + &modify_liquidity_update.tick_lower_update, + )?; + + tick_array_upper.load_mut()?.update_tick( + position.tick_upper_index, + whirlpool.tick_spacing, + &modify_liquidity_update.tick_upper_update, + )?; + + whirlpool.update_rewards_and_liquidity( + modify_liquidity_update.reward_infos, + modify_liquidity_update.whirlpool_liquidity, + reward_last_updated_timestamp, + ); + + Ok(()) +} + +#[cfg(test)] +mod calculate_modify_liquidity_unit_tests { + // Test position start => end state transitions after applying possible liquidity_delta values. + // x => position has no liquidity + // o => position has non-zero liquidity + // x => tick is not initialized + // o => tick is initialized + // ox_position indicates position with liquidity has zero liquidity after modifying liquidity + // xo_lower indicates lower tick was initialized after modifying liquidity + + // Position with zero liquidity remains in zero liquidity state + // Only possible with negative and zero liquidity delta values which all result in errors + // Current tick index location relative to position does not matter + mod xx_position { + use crate::{manager::liquidity_manager::_calculate_modify_liquidity, util::*}; + + // Zero liquidity delta on position with zero liquidity is not allowed + #[test] + #[should_panic(expected = "LiquidityZero")] + fn zero_delta_on_empty_position_not_allowed() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: 0, + fee_growth_global_b: 0, + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 100, + ) + .unwrap(); + } + + // Removing liquidity from position with zero liquidity results in error + // LiquidityUnderflow from lower tick (xx_oo) + #[test] + #[should_panic(expected = "LiquidityUnderflow")] + fn neg_delta_lower_tick_liquidity_underflow() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: 0, + fee_growth_global_b: 0, + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + } + + // Removing liquidity from position with zero liquidity results in error + // LiquidityUnderflow from upper tick (oo_xx) + #[test] + #[should_panic(expected = "LiquidityUnderflow")] + fn neg_delta_upper_tick_liquidity_underflow() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: 0, + fee_growth_global_b: 0, + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + } + + // Removing liquidity from position with zero liquidity results in error + // LiquidityUnderflow from updating position (oo_oo - not ticks) + #[test] + #[should_panic(expected = "LiquidityUnderflow")] + fn neg_delta_position_liquidity_underflow() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: 0, + fee_growth_global_b: 0, + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + } + } + + // Position with zero liquidity transitions to positive liquidity + // Only possible with positive liquidity delta values + mod xo_position { + + // Current tick below position + // Whirlpool virtual liquidity does not change + mod current_tick_below { + use crate::{ + manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*, + }; + + // Position liquidity increase, checkpoint zero values + // Lower tick initialized, liquidity increase, checkpoint zero values + // Upper tick initialized, liquidity increase, checkpoint zero values + #[test] + fn pos_delta_current_tick_below_xo_lower_xo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: -10, + ..Default::default() + }, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + }, + ); + } + + // Position liquidity increase, checkpoint zero values + // Lower tick initialized, liquidity increase, checkpoint zero values + // Upper tick already initialized, liquidity increase + #[test] + fn pos_delta_current_tick_below_xo_lower_oo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + ..Default::default() + }, + }, + ); + } + + // Position liquidity increase, checkpoint underflowed values + // Lower tick initialized, liquidity increase, checkpoint zero values + // Upper tick already initialized, has non-zero checkpoint values + // Simulates two left tick crossings in order to reach underflow edge case + #[test] + fn pos_delta_current_tick_below_xo_lower_oo_upper_underflow() { + // Underflow occurs when the lower tick is newly initialized and the upper tick + // is already initialized with non-zero growth checkpoints. + + // The upper tick only has non-zero checkpoints when it was either 1) initialized + // when current tick is above or 2) when it was crossed after some global fee growth + // occurred. + + // This test simulates two tick crossings from right to left before adding liquidity + // to the position. + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(10), + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + test.increment_whirlpool_reward_growths_by_time(100); + test.cross_tick(TickLabel::Upper, Direction::Left); + // Check crossing an upper tick with liquidity added new whirlpool liquidity + assert_eq!(test.whirlpool.liquidity, 110); + // 1 = 0 + (100/100) + assert_whirlpool_reward_growths(&test.whirlpool.reward_infos, to_x64(1)); + test.increment_whirlpool_fee_growths(to_x64(10), to_x64(10)); + test.increment_whirlpool_reward_growths_by_time(100); + test.cross_tick(TickLabel::Lower, Direction::Left); + // Lower tick has 0 net liquidity, so crossing does not affect whirlpool liquidity + assert_eq!(test.whirlpool.liquidity, 110); + // 1.909 = 1 + (100/110) + assert_whirlpool_reward_growths(&test.whirlpool.reward_infos, 35216511413445507630); + + // Create position which initializes the lower tick + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 300, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + // Current tick below position, so does not add to whirlpool liquidity + whirlpool_liquidity: 110, + // 2.8181 = 1.909 + 0.909 + whirlpool_reward_growths: create_reward_growths(51986278753181463644), + position_update: PositionUpdate { + liquidity: 10, + // Wrapped underflow -10 = 20 - (20 - 0) - (10) + fee_growth_checkpoint_a: 340282366920938463278907166694672695296, + // Wrapped underflow -10 + fee_growth_checkpoint_b: 340282366920938463278907166694672695296, + reward_infos: create_position_reward_infos( + 340282366920938463444927863358058659840, + 0, + ), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(10), + reward_growths_outside: create_reward_growths(to_x64(1)), + }, + }, + ); + } + + // Position liquidity increase, checkpoint zero values + // Lower tick already initialized, liquidity increase + // Upper tick already initialized, liquidity increase, checkpoint zero values + #[test] + fn pos_delta_current_tick_below_oo_lower_xo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: -10, + ..Default::default() + }, + }, + ); + } + + // Position liquidity increase, checkpoint zero values + // Lower tick already initialized, liquidity increase + // Upper tick already initialized, liquidity increase + #[test] + fn pos_delta_current_tick_below_oo_lower_oo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + ..Default::default() + }, + }, + ); + } + } + + // Current tick inside position + // Whirlpool virtual liquidity increases + mod current_tick_inside { + use crate::{ + manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*, + }; + + // Position liquidity increase, checkpoint zero values + // Lower tick initialized, liquidity increase, checkpoint current values + // Upper tick initialized, liquidity increase, checkpoint zero values + #[test] + fn pos_delta_current_tick_inside_xo_lower_xo_upper() { + // Both ticks are uninitialized. This is the first position to use this tick range + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: 0, + fee_growth_global_b: 0, + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 110, + whirlpool_reward_growths: create_reward_growths(to_x64(1)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + reward_growths_outside: create_reward_growths(to_x64(1)), + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: -10, + ..Default::default() + }, + }, + ); + } + + // Position liquidity increase, checkpoint zero values + // Lower tick initialized, liquidity increase, checkpoint current values + // Upper already initialized, liquidity increase + #[test] + fn pos_delta_current_tick_inside_xo_lower_oo_upper() { + // This is the first position to use this tick range + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 110, + whirlpool_reward_growths: create_reward_growths(to_x64(1)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(1)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + ..Default::default() + }, + }, + ); + } + + // Position liquidity increase, checkpoint underflowed values + // Lower tick initialized, liquidity increase, checkpoint current values + // Upper already initialized, liquidity increase + // Simulates one left tick crossings in order to reach underflow edge case + #[test] + fn pos_delta_current_tick_inside_xo_lower_oo_upper_underflow() { + // Underflow occurs when the lower tick is newly initialized and the upper tick + // is already initialized with non-zero growth checkpoints. + + // The upper tick only has non-zero checkpoints when it was either 1) initialized + // when current tick is above or 2) when it was crossed after some global fee growth + // occurred. + + // This test simulates one tick crossing from left to right before adding liquidity + // to the position. + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(10), + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + test.increment_whirlpool_reward_growths_by_time(100); + test.cross_tick(TickLabel::Upper, Direction::Left); + // Check crossing an upper tick with liquidity added new whirlpool liquidity + assert_eq!(test.whirlpool.liquidity, 110); + // 1 = 0 + (100/100) + assert_whirlpool_reward_growths(&test.whirlpool.reward_infos, to_x64(1)); + + // Create position which initializes the lower tick + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 200, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + // Current tick inside position, so whirlpool liquidity increases + whirlpool_liquidity: 120, + // 1.909 = 1 + 0.909 + whirlpool_reward_growths: create_reward_growths(35216511413445507630), + position_update: PositionUpdate { + liquidity: 10, + // Wrapped underflow -10 + fee_growth_checkpoint_a: 340282366920938463278907166694672695296, + // Wrapped underflow -10 + fee_growth_checkpoint_b: 340282366920938463278907166694672695296, + reward_infos: create_position_reward_infos( + 340282366920938463444927863358058659840, + 0, + ), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(10), + // 1.909 + reward_growths_outside: create_reward_growths(35216511413445507630), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(10), + reward_growths_outside: create_reward_growths(to_x64(1)), + }, + }, + ); + } + + // Position liquidity increase, checkpoint current inside growth values + // Lower tick already initialized, liquidity increase + // Upper tick initialized, liquidity increase, checkpoint zero values + #[test] + fn pos_delta_current_tick_inside_oo_lower_xo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 110, + whirlpool_reward_growths: create_reward_growths(to_x64(1)), + position_update: PositionUpdate { + liquidity: 10, + fee_growth_checkpoint_a: to_x64(10), + fee_growth_checkpoint_b: to_x64(20), + reward_infos: create_position_reward_infos(to_x64(1), 0), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: -10, + ..Default::default() + }, + }, + ); + } + + // Position liquidity increase, checkpoint current inside growth values + // Lower tick already initialized, liquidity increase + // Upper tick already initialized, liquidity increase + #[test] + fn pos_delta_current_tick_inside_oo_lower_oo_upper() { + // Ticks already initialized with liquidity from other position + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 110, + whirlpool_reward_growths: create_reward_growths(to_x64(1)), + position_update: PositionUpdate { + liquidity: 10, + fee_growth_checkpoint_a: to_x64(10), + fee_growth_checkpoint_b: to_x64(20), + reward_infos: create_position_reward_infos(to_x64(1), 0), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + ..Default::default() + }, + }, + ); + } + } + + // Current tick above position + // Whirlpool virtual liquidity does not change + mod current_tick_above { + use crate::{ + manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*, + }; + + // Position liquidity increase, checkpoint zero values + // Lower tick initialized, liquidity increase, checkpoint current values + // Upper tick initialized, liquidity increase, checkpoint current values + #[test] + fn pos_delta_current_tick_above_xo_lower_xo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(3)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: -10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(3)), + }, + }, + ); + } + + // Position liquidity increase, checkpoint underflowed values + // Lower tick initialized, liquidity increase, checkpoint current values + // Upper tick already initialized, liquidity increase + #[test] + fn pos_delta_current_tick_above_xo_lower_oo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + // Wrapped underflow -10 + fee_growth_checkpoint_a: 340282366920938463278907166694672695296, + // Wrapped underflow -20 + fee_growth_checkpoint_b: 340282366920938463094439725957577179136, + reward_infos: create_position_reward_infos( + 340282366920938463408034375210639556608, + 0, + ), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(3)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + ..Default::default() + }, + }, + ); + } + + // Adds liquidity to a new position where the checkpoints underflow. + // Simulates the whirlpool current tick moving below the upper tick, accruing fees + // and rewards, and then moving back above the tick. The calculated owed token amounts + // are verified to be correct with underflowed checkpoints. + #[test] + fn pos_delta_current_tick_above_xo_lower_oo_upper_underflow_owed_amounts_ok() { + // l < u < c, t = 0 to 100 + // global fee growth a: 10, fee growth b: 10, rewards: 1 + // create new position with 10 liquidity + // lower tick initialized now - checkpoint current growths + // upper tick already initialized with zero value checkpoints + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(10), + reward_infos: create_whirlpool_reward_infos(to_x64(1), 0), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(1)), + position_update: PositionUpdate { + liquidity: 10, + // Wrapped underflow -10 + fee_growth_checkpoint_a: 340282366920938463278907166694672695296, + // Wrapped underflow -10 + fee_growth_checkpoint_b: 340282366920938463278907166694672695296, + reward_infos: create_position_reward_infos( + 340282366920938463444927863358058659840, + 0, + ), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(10), + reward_growths_outside: create_reward_growths(to_x64(1)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + ..Default::default() + }, + }, + ); + test.apply_update(&update, 100); + + // l < c < u, t = 100 to 200 + // simulate crossing upper tick from right to left (price decrease) + // global fee growth a: 20, fee growth b: 20 + // upper tick checkpoints are inverted + // -120, 0, 120 + test.increment_whirlpool_fee_growths(to_x64(10), to_x64(10)); + test.increment_whirlpool_reward_growths_by_time(100); + test.cross_tick(TickLabel::Upper, Direction::Left); + + assert_whirlpool_reward_growths(&test.whirlpool.reward_infos, to_x64(2)); + assert_eq!( + test.tick_upper, + Tick { + initialized: true, + liquidity_net: -20, + liquidity_gross: 20, + // 20 = 20 - 0 + fee_growth_outside_a: to_x64(20), + // 20 = 20 - 0 + fee_growth_outside_b: to_x64(20), + // 2 = (1 + (100/100)) - 0 + reward_growths_outside: create_reward_growths(to_x64(2)), + ..Default::default() + } + ); + + // l < u < c, t = 200 to 300 + // simulate crossing upper tick from left to right (price increase) + // global fee growth a: 35, fee growth b: 35 + // upper tick checkpoints are inverted + test.increment_whirlpool_fee_growths(to_x64(15), to_x64(15)); + test.increment_whirlpool_reward_growths_by_time(100); + // 2.83 = 2 + 100/120 + assert_whirlpool_reward_growths(&test.whirlpool.reward_infos, 52265774875510396245); + + test.cross_tick(TickLabel::Upper, Direction::Right); + assert_eq!( + test.tick_upper, + Tick { + initialized: true, + liquidity_net: -20, + liquidity_gross: 20, + // 15 = 35 - 20 + fee_growth_outside_a: to_x64(15), + // 15 = 35 - 20 + fee_growth_outside_b: to_x64(15), + // 0.83 = 2.83 - 2 + reward_growths_outside: create_reward_growths(15372286728091293013), + } + ); + + // t = 300 to 400, recalculate position fees/rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 400, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + // 3.83 = 2.83 + 100/100 + whirlpool_reward_growths: create_reward_growths(70712518949219947861), + position_update: PositionUpdate { + liquidity: 10, + fee_growth_checkpoint_a: to_x64(5), + fee_owed_a: 150, + fee_growth_checkpoint_b: to_x64(5), + fee_owed_b: 150, + reward_infos: create_position_reward_infos( + 340282366920938463460300150086149952853, + // 8 = 0.83 * 10 + 8, + ), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(10), + reward_growths_outside: create_reward_growths(to_x64(1)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -20, + liquidity_gross: 20, + // 15 + fee_growth_outside_a: to_x64(15), + // 15 + fee_growth_outside_b: to_x64(15), + // 0.83 + reward_growths_outside: create_reward_growths(15372286728091293013), + }, + }, + ); + } + + // Position liquidity increase, checkpoint current values + // Lower tick already initialized, liquidity increase + // Upper tick initialized, liquidity increase, checkpoint current values + #[test] + fn pos_delta_current_tick_above_oo_lower_xo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + fee_growth_checkpoint_a: to_x64(10), + fee_growth_checkpoint_b: to_x64(20), + reward_infos: create_position_reward_infos(to_x64(3), 0), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: -10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(3)), + }, + }, + ); + } + + // Position liquidity increase, checkpoint zero values + // Lower tick already initialized, liquidity increase + // Upper tick already initialized, liquidity increase + #[test] + fn pos_delta_current_tick_above_oo_lower_oo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + ..Default::default() + }, + }, + ); + } + + // Use non-zero checkpoints for already initialized ticks + // Position liquidity increase, checkpoint current fee growth inside values + // Lower tick already initialized, liquidity increase + // Upper tick already initialized, liquidity increase + #[test] + fn pos_delta_current_tick_above_oo_lower_oo_upper_non_zero_checkpoints() { + // Test fixture is set up to simulate whirlpool at state T1. + // T0 - current tick inside position, global fees at 10, rewards at 1. + // - Some other position already exists using these tick bounds. + // - Price gets pushed above upper tick. + // T1 - current tick above position, global fees at 20, rewards at 2. + // - Deposit liquidity into new position. + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(20), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + + test.whirlpool.reward_last_updated_timestamp = 200; + test.tick_lower.fee_growth_outside_a = to_x64(10); + test.tick_lower.fee_growth_outside_b = to_x64(10); + test.tick_lower.reward_growths_outside = create_reward_growths(to_x64(1)); + test.tick_upper.fee_growth_outside_a = to_x64(20); + test.tick_upper.fee_growth_outside_b = to_x64(20); + test.tick_upper.reward_growths_outside = create_reward_growths(to_x64(2)); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 300, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + fee_growth_checkpoint_a: to_x64(10), + fee_growth_checkpoint_b: to_x64(10), + reward_infos: create_position_reward_infos(to_x64(1), 0), + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: 20, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(10), + reward_growths_outside: create_reward_growths(to_x64(1)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 20, + liquidity_net: -20, + fee_growth_outside_a: to_x64(20), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(2)), + }, + }, + ); + } + } + } + + // Position with positive liquidity transitions to zero liquidity + // Only possible with negative liquidity delta values + mod ox_position { + + mod current_tick_below { + use crate::{ + manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*, + }; + + #[test] + fn neg_delta_current_tick_below_ox_lower_ox_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate::default(), + tick_lower_update: TickUpdate::default(), + tick_upper_update: TickUpdate::default(), + }, + ); + } + + #[test] + fn neg_delta_current_tick_below_oo_lower_oo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 20, + tick_upper_liquidity_gross: 20, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate::default(), + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 10, + liquidity_gross: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -10, + liquidity_gross: 10, + ..Default::default() + }, + }, + ); + } + + #[test] + fn neg_delta_current_tick_below_oo_lower_oo_upper_non_zero_checkpoints() { + // Test fixture is set up to simulate whirlpool at state T2. + // T0 - current tick above position, global fees at 100, rewards at 10. + // - Deposit liquidity into new position. + // T1 - current tick inside position, global fees at 150, rewards at 20. + // T2 - current tick below position, global fees at 200, rewards at 30. + // - Remove all liquidity. + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 1000, + position_liquidity: 10, + tick_lower_liquidity_gross: 20, + tick_upper_liquidity_gross: 20, + fee_growth_global_a: to_x64(200), + fee_growth_global_b: to_x64(200), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(30)), + }); + + // Time starts at 30_000. Increments of 10_000 seconds with 1000 whirlpool liquidity + // equate to increments of 10 global rewards. + test.whirlpool.reward_last_updated_timestamp = 30_000; + + test.tick_lower.reward_growths_outside = create_reward_growths(to_x64(30)); + test.tick_lower.fee_growth_outside_a = to_x64(100); + test.tick_lower.fee_growth_outside_b = to_x64(100); + + test.tick_upper.reward_growths_outside = create_reward_growths(to_x64(10)); + test.tick_upper.fee_growth_outside_a = to_x64(50); + test.tick_upper.fee_growth_outside_b = to_x64(50); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 40_000, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 1000, + // 40 = 30 + (10000 / 1000) + whirlpool_reward_growths: create_reward_growths(737869762948382064640), + position_update: PositionUpdate { + liquidity: 0, + fee_growth_checkpoint_a: to_x64(50), + fee_owed_a: 500, + fee_growth_checkpoint_b: to_x64(50), + fee_owed_b: 500, + reward_infos: create_position_reward_infos(to_x64(20), 200), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 10, + liquidity_gross: 10, + fee_growth_outside_a: to_x64(100), + fee_growth_outside_b: to_x64(100), + reward_growths_outside: create_reward_growths(to_x64(30)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -10, + liquidity_gross: 10, + fee_growth_outside_a: to_x64(50), + fee_growth_outside_b: to_x64(50), + reward_growths_outside: create_reward_growths(to_x64(10)), + }, + }, + ); + } + } + + mod current_tick_inside { + use crate::{ + manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*, + }; + + #[test] + fn neg_delta_current_tick_inside_ox_lower_ox_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 90, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 0, + fee_growth_checkpoint_a: to_x64(10), + fee_owed_a: 100, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 200, + reward_infos: create_position_reward_infos(to_x64(3), 30), + }, + tick_lower_update: TickUpdate::default(), + tick_upper_update: TickUpdate::default(), + }, + ); + } + + #[test] + fn neg_delta_current_tick_inside_oo_lower_oo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 20, + tick_upper_liquidity_gross: 20, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 90, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 0, + fee_growth_checkpoint_a: to_x64(10), + fee_owed_a: 100, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 200, + reward_infos: create_position_reward_infos(to_x64(3), 30), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 10, + liquidity_gross: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -10, + liquidity_gross: 10, + ..Default::default() + }, + }, + ); + } + } + + mod current_tick_above { + use crate::{ + manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*, + }; + + #[test] + fn neg_delta_current_tick_above_ox_lower_ox_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate::default(), + tick_lower_update: TickUpdate::default(), + tick_upper_update: TickUpdate::default(), + }, + ); + } + + #[test] + fn neg_delta_current_tick_above_oo_lower_oo_upper() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 20, + tick_upper_liquidity_gross: 20, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate::default(), + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 10, + liquidity_gross: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -10, + liquidity_gross: 10, + ..Default::default() + }, + }, + ); + } + } + } + + // Position with positive liquidity remains in positive liquidity state + // Only possible with lower and upper ticks that are already initialized (oo, oo) + mod oo_position { + use crate::{manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*}; + + // Liquidity + tick states remain the same + // Only fee + reward growth changes + #[test] + fn zero_delta_current_tick_below() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 10, + liquidity_gross: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -10, + liquidity_gross: 10, + ..Default::default() + }, + }, + ); + } + + #[test] + fn zero_delta_current_tick_inside() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + fee_growth_checkpoint_a: to_x64(10), + fee_owed_a: 100, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 200, + reward_infos: create_position_reward_infos(to_x64(3), 30), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 10, + liquidity_gross: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -10, + liquidity_gross: 10, + ..Default::default() + }, + }, + ); + } + + #[test] + fn zero_delta_current_tick_above() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 10, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 10, + liquidity_gross: 10, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -10, + liquidity_gross: 10, + ..Default::default() + }, + }, + ); + } + + // Position liquidity increases + #[test] + fn pos_delta_current_tick_below() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 20, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 20, + liquidity_gross: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -20, + liquidity_gross: 20, + ..Default::default() + }, + }, + ); + } + + #[test] + fn pos_delta_current_tick_inside() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 110, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 20, + fee_growth_checkpoint_a: to_x64(10), + fee_owed_a: 100, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 200, + reward_infos: create_position_reward_infos(to_x64(3), 30), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 20, + liquidity_gross: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -20, + liquidity_gross: 20, + ..Default::default() + }, + }, + ); + } + + #[test] + fn pos_delta_current_tick_above() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 10, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 20, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 20, + liquidity_gross: 20, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -20, + liquidity_gross: 20, + ..Default::default() + }, + }, + ); + } + + // Position liquidity decreases by partial amount + #[test] + fn neg_delta_current_tick_below() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -5, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 5, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 5, + liquidity_gross: 5, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -5, + liquidity_gross: 5, + ..Default::default() + }, + }, + ); + } + + #[test] + fn neg_delta_current_tick_inside() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -5, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 95, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 5, + fee_growth_checkpoint_a: to_x64(10), + fee_owed_a: 100, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 200, + reward_infos: create_position_reward_infos(to_x64(3), 30), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 5, + liquidity_gross: 5, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -5, + liquidity_gross: 5, + ..Default::default() + }, + }, + ); + } + + #[test] + fn neg_delta_current_tick_above() { + let test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 100, + position_liquidity: 10, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(10), + fee_growth_global_b: to_x64(20), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(2)), + }); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -5, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 100, + whirlpool_reward_growths: create_reward_growths(to_x64(3)), + position_update: PositionUpdate { + liquidity: 5, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 5, + liquidity_gross: 5, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -5, + liquidity_gross: 5, + ..Default::default() + }, + }, + ); + } + } + + mod fees_and_rewards { + use crate::{manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*}; + + // Add liquidity to new position, accrue fees and rewards, remove all liquidity. + // This test checks that accrued fees and rewards are properly accounted even when all + // liquidity has been removed from a position and the ticks are still initialized. + #[test] + fn accrued_tokens_ok_closed_position_ticks_remain_initialized() { + // Whirlpool with 1000 liquidity, fees (a: 100, b: 200) and reward (20) + // Lower Tick with 10 liquidity, existing fee checkpoints (a: 10, b: 20) and reward (2) + // Upper Tick with 10 liquidity, existing fee checkpoints (a: 1, b: 2) and reward (1) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 1000, + position_liquidity: 0, + tick_lower_liquidity_gross: 10, + tick_upper_liquidity_gross: 10, + fee_growth_global_a: to_x64(100), + fee_growth_global_b: to_x64(200), + reward_infos: create_whirlpool_reward_infos(to_x64(1), to_x64(20)), + }); + + test.tick_lower.fee_growth_outside_a = to_x64(10); + test.tick_lower.fee_growth_outside_b = to_x64(20); + test.tick_lower.reward_growths_outside = create_reward_growths(to_x64(2)); + + test.tick_upper.fee_growth_outside_a = to_x64(1); + test.tick_upper.fee_growth_outside_b = to_x64(2); + test.tick_upper.reward_growths_outside = create_reward_growths(to_x64(1)); + + // Add 100 liquidity + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 100, + 100, + ) + .unwrap(); + + // 20.1 = 20 + (100 / 1000) + assert_whirlpool_reward_growths(&update.reward_infos, 370779555881561987481); + assert_eq!( + update.position_update, + PositionUpdate { + liquidity: 100, + fee_growth_checkpoint_a: to_x64(89), // 100 - 10 - 1 + fee_growth_checkpoint_b: to_x64(178), // 200 - 20 - 2 + reward_infos: create_position_reward_infos(315439323660433332633, 0), + ..Default::default() + } + ); + test.apply_update(&update, 100); + + // Add 50 more liquidity + test.increment_whirlpool_fee_growths(to_x64(10), to_x64(20)); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 50, + 200, + ) + .unwrap(); + + // 20.19090 = 20.1 + (100 / 1100) + assert_whirlpool_reward_growths(&update.reward_infos, 372456532615535583082); + assert_eq!( + update.position_update, + PositionUpdate { + liquidity: 150, + fee_growth_checkpoint_a: to_x64(99), // 110 - 10 - 1 + fee_owed_a: 1000, + fee_growth_checkpoint_b: to_x64(198), // 220 - 20 - 2 + fee_owed_b: 2000, + reward_infos: create_position_reward_infos(317116300394406928234, 9), + } + ); + test.apply_update(&update, 200); + + // Remove all 150 liquidity + test.increment_whirlpool_fee_growths(to_x64(10), to_x64(20)); + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + -150, + 300, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 1000, + // 20.277865 = 20.19090 + (100 / 1150) + whirlpool_reward_growths: create_reward_growths(374060597317597283222), + position_update: PositionUpdate { + liquidity: 0, + fee_growth_checkpoint_a: to_x64(109), // 120 - 10 - 1 + fee_owed_a: 2500, + fee_growth_checkpoint_b: to_x64(218), // 240 - 20 - 2 + fee_owed_b: 5000, + reward_infos: create_position_reward_infos(318720365096468628374, 22), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: 10, + fee_growth_outside_a: to_x64(10), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(2)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_gross: 10, + liquidity_net: -10, + fee_growth_outside_a: to_x64(1), + fee_growth_outside_b: to_x64(2), + reward_growths_outside: create_reward_growths(to_x64(1)), + }, + }, + ); + } + + // Test overflow accounting of global fee and reward accumulators + mod global_accumulators_overflow { + use crate::{ + manager::liquidity_manager::_calculate_modify_liquidity, state::*, util::*, + }; + + // t1 |---c1---l----------------u--------| open position (checkpoint) + // t2 |--------l-------c2-------u--------| cross right, accrue tokens + // t3 |---c3---l----------------u--------| cross left, overflow + #[test] + fn overflow_below_checkpoint_below() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 10000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 100, rewards at -4 + whirlpool_reward_growths: create_reward_growths(u128::MAX - to_x64(4)), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 200, rewards at MAX - 3 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + u128::MAX - to_x64(3), + ); + + // t2 - cross right, accrue tokens in position + test.cross_tick(TickLabel::Lower, Direction::Right); + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -60 + test.increment_whirlpool_reward_growths_by_time(100); // 300 + + // time: 300, rewards at -2.0909 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + 340282366920938463424804142550375512621, + ); + + // t3 - cross left, overflow + test.cross_tick(TickLabel::Lower, Direction::Left); + test.increment_whirlpool_fee_growths(to_x64(70), to_x64(70)); // fees overflow to 10 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 0.909 = -2.0909 + 3 + whirlpool_reward_growths: create_reward_growths(16769767339735956013), + position_update: PositionUpdate { + liquidity: 1000, + fee_growth_checkpoint_a: to_x64(20), + fee_owed_a: 20000, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 20000, + reward_infos: create_position_reward_infos(16769767339735956014, 909), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: to_x64(20), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(16769767339735956014), // 0.9090909 + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |--------l-------c1-------u--------| open position (checkpoint) + // t2 |--------l-------c2-------u--------| accrue tokens, cross left + // t3 |---c3---l----------------u--------| overflow + #[test] + fn overflow_below_checkpoint_inside() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 10000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 11000, + // time: 100, rewards at MAX - 4 + whirlpool_reward_growths: create_reward_growths(u128::MAX - to_x64(4)), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + + // t2 - accrue tokens, cross left + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 200, rewards at MAX - 3.0909 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + 340282366920938463406357398476665961005, + ); + test.cross_tick(TickLabel::Lower, Direction::Left); + + // t3 - overflow + test.increment_whirlpool_fee_growths(to_x64(90), to_x64(90)); // fees overflow to 10 + test.increment_whirlpool_reward_growths_by_time(400); // 600 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 0.909 = -3.0909 + 4 + whirlpool_reward_growths: create_reward_growths(16769767339735956013), + position_update: PositionUpdate { + liquidity: 1000, + fee_growth_checkpoint_a: to_x64(20), + fee_owed_a: 20000, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 20000, + reward_infos: create_position_reward_infos(16769767339735956014, 909), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: to_x64(20), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(16769767339735956014), // 0.9090909 + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |--------l----------------u---c1---| open position (checkpoint), cross left + // t2 |--------l-------c2-------u--------| accrue tokens, cross left + // t3 |---c3---l----------------u--------| overflow + #[test] + fn overflow_below_checkpoint_above() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 10000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 100, rewards at MAX - 4 + whirlpool_reward_growths: create_reward_growths(u128::MAX - to_x64(4)), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 200, rewards at MAX - 3 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + u128::MAX - to_x64(3), + ); + test.cross_tick(TickLabel::Upper, Direction::Left); + + // t2 - accrue tokens, cross left + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -60 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 300, rewards at MAX - 2.0909 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + 340282366920938463424804142550375512621, + ); + test.cross_tick(TickLabel::Lower, Direction::Left); + + // t3 - overflow + test.increment_whirlpool_fee_growths(to_x64(70), to_x64(70)); // fees overflow to 10 + test.increment_whirlpool_reward_growths_by_time(300); // 600 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 0.909 = -3.0909 + 4 + whirlpool_reward_growths: create_reward_growths(16769767339735956013), + position_update: PositionUpdate { + liquidity: 1000, + fee_growth_checkpoint_a: to_x64(20), + fee_owed_a: 20000, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 20000, + reward_infos: create_position_reward_infos(16769767339735956014, 909), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: to_x64(40), + fee_growth_outside_b: to_x64(40), + reward_growths_outside: create_reward_growths(35216511413445507630), // 1.9090909 + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: to_x64(20), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(to_x64(1)), // 1 + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |---c1---l----------------u--------| open position (checkpoint), cross right + // t2 |--------l-------c2-------u--------| accrue tokens, overflow + #[test] + fn overflow_inside_checkpoint_below() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 10000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 100, rewards at MAX - 4 + whirlpool_reward_growths: create_reward_growths(u128::MAX - to_x64(4)), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 200, rewards at MAX - 3 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + u128::MAX - to_x64(3), + ); + test.cross_tick(TickLabel::Lower, Direction::Right); + + // t2 - accrue tokens, overflow + test.increment_whirlpool_fee_growths(to_x64(90), to_x64(90)); // fees overflow to 10 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 11000, + // time: 600, rewards at 0.6363 = -3 + (400 * 100 / 11000) + whirlpool_reward_growths: create_reward_growths(11738837137815169209), + position_update: PositionUpdate { + liquidity: 1000, + fee_growth_checkpoint_a: to_x64(90), + fee_owed_a: 90000, + fee_growth_checkpoint_b: to_x64(90), + fee_owed_b: 90000, + reward_infos: create_position_reward_infos(67079069358943824058, 3636), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(80), + fee_growth_outside_b: u128::MAX - to_x64(80), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(3)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |--------l-------c1-------u--------| open position (checkpoint) + // t2 |--------l-------c2-------u--------| accrue tokens, overflow + #[test] + fn overflow_inside_checkpoint_inside() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 9000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 100, rewards at -3.888 = -5 + (100 * 100 / 9000) + whirlpool_reward_growths: create_reward_growths( + 340282366920938463391637269367342177392, + ), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths( + 340282366920938463391637269367342177392, + ), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + + // t2 - accrue tokens, overflow + test.increment_whirlpool_fee_growths(to_x64(110), to_x64(110)); // fees overflow to 10 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 1.111 = -3.888 + (500 * 100 / 10000) + whirlpool_reward_growths: create_reward_growths(20496382304121724016), + position_update: PositionUpdate { + liquidity: 1000, + fee_growth_checkpoint_a: to_x64(110), + fee_owed_a: 110000, + fee_growth_checkpoint_b: to_x64(110), + fee_owed_b: 110000, + reward_infos: create_position_reward_infos(to_x64(5), 5000), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths( + 340282366920938463391637269367342177392, + ), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |--------l----------------u---c1---| open position (checkpoint), cross left + // t2 |--------l-------c2-------u--------| accrue tokens, overflow + #[test] + fn overflow_inside_checkpoint_above() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 9000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 9000, + // time: 100, rewards at -3.888 = -5 + (100 * 100 / 9000) + whirlpool_reward_growths: create_reward_growths( + 340282366920938463391637269367342177392, + ), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths( + 340282366920938463391637269367342177392, + ), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths( + 340282366920938463391637269367342177392, + ), + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // -2.777 = -3.888 + (100 * 100 / 9000) + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + 340282366920938463412133651671463901409, + ); + test.cross_tick(TickLabel::Upper, Direction::Left); + + // t2 - accrue tokens, overflow + test.increment_whirlpool_fee_growths(to_x64(90), to_x64(90)); // fees overflow to 10 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 1.222 = -2.777 + (400 * 100 / 10000) + whirlpool_reward_growths: create_reward_growths(22546020534533896417), + position_update: PositionUpdate { + liquidity: 1000, + fee_growth_checkpoint_a: to_x64(90), + fee_owed_a: 90000, + fee_growth_checkpoint_b: to_x64(90), + fee_owed_b: 90000, + reward_infos: create_position_reward_infos(to_x64(4), 4000), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths( + 340282366920938463391637269367342177392, + ), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: to_x64(20), + fee_growth_outside_b: to_x64(20), + reward_growths_outside: create_reward_growths(20496382304121724017), + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |---c1---l----------------u--------| open position (checkpoint), cross right + // t2 |--------l-------c2-------u--------| accrue tokens, cross right + // t3 |--------l----------------u---c3---| overflow + #[test] + fn overflow_above_checkpoint_below() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Below, + whirlpool_liquidity: 10000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 100, rewards at -4 + whirlpool_reward_growths: create_reward_growths(u128::MAX - to_x64(4)), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + ..Default::default() + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 200, rewards at -3 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + u128::MAX - to_x64(3), + ); + test.cross_tick(TickLabel::Lower, Direction::Right); + + // // t2 - accrue tokens, cross right + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -60 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 300, rewards at -2.0909 = + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + 340282366920938463424804142550375512621, + ); + test.cross_tick(TickLabel::Upper, Direction::Right); + + // t3 - overflow + test.increment_whirlpool_fee_growths(to_x64(70), to_x64(70)); // fees overflow to 10 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 0.909 = -2.0909 + 3 + whirlpool_reward_growths: create_reward_growths(16769767339735956013), + position_update: PositionUpdate { + liquidity: 1000, + // 20 = 10 - (-80) - (10 - (-60)) + fee_growth_checkpoint_a: to_x64(20), + fee_owed_a: 20000, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 20000, + // 0.909 = 0.909 - (-3) - (0.909 - -2.0909) + reward_infos: create_position_reward_infos(16769767339735956014, 909), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(80), + fee_growth_outside_b: u128::MAX - to_x64(80), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(3)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(60), + fee_growth_outside_b: u128::MAX - to_x64(60), + reward_growths_outside: create_reward_growths( + 340282366920938463424804142550375512621, + ), + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |--------l-------c1-------u--------| open position (checkpoint) + // t2 |--------l-------c2-------u--------| accrue tokens, cross right + // t3 |--------l----------------u---c3---| overflow + #[test] + fn overflow_above_checkpoint_inside() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Inside, + whirlpool_liquidity: 10000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 11000, + // time: 100, rewards at -4 + whirlpool_reward_growths: create_reward_growths(u128::MAX - to_x64(4)), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + ..Default::default() + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + + // t2 -accrue tokens, cross right + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 200, rewards at MAX - 3.0909 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + 340282366920938463406357398476665961005, + ); + test.cross_tick(TickLabel::Upper, Direction::Right); + + // t3 - overflow + test.increment_whirlpool_fee_growths(to_x64(90), to_x64(90)); // fees overflow to 10 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 0.909 = -3.0909 + 4 + whirlpool_reward_growths: create_reward_growths(16769767339735956013), + position_update: PositionUpdate { + liquidity: 1000, + fee_growth_checkpoint_a: to_x64(20), + fee_owed_a: 20000, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 20000, + reward_infos: create_position_reward_infos(16769767339735956014, 909), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(80), + fee_growth_outside_b: u128::MAX - to_x64(80), + reward_growths_outside: create_reward_growths( + 340282366920938463406357398476665961005, + ), + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + + // t1 |--------l----------------u---c1---| open position (checkpoint), cross left + // t2 |--------l-------c2-------u--------| accrue tokens, cross right + // t3 |--------l----------------u---c3---| overflow + #[test] + fn overflow_above_checkpoint_above() { + // t1 - open position (checkpoint) + let mut test = LiquidityTestFixture::new(LiquidityTestFixtureInfo { + curr_index_loc: CurrIndex::Above, + whirlpool_liquidity: 10000, + position_liquidity: 0, + tick_lower_liquidity_gross: 0, + tick_upper_liquidity_gross: 0, + fee_growth_global_a: u128::MAX - to_x64(100), + fee_growth_global_b: u128::MAX - to_x64(100), + // rewards start at MAX - 5 + reward_infos: create_whirlpool_reward_infos(to_x64(100), u128::MAX - to_x64(5)), + }); + + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 1000, + 100, + ) + .unwrap(); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 100, rewards at -4 + whirlpool_reward_growths: create_reward_growths(u128::MAX - to_x64(4)), + position_update: PositionUpdate { + liquidity: 1000, + ..Default::default() + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + }, + ); + assert_eq!(test.whirlpool.fee_growth_global_a, u128::MAX - to_x64(100)); + assert_eq!(test.whirlpool.fee_growth_global_b, u128::MAX - to_x64(100)); + + test.apply_update(&update, 100); + + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -80 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 200, rewards at MAX - 3 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + u128::MAX - to_x64(3), + ); + test.cross_tick(TickLabel::Upper, Direction::Left); + + // t2 - accrue tokens, cross right + test.increment_whirlpool_fee_growths(to_x64(20), to_x64(20)); // fees at -60 + test.increment_whirlpool_reward_growths_by_time(100); + // time: 300, rewards at MAX - 2.0909 + assert_whirlpool_reward_growths( + &test.whirlpool.reward_infos, + 340282366920938463424804142550375512621, + ); + test.cross_tick(TickLabel::Upper, Direction::Right); + + // t3 - overflow + test.increment_whirlpool_fee_growths(to_x64(70), to_x64(70)); // fees overflow to 10 + + // Calculate fees and rewards + let update = _calculate_modify_liquidity( + &test.whirlpool, + &test.position, + &test.tick_lower, + &test.tick_upper, + test.position.tick_lower_index, + test.position.tick_upper_index, + 0, + 600, + ) + .unwrap(); + test.apply_update(&update, 600); + + assert_modify_liquidity( + &update, + &ModifyLiquidityExpectation { + whirlpool_liquidity: 10000, + // time: 600, rewards at 0.909 = -2.0909 + 3 + whirlpool_reward_growths: create_reward_growths(16769767339735956013), + position_update: PositionUpdate { + liquidity: 1000, + // 20 = 10 - (-100) - (10 - (-80)) + fee_growth_checkpoint_a: to_x64(20), + fee_owed_a: 20000, + fee_growth_checkpoint_b: to_x64(20), + fee_owed_b: 20000, + // 0.909 = 0.909 - (-4) - (0.909 - (-3.0909)) + reward_infos: create_position_reward_infos(16769767339735956014, 909), + }, + tick_lower_update: TickUpdate { + initialized: true, + liquidity_net: 1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(100), + fee_growth_outside_b: u128::MAX - to_x64(100), + reward_growths_outside: create_reward_growths(u128::MAX - to_x64(4)), + }, + tick_upper_update: TickUpdate { + initialized: true, + liquidity_net: -1000, + liquidity_gross: 1000, + fee_growth_outside_a: u128::MAX - to_x64(80), + fee_growth_outside_b: u128::MAX - to_x64(80), + reward_growths_outside: create_reward_growths( + 340282366920938463406357398476665961005, + ), + }, + }, + ); + // 10 + assert_eq!(test.whirlpool.fee_growth_global_a, 184467440737095516159); + assert_eq!(test.whirlpool.fee_growth_global_b, 184467440737095516159); + } + } + } +} diff --git a/programs/whirlpool/src/manager/mod.rs b/programs/whirlpool/src/manager/mod.rs new file mode 100644 index 0000000..922bb4e --- /dev/null +++ b/programs/whirlpool/src/manager/mod.rs @@ -0,0 +1,5 @@ +pub mod liquidity_manager; +pub mod position_manager; +pub mod swap_manager; +pub mod tick_manager; +pub mod whirlpool_manager; diff --git a/programs/whirlpool/src/manager/position_manager.rs b/programs/whirlpool/src/manager/position_manager.rs new file mode 100644 index 0000000..c657012 --- /dev/null +++ b/programs/whirlpool/src/manager/position_manager.rs @@ -0,0 +1,322 @@ +use crate::{ + errors::ErrorCode, + math::{add_liquidity_delta, checked_mul_shift_right}, + state::{Position, PositionUpdate, NUM_REWARDS}, +}; + +pub fn next_position_modify_liquidity_update( + position: &Position, + liquidity_delta: i128, + fee_growth_inside_a: u128, + fee_growth_inside_b: u128, + reward_growths_inside: &[u128; NUM_REWARDS], +) -> Result { + let mut update = PositionUpdate::default(); + + // Calculate fee deltas. + // If fee deltas overflow, default to a zero value. This means the position loses + // all fees earned since the last time the position was modified or fees collected. + let growth_delta_a = fee_growth_inside_a.wrapping_sub(position.fee_growth_checkpoint_a); + let fee_delta_a = checked_mul_shift_right(position.liquidity, growth_delta_a).unwrap_or(0); + + let growth_delta_b = fee_growth_inside_b.wrapping_sub(position.fee_growth_checkpoint_b); + let fee_delta_b = checked_mul_shift_right(position.liquidity, growth_delta_b).unwrap_or(0); + + update.fee_growth_checkpoint_a = fee_growth_inside_a; + update.fee_growth_checkpoint_b = fee_growth_inside_b; + + // Overflows allowed. Must collect fees owed before overflow. + update.fee_owed_a = position.fee_owed_a.wrapping_add(fee_delta_a); + update.fee_owed_b = position.fee_owed_b.wrapping_add(fee_delta_b); + + for i in 0..NUM_REWARDS { + let reward_growth_inside = reward_growths_inside[i]; + let curr_reward_info = position.reward_infos[i]; + + // Calculate reward delta. + // If reward delta overflows, default to a zero value. This means the position loses all + // rewards earned since the last time the position was modified or rewards were collected. + let reward_growth_delta = + reward_growth_inside.wrapping_sub(curr_reward_info.growth_inside_checkpoint); + let amount_owed_delta = + checked_mul_shift_right(position.liquidity, reward_growth_delta).unwrap_or(0); + + update.reward_infos[i].growth_inside_checkpoint = reward_growth_inside; + + // Overflows allowed. Must collect rewards owed before overflow. + update.reward_infos[i].amount_owed = + curr_reward_info.amount_owed.wrapping_add(amount_owed_delta); + } + + update.liquidity = add_liquidity_delta(position.liquidity, liquidity_delta)?; + + Ok(update) +} + +#[cfg(test)] +mod position_manager_unit_tests { + use crate::{ + math::{add_liquidity_delta, Q64_RESOLUTION}, + state::{position_builder::PositionBuilder, Position, PositionRewardInfo, NUM_REWARDS}, + }; + + use super::next_position_modify_liquidity_update; + + #[test] + fn ok_positive_liquidity_delta_fee_growth() { + let position = PositionBuilder::new(-10, 10) + .liquidity(0) + .fee_owed_a(10) + .fee_owed_b(500) + .fee_growth_checkpoint_a(100 << Q64_RESOLUTION) + .fee_growth_checkpoint_b(100 << Q64_RESOLUTION) + .build(); + let update = next_position_modify_liquidity_update( + &position, + 1000, + 1000 << Q64_RESOLUTION, + 2000 << Q64_RESOLUTION, + &[0, 0, 0], + ) + .unwrap(); + + assert_eq!(update.liquidity, 1000); + assert_eq!(update.fee_growth_checkpoint_a, 1000 << Q64_RESOLUTION); + assert_eq!(update.fee_growth_checkpoint_b, 2000 << Q64_RESOLUTION); + assert_eq!(update.fee_owed_a, 10); + assert_eq!(update.fee_owed_b, 500); + + for i in 0..NUM_REWARDS { + assert_eq!(update.reward_infos[i].amount_owed, 0); + assert_eq!(update.reward_infos[i].growth_inside_checkpoint, 0); + } + } + + #[test] + fn ok_negative_liquidity_delta_fee_growth() { + let position = PositionBuilder::new(-10, 10) + .liquidity(10000) + .fee_growth_checkpoint_a(100 << Q64_RESOLUTION) + .fee_growth_checkpoint_b(100 << Q64_RESOLUTION) + .build(); + let update = next_position_modify_liquidity_update( + &position, + -5000, + 120 << Q64_RESOLUTION, + 250 << Q64_RESOLUTION, + &[0, 0, 0], + ) + .unwrap(); + + assert_eq!(update.liquidity, 5000); + assert_eq!(update.fee_growth_checkpoint_a, 120 << Q64_RESOLUTION); + assert_eq!(update.fee_growth_checkpoint_b, 250 << Q64_RESOLUTION); + assert_eq!(update.fee_owed_a, 200_000); + assert_eq!(update.fee_owed_b, 1500_000); + + for i in 0..NUM_REWARDS { + assert_eq!(update.reward_infos[i].amount_owed, 0); + assert_eq!(update.reward_infos[i].growth_inside_checkpoint, 0); + } + } + + #[test] + #[should_panic(expected = "LiquidityUnderflow")] + fn liquidity_underflow() { + let position = PositionBuilder::new(-10, 10).build(); + next_position_modify_liquidity_update(&position, -100, 0, 0, &[0, 0, 0]).unwrap(); + } + + #[test] + #[should_panic(expected = "LiquidityOverflow")] + fn liquidity_overflow() { + let position = PositionBuilder::new(-10, 10).liquidity(u128::MAX).build(); + next_position_modify_liquidity_update(&position, i128::MAX, 0, 0, &[0, 0, 0]).unwrap(); + } + + #[test] + fn fee_delta_overflow_defaults_zero() { + let position = PositionBuilder::new(-10, 10) + .liquidity(i64::MAX as u128) + .fee_owed_a(10) + .fee_owed_b(20) + .build(); + let update = next_position_modify_liquidity_update( + &position, + i64::MAX as i128, + u128::MAX, + u128::MAX, + &[0, 0, 0], + ) + .unwrap(); + assert_eq!(update.fee_growth_checkpoint_a, u128::MAX); + assert_eq!(update.fee_growth_checkpoint_b, u128::MAX); + assert_eq!(update.fee_owed_a, 10); + assert_eq!(update.fee_owed_b, 20); + } + + #[test] + fn ok_reward_growth() { + struct Test<'a> { + name: &'a str, + position: &'a Position, + liquidity_delta: i128, + reward_growths_inside: [u128; NUM_REWARDS], + expected_reward_infos: [PositionRewardInfo; NUM_REWARDS], + } + + let position = &PositionBuilder::new(-10, 10) + .liquidity(2500) + .reward_infos([ + PositionRewardInfo { + growth_inside_checkpoint: 100 << Q64_RESOLUTION, + amount_owed: 50, + }, + PositionRewardInfo { + growth_inside_checkpoint: 250 << Q64_RESOLUTION, + amount_owed: 100, + }, + PositionRewardInfo { + growth_inside_checkpoint: 10 << Q64_RESOLUTION, + amount_owed: 0, + }, + ]) + .build(); + + for test in [ + Test { + name: "all initialized reward growths update", + position, + liquidity_delta: 2500, + reward_growths_inside: [ + 200 << Q64_RESOLUTION, + 500 << Q64_RESOLUTION, + 1000 << Q64_RESOLUTION, + ], + expected_reward_infos: [ + PositionRewardInfo { + growth_inside_checkpoint: 200 << Q64_RESOLUTION, + amount_owed: 250_050, + }, + PositionRewardInfo { + growth_inside_checkpoint: 500 << Q64_RESOLUTION, + amount_owed: 625_100, + }, + PositionRewardInfo { + growth_inside_checkpoint: 1000 << Q64_RESOLUTION, + amount_owed: 2_475_000, + }, + ], + }, + Test { + name: "reward delta overflow defaults to zero", + position: &PositionBuilder::new(-10, 10) + .liquidity(i64::MAX as u128) + .reward_infos([ + PositionRewardInfo { + ..Default::default() + }, + PositionRewardInfo { + amount_owed: 100, + ..Default::default() + }, + PositionRewardInfo { + amount_owed: 200, + ..Default::default() + }, + ]) + .build(), + liquidity_delta: 2500, + reward_growths_inside: [u128::MAX, 500 << Q64_RESOLUTION, 1000 << Q64_RESOLUTION], + expected_reward_infos: [ + PositionRewardInfo { + growth_inside_checkpoint: u128::MAX, + amount_owed: 0, + }, + PositionRewardInfo { + growth_inside_checkpoint: 500 << Q64_RESOLUTION, + amount_owed: 100, + }, + PositionRewardInfo { + growth_inside_checkpoint: 1000 << Q64_RESOLUTION, + amount_owed: 200, + }, + ], + }, + ] { + let update = next_position_modify_liquidity_update( + &test.position, + test.liquidity_delta, + 0, + 0, + &test.reward_growths_inside, + ) + .unwrap(); + assert_eq!( + update.liquidity, + add_liquidity_delta(test.position.liquidity, test.liquidity_delta).unwrap(), + "{} - assert liquidity delta", + test.name, + ); + for i in 0..NUM_REWARDS { + assert_eq!( + update.reward_infos[i].growth_inside_checkpoint, + test.expected_reward_infos[i].growth_inside_checkpoint, + "{} - assert growth_inside_checkpoint", + test.name, + ); + assert_eq!( + update.reward_infos[i].amount_owed, test.expected_reward_infos[i].amount_owed, + "{} - assert amount_owed", + test.name + ); + } + } + } + + #[test] + fn reward_delta_overflow_defaults_zero() { + let position = PositionBuilder::new(-10, 10) + .liquidity(i64::MAX as u128) + .reward_infos([ + PositionRewardInfo { + growth_inside_checkpoint: 100, + amount_owed: 1000, + }, + PositionRewardInfo { + growth_inside_checkpoint: 100, + amount_owed: 1000, + }, + PositionRewardInfo { + growth_inside_checkpoint: 100, + amount_owed: 1000, + }, + ]) + .build(); + let update = next_position_modify_liquidity_update( + &position, + i64::MAX as i128, + 0, + 0, + &[u128::MAX, u128::MAX, u128::MAX], + ) + .unwrap(); + assert_eq!( + update.reward_infos, + [ + PositionRewardInfo { + growth_inside_checkpoint: u128::MAX, + amount_owed: 1000, + }, + PositionRewardInfo { + growth_inside_checkpoint: u128::MAX, + amount_owed: 1000, + }, + PositionRewardInfo { + growth_inside_checkpoint: u128::MAX, + amount_owed: 1000, + }, + ] + ) + } +} diff --git a/programs/whirlpool/src/manager/swap_manager.rs b/programs/whirlpool/src/manager/swap_manager.rs new file mode 100644 index 0000000..6203357 --- /dev/null +++ b/programs/whirlpool/src/manager/swap_manager.rs @@ -0,0 +1,2537 @@ +use crate::{ + errors::ErrorCode, + manager::{ + tick_manager::next_tick_cross_update, whirlpool_manager::next_whirlpool_reward_infos, + }, + math::*, + state::*, + util::SwapTickSequence, +}; +use std::convert::TryInto; + +#[derive(Debug)] +pub struct PostSwapUpdate { + pub amount_a: u64, + pub amount_b: u64, + pub next_liquidity: u128, + pub next_tick_index: i32, + pub next_sqrt_price: u128, + pub next_fee_growth_global: u128, + pub next_reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + pub next_protocol_fee: u64, +} + +pub fn swap( + whirlpool: &Whirlpool, + swap_tick_sequence: &mut SwapTickSequence, + amount: u64, + sqrt_price_limit: u128, + amount_specified_is_input: bool, + a_to_b: bool, + timestamp: u64, +) -> Result { + if sqrt_price_limit < MIN_SQRT_PRICE_X64 || sqrt_price_limit > MAX_SQRT_PRICE_X64 { + return Err(ErrorCode::SqrtPriceOutOfBounds.into()); + } + + if a_to_b && sqrt_price_limit > whirlpool.sqrt_price + || !a_to_b && sqrt_price_limit < whirlpool.sqrt_price + { + return Err(ErrorCode::InvalidSqrtPriceLimitDirection.into()); + } + + if amount == 0 { + return Err(ErrorCode::ZeroTradableAmount.into()); + } + + let tick_spacing = whirlpool.tick_spacing; + let fee_rate = whirlpool.fee_rate; + let protocol_fee_rate = whirlpool.protocol_fee_rate; + let next_reward_infos = next_whirlpool_reward_infos(whirlpool, timestamp)?; + + let mut amount_remaining: u64 = amount; + let mut amount_calculated: u64 = 0; + let mut curr_sqrt_price = whirlpool.sqrt_price; + let mut curr_tick_index = whirlpool.tick_current_index; + let mut curr_liquidity = whirlpool.liquidity; + let mut curr_protocol_fee: u64 = 0; + let mut curr_array_index: usize = 0; + let mut curr_fee_growth_global_input = if a_to_b { + whirlpool.fee_growth_global_a + } else { + whirlpool.fee_growth_global_b + }; + + while amount_remaining > 0 && sqrt_price_limit != curr_sqrt_price { + let (next_array_index, next_tick_index) = swap_tick_sequence + .get_next_initialized_tick_index( + curr_tick_index, + tick_spacing, + a_to_b, + curr_array_index, + )?; + + let (next_tick_sqrt_price, sqrt_price_target) = + get_next_sqrt_prices(next_tick_index, sqrt_price_limit, a_to_b); + + let swap_computation = compute_swap( + amount_remaining, + fee_rate, + curr_liquidity, + curr_sqrt_price, + sqrt_price_target, + amount_specified_is_input, + a_to_b, + )?; + + if amount_specified_is_input { + amount_remaining = amount_remaining + .checked_sub(swap_computation.amount_in) + .ok_or(ErrorCode::AmountRemainingOverflow)?; + amount_remaining = amount_remaining. + checked_sub(swap_computation.fee_amount) + .ok_or(ErrorCode::AmountRemainingOverflow)?; + + amount_calculated = amount_calculated + .checked_add(swap_computation.amount_out) + .ok_or(ErrorCode::AmountCalcOverflow)?; + } else { + amount_remaining = amount_remaining + .checked_sub(swap_computation.amount_out) + .ok_or(ErrorCode::AmountRemainingOverflow)?; + + amount_calculated = amount_calculated + .checked_add(swap_computation.amount_in) + .ok_or(ErrorCode::AmountCalcOverflow)?; + amount_calculated = amount_calculated + .checked_add(swap_computation.fee_amount) + .ok_or(ErrorCode::AmountCalcOverflow)?; + } + + let (next_protocol_fee, next_fee_growth_global_input) = calculate_fees( + swap_computation.fee_amount, + protocol_fee_rate, + curr_liquidity, + curr_protocol_fee, + curr_fee_growth_global_input, + ); + curr_protocol_fee = next_protocol_fee; + curr_fee_growth_global_input = next_fee_growth_global_input; + + if swap_computation.next_price == next_tick_sqrt_price { + let (next_tick, next_tick_initialized) = swap_tick_sequence + .get_tick(next_array_index, next_tick_index, tick_spacing) + .map_or_else(|_| (None, false), |tick| (Some(tick), tick.initialized)); + + if next_tick_initialized { + let (fee_growth_global_a, fee_growth_global_b) = if a_to_b { + (curr_fee_growth_global_input, whirlpool.fee_growth_global_b) + } else { + (whirlpool.fee_growth_global_a, curr_fee_growth_global_input) + }; + + let (update, next_liquidity) = calculate_update( + &next_tick.unwrap(), + a_to_b, + curr_liquidity, + fee_growth_global_a, + fee_growth_global_b, + &next_reward_infos, + )?; + + curr_liquidity = next_liquidity; + swap_tick_sequence.update_tick( + next_array_index, + next_tick_index, + tick_spacing, + &update, + )?; + } + + let tick_offset = swap_tick_sequence.get_tick_offset( + next_array_index, + next_tick_index, + tick_spacing, + )?; + + // Increment to the next tick array if either condition is true: + // - Price is moving left and the current tick is the start of the tick array + // - Price is moving right and the current tick is the end of the tick array + curr_array_index = if (a_to_b && tick_offset == 0) + || (!a_to_b && tick_offset == TICK_ARRAY_SIZE as isize - 1) + { + next_array_index + 1 + } else { + next_array_index + }; + + // The get_init_tick search is inclusive of the current index in an a_to_b trade. + // We therefore have to shift the index by 1 to advance to the next init tick to the left. + curr_tick_index = if a_to_b { + next_tick_index - 1 + } else { + next_tick_index + }; + } else { + curr_tick_index = tick_index_from_sqrt_price(&swap_computation.next_price); + } + + curr_sqrt_price = swap_computation.next_price; + } + + let (amount_a, amount_b) = if a_to_b == amount_specified_is_input { + (amount - amount_remaining, amount_calculated) + } else { + (amount_calculated, amount - amount_remaining) + }; + + Ok(PostSwapUpdate { + amount_a, + amount_b, + next_liquidity: curr_liquidity, + next_tick_index: curr_tick_index, + next_sqrt_price: curr_sqrt_price, + next_fee_growth_global: curr_fee_growth_global_input, + next_reward_infos, + next_protocol_fee: curr_protocol_fee, + }) +} + +fn calculate_fees( + fee_amount: u64, + protocol_fee_rate: u16, + curr_liquidity: u128, + curr_protocol_fee: u64, + curr_fee_growth_global_input: u128, +) -> (u64, u128) { + let mut next_protocol_fee = curr_protocol_fee; + let mut next_fee_growth_global_input = curr_fee_growth_global_input; + let mut global_fee = fee_amount; + if protocol_fee_rate > 0 { + let delta = calculate_protocol_fee(global_fee, protocol_fee_rate); + global_fee -= delta; + next_protocol_fee = next_protocol_fee.wrapping_add(delta); + } + + if curr_liquidity > 0 { + next_fee_growth_global_input = next_fee_growth_global_input + .wrapping_add(((global_fee as u128) << Q64_RESOLUTION) / curr_liquidity); + } + (next_protocol_fee, next_fee_growth_global_input) +} + +fn calculate_protocol_fee(global_fee: u64, protocol_fee_rate: u16) -> u64 { + ((global_fee as u128) * (protocol_fee_rate as u128) / PROTOCOL_FEE_RATE_MUL_VALUE) + .try_into() + .unwrap() +} + +fn calculate_update( + tick: &Tick, + a_to_b: bool, + liquidity: u128, + fee_growth_global_a: u128, + fee_growth_global_b: u128, + reward_infos: &[WhirlpoolRewardInfo; NUM_REWARDS], +) -> Result<(TickUpdate, u128), ErrorCode> { + // Use updated fee_growth for crossing tick + // Use -liquidity_net if going left, +liquidity_net going right + let signed_liquidity_net = if a_to_b { + -tick.liquidity_net + } else { + tick.liquidity_net + }; + + let update = + next_tick_cross_update(tick, fee_growth_global_a, fee_growth_global_b, reward_infos)?; + + // Update the global liquidity to reflect the new current tick + let next_liquidity = add_liquidity_delta(liquidity, signed_liquidity_net)?; + + Ok((update, next_liquidity)) +} + +fn get_next_sqrt_prices( + next_tick_index: i32, + sqrt_price_limit: u128, + a_to_b: bool, +) -> (u128, u128) { + let next_tick_price = sqrt_price_from_tick_index(next_tick_index); + let next_sqrt_price_limit = if a_to_b { + sqrt_price_limit.max(next_tick_price) + } else { + sqrt_price_limit.min(next_tick_price) + }; + (next_tick_price, next_sqrt_price_limit) +} + +#[cfg(test)] +mod swap_liquidity_tests { + use super::*; + use crate::util::{create_whirlpool_reward_infos, test_utils::swap_test_fixture::*}; + + #[test] + /// A rightward swap on a pool with zero liquidity across the range with initialized ticks. + /// |____c1___p1________|____p1___________|______________c2| + /// + /// Expectation: + /// The swap will swap 0 assets but the next tick index will end at the end of tick-range. + fn zero_l_across_tick_range_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 0, + curr_tick_index: 255, // c1 + start_tick_index: 0, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(1720), + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![TestTickInfo { + // p1 + index: 448, + liquidity_net: 0, + ..Default::default() + }], + array_2_ticks: Some(&vec![TestTickInfo { + // p1 + index: 720, + liquidity_net: 0, + ..Default::default() + }]), + array_3_ticks: Some(&vec![]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 0, + traded_amount_b: 0, + end_tick_index: 1720, + end_liquidity: 0, + end_reward_growths: [10, 10, 10], + }, + ); + let tick_lower = tick_sequence.get_tick(0, 448, TS_8).unwrap(); + assert_swap_tick_state( + &tick_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + let tick_upper = tick_sequence.get_tick(1, 720, TS_8).unwrap(); + assert_swap_tick_state( + &tick_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A leftward swap on a pool with zero liquidity across the range with initialized ticks. + /// |____c2___p1________|____p1___________|______________c1| + /// + /// Expectation: + /// The swap will swap 0 assets but the next tick index will end at the end of tick-range. + fn zero_l_across_tick_range_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 0, + curr_tick_index: 1720, // c1 + start_tick_index: 1408, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(100), + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![], + array_2_ticks: Some(&vec![TestTickInfo { + // p1 + index: 720, + liquidity_net: 0, + ..Default::default() + }]), + array_3_ticks: Some(&vec![TestTickInfo { + // p1 + index: 448, + liquidity_net: 0, + ..Default::default() + }]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 0, + traded_amount_b: 0, + end_tick_index: 100, + end_liquidity: 0, + end_reward_growths: [10, 10, 10], + }, + ); + let lower_tick = tick_sequence.get_tick(1, 720, TS_8).unwrap(); + assert_swap_tick_state( + &lower_tick, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + let lower_tick = tick_sequence.get_tick(2, 448, TS_8).unwrap(); + assert_swap_tick_state( + &lower_tick, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A rightward swap on a pool with zero liquidity at the end of the tick-range. + /// |_____c1__p1________|_______________|_______________c2| + /// + /// Expectation: + /// The swap will swap some assets up to the last initialized tick and + /// the next tick index will end at the end of tick-range. + fn zero_l_after_first_tick_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 100_000, + curr_tick_index: 255, // c1 + start_tick_index: 0, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(1720), + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![TestTickInfo { + // p1 + index: 448, + liquidity_net: -100_000, + ..Default::default() + }], + array_2_ticks: Some(&vec![]), + array_3_ticks: Some(&vec![]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 948, + traded_amount_b: 983, + end_tick_index: 1720, + end_liquidity: 0, + end_reward_growths: [10, 10, 10], + }, + ); + let tick = tick_sequence.get_tick(0, 448, TS_8).unwrap(); + assert_swap_tick_state( + &tick, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A leftward swap on a pool with zero liquidity at the end of the tick-range. + /// |c2_______p1________|_______________|_____c1_________| + /// + /// Expectation: + /// The swap will swap some assets up to the last initialized tick and + /// the next tick index will end at the end of tick-range. + fn zero_l_after_first_tick_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 100_000, + curr_tick_index: 1720, // c1 + start_tick_index: 1408, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(0), + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![], + array_2_ticks: Some(&vec![]), + array_3_ticks: Some(&vec![TestTickInfo { + // p1 + index: 448, + liquidity_net: 100_000, + ..Default::default() + }]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 6026, + traded_amount_b: 6715, + end_tick_index: -1, // -1 a-to-b decrements by one when target price reached + end_liquidity: 0, + end_reward_growths: [10, 10, 10], + }, + ); + let tick = tick_sequence.get_tick(2, 448, TS_8).unwrap(); + assert_swap_tick_state( + &tick, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A rightward swap that traverses an empty gap with no liquidity. + /// |_______p1____c1___|____p1_______p2__|___c2__p2________| + /// + /// Expectation: + /// The swap will swap some assets up to the end of p1, jump through the gap + /// and continue swapping assets in p2 until the expected trade amount is satisfied. + fn zero_l_between_init_ticks_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 100_000, + curr_tick_index: 500, // c1 + start_tick_index: 0, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(1430), + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![TestTickInfo { + // p1 + index: 448, + liquidity_net: 100_000, + ..Default::default() + }], + array_2_ticks: Some(&vec![ + TestTickInfo { + // p1 + index: 768, + liquidity_net: -100_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 1120, + liquidity_net: 100_000, + ..Default::default() + }, + ]), + array_3_ticks: Some(&vec![TestTickInfo { + // p2 + index: 1536, + liquidity_net: -100_000, + ..Default::default() + }]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 2752, + traded_amount_b: 3036, + end_tick_index: 1430, + end_liquidity: 100000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(0, 448, TS_8).unwrap(); + let p1_upper = tick_sequence.get_tick(1, 768, TS_8).unwrap(); + assert_swap_tick_state(&p1_lower, &TickExpectation::default()); + assert_swap_tick_state( + &p1_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + let p2_lower = tick_sequence.get_tick(1, 1120, TS_8).unwrap(); + let p2_upper = tick_sequence.get_tick(2, 1536, TS_8).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state(&p2_upper, &TickExpectation::default()); + } + + #[test] + /// A leftward swap that traverses an empty gap with no liquidity. + /// |_______p1____c2___|____p1_______p2__|___c1__p2________| + /// + /// Expectation: + /// The swap will swap some assets up to the end of p2, jump through the gap + /// and continue swapping assets in p1 until the expected trade amount is satisfied. + fn zero_l_between_init_ticks_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 100_000, + curr_tick_index: 1440, // c1 + start_tick_index: 1408, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(500), + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![TestTickInfo { + // p2 + index: 1448, + liquidity_net: -100_000, + ..Default::default() + }], + array_2_ticks: Some(&vec![ + TestTickInfo { + // p1 + index: 720, + liquidity_net: -100_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 1120, + liquidity_net: 100_000, + ..Default::default() + }, + ]), + array_3_ticks: Some(&vec![TestTickInfo { + // p1 + index: 448, + liquidity_net: 100_000, + ..Default::default() + }]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 2568, + traded_amount_b: 2839, + end_tick_index: 500, + end_liquidity: 100000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(2, 448, TS_8).unwrap(); + let p1_upper = tick_sequence.get_tick(1, 720, TS_8).unwrap(); + assert_swap_tick_state(&p1_lower, &TickExpectation::default()); + assert_swap_tick_state( + &p1_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + let p2_lower = tick_sequence.get_tick(1, 1120, TS_8).unwrap(); + let p2_upper = tick_sequence.get_tick(0, 1448, TS_8).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state(&p2_upper, &TickExpectation::default()); + } + + #[test] + /// A swap that moves the price to the right to another initialized + /// tick within the same array. + /// |_c1__p1___p2____p2__c2__p1__| + /// + /// Expectation: + /// The swap will traverse through all initialized ticks (some of p1, p2) and + /// exit until the expected trade amount is satisfied. + fn next_initialized_tick_in_same_array_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 100_000, + curr_tick_index: 5, // c1 + start_tick_index: 0, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(400), + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: 8, + liquidity_net: 100_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 128, + liquidity_net: 200_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 320, + liquidity_net: -200_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: 448, + liquidity_net: -100_000, + ..Default::default() + }, + ], + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = + SwapTickSequence::new(swap_test_info.tick_arrays[0].borrow_mut(), None, None); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 5791, + traded_amount_b: 5920, + end_tick_index: 400, + end_liquidity: 200000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(0, 8, TS_8).unwrap(); + let p1_upper = tick_sequence.get_tick(0, 448, TS_8).unwrap(); + assert_swap_tick_state( + &p1_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state(&p1_upper, &TickExpectation::default()); + let p2_lower = tick_sequence.get_tick(0, 128, TS_8).unwrap(); + let p2_upper = tick_sequence.get_tick(0, 320, TS_8).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state( + &p2_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves the price to the left to another initialized + /// tick within the same array. + /// |_c2__p1___p2____p2__p1__c1_| + /// + /// Expectation: + /// The swap will traverse through all initialized ticks (some of p1, p2) and + /// exit until the expected trade amount is satisfied. + fn next_initialized_tick_in_same_array_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 100_000, + curr_tick_index: 568, // c1 + start_tick_index: 0, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(5), + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: 8, + liquidity_net: 100_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 128, + liquidity_net: 200_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 320, + liquidity_net: -200_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: 448, + liquidity_net: -100_000, + ..Default::default() + }, + ], + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = + SwapTickSequence::new(swap_test_info.tick_arrays[0].borrow_mut(), None, None); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 6850, + traded_amount_b: 7021, + end_tick_index: 5, + end_liquidity: 100000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(0, 8, TS_8).unwrap(); + let p1_upper = tick_sequence.get_tick(0, 448, TS_8).unwrap(); + assert_swap_tick_state( + &p1_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state( + &p1_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + let p2_lower = tick_sequence.get_tick(0, 128, TS_8).unwrap(); + let p2_upper = tick_sequence.get_tick(0, 320, TS_8).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state( + &p2_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves the price to the right from 1 tick-array to the next tick-array. + /// |____p1____c1____p2__|__p2__c2____p1______| + /// + /// Expectation: + /// The swap loop will traverse across the two tick-arrays on each initialized-tick and + /// at the end of the first tick-array. It will complete the swap and the next tick index + /// is in tick-array 2. + fn next_initialized_tick_in_next_array_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 11_000_000, + curr_tick_index: 25000, // c1 + start_tick_index: 22528, + trade_amount: 11_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(37000), + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: 23168, + liquidity_net: 5_000_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 28416, + liquidity_net: 6_000_000, + ..Default::default() + }, + ], + array_2_ticks: Some(&vec![ + TestTickInfo { + // p2 + index: 33920, + liquidity_net: -6_000_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: 37504, + liquidity_net: -5_000_000, + ..Default::default() + }, + ]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + None, + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 1770620, + traded_amount_b: 39429146, + end_tick_index: 37000, + end_liquidity: 11000000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(0, 23168, TS_128).unwrap(); + let p1_upper = tick_sequence.get_tick(1, 37504, TS_128).unwrap(); + assert_swap_tick_state(&p1_lower, &TickExpectation::default()); + assert_swap_tick_state(&p1_upper, &TickExpectation::default()); + let p2_lower = tick_sequence.get_tick(0, 28416, TS_128).unwrap(); + let p2_upper = tick_sequence.get_tick(1, 33920, TS_128).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state( + &p2_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves the price to the left from 1 tick-array to the next tick-array. + /// |____p1____c2____p2__|__p2__c1____p1______| + /// + /// Expectation: + /// The swap loop will traverse across the two tick-arrays on each initialized-tick and + /// at the end of tick-array 2. It will complete the swap and the next tick index + /// is in tick-array 1. + fn next_initialized_tick_in_next_array_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 11_000_000, + curr_tick_index: 37000, // c1 + start_tick_index: 29824, + trade_amount: 110_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(25000), + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![ + TestTickInfo { + // p2 + index: 30720, + liquidity_net: -6_000_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: 37504, + liquidity_net: -5_000_000, + ..Default::default() + }, + ], + array_2_ticks: Some(&vec![ + TestTickInfo { + // p1 + index: 23168, + liquidity_net: 5_000_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 28416, + liquidity_net: 6_000_000, + ..Default::default() + }, + ]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + None, + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 1579669, + traded_amount_b: 34593019, + end_tick_index: 25000, + end_liquidity: 11000000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(1, 23168, TS_128).unwrap(); + let p1_upper = tick_sequence.get_tick(0, 37504, TS_128).unwrap(); + assert_swap_tick_state(&p1_lower, &TickExpectation::default()); + assert_swap_tick_state(&p1_upper, &TickExpectation::default()); + let p2_lower = tick_sequence.get_tick(1, 28416, TS_128).unwrap(); + let p2_upper = tick_sequence.get_tick(0, 30720, TS_128).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state( + &p2_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves the price to the right, jumping a tick-array with 0 + /// initialized tick in between. + /// |____p1____c1____p2__|_________________|__p2___c2__p1______| + /// + /// Expectation: + /// The swap loop will traverse across the tick-range on each initialized-tick and + /// at the end of all traversed tick-arrays. It will complete the swap and the next tick index + /// is in tick-array 3. + fn next_initialized_tick_not_in_adjacent_array_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 11_000_000, + curr_tick_index: 30080, // c1 + start_tick_index: 29824, + trade_amount: 10_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(57000), + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: 29952, + liquidity_net: 5_000_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 30336, + liquidity_net: 6_000_000, + ..Default::default() + }, + ], + array_2_ticks: Some(&vec![]), // 41,088 + array_3_ticks: Some(&vec![ + // 52,352 + TestTickInfo { + // p2 + index: 56192, + liquidity_net: -6_000_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: 57216, + liquidity_net: -5_000_000, + ..Default::default() + }, + ]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 2763589, + traded_amount_b: 212908090, + end_tick_index: 57000, + end_liquidity: 11000000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(0, 29952, TS_128).unwrap(); + let p1_upper = tick_sequence.get_tick(2, 57216, TS_128).unwrap(); + assert_swap_tick_state(&p1_lower, &TickExpectation::default()); + assert_swap_tick_state(&p1_upper, &TickExpectation::default()); + let p2_lower = tick_sequence.get_tick(0, 30336, TS_128).unwrap(); + let p2_upper = tick_sequence.get_tick(2, 56192, TS_128).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state( + &p2_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves the price to the left, jumping a tick-array with 0 + /// initialized tick in between. + /// |____p1____c2____p2__|_________________|__p2___c1__p1______| + /// + /// Expectation: + /// The swap loop will traverse across the tick-range on each initialized-tick and + /// at the end of all traversed tick-arrays. It will complete the swap and the next tick index + /// is in tick-array 1. + fn next_initialized_tick_not_in_adjacent_array_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 11_000_000, + curr_tick_index: 48896, // c1 + start_tick_index: 48256, + trade_amount: 117_900_000, + sqrt_price_limit: sqrt_price_from_tick_index(0), + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![ + TestTickInfo { + // p2 + index: 48512, + liquidity_net: -6_000_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: 49280, + liquidity_net: -5_000_000, + ..Default::default() + }, + ], + array_2_ticks: Some(&vec![]), + array_3_ticks: Some(&vec![ + TestTickInfo { + // p1 + index: 29952, + liquidity_net: 5_000_000, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 30336, + liquidity_net: 6_000_000, + ..Default::default() + }, + ]), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 2281190, + traded_amount_b: 117900000, + end_tick_index: 30041, + end_liquidity: 11000000, + end_reward_growths: [10, 10, 10], + }, + ); + let p1_lower = tick_sequence.get_tick(2, 29952, TS_128).unwrap(); + let p1_upper = tick_sequence.get_tick(0, 49280, TS_128).unwrap(); + assert_swap_tick_state(&p1_lower, &TickExpectation::default()); + assert_swap_tick_state(&p1_upper, &TickExpectation::default()); + let p2_lower = tick_sequence.get_tick(2, 30336, TS_128).unwrap(); + let p2_upper = tick_sequence.get_tick(0, 48512, TS_128).unwrap(); + assert_swap_tick_state( + &p2_lower, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + assert_swap_tick_state( + &p2_upper, + &TickExpectation { + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves across towards the right on all tick-arrays + /// with no initialized-ticks in the tick-range, but has the liquidity to support it + /// as long as sqrt_price or amount stops in the tick-range. + /// |c1_____________|_________________|________________c2|...limit + /// + /// Expectation: + /// The swap loop will traverse across the tick-range on the last index of each tick-array. + /// It will complete the swap at the end of the tick-range. + fn no_initialized_tick_range_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 500_000, + curr_tick_index: -322176, // c1 + start_tick_index: -322176, + trade_amount: 1_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(0), + amount_specified_is_input: false, + a_to_b: false, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 1_000_000_000_000, + traded_amount_b: 1, + end_tick_index: -317663, + end_liquidity: 500000, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves across towards the right on all tick-arrays + /// with no initialized-ticks in the tick-range, but has the liquidity to support it. + /// |c1_____________|_________________|_________________|...limit + /// + /// Expectation: + /// The swap loop will fail if the sqrt_price exceeds the last tick of the last array + #[should_panic(expected = "TickArraySequenceInvalidIndex")] + fn sqrt_price_exceeds_tick_range_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 500_000, + curr_tick_index: -322176, // c1 + start_tick_index: -322176, + trade_amount: 100_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(0), + amount_specified_is_input: false, + a_to_b: false, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 1_000_000_000_000, + traded_amount_b: 1, + end_tick_index: -317663, + end_liquidity: 500000, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves across towards the left on all tick-arrays + /// with no initialized-ticks in the tick-range, but has the liquidity to support it, + /// as long as sqrt_price or amount stops in the tick-range. + /// |limit, c2____________|_________________|____c1__________| + /// -326656 -315,392 -304,128 -292,864 + /// + /// Expectation: + /// The swap loop will traverse across the tick-range on the last index of each tick-array. + /// It will complete the swap at the start of the tick-range. + /// + fn no_initialized_tick_range_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 11_000_000, + curr_tick_index: -302080, // c1 + start_tick_index: -304128, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(-326656), + amount_specified_is_input: false, + a_to_b: true, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 96362985379416, + traded_amount_b: 2, + end_tick_index: -326657, // -1 because swap crossed 340608 and is an initialized tick + end_liquidity: 11000000, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// A swap that moves across towards past the left on all tick-arrays + /// with no initialized-ticks in the tick-range, but has the liquidity to support it. + /// limit |____________|_________________|____c1__________| + /// -326656 -315,392 -304,128 -292,864 + /// + /// Expectation: + /// The swap loop will fail if the sqrt_price exceeds the last tick of the last array + #[should_panic(expected = "TickArraySequenceInvalidIndex")] + fn sqrt_price_exceeds_tick_range_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 11_000_000, + curr_tick_index: -302080, // c1 + start_tick_index: -304128, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(-326657), + amount_specified_is_input: false, + a_to_b: true, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 96362985379416, + traded_amount_b: 2, + end_tick_index: -326657, // -1 because swap crossed 340608 and is an initialized tick + end_liquidity: 11000000, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + #[should_panic(expected = "MultiplicationShiftRightOverflow")] + /// A swap in a pool with maximum liquidity that reaches the maximum tick + /// |__p1_____c1______p1_c2|max + /// + /// Expectation: + /// The swap will error on `TokenMaxExceeded` as it is not possible to increment more than the maximum token allowed. + fn max_l_at_max_tick_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: u64::MAX as u128, + curr_tick_index: 442500, // c1 + start_tick_index: 442368, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(443636), + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: 442496, + liquidity_net: 500_000_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: 443520, + liquidity_net: -500_000_000, + ..Default::default() + }, + ], + array_2_ticks: None, + array_3_ticks: None, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let _post_swap = swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + /// A swap in a pool that reaches the minimum tick + /// l = 0 + /// min|c2_p1_____c1___p1| + /// + /// Expectation: + /// The swap will not trade anything and end of the min-tick-index. + fn min_l_at_min_sqrt_price_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 500_000_000, + curr_tick_index: -442500, // c1 + start_tick_index: -451584, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(-443636), + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: -442496, + liquidity_net: -500_000_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: -443520, + liquidity_net: 500_000_000, + ..Default::default() + }, + ], + array_2_ticks: None, + array_3_ticks: None, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 106151097514387301, + traded_amount_b: 0, + end_tick_index: -443637, + end_liquidity: 0, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + /// The swap crosses the last tick of a tick array and then continues + /// into the next tick array. + /// + /// |__________c1|t1|________c2____|_____________| + /// -33792 -22528 -11264 + fn traversal_from_last_tick_in_array_to_next_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 7587362620357, + curr_tick_index: -22657, // c1 + start_tick_index: -33792, + trade_amount: 10_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(-22300), + amount_specified_is_input: true, + a_to_b: false, + array_1_ticks: &vec![TestTickInfo { + // p1 + index: -22656, + liquidity_net: 100, + ..Default::default() + }], + array_2_ticks: Some(&vec![TestTickInfo { + // p1 + index: -22400, + liquidity_net: -100, + ..Default::default() + }]), + array_3_ticks: Some(&vec![]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 95975095232, + traded_amount_b: 10000000000, + end_tick_index: -22576, + end_liquidity: 7587362620457, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// The swap crosses the first tick of the tick array and then continues + /// into the next tick array. + /// + /// |__________|________c2____|t1|c1___________| + /// -33792 -22528 -11264 + fn traversal_from_last_tick_in_array_to_next_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 7587362620357, + curr_tick_index: -11135, // c1 + start_tick_index: -11264, + trade_amount: 100_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(-22300), + amount_specified_is_input: true, + a_to_b: true, + array_1_ticks: &vec![TestTickInfo { + // p1 + index: -11264, + liquidity_net: 100, + ..Default::default() + }], + array_2_ticks: Some(&vec![TestTickInfo { + // p1 + index: -22400, + liquidity_net: -100, + ..Default::default() + }]), + array_3_ticks: Some(&vec![]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 9897370858896, + traded_amount_b: 1860048818693, + end_tick_index: -22300, + end_liquidity: 7587362620257, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// + /// |_______c1___t1|__________t2|__________t3,c2| + /// -33792 -22528 -11264 + fn traversal_to_last_tick_in_next_array_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 7587362620357, + curr_tick_index: -22784, // c1 + start_tick_index: -33792, + trade_amount: 10_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(-2), + amount_specified_is_input: true, + a_to_b: false, + array_1_ticks: &vec![TestTickInfo { + index: -22784, + liquidity_net: 100, + ..Default::default() + }], + array_2_ticks: Some(&vec![TestTickInfo { + index: -11392, + liquidity_net: 100, + ..Default::default() + }]), + array_3_ticks: Some(&vec![TestTickInfo { + index: -256, + liquidity_net: -100, + ..Default::default() + }]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 16115482403568, + traded_amount_b: 5157940702072, + end_tick_index: -2, + end_liquidity: 7587362620357, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// + /// |_______c1___t1|__________t2|__________t3,c2| + /// -33792 -22528 -11264 + fn traversal_to_last_tick_in_last_array_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 7587362620357, + curr_tick_index: -22784, // c1 + start_tick_index: -33792, + trade_amount: 10_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(-128), + amount_specified_is_input: true, + a_to_b: false, + array_1_ticks: &vec![TestTickInfo { + index: -22784, + liquidity_net: 100, + ..Default::default() + }], + array_2_ticks: Some(&vec![TestTickInfo { + index: -11392, + liquidity_net: 100, + ..Default::default() + }]), + array_3_ticks: Some(&vec![TestTickInfo { + index: -128, + liquidity_net: -100, + ..Default::default() + }]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 16067528741228, + traded_amount_b: 5110297712223, + end_tick_index: -128, + end_liquidity: 7587362620357, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// + /// |t1c1__________|t2___________|_________t1c1| + /// -33792 -22528 -11264 + fn traversal_to_last_tick_in_next_array_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 7587362620357, + curr_tick_index: -256, // c1 + start_tick_index: -11264, + trade_amount: 100_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(-33791), + amount_specified_is_input: true, + a_to_b: true, + array_1_ticks: &vec![TestTickInfo { + index: -256, + liquidity_net: -100, + ..Default::default() + }], + array_2_ticks: Some(&vec![TestTickInfo { + index: -22528, + liquidity_net: 100, + ..Default::default() + }]), + array_3_ticks: Some(&vec![TestTickInfo { + index: -33792, + liquidity_net: 100, + ..Default::default() + }]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 33412493784228, + traded_amount_b: 6090103077425, + end_tick_index: -33791, + end_liquidity: 7587362620357, + end_reward_growths: [10, 10, 10], + }, + ); + } + + #[test] + /// + /// |t1c1__________|t2___________|_________t1c1| + /// -33792 -22528 -11264 + fn traversal_to_last_tick_in_last_array_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 7587362620357, + curr_tick_index: -256, // c1 + start_tick_index: -11264, + trade_amount: 100_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(-33792), + amount_specified_is_input: true, + a_to_b: true, + array_1_ticks: &vec![TestTickInfo { + index: -256, + liquidity_net: -100, + ..Default::default() + }], + array_2_ticks: Some(&vec![]), + array_3_ticks: Some(&vec![TestTickInfo { + index: -33792, + liquidity_net: 100, + ..Default::default() + }]), + reward_infos: create_whirlpool_reward_infos(100, 10), + fee_growth_global_a: 100, + fee_growth_global_b: 100, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 33414548612789, + traded_amount_b: 6090173110437, + end_tick_index: -33793, + end_liquidity: 7587362620357, + end_reward_growths: [10, 10, 10], + }, + ); + } +} + +#[cfg(test)] +mod swap_sqrt_price_tests { + use super::*; + use crate::util::test_utils::swap_test_fixture::*; + + #[test] + #[should_panic(expected = "SqrtPriceOutOfBounds")] + /// A swap with the price limit over the max price limit. + /// |__p1_____p1_____c1___max|...limit| + /// + /// Expectation: + /// Fail on out of bounds sqrt-price-limit. + fn sqrt_price_limit_over_max_tick() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 500, + curr_tick_index: 442500, // c1 + start_tick_index: 442368, + trade_amount: 100_000_000_000_000_000, + sqrt_price_limit: MAX_SQRT_PRICE_X64 + 1, + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + /// An attempt to swap to the maximum tick without the last initializable tick + /// being initialized + /// |__p1_____p1_____c1___c2,max,limit| + /// + /// Expectation: + /// Successfully swap to the maximum tick / maximum sqrt-price + fn sqrt_price_limit_at_max_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 10, + curr_tick_index: 443635, // c1 + start_tick_index: 442368, + trade_amount: 100_000_000_000_000_000, + sqrt_price_limit: MAX_SQRT_PRICE_X64, + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 0, + traded_amount_b: 2147283, + end_tick_index: 443636, + end_liquidity: 10, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + /// A rightward swap that is limited by the max price limit. + /// |____p1______c1______p1_c2,max,limit| + /// + /// Expectation: + /// The swap will complete at the maximum tick index + fn sqrt_price_limit_at_max_with_last_init_tick_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 500, + curr_tick_index: 442500, // c1 + start_tick_index: 442368, + trade_amount: 100_000_000_000_000_000, + sqrt_price_limit: MAX_SQRT_PRICE_X64, // c2, limit + amount_specified_is_input: false, + a_to_b: false, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: 442496, + liquidity_net: 500, + ..Default::default() + }, + TestTickInfo { + // p2 + index: 443520, + liquidity_net: -500, + ..Default::default() + }, + ], + array_2_ticks: None, + array_3_ticks: None, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 0, + traded_amount_b: 106151097576, + end_tick_index: 443636, + end_liquidity: 0, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + #[should_panic(expected = "SqrtPriceOutOfBounds")] + /// A swap with the price limit under the min price limit. + /// |limit...|min____c2____c1____| + /// + /// Expectation: + /// Fail on out of bounds sqrt-price-limit. + fn sqrt_price_limit_under_min_tick() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 500, + curr_tick_index: -443500, // c1 + start_tick_index: -451584, + trade_amount: 100_000_000_000_000_000, + sqrt_price_limit: MIN_SQRT_PRICE_X64 - 1, + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![], + array_2_ticks: None, + array_3_ticks: None, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + /// A leftward swap into the min price with the price limit set at min price. + /// |limit,min,p1,c2______c1______| + /// + /// Expectation: + /// The swap will succeed and exits at the minimum tick index + fn sqrt_price_limit_at_min_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 50_000_000, + curr_tick_index: -442620, // c1 + start_tick_index: -451584, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(-443636), // c2, limit + amount_specified_is_input: false, + a_to_b: true, + array_1_ticks: &vec![ + TestTickInfo { + // p1 + index: -442624, + liquidity_net: -500_000_000, + ..Default::default() + }, + TestTickInfo { + // p1 + index: -443520, + liquidity_net: 550_000_000, + ..Default::default() + }, + ], + array_2_ticks: None, + array_3_ticks: None, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 102927825595253698, + traded_amount_b: 0, + end_tick_index: -443637, + end_liquidity: 0, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + /// A leftward swap with the sqrt-price limit lower than the swap-target. + /// |______limit____c2_____c1_| + /// + /// Expectation: + /// The swap will succeed and exits when expected trade amount is swapped. + fn sqrt_price_limit_under_current_tick_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000_000, + curr_tick_index: -225365, // c1 + start_tick_index: -225792, + trade_amount: 100, + sqrt_price_limit: sqrt_price_from_tick_index(-226000), // limit + amount_specified_is_input: false, + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 613293650976, + traded_amount_b: 100, + end_tick_index: -225397, + end_liquidity: 5_000_000_000, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + /// A leftward swap with the sqrt-price limit higher than the swap target. + /// |______c2____limit______c1_| + /// + /// Expectation: + /// Swap will be stopped at the sqrt-price-limit + fn sqrt_price_limit_under_current_tick_stop_limit_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000_000, + curr_tick_index: -225365, // c1 + start_tick_index: -225792, + trade_amount: 100, + sqrt_price_limit: sqrt_price_from_tick_index(-225380), // limit + amount_specified_is_input: false, + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 293539494127, + traded_amount_b: 47, + end_tick_index: -225380, + end_liquidity: 5_000_000_000, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + #[should_panic(expected = "InvalidSqrtPriceLimitDirection")] + /// A rightward swap with the sqrt-price below the current tick index. + /// |______limit____c1_____c2_| + /// + /// Expectation: + /// Swap will fail because the sqrt-price limit is in the opposite direction. + fn sqrt_price_limit_under_current_tick_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000_000, + curr_tick_index: -225365, // c1 + start_tick_index: -225792, + trade_amount: 100, + sqrt_price_limit: sqrt_price_from_tick_index(-225790), // limit + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + /// A leftward swap with the sqrt-price limit at the current tick index. + /// |__c2____limit,c1_______| + /// + /// Expectation: + /// Swap will not swap and exit on the price limit since it cannot proceed into the price limit. + fn sqrt_price_limit_at_current_tick_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000_000, + curr_tick_index: -225365, // c1 + start_tick_index: -225792, + trade_amount: 100, + sqrt_price_limit: sqrt_price_from_tick_index(-225365), // limit + amount_specified_is_input: false, + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 0, + traded_amount_b: 0, + end_tick_index: -225365, + end_liquidity: 5_000_000_000, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + /// A rightward swap with the sqrt-price limit at the current tick index. + /// |____c1,limit__c2__| + /// + /// Expectation: + /// Swap will not swap and exit on the price limit since it cannot proceed into the price limit. + fn sqrt_price_limit_at_current_tick_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000_000, + curr_tick_index: -225365, // c1 + start_tick_index: -225792, + trade_amount: 100, + sqrt_price_limit: sqrt_price_from_tick_index(-225365), // limit + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 0, + traded_amount_b: 0, + end_tick_index: -225365, + end_liquidity: 5_000_000_000, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + #[should_panic(expected = "InvalidSqrtPriceLimitDirection")] + /// A leftward swap with the sqrt-price limit higher than the current tick index. + /// |____c2___c1___limit__| + /// + /// Expectation: + /// Swap will fail because price limit is in the wrong direction. + fn sqrt_price_limit_over_current_tick_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000, + curr_tick_index: 64900, // c1 + start_tick_index: 64512, + trade_amount: 100_000, + sqrt_price_limit: sqrt_price_from_tick_index(65000), // limit + amount_specified_is_input: false, + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + /// A rightward swap with the sqrt-price limit higher than the current tick index. + /// |__c1_____c2___limit__| + /// + /// Expectataion: + /// The swap will succeed and exits when expected trade amount is swapped. + fn sqrt_price_limit_over_current_tick_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000, + curr_tick_index: 64900, // c1 + start_tick_index: 64512, + trade_amount: 100, + sqrt_price_limit: sqrt_price_from_tick_index(65388), // limit + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 100, + traded_amount_b: 65865, + end_tick_index: 64910, + end_liquidity: 5_000_000, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + /// A rightward swap with the sqrt-price limit lower than the next tick index. + /// |____c1____limit__c2__| + /// + /// Expectataion: + /// The swap will succeed and exits at the sqrt-price limit. + fn sqrt_price_limit_over_current_tick_stop_limit_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000, + curr_tick_index: 64900, // c1 + start_tick_index: 64512, + trade_amount: 100, + sqrt_price_limit: sqrt_price_from_tick_index(64905), // limit + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 48, + traded_amount_b: 32075, + end_tick_index: 64905, + end_liquidity: 5_000_000, + end_reward_growths: [0, 0, 0], + }, + ) + } +} + +#[cfg(test)] +mod swap_error_tests { + use super::*; + use crate::util::test_utils::swap_test_fixture::*; + + #[test] + #[should_panic(expected = "TickArraySequenceInvalidIndex")] + /// A swap with a price limit outside of the tick-range and a large + /// enough expected trade amount to move the next tick-index out of the tick-range + /// limit,c2...|____________|_________________|____c1__________| + /// + /// Expectation: + /// Fail on InvalidTickSequence as the tick-range is insufficent for the trade request. + fn insufficient_tick_array_range_test_a_to_b() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000, + curr_tick_index: 0, // c1 + start_tick_index: 0, + trade_amount: 1_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(-5576), // limit + amount_specified_is_input: false, + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + #[should_panic(expected = "TickArraySequenceInvalidIndex")] + /// A swap with a price limit outside of the tick-range and a large + /// enough expected trade amount to move the next tick-index out of the tick-range + /// |__c1__________|_________________|______________|...limit,c2 + /// + /// Expectation: + /// Fail on InvalidTickSequence as the tick-range is insufficent for the trade request. + fn insufficient_tick_array_range_test_b_to_a() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000, + curr_tick_index: 0, // c1 + start_tick_index: 0, + trade_amount: 1_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(5576), // limit + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + /// A swap with the pool's current tick index at sqrt-price 0. + /// + /// Expectation: + /// The swap should succeed without dividing by 0. + fn swap_starts_from_sqrt_price_0() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000_000, + curr_tick_index: 0, // c1 + start_tick_index: 0, + trade_amount: 1_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(576), // limit + amount_specified_is_input: false, + a_to_b: false, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 1000000, + traded_amount_b: 1000201, + end_tick_index: 4, + end_liquidity: 5_000_000_000, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + /// A swap with the pool's next tick index at sqrt-price 0. + /// + /// Expectation: + /// The swap should succeed without dividing by 0. + fn swap_ends_at_sqrt_price_0() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 119900, + curr_tick_index: 10, // c1 + start_tick_index: 0, + trade_amount: 59, + sqrt_price_limit: sqrt_price_from_tick_index(-5), // limit + amount_specified_is_input: false, + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.run(&mut tick_sequence, 100); + assert_swap( + &post_swap, + &SwapTestExpectation { + traded_amount_a: 59, + traded_amount_b: 59, + end_tick_index: 0, + end_liquidity: 119900, + end_reward_growths: [0, 0, 0], + }, + ) + } + + #[test] + #[should_panic(expected = "ZeroTradableAmount")] + /// A swap with zero tradable amount. + /// + /// Expectation + /// The swap should go through without moving the price and swappping anything. + fn swap_zero_tokens() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_8, + liquidity: 5_000_000_000, + curr_tick_index: -225365, // c1 + start_tick_index: -225792, + trade_amount: 0, + sqrt_price_limit: sqrt_price_from_tick_index(-225380), // limit + amount_specified_is_input: false, + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + #[test] + #[should_panic(expected = "InvalidTimestamp")] + /// A swap with an invalid timestamp. + /// + /// Expectation + /// The swap should fail due to the current timestamp being stale. + fn swap_invalid_timestamp() { + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 500_000, + curr_tick_index: -322176, + start_tick_index: -322176, + trade_amount: 1_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(0), + amount_specified_is_input: false, + a_to_b: false, + reward_last_updated_timestamp: 1000, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + + + #[test] + #[should_panic(expected = "AmountCalcOverflow")] + // Swapping at high liquidity/price can lead to an amount calculated + // overflow u64 + // + // Expectation + // The swap should fail to do amount calculated overflowing. + fn swap_does_not_overflow() { + // Use filled arrays to minimize the the overflow from calculations, rather than accumulation + let array_1_ticks: Vec = build_filled_tick_array(439296, TS_128); + let array_2_ticks: Vec = build_filled_tick_array(439296 - 88 * 128, TS_128); + let array_3_ticks: Vec = build_filled_tick_array(439296 - 2 * 88 * 128, TS_128); + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: (u32::MAX as u128) << 2, + curr_tick_index: MAX_TICK_INDEX - 1, // c1 + start_tick_index: 439296, + trade_amount: 1_000_000_000_000, + sqrt_price_limit: sqrt_price_from_tick_index(0), // limit + amount_specified_is_input: true, + array_1_ticks: &array_1_ticks, + array_2_ticks: Some(&array_2_ticks), + array_3_ticks: Some(&array_3_ticks), + a_to_b: true, + ..Default::default() + }); + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + swap_test_info.run(&mut tick_sequence, 100); + } + +} diff --git a/programs/whirlpool/src/manager/tick_manager.rs b/programs/whirlpool/src/manager/tick_manager.rs new file mode 100644 index 0000000..a8f27ab --- /dev/null +++ b/programs/whirlpool/src/manager/tick_manager.rs @@ -0,0 +1,866 @@ +use crate::{ + errors::ErrorCode, + math::add_liquidity_delta, + state::{Tick, TickUpdate, WhirlpoolRewardInfo, NUM_REWARDS}, +}; + +pub fn next_tick_cross_update( + tick: &Tick, + fee_growth_global_a: u128, + fee_growth_global_b: u128, + reward_infos: &[WhirlpoolRewardInfo; NUM_REWARDS], +) -> Result { + let mut update = TickUpdate::from(tick); + + update.fee_growth_outside_a = fee_growth_global_a.wrapping_sub(tick.fee_growth_outside_a); + update.fee_growth_outside_b = fee_growth_global_b.wrapping_sub(tick.fee_growth_outside_b); + + for i in 0..NUM_REWARDS { + if !reward_infos[i].initialized() { + continue; + } + + update.reward_growths_outside[i] = reward_infos[i] + .growth_global_x64 + .wrapping_sub(tick.reward_growths_outside[i]); + } + Ok(update) +} + +pub fn next_tick_modify_liquidity_update( + tick: &Tick, + tick_index: i32, + tick_current_index: i32, + fee_growth_global_a: u128, + fee_growth_global_b: u128, + reward_infos: &[WhirlpoolRewardInfo; NUM_REWARDS], + liquidity_delta: i128, + is_upper_tick: bool, +) -> Result { + // noop if there is no change in liquidity + if liquidity_delta == 0 { + return Ok(TickUpdate::from(tick)); + } + + let liquidity_gross = add_liquidity_delta(tick.liquidity_gross, liquidity_delta)?; + + // Update to an uninitialized tick if remaining liquidity is being removed + if liquidity_gross == 0 { + return Ok(TickUpdate::default()); + } + + let (fee_growth_outside_a, fee_growth_outside_b, reward_growths_outside) = + if tick.liquidity_gross == 0 { + // By convention, assume all prior growth happened below the tick + if tick_current_index >= tick_index { + ( + fee_growth_global_a, + fee_growth_global_b, + WhirlpoolRewardInfo::to_reward_growths(reward_infos), + ) + } else { + (0, 0, [0; NUM_REWARDS]) + } + } else { + ( + tick.fee_growth_outside_a, + tick.fee_growth_outside_b, + tick.reward_growths_outside, + ) + }; + + let liquidity_net = if is_upper_tick { + tick.liquidity_net + .checked_sub(liquidity_delta) + .ok_or(ErrorCode::LiquidityNetError)? + } else { + tick.liquidity_net + .checked_add(liquidity_delta) + .ok_or(ErrorCode::LiquidityNetError)? + }; + + Ok(TickUpdate { + initialized: true, + liquidity_net, + liquidity_gross, + fee_growth_outside_a, + fee_growth_outside_b, + reward_growths_outside, + }) +} + +// Calculates the fee growths inside of tick_lower and tick_upper based on their +// index relative to tick_current_index. +pub fn next_fee_growths_inside( + tick_current_index: i32, + tick_lower: &Tick, + tick_lower_index: i32, + tick_upper: &Tick, + tick_upper_index: i32, + fee_growth_global_a: u128, + fee_growth_global_b: u128, +) -> (u128, u128) { + // By convention, when initializing a tick, all fees have been earned below the tick. + let (fee_growth_below_a, fee_growth_below_b) = if !tick_lower.initialized { + (fee_growth_global_a, fee_growth_global_b) + } else if tick_current_index < tick_lower_index { + ( + fee_growth_global_a.wrapping_sub(tick_lower.fee_growth_outside_a), + fee_growth_global_b.wrapping_sub(tick_lower.fee_growth_outside_b), + ) + } else { + ( + tick_lower.fee_growth_outside_a, + tick_lower.fee_growth_outside_b, + ) + }; + + // By convention, when initializing a tick, no fees have been earned above the tick. + let (fee_growth_above_a, fee_growth_above_b) = if !tick_upper.initialized { + (0, 0) + } else if tick_current_index < tick_upper_index { + ( + tick_upper.fee_growth_outside_a, + tick_upper.fee_growth_outside_b, + ) + } else { + ( + fee_growth_global_a.wrapping_sub(tick_upper.fee_growth_outside_a), + fee_growth_global_b.wrapping_sub(tick_upper.fee_growth_outside_b), + ) + }; + + ( + fee_growth_global_a + .wrapping_sub(fee_growth_below_a) + .wrapping_sub(fee_growth_above_a), + fee_growth_global_b + .wrapping_sub(fee_growth_below_b) + .wrapping_sub(fee_growth_above_b), + ) +} + +// Calculates the reward growths inside of tick_lower and tick_upper based on their positions +// relative to tick_current_index. An uninitialized reward will always have a reward growth of zero. +pub fn next_reward_growths_inside( + tick_current_index: i32, + tick_lower: &Tick, + tick_lower_index: i32, + tick_upper: &Tick, + tick_upper_index: i32, + reward_infos: &[WhirlpoolRewardInfo; NUM_REWARDS], +) -> ([u128; NUM_REWARDS]) { + let mut reward_growths_inside = [0; NUM_REWARDS]; + + for i in 0..NUM_REWARDS { + if !reward_infos[i].initialized() { + continue; + } + + // By convention, assume all prior growth happened below the tick + let reward_growths_below = if !tick_lower.initialized { + reward_infos[i].growth_global_x64 + } else if tick_current_index < tick_lower_index { + reward_infos[i] + .growth_global_x64 + .wrapping_sub(tick_lower.reward_growths_outside[i]) + } else { + tick_lower.reward_growths_outside[i] + }; + + // By convention, assume all prior growth happened below the tick, not above + let reward_growths_above = if !tick_upper.initialized { + 0 + } else if tick_current_index < tick_upper_index { + tick_upper.reward_growths_outside[i] + } else { + reward_infos[i] + .growth_global_x64 + .wrapping_sub(tick_upper.reward_growths_outside[i]) + }; + + reward_growths_inside[i] = reward_infos[i] + .growth_global_x64 + .wrapping_sub(reward_growths_below) + .wrapping_sub(reward_growths_above); + } + + reward_growths_inside +} + +#[cfg(test)] +mod tick_manager_tests { + use anchor_lang::prelude::Pubkey; + + use crate::{ + errors::ErrorCode, + manager::tick_manager::{ + next_fee_growths_inside, next_tick_cross_update, next_tick_modify_liquidity_update, + TickUpdate, + }, + math::Q64_RESOLUTION, + state::{tick_builder::TickBuilder, Tick, WhirlpoolRewardInfo, NUM_REWARDS}, + }; + + use super::next_reward_growths_inside; + + fn create_test_whirlpool_reward_info( + emissions_per_second_x64: u128, + growth_global_x64: u128, + initialized: bool, + ) -> WhirlpoolRewardInfo { + WhirlpoolRewardInfo { + mint: if initialized { + Pubkey::new_unique() + } else { + Pubkey::default() + }, + emissions_per_second_x64, + growth_global_x64, + ..Default::default() + } + } + + #[test] + fn test_next_fee_growths_inside() { + struct Test<'a> { + name: &'a str, + tick_current_index: i32, + tick_lower: Tick, + tick_lower_index: i32, + tick_upper: Tick, + tick_upper_index: i32, + fee_growth_global_a: u128, + fee_growth_global_b: u128, + expected_fee_growths_inside: (u128, u128), + } + + for test in [ + Test { + name: "current tick index below ticks", + tick_current_index: -200, + tick_lower: Tick { + initialized: true, + fee_growth_outside_a: 2000, + fee_growth_outside_b: 1000, + ..Default::default() + }, + tick_lower_index: -100, + tick_upper: Tick { + initialized: true, + fee_growth_outside_a: 1000, + fee_growth_outside_b: 1000, + ..Default::default() + }, + tick_upper_index: 100, + fee_growth_global_a: 3000, + fee_growth_global_b: 3000, + expected_fee_growths_inside: (1000, 0), + }, + Test { + name: "current tick index between ticks", + tick_current_index: -20, + tick_lower: Tick { + initialized: true, + fee_growth_outside_a: 2000, + fee_growth_outside_b: 1000, + ..Default::default() + }, + tick_lower_index: -20, + tick_upper: Tick { + initialized: true, + fee_growth_outside_a: 1500, + fee_growth_outside_b: 1000, + ..Default::default() + }, + tick_upper_index: 100, + fee_growth_global_a: 4000, + fee_growth_global_b: 3000, + expected_fee_growths_inside: (500, 1000), + }, + Test { + name: "current tick index above ticks", + tick_current_index: 200, + tick_lower: Tick { + initialized: true, + fee_growth_outside_a: 2000, + fee_growth_outside_b: 1000, + ..Default::default() + }, + tick_lower_index: -100, + tick_upper: Tick { + initialized: true, + fee_growth_outside_a: 2500, + fee_growth_outside_b: 2000, + ..Default::default() + }, + tick_upper_index: 100, + fee_growth_global_a: 3000, + fee_growth_global_b: 3000, + expected_fee_growths_inside: (500, 1000), + }, + ] { + // System under test + let (fee_growth_inside_a, fee_growth_inside_b) = next_fee_growths_inside( + test.tick_current_index, + &test.tick_lower, + test.tick_lower_index, + &test.tick_upper, + test.tick_upper_index, + test.fee_growth_global_a, + test.fee_growth_global_b, + ); + assert_eq!( + fee_growth_inside_a, test.expected_fee_growths_inside.0, + "{} - fee_growth_inside_a", + test.name + ); + assert_eq!( + fee_growth_inside_b, test.expected_fee_growths_inside.1, + "{} - fee_growth_inside_b", + test.name + ); + } + } + + #[test] + fn test_next_reward_growths_inside() { + struct Test<'a> { + name: &'a str, + tick_current_index: i32, + tick_lower: Tick, + tick_lower_index: i32, + tick_upper: Tick, + tick_upper_index: i32, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + expected_reward_growths_inside: [u128; NUM_REWARDS], + } + + for test in [ + Test { + name: "current tick index below ticks zero rewards", + tick_lower: Tick { + initialized: true, + reward_growths_outside: [100, 666, 69420], + ..Default::default() + }, + tick_lower_index: -100, + tick_upper: Tick { + initialized: true, + reward_growths_outside: [100, 666, 69420], + ..Default::default() + }, + tick_upper_index: 100, + tick_current_index: -200, + reward_infos: [ + create_test_whirlpool_reward_info(1, 500, true), + create_test_whirlpool_reward_info(1, 1000, true), + create_test_whirlpool_reward_info(1, 70000, true), + ], + expected_reward_growths_inside: [0, 0, 0], + }, + Test { + name: "current tick index between ticks", + tick_lower: Tick { + initialized: true, + reward_growths_outside: [200, 134, 480], + ..Default::default() + }, + tick_lower_index: -100, + tick_upper: Tick { + initialized: true, + reward_growths_outside: [100, 666, 69420], + ..Default::default() + }, + tick_upper_index: 100, + tick_current_index: 10, + reward_infos: [ + create_test_whirlpool_reward_info(1, 1000, true), + create_test_whirlpool_reward_info(1, 2000, true), + create_test_whirlpool_reward_info(1, 80000, true), + ], + expected_reward_growths_inside: [700, 1200, 10100], + }, + Test { + name: "current tick index above ticks", + tick_lower: Tick { + reward_growths_outside: [200, 134, 480], + initialized: true, + ..Default::default() + }, + tick_lower_index: -100, + tick_upper: Tick { + initialized: true, + reward_growths_outside: [900, 1334, 10580], + ..Default::default() + }, + tick_upper_index: 100, + tick_current_index: 250, + reward_infos: [ + create_test_whirlpool_reward_info(1, 1000, true), + create_test_whirlpool_reward_info(1, 2000, true), + create_test_whirlpool_reward_info(1, 80000, true), + ], + expected_reward_growths_inside: [700, 1200, 10100], + }, + Test { + name: "uninitialized rewards no-op", + tick_lower: Tick { + initialized: true, + reward_growths_outside: [200, 134, 480], + ..Default::default() + }, + tick_lower_index: -100, + tick_upper: Tick { + initialized: true, + reward_growths_outside: [900, 1334, 10580], + ..Default::default() + }, + tick_upper_index: 100, + tick_current_index: 250, + reward_infos: [ + create_test_whirlpool_reward_info(1, 1000, true), + create_test_whirlpool_reward_info(1, 2000, false), + create_test_whirlpool_reward_info(1, 80000, false), + ], + expected_reward_growths_inside: [700, 0, 0], + }, + ] { + // System under test + let results = next_reward_growths_inside( + test.tick_current_index, + &test.tick_lower, + test.tick_lower_index, + &test.tick_upper, + test.tick_upper_index, + &test.reward_infos, + ); + + for i in 0..NUM_REWARDS { + assert_eq!( + results[i], test.expected_reward_growths_inside[i], + "[{}] {} - reward growth value not equal", + i, test.name + ); + assert_eq!( + results[i], test.expected_reward_growths_inside[i], + "[{}] {} - reward growth initialized flag not equal", + i, test.name + ); + } + } + } + + #[test] + fn test_next_tick_modify_liquidity_update() { + #[derive(Default)] + struct Test<'a> { + name: &'a str, + tick: Tick, + tick_index: i32, + tick_current_index: i32, + fee_growth_global_a: u128, + fee_growth_global_b: u128, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + liquidity_delta: i128, + is_upper_tick: bool, + expected_update: TickUpdate, + } + + // Whirlpool rewards re-used in the tests + let reward_infos = [ + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1 << Q64_RESOLUTION, + growth_global_x64: 100 << Q64_RESOLUTION, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1 << Q64_RESOLUTION, + growth_global_x64: 100 << Q64_RESOLUTION, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1 << Q64_RESOLUTION, + growth_global_x64: 100 << Q64_RESOLUTION, + ..Default::default() + }, + ]; + + for test in [ + Test { + name: "initialize lower tick with +liquidity, current < tick.index, growths not set", + tick: Tick::default(), + tick_index: 200, + tick_current_index: 100, + liquidity_delta: 42069, + is_upper_tick: false, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos, + expected_update: TickUpdate { + initialized: true, + liquidity_net: 42069, + liquidity_gross: 42069, + ..Default::default() + }, + }, + Test { + name: "initialize lower tick with +liquidity, current >= tick.index, growths get set", + tick: Tick::default(), + tick_index: 200, + tick_current_index: 300, + liquidity_delta: 42069, + is_upper_tick: false, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos, + expected_update: TickUpdate { + initialized: true, + liquidity_net: 42069, + liquidity_gross: 42069, + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + reward_growths_outside: [ + 100 << Q64_RESOLUTION, + 100 << Q64_RESOLUTION, + 100 << Q64_RESOLUTION, + ], + }, + ..Default::default() + }, + Test { + name: "lower tick +liquidity already initialized, growths not set", + tick: TickBuilder::default() + .initialized(true) + .liquidity_net(100) + .liquidity_gross(100) + .build(), + tick_index: 200, + tick_current_index: 100, + liquidity_delta: 42069, + is_upper_tick: false, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos, + expected_update: TickUpdate { + initialized: true, + liquidity_net: 42169, + liquidity_gross: 42169, + ..Default::default() + }, + ..Default::default() + }, + Test { + name: "upper tick +liquidity already initialized, growths not set, liquidity net should be subtracted", + tick: TickBuilder::default() + .initialized(true) + .liquidity_net(100000) + .liquidity_gross(100000) + .build(), + tick_index: 200, + tick_current_index: 100, + liquidity_delta: 42069, + is_upper_tick: true, + expected_update: TickUpdate { + initialized: true, + liquidity_net:57931, + liquidity_gross: 142069, + ..Default::default() + }, + ..Default::default() + }, + Test { + name: "upper tick -liquidity, growths not set, uninitialize tick", + tick: TickBuilder::default() + .initialized(true) + .liquidity_net(-100000) + .liquidity_gross(100000) + .build(), + tick_index: 200, + tick_current_index: 100, + liquidity_delta: -100000, + is_upper_tick: true, + expected_update: TickUpdate { + initialized: false, + liquidity_net: 0, + liquidity_gross: 0, + ..Default::default() + }, + ..Default::default() + }, + Test { + name: "lower tick -liquidity, growths not set, initialized no change", + tick: TickBuilder::default() + .initialized(true) + .liquidity_net(100000) + .liquidity_gross(200000) + .build(), + tick_index: 200, + tick_current_index: 100, + liquidity_delta: -100000, + is_upper_tick: false, + expected_update: TickUpdate { + initialized: true, + liquidity_net: 0, + liquidity_gross: 100000, + ..Default::default() + }, + ..Default::default() + }, + Test { + name: "liquidity delta zero is no-op", + tick: TickBuilder::default() + .initialized(true) + .liquidity_net(100000) + .liquidity_gross(200000) + .build(), + tick_index: 200, + tick_current_index: 100, + liquidity_delta: 0, + is_upper_tick: false, + expected_update: TickUpdate { + initialized: true, + liquidity_net: 100000, + liquidity_gross: 200000, + ..Default::default() + }, + ..Default::default() + }, + Test { + name: "uninitialized rewards get set to zero values", + tick: TickBuilder::default() + .initialized(true) + .reward_growths_outside([100, 200, 50]) + .build(), + tick_index: 200, + tick_current_index: 1000, + liquidity_delta: 42069, + is_upper_tick: false, + fee_growth_global_a: 100, + fee_growth_global_b: 100, + reward_infos: [ + WhirlpoolRewardInfo{ + ..Default::default() + }, + WhirlpoolRewardInfo{ + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1, + growth_global_x64: 250, + ..Default::default() + }, + WhirlpoolRewardInfo{ + ..Default::default() + } + ], + expected_update: TickUpdate { + initialized: true, + fee_growth_outside_a: 100, + fee_growth_outside_b: 100, + liquidity_net: 42069, + liquidity_gross: 42069, + reward_growths_outside: [0, 250, 0], + ..Default::default() + }, + } + ] { + // System under test + let update = next_tick_modify_liquidity_update( + &test.tick, + test.tick_index, + test.tick_current_index, + test.fee_growth_global_a, + test.fee_growth_global_b, + &test.reward_infos, + test.liquidity_delta, + test.is_upper_tick, + ) + .unwrap(); + + assert_eq!( + update.initialized, test.expected_update.initialized, + "{}: initialized invalid", + test.name + ); + assert_eq!( + update.liquidity_net, test.expected_update.liquidity_net, + "{}: liquidity_net invalid", + test.name + ); + assert_eq!( + update.liquidity_gross, test.expected_update.liquidity_gross, + "{}: liquidity_gross invalid", + test.name + ); + assert_eq!( + update.fee_growth_outside_a, test.expected_update.fee_growth_outside_a, + "{}: fee_growth_outside_a invalid", + test.name + ); + assert_eq!( + update.fee_growth_outside_b, test.expected_update.fee_growth_outside_b, + "{}: fee_growth_outside_b invalid", + test.name + ); + assert_eq!( + update.reward_growths_outside, test.expected_update.reward_growths_outside, + "{}: reward_growths_outside invalid", + test.name + ); + } + } + + #[test] + fn test_next_tick_modify_liquidity_update_errors() { + struct Test<'a> { + name: &'a str, + tick: Tick, + tick_index: i32, + tick_current_index: i32, + liquidity_delta: i128, + is_upper_tick: bool, + expected_error: ErrorCode, + } + + for test in [ + Test { + name: "liquidity gross overflow", + tick: TickBuilder::default().liquidity_gross(u128::MAX).build(), + tick_index: 0, + tick_current_index: 10, + liquidity_delta: i128::MAX, + is_upper_tick: false, + expected_error: ErrorCode::LiquidityOverflow, + }, + Test { + name: "liquidity gross underflow", + tick: Tick::default(), + tick_index: 0, + tick_current_index: 10, + liquidity_delta: -100, + is_upper_tick: false, + expected_error: ErrorCode::LiquidityUnderflow, + }, + Test { + name: "liquidity net overflow from subtracting negative delta", + tick: TickBuilder::default() + .liquidity_gross(i128::MAX as u128) + .liquidity_net(i128::MAX) + .build(), + tick_index: 0, + tick_current_index: 10, + liquidity_delta: -(i128::MAX - 1), + is_upper_tick: true, + expected_error: ErrorCode::LiquidityNetError, + }, + Test { + name: "liquidity net underflow", + tick: TickBuilder::default() + .liquidity_gross(10000) + .liquidity_net(i128::MAX) + .build(), + tick_index: 0, + tick_current_index: 10, + liquidity_delta: i128::MAX, + is_upper_tick: false, + expected_error: ErrorCode::LiquidityNetError, + }, + ] { + // System under test + let err = next_tick_modify_liquidity_update( + &test.tick, + test.tick_index, + test.tick_current_index, + 0, + 0, + &[WhirlpoolRewardInfo::default(); NUM_REWARDS], + test.liquidity_delta, + test.is_upper_tick, + ) + .unwrap_err(); + + assert_eq!(err, test.expected_error, "{}", test.name); + } + } + + #[test] + fn test_next_tick_cross_update() { + struct Test<'a> { + name: &'a str, + tick: Tick, + fee_growth_global_a: u128, + fee_growth_global_b: u128, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + expected_update: TickUpdate, + } + + for test in [Test { + name: "growths set properly (inverted)", + tick: TickBuilder::default() + .fee_growth_outside_a(1000) + .fee_growth_outside_b(1000) + .reward_growths_outside([500, 250, 100]) + .build(), + fee_growth_global_a: 2500, + fee_growth_global_b: 6750, + reward_infos: [ + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1, + growth_global_x64: 1000, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1, + growth_global_x64: 1000, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1, + growth_global_x64: 1000, + ..Default::default() + }, + ], + expected_update: TickUpdate { + fee_growth_outside_a: 1500, + fee_growth_outside_b: 5750, + reward_growths_outside: [500, 750, 900], + ..Default::default() + }, + }] { + // System under test + let update = next_tick_cross_update( + &test.tick, + test.fee_growth_global_a, + test.fee_growth_global_b, + &test.reward_infos, + ) + .unwrap(); + + assert_eq!( + update.fee_growth_outside_a, test.expected_update.fee_growth_outside_a, + "{}: fee_growth_outside_a invalid", + test.name + ); + assert_eq!( + update.fee_growth_outside_b, test.expected_update.fee_growth_outside_b, + "{}: fee_growth_outside_b invalid", + test.name + ); + + let reward_growths_outside = update.reward_growths_outside; + let expected_growths_outside = test.expected_update.reward_growths_outside; + for i in 0..NUM_REWARDS { + assert_eq!( + reward_growths_outside[i], expected_growths_outside[i], + "{}: reward_growth[{}] invalid", + test.name, i + ); + } + } + } +} diff --git a/programs/whirlpool/src/manager/whirlpool_manager.rs b/programs/whirlpool/src/manager/whirlpool_manager.rs new file mode 100644 index 0000000..7bb6f31 --- /dev/null +++ b/programs/whirlpool/src/manager/whirlpool_manager.rs @@ -0,0 +1,219 @@ +use crate::errors::ErrorCode; +use crate::math::{add_liquidity_delta, checked_mul_div}; +use crate::state::*; + +// Calculates the next global reward growth variables based on the given timestamp. +// The provided timestamp must be greater than or equal to the last updated timestamp. +pub fn next_whirlpool_reward_infos( + whirlpool: &Whirlpool, + next_timestamp: u64, +) -> Result<[WhirlpoolRewardInfo; NUM_REWARDS], ErrorCode> { + let curr_timestamp = whirlpool.reward_last_updated_timestamp; + if next_timestamp < curr_timestamp { + return Err(ErrorCode::InvalidTimestamp.into()); + } + + // No-op if no liquidity or no change in timestamp + if whirlpool.liquidity == 0 || next_timestamp == curr_timestamp { + return Ok(whirlpool.reward_infos); + } + + // Calculate new global reward growth + let mut next_reward_infos = whirlpool.reward_infos; + let time_delta = u128::from(next_timestamp - curr_timestamp); + for i in 0..NUM_REWARDS { + if !next_reward_infos[i].initialized() { + continue; + } + let reward_info = &mut next_reward_infos[i]; + + // Calculate the new reward growth delta. + // If the calculation overflows, set the delta value to zero. + // This will halt reward distributions for this reward. + let reward_growth_delta = checked_mul_div( + time_delta, + reward_info.emissions_per_second_x64, + whirlpool.liquidity, + ) + .unwrap_or(0); + + // Add the reward growth delta to the global reward growth. + let curr_growth_global = reward_info.growth_global_x64; + reward_info.growth_global_x64 = curr_growth_global.wrapping_add(reward_growth_delta); + } + + Ok(next_reward_infos) +} + +// Calculates the next global liquidity for a whirlpool depending on its position relative +// to the lower and upper tick indexes and the liquidity_delta. +pub fn next_whirlpool_liquidity( + whirlpool: &Whirlpool, + tick_upper_index: i32, + tick_lower_index: i32, + liquidity_delta: i128, +) -> Result { + if whirlpool.tick_current_index < tick_upper_index + && whirlpool.tick_current_index >= tick_lower_index + { + add_liquidity_delta(whirlpool.liquidity, liquidity_delta) + } else { + Ok(whirlpool.liquidity) + } +} + +#[cfg(test)] +mod whirlpool_manager_tests { + + use anchor_lang::prelude::Pubkey; + + use crate::manager::whirlpool_manager::next_whirlpool_reward_infos; + use crate::math::Q64_RESOLUTION; + use crate::state::whirlpool::WhirlpoolRewardInfo; + use crate::state::whirlpool::NUM_REWARDS; + use crate::state::whirlpool_builder::WhirlpoolBuilder; + use crate::state::Whirlpool; + + // Initializes a whirlpool for testing with all the rewards initialized + fn init_test_whirlpool(liquidity: u128, reward_last_updated_timestamp: u64) -> Whirlpool { + WhirlpoolBuilder::new() + .liquidity(liquidity) + .reward_last_updated_timestamp(reward_last_updated_timestamp) // Jan 1 2021 EST + .reward_infos([ + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 10 << Q64_RESOLUTION, + growth_global_x64: 100 << Q64_RESOLUTION, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 0b11 << (Q64_RESOLUTION - 1), // 1.5 + growth_global_x64: 200 << Q64_RESOLUTION, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1 << (Q64_RESOLUTION - 1), // 0.5 + growth_global_x64: 300 << Q64_RESOLUTION, + ..Default::default() + }, + ]) + .build() + } + + #[test] + fn test_next_whirlpool_reward_infos_zero_liquidity_no_op() { + let whirlpool = init_test_whirlpool(0, 1577854800); + + let result = next_whirlpool_reward_infos(&whirlpool, 1577855800); + assert_eq!( + WhirlpoolRewardInfo::to_reward_growths(&result.unwrap()), + [ + 100 << Q64_RESOLUTION, + 200 << Q64_RESOLUTION, + 300 << Q64_RESOLUTION + ] + ); + } + + #[test] + fn test_next_whirlpool_reward_infos_same_timestamp_no_op() { + let whirlpool = init_test_whirlpool(100, 1577854800); + + let result = next_whirlpool_reward_infos(&whirlpool, 1577854800); + assert_eq!( + WhirlpoolRewardInfo::to_reward_growths(&result.unwrap()), + [ + 100 << Q64_RESOLUTION, + 200 << Q64_RESOLUTION, + 300 << Q64_RESOLUTION + ] + ); + } + + #[test] + #[should_panic(expected = "InvalidTimestamp")] + fn test_next_whirlpool_reward_infos_invalid_timestamp() { + let whirlpool = &WhirlpoolBuilder::new() + .liquidity(100) + .reward_last_updated_timestamp(1577854800) // Jan 1 2020 EST + .build(); + + // New timestamp is earlier than the last updated timestamp + next_whirlpool_reward_infos(whirlpool, 1577768400).unwrap(); // Dec 31 2019 EST + } + + #[test] + fn test_next_whirlpool_reward_infos_no_initialized_rewards() { + let whirlpool = &WhirlpoolBuilder::new() + .liquidity(100) + .reward_last_updated_timestamp(1577854800) // Jan 1 2021 EST + .build(); + + let new_timestamp = 1577854800 + 300; + let result = next_whirlpool_reward_infos(whirlpool, new_timestamp).unwrap(); + assert_eq!(WhirlpoolRewardInfo::to_reward_growths(&result), [0, 0, 0]); + } + + #[test] + fn test_next_whirlpool_reward_infos_some_initialized_rewards() { + let whirlpool = &WhirlpoolBuilder::new() + .liquidity(100) + .reward_last_updated_timestamp(1577854800) // Jan 1 2021 EST + .reward_info( + 0, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: 1 << Q64_RESOLUTION, + ..Default::default() + }, + ) + .build(); + + let new_timestamp = 1577854800 + 300; + let result = next_whirlpool_reward_infos(whirlpool, new_timestamp).unwrap(); + assert_eq!(result[0].growth_global_x64, 3 << Q64_RESOLUTION); + for i in 1..NUM_REWARDS { + assert_eq!(whirlpool.reward_infos[i].growth_global_x64, 0); + } + } + + #[test] + fn test_next_whirlpool_reward_infos_delta_zero_on_overflow() { + let whirlpool = &WhirlpoolBuilder::new() + .liquidity(100) + .reward_last_updated_timestamp(0) + .reward_info( + 0, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64: u128::MAX, + growth_global_x64: 100, + ..Default::default() + }, + ) + .build(); + + let new_timestamp = i64::MAX as u64; + let result = next_whirlpool_reward_infos(whirlpool, new_timestamp).unwrap(); + assert_eq!(result[0].growth_global_x64, 100); + } + + #[test] + fn test_next_whirlpool_reward_infos_all_initialized_rewards() { + let whirlpool = init_test_whirlpool(100, 1577854800); + + let new_timestamp = 1577854800 + 300; + let result = next_whirlpool_reward_infos(&whirlpool, new_timestamp).unwrap(); + assert_eq!(result[0].growth_global_x64, 130 << Q64_RESOLUTION); + assert_eq!( + result[1].growth_global_x64, + 0b110011001 << (Q64_RESOLUTION - 1) // 204.5 + ); + assert_eq!( + result[2].growth_global_x64, + 0b1001011011 << (Q64_RESOLUTION - 1) // 301.5 + ); + } +} diff --git a/programs/whirlpool/src/math/bit_math.rs b/programs/whirlpool/src/math/bit_math.rs new file mode 100644 index 0000000..9e238a6 --- /dev/null +++ b/programs/whirlpool/src/math/bit_math.rs @@ -0,0 +1,343 @@ +use crate::errors::ErrorCode; + +use super::U256Muldiv; + +pub const Q64_RESOLUTION: u8 = 64; +pub const TO_Q64: u128 = 1u128 << Q64_RESOLUTION; + +pub fn checked_mul_div(n0: u128, n1: u128, d: u128) -> Result { + checked_mul_div_round_up_if(n0, n1, d, false) +} + +pub fn checked_mul_div_round_up(n0: u128, n1: u128, d: u128) -> Result { + checked_mul_div_round_up_if(n0, n1, d, true) +} + +pub fn checked_mul_div_round_up_if( + n0: u128, + n1: u128, + d: u128, + round_up: bool, +) -> Result { + if d == 0 { + return Err(ErrorCode::DivideByZero); + } + + let p = n0.checked_mul(n1).ok_or(ErrorCode::MulDivOverflow)?; + let n = p / d; + + Ok(if round_up && p % d > 0 { n + 1 } else { n }) +} + +pub fn checked_mul_shift_right(n0: u128, n1: u128) -> Result { + checked_mul_shift_right_round_up_if(n0, n1, false) +} + +const Q64_MASK: u128 = 0xFFFF_FFFF_FFFF_FFFF; + +/// Multiplies an integer u128 and a Q64.64 fixed point number. +/// Returns a product represented as a u64 integer. +pub fn checked_mul_shift_right_round_up_if( + n0: u128, + n1: u128, + round_up: bool, +) -> Result { + if n0 == 0 || n1 == 0 { + return Ok(0); + } + + let p = n0 + .checked_mul(n1) + .ok_or(ErrorCode::MultiplicationShiftRightOverflow)?; + + let result = (p >> Q64_RESOLUTION) as u64; + + let should_round = round_up && (p & Q64_MASK > 0); + if should_round && result == u64::MAX { + return Err(ErrorCode::MultiplicationOverflow); + } + + Ok(if should_round { + result + 1 + } else { + result + }) +} + +pub fn div_round_up(n: u128, d: u128) -> Result { + div_round_up_if(n, d, true) +} + +pub fn div_round_up_if(n: u128, d: u128, round_up: bool) -> Result { + if d == 0 { + return Err(ErrorCode::DivideByZero); + } + + let q = n / d; + + Ok(if round_up && n % d > 0 { q + 1 } else { q }) +} + +pub fn div_round_up_if_u256( + n: U256Muldiv, + d: U256Muldiv, + round_up: bool, +) -> Result { + let (quotient, remainder) = n.div(d, round_up); + + let result = if round_up && !remainder.is_zero() { + quotient.add(U256Muldiv::new(0, 1)) + } else { + quotient + }; + + Ok(result.try_into_u128()?) +} + +#[cfg(test)] +mod fuzz_tests { + use crate::math::U256; + + use super::*; + use proptest::prelude::*; + + proptest! { + #[test] + fn test_div_round_up_if( + n in 0..u128::MAX, + d in 0..u128::MAX, + ) { + let rounded = div_round_up(n, d); + if d == 0 { + assert!(rounded.is_err()); + } else { + let unrounded = n / d; + let div_unrounded = div_round_up_if(n, d, false)?; + let diff = rounded? - unrounded; + assert!(unrounded == div_unrounded); + assert!(diff <= 1); + assert!((diff == 1) == (n % d > 0)); + } + } + + + #[test] + fn test_div_round_up_if_u256( + n_hi in 0..u128::MAX, + n_lo in 0..u128::MAX, + d_hi in 0..u128::MAX, + d_lo in 0..u128::MAX, + ) { + let dividend = U256Muldiv::new(n_hi, n_lo); + let divisor = U256Muldiv::new(d_hi, d_lo); + + let rounded = div_round_up_if_u256(dividend, divisor, true); + let (quotient, _) = dividend.div(divisor, true); + + if quotient.try_into_u128().is_err() { + assert!(rounded.is_err()); + } else { + let other_dividend = (U256::from(n_hi) << 128) + U256::from(n_lo); + let other_divisor = (U256::from(d_hi) << 128) + U256::from(d_lo); + let other_quotient = other_dividend / other_divisor; + let other_remainder = other_dividend % other_divisor; + + let unrounded = div_round_up_if_u256(dividend, divisor, false); + assert!(unrounded? == other_quotient.try_into_u128()?); + + let diff = rounded.unwrap() - unrounded.unwrap(); + assert!(diff <= 1); + assert!((diff == 1) == (other_remainder > U256::zero())); + } + } + + #[test] + fn test_checked_mul_div_round_up_if(n0 in 0..u128::MAX, n1 in 0..u128::MAX, d in 0..u128::MAX) { + let result = checked_mul_div_round_up_if(n0, n1, d, true); + + if d == 0 { + assert!(result.is_err()); + } else if n0.checked_mul(n1).is_none() { + assert!(result.is_err()); + } else { + let other_n0 = U256::from(n0); + let other_n1 = U256::from(n1); + let other_p = other_n0 * other_n1; + let other_d = U256::from(d); + let other_result = other_p / other_d; + + let unrounded = checked_mul_div_round_up_if(n0, n1, d, false)?; + assert!(U256::from(unrounded) == other_result); + + let diff = U256::from(result.unwrap()) - other_result; + assert!(diff <= U256::from(1)); + assert!((diff == U256::from(1)) == (other_p % other_d > U256::from(0))); + } + } + + #[test] + fn test_mul_shift_right_round_up_if(n0 in 0..u128::MAX, n1 in 0..u128::MAX) { + let result = checked_mul_shift_right_round_up_if(n0, n1, true); + + if n0.checked_mul(n1).is_none() { + assert!(result.is_err()); + } else { + let p = (U256::from(n0) * U256::from(n1)).try_into_u128()?; + + let i = (p >> 64) as u64; + + + assert!(i == checked_mul_shift_right_round_up_if(n0, n1, false)?); + + if i == u64::MAX && (p & Q64_MASK > 0) { + assert!(result.is_err()); + } else { + let diff = result.unwrap() - i; + assert!(diff <= 1); + assert!((diff == 1) == (p % (u64::MAX as u128) > 0)); + } + } + } + } +} + +#[cfg(test)] +mod test_bit_math { + // We arbitrarily select integers a, b, d < 2^128 - 1, such that 2^128 - 1 < (a * b / d) < 2^128 + // For simplicity we fix d = 2 and the target to be 2^128 - 0.5 + // We then solve for a * b = 2^129 - 1 + const MAX_FLOOR: (u128, u128, u128) = (11053036065049294753459639, 61572651155449, 2); + + mod test_mul_div { + use crate::math::checked_mul_div; + + use super::MAX_FLOOR; + + #[test] + fn test_mul_div_ok() { + assert_eq!(checked_mul_div(150, 30, 3).unwrap(), 1500); + assert_eq!(checked_mul_div(15, 0, 10).unwrap(), 0); + } + + #[test] + fn test_mul_div_shift_ok() { + assert_eq!(checked_mul_div(u128::MAX, 1, 2).unwrap(), u128::MAX >> 1); + assert_eq!(checked_mul_div(u128::MAX, 1, 4).unwrap(), u128::MAX >> 2); + assert_eq!(checked_mul_div(u128::MAX, 1, 8).unwrap(), u128::MAX >> 3); + assert_eq!(checked_mul_div(u128::MAX, 1, 16).unwrap(), u128::MAX >> 4); + assert_eq!(checked_mul_div(u128::MAX, 1, 32).unwrap(), u128::MAX >> 5); + assert_eq!(checked_mul_div(u128::MAX, 1, 64).unwrap(), u128::MAX >> 6); + } + + #[test] + fn test_mul_div_large_ok() { + assert_eq!( + checked_mul_div(u128::MAX, 1, u128::from(u64::MAX) + 1).unwrap(), + u64::MAX.into() + ); + assert_eq!(checked_mul_div(u128::MAX - 1, 1, u128::MAX).unwrap(), 0); + } + + #[test] + fn test_mul_div_overflows() { + assert!(checked_mul_div(u128::MAX, 2, u128::MAX).is_err()); + assert!(checked_mul_div(u128::MAX, u128::MAX, u128::MAX).is_err()); + assert!(checked_mul_div(u128::MAX, u128::MAX - 1, u128::MAX).is_err()); + assert!(checked_mul_div(u128::MAX, 2, 1).is_err()); + assert!(checked_mul_div(MAX_FLOOR.0, MAX_FLOOR.1, MAX_FLOOR.2).is_err()); + } + + #[test] + fn test_mul_div_does_not_round() { + assert_eq!(checked_mul_div(3, 7, 10).unwrap(), 2); + assert_eq!( + checked_mul_div(u128::MAX, 1, 7).unwrap(), + 48611766702991209066196372490252601636 + ); + } + } + mod test_mul_div_round_up { + use crate::math::checked_mul_div_round_up; + + use super::MAX_FLOOR; + + #[test] + fn test_mul_div_ok() { + assert_eq!(checked_mul_div_round_up(0, 4, 4).unwrap(), 0); + assert_eq!(checked_mul_div_round_up(2, 4, 4).unwrap(), 2); + assert_eq!(checked_mul_div_round_up(3, 7, 21).unwrap(), 1); + } + + #[test] + fn test_mul_div_rounding_up_rounds_up() { + assert_eq!(checked_mul_div_round_up(3, 7, 10).unwrap(), 3); + assert_eq!( + checked_mul_div_round_up(u128::MAX, 1, 7).unwrap(), + 48611766702991209066196372490252601637 + ); + assert_eq!( + checked_mul_div_round_up(u128::MAX - 1, 1, u128::MAX).unwrap(), + 1 + ); + } + + #[test] + #[should_panic] + fn test_mul_div_rounding_upfloor_max_panics() { + assert_eq!( + checked_mul_div_round_up(MAX_FLOOR.0, MAX_FLOOR.1, MAX_FLOOR.2).unwrap(), + u128::MAX + ); + } + + #[test] + fn test_mul_div_overflow_panics() { + assert!(checked_mul_div_round_up(u128::MAX, u128::MAX, 1u128).is_err()); + } + } + + mod test_div_round_up { + use crate::math::div_round_up; + + #[test] + fn test_mul_div_ok() { + assert_eq!(div_round_up(0, 21).unwrap(), 0); + assert_eq!(div_round_up(21, 21).unwrap(), 1); + assert_eq!(div_round_up(8, 4).unwrap(), 2); + } + + #[test] + fn test_mul_div_rounding_up_rounds_up() { + assert_eq!(div_round_up(21, 10).unwrap(), 3); + assert_eq!( + div_round_up(u128::MAX, 7).unwrap(), + 48611766702991209066196372490252601637 + ); + assert_eq!(div_round_up(u128::MAX - 1, u128::MAX).unwrap(), 1); + } + + } + + mod test_mult_shift_right_round_up { + use crate::math::checked_mul_shift_right_round_up_if; + + #[test] + fn test_mul_shift_right_ok() { + assert_eq!(checked_mul_shift_right_round_up_if(u64::MAX as u128, 1, false).unwrap(), 0); + assert_eq!(checked_mul_shift_right_round_up_if(u64::MAX as u128, 1, true).unwrap(), 1); + assert_eq!(checked_mul_shift_right_round_up_if(u64::MAX as u128 + 1, 1, false).unwrap(), 1); + assert_eq!(checked_mul_shift_right_round_up_if(u64::MAX as u128 + 1, 1, true).unwrap(), 1); + assert_eq!(checked_mul_shift_right_round_up_if(u32::MAX as u128, u32::MAX as u128, false).unwrap(), 0); + assert_eq!(checked_mul_shift_right_round_up_if(u32::MAX as u128, u32::MAX as u128, true).unwrap(), 1); + assert_eq!(checked_mul_shift_right_round_up_if(u32::MAX as u128 + 1, u32::MAX as u128 + 2, false).unwrap(), 1); + assert_eq!(checked_mul_shift_right_round_up_if(u32::MAX as u128 + 1, u32::MAX as u128 + 2, true).unwrap(), 2); + } + + #[test] + fn test_mul_shift_right_u64_max() { + assert!(checked_mul_shift_right_round_up_if(u128::MAX, 1, true).is_err()); + assert_eq!(checked_mul_shift_right_round_up_if(u128::MAX, 1, false).unwrap(), u64::MAX); + } + + } +} diff --git a/programs/whirlpool/src/math/bn.rs b/programs/whirlpool/src/math/bn.rs new file mode 100644 index 0000000..612b4b9 --- /dev/null +++ b/programs/whirlpool/src/math/bn.rs @@ -0,0 +1,168 @@ +#![allow(clippy::assign_op_pattern)] +#![allow(clippy::ptr_offset_with_cast)] +#![allow(clippy::manual_range_contains)] + +/// The following code is referenced from drift-labs: +/// https://github.com/drift-labs/protocol-v1/blob/3da78f1f03b66a273fc50818323ac62874abd1d8/programs/clearing_house/src/math/bn.rs +/// +/// Based on parity's uint crate +/// https://github.com/paritytech/parity-common/tree/master/uint +/// +/// Note: We cannot use U256 from primitive-types (default u256 from parity's uint) because we need to extend the U256 struct to +/// support the Borsh serial/deserialize traits. +/// +/// The reason why this custom U256 impl does not directly impl TryInto traits is because of this: +/// https://stackoverflow.com/questions/37347311/how-is-there-a-conflicting-implementation-of-from-when-using-a-generic-type +/// +/// As a result, we have to define our own custom Into methods +/// +/// U256 reference: +/// https://crates.parity.io/sp_core/struct.U256.html +/// +use borsh::{BorshDeserialize, BorshSerialize}; +use std::borrow::BorrowMut; +use std::convert::TryInto; +use std::io::{Error, ErrorKind, Write}; +use std::mem::size_of; +use uint::construct_uint; + +use crate::errors::ErrorCode; + +macro_rules! impl_borsh_serialize_for_bn { + ($type: ident) => { + impl BorshSerialize for $type { + #[inline] + fn serialize(&self, writer: &mut W) -> std::io::Result<()> { + let bytes = self.to_le_bytes(); + writer.write_all(&bytes) + } + } + }; +} + +macro_rules! impl_borsh_deserialize_for_bn { + ($type: ident) => { + impl BorshDeserialize for $type { + #[inline] + fn deserialize(buf: &mut &[u8]) -> std::io::Result { + if buf.len() < size_of::<$type>() { + return Err(Error::new( + ErrorKind::InvalidInput, + "Unexpected length of input", + )); + } + let res = $type::from_le_bytes(buf[..size_of::<$type>()].try_into().unwrap()); + *buf = &buf[size_of::<$type>()..]; + Ok(res) + } + } + }; +} + +construct_uint! { + // U256 of [u64; 4] + pub struct U256(4); +} + +impl U256 { + pub fn try_into_u64(self) -> Result { + self.try_into().map_err(|_| ErrorCode::NumberCastError) + } + + pub fn try_into_u128(self) -> Result { + self.try_into().map_err(|_| ErrorCode::NumberCastError) + } + + pub fn from_le_bytes(bytes: [u8; 32]) -> Self { + U256::from_little_endian(&bytes) + } + + pub fn to_le_bytes(self) -> [u8; 32] { + let mut buf: Vec = Vec::with_capacity(size_of::()); + self.to_little_endian(buf.borrow_mut()); + + let mut bytes: [u8; 32] = [0u8; 32]; + bytes.copy_from_slice(buf.as_slice()); + bytes + } +} + +impl_borsh_deserialize_for_bn!(U256); +impl_borsh_serialize_for_bn!(U256); + +#[cfg(test)] +mod test_u256 { + use super::*; + + #[test] + fn test_into_u128_ok() { + let a = U256::from(2653u128); + let b = U256::from(1232u128); + let sum = a + b; + let d: u128 = sum.try_into_u128().unwrap(); + assert_eq!(d, 3885u128); + } + + #[test] + fn test_into_u128_error() { + let a = U256::from(u128::MAX); + let b = U256::from(u128::MAX); + let sum = a + b; + let c: Result = sum.try_into_u128(); + assert_eq!(c.is_err(), true); + } + + #[test] + fn test_as_u128_ok() { + let a = U256::from(2653u128); + let b = U256::from(1232u128); + let sum = a + b; + let d: u128 = sum.as_u128(); + assert_eq!(d, 3885u128); + } + + #[test] + #[should_panic(expected = "Integer overflow when casting to u128")] + fn test_as_u128_panic() { + let a = U256::from(u128::MAX); + let b = U256::from(u128::MAX); + let sum = a + b; + let _: u128 = sum.as_u128(); + } + + #[test] + fn test_into_u64_ok() { + let a = U256::from(2653u64); + let b = U256::from(1232u64); + let sum = a + b; + let d: u64 = sum.try_into_u64().unwrap(); + assert_eq!(d, 3885u64); + } + + #[test] + fn test_into_u64_error() { + let a = U256::from(u64::MAX); + let b = U256::from(u64::MAX); + let sum = a + b; + let c: Result = sum.try_into_u64(); + assert_eq!(c.is_err(), true); + } + + #[test] + fn test_as_u64_ok() { + let a = U256::from(2653u64); + let b = U256::from(1232u64); + let sum = a + b; + let d: u64 = sum.as_u64(); + assert_eq!(d, 3885u64); + } + + #[test] + #[should_panic(expected = "Integer overflow when casting to u64")] + fn test_as_u64_panic() { + let a = U256::from(u64::MAX); + let b = U256::from(u64::MAX); + let sum = a + b; + let _: u64 = sum.as_u64(); // panic overflow + } +} diff --git a/programs/whirlpool/src/math/liquidity_math.rs b/programs/whirlpool/src/math/liquidity_math.rs new file mode 100644 index 0000000..fa0528e --- /dev/null +++ b/programs/whirlpool/src/math/liquidity_math.rs @@ -0,0 +1,61 @@ +use crate::errors::ErrorCode; + +// Adds a signed liquidity delta to a given integer liquidity amount. +// Errors on overflow or underflow. +pub fn add_liquidity_delta(liquidity: u128, delta: i128) -> Result { + if delta == 0 { + return Ok(liquidity); + } + if delta > 0 { + liquidity + .checked_add(delta as u128) + .ok_or(ErrorCode::LiquidityOverflow) + } else { + liquidity + .checked_sub(delta.abs() as u128) + .ok_or(ErrorCode::LiquidityUnderflow) + } +} + +// Converts an unsigned liquidity amount to a signed liquidity delta +pub fn convert_to_liquidity_delta( + liquidity_amount: u128, + positive: bool, +) -> Result { + if liquidity_amount > i128::MAX as u128 { + // The liquidity_amount is converted to a liquidity_delta that is represented as an i128 + // By doing this conversion we lose the most significant bit in the u128 + // Here we enforce a max value of i128::MAX on the u128 to prevent loss of data. + return Err(ErrorCode::LiquidityTooHigh.into()); + } + Ok(if positive { + liquidity_amount as i128 + } else { + -(liquidity_amount as i128) + }) +} + +#[cfg(test)] +mod liquidity_math_tests { + use super::add_liquidity_delta; + use super::ErrorCode; + + #[test] + fn test_valid_add_liquidity_delta() { + assert_eq!(add_liquidity_delta(100, 100).unwrap(), 200); + assert_eq!(add_liquidity_delta(100, 0).unwrap(), 100); + assert_eq!(add_liquidity_delta(100, -100).unwrap(), 0); + } + + #[test] + fn test_invalid_add_liquidity_delta_overflow() { + let result = add_liquidity_delta(u128::MAX, 1); + assert_eq!(result.unwrap_err(), ErrorCode::LiquidityOverflow); + } + + #[test] + fn test_invalid_add_liquidity_delta_underflow() { + let result = add_liquidity_delta(u128::MIN, -1); + assert_eq!(result.unwrap_err(), ErrorCode::LiquidityUnderflow); + } +} diff --git a/programs/whirlpool/src/math/mod.rs b/programs/whirlpool/src/math/mod.rs new file mode 100644 index 0000000..c72fdc5 --- /dev/null +++ b/programs/whirlpool/src/math/mod.rs @@ -0,0 +1,15 @@ +pub mod bit_math; +pub mod bn; +pub mod liquidity_math; +pub mod swap_math; +pub mod tick_math; +pub mod token_math; +pub mod u256_math; + +pub use bit_math::*; +pub use bn::*; +pub use liquidity_math::*; +pub use swap_math::*; +pub use tick_math::*; +pub use token_math::*; +pub use u256_math::*; diff --git a/programs/whirlpool/src/math/swap_math.rs b/programs/whirlpool/src/math/swap_math.rs new file mode 100644 index 0000000..87233eb --- /dev/null +++ b/programs/whirlpool/src/math/swap_math.rs @@ -0,0 +1,942 @@ +use std::convert::TryInto; + +use crate::errors::ErrorCode; +use crate::math::*; + +#[derive(PartialEq, Debug)] +pub struct SwapStepComputation { + pub amount_in: u64, + pub amount_out: u64, + pub next_price: u128, + pub fee_amount: u64, +} + +pub fn compute_swap( + amount_remaining: u64, + fee_rate: u16, + liquidity: u128, + sqrt_price_current: u128, + sqrt_price_target: u128, + amount_specified_is_input: bool, + a_to_b: bool, +) -> Result { + let fee_amount; + + let mut amount_fixed_delta = get_amount_fixed_delta( + sqrt_price_current, + sqrt_price_target, + liquidity, + amount_specified_is_input, + a_to_b, + )?; + + let mut amount_calc = amount_remaining; + if amount_specified_is_input { + amount_calc = checked_mul_div( + amount_remaining as u128, + FEE_RATE_MUL_VALUE - fee_rate as u128, + FEE_RATE_MUL_VALUE, + )? + .try_into()?; + } + + let next_sqrt_price = if amount_calc >= amount_fixed_delta { + sqrt_price_target + } else { + get_next_sqrt_price( + sqrt_price_current, + liquidity, + amount_calc, + amount_specified_is_input, + a_to_b, + )? + }; + + let is_max_swap = next_sqrt_price == sqrt_price_target; + + let amount_unfixed_delta = get_amount_unfixed_delta( + sqrt_price_current, + next_sqrt_price, + liquidity, + amount_specified_is_input, + a_to_b, + )?; + + // If the swap is not at the max, we need to readjust the amount of the fixed token we are using + if !is_max_swap { + amount_fixed_delta = get_amount_fixed_delta( + sqrt_price_current, + next_sqrt_price, + liquidity, + amount_specified_is_input, + a_to_b, + )?; + } + + let (amount_in, mut amount_out) = if amount_specified_is_input { + (amount_fixed_delta, amount_unfixed_delta) + } else { + (amount_unfixed_delta, amount_fixed_delta) + }; + + // Cap output amount if using output + if !amount_specified_is_input && amount_out > amount_remaining { + amount_out = amount_remaining; + } + + if amount_specified_is_input && !is_max_swap { + fee_amount = amount_remaining - amount_in; + } else { + fee_amount = checked_mul_div_round_up( + amount_in as u128, + fee_rate as u128, + FEE_RATE_MUL_VALUE - fee_rate as u128, + )? + .try_into()?; + } + + Ok(SwapStepComputation { + amount_in, + amount_out, + next_price: next_sqrt_price, + fee_amount, + }) +} + +fn get_amount_fixed_delta( + sqrt_price_current: u128, + sqrt_price_target: u128, + liquidity: u128, + amount_specified_is_input: bool, + a_to_b: bool, +) -> Result { + if a_to_b == amount_specified_is_input { + get_amount_delta_a( + sqrt_price_current, + sqrt_price_target, + liquidity, + amount_specified_is_input, + ) + } else { + get_amount_delta_b( + sqrt_price_current, + sqrt_price_target, + liquidity, + amount_specified_is_input, + ) + } +} + +fn get_amount_unfixed_delta( + sqrt_price_current: u128, + sqrt_price_target: u128, + liquidity: u128, + amount_specified_is_input: bool, + a_to_b: bool, +) -> Result { + if a_to_b == amount_specified_is_input { + get_amount_delta_b( + sqrt_price_current, + sqrt_price_target, + liquidity, + !amount_specified_is_input, + ) + } else { + get_amount_delta_a( + sqrt_price_current, + sqrt_price_target, + liquidity, + !amount_specified_is_input, + ) + } +} + +#[cfg(test)] +mod fuzz_tests { + use super::*; + use proptest::prelude::*; + + proptest! { + #[test] + fn test_compute_swap( + amount in 1..u64::MAX, + liquidity in 1..u32::MAX as u128, + fee_rate in 1..u16::MAX, + price_0 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + price_1 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + amount_specified_is_input in proptest::bool::ANY, + ) { + prop_assume!(price_0 != price_1); + + // Rather than use logic to correctly input the prices, we just use the distribution to determine direction + let a_to_b = price_0 >= price_1; + + let swap_computation = compute_swap( + amount, + fee_rate, + liquidity, + price_0, + price_1, + amount_specified_is_input, + a_to_b, + ).ok().unwrap(); + + let amount_in = swap_computation.amount_in; + let amount_out = swap_computation.amount_out; + let next_price = swap_computation.next_price; + let fee_amount = swap_computation.fee_amount; + + // Amount_in can not exceed maximum amount + assert!(amount_in <= u64::MAX - fee_amount); + + // Amounts calculated are less than amount specified + let amount_used = if amount_specified_is_input { + amount_in + fee_amount + } else { + amount_out + }; + + if next_price != price_1 { + assert!(amount_used == amount); + } else { + assert!(amount_used <= amount); + } + + let (price_lower, price_upper) = increasing_price_order(price_0, price_1); + assert!(next_price >= price_lower); + assert!(next_price <= price_upper); + } + + #[test] + fn test_compute_swap_inversion( + amount in 1..u64::MAX, + liquidity in 1..u32::MAX as u128, + fee_rate in 1..u16::MAX, + price_0 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + price_1 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + amount_specified_is_input in proptest::bool::ANY, + ) { + prop_assume!(price_0 != price_1); + + // Rather than use logic to correctly input the prices, we just use the distribution to determine direction + let a_to_b = price_0 >= price_1; + + let swap_computation = compute_swap( + amount, + fee_rate, + liquidity, + price_0, + price_1, + amount_specified_is_input, + a_to_b, + ).ok().unwrap(); + + let amount_in = swap_computation.amount_in; + let amount_out = swap_computation.amount_out; + let next_price = swap_computation.next_price; + let fee_amount = swap_computation.fee_amount; + + let inverted_amount = if amount_specified_is_input { + amount_out + } else { + amount_in + fee_amount + }; + + if inverted_amount != 0 { + let inverted = compute_swap( + inverted_amount, + fee_rate, + liquidity, + price_0, + price_1, + !amount_specified_is_input, + a_to_b, + ).ok().unwrap(); + + // A to B = price decreasing + + // Case 1 + // Normal: is_input, a_to_b + // Input is fixed, consume all input to produce amount_out + // amount_in = fixed, ceil + // amount_out = unfixed, floor + + // Inverted: !is_input, a_to_b + // amount_in = unfixed, ceil + // amount_out = fixed, floor + // Amount = amount_out, inverted.amount_in and fee <= original input and fee, inverted.amount_out ~~ amount_out, inverted.next_price >= original.next_price + + + // Case 2 + // Normal: !is_input, a_to_b + // Find amount required to get amount_out + // amount_in = unfixed, ceil + // amount_out = fixed, floor + + // Inverted: is_input, a_to_b + // amount_in = fixed, ceil + // amount_out = unfixed, floor + // Get max amount_out for input, inverted.amount_in + fee ~~ original input and fee, inverted.amount_out >= amount_out, inverted.next_price <= original.next_price + + + // Price increasing + // Case 3 + // Normal: is_input, !a_to_b + // Input is fixed, consume all input to produce amount_out + // amount_in = fixed, ceil + // amount_out = unfixed, floor + + // Inverted: !is_input, !a_to_b + // Amount = amount_out, inverted.amount_in and fee <= original input and fee, inverted.amount_out ~~ amount_out, inverted.next_price <= original.next_price + + // Case 4 + // Normal: !is_input, !a_to_b + // Find amount required to get amount_out + // amount_in = fixed, floor + // amount_out = unfixed, ceil + // Inverted: is_input, !a_to_b + // Get max amount_out for input, inverted.amount_in + fee ~~ original input and fee, inverted.amount_out >= amount_out + // Since inverted.amount_out >= amount_out and amount in is the same, more of token a is being removed, so + // inverted.next_price >= original.next_price + + // Next sqrt price goes from round up to round down + // assert!(inverted.next_price + 1 >= next_price); + + if inverted.next_price != price_1 { + if amount_specified_is_input { + // If a_to_b, then goes round up => round down, + assert!(inverted.amount_in <= amount_in); + assert!(inverted.fee_amount <= fee_amount); + } else { + assert!(inverted.amount_in >= amount_in); + assert!(inverted.fee_amount >= fee_amount); + } + assert!(inverted.amount_out >= amount_out); + if a_to_b == amount_specified_is_input { + // Next sqrt price goes from round up to round down + assert!(inverted.next_price >= next_price); + } else { + // Next sqrt price goes from round down to round up + assert!(inverted.next_price <= next_price); + } + + // Ratio calculations + // let ratio_in = (u128::from(inverted.amount_in) << 64) / u128::from(amount_in); + // let ratio_out = (u128::from(inverted.amount_out) << 64) / u128::from(amount_out); + // println!("RATIO IN/OUT WHEN INVERTED {} \t| {} ", ratio_in, ratio_out); + + // if ratio_out > (2 << 64) || ratio_in < (1 << 63) { + // if ratio_out > (2 << 64) { + // println!("OUT > {}", ratio_out / (1 << 64)); + // } + // if ratio_in < (1 << 63) { + // println!("IN < 1/{}", (1 << 64) / ratio_in); + // } + + // println!("liq {} | fee {} | price_0 {} | price_1 {} | a_to_b {}", liquidity, fee_rate, price_0, price_1, a_to_b); + // println!("Amount {} | is_input {}", amount, amount_specified_is_input); + // println!("Inverted Amount {} | is_input {}", inverted_amount, !amount_specified_is_input); + // println!("{:?}", swap_computation); + // println!("{:?}", inverted); + // } + } + } + } + } +} + +#[cfg(test)] +mod unit_tests { + use super::*; + + mod test_swap { + // Doesn't cross any additional ticks + mod no_cross { + use super::*; + + #[test] + fn swap_a_to_b_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output_partial() { + validate_tick_whirlpool(); + } + } + + // Crosses single initialized tick + mod single_tick { + use super::*; + + #[test] + fn swap_a_to_b_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output_partial() { + validate_tick_whirlpool(); + } + } + + // Crosses multiple initialized ticks + mod multi_tick { + use super::*; + + #[test] + fn swap_a_to_b_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output_partial() { + validate_tick_whirlpool(); + } + } + + // Crosses a multiple ticks with a zone of 0 liquidity + mod discontiguous_multi_tick { + use super::*; + + #[test] + fn swap_a_to_b_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_a_to_b_output_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_input_partial() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output() { + validate_tick_whirlpool(); + } + + #[test] + fn swap_b_to_a_output_partial() { + validate_tick_whirlpool(); + } + } + + mod protocol_rate { + use super::*; + + #[test] + fn protocol_rate() { + validate_tick_whirlpool(); + } + + #[test] + fn protocol_rate_zero() { + validate_tick_whirlpool(); + } + } + + fn validate_tick_whirlpool() { + // Validate tick values + // Fee, reward growths + // + // Validate whirlpool values + // liquidity, tick, sqrt_price, fee_growth, reward, protocol fee, token amounts + } + } + + mod test_compute_swap { + const TWO_PCT: u16 = 20000; + use std::convert::TryInto; + + use super::*; + use crate::math::bit_math::Q64_RESOLUTION; + + #[test] + fn swap_a_to_b_input() { + // Example calculation + let amount = 100u128; + let init_liq = 1296; + let init_price = 9; + let price_limit = 4; + + // Calculate fee given fee percentage + let fee_amount = div_round_up((amount * u128::from(TWO_PCT)).into(), 1_000_000) + .ok() + .unwrap(); + + // Calculate initial a and b given L and sqrt(P) + let init_b = init_liq * init_price; + let init_a = init_liq / init_price; + + // Calculate amount_in given fee_percentage + let amount_in = amount - fee_amount; + + // Swapping a to b => + let new_a = init_a + amount_in; + + // Calculate next price + let next_price = div_round_up(init_liq << Q64_RESOLUTION, new_a) + .ok() + .unwrap(); + + // b - new_b + let amount_out = init_b - div_round_up(init_liq * init_liq, new_a).ok().unwrap(); + test_swap( + 100, + TWO_PCT, // 2 % fee + init_liq.try_into().unwrap(), // sqrt(ab) + // Current + // b = 1296 * 9 => 11664 + // a = 1296 / 9 => 144 + init_price << Q64_RESOLUTION, // sqrt (b/a) + // New + // a = 144 + 98 => 242 => 1296 / sqrt(P) = 242 => sqrt(P) = 1296 /242 + // next b = 1296 * 1296 / 242 => 6940 + price_limit << Q64_RESOLUTION, + true, + true, + SwapStepComputation { + amount_in: amount_in.try_into().unwrap(), + amount_out: amount_out.try_into().unwrap(), + next_price, + fee_amount: fee_amount.try_into().unwrap(), + }, + ); + } + + #[test] + fn swap_a_to_b_input_zero() { + test_swap( + 0, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + true, + false, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 9 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + + #[test] + fn swap_a_to_b_input_zero_liq() { + test_swap( + 100, + TWO_PCT, + 0, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + true, + false, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 4 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + + #[test] + fn swap_a_to_b_input_max() { + test_swap( + 1000, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + true, + true, + SwapStepComputation { + amount_in: 180, + amount_out: 6480, + next_price: 4 << Q64_RESOLUTION, + fee_amount: 4, + }, + ); + } + + #[test] + fn swap_a_to_b_input_max_1pct_fee() { + test_swap( + 1000, + TWO_PCT / 2, + 1296, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + true, + true, + SwapStepComputation { + amount_in: 180, + amount_out: 6480, + next_price: 4 << Q64_RESOLUTION, + fee_amount: 2, + }, + ); + } + + #[test] + fn swap_a_to_b_output() { + test_swap( + 4723, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + false, + true, + SwapStepComputation { + amount_in: 98, + amount_out: 4723, + next_price: 98795409425631171116, + fee_amount: 2, + }, + ); + } + + #[test] + fn swap_a_to_b_output_max() { + test_swap( + 10000, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + false, + true, + SwapStepComputation { + amount_in: 180, + amount_out: 6480, + next_price: 4 << Q64_RESOLUTION, + fee_amount: 4, + }, + ); + } + + #[test] + fn swap_a_to_b_output_zero() { + test_swap( + 0, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + false, + true, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 9 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + + #[test] + fn swap_a_to_b_output_zero_liq() { + test_swap( + 100, + TWO_PCT, + 0, + 9 << Q64_RESOLUTION, + 4 << Q64_RESOLUTION, + false, + true, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 4 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + + #[test] + fn swap_b_to_a_input() { + test_swap( + 2000, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + true, + false, + SwapStepComputation { + amount_in: 1960, + amount_out: 20, + next_price: 193918550355107200012, + fee_amount: 40, + }, + ); + } + + #[test] + fn swap_b_to_a_input_max() { + test_swap( + 20000, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + true, + false, + SwapStepComputation { + amount_in: 9072, + amount_out: 63, + next_price: 16 << Q64_RESOLUTION, + fee_amount: 186, + }, + ); + } + + #[test] + fn swap_b_to_a_input_zero() { + test_swap( + 0, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + true, + false, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 9 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + + #[test] + fn swap_b_to_a_input_zero_liq() { + test_swap( + 100, + TWO_PCT, + 0, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + true, + false, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 16 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + + #[test] + fn swap_b_to_a_output() { + test_swap( + 20, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + false, + false, + SwapStepComputation { + amount_in: 1882, + amount_out: 20, + next_price: 192798228383286926568, + fee_amount: 39, + }, + ); + } + + #[test] + fn swap_b_to_a_output_max() { + test_swap( + 80, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + false, + false, + SwapStepComputation { + amount_in: 9072, + amount_out: 63, + next_price: 16 << Q64_RESOLUTION, + fee_amount: 186, + }, + ); + } + + #[test] + fn swap_b_to_a_output_zero() { + test_swap( + 0, + TWO_PCT, + 1296, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + false, + false, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 9 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + + #[test] + fn swap_b_to_a_output_zero_liq() { + test_swap( + 100, + TWO_PCT, + 0, + 9 << Q64_RESOLUTION, + 16 << Q64_RESOLUTION, + false, + false, + SwapStepComputation { + amount_in: 0, + amount_out: 0, + next_price: 16 << Q64_RESOLUTION, + fee_amount: 0, + }, + ); + } + } + + fn test_swap( + amount_remaining: u64, + fee_rate: u16, + liquidity: u128, + sqrt_price_current: u128, + sqrt_price_target_limit: u128, + amount_specified_is_input: bool, + a_to_b: bool, + expected: SwapStepComputation, + ) { + let swap_computation = compute_swap( + amount_remaining, + fee_rate, + liquidity, + sqrt_price_current, + sqrt_price_target_limit, + amount_specified_is_input, + a_to_b, + ); + assert_eq!(swap_computation.ok().unwrap(), expected); + } +} diff --git a/programs/whirlpool/src/math/tick_math.rs b/programs/whirlpool/src/math/tick_math.rs new file mode 100644 index 0000000..b8b37a1 --- /dev/null +++ b/programs/whirlpool/src/math/tick_math.rs @@ -0,0 +1,595 @@ +use crate::math::u256_math::*; +use std::convert::TryInto; + +// Max/Min sqrt_price derived from max/min tick-index +pub const MAX_SQRT_PRICE_X64: u128 = 79226673515401279992447579055; +pub const MIN_SQRT_PRICE_X64: u128 = 4295048016; + +const LOG_B_2_X32: i128 = 59543866431248i128; +const BIT_PRECISION: u32 = 14; +const LOG_B_P_ERR_MARGIN_LOWER_X64: i128 = 184467440737095516i128; // 0.01 +const LOG_B_P_ERR_MARGIN_UPPER_X64: i128 = 15793534762490258745i128; // 2^-precision / log_2_b + 0.01 + +/// Derive the sqrt-price from a tick index. The precision of this method is only guarranted +/// if tick is within the bounds of {max, min} tick-index. +/// +/// # Parameters +/// - `tick` - A i32 integer representing the tick integer +/// +/// # Returns +/// - `Ok`: A u128 Q32.64 representing the sqrt_price +pub fn sqrt_price_from_tick_index(tick: i32) -> u128 { + if tick >= 0 { + get_sqrt_price_positive_tick(tick) + } else { + get_sqrt_price_negative_tick(tick) + } +} + +/// Derive the tick-index from a sqrt-price. The precision of this method is only guarranted +/// if sqrt-price is within the bounds of {max, min} sqrt-price. +/// +/// # Parameters +/// - `sqrt_price_x64` - A u128 Q64.64 integer representing the sqrt-price +/// +/// # Returns +/// - An i32 representing the tick_index of the provided sqrt-price +pub fn tick_index_from_sqrt_price(sqrt_price_x64: &u128) -> i32 { + // Determine log_b(sqrt_ratio). First by calculating integer portion (msb) + let msb: u32 = 128 - sqrt_price_x64.leading_zeros() - 1; + let log2p_integer_x32 = (msb as i128 - 64) << 32; + + // get fractional value (r/2^msb), msb always > 128 + // We begin the iteration from bit 63 (0.5 in Q64.64) + let mut bit: i128 = 0x8000_0000_0000_0000i128; + let mut precision = 0; + let mut log2p_fraction_x64 = 0; + + // Log2 iterative approximation for the fractional part + // Go through each 2^(j) bit where j < 64 in a Q64.64 number + // Append current bit value to fraction result if r^2 Q2.126 is more than 2 + let mut r = if msb >= 64 { + sqrt_price_x64 >> (msb - 63) + } else { + sqrt_price_x64 << (63 - msb) + }; + + while bit > 0 && precision < BIT_PRECISION { + r *= r; + let is_r_more_than_two = r >> 127 as u32; + r >>= 63 + is_r_more_than_two; + log2p_fraction_x64 += bit * is_r_more_than_two as i128; + bit >>= 1; + precision += 1; + } + + let log2p_fraction_x32 = log2p_fraction_x64 >> 32; + let log2p_x32 = log2p_integer_x32 + log2p_fraction_x32; + + // Transform from base 2 to base b + let logbp_x64 = log2p_x32 * LOG_B_2_X32; + + // Derive tick_low & high estimate. Adjust with the possibility of under-estimating by 2^precision_bits/log_2(b) + 0.01 error margin. + let tick_low: i32 = ((logbp_x64 - LOG_B_P_ERR_MARGIN_LOWER_X64) >> 64) + .try_into() + .unwrap(); + let tick_high: i32 = ((logbp_x64 + LOG_B_P_ERR_MARGIN_UPPER_X64) >> 64) + .try_into() + .unwrap(); + + let result_tick = if tick_low == tick_high { + tick_low + } else { + // If our estimation for tick_high returns a lower sqrt_price than the input + // then the actual tick_high has to be higher than than tick_high. + // Otherwise, the actual value is between tick_low & tick_high, so a floor value + // (tick_low) is returned + let actual_tick_high_sqrt_price_x64: u128 = sqrt_price_from_tick_index(tick_high); + if actual_tick_high_sqrt_price_x64 <= *sqrt_price_x64 { + tick_high + } else { + tick_low + } + }; + + result_tick +} + +fn mul_shift_96(n0: u128, n1: u128) -> u128 { + mul_u256(n0, n1).shift_right(96).try_into_u128().unwrap() +} + +// Performs the exponential conversion with Q64.64 precision +fn get_sqrt_price_positive_tick(tick: i32) -> u128 { + let mut ratio: u128 = if tick & 1 != 0 { + 79232123823359799118286999567 + } else { + 79228162514264337593543950336 + }; + + if tick & 2 != 0 { + ratio = mul_shift_96(ratio, 79236085330515764027303304731); + } + if tick & 4 != 0 { + ratio = mul_shift_96(ratio, 79244008939048815603706035061); + } + if tick & 8 != 0 { + ratio = mul_shift_96(ratio, 79259858533276714757314932305); + } + if tick & 16 != 0 { + ratio = mul_shift_96(ratio, 79291567232598584799939703904); + } + if tick & 32 != 0 { + ratio = mul_shift_96(ratio, 79355022692464371645785046466); + } + if tick & 64 != 0 { + ratio = mul_shift_96(ratio, 79482085999252804386437311141); + } + if tick & 128 != 0 { + ratio = mul_shift_96(ratio, 79736823300114093921829183326); + } + if tick & 256 != 0 { + ratio = mul_shift_96(ratio, 80248749790819932309965073892); + } + if tick & 512 != 0 { + ratio = mul_shift_96(ratio, 81282483887344747381513967011); + } + if tick & 1024 != 0 { + ratio = mul_shift_96(ratio, 83390072131320151908154831281); + } + if tick & 2048 != 0 { + ratio = mul_shift_96(ratio, 87770609709833776024991924138); + } + if tick & 4096 != 0 { + ratio = mul_shift_96(ratio, 97234110755111693312479820773); + } + if tick & 8192 != 0 { + ratio = mul_shift_96(ratio, 119332217159966728226237229890); + } + if tick & 16384 != 0 { + ratio = mul_shift_96(ratio, 179736315981702064433883588727); + } + if tick & 32768 != 0 { + ratio = mul_shift_96(ratio, 407748233172238350107850275304); + } + if tick & 65536 != 0 { + ratio = mul_shift_96(ratio, 2098478828474011932436660412517); + } + if tick & 131072 != 0 { + ratio = mul_shift_96(ratio, 55581415166113811149459800483533); + } + if tick & 262144 != 0 { + ratio = mul_shift_96(ratio, 38992368544603139932233054999993551); + } + + ratio >> 32 +} + +fn get_sqrt_price_negative_tick(tick: i32) -> u128 { + let abs_tick = tick.abs(); + + let mut ratio: u128 = if abs_tick & 1 != 0 { + 18445821805675392311 + } else { + 18446744073709551616 + }; + + if abs_tick & 2 != 0 { + ratio = (ratio * 18444899583751176498) >> 64 + } + if abs_tick & 4 != 0 { + ratio = (ratio * 18443055278223354162) >> 64 + } + if abs_tick & 8 != 0 { + ratio = (ratio * 18439367220385604838) >> 64 + } + if abs_tick & 16 != 0 { + ratio = (ratio * 18431993317065449817) >> 64 + } + if abs_tick & 32 != 0 { + ratio = (ratio * 18417254355718160513) >> 64 + } + if abs_tick & 64 != 0 { + ratio = (ratio * 18387811781193591352) >> 64 + } + if abs_tick & 128 != 0 { + ratio = (ratio * 18329067761203520168) >> 64 + } + if abs_tick & 256 != 0 { + ratio = (ratio * 18212142134806087854) >> 64 + } + if abs_tick & 512 != 0 { + ratio = (ratio * 17980523815641551639) >> 64 + } + if abs_tick & 1024 != 0 { + ratio = (ratio * 17526086738831147013) >> 64 + } + if abs_tick & 2048 != 0 { + ratio = (ratio * 16651378430235024244) >> 64 + } + if abs_tick & 4096 != 0 { + ratio = (ratio * 15030750278693429944) >> 64 + } + if abs_tick & 8192 != 0 { + ratio = (ratio * 12247334978882834399) >> 64 + } + if abs_tick & 16384 != 0 { + ratio = (ratio * 8131365268884726200) >> 64 + } + if abs_tick & 32768 != 0 { + ratio = (ratio * 3584323654723342297) >> 64 + } + if abs_tick & 65536 != 0 { + ratio = (ratio * 696457651847595233) >> 64 + } + if abs_tick & 131072 != 0 { + ratio = (ratio * 26294789957452057) >> 64 + } + if abs_tick & 262144 != 0 { + ratio = (ratio * 37481735321082) >> 64 + } + + ratio +} + +#[cfg(test)] +mod fuzz_tests { + + use super::*; + use crate::{ + math::U256, + state::{MAX_TICK_INDEX, MIN_TICK_INDEX}, + }; + use proptest::prelude::*; + + fn within_price_approximation(lower: u128, upper: u128) -> bool { + let precision = 96; + // We increase the resolution of upper to find ratio_x96 + let x = U256::from(upper) << precision; + let y = U256::from(lower); + + // (1.0001 ^ 0.5) << 96 (precision) + let sqrt_10001_x96 = 79232123823359799118286999567u128; + + // This ratio should be as close to sqrt_10001_x96 as possible + let ratio_x96 = x.div_mod(y).0.as_u128(); + + // Find absolute error in ratio in x96 + let error = if sqrt_10001_x96 > ratio_x96 { + sqrt_10001_x96 - ratio_x96 + } else { + ratio_x96 - sqrt_10001_x96 + }; + + // Calculate number of error bits + let error_bits = 128 - error.leading_zeros(); + return precision - error_bits >= 32; + } + + proptest! { + #[test] + fn test_tick_index_to_sqrt_price ( + tick in MIN_TICK_INDEX..MAX_TICK_INDEX, + ) { + let sqrt_price = sqrt_price_from_tick_index(tick); + + // Check bounds + assert!(sqrt_price >= MIN_SQRT_PRICE_X64); + assert!(sqrt_price <= MAX_SQRT_PRICE_X64); + + // Check the inverted tick has unique price and within bounds + let minus_tick_price = sqrt_price_from_tick_index(tick - 1); + let plus_tick_price = sqrt_price_from_tick_index(tick + 1); + assert!(minus_tick_price < sqrt_price && sqrt_price < plus_tick_price); + + // Check that sqrt_price_from_tick_index(tick + 1) approximates sqrt(1.0001) * sqrt_price_from_tick_index(tick) + assert!(within_price_approximation(minus_tick_price, sqrt_price)); + assert!(within_price_approximation(sqrt_price, plus_tick_price)); + } + + #[test] + fn test_tick_index_from_sqrt_price ( + sqrt_price in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64 + ) { + let tick = tick_index_from_sqrt_price(&sqrt_price); + + // Check bounds + assert!(tick >= MIN_TICK_INDEX); + assert!(tick < MAX_TICK_INDEX); + + // Check the inverted price from the calculated tick is within tick boundaries + assert!(sqrt_price >= sqrt_price_from_tick_index(tick) && sqrt_price < sqrt_price_from_tick_index(tick + 1)) + } + + #[test] + // Verify that both conversion functions are symmetrical. + fn test_tick_index_and_sqrt_price_symmetry ( + tick in MIN_TICK_INDEX..MAX_TICK_INDEX + ) { + + let sqrt_price_x64 = sqrt_price_from_tick_index(tick); + let resolved_tick = tick_index_from_sqrt_price(&sqrt_price_x64); + assert!(resolved_tick == tick); + } + + + #[test] + fn test_sqrt_price_from_tick_index_is_sequence ( + tick in MIN_TICK_INDEX-1..MAX_TICK_INDEX + ) { + + let sqrt_price_x64 = sqrt_price_from_tick_index(tick); + let last_sqrt_price_x64 = sqrt_price_from_tick_index(tick-1); + assert!(last_sqrt_price_x64 < sqrt_price_x64); + } + + #[test] + fn test_tick_index_from_sqrt_price_is_sequence ( + sqrt_price in (MIN_SQRT_PRICE_X64 + 10)..MAX_SQRT_PRICE_X64 + ) { + + let tick = tick_index_from_sqrt_price(&sqrt_price); + let last_tick = tick_index_from_sqrt_price(&(sqrt_price - 10)); + assert!(last_tick <= tick); + } + } +} + +#[cfg(test)] +mod test_tick_index_from_sqrt_price { + use super::*; + use crate::state::{MAX_TICK_INDEX, MIN_TICK_INDEX}; + + #[test] + fn test_sqrt_price_from_tick_index_at_max() { + let r = tick_index_from_sqrt_price(&MAX_SQRT_PRICE_X64); + assert_eq!(&r, &MAX_TICK_INDEX); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_min() { + let r = tick_index_from_sqrt_price(&MIN_SQRT_PRICE_X64); + assert_eq!(&r, &MIN_TICK_INDEX); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_max_add_one() { + let sqrt_price_x64_max_add_one = MAX_SQRT_PRICE_X64 + 1; + let tick_from_max_add_one = tick_index_from_sqrt_price(&sqrt_price_x64_max_add_one); + let sqrt_price_x64_max = MAX_SQRT_PRICE_X64 + 1; + let tick_from_max = tick_index_from_sqrt_price(&sqrt_price_x64_max); + + // We don't care about accuracy over the limit. We just care about it's equality properties. + assert_eq!(tick_from_max_add_one >= tick_from_max, true); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_min_add_one() { + let sqrt_price_x64 = MIN_SQRT_PRICE_X64 + 1; + let r = tick_index_from_sqrt_price(&sqrt_price_x64); + assert_eq!(&r, &(MIN_TICK_INDEX)); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_max_sub_one() { + let sqrt_price_x64 = MAX_SQRT_PRICE_X64 - 1; + let r = tick_index_from_sqrt_price(&sqrt_price_x64); + assert_eq!(&r, &(MAX_TICK_INDEX - 1)); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_min_sub_one() { + let sqrt_price_x64_min_sub_one = MIN_SQRT_PRICE_X64 - 1; + let tick_from_min_sub_one = tick_index_from_sqrt_price(&sqrt_price_x64_min_sub_one); + let sqrt_price_x64_min = MIN_SQRT_PRICE_X64 + 1; + let tick_from_min = tick_index_from_sqrt_price(&sqrt_price_x64_min); + + // We don't care about accuracy over the limit. We just care about it's equality properties. + assert_eq!(tick_from_min_sub_one < tick_from_min, true); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_one() { + let sqrt_price_x64: u128 = u64::MAX as u128 + 1; + let r = tick_index_from_sqrt_price(&sqrt_price_x64); + assert_eq!(r, 0); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_one_add_one() { + let sqrt_price_x64: u128 = u64::MAX as u128 + 2; + let r = tick_index_from_sqrt_price(&sqrt_price_x64); + assert_eq!(r, 0); + } + + #[test] + fn test_sqrt_price_from_tick_index_at_one_sub_one() { + let sqrt_price_x64: u128 = u64::MAX.into(); + let r = tick_index_from_sqrt_price(&sqrt_price_x64); + assert_eq!(r, -1); + } +} + +#[cfg(test)] +mod sqrt_price_from_tick_index_tests { + use super::*; + use crate::state::{MAX_TICK_INDEX, MIN_TICK_INDEX}; + + #[test] + #[should_panic(expected = "NumberDownCastError")] + // There should never be a use-case where we call this method with an out of bound index + fn test_tick_exceed_max() { + let sqrt_price_from_max_tick_add_one = sqrt_price_from_tick_index(MAX_TICK_INDEX + 1); + let sqrt_price_from_max_tick = sqrt_price_from_tick_index(MAX_TICK_INDEX); + assert_eq!( + sqrt_price_from_max_tick_add_one > sqrt_price_from_max_tick, + true + ); + } + + #[test] + fn test_tick_below_min() { + let sqrt_price_from_min_tick_sub_one = sqrt_price_from_tick_index(MIN_TICK_INDEX - 1); + let sqrt_price_from_min_tick = sqrt_price_from_tick_index(MIN_TICK_INDEX); + assert_eq!( + sqrt_price_from_min_tick_sub_one < sqrt_price_from_min_tick, + true + ); + } + + #[test] + fn test_tick_at_max() { + let max_tick = MAX_TICK_INDEX; + let r = sqrt_price_from_tick_index(max_tick); + assert_eq!(r, MAX_SQRT_PRICE_X64); + } + + #[test] + fn test_tick_at_min() { + let min_tick = MIN_TICK_INDEX; + let r = sqrt_price_from_tick_index(min_tick); + assert_eq!(r, MIN_SQRT_PRICE_X64); + } + + #[test] + fn test_exact_bit_values() { + let conditions = &[ + ( + 0i32, + 18446744073709551616u128, + 18446744073709551616u128, + "0x0", + ), + ( + 1i32, + 18447666387855959850u128, + 18445821805675392311u128, + "0x1", + ), + ( + 2i32, + 18448588748116922571u128, + 18444899583751176498u128, + "0x2", + ), + ( + 4i32, + 18450433606991734263u128, + 18443055278223354162u128, + "0x4", + ), + ( + 8i32, + 18454123878217468680u128, + 18439367220385604838u128, + "0x8", + ), + ( + 16i32, + 18461506635090006701u128, + 18431993317065449817u128, + "0x10", + ), + ( + 32i32, + 18476281010653910144u128, + 18417254355718160513u128, + "0x20", + ), + ( + 64i32, + 18505865242158250041u128, + 18387811781193591352u128, + "0x40", + ), + ( + 128i32, + 18565175891880433522u128, + 18329067761203520168u128, + "0x80", + ), + ( + 256i32, + 18684368066214940582u128, + 18212142134806087854u128, + "0x100", + ), + ( + 512i32, + 18925053041275764671u128, + 17980523815641551639u128, + "0x200", + ), + ( + 1024i32, + 19415764168677886926u128, + 17526086738831147013u128, + "0x400", + ), + ( + 2048i32, + 20435687552633177494u128, + 16651378430235024244u128, + "0x800", + ), + ( + 4096i32, + 22639080592224303007u128, + 15030750278693429944u128, + "0x1000", + ), + ( + 8192i32, + 27784196929998399742u128, + 12247334978882834399u128, + "0x2000", + ), + ( + 16384i32, + 41848122137994986128u128, + 8131365268884726200u128, + "0x4000", + ), + ( + 32768i32, + 94936283578220370716u128, + 3584323654723342297u128, + "0x8000", + ), + ( + 65536i32, + 488590176327622479860u128, + 696457651847595233u128, + "0x10000", + ), + ( + 131072i32, + 12941056668319229769860u128, + 26294789957452057u128, + "0x20000", + ), + ( + 262144i32, + 9078618265828848800676189u128, + 37481735321082u128, + "0x40000", + ), + ]; + + for (p_tick, expected, neg_expected, desc) in conditions { + let p_result = sqrt_price_from_tick_index(*p_tick); + let n_tick = -p_tick; + let n_result = sqrt_price_from_tick_index(n_tick); + assert_eq!( + p_result, *expected, + "Assert positive tick equals expected value on binary fraction bit = {} ", + desc + ); + assert_eq!( + n_result, *neg_expected, + "Assert negative tick equals expected value on binary fraction bit = {} ", + desc + ); + } + } +} diff --git a/programs/whirlpool/src/math/token_math.rs b/programs/whirlpool/src/math/token_math.rs new file mode 100644 index 0000000..e5b7b58 --- /dev/null +++ b/programs/whirlpool/src/math/token_math.rs @@ -0,0 +1,495 @@ +use crate::errors::ErrorCode; +use crate::math::Q64_RESOLUTION; + +use super::{ + checked_mul_shift_right_round_up_if, div_round_up_if, div_round_up_if_u256, mul_u256, + U256Muldiv, MAX_SQRT_PRICE_X64, MIN_SQRT_PRICE_X64, +}; + +// Fee rate is represented as hundredths of a basis point. +// Fee amount = total_amount * fee_rate / 1_000_000. +// Max fee rate supported is 1%. +pub const MAX_FEE_RATE: u16 = 10_000; + +// Assuming that FEE_RATE is represented as hundredths of a basis point +// We want FEE_RATE_MUL_VALUE = 1/FEE_RATE_UNIT, so 1e6 +pub const FEE_RATE_MUL_VALUE: u128 = 1_000_000; + +// Protocol fee rate is represented as a basis point. +// Protocol fee amount = fee_amount * protocol_fee_rate / 10_000. +// Max protocol fee rate supported is 25% of the fee rate. +pub const MAX_PROTOCOL_FEE_RATE: u16 = 2_500; + +// Assuming that PROTOCOL_FEE_RATE is represented as a basis point +// We want PROTOCOL_FEE_RATE_MUL_VALUE = 1/PROTOCOL_FEE_UNIT, so 1e4 +pub const PROTOCOL_FEE_RATE_MUL_VALUE: u128 = 10_000; + +// +// Get change in token_a corresponding to a change in price +// + +// 6.16 +// Δt_a = Δ(1 / sqrt_price) * liquidity + +// Replace delta +// Δt_a = (1 / sqrt_price_upper - 1 / sqrt_price_lower) * liquidity + +// Common denominator to simplify +// Δt_a = ((sqrt_price_lower - sqrt_price_upper) / (sqrt_price_upper * sqrt_price_lower)) * liquidity + +// Δt_a = (liquidity * (sqrt_price_lower - sqrt_price_upper)) / (sqrt_price_upper * sqrt_price_lower) +pub fn get_amount_delta_a( + sqrt_price_0: u128, + sqrt_price_1: u128, + liquidity: u128, + round_up: bool, +) -> Result { + let (sqrt_price_lower, sqrt_price_upper) = increasing_price_order(sqrt_price_0, sqrt_price_1); + + let sqrt_price_diff = sqrt_price_upper - sqrt_price_lower; + + let numerator = mul_u256(liquidity, sqrt_price_diff) + .checked_shift_word_left() + .ok_or(ErrorCode::MultiplicationOverflow)?; + + let denominator = mul_u256(sqrt_price_upper, sqrt_price_lower); + + let (quotient, remainder) = numerator.div(denominator, round_up); + + let result = if round_up && !remainder.is_zero() { + quotient.add(U256Muldiv::new(0, 1)).try_into_u128()? + } else { + quotient.try_into_u128()? + }; + + if result > u64::MAX as u128 { + return Err(ErrorCode::TokenMaxExceeded); + } + + return Ok(result as u64); +} + +// +// Get change in token_b corresponding to a change in price +// + +// 6.14 +// Δt_b = Δ(sqrt_price) * liquidity + +// Replace delta +// Δt_b = (sqrt_price_upper - sqrt_price_lower) * liquidity +pub fn get_amount_delta_b( + sqrt_price_0: u128, + sqrt_price_1: u128, + liquidity: u128, + round_up: bool, +) -> Result { + let (price_lower, price_upper) = increasing_price_order(sqrt_price_0, sqrt_price_1); + + // liquidity * (price_upper - price_lower) must be less than 2^128 + // for the token amount to be less than 2^64 + checked_mul_shift_right_round_up_if(liquidity, price_upper - price_lower, round_up) +} + +pub fn increasing_price_order(sqrt_price_0: u128, sqrt_price_1: u128) -> (u128, u128) { + if sqrt_price_0 > sqrt_price_1 { + (sqrt_price_1, sqrt_price_0) + } else { + (sqrt_price_0, sqrt_price_1) + } +} + +// +// Get change in price corresponding to a change in token_a supply +// +// 6.15 +// Δ(1 / sqrt_price) = Δt_a / liquidity +// +// Replace delta +// 1 / sqrt_price_new - 1 / sqrt_price = amount / liquidity +// +// Move sqrt price to other side +// 1 / sqrt_price_new = (amount / liquidity) + (1 / sqrt_price) +// +// Common denominator for right side +// 1 / sqrt_price_new = (sqrt_price * amount + liquidity) / (sqrt_price * liquidity) +// +// Invert fractions +// sqrt_price_new = (sqrt_price * liquidity) / (liquidity + amount * sqrt_price) +pub fn get_next_sqrt_price_from_a_round_up( + sqrt_price: u128, + liquidity: u128, + amount: u64, + amount_specified_is_input: bool, +) -> Result { + if amount == 0 { + return Ok(sqrt_price); + } + let product = mul_u256(sqrt_price, amount as u128); + + let numerator = mul_u256(liquidity, sqrt_price) + .checked_shift_word_left() + .ok_or(ErrorCode::MultiplicationOverflow)?; + + // In this scenario the denominator will end up being < 0 + let liquidity_shift_left = U256Muldiv::new(0, liquidity).shift_word_left(); + if !amount_specified_is_input && liquidity_shift_left.lte(product) { + return Err(ErrorCode::DivideByZero); + } + + let denominator = if amount_specified_is_input { + liquidity_shift_left.add(product) + } else { + liquidity_shift_left.sub(product) + }; + + let price = div_round_up_if_u256(numerator, denominator, true)?; + if price < MIN_SQRT_PRICE_X64 { + return Err(ErrorCode::TokenMinSubceeded); + } else if price > MAX_SQRT_PRICE_X64 { + return Err(ErrorCode::TokenMaxExceeded); + } + + Ok(price) +} + +// +// Get change in price corresponding to a change in token_b supply +// +// 6.13 +// Δ(sqrt_price) = Δt_b / liquidity +pub fn get_next_sqrt_price_from_b_round_down( + sqrt_price: u128, + liquidity: u128, + amount: u64, + amount_specified_is_input: bool, +) -> Result { + // We always want square root price to be rounded down, which means + // Case 3. If we are fixing input (adding B), we are increasing price, we want delta to be floor(delta) + // sqrt_price + floor(delta) < sqrt_price + delta + // + // Case 4. If we are fixing output (removing B), we are decreasing price, we want delta to be ceil(delta) + // sqrt_price - ceil(delta) < sqrt_price - delta + + // Q64.0 << 64 => Q64.64 + let amount_x64 = (amount as u128) << Q64_RESOLUTION; + + // Q64.64 / Q64.0 => Q64.64 + let delta = div_round_up_if(amount_x64, liquidity, !amount_specified_is_input)?; + + // Q64(32).64 +/- Q64.64 + if amount_specified_is_input { + // We are adding token b to supply, causing price to increase + sqrt_price + .checked_add(delta) + .ok_or(ErrorCode::SqrtPriceOutOfBounds) + } else { + // We are removing token b from supply,. causing price to decrease + sqrt_price + .checked_sub(delta) + .ok_or(ErrorCode::SqrtPriceOutOfBounds) + } +} + +pub fn get_next_sqrt_price( + sqrt_price: u128, + liquidity: u128, + amount: u64, + amount_specified_is_input: bool, + a_to_b: bool, +) -> Result { + if amount_specified_is_input == a_to_b { + // We are fixing A + // Case 1. amount_specified_is_input = true, a_to_b = true + // We are exchanging A to B with at most _amount_ of A (input) + // + // Case 2. amount_specified_is_input = false, a_to_b = false + // We are exchanging B to A wanting to guarantee at least _amount_ of A (output) + // + // In either case we want the sqrt_price to be rounded up. + // + // Eq 1. sqrt_price = sqrt( b / a ) + // + // Case 1. amount_specified_is_input = true, a_to_b = true + // We are adding token A to the supply, causing price to decrease (Eq 1.) + // Since we are fixing input, we can not exceed the amount that is being provided by the user. + // Because a higher price is inversely correlated with an increased supply of A, + // a higher price means we are adding less A. Thus when performing math, we wish to round the + // price up, since that means that we are guaranteed to not exceed the fixed amount of A provided. + // + // Case 2. amount_specified_is_input = false, a_to_b = false + // We are removing token A from the supply, causing price to increase (Eq 1.) + // Since we are fixing output, we want to guarantee that the user is provided at least _amount_ of A + // Because a higher price is correlated with a decreased supply of A, + // a higher price means we are removing more A to give to the user. Thus when performing math, we wish + // to round the price up, since that means we guarantee that user receives at least _amount_ of A + get_next_sqrt_price_from_a_round_up( + sqrt_price, + liquidity, + amount, + amount_specified_is_input, + ) + } else { + // We are fixing B + // Case 3. amount_specified_is_input = true, a_to_b = false + // We are exchanging B to A using at most _amount_ of B (input) + // + // Case 4. amount_specified_is_input = false, a_to_b = true + // We are exchanging A to B wanting to guarantee at least _amount_ of B (output) + // + // In either case we want the sqrt_price to be rounded down. + // + // Eq 1. sqrt_price = sqrt( b / a ) + // + // Case 3. amount_specified_is_input = true, a_to_b = false + // We are adding token B to the supply, causing price to increase (Eq 1.) + // Since we are fixing input, we can not exceed the amount that is being provided by the user. + // Because a lower price is inversely correlated with an increased supply of B, + // a lower price means that we are adding less B. Thus when performing math, we wish to round the + // price down, since that means that we are guaranteed to not exceed the fixed amount of B provided. + // + // Case 4. amount_specified_is_input = false, a_to_b = true + // We are removing token B from the supply, causing price to decrease (Eq 1.) + // Since we are fixing output, we want to guarantee that the user is provided at least _amount_ of B + // Because a lower price is correlated with a decreased supply of B, + // a lower price means we are removing more B to give to the user. Thus when performing math, we + // wish to round the price down, since that means we guarantee that the user receives at least _amount_ of B + get_next_sqrt_price_from_b_round_down( + sqrt_price, + liquidity, + amount, + amount_specified_is_input, + ) + } +} + +#[cfg(test)] +mod fuzz_tests { + use super::*; + use crate::math::{bit_math::*, tick_math::*, U256}; + use proptest::prelude::*; + + // Cases where the math overflows or errors + // + // get_next_sqrt_price_from_a_round_up + // sqrt_price_new = (sqrt_price * liquidity) / (liquidity + amount * sqrt_price) + // + // If amount_specified_is_input == false + // DivideByZero: (liquidity / liquidity - amount * sqrt_price) + // liquidity <= sqrt_price * amount, divide by zero error + // TokenMax/MinExceed + // (sqrt_price * liquidity) / (liquidity + amount * sqrt_price) > 2^32 - 1 + // + // get_next_sqrt_price_from_b_round_down + // SqrtPriceOutOfBounds + // sqrt_price - (amount / liquidity) < 0 + // + // get_amount_delta_b + // TokenMaxExceeded + // (price_1 - price_0) * liquidity > 2^64 + + proptest! { + #[test] + fn test_get_next_sqrt_price_from_a_round_up ( + sqrt_price in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + liquidity in 1..u128::MAX, + amount in 0..u64::MAX, + ) { + prop_assume!(sqrt_price != 0); + + // Case 1. amount_specified_is_input = true, a_to_b = true + // We are adding token A to the supply, causing price to decrease (Eq 1.) + // Since we are fixing input, we can not exceed the amount that is being provided by the user. + // Because a higher price is inversely correlated with an increased supply of A, + // a higher price means we are adding less A. Thus when performing math, we wish to round the + // price up, since that means that we are guaranteed to not exceed the fixed amount of A provided + let case_1_price = get_next_sqrt_price_from_a_round_up(sqrt_price, liquidity, amount, true); + if liquidity.leading_zeros() + sqrt_price.leading_zeros() < Q64_RESOLUTION.into() { + assert!(case_1_price.is_err()); + } else { + assert!(amount >= get_amount_delta_a(sqrt_price, case_1_price?, liquidity, true)?); + + // Case 2. amount_specified_is_input = false, a_to_b = false + // We are removing token A from the supply, causing price to increase (Eq 1.) + // Since we are fixing output, we want to guarantee that the user is provided at least _amount_ of A + // Because a higher price is correlated with a decreased supply of A, + // a higher price means we are removing more A to give to the user. Thus when performing math, we wish + // to round the price up, since that means we guarantee that user receives at least _amount_ of A + let case_2_price = get_next_sqrt_price_from_a_round_up(sqrt_price, liquidity, amount, false); + + + // We need to expand into U256 space here in order to support large enough values + // Q64 << 64 => Q64.64 + let liquidity_x64 = U256::from(liquidity) << Q64_RESOLUTION; + + // Q64.64 * Q64 => Q128.64 + let product = U256::from(sqrt_price) * U256::from(amount); + if liquidity_x64 <= product { + assert!(case_2_price.is_err()); + } else { + assert!(amount <= get_amount_delta_a(sqrt_price, case_2_price?, liquidity, false)?); + assert!(case_2_price? >= sqrt_price); + } + + if amount == 0 { + assert!(case_1_price? == case_2_price?); + } + } + } + + #[test] + fn test_get_next_sqrt_price_from_b_round_down ( + sqrt_price in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + liquidity in 1..u128::MAX, + amount in 0..u64::MAX, + ) { + prop_assume!(sqrt_price != 0); + + // Case 3. amount_specified_is_input = true, a_to_b = false + // We are adding token B to the supply, causing price to increase (Eq 1.) + // Since we are fixing input, we can not exceed the amount that is being provided by the user. + // Because a lower price is inversely correlated with an increased supply of B, + // a lower price means that we are adding less B. Thus when performing math, we wish to round the + // price down, since that means that we are guaranteed to not exceed the fixed amount of B provided. + let case_3_price = get_next_sqrt_price_from_b_round_down(sqrt_price, liquidity, amount, true)?; + assert!(case_3_price >= sqrt_price); + assert!(amount >= get_amount_delta_b(sqrt_price, case_3_price, liquidity, true)?); + + // Case 4. amount_specified_is_input = false, a_to_b = true + // We are removing token B from the supply, causing price to decrease (Eq 1.) + // Since we are fixing output, we want to guarantee that the user is provided at least _amount_ of B + // Because a lower price is correlated with a decreased supply of B, + // a lower price means we are removing more B to give to the user. Thus when performing math, we + // wish to round the price down, since that means we guarantee that the user receives at least _amount_ of B + let case_4_price = get_next_sqrt_price_from_b_round_down(sqrt_price, liquidity, amount, false); + + // Q64.0 << 64 => Q64.64 + let amount_x64 = u128::from(amount) << Q64_RESOLUTION; + let delta = div_round_up(amount_x64, liquidity.into())?; + + if sqrt_price < delta { + // In Case 4, error if sqrt_price < delta + assert!(case_4_price.is_err()); + } else { + let calc_delta = get_amount_delta_b(sqrt_price, case_4_price?, liquidity, false); + if calc_delta.is_ok() { + assert!(amount <= calc_delta?); + } + // In Case 4, price is decreasing + assert!(case_4_price? <= sqrt_price); + } + + if amount == 0 { + assert!(case_3_price == case_4_price?); + } + } + + + #[test] + fn test_get_amount_delta_a( + sqrt_price_0 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + sqrt_price_1 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + liquidity in 0..u128::MAX, + ) { + let (sqrt_price_lower, sqrt_price_upper) = increasing_price_order(sqrt_price_0, sqrt_price_1); + + let rounded = get_amount_delta_a(sqrt_price_0, sqrt_price_1, liquidity, true); + + if liquidity.leading_zeros() + (sqrt_price_upper - sqrt_price_lower).leading_zeros() < Q64_RESOLUTION.into() { + assert!(rounded.is_err()) + } else { + let unrounded = get_amount_delta_a(sqrt_price_0, sqrt_price_1, liquidity, false)?; + + // Price difference symmetry + assert_eq!(rounded?, get_amount_delta_a(sqrt_price_1, sqrt_price_0, liquidity, true)?); + assert_eq!(unrounded, get_amount_delta_a(sqrt_price_1, sqrt_price_0, liquidity, false)?); + + // Rounded should always be larger + assert!(unrounded <= rounded?); + + // Diff should be no more than 1 + assert!(rounded? - unrounded <= 1); + } + } + + #[test] + fn test_get_amount_delta_b( + sqrt_price_0 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + sqrt_price_1 in MIN_SQRT_PRICE_X64..MAX_SQRT_PRICE_X64, + liquidity in 0..u128::MAX, + ) { + let (price_lower, price_upper) = increasing_price_order(sqrt_price_0, sqrt_price_1); + + // We need 256 here since we may end up above u128 bits + let n_0 = U256::from(liquidity); // Q64.0, not using 64 MSB + let n_1 = U256::from(price_upper - price_lower); // Q32.64 - Q32.64 => Q32.64 + + // Shift by 64 in order to remove fractional bits + let m = n_0 * n_1; // Q64.0 * Q32.64 => Q96.64 + let delta = m >> Q64_RESOLUTION; // Q96.64 >> 64 => Q96.0 + let has_mod = m % TO_Q64 > U256::zero(); + let round_up_delta = if has_mod { delta + U256::from(1) } else { delta }; + + let rounded = get_amount_delta_b(sqrt_price_0, sqrt_price_1, liquidity, true); + let unrounded = get_amount_delta_b(sqrt_price_0, sqrt_price_1, liquidity, false); + + let u64_max_in_u256 = U256::from(u64::MAX); + if delta > u64_max_in_u256 { + assert!(rounded.is_err()); + assert!(unrounded.is_err()); + } else if round_up_delta > u64_max_in_u256 { + assert!(rounded.is_err()); + // Price symmmetry + assert_eq!(unrounded?, get_amount_delta_b(sqrt_price_1, sqrt_price_0, liquidity, false)?); + } else { + // Price difference symmetry + assert_eq!(rounded?, get_amount_delta_b(sqrt_price_1, sqrt_price_0, liquidity, true)?); + assert_eq!(unrounded?, get_amount_delta_b(sqrt_price_1, sqrt_price_0, liquidity, false)?); + + // Rounded should always be larger + assert!(unrounded? <= rounded? ); + + // Diff should be no more than 1 + assert!(rounded? - unrounded? <= 1); + } + + } + } +} + +#[cfg(test)] +mod test_get_amount_delta { + // Δt_a = ((liquidity * (sqrt_price_lower - sqrt_price_upper)) / sqrt_price_upper) / sqrt_price_lower + use super::get_amount_delta_a; + use super::get_amount_delta_b; + + #[test] + fn test_get_amount_delta_ok() { + // A + assert_eq!(get_amount_delta_a(4 << 64, 2 << 64, 4, true).unwrap(), 1); + assert_eq!(get_amount_delta_a(4 << 64, 2 << 64, 4, false).unwrap(), 1); + + // B + assert_eq!(get_amount_delta_b(4 << 64, 2 << 64, 4, true).unwrap(), 8); + assert_eq!(get_amount_delta_b(4 << 64, 2 << 64, 4, false).unwrap(), 8); + } + + #[test] + fn test_get_amount_delta_price_diff_zero_ok() { + // A + assert_eq!(get_amount_delta_a(4 << 64, 4 << 64, 4, true).unwrap(), 0); + assert_eq!(get_amount_delta_a(4 << 64, 4 << 64, 4, false).unwrap(), 0); + + // B + assert_eq!(get_amount_delta_b(4 << 64, 4 << 64, 4, true).unwrap(), 0); + assert_eq!(get_amount_delta_b(4 << 64, 4 << 64, 4, false).unwrap(), 0); + } + + #[test] + fn test_get_amount_delta_a_overflow() { + assert!(get_amount_delta_a(1 << 64, 2 << 64, u128::MAX, true).is_err()); + assert!(get_amount_delta_a(1 << 64, 2 << 64, (u64::MAX as u128) << 1 + 1, true).is_err()); + assert!(get_amount_delta_a(1 << 64, 2 << 64, (u64::MAX as u128) << 1, true).is_ok()); + assert!(get_amount_delta_a(1 << 64, 2 << 64, u64::MAX as u128, true).is_ok()); + } +} diff --git a/programs/whirlpool/src/math/u256_math.rs b/programs/whirlpool/src/math/u256_math.rs new file mode 100644 index 0000000..b1e5915 --- /dev/null +++ b/programs/whirlpool/src/math/u256_math.rs @@ -0,0 +1,1051 @@ +use std::{ + cmp::Ordering, + fmt::{Display, Formatter, Result as FmtResult}, + str::from_utf8_unchecked, +}; + +use crate::errors::ErrorCode; + +const NUM_WORDS: usize = 4; + +#[derive(Copy, Clone, Debug)] +pub struct U256Muldiv { + pub items: [u64; NUM_WORDS], +} + +impl U256Muldiv { + pub fn new(h: u128, l: u128) -> Self { + U256Muldiv { + items: [l.lo(), l.hi(), h.lo(), h.hi()], + } + } + + fn copy(&self) -> Self { + let mut items: [u64; NUM_WORDS] = [0; NUM_WORDS]; + items.copy_from_slice(&self.items); + U256Muldiv { items } + } + + fn update_word(&mut self, index: usize, value: u64) { + self.items[index] = value; + } + + fn num_words(&self) -> usize { + for i in (0..self.items.len()).rev() { + if self.items[i] != 0 { + return i + 1; + } + } + 0 + } + + pub fn get_word(&self, index: usize) -> u64 { + self.items[index] + } + + pub fn get_word_u128(&self, index: usize) -> u128 { + self.items[index] as u128 + } + + // Logical-left shift, does not trigger overflow + pub fn shift_word_left(&self) -> Self { + let mut result = U256Muldiv::new(0, 0); + + for i in (0..NUM_WORDS - 1).rev() { + result.items[i + 1] = self.items[i]; + } + + result + } + + pub fn checked_shift_word_left(&self) -> Option { + let last_element = self.items.last(); + + match last_element { + None => Some(self.shift_word_left()), + Some(element) => { + if *element > 0 { + None + } else { + Some(self.shift_word_left()) + } + } + } + } + + // Logical-left shift, does not trigger overflow + pub fn shift_left(&self, mut shift_amount: u32) -> Self { + // Return 0 if shift is greater than number of bits + if shift_amount >= U64_RESOLUTION * (NUM_WORDS as u32) { + return U256Muldiv::new(0, 0); + } + + let mut result = self.copy(); + + while shift_amount >= U64_RESOLUTION { + result = result.shift_word_left(); + shift_amount -= U64_RESOLUTION; + } + + if shift_amount == 0 { + return result; + } + + for i in (1..NUM_WORDS).rev() { + result.items[i] = result.items[i] << shift_amount + | result.items[i - 1] >> (U64_RESOLUTION - shift_amount); + } + + result.items[0] = result.items[0] << shift_amount; + + result + } + + // Logical-right shift, does not trigger overflow + pub fn shift_word_right(&self) -> Self { + let mut result = U256Muldiv::new(0, 0); + + for i in 0..NUM_WORDS - 1 { + result.items[i] = self.items[i + 1] + } + + result + } + + // Logical-right shift, does not trigger overflow + pub fn shift_right(&self, mut shift_amount: u32) -> Self { + // Return 0 if shift is greater than number of bits + if shift_amount >= U64_RESOLUTION * (NUM_WORDS as u32) { + return U256Muldiv::new(0, 0); + } + + let mut result = self.copy(); + + while shift_amount >= U64_RESOLUTION { + result = result.shift_word_right(); + shift_amount -= U64_RESOLUTION; + } + + if shift_amount == 0 { + return result; + } + + for i in 0..NUM_WORDS - 1 { + result.items[i] = result.items[i] >> shift_amount + | result.items[i + 1] << (U64_RESOLUTION - shift_amount); + } + + result.items[3] = result.items[3] >> shift_amount; + + result + } + + pub fn eq(&self, other: U256Muldiv) -> bool { + for i in 0..self.items.len() { + if self.items[i] != other.items[i] { + return false; + } + } + + true + } + + pub fn lt(&self, other: U256Muldiv) -> bool { + for i in (0..self.items.len()).rev() { + match self.items[i].cmp(&other.items[i]) { + Ordering::Less => return true, + Ordering::Greater => return false, + Ordering::Equal => {} + } + } + + false + } + + pub fn gt(&self, other: U256Muldiv) -> bool { + for i in (0..self.items.len()).rev() { + match self.items[i].cmp(&other.items[i]) { + Ordering::Less => return false, + Ordering::Greater => return true, + Ordering::Equal => {} + } + } + + false + } + + pub fn lte(&self, other: U256Muldiv) -> bool { + for i in (0..self.items.len()).rev() { + match self.items[i].cmp(&other.items[i]) { + Ordering::Less => return true, + Ordering::Greater => return false, + Ordering::Equal => {} + } + } + + true + } + + pub fn gte(&self, other: U256Muldiv) -> bool { + for i in (0..self.items.len()).rev() { + match self.items[i].cmp(&other.items[i]) { + Ordering::Less => return false, + Ordering::Greater => return true, + Ordering::Equal => {} + } + } + + true + } + + pub fn try_into_u128(&self) -> Result { + if self.num_words() > 2 { + return Err(ErrorCode::NumberDownCastError); + } + + Ok((self.items[1] as u128) << U64_RESOLUTION | (self.items[0] as u128)) + } + + pub fn is_zero(self) -> bool { + for i in 0..NUM_WORDS { + if self.items[i] != 0 { + return false; + } + } + + true + } + + // Input: + // m = U256::MAX + 1 (which is the amount used for overflow) + // n = input value + // Output: + // r = smallest positive additive inverse of n mod m + // + // We wish to find r, s.t., r + n ≡ 0 mod m; + // We generally wish to find this r since r ≡ -n mod m + // and can make operations with n with large number of bits + // fit into u256 space without overflow + pub fn get_add_inverse(&self) -> Self { + // Additive inverse of 0 is 0 + if self.eq(U256Muldiv::new(0, 0)) { + return U256Muldiv::new(0, 0); + } + // To ensure we don't overflow, we begin with max and do a subtraction + U256Muldiv::new(u128::MAX, u128::MAX) + .sub(*self) + .add(U256Muldiv::new(0, 1)) + } + + // Result overflows if the result is greater than 2^256-1 + pub fn add(&self, other: U256Muldiv) -> Self { + let mut result = U256Muldiv::new(0, 0); + + let mut carry = 0; + for i in 0..NUM_WORDS { + let x = self.get_word_u128(i); + let y = other.get_word_u128(i); + let t = x + y + carry; + result.update_word(i, t.lo()); + + carry = t.hi_u128(); + } + + result + } + + // Result underflows if the result is greater than 2^256-1 + pub fn sub(&self, other: U256Muldiv) -> Self { + let mut result = U256Muldiv::new(0, 0); + + let mut carry = 0; + for i in 0..NUM_WORDS { + let x = self.get_word(i); + let y = other.get_word(i); + let (t0, overflowing0) = x.overflowing_sub(y); + let (t1, overflowing1) = t0.overflowing_sub(carry); + result.update_word(i, t1); + + carry = if overflowing0 || overflowing1 { 1 } else { 0 }; + } + + result + } + + // Result overflows if great than 2^256-1 + pub fn mul(&self, other: U256Muldiv) -> Self { + let mut result = U256Muldiv::new(0, 0); + + let m = self.num_words(); + let n = other.num_words(); + + for j in 0..n { + let mut k = 0; + for i in 0..m { + let x = self.get_word_u128(i); + let y = other.get_word_u128(j); + if i + j < NUM_WORDS { + let z = result.get_word_u128(i + j); + let t = x.wrapping_mul(y).wrapping_add(z).wrapping_add(k); + result.update_word(i + j, t.lo()); + k = t.hi_u128(); + } + } + + // Don't update the carry word + if j + m < NUM_WORDS { + result.update_word(j + m, k as u64); + } + } + + result + } + + // Result returns 0 if divide by zero + pub fn div(&self, mut divisor: U256Muldiv, return_remainder: bool) -> (Self, Self) { + let mut dividend = self.copy(); + let mut quotient = U256Muldiv::new(0, 0); + + let num_dividend_words = dividend.num_words(); + let num_divisor_words = divisor.num_words(); + + if num_divisor_words == 0 { + panic!("divide by zero"); + } + + // Case 0. If either the dividend or divisor is 0, return 0 + if num_dividend_words == 0 { + return (U256Muldiv::new(0, 0), U256Muldiv::new(0, 0)); + } + + // Case 1. Dividend is smaller than divisor, quotient = 0, remainder = dividend + if num_dividend_words < num_divisor_words { + if return_remainder { + return (U256Muldiv::new(0, 0), dividend); + } else { + return (U256Muldiv::new(0, 0), U256Muldiv::new(0, 0)); + } + } + + // Case 2. Dividend is smaller than u128, divisor <= dividend, perform math in u128 space + if num_dividend_words < 3 { + let dividend = dividend.try_into_u128().unwrap(); + let divisor = divisor.try_into_u128().unwrap(); + let quotient = dividend / divisor; + if return_remainder { + let remainder = dividend % divisor; + return (U256Muldiv::new(0, quotient), U256Muldiv::new(0, remainder)); + } else { + return (U256Muldiv::new(0, quotient), U256Muldiv::new(0, 0)); + } + } + + // Case 3. Divisor is single-word, we must isolate this case for correctness + if num_divisor_words == 1 { + let mut k = 0; + for j in (0..num_dividend_words).rev() { + let d1 = hi_lo(k.lo(), dividend.get_word(j)); + let d2 = divisor.get_word_u128(0); + let q = d1 / d2; + k = d1 - d2 * q; + quotient.update_word(j, q.lo()); + } + + if return_remainder { + return (quotient, U256Muldiv::new(0, k)); + } else { + return (quotient, U256Muldiv::new(0, 0)); + } + } + + // Normalize the division by shifting left + let s = divisor.get_word(num_divisor_words - 1).leading_zeros(); + let b = dividend.get_word(num_dividend_words - 1).leading_zeros(); + + // Conditional carry space for normalized division + let mut dividend_carry_space: u64 = 0; + if num_dividend_words == NUM_WORDS && b < s { + dividend_carry_space = dividend.items[num_dividend_words - 1] >> (U64_RESOLUTION - s); + } + dividend = dividend.shift_left(s); + divisor = divisor.shift_left(s); + + for j in (0..num_dividend_words - num_divisor_words + 1).rev() { + let result = div_loop( + j, + num_divisor_words, + dividend, + &mut dividend_carry_space, + divisor, + quotient, + ); + quotient = result.0; + dividend = result.1; + } + + if return_remainder { + dividend = dividend.shift_right(s); + return (quotient, dividend); + } else { + return (quotient, U256Muldiv::new(0, 0)); + } + } +} + +impl Display for U256Muldiv { + fn fmt(&self, f: &mut Formatter) -> FmtResult { + let mut buf = [0_u8; NUM_WORDS * 20]; + let mut i = buf.len() - 1; + + let ten = U256Muldiv::new(0, 10); + let mut current = *self; + + loop { + let (quotient, remainder) = current.div(ten, true); + let digit = remainder.get_word(0) as u8; + buf[i] = digit + b'0'; + current = quotient; + + if current.is_zero() { + break; + } + + i -= 1; + } + + let s = unsafe { from_utf8_unchecked(&buf[i..]) }; + + f.write_str(s) + } +} + +const U64_MAX: u128 = u64::MAX as u128; +const U64_RESOLUTION: u32 = 64; + +pub trait LoHi { + fn lo(self) -> u64; + fn hi(self) -> u64; + fn lo_u128(self) -> u128; + fn hi_u128(self) -> u128; +} + +impl LoHi for u128 { + fn lo(self) -> u64 { + (self & U64_MAX) as u64 + } + fn lo_u128(self) -> u128 { + self & U64_MAX + } + fn hi(self) -> u64 { + (self >> U64_RESOLUTION) as u64 + } + fn hi_u128(self) -> u128 { + self >> U64_RESOLUTION + } +} + +pub fn hi_lo(hi: u64, lo: u64) -> u128 { + (hi as u128) << U64_RESOLUTION | (lo as u128) +} + +pub fn mul_u256(v: u128, n: u128) -> U256Muldiv { + // do 128 bits multiply + // nh nl + // * vh vl + // ---------- + // a0 = vl * nl + // a1 = vl * nh + // b0 = vh * nl + // b1 = + vh * nh + // ------------------- + // c1h c1l c0h c0l + // + // "a0" is optimized away, result is stored directly in c0. "b1" is + // optimized away, result is stored directly in c1. + // + + let mut c0 = v.lo_u128() * n.lo_u128(); + let a1 = v.lo_u128() * n.hi_u128(); + let b0 = v.hi_u128() * n.lo_u128(); + + // add the high word of a0 to the low words of a1 and b0 using c1 as + // scrach space to capture the carry. the low word of the result becomes + // the final high word of c0 + let mut c1 = c0.hi_u128() + a1.lo_u128() + b0.lo_u128(); + + c0 = hi_lo(c1.lo(), c0.lo()); + + // add the carry from the result above (found in the high word of c1) and + // the high words of a1 and b0 to b1, the result is c1. + c1 = v.hi_u128() * n.hi_u128() + c1.hi_u128() + a1.hi_u128() + b0.hi_u128(); + + U256Muldiv::new(c1, c0) +} + +fn div_loop( + index: usize, + num_divisor_words: usize, + mut dividend: U256Muldiv, + dividend_carry_space: &mut u64, + divisor: U256Muldiv, + mut quotient: U256Muldiv, +) -> (U256Muldiv, U256Muldiv) { + let use_carry = (index + num_divisor_words) == NUM_WORDS; + let div_hi = if use_carry { + *dividend_carry_space + } else { + dividend.get_word(index + num_divisor_words) + }; + let d0 = hi_lo(div_hi, dividend.get_word(index + num_divisor_words - 1)); + let d1 = divisor.get_word_u128(num_divisor_words - 1); + + let mut qhat = d0 / d1; + let mut rhat = d0 - d1 * qhat; + + let d0_2 = dividend.get_word(index + num_divisor_words - 2); + let d1_2 = divisor.get_word_u128(num_divisor_words - 2); + + let mut cmp1 = hi_lo(rhat.lo(), d0_2); + let mut cmp2 = qhat.wrapping_mul(d1_2); + + while qhat.hi() != 0 || cmp2 > cmp1 { + qhat -= 1; + rhat += d1; + if rhat.hi() != 0 { + break; + } + + cmp1 = hi_lo(rhat.lo(), cmp1.lo()); + cmp2 -= d1_2; + } + + let mut k = 0; + let mut t; + for i in 0..num_divisor_words { + let p = qhat * (divisor.get_word_u128(i)); + t = (dividend.get_word_u128(index + i)) + .wrapping_sub(k) + .wrapping_sub(p.lo_u128()); + dividend.update_word(index + i, t.lo()); + k = ((p >> U64_RESOLUTION) as u64).wrapping_sub((t >> U64_RESOLUTION) as u64) as u128; + } + + let d_head = if use_carry { + *dividend_carry_space as u128 + } else { + dividend.get_word_u128(index + num_divisor_words) + }; + + t = d_head.wrapping_sub(k); + if use_carry { + *dividend_carry_space = t.lo(); + } else { + dividend.update_word(index + num_divisor_words, t.lo()); + } + + if k > d_head { + qhat -= 1; + k = 0; + for i in 0..num_divisor_words { + t = dividend + .get_word_u128(index + i) + .wrapping_add(divisor.get_word_u128(i)) + .wrapping_add(k); + dividend.update_word(index + i, t.lo()); + k = t >> U64_RESOLUTION; + } + + let new_carry = dividend + .get_word_u128(index + num_divisor_words) + .wrapping_add(k) + .lo(); + if use_carry { + *dividend_carry_space = new_carry + } else { + dividend.update_word( + index + num_divisor_words, + dividend + .get_word_u128(index + num_divisor_words) + .wrapping_add(k) + .lo(), + ); + } + } + + quotient.update_word(index, qhat.lo()); + + (quotient, dividend) +} + +#[cfg(test)] +mod fuzz_tests { + use proptest::prelude::*; + + use crate::math::{mul_u256, U256Muldiv, U256}; + + fn assert_equality(n0: U256Muldiv, n1: U256) { + assert_eq!(n0.get_word(0), n1.0[0], "failed: 0"); + assert_eq!(n0.get_word(1), n1.0[1], "failed: 1"); + assert_eq!(n0.get_word(2), n1.0[2], "failed: 2"); + assert_eq!(n0.get_word(3), n1.0[3], "failed: 3"); + } + + proptest! { + #[test] + fn test_lt(n0_lo in 0..u128::MAX, n0_hi in 0..u128::MAX, n1_lo in 0..u128::MAX, n1_hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + + let result = n0.lt(n1); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + let other_result = other_n0 < other_n1; + + assert_eq!(result, other_result); + } + + #[test] + fn test_gt(n0_lo in 0..u128::MAX, n0_hi in 0..u128::MAX, n1_lo in 0..u128::MAX, n1_hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + + let result = n0.gt(n1); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + let other_result = other_n0 > other_n1; + + assert_eq!(result, other_result); + } + + #[test] + fn test_lte(n0_lo in 0..u128::MAX, n0_hi in 0..u128::MAX, n1_lo in 0..u128::MAX, n1_hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + + let result = n0.lte(n1); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + let other_result = other_n0 <= other_n1; + + assert_eq!(result, other_result); + } + + #[test] + fn test_gte(n0_lo in 0..u128::MAX, n0_hi in 0..u128::MAX, n1_lo in 0..u128::MAX, n1_hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + + let result = n0.gte(n1); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + let other_result = other_n0 >= other_n1; + + // Should always be >= to itself + assert_eq!(n0.gte(n0), true); + + // Should be equivalent to u256 operation + assert_eq!(result, other_result); + } + + #[test] + fn test_eq(n0_lo in 0..u128::MAX, n0_hi in 0..u128::MAX, n1_lo in 0..u128::MAX, n1_hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + + let result_self = n0.eq(n0); + let result = n0.eq(n1); + let result2 = n1.eq(n0); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + let other_result = other_n0 == other_n1; + + // Should always be = to itself + assert_eq!(result_self, true); + + // Should be equivalent to using u256 space + assert_eq!(result, other_result); + assert_eq!(result2, other_result); + + // Property should be symmetric, n0.eq(n1) == n1.eq(n0) + assert_eq!(result, result2); + } + + #[test] + fn test_div(dividend_hi in 0..u128::MAX, dividend_lo in 0..u128::MAX, divisor_hi in 0..u128::MAX, divisor_lo in 0..u128::MAX) { + let dividend = U256Muldiv::new(dividend_hi, dividend_lo); + let divisor = U256Muldiv::new(divisor_hi, divisor_lo); + + let result = dividend.div(divisor, false).0; + + let other_dividend = (U256::from(dividend_hi) << 128) + U256::from(dividend_lo); + let other_divisor = (U256::from(divisor_hi) << 128) + U256::from(divisor_lo); + + let other_result = other_dividend / other_divisor; + + assert_equality(result, other_result); + } + + #[test] + fn test_add(n0_lo in 0..u128::MAX, n0_hi in 0..u128::MAX, n1_lo in 0..u128::MAX, n1_hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + + let result = n0.add(n1); + let result2 = n1.add(n0); + let add_zero = n0.add(U256Muldiv::new(0, 0)); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + // Assert addition is symmetric + assert!(result.eq(result2)); + + // Adding 0 is no-op + assert!(n0.eq(add_zero)); + + match other_n0.checked_add(other_n1) { + Some(other_result) => { + // Assert results equal to addition in U256 space + assert_equality(result, other_result); + }, + None => { + // U256 has overflowed, we allow overflow, so the overflow amount should be (n0 + n1) mod (U256::MAX + 1) + + // Since we know that n0 + n1 >= U256::MAX + 1, their sum of additive inverses must be < U256::MAX + 1 + // Thus we calculate neg_sum = -n0 + -n1 mod U256::MAX + 1 + let add_inv_0 = n0.get_add_inverse(); + let add_inv_1 = n1.get_add_inverse(); + let neg_sum = add_inv_0.add(add_inv_1); + + // We then invert the neg_sum to get the expected overflow which should be the equivalent of n0 + n1 mod U256::MAX + // without any overflowing operations + let overflow = neg_sum.get_add_inverse(); + + assert!(result.eq(overflow)); + }, + } + } + + #[test] + fn test_overflow_equality(lo in 0..u128::MAX, hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(hi, lo); + + // Overflowing in either direction should be equivalent + let n1 = n0.add(U256Muldiv::new(u128::MAX, u128::MAX)).add(U256Muldiv::new(0, 1)); + let n2 = n0.sub(U256Muldiv::new(u128::MAX, u128::MAX)).sub(U256Muldiv::new(0, 1)); + + assert!(n0.eq(n1)); + assert!(n0.eq(n2)); + } + + #[test] + fn test_sub(n0_lo in 0..u128::MAX, n0_hi in 0..u128::MAX, n1_lo in 0..u128::MAX, n1_hi in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + + let result = n0.sub(n1); + let result2 = n0.sub(U256Muldiv::new(0, 0)); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + // Subtracting zero is no-op + assert!(result2.eq(n0)); + + match n0.gt(n1) { + true => { + let other_result = other_n0 - other_n1; + assert_equality(result, other_result); + }, + false => { + // n1 >= n0 so we know that n1 - n0 does not overflow + // n1 - n0 ≡ -(n0 - n1) mod U256::MAX + 1 + let neg = n1.sub(n0); + let overflow = neg.get_add_inverse(); + assert!(result.eq(overflow)); + } + } + } + + #[test] + fn test_fmt(n_lo in 0..u128::MAX, n_hi in 0..u128::MAX) { + let n = U256Muldiv::new(n_hi, n_lo); + + let other_n = (U256::from(n_hi) << 128) + U256::from(n_lo); + + assert_eq!(format!("{}", n), format!("{}", other_n)); + } + + #[test] + fn test_mul_u256(n0 in 0..u128::MAX, n1 in 0..u128::MAX) { + let result = mul_u256(n0, n1); + + let other_result = U256::from(n0) * U256::from(n1); + + assert_equality(result, other_result); + } + + #[test] + fn test_get_add_inv(n_hi in 0..u128::MAX, n_lo in 0..u128::MAX) { + let n = U256Muldiv::new(n_hi, n_lo); + let inverse = n.get_add_inverse(); + + let result = n.add(inverse); + assert!(result.eq(U256Muldiv::new(0, 0))); + } + + #[test] + fn test_shift_right(n_hi in 1..u128::MAX, n_lo in 0..u128::MAX, shift_amount in 1u32..128) { + let n = U256Muldiv::new(n_hi, n_lo); + let result = n.shift_right(shift_amount); + + let other_n = (U256::from(n_hi) << 128) + U256::from(n_lo); + let other_result = other_n >> shift_amount; + + assert_equality(result, other_result); + } + + #[test] + fn test_shift_left(n_hi in 0u128..(u32::MAX as u128), n_lo in 0..u128::MAX, shift_amount in 1u32..96) { + let n = U256Muldiv::new(n_hi, n_lo); + let result = n.shift_left(shift_amount); + + let other_n = (U256::from(n_hi) << 128) + U256::from(n_lo); + let other_result = other_n << shift_amount; + + assert_equality(result, other_result); + } + + #[test] + fn test_checked_shift_word_left(n_hi in 0u128..(u64::MAX as u128), n_lo in 0..u128::MAX) { + let n = U256Muldiv::new(n_hi, n_lo); + let result = n.checked_shift_word_left(); + + let other_n = (U256::from(n_hi) << 128) + U256::from(n_lo); + let other_result = other_n << 64; + + let final_result = result.unwrap(); + assert_equality(final_result, other_result); + } + + #[test] + fn test_checked_shift_word_left_overflow(n_hi in u64::MAX as u128..u128::MAX, n_lo in 0..u128::MAX) { + let n = U256Muldiv::new(n_hi, n_lo); + let result = n.checked_shift_word_left(); + + assert!(result.is_none()) + } + + #[test] + fn test_mul(n0_hi in 0..u128::MAX, n0_lo in 0..u128::MAX, n1_hi in 0..u128::MAX, n1_lo in 0..u128::MAX) { + let n0 = U256Muldiv::new(n0_hi, n0_lo); + let n1 = U256Muldiv::new(n1_hi, n1_lo); + let result = n0.mul(n1); + + let other_n0 = (U256::from(n0_hi) << 128) + U256::from(n0_lo); + let other_n1 = (U256::from(n1_hi) << 128) + U256::from(n1_lo); + + match other_n0.checked_mul(other_n1) { + Some(other_result) => { + // Assert results equal to addition in U256 space + assert_equality(result, other_result); + }, + None => { + // The intention here is to enforce that the total number of bits <= 256 + // If either of the values are larger than 2 words, we use the additive inverse + // which is congruent to the negative value mod U256::MAX + 1 + // We are guaranteed that at least one of the values is > 2 words since we have overflowed + let should_inv_n0 = n0.num_words() > 2; + let should_inv_n1 = n1.num_words() > 2; + + let maybe_inv_n0 = if should_inv_n0 { + n0.get_add_inverse() + } else { + n0 + }; + let maybe_inv_n1 = if should_inv_n1 { + n1.get_add_inverse() + } else { + n1 + }; + + let prod = maybe_inv_n0.mul(maybe_inv_n1); + + let overflow = if should_inv_n0 == should_inv_n1 { + // If we have inverted both n0 and n1, the inversions cancel out + prod + } else { + // Otherwise, invert the product again + prod.get_add_inverse() + }; + assert!(result.eq(overflow)); + }, + } + } + } +} + +#[cfg(test)] +mod test_add { + use crate::math::U256Muldiv; + + #[test] + fn test_add_overflow_0() { + let n0 = U256Muldiv::new(u128::MAX, u128::MAX); + let n1 = n0.copy(); + + let result = n0.add(n1); + + assert!(result.eq(U256Muldiv::new(u128::MAX, u128::MAX - 1))); + } + + #[test] + fn test_add_overflow_1() { + let n0 = U256Muldiv::new(u128::MAX, u128::MAX); + let n1 = U256Muldiv::new(0, 1); + + let result = n0.add(n1); + + assert!(result.eq(U256Muldiv::new(0, 0))); + } +} + +#[cfg(test)] +mod test_sub { + use crate::math::U256Muldiv; + + #[test] + fn test_sub_underflow_0() { + let n0 = U256Muldiv::new(u128::MAX, u128::MAX - 1); + let n1 = U256Muldiv::new(u128::MAX, u128::MAX); + + let result = n0.sub(n1); + + assert!(result.eq(U256Muldiv::new(u128::MAX, u128::MAX))); + } + + #[test] + fn test_sub_underflow_1() { + let n0 = U256Muldiv::new(0, 0); + let n1 = U256Muldiv::new(0, 1); + + let result = n0.sub(n1); + + assert!(result.eq(U256Muldiv::new(u128::MAX, u128::MAX))); + } +} + +#[cfg(test)] +mod test_div { + use crate::math::U256; + + use super::U256Muldiv; + + #[test] + fn test_div_0() { + let dividend = U256Muldiv::new(50 << 64, 100 << 64); + let divisor = U256Muldiv::new(0, 100 << 64); + let result = dividend.div(divisor, true); + + let result2 = ((U256::from(50u128 << 64) << 128) + U256::from(100u128 << 64)) + .div_mod(U256::from(100u128 << 64)); + + assert!(format!("{}", result.0) == format!("{}", result2.0)); + assert!(format!("{}", result.1) == format!("{}", result2.1)); + } + + #[test] + fn test_div_1() { + let dividend = U256Muldiv::new(100, 100); + let divisor = U256Muldiv::new(0, 50 << 64); + let result = dividend.div(divisor, true); + + let result2 = + ((U256::from(100u128) << 128) + U256::from(100u128)).div_mod(U256::from(50u128 << 64)); + + assert!(format!("{}", result.0) == format!("{}", result2.0)); + assert!(format!("{}", result.1) == format!("{}", result2.1)); + } + + #[test] + fn test_div_2() { + let dividend = U256Muldiv::new(50, 100 << 64); + let divisor = U256Muldiv::new(0, 100 << 64); + let result = dividend.div(divisor, true); + + let result2 = ((U256::from(50u128) << 128) + U256::from(100u128 << 64)) + .div_mod(U256::from(100u128 << 64)); + + assert!(format!("{}", result.0) == format!("{}", result2.0)); + assert!(format!("{}", result.1) == format!("{}", result2.1)); + } + + #[test] + fn test_div_3() { + let dividend = U256Muldiv::new(50, 100 << 64); + let divisor = U256Muldiv::new(0, 66); + let result = dividend.div(divisor, true); + + let result2 = + ((U256::from(50) << 128) + U256::from(100u128 << 64)).div_mod(U256::from(66u128)); + + assert!(format!("{}", result.0) == format!("{}", result2.0)); + assert!(format!("{}", result.1) == format!("{}", result2.1)); + } + + #[test] + fn test_div_4() { + let dividend = U256Muldiv::new(100 << 64, 0); + let divisor = U256Muldiv::new(1 << 63, u64::MAX as u128); + let result = dividend.div(divisor, true); + + let result2 = (U256::from(100u128 << 64) << 128) + .div_mod((U256::from(1u128 << 63) << 128) + U256::from(u64::MAX)); + + assert!(format!("{}", result.0) == format!("{}", result2.0)); + assert!(format!("{}", result.1) == format!("{}", result2.1)); + } + + #[test] + fn test_div_5() { + let dividend = U256Muldiv::new(100 << 64, 0); + let divisor = U256Muldiv::new(1 << 63, 0); + let result = dividend.div(divisor, true); + + let result2 = (U256::from(100u128 << 64) << 128).div_mod(U256::from(1u128 << 63) << 128); + + assert!(format!("{}", result.0) == format!("{}", result2.0)); + assert!(format!("{}", result.1) == format!("{}", result2.1)); + } + + #[test] + fn test_div_6() { + let dividend = U256Muldiv::new(1 << 63, 0); + let divisor = U256Muldiv::new(1 << 63, 1); + let result = dividend.div(divisor, true); + + let result2 = + (U256::from(1u128 << 63) << 128).div_mod((U256::from(1u128 << 63) << 128) + 1); + + assert!(format!("{}", result.0) == format!("{}", result2.0)); + assert!(format!("{}", result.1) == format!("{}", result2.1)); + } + + #[test] + #[should_panic(expected = "divide by zero")] + fn test_div_7() { + let dividend = U256Muldiv::new(1 << 63, 0); + let divisor = U256Muldiv::new(0, 0); + let _ = dividend.div(divisor, true); + } +} diff --git a/programs/whirlpool/src/state/config.rs b/programs/whirlpool/src/state/config.rs new file mode 100644 index 0000000..416ece9 --- /dev/null +++ b/programs/whirlpool/src/state/config.rs @@ -0,0 +1,61 @@ +use anchor_lang::prelude::*; + +use crate::{errors::ErrorCode, math::MAX_PROTOCOL_FEE_RATE}; + +#[account] +pub struct WhirlpoolsConfig { + pub fee_authority: Pubkey, + pub collect_protocol_fees_authority: Pubkey, + pub reward_emissions_super_authority: Pubkey, + + pub default_protocol_fee_rate: u16, +} + +impl WhirlpoolsConfig { + pub const LEN: usize = 8 + 96 + 4; + + pub fn update_fee_authority(&mut self, fee_authority: Pubkey) { + self.fee_authority = fee_authority; + } + + pub fn update_collect_protocol_fees_authority( + &mut self, + collect_protocol_fees_authority: Pubkey, + ) { + self.collect_protocol_fees_authority = collect_protocol_fees_authority; + } + + pub fn initialize( + &mut self, + fee_authority: Pubkey, + collect_protocol_fees_authority: Pubkey, + reward_emissions_super_authority: Pubkey, + default_protocol_fee_rate: u16, + ) -> Result<(), ErrorCode> { + self.fee_authority = fee_authority; + self.collect_protocol_fees_authority = collect_protocol_fees_authority; + self.reward_emissions_super_authority = reward_emissions_super_authority; + self.update_default_protocol_fee_rate(default_protocol_fee_rate)?; + + Ok(()) + } + + pub fn update_reward_emissions_super_authority( + &mut self, + reward_emissions_super_authority: Pubkey, + ) { + self.reward_emissions_super_authority = reward_emissions_super_authority; + } + + pub fn update_default_protocol_fee_rate( + &mut self, + default_protocol_fee_rate: u16, + ) -> Result<(), ErrorCode> { + if default_protocol_fee_rate > MAX_PROTOCOL_FEE_RATE { + return Err(ErrorCode::ProtocolFeeRateMaxExceeded.into()); + } + self.default_protocol_fee_rate = default_protocol_fee_rate; + + Ok(()) + } +} diff --git a/programs/whirlpool/src/state/fee_tier.rs b/programs/whirlpool/src/state/fee_tier.rs new file mode 100644 index 0000000..fb59cdf --- /dev/null +++ b/programs/whirlpool/src/state/fee_tier.rs @@ -0,0 +1,35 @@ +use crate::state::WhirlpoolsConfig; +use crate::{errors::ErrorCode, math::MAX_FEE_RATE}; +use anchor_lang::prelude::*; + +#[account] +pub struct FeeTier { + pub whirlpools_config: Pubkey, + pub tick_spacing: u16, + pub default_fee_rate: u16, +} + +impl FeeTier { + pub const LEN: usize = 8 + 32 + 4; + + pub fn initialize( + &mut self, + whirlpools_config: &Account, + tick_spacing: u16, + default_fee_rate: u16, + ) -> Result<(), ErrorCode> { + self.whirlpools_config = whirlpools_config.key(); + self.tick_spacing = tick_spacing; + self.update_default_fee_rate(default_fee_rate)?; + Ok(()) + } + + pub fn update_default_fee_rate(&mut self, default_fee_rate: u16) -> Result<(), ErrorCode> { + if default_fee_rate > MAX_FEE_RATE { + return Err(ErrorCode::FeeRateMaxExceeded.into()); + } + self.default_fee_rate = default_fee_rate; + + Ok(()) + } +} diff --git a/programs/whirlpool/src/state/mod.rs b/programs/whirlpool/src/state/mod.rs new file mode 100644 index 0000000..c35582b --- /dev/null +++ b/programs/whirlpool/src/state/mod.rs @@ -0,0 +1,11 @@ +pub mod config; +pub mod fee_tier; +pub mod position; +pub mod tick; +pub mod whirlpool; + +pub use self::whirlpool::*; +pub use config::*; +pub use fee_tier::*; +pub use position::*; +pub use tick::*; diff --git a/programs/whirlpool/src/state/position.rs b/programs/whirlpool/src/state/position.rs new file mode 100644 index 0000000..9184fdc --- /dev/null +++ b/programs/whirlpool/src/state/position.rs @@ -0,0 +1,276 @@ +use anchor_lang::prelude::*; + +use crate::{errors::ErrorCode, state::NUM_REWARDS}; + +use super::{Tick, Whirlpool}; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default, Copy)] +pub struct OpenPositionBumps { + pub position_bump: u8, +} + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default, Copy)] +pub struct OpenPositionWithMetadataBumps { + pub position_bump: u8, + pub metadata_bump: u8, +} + +#[account] +#[derive(Default)] +pub struct Position { + pub whirlpool: Pubkey, // 32 + pub position_mint: Pubkey, // 32 + pub liquidity: u128, // 16 + pub tick_lower_index: i32, // 4 + pub tick_upper_index: i32, // 4 + + // Q64.64 + pub fee_growth_checkpoint_a: u128, // 16 + pub fee_owed_a: u64, // 8 + // Q64.64 + pub fee_growth_checkpoint_b: u128, // 16 + pub fee_owed_b: u64, // 8 + + pub reward_infos: [PositionRewardInfo; NUM_REWARDS], // 72 +} + +impl Position { + pub const LEN: usize = 8 + 136 + 72; + + pub fn is_position_empty<'info>(position: &Position) -> bool { + let fees_not_owed = position.fee_owed_a == 0 && position.fee_owed_b == 0; + let mut rewards_not_owed = true; + for i in 0..NUM_REWARDS { + rewards_not_owed = rewards_not_owed && position.reward_infos[i].amount_owed == 0 + } + position.liquidity == 0 && fees_not_owed && rewards_not_owed + } + + pub fn update(&mut self, update: &PositionUpdate) { + self.liquidity = update.liquidity; + self.fee_growth_checkpoint_a = update.fee_growth_checkpoint_a; + self.fee_growth_checkpoint_b = update.fee_growth_checkpoint_b; + self.fee_owed_a = update.fee_owed_a; + self.fee_owed_b = update.fee_owed_b; + self.reward_infos = update.reward_infos; + } + + pub fn open_position( + &mut self, + whirlpool: &Account, + position_mint: Pubkey, + tick_lower_index: i32, + tick_upper_index: i32, + ) -> Result<(), ErrorCode> { + if !Tick::check_is_usable_tick(tick_lower_index, whirlpool.tick_spacing) + || !Tick::check_is_usable_tick(tick_upper_index, whirlpool.tick_spacing) + || tick_lower_index >= tick_upper_index + { + return Err(ErrorCode::InvalidTickIndex.into()); + } + + self.whirlpool = whirlpool.key(); + self.position_mint = position_mint; + + self.tick_lower_index = tick_lower_index; + self.tick_upper_index = tick_upper_index; + Ok(()) + } + + pub fn reset_fees_owed(&mut self) { + self.fee_owed_a = 0; + self.fee_owed_b = 0; + } + + pub fn update_reward_owed(&mut self, index: usize, amount_owed: u64) { + self.reward_infos[index].amount_owed = amount_owed; + } +} + +#[derive(Copy, Clone, AnchorSerialize, AnchorDeserialize, Default, Debug, PartialEq)] +pub struct PositionRewardInfo { + // Q64.64 + pub growth_inside_checkpoint: u128, + pub amount_owed: u64, +} + +#[derive(Default, Debug, PartialEq)] +pub struct PositionUpdate { + pub liquidity: u128, + pub fee_growth_checkpoint_a: u128, + pub fee_owed_a: u64, + pub fee_growth_checkpoint_b: u128, + pub fee_owed_b: u64, + pub reward_infos: [PositionRewardInfo; NUM_REWARDS], +} + +#[cfg(test)] +mod is_position_empty_tests { + use super::*; + use crate::constants::test_constants::*; + + pub fn build_test_position( + liquidity: u128, + fee_owed_a: u64, + fee_owed_b: u64, + reward_owed_0: u64, + reward_owed_1: u64, + reward_owed_2: u64, + ) -> Position { + Position { + whirlpool: test_program_id(), + position_mint: test_program_id(), + liquidity, + tick_lower_index: 0, + tick_upper_index: 0, + fee_growth_checkpoint_a: 0, + fee_owed_a, + fee_growth_checkpoint_b: 0, + fee_owed_b, + reward_infos: [ + PositionRewardInfo { + growth_inside_checkpoint: 0, + amount_owed: reward_owed_0, + }, + PositionRewardInfo { + growth_inside_checkpoint: 0, + amount_owed: reward_owed_1, + }, + PositionRewardInfo { + growth_inside_checkpoint: 0, + amount_owed: reward_owed_2, + }, + ], + } + } + + #[test] + fn test_position_empty() { + let pos = build_test_position(0, 0, 0, 0, 0, 0); + assert_eq!(Position::is_position_empty(&pos), true); + } + + #[test] + fn test_liquidity_non_zero() { + let pos = build_test_position(100, 0, 0, 0, 0, 0); + assert_eq!(Position::is_position_empty(&pos), false); + } + + #[test] + fn test_fee_a_non_zero() { + let pos = build_test_position(0, 100, 0, 0, 0, 0); + assert_eq!(Position::is_position_empty(&pos), false); + } + + #[test] + fn test_fee_b_non_zero() { + let pos = build_test_position(0, 0, 100, 0, 0, 0); + assert_eq!(Position::is_position_empty(&pos), false); + } + + #[test] + fn test_reward_0_non_zero() { + let pos = build_test_position(0, 0, 0, 100, 0, 0); + assert_eq!(Position::is_position_empty(&pos), false); + } + + #[test] + fn test_reward_1_non_zero() { + let pos = build_test_position(0, 0, 0, 0, 100, 0); + assert_eq!(Position::is_position_empty(&pos), false); + } + + #[test] + fn test_reward_2_non_zero() { + let pos = build_test_position(0, 0, 0, 0, 0, 100); + assert_eq!(Position::is_position_empty(&pos), false); + } +} + +#[cfg(test)] +pub mod position_builder { + use anchor_lang::prelude::Pubkey; + + use super::{Position, PositionRewardInfo}; + use crate::state::NUM_REWARDS; + + #[derive(Default)] + pub struct PositionBuilder { + liquidity: u128, + + tick_lower_index: i32, + tick_upper_index: i32, + + // Q64.64 + fee_growth_checkpoint_a: u128, + fee_owed_a: u64, + // Q64.64 + fee_growth_checkpoint_b: u128, + fee_owed_b: u64, + + // Size should equal state::NUM_REWARDS + reward_infos: [PositionRewardInfo; NUM_REWARDS], + } + + impl PositionBuilder { + pub fn new(tick_lower_index: i32, tick_upper_index: i32) -> Self { + Self { + tick_lower_index, + tick_upper_index, + reward_infos: [PositionRewardInfo::default(); NUM_REWARDS], + ..Default::default() + } + } + + pub fn liquidity(mut self, liquidity: u128) -> Self { + self.liquidity = liquidity; + self + } + + pub fn fee_growth_checkpoint_a(mut self, fee_growth_checkpoint_a: u128) -> Self { + self.fee_growth_checkpoint_a = fee_growth_checkpoint_a; + self + } + + pub fn fee_growth_checkpoint_b(mut self, fee_growth_checkpoint_b: u128) -> Self { + self.fee_growth_checkpoint_b = fee_growth_checkpoint_b; + self + } + + pub fn fee_owed_a(mut self, fee_owed_a: u64) -> Self { + self.fee_owed_a = fee_owed_a; + self + } + + pub fn fee_owed_b(mut self, fee_owed_b: u64) -> Self { + self.fee_owed_b = fee_owed_b; + self + } + + pub fn reward_info(mut self, index: usize, reward_info: PositionRewardInfo) -> Self { + self.reward_infos[index] = reward_info; + self + } + + pub fn reward_infos(mut self, reward_infos: [PositionRewardInfo; NUM_REWARDS]) -> Self { + self.reward_infos = reward_infos; + self + } + + pub fn build(self) -> Position { + Position { + whirlpool: Pubkey::new_unique(), + position_mint: Pubkey::new_unique(), + liquidity: self.liquidity, + fee_growth_checkpoint_a: self.fee_growth_checkpoint_a, + fee_growth_checkpoint_b: self.fee_growth_checkpoint_b, + fee_owed_a: self.fee_owed_a, + fee_owed_b: self.fee_owed_b, + reward_infos: self.reward_infos, + tick_lower_index: self.tick_lower_index, + tick_upper_index: self.tick_upper_index, + ..Default::default() + } + } + } +} diff --git a/programs/whirlpool/src/state/tick.rs b/programs/whirlpool/src/state/tick.rs new file mode 100644 index 0000000..bf0cbdc --- /dev/null +++ b/programs/whirlpool/src/state/tick.rs @@ -0,0 +1,624 @@ +use crate::errors::ErrorCode; +use crate::state::NUM_REWARDS; +use anchor_lang::prelude::*; + +use super::Whirlpool; + +// Max & min tick index based on sqrt(1.0001) & max.min price of 2^64 +pub const MAX_TICK_INDEX: i32 = 443636; +pub const MIN_TICK_INDEX: i32 = -443636; + +// We have two consts because most of our code uses it as a i32. However, +// for us to use it in tick array declarations, anchor requires it to be a usize. +pub const TICK_ARRAY_SIZE: i32 = 88; +pub const TICK_ARRAY_SIZE_USIZE: usize = 88; + +#[zero_copy] +#[repr(packed)] +#[derive(Default, Debug, PartialEq)] +pub struct Tick { + // Total 137 bytes + pub initialized: bool, // 1 + pub liquidity_net: i128, // 16 + pub liquidity_gross: u128, // 16 + + // Q64.64 + pub fee_growth_outside_a: u128, // 16 + // Q64.64 + pub fee_growth_outside_b: u128, // 16 + + // Array of Q64.64 + pub reward_growths_outside: [u128; NUM_REWARDS], // 48 = 16 * 3 +} + +impl Tick { + pub const LEN: usize = 113; + + /// Apply an update for this tick + /// + /// # Parameters + /// - `update` - An update object to update the values in this tick + pub fn update(&mut self, update: &TickUpdate) { + self.initialized = update.initialized; + self.liquidity_net = update.liquidity_net; + self.liquidity_gross = update.liquidity_gross; + self.fee_growth_outside_a = update.fee_growth_outside_a; + self.fee_growth_outside_b = update.fee_growth_outside_b; + self.reward_growths_outside = update.reward_growths_outside; + } + + /// Check that the tick index is within the supported range of this contract + /// + /// # Parameters + /// - `tick_index` - A i32 integer representing the tick index + /// + /// # Returns + /// - `true`: The tick index is not within the range supported by this contract + /// - `false`: The tick index is within the range supported by this contract + pub fn check_is_out_of_bounds(tick_index: i32) -> bool { + tick_index > MAX_TICK_INDEX || tick_index < MIN_TICK_INDEX + } + + /// Check that the tick index is a valid start tick for a tick array in this whirlpool + /// A valid start-tick-index is a multiple of tick_spacing & number of ticks in a tick-array. + /// + /// # Parameters + /// - `tick_index` - A i32 integer representing the tick index + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// + /// # Returns + /// - `true`: The tick index is a valid start-tick-index for this whirlpool + /// - `false`: The tick index is not a valid start-tick-index for this whirlpool + /// or the tick index not within the range supported by this contract + pub fn check_is_valid_start_tick(tick_index: i32, tick_spacing: u16) -> bool { + let ticks_in_array = TICK_ARRAY_SIZE * tick_spacing as i32; + + if Tick::check_is_out_of_bounds(tick_index) { + // Left-edge tick-array can have a start-tick-index smaller than the min tick index + if tick_index > MIN_TICK_INDEX { + return false; + } + + let min_array_start_index = + MIN_TICK_INDEX - (MIN_TICK_INDEX % ticks_in_array + ticks_in_array); + return tick_index == min_array_start_index; + } + tick_index % ticks_in_array == 0 + } + + /// Check that the tick index is within bounds and is a usable tick index for the given tick spacing. + /// + /// # Parameters + /// - `tick_index` - A i32 integer representing the tick index + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// + /// # Returns + /// - `true`: The tick index is within max/min index bounds for this protocol and is a usable tick-index given the tick-spacing + /// - `false`: The tick index is out of bounds or is not a usable tick for this tick-spacing + pub fn check_is_usable_tick(tick_index: i32, tick_spacing: u16) -> bool { + if Tick::check_is_out_of_bounds(tick_index) { + return false; + } + + tick_index % tick_spacing as i32 == 0 + } + + /// Bound a tick-index value to the max & min index value for this protocol + /// + /// # Parameters + /// - `tick_index` - A i32 integer representing the tick index + /// + /// # Returns + /// - `i32` The input tick index value but bounded by the max/min value of this protocol. + pub fn bound_tick_index(tick_index: i32) -> i32 { + tick_index.max(MIN_TICK_INDEX).min(MAX_TICK_INDEX) + } +} + +#[derive(Default, Debug, PartialEq)] +pub struct TickUpdate { + pub initialized: bool, + pub liquidity_net: i128, + pub liquidity_gross: u128, + pub fee_growth_outside_a: u128, + pub fee_growth_outside_b: u128, + pub reward_growths_outside: [u128; NUM_REWARDS], +} + +impl TickUpdate { + pub fn from(tick: &Tick) -> TickUpdate { + TickUpdate { + initialized: tick.initialized, + liquidity_net: tick.liquidity_net, + liquidity_gross: tick.liquidity_gross, + fee_growth_outside_a: tick.fee_growth_outside_a, + fee_growth_outside_b: tick.fee_growth_outside_b, + reward_growths_outside: tick.reward_growths_outside, + } + } +} + +#[account(zero_copy)] +#[repr(packed)] +pub struct TickArray { + pub start_tick_index: i32, + pub ticks: [Tick; TICK_ARRAY_SIZE_USIZE], + pub whirlpool: Pubkey, +} + +impl Default for TickArray { + #[inline] + fn default() -> TickArray { + TickArray { + whirlpool: Pubkey::default(), + ticks: [Tick::default(); TICK_ARRAY_SIZE_USIZE], + start_tick_index: 0, + } + } +} + +impl TickArray { + pub const LEN: usize = 8 + 36 + (Tick::LEN * TICK_ARRAY_SIZE_USIZE); + + /// Search for the next initialized tick in this array. + /// + /// # Parameters + /// - `tick_index` - A i32 integer representing the tick index to start searching for + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// - `a_to_b` - If the trade is from a_to_b, the search will move to the left and the starting search tick is inclusive. + /// If the trade is from b_to_a, the search will move to the right and the starting search tick is not inclusive. + /// + /// # Returns + /// - `Some(i32)`: The next initialized tick index of this array + /// - `None`: An initialized tick index was not found in this array + /// - `InvalidTickArraySequence` - error if `tick_index` is not a valid search tick for the array + /// - `InvalidTickSpacing` - error if the provided tick spacing is 0 + pub fn get_next_init_tick_index( + &self, + tick_index: i32, + tick_spacing: u16, + a_to_b: bool, + ) -> Result, ErrorCode> { + if !self.in_search_range(tick_index, tick_spacing, !a_to_b) { + return Err(ErrorCode::InvalidTickArraySequence); + } + + let mut curr_offset = match self.tick_offset(tick_index, tick_spacing) { + Ok(value) => value as i32, + Err(e) => return Err(e), + }; + + // For a_to_b searches, the search moves to the left. The next possible init-tick can be the 1st tick in the current offset + // For b_to_a searches, the search moves to the right. The next possible init-tick cannot be within the current offset + if !a_to_b { + curr_offset += 1; + } + + while curr_offset >= 0 && curr_offset < TICK_ARRAY_SIZE { + let curr_tick = self.ticks[curr_offset as usize]; + if curr_tick.initialized { + return Ok(Some( + (curr_offset * tick_spacing as i32) + self.start_tick_index, + )); + } + + curr_offset = if a_to_b { + curr_offset - 1 + } else { + curr_offset + 1 + }; + } + + Ok(None) + } + + /// Initialize the TickArray object + /// + /// # Parameters + /// - `whirlpool` - the tick index the desired Tick object is stored in + /// - `start_tick_index` - A u8 integer of the tick spacing for this whirlpool + /// + /// # Errors + /// - `InvalidStartTick`: - The provided start-tick-index is not an initializable tick index in this Whirlpool w/ this tick-spacing. + pub fn initialize( + &mut self, + whirlpool: &Account, + start_tick_index: i32, + ) -> Result<(), ErrorCode> { + if !Tick::check_is_valid_start_tick(start_tick_index, whirlpool.tick_spacing) { + return Err(ErrorCode::InvalidStartTick.into()); + } + + self.whirlpool = whirlpool.key(); + self.start_tick_index = start_tick_index; + Ok(()) + } + + /// Get the Tick object at the given tick-index & tick-spacing + /// + /// # Parameters + /// - `tick_index` - the tick index the desired Tick object is stored in + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// + /// # Returns + /// - `&Tick`: A reference to the desired Tick object + /// - `TickNotFound`: - The provided tick-index is not an initializable tick index in this Whirlpool w/ this tick-spacing. + pub fn get_tick(&self, tick_index: i32, tick_spacing: u16) -> Result<&Tick, ErrorCode> { + if !self.check_in_array_bounds(tick_index, tick_spacing) + || !Tick::check_is_usable_tick(tick_index, tick_spacing) + { + return Err(ErrorCode::TickNotFound); + } + let offset = self.tick_offset(tick_index, tick_spacing)?; + if offset < 0 { + return Err(ErrorCode::TickNotFound); + } + Ok(&self.ticks[offset as usize]) + } + + /// Updates the Tick object at the given tick-index & tick-spacing + /// + /// # Parameters + /// - `tick_index` - the tick index the desired Tick object is stored in + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// - `update` - A reference to a TickUpdate object to update the Tick object at the given index + /// + /// # Errors + /// - `TickNotFound`: - The provided tick-index is not an initializable tick index in this Whirlpool w/ this tick-spacing. + pub fn update_tick( + &mut self, + tick_index: i32, + tick_spacing: u16, + update: &TickUpdate, + ) -> Result<(), ErrorCode> { + if !self.check_in_array_bounds(tick_index, tick_spacing) + || !Tick::check_is_usable_tick(tick_index, tick_spacing) + { + return Err(ErrorCode::TickNotFound); + } + let offset = self.tick_offset(tick_index, tick_spacing)?; + if offset < 0 { + return Err(ErrorCode::TickNotFound); + } + self.ticks.get_mut(offset as usize).unwrap().update(update); + Ok(()) + } + + /// Checks that this array holds the next tick index for the current tick index, given the pool's tick spacing & search direction. + /// + /// unshifted checks on [start, start + TICK_ARRAY_SIZE * tick_spacing) + /// shifted checks on [start - tick_spacing, start + (TICK_ARRAY_SIZE - 1) * tick_spacing) (adjusting range by -tick_spacing) + /// + /// shifted == !a_to_b + /// + /// For a_to_b swaps, price moves left. All searchable ticks in this tick-array's range will end up in this tick's usable ticks. + /// The search range is therefore the range of the tick-array. + /// + /// For b_to_a swaps, this tick-array's left-most ticks can be the 'next' usable tick-index of the previous tick-array. + /// The right-most ticks also points towards the next tick-array. The search range is therefore shifted by 1 tick-spacing. + pub fn in_search_range(&self, tick_index: i32, tick_spacing: u16, shifted: bool) -> bool { + let mut lower = self.start_tick_index; + let mut upper = self.start_tick_index + TICK_ARRAY_SIZE * tick_spacing as i32; + if shifted { + lower = lower - tick_spacing as i32; + upper = upper - tick_spacing as i32; + } + tick_index >= lower && tick_index < upper + } + + pub fn check_in_array_bounds(&self, tick_index: i32, tick_spacing: u16) -> bool { + self.in_search_range(tick_index, tick_spacing, false) + } + + pub fn is_min_tick_array(&self) -> bool { + self.start_tick_index <= MIN_TICK_INDEX + } + + pub fn is_max_tick_array(&self, tick_spacing: u16) -> bool { + self.start_tick_index + TICK_ARRAY_SIZE * (tick_spacing as i32) > MAX_TICK_INDEX + } + + // Calculates an offset from a tick index that can be used to access the tick data + pub fn tick_offset(&self, tick_index: i32, tick_spacing: u16) -> Result { + if tick_spacing == 0 { + return Err(ErrorCode::InvalidTickSpacing); + } + + Ok(get_offset(tick_index, self.start_tick_index, tick_spacing)) + } +} + +fn get_offset(tick_index: i32, start_tick_index: i32, tick_spacing: u16) -> isize { + // TODO: replace with i32.div_floor once not experimental + let lhs = tick_index - start_tick_index; + let rhs = tick_spacing as i32; + let d = lhs / rhs; + let r = lhs % rhs; + let o = if (r > 0 && rhs < 0) || (r < 0 && rhs > 0) { + d - 1 + } else { + d + }; + return o as isize; +} + +#[cfg(test)] +pub mod tick_builder { + use super::Tick; + use crate::state::NUM_REWARDS; + + #[derive(Default)] + pub struct TickBuilder { + initialized: bool, + liquidity_net: i128, + liquidity_gross: u128, + fee_growth_outside_a: u128, + fee_growth_outside_b: u128, + reward_growths_outside: [u128; NUM_REWARDS], + } + + impl TickBuilder { + pub fn initialized(mut self, initialized: bool) -> Self { + self.initialized = initialized; + self + } + + pub fn liquidity_net(mut self, liquidity_net: i128) -> Self { + self.liquidity_net = liquidity_net; + self + } + + pub fn liquidity_gross(mut self, liquidity_gross: u128) -> Self { + self.liquidity_gross = liquidity_gross; + self + } + + pub fn fee_growth_outside_a(mut self, fee_growth_outside_a: u128) -> Self { + self.fee_growth_outside_a = fee_growth_outside_a; + self + } + + pub fn fee_growth_outside_b(mut self, fee_growth_outside_b: u128) -> Self { + self.fee_growth_outside_b = fee_growth_outside_b; + self + } + + pub fn reward_growths_outside( + mut self, + reward_growths_outside: [u128; NUM_REWARDS], + ) -> Self { + self.reward_growths_outside = reward_growths_outside; + self + } + + pub fn build(self) -> Tick { + Tick { + initialized: self.initialized, + liquidity_net: self.liquidity_net, + liquidity_gross: self.liquidity_gross, + fee_growth_outside_a: self.fee_growth_outside_a, + fee_growth_outside_b: self.fee_growth_outside_b, + reward_growths_outside: self.reward_growths_outside, + } + } + } +} + +#[cfg(test)] +mod fuzz_tests { + use super::*; + use proptest::prelude::*; + + proptest! { + #[test] + fn test_get_search_and_offset( + tick_index in 2 * MIN_TICK_INDEX..2 * MAX_TICK_INDEX, + start_tick_index in 2 * MIN_TICK_INDEX..2 * MAX_TICK_INDEX, + tick_spacing in 1u16..u16::MAX, + a_to_b in proptest::bool::ANY, + ) { + let mut array = TickArray::default(); + array.start_tick_index = start_tick_index; + + let in_search = array.in_search_range(tick_index, tick_spacing, !a_to_b); + + let mut lower_bound = start_tick_index; + let mut upper_bound = start_tick_index + TICK_ARRAY_SIZE * tick_spacing as i32; + let mut offset_lower = 0; + let mut offset_upper = TICK_ARRAY_SIZE as isize; + + // If we are doing b_to_a, we shift the index bounds by -tick_spacing + // and the offset bounds by -1 + if !a_to_b { + lower_bound = lower_bound - tick_spacing as i32; + upper_bound = upper_bound - tick_spacing as i32; + offset_lower = -1; + offset_upper = offset_upper - 1; + } + + // in_bounds should be identical to search + let in_bounds = tick_index >= lower_bound && tick_index < upper_bound; + assert!(in_bounds == in_search); + + if in_search { + let offset = get_offset(tick_index, start_tick_index, tick_spacing); + assert!(offset >= offset_lower && offset < offset_upper) + } + } + + #[test] + fn test_get_offset( + tick_index in 2 * MIN_TICK_INDEX..2 * MAX_TICK_INDEX, + start_tick_index in 2 * MIN_TICK_INDEX..2 * MAX_TICK_INDEX, + tick_spacing in 1u16..u16::MAX, + ) { + let offset = get_offset(tick_index, start_tick_index, tick_spacing); + let rounded = start_tick_index >= tick_index; + let raw = (tick_index - start_tick_index) / tick_spacing as i32; + let d = raw as isize; + if !rounded { + assert_eq!(offset, d); + } else { + assert!(offset == d || offset == (raw - 1) as isize); + } + } + } +} + +#[cfg(test)] +mod check_is_valid_start_tick_tests { + use super::*; + const TS_8: u16 = 8; + const TS_128: u16 = 128; + + #[test] + fn test_start_tick_is_zero() { + assert_eq!(Tick::check_is_valid_start_tick(0, TS_8), true); + } + + #[test] + fn test_start_tick_is_valid_ts8() { + assert_eq!(Tick::check_is_valid_start_tick(704, TS_8), true); + } + + #[test] + fn test_start_tick_is_valid_ts128() { + assert_eq!(Tick::check_is_valid_start_tick(337920, TS_128), true); + } + + #[test] + fn test_start_tick_is_valid_negative_ts8() { + assert_eq!(Tick::check_is_valid_start_tick(-704, TS_8), true); + } + + #[test] + fn test_start_tick_is_valid_negative_ts128() { + assert_eq!(Tick::check_is_valid_start_tick(-337920, TS_128), true); + } + + #[test] + fn test_start_tick_is_not_valid_ts8() { + assert_eq!(Tick::check_is_valid_start_tick(2353573, TS_8), false); + } + + #[test] + fn test_start_tick_is_not_valid_ts128() { + assert_eq!(Tick::check_is_valid_start_tick(-2353573, TS_128), false); + } + + #[test] + fn test_min_tick_array_start_tick_is_valid_ts8() { + let expected_array_index: i32 = (MIN_TICK_INDEX / TICK_ARRAY_SIZE / TS_8 as i32) - 1; + let expected_start_index_for_last_array: i32 = + expected_array_index * TICK_ARRAY_SIZE * TS_8 as i32; + assert_eq!( + Tick::check_is_valid_start_tick(expected_start_index_for_last_array, TS_8), + true + ) + } + + #[test] + fn test_min_tick_array_sub_1_start_tick_is_invalid_ts8() { + let expected_array_index: i32 = (MIN_TICK_INDEX / TICK_ARRAY_SIZE / TS_8 as i32) - 2; + let expected_start_index_for_last_array: i32 = + expected_array_index * TICK_ARRAY_SIZE * TS_8 as i32; + assert_eq!( + Tick::check_is_valid_start_tick(expected_start_index_for_last_array, TS_8), + false + ) + } + + #[test] + fn test_min_tick_array_start_tick_is_valid_ts128() { + let expected_array_index: i32 = (MIN_TICK_INDEX / TICK_ARRAY_SIZE / TS_128 as i32) - 1; + let expected_start_index_for_last_array: i32 = + expected_array_index * TICK_ARRAY_SIZE * TS_128 as i32; + assert_eq!( + Tick::check_is_valid_start_tick(expected_start_index_for_last_array, TS_128), + true + ) + } + + #[test] + fn test_min_tick_array_sub_1_start_tick_is_invalid_ts128() { + let expected_array_index: i32 = (MIN_TICK_INDEX / TICK_ARRAY_SIZE / TS_128 as i32) - 2; + let expected_start_index_for_last_array: i32 = + expected_array_index * TICK_ARRAY_SIZE * TS_128 as i32; + assert_eq!( + Tick::check_is_valid_start_tick(expected_start_index_for_last_array, TS_128), + false + ) + } +} + +#[cfg(test)] +mod check_is_out_of_bounds_tests { + use super::*; + + #[test] + fn test_min_tick_index() { + assert_eq!(Tick::check_is_out_of_bounds(MIN_TICK_INDEX), false); + } + + #[test] + fn test_max_tick_index() { + assert_eq!(Tick::check_is_out_of_bounds(MAX_TICK_INDEX), false); + } + + #[test] + fn test_min_tick_index_sub_1() { + assert_eq!(Tick::check_is_out_of_bounds(MIN_TICK_INDEX - 1), true); + } + + #[test] + fn test_max_tick_index_add_1() { + assert_eq!(Tick::check_is_out_of_bounds(MAX_TICK_INDEX + 1), true); + } +} + +#[cfg(test)] +mod array_update_tests { + use super::*; + + #[test] + fn update_applies_successfully() { + let mut array = TickArray::default(); + let tick_index = 8; + let original = Tick { + initialized: true, + liquidity_net: 2525252i128, + liquidity_gross: 2525252u128, + fee_growth_outside_a: 28728282u128, + fee_growth_outside_b: 22528728282u128, + reward_growths_outside: [124272242u128, 1271221u128, 966958u128], + }; + + array.ticks[1] = original; + + let update = TickUpdate { + initialized: true, + liquidity_net: 24128472184712i128, + liquidity_gross: 353873892732u128, + fee_growth_outside_a: 3928372892u128, + fee_growth_outside_b: 12242u128, + reward_growths_outside: [53264u128, 539282u128, 98744u128], + }; + + let tick_spacing = 8; + + array + .update_tick(tick_index, tick_spacing, &update) + .unwrap(); + + let expected = Tick { + initialized: true, + liquidity_net: 24128472184712i128, + liquidity_gross: 353873892732u128, + fee_growth_outside_a: 3928372892u128, + fee_growth_outside_b: 12242u128, + reward_growths_outside: [53264u128, 539282u128, 98744u128], + }; + let result = array.get_tick(tick_index, tick_spacing).unwrap(); + assert_eq!(*result, expected); + } +} diff --git a/programs/whirlpool/src/state/whirlpool.rs b/programs/whirlpool/src/state/whirlpool.rs new file mode 100644 index 0000000..0a64818 --- /dev/null +++ b/programs/whirlpool/src/state/whirlpool.rs @@ -0,0 +1,414 @@ +use crate::{ + errors::ErrorCode, + math::{ + tick_index_from_sqrt_price, MAX_FEE_RATE, MAX_PROTOCOL_FEE_RATE, MAX_SQRT_PRICE_X64, + MIN_SQRT_PRICE_X64, + }, +}; +use anchor_lang::prelude::*; + +use super::WhirlpoolsConfig; + +#[account] +#[derive(Default)] +pub struct Whirlpool { + pub whirlpools_config: Pubkey, // 32 + pub whirlpool_bump: [u8; 1], // 1 + + pub tick_spacing: u16, // 2 + pub tick_spacing_seed: [u8; 2], // 2 + + // Stored as hundredths of a basis point + // u16::MAX corresponds to ~6.5% + pub fee_rate: u16, // 2 + + // Denominator for portion of fee rate taken (1/x)% + pub protocol_fee_rate: u16, // 2 + + // Maximum amount that can be held by Solana account + pub liquidity: u128, // 16 + + // MAX/MIN at Q32.64, but using Q64.64 for rounder bytes + // Q64.64 + pub sqrt_price: u128, // 16 + pub tick_current_index: i32, // 4 + + pub protocol_fee_owed_a: u64, // 8 + pub protocol_fee_owed_b: u64, // 8 + + pub token_mint_a: Pubkey, // 32 + pub token_vault_a: Pubkey, // 32 + + // Q64.64 + pub fee_growth_global_a: u128, // 16 + + pub token_mint_b: Pubkey, // 32 + pub token_vault_b: Pubkey, // 32 + + // Q64.64 + pub fee_growth_global_b: u128, // 16 + + pub reward_last_updated_timestamp: u64, // 8 + + pub reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], // 384 +} + +// Number of rewards supported by Whirlpools +pub const NUM_REWARDS: usize = 3; + +impl Whirlpool { + pub const LEN: usize = 8 + 261 + 384; + pub fn seeds(&self) -> [&[u8]; 6] { + [ + &b"whirlpool"[..], + self.whirlpools_config.as_ref(), + self.token_mint_a.as_ref(), + self.token_mint_b.as_ref(), + self.tick_spacing_seed.as_ref(), + self.whirlpool_bump.as_ref(), + ] + } + + pub fn initialize( + &mut self, + whirlpools_config: &Account, + bump: u8, + tick_spacing: u16, + sqrt_price: u128, + default_fee_rate: u16, + token_mint_a: Pubkey, + token_vault_a: Pubkey, + token_mint_b: Pubkey, + token_vault_b: Pubkey, + ) -> Result<(), ErrorCode> { + if token_mint_a.ge(&token_mint_b) { + return Err(ErrorCode::InvalidTokenMintOrder.into()); + } + + if sqrt_price < MIN_SQRT_PRICE_X64 || sqrt_price > MAX_SQRT_PRICE_X64 { + return Err(ErrorCode::SqrtPriceOutOfBounds.into()); + } + + self.whirlpools_config = whirlpools_config.key(); + self.whirlpool_bump = [bump]; + + self.tick_spacing = tick_spacing; + self.tick_spacing_seed = self.tick_spacing.to_le_bytes(); + + self.update_fee_rate(default_fee_rate)?; + self.update_protocol_fee_rate(whirlpools_config.default_protocol_fee_rate)?; + + self.liquidity = 0; + self.sqrt_price = sqrt_price; + self.tick_current_index = tick_index_from_sqrt_price(&sqrt_price); + + self.protocol_fee_owed_a = 0; + self.protocol_fee_owed_b = 0; + + self.token_mint_a = token_mint_a; + self.token_vault_a = token_vault_a; + self.fee_growth_global_a = 0; + + self.token_mint_b = token_mint_b; + self.token_vault_b = token_vault_b; + self.fee_growth_global_b = 0; + + self.reward_infos = + [WhirlpoolRewardInfo::new(whirlpools_config.reward_emissions_super_authority); + NUM_REWARDS]; + + Ok(()) + } + + /// Update all reward values for the Whirlpool. + /// + /// # Parameters + /// - `reward_infos` - An array of all updated whirlpool rewards + /// - `reward_last_updated_timestamp` - The timestamp when the rewards were last updated + pub fn update_rewards( + &mut self, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + reward_last_updated_timestamp: u64, + ) { + self.reward_last_updated_timestamp = reward_last_updated_timestamp; + self.reward_infos = reward_infos; + } + + pub fn update_rewards_and_liquidity( + &mut self, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + liquidity: u128, + reward_last_updated_timestamp: u64, + ) { + self.update_rewards(reward_infos, reward_last_updated_timestamp); + self.liquidity = liquidity; + } + + /// Update the reward authority at the specified Whirlpool reward index. + pub fn update_reward_authority( + &mut self, + index: usize, + authority: Pubkey, + ) -> Result<(), ErrorCode> { + if index >= NUM_REWARDS { + return Err(ErrorCode::InvalidRewardIndex.into()); + } + self.reward_infos[index].authority = authority; + + Ok(()) + } + + pub fn update_emissions( + &mut self, + index: usize, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + timestamp: u64, + emissions_per_second_x64: u128, + ) -> Result<(), ErrorCode> { + if index >= NUM_REWARDS { + return Err(ErrorCode::InvalidRewardIndex.into()); + } + self.update_rewards(reward_infos, timestamp); + self.reward_infos[index].emissions_per_second_x64 = emissions_per_second_x64; + + Ok(()) + } + + pub fn initialize_reward( + &mut self, + index: usize, + mint: Pubkey, + vault: Pubkey, + ) -> Result<(), ErrorCode> { + if index >= NUM_REWARDS { + return Err(ErrorCode::InvalidRewardIndex.into()); + } + + let lowest_index = match self.reward_infos.iter().position(|r| !r.initialized()) { + Some(lowest_index) => lowest_index, + None => return Err(ErrorCode::InvalidRewardIndex.into()), + }; + + if lowest_index != index { + return Err(ErrorCode::InvalidRewardIndex.into()); + } + + self.reward_infos[index].mint = mint; + self.reward_infos[index].vault = vault; + + Ok(()) + } + + pub fn update_after_swap( + &mut self, + liquidity: u128, + tick_index: i32, + sqrt_price: u128, + fee_growth_global: u128, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + protocol_fee: u64, + is_token_fee_in_a: bool, + reward_last_updated_timestamp: u64, + ) { + self.tick_current_index = tick_index; + self.sqrt_price = sqrt_price; + self.liquidity = liquidity; + self.reward_infos = reward_infos; + self.reward_last_updated_timestamp = reward_last_updated_timestamp; + if is_token_fee_in_a { + // Add fees taken via a + self.fee_growth_global_a = fee_growth_global; + self.protocol_fee_owed_a += protocol_fee; + } else { + // Add fees taken via b + self.fee_growth_global_b = fee_growth_global; + self.protocol_fee_owed_b += protocol_fee; + } + } + + pub fn update_fee_rate(&mut self, fee_rate: u16) -> Result<(), ErrorCode> { + if fee_rate > MAX_FEE_RATE { + return Err(ErrorCode::FeeRateMaxExceeded.into()); + } + self.fee_rate = fee_rate; + + Ok(()) + } + + pub fn update_protocol_fee_rate(&mut self, protocol_fee_rate: u16) -> Result<(), ErrorCode> { + if protocol_fee_rate > MAX_PROTOCOL_FEE_RATE { + return Err(ErrorCode::ProtocolFeeRateMaxExceeded.into()); + } + self.protocol_fee_rate = protocol_fee_rate; + + Ok(()) + } + + pub fn reset_protocol_fees_owed(&mut self) { + self.protocol_fee_owed_a = 0; + self.protocol_fee_owed_b = 0; + } +} + +/// Stores the state relevant for tracking liquidity mining rewards at the `Whirlpool` level. +/// These values are used in conjunction with `PositionRewardInfo`, `Tick.reward_growths_outside`, +/// and `Whirlpool.reward_last_updated_timestamp` to determine how many rewards are earned by open +/// positions. +#[derive(Copy, Clone, AnchorSerialize, AnchorDeserialize, Default, Debug, PartialEq)] +pub struct WhirlpoolRewardInfo { + /// Reward token mint. + pub mint: Pubkey, + /// Reward vault token account. + pub vault: Pubkey, + /// Authority account that has permission to initialize the reward and set emissions. + pub authority: Pubkey, + /// Q64.64 number that indicates how many tokens per second are earned per unit of liquidity. + pub emissions_per_second_x64: u128, + /// Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward + /// emissions were turned on. + pub growth_global_x64: u128, +} + +impl WhirlpoolRewardInfo { + /// Creates a new `WhirlpoolRewardInfo` with the authority set + pub fn new(authority: Pubkey) -> Self { + Self { + authority, + ..Default::default() + } + } + + /// Returns true if this reward is initialized. + /// Once initialized, a reward cannot transition back to uninitialized. + pub fn initialized(&self) -> bool { + self.mint.ne(&Pubkey::default()) + } + + /// Maps all reward data to only the reward growth accumulators + pub fn to_reward_growths( + reward_infos: &[WhirlpoolRewardInfo; NUM_REWARDS], + ) -> [u128; NUM_REWARDS] { + let mut reward_growths = [0u128; NUM_REWARDS]; + for i in 0..NUM_REWARDS { + reward_growths[i] = reward_infos[i].growth_global_x64; + } + reward_growths + } +} + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default, Copy)] +pub struct WhirlpoolBumps { + pub whirlpool_bump: u8, +} + +#[test] +fn test_whirlpool_reward_info_not_initialized() { + let reward_info = WhirlpoolRewardInfo::default(); + assert_eq!(reward_info.initialized(), false); +} + +#[test] +fn test_whirlpool_reward_info_initialized() { + let reward_info = &mut WhirlpoolRewardInfo::default(); + reward_info.mint = Pubkey::new_unique(); + assert_eq!(reward_info.initialized(), true); +} + +#[cfg(test)] +pub mod whirlpool_builder { + use super::{Whirlpool, WhirlpoolRewardInfo, NUM_REWARDS}; + + #[derive(Default)] + pub struct WhirlpoolBuilder { + liquidity: u128, + tick_spacing: u16, + tick_current_index: i32, + sqrt_price: u128, + fee_rate: u16, + protocol_fee_rate: u16, + fee_growth_global_a: u128, + fee_growth_global_b: u128, + reward_last_updated_timestamp: u64, + reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + } + + impl WhirlpoolBuilder { + pub fn new() -> Self { + Self { + reward_infos: [WhirlpoolRewardInfo::default(); NUM_REWARDS], + ..Default::default() + } + } + + pub fn liquidity(mut self, liquidity: u128) -> Self { + self.liquidity = liquidity; + self + } + + pub fn reward_last_updated_timestamp(mut self, reward_last_updated_timestamp: u64) -> Self { + self.reward_last_updated_timestamp = reward_last_updated_timestamp; + self + } + + pub fn reward_info(mut self, index: usize, reward_info: WhirlpoolRewardInfo) -> Self { + self.reward_infos[index] = reward_info; + self + } + + pub fn reward_infos(mut self, reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS]) -> Self { + self.reward_infos = reward_infos; + self + } + + pub fn tick_spacing(mut self, tick_spacing: u16) -> Self { + self.tick_spacing = tick_spacing; + self + } + + pub fn tick_current_index(mut self, tick_current_index: i32) -> Self { + self.tick_current_index = tick_current_index; + self + } + + pub fn sqrt_price(mut self, sqrt_price: u128) -> Self { + self.sqrt_price = sqrt_price; + self + } + + pub fn fee_growth_global_a(mut self, fee_growth_global_a: u128) -> Self { + self.fee_growth_global_a = fee_growth_global_a; + self + } + + pub fn fee_growth_global_b(mut self, fee_growth_global_b: u128) -> Self { + self.fee_growth_global_b = fee_growth_global_b; + self + } + + pub fn fee_rate(mut self, fee_rate: u16) -> Self { + self.fee_rate = fee_rate; + self + } + + pub fn protocol_fee_rate(mut self, protocol_fee_rate: u16) -> Self { + self.protocol_fee_rate = protocol_fee_rate; + self + } + + pub fn build(self) -> Whirlpool { + Whirlpool { + liquidity: self.liquidity, + reward_last_updated_timestamp: self.reward_last_updated_timestamp, + reward_infos: self.reward_infos, + tick_current_index: self.tick_current_index, + sqrt_price: self.sqrt_price, + tick_spacing: self.tick_spacing, + fee_growth_global_a: self.fee_growth_global_a, + fee_growth_global_b: self.fee_growth_global_b, + fee_rate: self.fee_rate, + protocol_fee_rate: self.protocol_fee_rate, + ..Default::default() + } + } + } +} diff --git a/programs/whirlpool/src/tests/mod.rs b/programs/whirlpool/src/tests/mod.rs new file mode 100644 index 0000000..63b01ce --- /dev/null +++ b/programs/whirlpool/src/tests/mod.rs @@ -0,0 +1,5 @@ +#[cfg(test)] +mod swap_integration_tests; + +#[cfg(test)] +pub use swap_integration_tests::*; diff --git a/programs/whirlpool/src/tests/swap_integration_tests.rs b/programs/whirlpool/src/tests/swap_integration_tests.rs new file mode 100644 index 0000000..b788d8c --- /dev/null +++ b/programs/whirlpool/src/tests/swap_integration_tests.rs @@ -0,0 +1,287 @@ +use crate::errors::ErrorCode; +use crate::manager::swap_manager::*; +use crate::math::*; +use crate::state::{MAX_TICK_INDEX, MIN_TICK_INDEX, TICK_ARRAY_SIZE}; +use crate::util::test_utils::swap_test_fixture::*; +use crate::util::{create_whirlpool_reward_infos, SwapTickSequence}; +use serde::Deserialize; +use serde_json; +use serde_with::{serde_as, DisplayFromStr}; +use solana_program::msg; +use std::cmp::{max, min}; +use std::fs; + +#[serde_as] +#[derive(Debug, Deserialize, Default)] +#[serde(rename_all = "camelCase")] +struct TestCase { + test_id: u16, + description: String, + tick_spacing: u16, + fee_rate: u16, + protocol_fee_rate: u16, + #[serde_as(as = "DisplayFromStr")] + liquidity: u128, + curr_tick_index: i32, + #[serde_as(as = "DisplayFromStr")] + trade_amount: u64, + amount_is_input: bool, + a_to_b: bool, + expectation: Expectation, +} + +#[serde_as] +#[derive(Debug, Default, Deserialize)] +#[serde(rename_all = "camelCase")] +struct Expectation { + exception: String, + #[serde_as(as = "DisplayFromStr")] + amount_a: u64, + #[serde_as(as = "DisplayFromStr")] + amount_b: u64, + #[serde_as(as = "DisplayFromStr")] + next_liquidity: u128, + next_tick_index: i32, + #[serde_as(as = "DisplayFromStr")] + next_sqrt_price: u128, + #[serde_as(as = "DisplayFromStr")] + next_fee_growth_global: u128, + #[serde_as(as = "DisplayFromStr")] + next_protocol_fee: u64, +} + +/// Current version of Anchor doesn't bubble up errors in a way +/// where we can compare. v0.23.0 has an updated format that will allow us to do so. +const CATCHABLE_ERRORS: [(&str, ErrorCode); 8] = [ + ( + "MultiplicationShiftRightOverflow", + ErrorCode::MultiplicationShiftRightOverflow, + ), + ("TokenMaxExceeded", ErrorCode::TokenMaxExceeded), + ("DivideByZero", ErrorCode::DivideByZero), + ("SqrtPriceOutOfBounds", ErrorCode::SqrtPriceOutOfBounds), + ( + "InvalidTickArraySequence", + ErrorCode::InvalidTickArraySequence, + ), + ("ZeroTradableAmount", ErrorCode::ZeroTradableAmount), + ("NumberDownCastError", ErrorCode::NumberDownCastError), + ("MultiplicationOverflow", ErrorCode::MultiplicationOverflow), +]; + +#[test] +/// Run a collection of tests on the swap_manager against expectations +/// A total of 3840 tests on these variables: +/// 1. FeeRate ([MAX_FEE, MAX_PROTOCOL_FEE], [65535, 600], [700, 300], [0, 0]) +/// 2. CurrentTickPosition (-443500, -223027, 0, 223027, 443500) +/// 3. Liquidity (0, 2^32, 2^64, 2^110) +/// 4. TickSpacing (1, 8, 128) +/// 5. TradeAmount (0, 10^9, 10^12, U64::max) +/// 6. Trade Direction (a->b, b->a) +/// 7. TradeAmountToken (amountIsInput, amountIsOutput) +fn run_swap_integration_tests() { + let contents = + fs::read_to_string("src/tests/swap_test_cases.json").expect("Failure to read the file."); + let json: Vec = serde_json::from_str(&contents).expect("JSON was not well-formatted"); + let test_iterator = json.iter(); + + let mut total_cases: u16 = 0; + let mut pass_cases: u16 = 0; + let mut fail_cases: u16 = 0; + + for test in test_iterator { + let test_id = test.test_id; + total_cases += 1; + + let derived_start_tick = derive_start_tick(test.curr_tick_index, test.tick_spacing); + let last_tick_in_seq = + derive_last_tick_in_seq(derived_start_tick, test.tick_spacing, test.a_to_b); + + let swap_test_info = SwapTestFixture::new(SwapTestFixtureInfo { + tick_spacing: test.tick_spacing, + liquidity: test.liquidity, + curr_tick_index: test.curr_tick_index, + start_tick_index: derived_start_tick, + trade_amount: test.trade_amount, + sqrt_price_limit: sqrt_price_from_tick_index(last_tick_in_seq), + amount_specified_is_input: test.amount_is_input, + a_to_b: test.a_to_b, + array_1_ticks: &vec![], + array_2_ticks: Some(&vec![]), + array_3_ticks: Some(&vec![]), + fee_growth_global_a: 0, + fee_growth_global_b: 0, + fee_rate: test.fee_rate, + protocol_fee_rate: test.protocol_fee_rate, + reward_infos: create_whirlpool_reward_infos(100, 10), + ..Default::default() + }); + + let mut tick_sequence = SwapTickSequence::new( + swap_test_info.tick_arrays[0].borrow_mut(), + Some(swap_test_info.tick_arrays[1].borrow_mut()), + Some(swap_test_info.tick_arrays[2].borrow_mut()), + ); + let post_swap = swap_test_info.eval(&mut tick_sequence, 1643027024); + + if post_swap.is_err() { + let e = post_swap.unwrap_err(); + + if test.expectation.exception.is_empty() { + fail_cases += 1; + + msg!("Test case {} - {}", test_id, test.description); + msg!("Received an unexpected error - {}", e.to_string()); + msg!(""); + + continue; + } + + let expected_error = derive_error(&test.expectation.exception); + + if expected_error.is_none() { + msg!("Test case {} - {}", test_id, test.description); + msg!( + "Expectation expecting an unregistered error - {}. Test received this error - {}", + test.expectation.exception, + e.to_string() + ); + msg!(""); + + fail_cases += 1; + } else if expected_error.is_some() && !expected_error.unwrap().eq(&e) { + fail_cases += 1; + + msg!("Test case {} - {}", test_id, test.description); + msg!( + "Test case expected error - {}, but received - {}", + expected_error.unwrap().to_string(), + e.to_string() + ); + msg!(""); + } else { + pass_cases += 1; + } + } else { + let expectation = &test.expectation; + let results = post_swap.unwrap(); + let equal = assert_expectation(&results, expectation); + + if equal { + pass_cases += 1; + } else { + msg!("Test case {} - {}", test_id, test.description); + msg!("Fail - results do not equal."); + + if !expectation.exception.is_empty() { + msg!( + "Test case received no error but expected error - {}", + expectation.exception + ); + } else { + msg!( + "amount_a - {}, expect - {}", + results.amount_a, + expectation.amount_a + ); + msg!( + "amount_b - {}, expect - {}", + results.amount_b, + expectation.amount_b + ); + msg!( + "next_liq - {}, expect - {}", + results.next_liquidity, + expectation.next_liquidity + ); + msg!( + "next_tick - {}, expect - {}", + results.next_tick_index, + expectation.next_tick_index + ); + msg!( + "next_sqrt_price - {}, expect - {}", + results.next_sqrt_price, + expectation.next_sqrt_price + ); + msg!( + "next_fee_growth_global - {}, expect - {}, delta - {}", + results.next_fee_growth_global, + expectation.next_fee_growth_global, + results.next_fee_growth_global as i128 + - expectation.next_fee_growth_global as i128, + ); + msg!( + "next_protocol_fee - {}, expect - {}", + results.next_protocol_fee, + expectation.next_protocol_fee + ); + } + + msg!(""); + + fail_cases += 1; + } + } + } + msg!( + "Total - {}, Pass - {}, Failed - {}", + total_cases, + pass_cases, + fail_cases + ); + assert_eq!(total_cases, pass_cases); +} + +fn assert_expectation(post_swap: &PostSwapUpdate, expectation: &Expectation) -> bool { + let amount_a_equal = post_swap.amount_a.eq(&expectation.amount_a); + let amount_b_equal = post_swap.amount_b.eq(&expectation.amount_b); + let next_liquidity_equal = post_swap.next_liquidity.eq(&expectation.next_liquidity); + let next_tick_equal = post_swap.next_tick_index.eq(&expectation.next_tick_index); + let next_sqrt_price_equal = post_swap.next_sqrt_price.eq(&expectation.next_sqrt_price); + let next_fees_equal = post_swap + .next_fee_growth_global + .eq(&expectation.next_fee_growth_global); + let next_protocol_fees_equal = post_swap + .next_protocol_fee + .eq(&expectation.next_protocol_fee); + + amount_a_equal + && amount_b_equal + && next_liquidity_equal + && next_tick_equal + && next_sqrt_price_equal + && next_fees_equal + && next_protocol_fees_equal +} + +fn derive_error(expected_err: &String) -> Option { + for possible_error in CATCHABLE_ERRORS { + if expected_err.eq(&possible_error.0) { + return Some(possible_error.1); + } + } + return None; +} + +/// Given a tick & tick-spacing, derive the start tick of the tick-array that this tick would reside in +fn derive_start_tick(curr_tick: i32, tick_spacing: u16) -> i32 { + let num_of_ticks_in_array = TICK_ARRAY_SIZE * tick_spacing as i32; + let rem = curr_tick % num_of_ticks_in_array; + if curr_tick < 0 && rem != 0 { + ((curr_tick / num_of_ticks_in_array) - 1) * num_of_ticks_in_array + } else { + curr_tick / num_of_ticks_in_array * num_of_ticks_in_array + } +} + +/// Given a start-tick & tick-spacing, derive the last tick of a 3-tick-array sequence +fn derive_last_tick_in_seq(start_tick: i32, tick_spacing: u16, a_to_b: bool) -> i32 { + let num_of_ticks_in_array = TICK_ARRAY_SIZE * tick_spacing as i32; + let potential_last = if a_to_b { + start_tick - (2 * num_of_ticks_in_array) + } else { + start_tick + (3 * num_of_ticks_in_array) - 1 + }; + max(min(potential_last, MAX_TICK_INDEX), MIN_TICK_INDEX) +} diff --git a/programs/whirlpool/src/tests/swap_test_cases.json b/programs/whirlpool/src/tests/swap_test_cases.json new file mode 100644 index 0000000..2bf6b89 --- /dev/null +++ b/programs/whirlpool/src/tests/swap_test_cases.json @@ -0,0 +1,84482 @@ +[ + { + "testId": 1, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 4, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 5, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 6, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 7, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 8, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 9, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 10, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 11, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 12, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 13, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 14, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 15, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 16, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 17, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 18, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 19, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 20, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 21, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 22, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 23, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 24, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 25, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 26, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 27, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 28, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 29, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 30, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 31, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 32, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 33, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 34, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 35, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 36, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 37, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 38, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 39, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 40, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 41, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 42, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 43, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 44, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 45, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 46, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 47, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 48, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 49, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 50, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 51, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 52, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 53, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 54, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 55, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 56, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 57, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 58, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 59, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 60, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 61, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 62, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 63, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 64, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 65, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 66, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 67, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 68, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 69, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 70, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 71, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 72, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 73, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 74, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 75, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 76, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 77, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 78, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 79, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 80, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 81, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 82, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 83, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 84, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 85, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 86, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 87, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 88, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 89, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 90, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 91, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 92, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 93, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 94, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 95, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 96, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 97, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 98, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 99, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 100, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 101, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 102, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 103, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 104, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 105, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 106, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 107, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 108, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 109, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 110, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 111, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 112, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 113, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "164686381608593732", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235147862064454", + "nextProtocolFee": "411715954021484" + } + }, + { + "testId": 114, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "246630645263171373", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849729839473786", + "nextProtocolFee": "616576613157928" + } + }, + { + "testId": 115, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "164686381608593732", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235147862064454", + "nextProtocolFee": "411715954021484" + } + }, + { + "testId": 116, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "246630645263171373", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849729839473786", + "nextProtocolFee": "616576613157928" + } + }, + { + "testId": 117, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "989999946868", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743083709604748", + "nextFeeGrowthGlobal": "7500000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 118, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "989999946868", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745063709551616", + "nextFeeGrowthGlobal": "7500000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 119, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1010101064860", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "7575757987", + "nextProtocolFee": "2525252662" + } + }, + { + "testId": 120, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1010101064860", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "7575757987", + "nextProtocolFee": "2525252662" + } + }, + { + "testId": 121, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "989999999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072719551617", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 122, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "989999999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074699551616", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 123, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1010101012", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "7575759", + "nextProtocolFee": "2525252" + } + }, + { + "testId": 124, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1010101012", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "7575759", + "nextProtocolFee": "2525252" + } + }, + { + "testId": 125, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 126, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 127, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 128, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 129, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 130, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 131, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 132, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 133, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 134, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 135, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 136, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 137, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4798316034585943377", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238656241250453672206", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 138, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 139, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 140, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4895778055119342092", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "36718335413395066", + "nextProtocolFee": "12239445137798355" + } + }, + { + "testId": 141, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 142, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 143, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 144, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 145, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 146, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 147, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 148, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 149, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 150, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 151, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 152, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 153, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 154, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4798316034585962117", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968170259636", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 155, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4895778055119361214", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "36718335413395210", + "nextProtocolFee": "12239445137798403" + } + }, + { + "testId": 156, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 157, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 158, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 159, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 160, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 161, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 162, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 163, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 164, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 165, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 166, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790716093606739238871887", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 167, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 168, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 169, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 170, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468328001322278871887", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 171, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 172, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 173, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 174, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 175, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 176, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 177, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 178, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 179, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 180, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 181, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352166", + "nextFeeGrowthGlobal": "41317902338926575616", + "nextProtocolFee": "3206691265" + } + }, + { + "testId": 182, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 183, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 184, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 185, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "3221225472000000000", + "nextProtocolFee": "250000000" + } + }, + { + "testId": 186, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 187, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 188, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 189, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 190, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 191, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 192, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 193, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "38344037", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235150989950976", + "nextProtocolFee": "95860" + } + }, + { + "testId": 194, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "57423173", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849730745237504", + "nextProtocolFee": "143558" + } + }, + { + "testId": 195, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "38344037", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235150989950976", + "nextProtocolFee": "95860" + } + }, + { + "testId": 196, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "57423173", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849730745237504", + "nextProtocolFee": "143558" + } + }, + { + "testId": 197, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "38344037", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235150989950976", + "nextProtocolFee": "95860" + } + }, + { + "testId": 198, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "57423173", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849730745237504", + "nextProtocolFee": "143558" + } + }, + { + "testId": 199, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "38344037", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235150989950976", + "nextProtocolFee": "95860" + } + }, + { + "testId": 200, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "57423173", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849730745237504", + "nextProtocolFee": "143558" + } + }, + { + "testId": 201, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "38344037", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235150989950976", + "nextProtocolFee": "95860" + } + }, + { + "testId": 202, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "57423173", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849730745237504", + "nextProtocolFee": "143558" + } + }, + { + "testId": 203, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "38344037", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "1235150989950976", + "nextProtocolFee": "95860" + } + }, + { + "testId": 204, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "57423173", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "1849730745237504", + "nextProtocolFee": "143558" + } + }, + { + "testId": 205, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 206, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 207, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 208, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 209, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "662", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 210, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3462686301263", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "111540933154004008960", + "nextProtocolFee": "8656715753" + } + }, + { + "testId": 211, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "662", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 212, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3462686301263", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "111540933154004008960", + "nextProtocolFee": "8656715753" + } + }, + { + "testId": 213, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "662", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 214, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "203", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288495472180325039615583", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 215, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "211", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "12884901888", + "nextProtocolFee": "0" + } + }, + { + "testId": 216, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3462686301263", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "111540933154004008960", + "nextProtocolFee": "8656715753" + } + }, + { + "testId": 217, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "662", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 218, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247706574908079615583", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 219, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 220, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3462686301263", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "111540933154004008960", + "nextProtocolFee": "8656715753" + } + }, + { + "testId": 221, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 222, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 223, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 224, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 225, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3477960631010", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "112032953758346379264", + "nextProtocolFee": "8694901577" + } + }, + { + "testId": 226, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "659", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 227, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3477960631010", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "112032953758346379264", + "nextProtocolFee": "8694901577" + } + }, + { + "testId": 228, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "659", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 229, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "203", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264092792150158", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 230, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "659", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 231, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3477960631010", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "112032953758346379264", + "nextProtocolFee": "8694901577" + } + }, + { + "testId": 232, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "211", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "12884901888", + "nextProtocolFee": "0" + } + }, + { + "testId": 233, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966302979409", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 234, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "659", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "25769803776", + "nextProtocolFee": "1" + } + }, + { + "testId": 235, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3477960631010", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "112032953758346379264", + "nextProtocolFee": "8694901577" + } + }, + { + "testId": 236, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 237, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 238, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 239, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 240, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 241, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 242, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 243, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 244, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 245, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 246, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 247, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 248, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 249, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 250, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 251, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 252, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 253, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 254, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 255, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 256, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 257, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 258, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 259, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 260, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 261, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 262, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 263, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 264, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 265, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 266, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 267, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 268, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 269, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 270, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 271, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 272, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 273, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 274, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 275, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 276, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 277, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 278, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 279, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 280, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 281, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 282, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 283, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 284, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 285, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 286, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 287, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 288, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 289, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 290, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 291, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 292, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 293, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 294, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 295, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 296, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 297, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 298, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 299, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 300, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 301, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 302, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 303, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 304, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 305, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 306, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 307, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 308, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 309, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 310, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 311, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 312, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 313, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 314, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 315, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 316, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 317, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 318, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 319, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 320, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 1, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 321, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 322, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 323, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 324, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 325, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 326, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 327, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 328, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 329, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 330, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 331, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 332, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 333, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 334, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 335, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 336, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 337, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 338, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 339, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 340, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 341, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 342, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 343, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 344, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 345, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 346, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 347, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 348, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 349, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 350, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 351, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 352, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 353, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 354, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 355, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 356, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 357, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 358, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 359, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 360, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 361, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 362, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 363, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 364, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 365, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 366, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 367, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 368, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 369, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 370, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 371, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 372, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 373, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 374, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 375, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 376, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 377, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 378, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 379, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 380, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 381, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 382, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 383, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 384, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 385, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 386, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 387, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 388, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 389, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 390, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 391, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 392, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 393, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 394, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 395, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 396, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 397, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 398, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 399, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 400, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 401, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 402, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 403, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 404, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 405, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 406, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 407, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 408, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 409, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 410, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 411, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 412, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 413, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 414, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 415, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 416, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 417, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 418, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 419, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 420, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 421, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 422, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 423, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 424, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 425, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 426, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 427, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 428, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 429, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 430, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 431, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 432, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 433, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1358975248081401530", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192314360610512", + "nextProtocolFee": "3397438120203504" + } + }, + { + "testId": 434, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2074155716413252474", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556167873099394", + "nextProtocolFee": "5185389291033131" + } + }, + { + "testId": 435, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1358975248081401530", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192314360610512", + "nextProtocolFee": "3397438120203504" + } + }, + { + "testId": 436, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2074155716413252474", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556167873099394", + "nextProtocolFee": "5185389291033131" + } + }, + { + "testId": 437, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "989999946868", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743083709604748", + "nextFeeGrowthGlobal": "7500000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 438, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "989999946868", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745063709551616", + "nextFeeGrowthGlobal": "7500000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 439, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1010101064860", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "7575757987", + "nextProtocolFee": "2525252662" + } + }, + { + "testId": 440, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1010101064860", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "7575757987", + "nextProtocolFee": "2525252662" + } + }, + { + "testId": 441, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "989999999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072719551617", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 442, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "989999999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074699551616", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 443, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1010101012", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "7575759", + "nextProtocolFee": "2525252" + } + }, + { + "testId": 444, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1010101012", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "7575759", + "nextProtocolFee": "2525252" + } + }, + { + "testId": 445, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 446, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 447, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 448, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 449, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 450, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 451, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 452, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 453, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 454, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 455, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 456, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 457, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4798316034585943377", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238656241250453672206", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 458, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 459, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 460, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4895778055119342092", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "36718335413395066", + "nextProtocolFee": "12239445137798355" + } + }, + { + "testId": 461, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 462, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 463, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 464, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 465, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 466, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 467, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 468, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 469, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 470, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 471, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 472, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 473, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 474, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4798316034585962117", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968170259636", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 475, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4895778055119361214", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "36718335413395210", + "nextProtocolFee": "12239445137798403" + } + }, + { + "testId": 476, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 477, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 478, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 479, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 480, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 481, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 482, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 483, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 484, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 485, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 486, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790716093606739238871887", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 487, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 488, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 489, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 490, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468328001322278871887", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 491, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 492, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 493, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 494, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 495, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 496, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 497, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 498, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 499, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 500, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 501, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352166", + "nextFeeGrowthGlobal": "41317902338926575616", + "nextProtocolFee": "3206691265" + } + }, + { + "testId": 502, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 503, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 504, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 505, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "3221225472000000000", + "nextProtocolFee": "250000000" + } + }, + { + "testId": 506, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 507, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 508, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 509, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 510, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 511, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 512, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 513, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "316411082", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192318170660864", + "nextProtocolFee": "791027" + } + }, + { + "testId": 514, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "482927012", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556173977616384", + "nextProtocolFee": "1207317" + } + }, + { + "testId": 515, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "316411082", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192318170660864", + "nextProtocolFee": "791027" + } + }, + { + "testId": 516, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "482927012", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556173977616384", + "nextProtocolFee": "1207317" + } + }, + { + "testId": 517, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "316411082", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192318170660864", + "nextProtocolFee": "791027" + } + }, + { + "testId": 518, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "482927012", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556173977616384", + "nextProtocolFee": "1207317" + } + }, + { + "testId": 519, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "316411082", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192318170660864", + "nextProtocolFee": "791027" + } + }, + { + "testId": 520, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "482927012", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556173977616384", + "nextProtocolFee": "1207317" + } + }, + { + "testId": 521, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "316411082", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192318170660864", + "nextProtocolFee": "791027" + } + }, + { + "testId": 522, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "482927012", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556173977616384", + "nextProtocolFee": "1207317" + } + }, + { + "testId": 523, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "316411082", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "10192318170660864", + "nextProtocolFee": "791027" + } + }, + { + "testId": 524, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "482927012", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "15556173977616384", + "nextProtocolFee": "1207317" + } + }, + { + "testId": 525, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 526, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 527, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 528, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 529, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6455", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 530, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24304478017398", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "782902036735276875776", + "nextProtocolFee": "60761195043" + } + }, + { + "testId": 531, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6455", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 532, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24304478017398", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "782902036735276875776", + "nextProtocolFee": "60761195043" + } + }, + { + "testId": 533, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6455", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 534, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "203", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288495472180325039615583", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 535, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "211", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "12884901888", + "nextProtocolFee": "0" + } + }, + { + "testId": 536, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24304478017398", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "782902036735276875776", + "nextProtocolFee": "60761195043" + } + }, + { + "testId": 537, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6455", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 538, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247706574908079615583", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 539, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 540, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24304478017398", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "782902036735276875776", + "nextProtocolFee": "60761195043" + } + }, + { + "testId": 541, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 542, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 543, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 544, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 545, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24320794410679", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "783427624553441918976", + "nextProtocolFee": "60801986026" + } + }, + { + "testId": 546, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6451", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 547, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24320794410679", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "783427624553441918976", + "nextProtocolFee": "60801986026" + } + }, + { + "testId": 548, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6451", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 549, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "203", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264092792150158", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 550, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6451", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 551, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24320794410679", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "783427624553441918976", + "nextProtocolFee": "60801986026" + } + }, + { + "testId": 552, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "211", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "12884901888", + "nextProtocolFee": "0" + } + }, + { + "testId": 553, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966302979409", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 554, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6451", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "210453397504", + "nextProtocolFee": "16" + } + }, + { + "testId": 555, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24320794410679", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "783427624553441918976", + "nextProtocolFee": "60801986026" + } + }, + { + "testId": 556, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 557, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 558, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 559, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 560, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 561, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 562, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 563, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 564, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 565, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 566, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 567, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 568, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 569, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 570, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 571, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 572, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 573, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 574, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 575, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 576, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 577, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 578, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 579, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 580, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 581, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 582, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 583, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 584, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 585, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 586, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 587, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 588, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 589, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 590, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 591, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 592, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 593, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 594, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 595, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 596, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 597, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 598, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 599, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 600, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 601, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 602, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 603, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 604, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 605, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 606, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 607, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 608, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 609, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 610, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 611, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 612, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 613, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 614, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 615, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 616, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 617, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 618, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 619, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 620, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 621, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 622, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 623, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 624, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 625, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 626, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 627, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 628, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 629, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 630, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 631, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 632, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 633, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 634, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 635, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 636, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 637, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 638, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 639, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 640, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 8, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 641, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 642, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 643, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 644, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 645, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 646, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 647, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 648, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 649, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 650, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 651, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 652, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 653, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 654, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 655, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 656, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 657, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 658, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 659, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 660, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 661, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 662, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 663, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 664, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 665, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 666, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 667, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 668, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 669, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 670, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 671, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 672, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 673, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 674, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 675, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 676, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 677, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 678, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 679, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 680, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 681, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 682, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 683, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 684, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 685, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 686, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 687, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 688, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 689, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 690, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 691, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 692, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 693, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 694, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 695, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 696, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 697, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 698, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 699, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 700, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 701, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 702, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 703, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 704, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 705, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 706, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 707, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 708, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 709, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 710, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 711, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 712, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 713, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 714, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 715, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 716, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 717, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 718, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 719, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 720, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 721, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 722, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 723, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 724, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 725, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 726, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 727, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 728, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 729, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 730, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 731, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 732, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 733, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 734, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 735, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 736, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 737, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 738, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 739, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 740, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 741, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 742, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 743, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 744, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 745, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 746, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 747, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 748, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 749, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 750, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 751, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 752, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 753, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 754, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 755, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 756, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 757, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 758, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 759, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1010101064860", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "7575757987", + "nextProtocolFee": "2525252662" + } + }, + { + "testId": 760, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1010101064860", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "7575757987", + "nextProtocolFee": "2525252662" + } + }, + { + "testId": 761, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 762, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 763, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1010101012", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "7575759", + "nextProtocolFee": "2525252" + } + }, + { + "testId": 764, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1010101012", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "7575759", + "nextProtocolFee": "2525252" + } + }, + { + "testId": 765, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 766, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 767, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 768, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 769, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 770, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 771, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 772, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 773, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 774, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 775, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 776, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 777, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4798316034585943377", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238656241250453672206", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 778, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 779, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 780, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4895778055119342092", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "36718335413395066", + "nextProtocolFee": "12239445137798355" + } + }, + { + "testId": 781, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 782, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 783, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 784, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 785, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 786, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 787, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 788, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 789, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 790, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 791, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 792, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 793, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 794, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4798316034585962117", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968170259636", + "nextFeeGrowthGlobal": "7500000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 795, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4895778055119361214", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "36718335413395210", + "nextProtocolFee": "12239445137798403" + } + }, + { + "testId": 796, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 797, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 798, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 799, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 800, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 801, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 802, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 803, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 804, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 805, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 806, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790716093606739238871887", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 807, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 808, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 809, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 810, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468328001322278871887", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 811, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 812, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "126266421948986744", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "4067326146403761647517696", + "nextProtocolFee": "315666054872467" + } + }, + { + "testId": 813, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 814, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 815, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 816, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 817, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 818, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 819, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 820, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 821, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352166", + "nextFeeGrowthGlobal": "41317902338926575616", + "nextProtocolFee": "3206691265" + } + }, + { + "testId": 822, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 823, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 824, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 825, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "3221225472000000000", + "nextProtocolFee": "250000000" + } + }, + { + "testId": 826, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 827, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "126266420659326182", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "4067326104860888045453312", + "nextProtocolFee": "315666051648315" + } + }, + { + "testId": 828, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 829, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 830, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 831, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 832, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 833, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9042678237", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "291285059971842048", + "nextProtocolFee": "22606695" + } + }, + { + "testId": 834, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "19160694736", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "617209181509779456", + "nextProtocolFee": "47901737" + } + }, + { + "testId": 835, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9042678237", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "291285059971842048", + "nextProtocolFee": "22606695" + } + }, + { + "testId": 836, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "19160694736", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "617209181509779456", + "nextProtocolFee": "47901737" + } + }, + { + "testId": 837, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9042678237", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "291285059971842048", + "nextProtocolFee": "22606695" + } + }, + { + "testId": 838, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "19160694736", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "617209181509779456", + "nextProtocolFee": "47901737" + } + }, + { + "testId": 839, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9042678237", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "291285059971842048", + "nextProtocolFee": "22606695" + } + }, + { + "testId": 840, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "19160694736", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "617209181509779456", + "nextProtocolFee": "47901737" + } + }, + { + "testId": 841, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "804549467", + "nextLiquidity": "4294967296", + "nextTickIndex": -4149, + "nextSqrtPrice": "14991230423361230502", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 842, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "804549467", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 4148, + "nextSqrtPrice": "22698761696749551616", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 843, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1316659747", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": -5302, + "nextSqrtPrice": "14151776777709551616", + "nextFeeGrowthGlobal": "42412583004667904", + "nextProtocolFee": "3291649" + } + }, + { + "testId": 844, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1316659747", + "nextLiquidity": "4294967296", + "nextTickIndex": 5301, + "nextSqrtPrice": "24045204518553235921", + "nextFeeGrowthGlobal": "42412583004667904", + "nextProtocolFee": "3291649" + } + }, + { + "testId": 845, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 846, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 847, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 848, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 849, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "239280", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 850, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "740564960984881", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "23855267159953534615552", + "nextProtocolFee": "1851412402462" + } + }, + { + "testId": 851, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "239280", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 852, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "740564960984881", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "23855267159953534615552", + "nextProtocolFee": "1851412402462" + } + }, + { + "testId": 853, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "239280", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 854, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "203", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288495472180325039615583", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 855, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "211", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "12884901888", + "nextProtocolFee": "0" + } + }, + { + "testId": 856, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "740564960984881", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "23855267159953534615552", + "nextProtocolFee": "1851412402462" + } + }, + { + "testId": 857, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "239280", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 858, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247706574908079615583", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 859, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 860, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "740564960984881", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "23855267159953534615552", + "nextProtocolFee": "1851412402462" + } + }, + { + "testId": 861, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 862, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 863, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 864, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 865, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "740617089507030", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "23856946337190965673984", + "nextProtocolFee": "1851542723767" + } + }, + { + "testId": 866, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "239265", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 867, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "740617089507030", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "23856946337190965673984", + "nextProtocolFee": "1851542723767" + } + }, + { + "testId": 868, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "239265", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 869, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "203", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264092792150158", + "nextFeeGrowthGlobal": "32212254720000000000", + "nextProtocolFee": "2500000000" + } + }, + { + "testId": 870, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "239265", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 871, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "740617089507030", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "23856946337190965673984", + "nextProtocolFee": "1851542723767" + } + }, + { + "testId": 872, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "211", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "12884901888", + "nextProtocolFee": "0" + } + }, + { + "testId": 873, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966302979409", + "nextFeeGrowthGlobal": "32212254720000000", + "nextProtocolFee": "2500000" + } + }, + { + "testId": 874, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "239265", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "7709466296320", + "nextProtocolFee": "598" + } + }, + { + "testId": 875, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "740617089507030", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "23856946337190965673984", + "nextProtocolFee": "1851542723767" + } + }, + { + "testId": 876, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 877, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 878, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 879, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 880, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 881, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 882, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 883, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 884, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 885, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 886, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 887, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 888, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 889, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 890, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 891, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 892, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 893, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 894, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 895, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 896, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 897, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 898, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 899, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 900, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 901, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 902, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 903, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 904, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 905, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 906, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 907, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 908, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 909, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 910, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 911, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 912, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 913, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 914, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 915, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 916, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 917, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 918, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 919, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 920, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 921, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 922, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 923, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 924, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 925, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 926, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 927, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 928, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 929, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 930, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 931, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 932, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 933, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 934, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 935, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 936, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 937, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 938, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 939, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 940, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 941, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 942, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 943, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 944, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 945, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 946, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 947, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 948, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 949, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 950, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 951, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 952, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 953, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 954, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 955, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 956, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 957, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 958, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 959, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 960, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 1.00%/2500 fee", + "tickSpacing": 128, + "feeRate": 10000, + "protocolFeeRate": 2500, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 961, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 962, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 963, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 964, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 965, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 966, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 967, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 968, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 969, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 970, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 971, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 972, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 973, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 974, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 975, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 976, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 977, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 978, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 979, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 980, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 981, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 982, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 983, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 984, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 985, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 986, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 987, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 988, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 989, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 990, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 991, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 992, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 993, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 994, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 995, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 996, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 997, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 998, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 999, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1000, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1001, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1002, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1003, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1004, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1005, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1006, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1007, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1008, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1009, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1010, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1011, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1012, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1013, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1014, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1015, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1016, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1017, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1018, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1019, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1020, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1021, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1022, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1023, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1024, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1025, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1026, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1027, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1028, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1029, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1030, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1031, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1032, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1033, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1034, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1035, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1036, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1037, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1038, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1039, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1040, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1041, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1042, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1043, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1044, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1045, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1046, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1047, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1048, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1049, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1050, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1051, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1052, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1053, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1054, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1055, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1056, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1057, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1058, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1059, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1060, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1061, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1062, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1063, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1064, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1065, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1066, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1067, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1068, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1069, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1070, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1071, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1072, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1073, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "174473648336222110", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748082711091458", + "nextProtocolFee": "686047832622858" + } + }, + { + "testId": 1074, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "261287837222945385", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096088507661383", + "nextProtocolFee": "1027409904744343" + } + }, + { + "testId": 1075, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "174473648336222110", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748082711091458", + "nextProtocolFee": "686047832622858" + } + }, + { + "testId": 1076, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "261287837222945385", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096088507661383", + "nextProtocolFee": "1027409904744343" + } + }, + { + "testId": 1077, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "934464952662", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743139244598954", + "nextFeeGrowthGlobal": "61602900000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1078, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "934464952662", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745008174551616", + "nextFeeGrowthGlobal": "61602900000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1079, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1070131095559", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "65923178868", + "nextProtocolFee": "4207862480" + } + }, + { + "testId": 1080, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1070131095559", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "65923178868", + "nextProtocolFee": "4207862480" + } + }, + { + "testId": 1081, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "934464999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072775086617", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1082, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "934464999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074644016616", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1083, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1070131039", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "65923176", + "nextProtocolFee": "4207862" + } + }, + { + "testId": 1084, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1070131039", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "65923176", + "nextProtocolFee": "4207862" + } + }, + { + "testId": 1085, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1086, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1087, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1088, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1089, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1090, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1091, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1092, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1093, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1094, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1095, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1096, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1097, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4529150841451380342", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238925406443588235241", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1098, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1099, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1100, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "5186732809220408117", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "319517782573123880", + "nextProtocolFee": "20394752079135566" + } + }, + { + "testId": 1101, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1102, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1103, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1104, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1105, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1106, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1107, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1108, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1109, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1110, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1111, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1112, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1113, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1114, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4529150841451398030", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968114724636", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1115, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "5186732809220428375", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "319517782573125128", + "nextProtocolFee": "20394752079135646" + } + }, + { + "testId": 1116, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1117, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1118, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1119, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1120, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1121, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1122, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1123, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1124, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1125, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1126, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790477572597955878871887", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1127, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1128, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1129, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1130, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468089480313495511887", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1131, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1132, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1133, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1134, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1135, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1136, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1137, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1138, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1139, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1140, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1141, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352179", + "nextFeeGrowthGlobal": "274151184252585115648", + "nextProtocolFee": "4074306171" + } + }, + { + "testId": 1142, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1143, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1144, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1145, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4037269258240000000", + "nextProtocolFee": "60000000" + } + }, + { + "testId": 1146, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1147, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1148, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1149, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1150, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1151, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1152, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1153, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "40622812", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748086938763264", + "nextProtocolFee": "159732" + } + }, + { + "testId": 1154, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "60835817", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096094316396544", + "nextProtocolFee": "239212" + } + }, + { + "testId": 1155, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "40622812", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748086938763264", + "nextProtocolFee": "159732" + } + }, + { + "testId": 1156, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "60835817", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096094316396544", + "nextProtocolFee": "239212" + } + }, + { + "testId": 1157, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "40622812", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748086938763264", + "nextProtocolFee": "159732" + } + }, + { + "testId": 1158, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "60835817", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096094316396544", + "nextProtocolFee": "239212" + } + }, + { + "testId": 1159, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "40622812", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748086938763264", + "nextProtocolFee": "159732" + } + }, + { + "testId": 1160, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "60835817", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096094316396544", + "nextProtocolFee": "239212" + } + }, + { + "testId": 1161, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "40622812", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748086938763264", + "nextProtocolFee": "159732" + } + }, + { + "testId": 1162, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "60835817", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096094316396544", + "nextProtocolFee": "239212" + } + }, + { + "testId": 1163, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "40622812", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "10748086938763264", + "nextProtocolFee": "159732" + } + }, + { + "testId": 1164, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "60835817", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "16096094316396544", + "nextProtocolFee": "239212" + } + }, + { + "testId": 1165, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1166, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1167, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1168, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1169, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "701", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1170, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3668472803423", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "970613488484612046848", + "nextProtocolFee": "14424801910" + } + }, + { + "testId": 1171, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "701", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1172, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3668472803423", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "970613488484612046848", + "nextProtocolFee": "14424801910" + } + }, + { + "testId": 1173, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "701", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1174, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "192", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223089, + "nextSqrtPrice": "1288256951171541679615583", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1175, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "223", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "64424509440", + "nextProtocolFee": "0" + } + }, + { + "testId": 1176, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3668472803423", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "970613488484612046848", + "nextProtocolFee": "14424801910" + } + }, + { + "testId": 1177, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "701", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1178, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247468053899296255583", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1179, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1180, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3668472803423", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "970613488484612046848", + "nextProtocolFee": "14424801910" + } + }, + { + "testId": 1181, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1182, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1183, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1184, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1185, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3684654882419", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "974894982442434691072", + "nextProtocolFee": "14488431463" + } + }, + { + "testId": 1186, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "698", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1187, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3684654882419", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "974894982442434691072", + "nextProtocolFee": "14488431463" + } + }, + { + "testId": 1188, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "698", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1189, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "192", + "nextLiquidity": "4294967296", + "nextTickIndex": -223090, + "nextSqrtPrice": "264141688978651", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1190, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "698", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1191, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3684654882419", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "974894982442434691072", + "nextProtocolFee": "14488431463" + } + }, + { + "testId": 1192, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "223", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "64424509440", + "nextProtocolFee": "0" + } + }, + { + "testId": 1193, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966352191132", + "nextFeeGrowthGlobal": "264582445133725696", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1194, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "698", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "188978561024", + "nextProtocolFee": "2" + } + }, + { + "testId": 1195, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3684654882419", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "974894982442434691072", + "nextProtocolFee": "14488431463" + } + }, + { + "testId": 1196, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1197, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1198, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1199, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1200, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1201, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1202, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1203, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1204, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1205, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1206, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1207, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1208, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1209, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1210, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1211, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1212, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1213, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1214, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1215, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1216, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1217, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1218, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1219, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1220, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1221, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1222, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1223, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1224, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1225, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1226, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1227, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1228, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1229, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1230, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1231, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1232, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1233, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1234, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1235, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1236, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1237, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1238, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1239, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1240, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1241, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1242, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1243, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1244, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1245, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1246, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1247, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1248, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1249, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1250, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1251, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1252, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1253, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1254, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1255, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1256, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1257, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1258, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1259, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1260, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1261, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1262, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1263, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1264, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1265, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1266, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1267, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1268, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1269, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1270, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1271, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1272, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1273, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1274, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1275, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1276, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1277, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1278, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1279, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1280, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 1, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1281, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1282, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1283, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1284, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1285, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1286, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1287, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1288, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1289, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1290, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1291, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1292, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1293, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1294, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1295, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1296, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1297, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1298, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1299, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1300, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1301, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1302, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1303, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1304, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1305, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1306, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1307, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1308, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1309, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1310, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1311, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1312, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1313, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1314, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1315, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1316, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1317, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1318, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1319, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1320, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1321, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1322, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1323, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1324, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1325, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1326, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1327, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1328, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1329, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1330, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1331, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1332, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1333, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1334, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1335, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1336, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1337, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1338, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1339, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1340, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1341, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1342, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1343, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1344, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1345, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1346, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1347, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1348, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1349, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1350, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1351, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1352, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1353, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1354, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1355, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1356, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1357, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1358, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1359, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1360, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1361, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1362, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1363, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1364, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1365, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1366, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1367, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1368, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1369, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1370, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1371, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1372, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1373, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1374, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1375, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1376, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1377, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1378, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1379, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1380, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1381, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1382, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1383, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1384, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1385, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1386, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1387, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1388, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1389, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1390, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1391, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1392, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1393, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1439738776305787284", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692083862887784", + "nextProtocolFee": "5661196842311986" + } + }, + { + "testId": 1394, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2197422224747978736", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367581568927260", + "nextProtocolFee": "8640483929931527" + } + }, + { + "testId": 1395, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1439738776305787284", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692083862887784", + "nextProtocolFee": "5661196842311986" + } + }, + { + "testId": 1396, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2197422224747978736", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367581568927260", + "nextProtocolFee": "8640483929931527" + } + }, + { + "testId": 1397, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "934464952662", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743139244598954", + "nextFeeGrowthGlobal": "61602900000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1398, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "934464952662", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745008174551616", + "nextFeeGrowthGlobal": "61602900000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1399, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1070131095559", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "65923178868", + "nextProtocolFee": "4207862480" + } + }, + { + "testId": 1400, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1070131095559", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "65923178868", + "nextProtocolFee": "4207862480" + } + }, + { + "testId": 1401, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "934464999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072775086617", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1402, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "934464999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074644016616", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1403, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1070131039", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "65923176", + "nextProtocolFee": "4207862" + } + }, + { + "testId": 1404, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1070131039", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "65923176", + "nextProtocolFee": "4207862" + } + }, + { + "testId": 1405, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1406, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1407, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1408, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1409, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1410, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1411, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1412, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1413, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1414, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1415, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1416, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1417, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4529150841451380342", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238925406443588235241", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1418, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1419, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1420, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "5186732809220408117", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "319517782573123880", + "nextProtocolFee": "20394752079135566" + } + }, + { + "testId": 1421, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1422, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1423, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1424, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1425, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1426, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1427, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1428, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1429, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1430, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1431, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1432, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1433, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1434, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4529150841451398030", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968114724636", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1435, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "5186732809220428375", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "319517782573125128", + "nextProtocolFee": "20394752079135646" + } + }, + { + "testId": 1436, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1437, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1438, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1439, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1440, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1441, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1442, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1443, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1444, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1445, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1446, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790477572597955878871887", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1447, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1448, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1449, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1450, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468089480313495511887", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1451, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1452, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1453, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1454, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1455, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1456, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1457, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1458, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1459, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1460, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1461, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352179", + "nextFeeGrowthGlobal": "274151184252585115648", + "nextProtocolFee": "4074306171" + } + }, + { + "testId": 1462, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1463, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1464, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1465, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4037269258240000000", + "nextProtocolFee": "60000000" + } + }, + { + "testId": 1466, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1467, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1468, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1469, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1470, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1471, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1472, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1473, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "335215307", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692088274681856", + "nextProtocolFee": "1318100" + } + }, + { + "testId": 1474, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "511627232", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367585234419712", + "nextProtocolFee": "2011769" + } + }, + { + "testId": 1475, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "335215307", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692088274681856", + "nextProtocolFee": "1318100" + } + }, + { + "testId": 1476, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "511627232", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367585234419712", + "nextProtocolFee": "2011769" + } + }, + { + "testId": 1477, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "335215307", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692088274681856", + "nextProtocolFee": "1318100" + } + }, + { + "testId": 1478, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "511627232", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367585234419712", + "nextProtocolFee": "2011769" + } + }, + { + "testId": 1479, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "335215307", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692088274681856", + "nextProtocolFee": "1318100" + } + }, + { + "testId": 1480, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "511627232", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367585234419712", + "nextProtocolFee": "2011769" + } + }, + { + "testId": 1481, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "335215307", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692088274681856", + "nextProtocolFee": "1318100" + } + }, + { + "testId": 1482, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "511627232", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367585234419712", + "nextProtocolFee": "2011769" + } + }, + { + "testId": 1483, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "335215307", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "88692088274681856", + "nextProtocolFee": "1318100" + } + }, + { + "testId": 1484, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "511627232", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "135367585234419712", + "nextProtocolFee": "2011769" + } + }, + { + "testId": 1485, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1486, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1487, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1488, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1489, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6839", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "1816771166208", + "nextProtocolFee": "26" + } + }, + { + "testId": 1490, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "25748886514984", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "6812703243019348869120", + "nextProtocolFee": "101247196665" + } + }, + { + "testId": 1491, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6839", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "1816771166208", + "nextProtocolFee": "26" + } + }, + { + "testId": 1492, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "25748886514984", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "6812703243019348869120", + "nextProtocolFee": "101247196665" + } + }, + { + "testId": 1493, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6839", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "1816771166208", + "nextProtocolFee": "26" + } + }, + { + "testId": 1494, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "192", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223089, + "nextSqrtPrice": "1288256951171541679615583", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1495, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "223", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "64424509440", + "nextProtocolFee": "0" + } + }, + { + "testId": 1496, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "25748886514984", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "6812703243019348869120", + "nextProtocolFee": "101247196665" + } + }, + { + "testId": 1497, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6839", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "1816771166208", + "nextProtocolFee": "26" + } + }, + { + "testId": 1498, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247468053899296255583", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1499, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1500, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "25748886514984", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "6812703243019348869120", + "nextProtocolFee": "101247196665" + } + }, + { + "testId": 1501, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1502, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1503, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1504, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1505, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "25766172587066", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "6817276834163919421440", + "nextProtocolFee": "101315167229" + } + }, + { + "testId": 1506, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6834", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "1812476198912", + "nextProtocolFee": "26" + } + }, + { + "testId": 1507, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "25766172587066", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "6817276834163919421440", + "nextProtocolFee": "101315167229" + } + }, + { + "testId": 1508, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6834", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "1812476198912", + "nextProtocolFee": "26" + } + }, + { + "testId": 1509, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "192", + "nextLiquidity": "4294967296", + "nextTickIndex": -223090, + "nextSqrtPrice": "264141688978651", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1510, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6834", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "1812476198912", + "nextProtocolFee": "26" + } + }, + { + "testId": 1511, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "25766172587066", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "6817276834163919421440", + "nextProtocolFee": "101315167229" + } + }, + { + "testId": 1512, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "223", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "64424509440", + "nextProtocolFee": "0" + } + }, + { + "testId": 1513, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966352191132", + "nextFeeGrowthGlobal": "264582445133725696", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1514, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6834", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "1812476198912", + "nextProtocolFee": "26" + } + }, + { + "testId": 1515, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "25766172587066", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "6817276834163919421440", + "nextProtocolFee": "101315167229" + } + }, + { + "testId": 1516, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1517, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1518, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1519, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1520, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1521, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1522, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1523, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1524, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1525, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1526, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1527, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1528, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1529, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1530, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1531, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1532, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1533, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1534, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1535, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1536, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1537, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1538, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1539, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1540, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1541, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1542, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1543, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1544, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1545, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1546, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1547, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1548, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1549, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1550, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1551, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1552, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1553, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1554, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1555, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1556, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1557, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1558, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1559, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1560, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1561, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1562, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1563, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1564, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1565, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1566, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1567, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1568, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1569, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1570, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1571, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1572, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1573, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1574, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1575, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1576, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1577, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1578, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1579, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1580, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1581, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1582, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1583, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1584, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1585, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1586, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1587, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1588, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1589, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1590, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1591, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1592, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1593, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1594, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1595, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1596, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1597, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1598, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1599, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1600, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 8, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1601, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1602, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1603, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1604, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1605, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1606, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1607, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1608, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1609, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1610, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1611, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1612, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1613, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1614, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1615, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1616, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1617, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1618, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1619, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1620, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1621, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1622, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1623, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1624, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1625, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1626, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1627, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1628, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1629, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1630, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1631, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1632, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1633, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1634, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1635, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1636, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1637, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1638, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1639, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1640, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1641, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1642, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1643, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1644, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1645, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1646, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1647, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1648, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1649, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1650, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1651, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1652, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1653, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1654, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1655, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1656, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1657, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1658, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1659, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1660, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1661, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1662, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1663, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1664, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1665, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1666, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1667, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1668, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1669, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1670, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1671, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1672, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1673, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1674, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1675, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1676, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1677, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1678, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1679, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1680, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1681, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1682, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1683, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1684, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1685, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1686, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1687, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1688, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1689, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1690, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1691, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1692, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1693, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1694, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1695, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1696, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1697, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1698, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1699, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1700, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1701, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1702, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1703, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1704, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1705, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1706, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1707, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1708, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1709, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1710, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1711, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1712, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1713, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1714, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1715, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1716, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1717, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1718, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1719, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1070131095559", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "65923178868", + "nextProtocolFee": "4207862480" + } + }, + { + "testId": 1720, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1070131095559", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "65923178868", + "nextProtocolFee": "4207862480" + } + }, + { + "testId": 1721, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1722, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1723, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1070131039", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "65923176", + "nextProtocolFee": "4207862" + } + }, + { + "testId": 1724, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1070131039", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "65923176", + "nextProtocolFee": "4207862" + } + }, + { + "testId": 1725, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1726, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1727, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1728, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1729, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1730, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1731, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1732, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1733, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1734, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1735, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1736, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1737, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4529150841451380342", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238925406443588235241", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1738, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1739, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1740, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "5186732809220408117", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "319517782573123880", + "nextProtocolFee": "20394752079135566" + } + }, + { + "testId": 1741, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1742, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1743, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1744, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1745, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1746, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1747, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1748, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1749, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1750, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1751, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1752, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1753, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1754, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4529150841451398030", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968114724636", + "nextFeeGrowthGlobal": "61602900", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1755, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "5186732809220428375", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "319517782573125128", + "nextProtocolFee": "20394752079135646" + } + }, + { + "testId": 1756, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1757, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1758, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1759, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1760, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1761, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1762, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1763, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1764, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1765, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1766, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790477572597955878871887", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1767, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1768, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1769, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1770, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468089480313495511887", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1771, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1772, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "133770400956158739", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "35393299196959863175380992", + "nextProtocolFee": "525998593599711" + } + }, + { + "testId": 1773, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1774, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1775, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1776, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1777, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1778, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1779, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1780, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1781, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352179", + "nextFeeGrowthGlobal": "274151184252585115648", + "nextProtocolFee": "4074306171" + } + }, + { + "testId": 1782, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1783, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1784, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1785, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4037269258240000000", + "nextProtocolFee": "60000000" + } + }, + { + "testId": 1786, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1787, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "133770399589854003", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "35393298835459625581543424", + "nextProtocolFee": "525998588227264" + } + }, + { + "testId": 1788, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1789, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1790, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1791, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1792, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1793, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9580082137", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "2534721520064790528", + "nextProtocolFee": "37669840" + } + }, + { + "testId": 1794, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "20299409596", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "5370867341066240000", + "nextProtocolFee": "79819308" + } + }, + { + "testId": 1795, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9580082137", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "2534721520064790528", + "nextProtocolFee": "37669840" + } + }, + { + "testId": 1796, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "20299409596", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "5370867341066240000", + "nextProtocolFee": "79819308" + } + }, + { + "testId": 1797, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9580082137", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "2534721520064790528", + "nextProtocolFee": "37669840" + } + }, + { + "testId": 1798, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "20299409596", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "5370867341066240000", + "nextProtocolFee": "79819308" + } + }, + { + "testId": 1799, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "9580082137", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "2534721520064790528", + "nextProtocolFee": "37669840" + } + }, + { + "testId": 1800, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "20299409596", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "5370867341066240000", + "nextProtocolFee": "79819308" + } + }, + { + "testId": 1801, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "767482278", + "nextLiquidity": "4294967296", + "nextTickIndex": -3938, + "nextSqrtPrice": "15150432786913804916", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1802, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "767482278", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 3937, + "nextSqrtPrice": "22460240687966191616", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1803, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1394908476", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": -5302, + "nextSqrtPrice": "14151776777709551616", + "nextFeeGrowthGlobal": "369068292091936768", + "nextProtocolFee": "5484919" + } + }, + { + "testId": 1804, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1394908476", + "nextLiquidity": "4294967296", + "nextTickIndex": 5301, + "nextSqrtPrice": "24045204518553235921", + "nextFeeGrowthGlobal": "369068292091936768", + "nextProtocolFee": "5484919" + } + }, + { + "testId": 1805, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1806, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1807, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1808, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1809, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "253501", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "67078799228928", + "nextProtocolFee": "996" + } + }, + { + "testId": 1810, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "784576534567943", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "207585174540807152074752", + "nextProtocolFee": "3085033391574" + } + }, + { + "testId": 1811, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "253501", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "67078799228928", + "nextProtocolFee": "996" + } + }, + { + "testId": 1812, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "784576534567943", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "207585174540807152074752", + "nextProtocolFee": "3085033391574" + } + }, + { + "testId": 1813, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "253501", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "67078799228928", + "nextProtocolFee": "996" + } + }, + { + "testId": 1814, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "192", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223089, + "nextSqrtPrice": "1288256951171541679615583", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1815, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "223", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "64424509440", + "nextProtocolFee": "0" + } + }, + { + "testId": 1816, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "784576534567943", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "207585174540807152074752", + "nextProtocolFee": "3085033391574" + } + }, + { + "testId": 1817, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "253501", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "67078799228928", + "nextProtocolFee": "996" + } + }, + { + "testId": 1818, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247468053899296255583", + "nextFeeGrowthGlobal": "264582440838758400", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1819, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1820, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "784576534567943", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "207585174540807152074752", + "nextProtocolFee": "3085033391574" + } + }, + { + "testId": 1821, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1822, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1823, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1824, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1825, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "784631761073940", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "207599786504561620942848", + "nextProtocolFee": "3085250547718" + } + }, + { + "testId": 1826, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "253485", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "67074504261632", + "nextProtocolFee": "996" + } + }, + { + "testId": 1827, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "784631761073940", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "207599786504561620942848", + "nextProtocolFee": "3085250547718" + } + }, + { + "testId": 1828, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "253485", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "67074504261632", + "nextProtocolFee": "996" + } + }, + { + "testId": 1829, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "192", + "nextLiquidity": "4294967296", + "nextTickIndex": -223090, + "nextSqrtPrice": "264141688978651", + "nextFeeGrowthGlobal": "264582440838758400000", + "nextProtocolFee": "3932100000" + } + }, + { + "testId": 1830, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "253485", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "67074504261632", + "nextProtocolFee": "996" + } + }, + { + "testId": 1831, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "784631761073940", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "207599786504561620942848", + "nextProtocolFee": "3085250547718" + } + }, + { + "testId": 1832, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "223", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "64424509440", + "nextProtocolFee": "0" + } + }, + { + "testId": 1833, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966352191132", + "nextFeeGrowthGlobal": "264582445133725696", + "nextProtocolFee": "3932100" + } + }, + { + "testId": 1834, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "253485", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "67074504261632", + "nextProtocolFee": "996" + } + }, + { + "testId": 1835, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "784631761073940", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "207599786504561620942848", + "nextProtocolFee": "3085250547718" + } + }, + { + "testId": 1836, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 1837, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1838, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1839, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1840, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1841, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1842, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1843, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1844, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1845, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1846, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1847, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1848, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1849, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1850, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1851, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1852, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1853, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1854, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1855, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1856, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1857, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1858, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1859, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1860, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1861, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1862, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1863, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1864, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1865, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1866, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1867, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1868, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1869, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1870, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1871, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1872, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1873, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1874, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1875, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1876, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1877, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1878, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1879, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1880, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1881, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1882, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1883, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1884, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1885, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1886, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1887, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1888, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1889, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1890, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1891, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1892, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1893, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1894, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1895, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1896, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1897, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1898, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1899, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1900, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1901, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1902, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1903, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1904, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1905, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1906, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1907, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1908, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1909, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1910, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1911, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1912, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1913, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1914, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1915, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1916, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1917, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1918, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1919, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1920, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 6.55%/600 fee", + "tickSpacing": 128, + "feeRate": 65535, + "protocolFeeRate": 600, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1921, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1922, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1923, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1924, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1925, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1926, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1927, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1928, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1929, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1930, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1931, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1932, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1933, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1934, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1935, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1936, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1937, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1938, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1939, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1940, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1941, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1942, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1943, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1944, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1945, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1946, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1947, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1948, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1949, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1950, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1951, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1952, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1953, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1954, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1955, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1956, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1957, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1958, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1959, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1960, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1961, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1962, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1963, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1964, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1965, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1966, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1967, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1968, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1969, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1970, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1971, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1972, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1973, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1974, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1975, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1976, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1977, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1978, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1979, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1980, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1981, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1982, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1983, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1984, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1985, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1986, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1987, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1988, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1989, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1990, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1991, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1992, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1993, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1994, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1995, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1996, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1997, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1998, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 1999, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2000, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2001, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2002, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2003, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2004, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2005, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2006, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2007, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2008, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2009, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2010, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2011, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2012, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2013, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2014, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2015, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2016, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2017, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2018, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2019, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2020, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2021, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2022, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2023, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2024, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2025, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2026, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2027, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2028, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2029, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2030, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2031, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2032, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2033, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "163153725400287996", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110781379546796", + "nextProtocolFee": "3426228233406" + } + }, + { + "testId": 2034, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "244335373572040088", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165903718655417", + "nextProtocolFee": "5131042845012" + } + }, + { + "testId": 2035, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "163153725400287996", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110781379546796", + "nextProtocolFee": "3426228233406" + } + }, + { + "testId": 2036, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "244335373572040088", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165903718655417", + "nextProtocolFee": "5131042845012" + } + }, + { + "testId": 2037, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "999299945865", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743074409605751", + "nextFeeGrowthGlobal": "679000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2038, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999299945865", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073009551616", + "nextFeeGrowthGlobal": "679000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2039, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000700544593", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "679475671", + "nextProtocolFee": "21014711" + } + }, + { + "testId": 2040, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1000700544593", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "679475671", + "nextProtocolFee": "21014711" + } + }, + { + "testId": 2041, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "999299999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072710251617", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2042, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999299999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074708851616", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2043, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000700492", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "679477", + "nextProtocolFee": "21014" + } + }, + { + "testId": 2044, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1000700492", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "679477", + "nextProtocolFee": "21014" + } + }, + { + "testId": 2045, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2046, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2047, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2048, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2049, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2050, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2051, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2052, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2053, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2054, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2055, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2056, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2057, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4843390954611785642", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238611166330427829941", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2058, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2059, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2060, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4850215425365904805", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "3293296273823450", + "nextProtocolFee": "101854523932684" + } + }, + { + "testId": 2061, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2062, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2063, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2064, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2065, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2066, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2067, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2068, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2069, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2070, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2071, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2072, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2073, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2074, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4843390954611804558", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968179559636", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2075, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4850215425365923748", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "3293296273823463", + "nextProtocolFee": "101854523932684" + } + }, + { + "testId": 2076, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2077, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2078, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2079, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2080, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2081, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2082, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2083, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2084, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2085, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2086, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790756036802592038871887", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2087, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2088, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2089, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2090, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468367944518131671887", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2091, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2092, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2093, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2094, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2095, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2096, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2097, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2098, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2099, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2100, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2101, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352164", + "nextFeeGrowthGlobal": "18135840268849512448", + "nextProtocolFee": "130595238" + } + }, + { + "testId": 2102, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2103, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2104, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2105, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4166118277120000000", + "nextProtocolFee": "30000000" + } + }, + { + "testId": 2106, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2107, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2108, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2109, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2110, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2111, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2112, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2113, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37987188", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110788681400320", + "nextProtocolFee": "797" + } + }, + { + "testId": 2114, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56888764", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165910291677184", + "nextProtocolFee": "1194" + } + }, + { + "testId": 2115, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37987188", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110788681400320", + "nextProtocolFee": "797" + } + }, + { + "testId": 2116, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56888764", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165910291677184", + "nextProtocolFee": "1194" + } + }, + { + "testId": 2117, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37987188", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110788681400320", + "nextProtocolFee": "797" + } + }, + { + "testId": 2118, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56888764", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165910291677184", + "nextProtocolFee": "1194" + } + }, + { + "testId": 2119, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37987188", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110788681400320", + "nextProtocolFee": "797" + } + }, + { + "testId": 2120, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56888764", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165910291677184", + "nextProtocolFee": "1194" + } + }, + { + "testId": 2121, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37987188", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110788681400320", + "nextProtocolFee": "797" + } + }, + { + "testId": 2122, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56888764", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165910291677184", + "nextProtocolFee": "1194" + } + }, + { + "testId": 2123, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37987188", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "110788681400320", + "nextProtocolFee": "797" + } + }, + { + "testId": 2124, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56888764", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "165910291677184", + "nextProtocolFee": "1194" + } + }, + { + "testId": 2125, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2126, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2127, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2128, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2129, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "656", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2130, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3430460760783", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "10004193698243411968", + "nextProtocolFee": "72039675" + } + }, + { + "testId": 2131, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "656", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2132, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3430460760783", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "10004193698243411968", + "nextProtocolFee": "72039675" + } + }, + { + "testId": 2133, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "656", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2134, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "205", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288535415376177839615583", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2135, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "209", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2136, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3430460760783", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "10004193698243411968", + "nextProtocolFee": "72039675" + } + }, + { + "testId": 2137, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "656", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2138, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247746518103932415583", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2139, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2140, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3430460760783", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "10004193698243411968", + "nextProtocolFee": "72039675" + } + }, + { + "testId": 2141, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2142, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2143, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2144, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2145, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3445592939757", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "10048323409173020672", + "nextProtocolFee": "72357451" + } + }, + { + "testId": 2146, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "653", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2147, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3445592939757", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "10048323409173020672", + "nextProtocolFee": "72357451" + } + }, + { + "testId": 2148, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "653", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2149, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "205", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264084605560954", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2150, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "653", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2151, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3445592939757", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "10048323409173020672", + "nextProtocolFee": "72357451" + } + }, + { + "testId": 2152, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "209", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2153, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966294738319", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2154, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "653", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2155, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3445592939757", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "10048323409173020672", + "nextProtocolFee": "72357451" + } + }, + { + "testId": 2156, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2157, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2158, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2159, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2160, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2161, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2162, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2163, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2164, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2165, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2166, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2167, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2168, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2169, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2170, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2171, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2172, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2173, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2174, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2175, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2176, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2177, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2178, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2179, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2180, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2181, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2182, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2183, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2184, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2185, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2186, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2187, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2188, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2189, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2190, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2191, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2192, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2193, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2194, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2195, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2196, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2197, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2198, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2199, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2200, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2201, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2202, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2203, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2204, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2205, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2206, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2207, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2208, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2209, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2210, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2211, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2212, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2213, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2214, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2215, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2216, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2217, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2218, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2219, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2220, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2221, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2222, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2223, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2224, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2225, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2226, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2227, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2228, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2229, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2230, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2231, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2232, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2233, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2234, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2235, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2236, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2237, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2238, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2239, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2240, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 1, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2241, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2242, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2243, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2244, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2245, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2246, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2247, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2248, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2249, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2250, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2251, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2252, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2253, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2254, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2255, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2256, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2257, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2258, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2259, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2260, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2261, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2262, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2263, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2264, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2265, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2266, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2267, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2268, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2269, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2270, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2271, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2272, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2273, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2274, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2275, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2276, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2277, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2278, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2279, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2280, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2281, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2282, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2283, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2284, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2285, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2286, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2287, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2288, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2289, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2290, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2291, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2292, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2293, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2294, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2295, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2296, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2297, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2298, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2299, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2300, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2301, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2302, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2303, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2304, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2305, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2306, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2307, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2308, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2309, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2310, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2311, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2312, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2313, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2314, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2315, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2316, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2317, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2318, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2319, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2320, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2321, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2322, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2323, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2324, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2325, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2326, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2327, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2328, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2329, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2330, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2331, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2332, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2333, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2334, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2335, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2336, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2337, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2338, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2339, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2340, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2341, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2342, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2343, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2344, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2345, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2346, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2347, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2348, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2349, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2350, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2351, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2352, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2353, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1346327925148191248", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914156661175622", + "nextProtocolFee": "28272886428112" + } + }, + { + "testId": 2354, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2054852556038346792", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395244885550038", + "nextProtocolFee": "43151903676805" + } + }, + { + "testId": 2355, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1346327925148191248", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914156661175622", + "nextProtocolFee": "28272886428112" + } + }, + { + "testId": 2356, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2054852556038346792", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395244885550038", + "nextProtocolFee": "43151903676805" + } + }, + { + "testId": 2357, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "999299945865", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743074409605751", + "nextFeeGrowthGlobal": "679000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2358, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999299945865", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073009551616", + "nextFeeGrowthGlobal": "679000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2359, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000700544593", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "679475671", + "nextProtocolFee": "21014711" + } + }, + { + "testId": 2360, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1000700544593", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "679475671", + "nextProtocolFee": "21014711" + } + }, + { + "testId": 2361, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "999299999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072710251617", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2362, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999299999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074708851616", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2363, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000700492", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "679477", + "nextProtocolFee": "21014" + } + }, + { + "testId": 2364, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1000700492", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "679477", + "nextProtocolFee": "21014" + } + }, + { + "testId": 2365, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2366, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2367, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2368, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2369, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2370, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2371, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2372, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2373, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2374, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2375, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2376, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2377, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4843390954611785642", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238611166330427829941", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2378, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2379, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2380, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4850215425365904805", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "3293296273823450", + "nextProtocolFee": "101854523932684" + } + }, + { + "testId": 2381, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2382, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2383, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2384, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2385, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2386, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2387, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2388, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2389, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2390, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2391, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2392, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2393, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2394, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4843390954611804558", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968179559636", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2395, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4850215425365923748", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "3293296273823463", + "nextProtocolFee": "101854523932684" + } + }, + { + "testId": 2396, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2397, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2398, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2399, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2400, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2401, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2402, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2403, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2404, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2405, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2406, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790756036802592038871887", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2407, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2408, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2409, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2410, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468367944518131671887", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2411, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2412, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2413, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2414, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2415, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2416, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2417, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2418, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2419, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2420, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2421, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352164", + "nextFeeGrowthGlobal": "18135840268849512448", + "nextProtocolFee": "130595238" + } + }, + { + "testId": 2422, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2423, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2424, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2425, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4166118277120000000", + "nextProtocolFee": "30000000" + } + }, + { + "testId": 2426, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2427, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2428, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2429, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2430, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2431, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2432, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2433, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313466398", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914162314117120", + "nextProtocolFee": "6582" + } + }, + { + "testId": 2434, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478432644", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395245895909376", + "nextProtocolFee": "10047" + } + }, + { + "testId": 2435, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313466398", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914162314117120", + "nextProtocolFee": "6582" + } + }, + { + "testId": 2436, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478432644", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395245895909376", + "nextProtocolFee": "10047" + } + }, + { + "testId": 2437, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313466398", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914162314117120", + "nextProtocolFee": "6582" + } + }, + { + "testId": 2438, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478432644", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395245895909376", + "nextProtocolFee": "10047" + } + }, + { + "testId": 2439, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313466398", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914162314117120", + "nextProtocolFee": "6582" + } + }, + { + "testId": 2440, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478432644", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395245895909376", + "nextProtocolFee": "10047" + } + }, + { + "testId": 2441, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313466398", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914162314117120", + "nextProtocolFee": "6582" + } + }, + { + "testId": 2442, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478432644", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395245895909376", + "nextProtocolFee": "10047" + } + }, + { + "testId": 2443, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313466398", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "914162314117120", + "nextProtocolFee": "6582" + } + }, + { + "testId": 2444, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478432644", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "1395245895909376", + "nextProtocolFee": "10047" + } + }, + { + "testId": 2445, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2446, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2447, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2448, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2449, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6395", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2450, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24078288038852", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "70219097123250503680", + "nextProtocolFee": "505644048" + } + }, + { + "testId": 2451, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6395", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2452, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24078288038852", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "70219097123250503680", + "nextProtocolFee": "505644048" + } + }, + { + "testId": 2453, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6395", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2454, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "205", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288535415376177839615583", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2455, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "209", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2456, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24078288038852", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "70219097123250503680", + "nextProtocolFee": "505644048" + } + }, + { + "testId": 2457, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6395", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2458, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247746518103932415583", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2459, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2460, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24078288038852", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "70219097123250503680", + "nextProtocolFee": "505644048" + } + }, + { + "testId": 2461, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2462, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2463, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2464, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2465, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24094452583381", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "70266237503175393280", + "nextProtocolFee": "505983504" + } + }, + { + "testId": 2466, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6391", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2467, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24094452583381", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "70266237503175393280", + "nextProtocolFee": "505983504" + } + }, + { + "testId": 2468, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6391", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2469, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "205", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264084605560954", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2470, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6391", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2471, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24094452583381", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "70266237503175393280", + "nextProtocolFee": "505983504" + } + }, + { + "testId": 2472, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "209", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2473, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966294738319", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2474, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6391", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "21474836480", + "nextProtocolFee": "0" + } + }, + { + "testId": 2475, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24094452583381", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "70266237503175393280", + "nextProtocolFee": "505983504" + } + }, + { + "testId": 2476, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2477, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2478, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2479, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2480, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2481, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2482, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2483, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2484, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2485, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2486, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2487, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2488, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2489, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2490, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2491, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2492, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2493, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2494, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2495, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2496, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2497, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2498, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2499, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2500, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2501, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2502, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2503, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2504, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2505, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2506, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2507, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2508, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2509, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2510, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2511, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2512, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2513, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2514, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2515, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2516, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2517, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2518, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2519, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2520, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2521, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2522, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2523, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2524, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2525, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2526, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2527, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2528, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2529, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2530, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2531, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2532, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2533, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2534, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2535, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2536, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2537, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2538, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2539, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2540, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2541, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2542, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2543, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2544, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2545, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2546, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2547, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2548, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2549, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2550, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2551, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2552, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2553, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2554, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2555, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2556, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2557, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2558, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2559, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2560, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 8, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2561, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2562, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2563, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2564, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2565, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2566, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2567, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2568, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2569, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2570, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2571, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2572, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2573, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2574, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2575, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2576, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2577, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2578, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2579, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2580, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2581, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2582, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2583, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2584, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2585, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2586, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2587, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2588, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2589, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2590, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2591, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2592, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2593, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2594, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2595, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2596, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2597, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2598, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2599, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2600, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2601, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2602, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2603, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2604, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2605, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2606, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2607, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2608, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2609, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2610, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2611, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2612, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2613, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2614, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2615, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2616, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2617, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2618, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2619, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2620, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2621, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2622, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2623, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2624, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2625, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2626, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2627, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2628, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2629, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2630, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2631, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2632, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2633, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2634, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2635, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2636, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2637, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2638, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2639, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2640, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2641, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2642, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2643, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2644, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2645, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2646, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2647, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2648, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2649, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2650, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2651, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2652, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2653, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2654, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2655, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2656, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2657, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2658, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2659, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2660, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2661, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2662, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2663, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2664, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2665, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2666, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2667, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2668, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2669, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2670, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2671, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2672, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2673, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2674, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2675, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2676, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2677, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2678, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2679, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000700544593", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "679475671", + "nextProtocolFee": "21014711" + } + }, + { + "testId": 2680, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1000700544593", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "679475671", + "nextProtocolFee": "21014711" + } + }, + { + "testId": 2681, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2682, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2683, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000700492", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "679477", + "nextProtocolFee": "21014" + } + }, + { + "testId": 2684, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1000700492", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "679477", + "nextProtocolFee": "21014" + } + }, + { + "testId": 2685, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2686, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2687, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2688, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2689, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2690, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2691, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2692, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2693, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2694, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2695, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2696, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2697, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4843390954611785642", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238611166330427829941", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2698, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2699, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2700, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4850215425365904805", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "3293296273823450", + "nextProtocolFee": "101854523932684" + } + }, + { + "testId": 2701, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2702, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2703, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2704, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2705, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2706, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2707, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2708, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2709, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2710, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2711, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2712, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2713, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2714, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4843390954611804558", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968179559636", + "nextFeeGrowthGlobal": "679000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2715, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4850215425365923748", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "3293296273823463", + "nextProtocolFee": "101854523932684" + } + }, + { + "testId": 2716, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2717, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2718, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2719, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2720, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2721, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2722, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2723, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2724, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2725, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2726, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790756036802592038871887", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2727, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2728, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2729, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2730, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468367944518131671887", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2731, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2732, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125091321654655135", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "364801669018193915543552", + "nextProtocolFee": "2626917754747" + } + }, + { + "testId": 2733, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2734, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2735, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2736, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2737, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2738, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2739, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2740, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2741, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352164", + "nextFeeGrowthGlobal": "18135840268849512448", + "nextProtocolFee": "130595238" + } + }, + { + "testId": 2742, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2743, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2744, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2745, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4166118277120000000", + "nextProtocolFee": "30000000" + } + }, + { + "testId": 2746, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "4", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2747, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125091320376996818", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "364801665292180937244672", + "nextProtocolFee": "2626917727916" + } + }, + { + "testId": 2748, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2749, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2750, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2751, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2752, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2753, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8958522420", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "26125590276866048", + "nextProtocolFee": "188128" + } + }, + { + "testId": 2754, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18982375451", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "55357979507032064", + "nextProtocolFee": "398629" + } + }, + { + "testId": 2755, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8958522420", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "26125590276866048", + "nextProtocolFee": "188128" + } + }, + { + "testId": 2756, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18982375451", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "55357979507032064", + "nextProtocolFee": "398629" + } + }, + { + "testId": 2757, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8958522420", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "26125590276866048", + "nextProtocolFee": "188128" + } + }, + { + "testId": 2758, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18982375451", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "55357979507032064", + "nextProtocolFee": "398629" + } + }, + { + "testId": 2759, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8958522420", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "26125590276866048", + "nextProtocolFee": "188128" + } + }, + { + "testId": 2760, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18982375451", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "55357979507032064", + "nextProtocolFee": "398629" + } + }, + { + "testId": 2761, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "810680794", + "nextLiquidity": "4294967296", + "nextTickIndex": -4184, + "nextSqrtPrice": "14964896572963726990", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2762, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "810680794", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 4183, + "nextSqrtPrice": "22738704892602351616", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2763, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1304406234", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": -5302, + "nextSqrtPrice": "14151776777709551616", + "nextFeeGrowthGlobal": "3804022469296128", + "nextProtocolFee": "27392" + } + }, + { + "testId": 2764, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1304406234", + "nextLiquidity": "4294967296", + "nextTickIndex": 5301, + "nextSqrtPrice": "24045204518553235921", + "nextFeeGrowthGlobal": "3804022469296128", + "nextProtocolFee": "27392" + } + }, + { + "testId": 2765, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2766, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2767, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2768, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2769, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "237053", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2770, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733672882392707", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "2139597603336009809920", + "nextProtocolFee": "15407130530" + } + }, + { + "testId": 2771, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "237053", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2772, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733672882392707", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "2139597603336009809920", + "nextProtocolFee": "15407130530" + } + }, + { + "testId": 2773, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "237053", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2774, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "205", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288535415376177839615583", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2775, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "209", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2776, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733672882392707", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "2139597603336009809920", + "nextProtocolFee": "15407130530" + } + }, + { + "testId": 2777, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "237053", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2778, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247746518103932415583", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2779, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "2", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2780, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733672882392707", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "2139597603336009809920", + "nextProtocolFee": "15407130530" + } + }, + { + "testId": 2781, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2782, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2783, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2784, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2785, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733724525780006", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "2139748210062210891776", + "nextProtocolFee": "15408215041" + } + }, + { + "testId": 2786, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "237038", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2787, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733724525780006", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "2139748210062210891776", + "nextProtocolFee": "15408215041" + } + }, + { + "testId": 2788, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "237038", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2789, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "205", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264084605560954", + "nextFeeGrowthGlobal": "2916282793984000000", + "nextProtocolFee": "21000000" + } + }, + { + "testId": 2790, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "237038", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2791, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733724525780006", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "2139748210062210891776", + "nextProtocolFee": "15408215041" + } + }, + { + "testId": 2792, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "209", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2793, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966294738319", + "nextFeeGrowthGlobal": "2916282793984000", + "nextProtocolFee": "21000" + } + }, + { + "testId": 2794, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "237038", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "695784701952", + "nextProtocolFee": "4" + } + }, + { + "testId": 2795, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733724525780006", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "2139748210062210891776", + "nextProtocolFee": "15408215041" + } + }, + { + "testId": 2796, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "2", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "4294967296", + "nextProtocolFee": "0" + } + }, + { + "testId": 2797, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2798, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2799, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2800, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2801, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2802, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2803, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2804, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2805, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2806, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2807, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2808, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2809, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2810, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2811, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2812, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2813, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2814, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2815, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2816, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2817, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2818, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2819, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2820, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2821, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2822, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2823, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2824, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2825, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2826, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2827, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2828, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2829, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2830, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2831, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2832, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2833, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2834, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2835, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2836, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2837, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2838, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2839, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2840, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2841, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2842, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2843, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2844, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2845, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2846, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2847, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2848, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2849, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2850, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2851, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2852, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2853, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2854, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2855, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2856, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2857, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2858, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2859, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2860, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2861, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2862, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2863, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2864, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2865, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2866, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2867, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2868, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2869, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2870, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2871, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2872, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2873, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2874, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2875, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2876, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2877, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2878, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2879, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2880, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.07%/300 fee", + "tickSpacing": 128, + "feeRate": 700, + "protocolFeeRate": 300, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2881, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2882, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2883, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2884, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2885, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2886, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2887, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2888, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2889, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2890, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2891, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2892, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2893, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2894, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2895, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2896, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2897, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2898, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2899, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2900, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2901, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2902, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2903, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2904, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2905, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2906, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2907, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2908, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2909, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2910, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2911, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2912, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2913, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2914, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2915, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2916, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2917, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2918, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2919, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2920, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2921, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2922, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2923, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2924, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2925, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2926, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2927, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2928, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2929, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2930, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2931, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2932, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2933, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2934, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2935, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2936, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2937, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2938, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2939, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2940, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2941, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2942, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2943, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2944, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2945, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2946, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2947, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2948, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2949, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2950, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2951, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2952, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2953, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2954, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2955, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2956, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2957, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2958, + "description": "In a ts_1 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2959, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2960, + "description": "In a ts_1 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2961, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2962, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2963, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2964, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2965, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2966, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2967, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2968, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2969, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2970, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2971, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2972, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2973, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2974, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2975, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2976, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2977, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2978, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2979, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2980, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2981, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2982, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2983, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2984, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2985, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2986, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2987, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2988, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2989, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2990, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2991, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2992, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2993, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "163039517792507794", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2994, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "244164338810539659", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2995, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "163039517792507794", + "amountB": "161611135553062958", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2996, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "240974754707347856", + "amountB": "244164338810539659", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2997, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "999999945789", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709605827", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2998, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999999945789", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 2999, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000054211", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3000, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1000000054211", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3001, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "999999999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551617", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3002, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999999999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3003, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000001", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3004, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1000000001", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3005, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3006, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3007, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3008, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3009, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3010, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3011, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3012, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3013, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3014, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3015, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3016, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3017, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4846783690399666109", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238607773594639949474", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3018, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3019, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3020, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4846820274568148671", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3021, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3022, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3023, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3024, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3025, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3026, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3027, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3028, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3029, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3030, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3031, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3032, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3033, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3034, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4846783690399685038", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968180259636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3035, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4846820274568167601", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3036, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3037, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3038, + "description": "In a ts_1 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3039, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3040, + "description": "In a ts_1 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3041, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3042, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3043, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3044, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3045, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3046, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790759043279699238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3047, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3048, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3049, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "222152012331693918", + "nextLiquidity": "4294967296", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3050, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468370950995238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3051, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3052, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3053, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3054, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3055, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3056, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3057, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3058, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3059, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3060, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3061, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352163", + "nextFeeGrowthGlobal": "499845579489148928", + "nextProtocolFee": "0" + } + }, + { + "testId": 3062, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3063, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3064, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3065, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4294967296000000000", + "nextProtocolFee": "0" + } + }, + { + "testId": 3066, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "221247072229197460", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3067, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3068, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3069, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3070, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3071, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3072, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3073, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37960596", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3074, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56848941", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3075, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37960596", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3076, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56848941", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3077, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37960596", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3078, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56848941", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3079, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37960596", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3080, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56848941", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3081, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37960596", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3082, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56848941", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3083, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "37960596", + "amountB": "37628024", + "nextLiquidity": "4294967296", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3084, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "56106307", + "amountB": "56848941", + "nextLiquidity": "4294967296", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3085, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3086, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3087, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3088, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3089, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "655", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3090, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3428059438250", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3091, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "655", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3092, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3428059438250", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3093, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "655", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3094, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "205", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288538421853285039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3095, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "208", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3096, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3428059438250", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3097, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "655", + "amountB": "3137830430949", + "nextLiquidity": "4294967296", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3098, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247749524581039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3099, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3100, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "699", + "amountB": "3428059438250", + "nextLiquidity": "4294967296", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3101, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3102, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3103, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3104, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3105, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3443181024699", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3106, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "652", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3107, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3443181024699", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3108, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "652", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3109, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "205", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264083989386607", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3110, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "652", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3111, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3443181024699", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3112, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "208", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3113, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966294118022", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3114, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3123037130788", + "amountB": "652", + "nextLiquidity": "4294967296", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3115, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3443181024699", + "amountB": "702", + "nextLiquidity": "4294967296", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3116, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3117, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3118, + "description": "In a ts_1 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3119, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3120, + "description": "In a ts_1 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3121, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3122, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3123, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3124, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3125, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3126, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3127, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3128, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3129, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3130, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3131, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443255, + "nextSqrtPrice": "77735650836370769616350596754", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3132, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3133, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3134, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3135, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3136, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3137, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3138, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3139, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3140, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3141, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3142, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3143, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3144, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3145, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3146, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3147, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3148, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443257, + "nextSqrtPrice": "4377211104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3149, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3150, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3151, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3152, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3153, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3154, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3155, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3156, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3157, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3158, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3159, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3160, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3161, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3162, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3163, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -177, + "nextSqrtPrice": "18285132938156488658", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3164, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 263, + "nextSqrtPrice": "18690908412520091275", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3165, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3166, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3167, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3168, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3169, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3170, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3171, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3172, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3173, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3174, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3175, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3176, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3177, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3178, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3179, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 222815, + "nextSqrtPrice": "1270766575475963239534908", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3180, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 223255, + "nextSqrtPrice": "1298966857733312654752301", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3181, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3182, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3183, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3184, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3185, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3186, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3187, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3188, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3189, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3190, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3191, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3192, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3193, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3194, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3195, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -223257, + "nextSqrtPrice": "261950758830217", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3196, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -222817, + "nextSqrtPrice": "267763852658069", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3197, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3198, + "description": "In a ts_1 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3199, + "description": "In a ts_1 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3200, + "description": "In a ts_1 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 1, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3201, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3202, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3203, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3204, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3205, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3206, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3207, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3208, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3209, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3210, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3211, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3212, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3213, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3214, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3215, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3216, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3217, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3218, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3219, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3220, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3221, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3222, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3223, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3224, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3225, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3226, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3227, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3228, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3229, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3230, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3231, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3232, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3233, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3234, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3235, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3236, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3237, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3238, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3239, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3240, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3241, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3242, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3243, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3244, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3245, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3246, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3247, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3248, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3249, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3250, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3251, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3252, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3253, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3254, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3255, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3256, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3257, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3258, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3259, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3260, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3261, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3262, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3263, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3264, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3265, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3266, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3267, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3268, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3269, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3270, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3271, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3272, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3273, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3274, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3275, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3276, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3277, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3278, + "description": "In a ts_8 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3279, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3280, + "description": "In a ts_8 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3281, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3282, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3283, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3284, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3285, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3286, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3287, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3288, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3289, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3290, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3291, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3292, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3293, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3294, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3295, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3296, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3297, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3298, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3299, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3300, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3301, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3302, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3303, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3304, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3305, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3306, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3307, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3308, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3309, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3310, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3311, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3312, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3313, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1345385495600587514", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3314, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2053414159249119949", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3315, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1345385495600587514", + "amountB": "1253931863719602977", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3316, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1847732346382633346", + "amountB": "2053414159249119949", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3317, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "999999945789", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709605827", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3318, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999999945789", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3319, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000054211", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3320, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1000000054211", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3321, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "999999999", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551617", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3322, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "999999999", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3323, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000001", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3324, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1000000001", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3325, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3326, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3327, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3328, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3329, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3330, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3331, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3332, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3333, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3334, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3335, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3336, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3337, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4846783690399666109", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238607773594639949474", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3338, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3339, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3340, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4846820274568148671", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3341, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3342, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3343, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3344, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3345, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3346, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3347, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3348, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3349, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3350, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3351, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3352, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3353, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3354, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4846783690399685038", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968180259636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3355, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4846820274568167601", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3356, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3357, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3358, + "description": "In a ts_8 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3359, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3360, + "description": "In a ts_8 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3361, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3362, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3363, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3364, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3365, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3366, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790759043279699238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3367, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3368, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3369, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1819507958431500011", + "nextLiquidity": "4294967296", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3370, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468370950995238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3371, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3372, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3373, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3374, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3375, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3376, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3377, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3378, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3379, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3380, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3381, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352163", + "nextFeeGrowthGlobal": "499845579489148928", + "nextProtocolFee": "0" + } + }, + { + "testId": 3382, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3383, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3384, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3385, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4294967296000000000", + "nextProtocolFee": "0" + } + }, + { + "testId": 3386, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1818682886082718358", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3387, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3388, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3389, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3390, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3391, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3392, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3393, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313246971", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3394, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478097741", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3395, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313246971", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3396, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478097741", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3397, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313246971", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3398, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478097741", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3399, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313246971", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3400, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478097741", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3401, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313246971", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3402, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478097741", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3403, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "313246971", + "amountB": "291953762", + "nextLiquidity": "4294967296", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3404, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "430208711", + "amountB": "478097741", + "nextLiquidity": "4294967296", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3405, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3406, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3407, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3408, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3409, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6390", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3410, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24061433237224", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3411, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6390", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3412, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24061433237224", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3413, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6390", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3414, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "205", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288538421853285039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3415, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "208", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3416, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24061433237224", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3417, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "6390", + "amountB": "28060754122726", + "nextLiquidity": "4294967296", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3418, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247749524581039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3419, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3420, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4594", + "amountB": "24061433237224", + "nextLiquidity": "4294967296", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3421, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3422, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3423, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3424, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3425, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24077586466572", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3426, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6386", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3427, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24077586466572", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3428, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6386", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3429, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "205", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264083989386607", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3430, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6386", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3431, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24077586466572", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3432, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "208", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3433, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966294118022", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3434, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "28047206937597", + "amountB": "6386", + "nextLiquidity": "4294967296", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3435, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "24077586466572", + "amountB": "4597", + "nextLiquidity": "4294967296", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3436, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3437, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3438, + "description": "In a ts_8 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3439, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3440, + "description": "In a ts_8 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3441, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3442, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3443, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3444, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3445, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3446, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3447, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3448, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3449, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3450, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3451, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 441407, + "nextSqrtPrice": "70875059287800963694839334936", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3452, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3453, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3454, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3455, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3456, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3457, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3458, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3459, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3460, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3461, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3462, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3463, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3464, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3465, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3466, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3467, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3468, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -441409, + "nextSqrtPrice": "4800918087", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3469, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3470, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3471, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3472, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3473, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3474, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3475, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3476, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3477, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3478, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3479, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3480, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3481, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3482, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3483, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -1409, + "nextSqrtPrice": "17192812209989948639", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3484, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 2111, + "nextSqrtPrice": "20500158232958671565", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3485, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3486, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3487, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3488, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3489, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3490, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3491, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3492, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3493, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3494, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3495, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3496, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3497, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3498, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3499, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 221055, + "nextSqrtPrice": "1163723433299076165172299", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3500, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 224575, + "nextSqrtPrice": "1387586523406046954089323", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3501, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3502, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3503, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3504, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3505, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3506, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3507, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3508, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3509, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3510, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3511, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3512, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3513, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3514, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3515, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -224577, + "nextSqrtPrice": "245220999439595", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3516, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -221057, + "nextSqrtPrice": "292393660161947", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3517, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3518, + "description": "In a ts_8 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3519, + "description": "In a ts_8 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3520, + "description": "In a ts_8 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 8, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3521, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3522, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3523, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3524, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3525, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3526, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3527, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3528, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3529, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3530, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3531, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3532, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3533, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3534, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3535, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3536, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3537, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3538, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3539, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3540, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3541, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3542, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3543, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3544, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3545, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3546, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3547, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3548, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "NumberDownCastError", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3549, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3550, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3551, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3552, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3553, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3554, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3555, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3556, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3557, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3558, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3559, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3560, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3561, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3562, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3563, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3564, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3565, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3566, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3567, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3568, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3569, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3570, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3571, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3572, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3573, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3574, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3575, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3576, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3577, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3578, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3579, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3580, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3581, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3582, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3583, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3584, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3585, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3586, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3587, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3588, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3589, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3590, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3591, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3592, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3593, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3594, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3595, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3596, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3597, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3598, + "description": "In a ts_128 pool with 2^110 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3599, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3600, + "description": "In a ts_128 pool with 2^110 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "1298074214633706907132624082305024", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3601, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3602, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3603, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3604, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3605, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3606, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3607, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3608, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3609, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3610, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3611, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3612, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3613, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3614, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3615, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3616, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3617, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3618, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3619, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3620, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3621, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3622, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3623, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3624, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3625, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3626, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3627, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3628, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3629, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3630, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3631, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3632, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3633, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3634, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3635, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3636, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3637, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3638, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3639, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000054211", + "amountB": "1000000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446743073709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3640, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1000000054211", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446745073709605827", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3641, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3642, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3643, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000001", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -1, + "nextSqrtPrice": "18446744072709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3644, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1000000001", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 0, + "nextSqrtPrice": "18446744074709551617", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3645, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3646, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3647, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3648, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3649, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3650, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3651, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3652, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3653, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3654, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3655, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3656, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3657, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4846783690399666109", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284238607773594639949474", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3658, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3659, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "MultiplicationShiftRightOverflow", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3660, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "4846820274568148671", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284248301377559607764254", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3661, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3662, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3663, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3664, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3665, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3666, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3667, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3668, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3669, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3670, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3671, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3672, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3673, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3674, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "4846783690399685038", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968180259636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3675, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "4846820274568167601", + "amountB": "1000000000", + "nextLiquidity": "18446744073709551616", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966180259636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3676, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "TokenMaxExceeded", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3677, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3678, + "description": "In a ts_128 pool with 2^64 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3679, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3680, + "description": "In a ts_128 pool with 2^64 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "18446744073709551616", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3681, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3682, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3683, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3684, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3685, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3686, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689790759043279699238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3687, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689782169108687699238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3688, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3689, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "3", + "amountB": "13507355532688697643", + "nextLiquidity": "4294967296", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3690, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443500, + "nextSqrtPrice": "78689786468370950995238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3691, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 443499, + "nextSqrtPrice": "78689786459781016403238871887", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3692, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "125003757729496876", + "nextLiquidity": "4294967296", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3693, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3694, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3695, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3696, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3697, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3698, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "3", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3699, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3700, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "3", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3701, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443501, + "nextSqrtPrice": "4324352163", + "nextFeeGrowthGlobal": "499845579489148928", + "nextProtocolFee": "0" + } + }, + { + "testId": 3702, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "3", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3703, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3704, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352636", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3705, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352399", + "nextFeeGrowthGlobal": "4294967296000000000", + "nextProtocolFee": "0" + } + }, + { + "testId": 3706, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "13507114839124405324", + "amountB": "3", + "nextLiquidity": "4294967296", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3707, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "125003756452732920", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3708, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -443500, + "nextSqrtPrice": "4324352400", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3709, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3710, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3711, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3712, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3713, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8952251454", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3714, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18969087788", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3715, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8952251454", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3716, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18969087788", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3717, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8952251454", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3718, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18969087788", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3719, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "8952251454", + "amountB": "2902467902", + "nextLiquidity": "4294967296", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3720, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "3502038289", + "amountB": "18969087788", + "nextLiquidity": "4294967296", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3721, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "811141420", + "nextLiquidity": "4294967296", + "nextTickIndex": -4187, + "nextSqrtPrice": "14962918198591332262", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3722, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "811141420", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 4186, + "nextSqrtPrice": "22741711369709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3723, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1303493149", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": -5302, + "nextSqrtPrice": "14151776777709551616", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3724, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1303493149", + "nextLiquidity": "4294967296", + "nextTickIndex": 5301, + "nextSqrtPrice": "24045204518553235921", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3725, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3726, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3727, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3728, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3729, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "236887", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3730, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733159311375032", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3731, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "236887", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3732, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733159311375032", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3733, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "236887", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3734, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "205", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223093, + "nextSqrtPrice": "1288538421853285039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3735, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "208", + "amountB": "1000000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 222959, + "nextSqrtPrice": "1279948487261285039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3736, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733159311375032", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3737, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "236887", + "amountB": "237229359010002", + "nextLiquidity": "4294967296", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3738, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223027, + "nextSqrtPrice": "1284247749524581039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3739, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1", + "amountB": "1000000000", + "nextLiquidity": "4294967296", + "nextTickIndex": 223026, + "nextSqrtPrice": "1284239159589989039615583", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3740, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "43820", + "amountB": "733159311375032", + "nextLiquidity": "4294967296", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3741, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3742, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3743, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3744, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3745, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733210918611959", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3746, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "236872", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3747, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733210918611959", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3748, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "236872", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3749, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "205", + "nextLiquidity": "4294967296", + "nextTickIndex": -223094, + "nextSqrtPrice": "264083989386607", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3750, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "236872", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3751, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733210918611959", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3752, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000000", + "amountB": "208", + "nextLiquidity": "4294967296", + "nextTickIndex": -222960, + "nextSqrtPrice": "265856298364822", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3753, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "0", + "nextLiquidity": "4294967296", + "nextTickIndex": -223028, + "nextSqrtPrice": "264966294118022", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3754, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "237226269993670", + "amountB": "236872", + "nextLiquidity": "4294967296", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3755, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "733210918611959", + "amountB": "43821", + "nextLiquidity": "4294967296", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3756, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "1000000000", + "amountB": "1", + "nextLiquidity": "4294967296", + "nextTickIndex": -223027, + "nextSqrtPrice": "264968066407178", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3757, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3758, + "description": "In a ts_128 pool with 2^32 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3759, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3760, + "description": "In a ts_128 pool with 2^32 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "4294967296", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3761, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3762, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3763, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3764, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3765, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3766, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3767, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3768, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3769, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3770, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3771, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 416767, + "nextSqrtPrice": "20676136195733368370761324026", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3772, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 443636, + "nextSqrtPrice": "79226673515401279992447579055", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3773, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3774, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3775, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3776, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near max tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3777, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3778, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3779, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3780, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3781, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3782, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3783, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3784, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3785, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3786, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3787, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -443637, + "nextSqrtPrice": "4295048016", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3788, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -416769, + "nextSqrtPrice": "16456912009", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3789, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3790, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3791, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3792, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at near min tick with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -443500, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3793, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3794, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3795, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3796, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3797, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3798, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3799, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3800, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3801, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3802, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3803, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -22529, + "nextSqrtPrice": "5980739354458315104", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3804, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 33791, + "nextSqrtPrice": "99918355755764668879", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3805, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3806, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3807, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3808, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 0 (p = 1) with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 0, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3809, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3810, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3811, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3812, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3813, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3814, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3815, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3816, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3817, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3818, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3819, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 191487, + "nextSqrtPrice": "265351115958282680265311", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3820, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 247807, + "nextSqrtPrice": "4433138719670925470028609", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3821, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3822, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3823, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3824, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick 223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": 223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3825, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3826, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1.8446744073709551615e+19 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3827, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1.8446744073709551615e+19 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3828, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1.8446744073709551615e+19 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "18446744073709551615", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3829, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3830, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+12 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3831, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+12 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3832, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+12 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3833, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3834, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 1e+9 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3835, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 1e+9 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -247809, + "nextSqrtPrice": "76754953001742", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3836, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 1e+9 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "1000000000", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": -191489, + "nextSqrtPrice": "1282321172269122", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3837, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenA to tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3838, + "description": "In a ts_128 pool with 0 liquidity, swap exactly 0 tokenB to tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": true, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3839, + "description": "In a ts_128 pool with 0 liquidity, swap tokenA to exactly 0 tokenB at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": true, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + }, + { + "testId": 3840, + "description": "In a ts_128 pool with 0 liquidity, swap tokenB to exactly 0 tokenA at tick -223027 with 0.00%/0 fee", + "tickSpacing": 128, + "feeRate": 0, + "protocolFeeRate": 0, + "liquidity": "0", + "currTickIndex": -223027, + "tradeAmount": "0", + "amountIsInput": false, + "aToB": false, + "expectation": { + "exception": "ZeroTradableAmount", + "amountA": "0", + "amountB": "0", + "nextLiquidity": "0", + "nextTickIndex": 0, + "nextSqrtPrice": "0", + "nextFeeGrowthGlobal": "0", + "nextProtocolFee": "0" + } + } +] diff --git a/programs/whirlpool/src/util/mod.rs b/programs/whirlpool/src/util/mod.rs new file mode 100644 index 0000000..0129c8d --- /dev/null +++ b/programs/whirlpool/src/util/mod.rs @@ -0,0 +1,12 @@ +pub mod swap_tick_sequence; +pub mod token; +pub mod util; + +pub use swap_tick_sequence::*; +pub use token::*; +pub use util::*; + +#[cfg(test)] +pub mod test_utils; +#[cfg(test)] +pub use test_utils::*; diff --git a/programs/whirlpool/src/util/swap_tick_sequence.rs b/programs/whirlpool/src/util/swap_tick_sequence.rs new file mode 100644 index 0000000..504c394 --- /dev/null +++ b/programs/whirlpool/src/util/swap_tick_sequence.rs @@ -0,0 +1,735 @@ +use crate::errors::ErrorCode; +use crate::state::*; +use std::cell::RefMut; + +pub struct SwapTickSequence<'info> { + arrays: Vec>, +} + +impl<'info> SwapTickSequence<'info> { + pub fn new( + ta0: RefMut<'info, TickArray>, + ta1: Option>, + ta2: Option>, + ) -> Self { + let mut vec = Vec::with_capacity(3); + vec.push(ta0); + if ta1.is_some() { + vec.push(ta1.unwrap()); + } + if ta2.is_some() { + vec.push(ta2.unwrap()); + } + Self { arrays: vec } + } + + /// Get the Tick object at the given tick-index & tick-spacing + /// + /// # Parameters + /// - `array_index` - the array index that the tick of this given tick-index would be stored in + /// - `tick_index` - the tick index the desired Tick object is stored in + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// + /// # Returns + /// - `&Tick`: A reference to the desired Tick object + /// - `TickArrayIndexOutofBounds` - The provided array-index is out of bounds + /// - `TickNotFound`: - The provided tick-index is not an initializable tick index in this Whirlpool w/ this tick-spacing. + pub fn get_tick( + &self, + array_index: usize, + tick_index: i32, + tick_spacing: u16, + ) -> Result<&Tick, ErrorCode> { + let array = self.arrays.get(array_index); + match array { + Some(array) => array.get_tick(tick_index, tick_spacing), + _ => Err(ErrorCode::TickArrayIndexOutofBounds), + } + } + + /// Updates the Tick object at the given tick-index & tick-spacing + /// + /// # Parameters + /// - `array_index` - the array index that the tick of this given tick-index would be stored in + /// - `tick_index` - the tick index the desired Tick object is stored in + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// - `update` - A reference to a TickUpdate object to update the Tick object at the given index + /// + /// # Errors + /// - `TickArrayIndexOutofBounds` - The provided array-index is out of bounds + /// - `TickNotFound`: - The provided tick-index is not an initializable tick index in this Whirlpool w/ this tick-spacing. + pub fn update_tick( + &mut self, + array_index: usize, + tick_index: i32, + tick_spacing: u16, + update: &TickUpdate, + ) -> Result<(), ErrorCode> { + let array = self.arrays.get_mut(array_index); + match array { + Some(array) => { + array.update_tick(tick_index, tick_spacing, update)?; + Ok(()) + } + _ => Err(ErrorCode::TickArrayIndexOutofBounds), + } + } + + pub fn get_tick_offset( + &self, + array_index: usize, + tick_index: i32, + tick_spacing: u16, + ) -> Result { + let array = self.arrays.get(array_index); + match array { + Some(array) => array.tick_offset(tick_index, tick_spacing), + _ => Err(ErrorCode::TickArrayIndexOutofBounds), + } + } + + /// Get the next initialized tick in the provided tick range + /// + /// # Parameters + /// - `tick_index` - the tick index to start searching from + /// - `tick_spacing` - A u8 integer of the tick spacing for this whirlpool + /// - `a_to_b` - If the trade is from a_to_b, the search will move to the left and the starting search tick is inclusive. + /// If the trade is from b_to_a, the search will move to the right and the starting search tick is not inclusive. + /// - `start_array_index` - + /// + /// # Returns + /// - `(usize, i32, &mut Tick)`: The array_index which the next initialized index was found, the next initialized tick-index & a mutable reference to that tick + /// + /// - `InvalidTickArraySequence`: - Unable to find the next initialized index with the provided tick-array sequence. + /// - Provided tick-arrays are not in sequential order to the trade direction. + pub fn get_next_initialized_tick_index( + &self, + tick_index: i32, + tick_spacing: u16, + a_to_b: bool, + start_array_index: usize, + ) -> Result<(usize, i32), ErrorCode> { + let ticks_in_array = TICK_ARRAY_SIZE * tick_spacing as i32; + let mut search_index = tick_index; + let mut array_index = start_array_index; + + // Keep looping the arrays until an initialized tick index in the subsequent tick-arrays found. + loop { + // If we get to the end of the array sequence and next_index is still not found, throw error + let next_array = match self.arrays.get(array_index) { + Some(array) => array, + None => return Err(ErrorCode::TickArraySequenceInvalidIndex), + }; + + let next_index = + next_array.get_next_init_tick_index(search_index, tick_spacing, a_to_b)?; + + match next_index { + Some(next_index) => { + return Ok((array_index, next_index)); + } + None => { + // If we are at the last valid tick array, return the min/max tick index + if a_to_b && next_array.is_min_tick_array() { + return Ok((array_index, MIN_TICK_INDEX)); + } else if !a_to_b && next_array.is_max_tick_array(tick_spacing) { + return Ok((array_index, MAX_TICK_INDEX)); + } + + // If we are at the last tick array in the sequencer, return the last tick + if array_index + 1 == self.arrays.len() { + if a_to_b { + return Ok((array_index, next_array.start_tick_index)); + } else { + let last_tick = next_array.start_tick_index + ticks_in_array - 1; + return Ok((array_index, last_tick)); + } + } + + // No initialized index found. Move the search-index to the 1st search position + // of the next array in sequence. + search_index = if a_to_b { + next_array.start_tick_index - 1 + } else { + next_array.start_tick_index + ticks_in_array - 1 + }; + + array_index += 1; + } + } + } + } +} + +#[cfg(test)] +mod swap_tick_sequence_tests { + use super::*; + use std::cell::RefCell; + + const TS_8: u16 = 8; + const TS_128: u16 = 128; + const LAST_TICK_OFFSET: usize = TICK_ARRAY_SIZE as usize - 1; + + fn build_tick_array( + start_tick_index: i32, + initialized_offsets: Vec, + ) -> RefCell { + let mut array = TickArray::default(); + array.start_tick_index = start_tick_index; + + for offset in initialized_offsets { + let mut new_tick = Tick::default(); + new_tick.initialized = true; + array.ticks[offset] = new_tick; + } + + RefCell::new(array) + } + + mod modify_ticks { + use super::*; + + #[test] + fn modify_tick_init_tick() { + let ta0 = build_tick_array(11264, vec![50]); + let ta1 = build_tick_array(0, vec![25, 71]); + let ta2 = build_tick_array(-11264, vec![25, 35, 56]); + let mut swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let initialized_ticks_offsets = [(0, 50), (1, 25), (1, 71), (2, 25), (2, 35), (2, 56)]; + + for init_tick_offset in initialized_ticks_offsets { + let array_index = init_tick_offset.0 as usize; + let tick_index = 11264 - array_index as i32 * TS_128 as i32 * TICK_ARRAY_SIZE + + init_tick_offset.1 * TS_128 as i32; + let result = swap_tick_sequence.get_tick(array_index, tick_index, TS_128); + assert_eq!(result.is_ok(), true); + assert_eq!(result.unwrap().initialized, true); + + let update_result = swap_tick_sequence.update_tick( + array_index, + tick_index, + TS_128, + &TickUpdate { + initialized: false, + liquidity_net: 1500, + ..Default::default() + }, + ); + assert_eq!(update_result.is_ok(), true); + + let get_updated_result = swap_tick_sequence + .get_tick(array_index, tick_index, TS_128) + .unwrap(); + let liq_net = get_updated_result.liquidity_net; + assert_eq!(liq_net, 1500); + } + } + + #[test] + fn modify_tick_uninitializable_tick() { + let ta0 = build_tick_array(9216, vec![50]); + let ta1 = build_tick_array(0, vec![25, 71]); + let ta2 = build_tick_array(-9216, vec![25, 35, 56]); + let mut swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let uninitializable_tick_indices = [(0, 9217), (1, 257), (2, -5341)]; + + for uninitializable_search_tick in uninitializable_tick_indices { + let result = swap_tick_sequence.get_tick( + uninitializable_search_tick.0, + uninitializable_search_tick.1, + TS_128, + ); + + assert_eq!(result.unwrap_err(), ErrorCode::TickNotFound); + + let update_result = swap_tick_sequence.update_tick( + uninitializable_search_tick.0, + uninitializable_search_tick.1, + TS_128, + &TickUpdate { + initialized: false, + liquidity_net: 1500, + ..Default::default() + }, + ); + assert_eq!(update_result.unwrap_err(), ErrorCode::TickNotFound); + } + } + + #[test] + fn modify_tick_uninitialized_tick() { + let ta0 = build_tick_array(9216, vec![50]); + let ta1 = build_tick_array(0, vec![25, 71]); + let ta2 = build_tick_array(-9216, vec![25, 35, 56]); + let mut swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let uninitialized_tick_indices = [(0, 13696), (1, 0), (1, 3072), (2, -3456)]; + + for uninitializable_search_tick in uninitialized_tick_indices { + let result = swap_tick_sequence.get_tick( + uninitializable_search_tick.0, + uninitializable_search_tick.1, + TS_128, + ); + + assert_eq!(result.unwrap().initialized, false); + + let update_result = swap_tick_sequence.update_tick( + uninitializable_search_tick.0, + uninitializable_search_tick.1, + TS_128, + &TickUpdate { + initialized: true, + liquidity_net: 1500, + ..Default::default() + }, + ); + assert_eq!(update_result.is_ok(), true); + + let get_updated_result = swap_tick_sequence + .get_tick( + uninitializable_search_tick.0, + uninitializable_search_tick.1, + TS_128, + ) + .unwrap(); + assert_eq!(get_updated_result.initialized, true); + let liq_net = get_updated_result.liquidity_net; + assert_eq!(liq_net, 1500); + } + } + + #[test] + fn cannot_modify_invalid_array_index() { + let ta0 = build_tick_array(9216, vec![50]); + let ta1 = build_tick_array(0, vec![25, 71]); + let ta2 = build_tick_array(-9216, vec![25, 35, 56]); + let mut swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let get_result = swap_tick_sequence.get_tick(3, 5000, TS_128); + assert_eq!( + get_result.unwrap_err(), + ErrorCode::TickArrayIndexOutofBounds + ); + + let update_result = swap_tick_sequence.update_tick( + 3, + 5000, + TS_128, + &TickUpdate { + ..Default::default() + }, + ); + assert_eq!( + update_result.unwrap_err(), + ErrorCode::TickArrayIndexOutofBounds + ); + } + } + + mod a_to_b { + use super::*; + + #[test] + /// In an a_to_b search, the search-range of a tick-array is between 0 & last-tick - 1 + fn search_range() { + let ta0 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let ta1 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let ta2 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + // Verify start range is ok at start-tick-index + let (start_range_array_index, start_range_result_index) = swap_tick_sequence + .get_next_initialized_tick_index(0, TS_128, true, 2) + .unwrap(); + assert_eq!(start_range_result_index, 0); + assert_eq!(start_range_array_index, 2); + + // Verify search is ok at the last tick-index in array + let last_tick_in_array = (TICK_ARRAY_SIZE as i32 * TS_128 as i32) - 1; + let expected_last_usable_tick_index = LAST_TICK_OFFSET as i32 * TS_128 as i32; + let (end_range_array_index, end_range_result_index) = swap_tick_sequence + .get_next_initialized_tick_index(last_tick_in_array, TS_128, true, 2) + .unwrap(); + assert_eq!(end_range_result_index, expected_last_usable_tick_index); + assert_eq!(end_range_array_index, 2); + } + + #[test] + /// On a b_to_a search where the search_index is within [-tickSpacing, 0) and search array begins at 0, correctly + /// uses 0 as next initialized. This test is shifted by TICK_ARRAY_SIZE * TS_128. + fn search_range_on_left() { + let ta0 = build_tick_array( + TICK_ARRAY_SIZE * TS_128 as i32, + vec![0, 1, LAST_TICK_OFFSET], + ); + let swap_tick_sequence = SwapTickSequence::new(ta0.borrow_mut(), None, None); + + // Verify start range is ok at start-tick-index + let (start_range_array_index, start_range_result_index) = swap_tick_sequence + .get_next_initialized_tick_index( + TICK_ARRAY_SIZE * (TS_128 as i32) - 40, + TS_128, + false, + 0, + ) + .unwrap(); + assert_eq!(start_range_array_index, 0); + assert_eq!(start_range_result_index, TICK_ARRAY_SIZE * TS_128 as i32); + } + + #[test] + #[should_panic(expected = "InvalidTickArraySequence")] + /// In an a_to_b search, search will panic if search index is on the last tick in array + 1 + fn range_panic_on_end_range_plus_one() { + let ta0 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let ta1 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let ta2 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let last_tick_in_array_plus_one = TICK_ARRAY_SIZE as i32 * TS_8 as i32; + let (_, _) = swap_tick_sequence + .get_next_initialized_tick_index(last_tick_in_array_plus_one, TS_8, true, 1) + .unwrap(); + } + + #[test] + #[should_panic(expected = "InvalidTickArraySequence")] + /// In an a_to_b search, search will panic if search index is on the first tick in array - 1 + fn range_panic_on_start_range_sub_one() { + let ta0 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let ta1 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let ta2 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let (_, _) = swap_tick_sequence + .get_next_initialized_tick_index(-1, TS_8, true, 2) + .unwrap(); + } + } + mod b_to_a { + use super::*; + + #[test] + /// In an b_to_a search, the search-range of a tick-array is between the last usable tick in the last array + /// & the last usable tick in this array minus one. + fn search_range() { + let ta0 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let swap_tick_sequence = SwapTickSequence::new(ta0.borrow_mut(), None, None); + + // Verify start range is ok at start-tick-index + let (start_range_array_index, start_range_result_index) = swap_tick_sequence + .get_next_initialized_tick_index(TS_8 as i32 * -1, TS_8, false, 0) + .unwrap(); + assert_eq!(start_range_result_index, 0); + assert_eq!(start_range_array_index, 0); + + // Verify search is ok at the last tick-index in array + let last_searchable_tick_in_array = LAST_TICK_OFFSET as i32 * TS_8 as i32 - 1; + let last_usable_tick_in_array = LAST_TICK_OFFSET as i32 * TS_8 as i32; + let (end_range_array_index, end_range_result_index) = swap_tick_sequence + .get_next_initialized_tick_index(last_searchable_tick_in_array, TS_8, false, 0) + .unwrap(); + assert_eq!(end_range_result_index, last_usable_tick_in_array); + assert_eq!(end_range_array_index, 0); + } + + #[test] + #[should_panic(expected = "InvalidTickArraySequence")] + /// In an b_to_a search, search will panic if search index is on the last usable tick + fn range_panic_on_end_range_plus_one() { + let ta0 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let swap_tick_sequence = SwapTickSequence::new(ta0.borrow_mut(), None, None); + + let last_searchable_tick_in_array_plus_one = LAST_TICK_OFFSET as i32 * TS_8 as i32; + let (_, _) = swap_tick_sequence + .get_next_initialized_tick_index( + last_searchable_tick_in_array_plus_one, + TS_8, + false, + 0, + ) + .unwrap(); + } + + #[test] + #[should_panic(expected = "InvalidTickArraySequence")] + /// In an b_to_a search, search will panic if search index is less than the last usable tick in the previous tick-array + fn range_panic_on_start_range_sub_one() { + let ta0 = build_tick_array(0, vec![0, LAST_TICK_OFFSET]); + let swap_tick_sequence = SwapTickSequence::new(ta0.borrow_mut(), None, None); + + let (_, _) = swap_tick_sequence + .get_next_initialized_tick_index(TS_8 as i32 * -1 - 1, TS_8, false, 0) + .unwrap(); + } + } + + mod tick_bound { + use super::*; + + /// SwapTickSequence will bound the ticks by tick-array, not max/min tick. This is to reduce duplicated responsibility + /// between thsi & the swap loop / compute_swap. + + #[test] + fn b_to_a_search_reaching_max_tick() { + let ta0 = build_tick_array(0, vec![]); + let ta1 = build_tick_array(0, vec![]); + let ta2 = build_tick_array(443520, vec![]); // Max(443636).div_floor(tick-spacing (8) * TA Size (72))* tick-spacing (8) * TA Size (72) + let swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let (array_index, index) = swap_tick_sequence + .get_next_initialized_tick_index(443521, TS_8, false, 2) + .unwrap(); + + assert_eq!(index, 443636); + assert_eq!(array_index, 2); + } + + #[test] + fn a_to_b_search_reaching_min_tick() { + let ta0 = build_tick_array(0, vec![]); + let ta1 = build_tick_array(0, vec![]); + let ta2 = build_tick_array(-444096, vec![]); // Min(-443636).div_ceil(tick-spacing (8) * TA Size (72)) * tick-spacing (8) * TA Size (72) + let swap_tick_sequence = SwapTickSequence::new( + ta2.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta0.borrow_mut()), + ); + + let (array_index, index) = swap_tick_sequence + .get_next_initialized_tick_index(-443521, TS_8, true, 0) + .unwrap(); + + assert_eq!(index, -443636); + assert_eq!(array_index, 0); + } + } + + #[test] + /// Search index on an initialized tick index will return that tick in a a_to_b search + /// Expect: + /// - The same tick will be returned if search index is an initialized tick + fn a_to_b_search_on_initialized_index() { + let ta0 = build_tick_array(9216, vec![]); + let ta1 = build_tick_array(0, vec![25, 71]); + let ta2 = build_tick_array(-9216, vec![25, 35, 56]); + let swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let (array_index, index) = swap_tick_sequence + .get_next_initialized_tick_index(9088, TS_128, true, 1) + .unwrap(); + assert_eq!(index, 9088); + assert_eq!(array_index, 1); + + let tick = swap_tick_sequence + .get_tick(array_index, index, TS_128) + .unwrap(); + assert_eq!(tick.initialized, true); + } + + #[test] + /// a-to-b search through the entire tick-array sequence + /// + /// Verifies: + /// - Search index will not return previous initialized indicies in a b_to_a search + /// - If the search reaches the end of the last tick array, return the first tick index of the last tick array + fn a_to_b_search_entire_range() { + let ta0 = build_tick_array(9216, vec![]); + let ta1 = build_tick_array(0, vec![25, 71]); + let ta2 = build_tick_array(-9216, vec![25, 35, 56]); + let swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let mut search_index = 18431; + let mut curr_array_index = 0; + + let expectation = [ + (9088, 1, true), + (3200, 1, true), + (-2048, 2, true), + (-4736, 2, true), + (-6016, 2, true), + (-9216, 2, false), + ]; + + for i in 0..expectation.len() { + let (array_index, index) = swap_tick_sequence + .get_next_initialized_tick_index(search_index, TS_128, true, curr_array_index) + .unwrap(); + + assert_eq!(index, expectation[i].0); + assert_eq!(array_index, expectation[i].1); + + let tick = swap_tick_sequence + .get_tick(array_index, index, TS_128) + .unwrap(); + assert_eq!(tick.initialized, expectation[i].2); + + // users on a_to_b search must manually decrement since a_to_b is inclusive of current-tick + search_index = index - 1; + curr_array_index = array_index; + } + } + + #[test] + /// b-to-a search through the entire tick-array sequence + /// + /// Verifies: + /// - Search index on an initialized tick index will not return that tick in a b_to_a search + /// - Search index will not return previous initialized indicies in a b_to_a search + /// - Search indicies within the shifted range (-tick-spacing prior to the start-tick) will + /// return a valid initialized tick + /// - If the search reaches the last tick array, return the last tick in the last tick array + fn b_to_a_search_entire_range() { + let ta0 = build_tick_array(0, vec![10, 25]); + let ta1 = build_tick_array(704, vec![]); + let ta2 = build_tick_array(1408, vec![10, 50, 25]); + let swap_tick_sequence = SwapTickSequence::new( + ta0.borrow_mut(), + Some(ta1.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let mut search_index = -7; + let mut curr_array_index = 0; + + let expectation = [ + (80, 0, true), + (200, 0, true), + (1488, 2, true), + (1608, 2, true), + (1808, 2, true), + (2111, 2, false), + ]; + + for i in 0..expectation.len() { + let (array_index, index) = swap_tick_sequence + .get_next_initialized_tick_index(search_index, TS_8, false, curr_array_index) + .unwrap(); + + assert_eq!(index, expectation[i].0); + assert_eq!(array_index, expectation[i].1); + + let mut tick_initialized = false; + if Tick::check_is_usable_tick(index, TS_8) { + tick_initialized = swap_tick_sequence + .get_tick(array_index, index, TS_8) + .unwrap() + .initialized; + }; + assert_eq!(tick_initialized, expectation[i].2); + + search_index = index; + curr_array_index = array_index; + } + } + + #[test] + #[should_panic(expected = "InvalidTickArraySequence")] + /// The starting point of a swap should always be contained within the first array + /// Expected: + /// - Panic on InvalidTickArraySequence on 1st array + fn array_0_out_of_sequence() { + let ta0 = build_tick_array(0, vec![10, 25]); + let ta1 = build_tick_array(720, vec![53, 71]); + let ta2 = build_tick_array(1440, vec![10, 50, 25]); + let swap_tick_sequence = SwapTickSequence::new( + ta1.borrow_mut(), + Some(ta0.borrow_mut()), + Some(ta2.borrow_mut()), + ); + + let mut search_index = -5; + let mut curr_array_index = 0; + + for _ in 0..10 { + let (array_index, index) = swap_tick_sequence + .get_next_initialized_tick_index(search_index, TS_8, false, curr_array_index) + .unwrap(); + + search_index = index; + curr_array_index = array_index; + } + } + + #[test] + #[should_panic(expected = "InvalidTickArraySequence")] + /// Search sequence will be successful up until invalid tick array sequence + /// + /// Expected: + /// - Does not panic when traversing tick-array 0 + /// - Panic on InvalidTickArraySequence when search-sequence is not in array 1's range + fn array_1_out_of_sequence() { + let ta0 = build_tick_array(-576, vec![10]); + let ta1 = build_tick_array(0, vec![10]); + let ta2 = build_tick_array(576, vec![25]); + let swap_tick_sequence = SwapTickSequence::new( + ta2.borrow_mut(), + Some(ta0.borrow_mut()), + Some(ta1.borrow_mut()), + ); + + let mut search_index = 1439; + let mut curr_array_index = 0; + let expectation = [(776, 0, true), (576, 0, false), (80, 0, true)]; + + for i in 0..expectation.len() { + let (array_index, index) = swap_tick_sequence + .get_next_initialized_tick_index(search_index, TS_8, true, curr_array_index) + .unwrap(); + + assert_eq!(index, expectation[i].0); + assert_eq!(array_index, expectation[i].1); + + let tick = swap_tick_sequence + .get_tick(array_index, index, TS_8) + .unwrap(); + assert_eq!(tick.initialized, expectation[i].2); + + search_index = index - 1; + curr_array_index = array_index; + } + } +} diff --git a/programs/whirlpool/src/util/test_utils/liquidity_test_fixture.rs b/programs/whirlpool/src/util/test_utils/liquidity_test_fixture.rs new file mode 100644 index 0000000..3db51c0 --- /dev/null +++ b/programs/whirlpool/src/util/test_utils/liquidity_test_fixture.rs @@ -0,0 +1,254 @@ +use crate::manager::liquidity_manager::ModifyLiquidityUpdate; +use crate::manager::tick_manager::next_tick_cross_update; +use crate::manager::whirlpool_manager::*; +use crate::math::{add_liquidity_delta, Q64_RESOLUTION}; +use crate::state::position_builder::PositionBuilder; +use crate::state::{ + tick::*, tick_builder::TickBuilder, whirlpool_builder::WhirlpoolBuilder, Whirlpool, +}; +use crate::state::{ + Position, PositionRewardInfo, PositionUpdate, WhirlpoolRewardInfo, NUM_REWARDS, +}; +use anchor_lang::prelude::*; + +const BELOW_LOWER_TICK_INDEX: i32 = -120; +const ABOVE_UPPER_TICK_INDEX: i32 = 120; + +pub enum CurrIndex { + Below, + Inside, + Above, +} + +pub enum TickLabel { + Upper, + Lower, +} + +pub enum Direction { + Left, + Right, +} + +// State for testing modifying liquidity in a single whirlpool position +pub struct LiquidityTestFixture { + pub whirlpool: Whirlpool, + pub position: Position, + pub tick_lower: Tick, + pub tick_upper: Tick, +} + +pub struct LiquidityTestFixtureInfo { + pub curr_index_loc: CurrIndex, + pub whirlpool_liquidity: u128, + pub position_liquidity: u128, + pub tick_lower_liquidity_gross: u128, + pub tick_upper_liquidity_gross: u128, + pub fee_growth_global_a: u128, + pub fee_growth_global_b: u128, + pub reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], +} + +impl LiquidityTestFixture { + pub fn new(info: LiquidityTestFixtureInfo) -> LiquidityTestFixture { + assert!(info.tick_lower_liquidity_gross < i64::MAX as u128); + assert!(info.tick_upper_liquidity_gross < i64::MAX as u128); + + // Tick's must have enough at least enough liquidity to support the position + assert!(info.tick_lower_liquidity_gross >= info.position_liquidity); + assert!(info.tick_upper_liquidity_gross >= info.position_liquidity); + + let curr_index = match info.curr_index_loc { + CurrIndex::Below => BELOW_LOWER_TICK_INDEX, + CurrIndex::Inside => 0, + CurrIndex::Above => ABOVE_UPPER_TICK_INDEX, + }; + + let whirlpool = WhirlpoolBuilder::new() + .tick_current_index(curr_index) + .liquidity(info.whirlpool_liquidity) + .reward_infos(info.reward_infos) + .fee_growth_global_a(info.fee_growth_global_a) + .fee_growth_global_b(info.fee_growth_global_b) + .build(); + + let tick_lower_initialized = info.tick_lower_liquidity_gross > 0; + let tick_upper_initialized = info.tick_upper_liquidity_gross > 0; + + LiquidityTestFixture { + whirlpool, + position: PositionBuilder::new(-100, 100) + .liquidity(info.position_liquidity) + .build(), + tick_lower: TickBuilder::default() + .initialized(tick_lower_initialized) + .liquidity_gross(info.tick_lower_liquidity_gross) + .liquidity_net(info.tick_lower_liquidity_gross as i128) + .build(), + tick_upper: TickBuilder::default() + .initialized(tick_upper_initialized) + .liquidity_gross(info.tick_upper_liquidity_gross) + .liquidity_net(-(info.tick_upper_liquidity_gross as i128)) + .build(), + } + } + + pub fn increment_whirlpool_fee_growths( + &mut self, + fee_growth_delta_a: u128, + fee_growth_delta_b: u128, + ) { + self.whirlpool.fee_growth_global_a = self + .whirlpool + .fee_growth_global_a + .wrapping_add(fee_growth_delta_a); + self.whirlpool.fee_growth_global_b = self + .whirlpool + .fee_growth_global_b + .wrapping_add(fee_growth_delta_b); + } + + pub fn increment_whirlpool_reward_growths_by_time(&mut self, seconds: u64) { + let next_timestamp = self.whirlpool.reward_last_updated_timestamp + seconds; + self.whirlpool.reward_infos = + next_whirlpool_reward_infos(&self.whirlpool, next_timestamp).unwrap(); + self.whirlpool.reward_last_updated_timestamp = next_timestamp; + } + + /// Simulates crossing a tick within the test fixture. + pub fn cross_tick(&mut self, tick_label: TickLabel, direction: Direction) { + let tick = match tick_label { + TickLabel::Lower => &mut self.tick_lower, + TickLabel::Upper => &mut self.tick_upper, + }; + let update = next_tick_cross_update( + tick, + self.whirlpool.fee_growth_global_a, + self.whirlpool.fee_growth_global_b, + &self.whirlpool.reward_infos, + ) + .unwrap(); + + tick.update(&update); + + self.whirlpool.liquidity = add_liquidity_delta( + self.whirlpool.liquidity, + match direction { + Direction::Left => -tick.liquidity_net, + Direction::Right => tick.liquidity_net, + }, + ) + .unwrap(); + + match tick_label { + TickLabel::Lower => match direction { + Direction::Right => self.whirlpool.tick_current_index = 0, + Direction::Left => self.whirlpool.tick_current_index = BELOW_LOWER_TICK_INDEX, + }, + TickLabel::Upper => match direction { + Direction::Left => self.whirlpool.tick_current_index = 0, + Direction::Right => self.whirlpool.tick_current_index = ABOVE_UPPER_TICK_INDEX, + }, + } + } + + pub fn apply_update( + &mut self, + update: &ModifyLiquidityUpdate, + reward_last_updated_timestamp: u64, + ) { + assert!(reward_last_updated_timestamp >= self.whirlpool.reward_last_updated_timestamp); + self.whirlpool.reward_last_updated_timestamp = reward_last_updated_timestamp; + self.whirlpool.liquidity = update.whirlpool_liquidity; + self.whirlpool.reward_infos = update.reward_infos; + self.tick_lower.update(&update.tick_lower_update); + self.tick_upper.update(&update.tick_upper_update); + self.position.update(&update.position_update); + } +} + +pub fn create_whirlpool_reward_infos( + emissions_per_second_x64: u128, + growth_global_x64: u128, +) -> [WhirlpoolRewardInfo; NUM_REWARDS] { + [ + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64, + growth_global_x64, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64, + growth_global_x64, + ..Default::default() + }, + WhirlpoolRewardInfo { + mint: Pubkey::new_unique(), + emissions_per_second_x64, + growth_global_x64, + ..Default::default() + }, + ] +} + +pub fn create_position_reward_infos( + growth_inside_checkpoint: u128, + amount_owed: u64, +) -> [PositionRewardInfo; NUM_REWARDS] { + [ + PositionRewardInfo { + growth_inside_checkpoint, + amount_owed, + }, + PositionRewardInfo { + growth_inside_checkpoint, + amount_owed, + }, + PositionRewardInfo { + growth_inside_checkpoint, + amount_owed, + }, + ] +} + +pub fn create_reward_growths(growth_global_x64: u128) -> [u128; NUM_REWARDS] { + [growth_global_x64, growth_global_x64, growth_global_x64] +} + +pub fn to_x64(n: u128) -> u128 { + n << Q64_RESOLUTION +} + +pub fn assert_whirlpool_reward_growths( + reward_infos: &[WhirlpoolRewardInfo; NUM_REWARDS], + expected_growth: u128, +) { + assert_eq!( + WhirlpoolRewardInfo::to_reward_growths(reward_infos), + create_reward_growths(expected_growth) + ) +} + +pub struct ModifyLiquidityExpectation { + pub whirlpool_liquidity: u128, + pub whirlpool_reward_growths: [u128; NUM_REWARDS], + pub position_update: PositionUpdate, + pub tick_lower_update: TickUpdate, + pub tick_upper_update: TickUpdate, +} + +pub fn assert_modify_liquidity( + update: &ModifyLiquidityUpdate, + expect: &ModifyLiquidityExpectation, +) { + assert_eq!(update.whirlpool_liquidity, expect.whirlpool_liquidity); + assert_eq!( + WhirlpoolRewardInfo::to_reward_growths(&update.reward_infos), + expect.whirlpool_reward_growths + ); + assert_eq!(update.tick_lower_update, expect.tick_lower_update); + assert_eq!(update.tick_upper_update, expect.tick_upper_update); + assert_eq!(update.position_update, expect.position_update); +} diff --git a/programs/whirlpool/src/util/test_utils/mod.rs b/programs/whirlpool/src/util/test_utils/mod.rs new file mode 100644 index 0000000..4ee10bd --- /dev/null +++ b/programs/whirlpool/src/util/test_utils/mod.rs @@ -0,0 +1,5 @@ +pub mod liquidity_test_fixture; +pub mod swap_test_fixture; + +pub use liquidity_test_fixture::*; +pub use swap_test_fixture::*; diff --git a/programs/whirlpool/src/util/test_utils/swap_test_fixture.rs b/programs/whirlpool/src/util/test_utils/swap_test_fixture.rs new file mode 100644 index 0000000..33b7bb8 --- /dev/null +++ b/programs/whirlpool/src/util/test_utils/swap_test_fixture.rs @@ -0,0 +1,236 @@ +use crate::errors::ErrorCode; +use crate::manager::swap_manager::*; +use crate::math::tick_math::*; +use crate::state::{ + tick::*, tick_builder::TickBuilder, whirlpool_builder::WhirlpoolBuilder, TickArray, Whirlpool, +}; +use crate::state::{WhirlpoolRewardInfo, NUM_REWARDS}; +use crate::util::SwapTickSequence; +use anchor_lang::prelude::*; +use std::cell::RefCell; + +pub const TS_8: u16 = 8; +pub const TS_128: u16 = 128; + +const NO_TICKS_VEC: &Vec = &vec![]; + +pub struct SwapTestFixture { + pub whirlpool: Whirlpool, + pub tick_arrays: Vec>, + pub trade_amount: u64, + pub sqrt_price_limit: u128, + pub amount_specified_is_input: bool, + pub a_to_b: bool, + pub reward_last_updated_timestamp: u64, +} + +#[derive(Default)] +pub struct TestTickInfo { + pub index: i32, + pub liquidity_net: i128, + pub fee_growth_outside_a: u128, + pub fee_growth_outside_b: u128, + pub reward_growths_outside: [u128; NUM_REWARDS], +} + +pub struct SwapTestFixtureInfo<'info> { + pub tick_spacing: u16, + pub liquidity: u128, + pub curr_tick_index: i32, + pub start_tick_index: i32, + pub trade_amount: u64, + pub sqrt_price_limit: u128, + pub amount_specified_is_input: bool, + pub a_to_b: bool, + pub reward_last_updated_timestamp: u64, + pub reward_infos: [WhirlpoolRewardInfo; NUM_REWARDS], + pub fee_growth_global_a: u128, + pub fee_growth_global_b: u128, + pub array_1_ticks: &'info Vec, + pub array_2_ticks: Option<&'info Vec>, + pub array_3_ticks: Option<&'info Vec>, + pub fee_rate: u16, + pub protocol_fee_rate: u16, +} + +impl<'info> Default for SwapTestFixtureInfo<'info> { + fn default() -> Self { + SwapTestFixtureInfo { + tick_spacing: TS_128, + liquidity: 0, + curr_tick_index: 0, + start_tick_index: 0, + trade_amount: 0, + sqrt_price_limit: 0, + amount_specified_is_input: false, + a_to_b: false, + reward_last_updated_timestamp: 0, + reward_infos: [ + WhirlpoolRewardInfo::default(), + WhirlpoolRewardInfo::default(), + WhirlpoolRewardInfo::default(), + ], + fee_growth_global_a: 0, + fee_growth_global_b: 0, + array_1_ticks: &NO_TICKS_VEC, + array_2_ticks: None, + array_3_ticks: None, + fee_rate: 0, + protocol_fee_rate: 0, + } + } +} + +pub struct SwapTestExpectation { + pub traded_amount_a: u64, + pub traded_amount_b: u64, + pub end_tick_index: i32, + pub end_liquidity: u128, + pub end_reward_growths: [u128; NUM_REWARDS], +} + +#[derive(Default)] +pub struct TickExpectation { + pub fee_growth_outside_a: u128, + pub fee_growth_outside_b: u128, + pub reward_growths_outside: [u128; NUM_REWARDS], +} + +pub fn assert_swap(swap_update: &PostSwapUpdate, expect: &SwapTestExpectation) { + assert_eq!(swap_update.amount_a, expect.traded_amount_a); + assert_eq!(swap_update.amount_b, expect.traded_amount_b); + assert_eq!(swap_update.next_tick_index, expect.end_tick_index); + assert_eq!(swap_update.next_liquidity, expect.end_liquidity); + assert_eq!( + WhirlpoolRewardInfo::to_reward_growths(&swap_update.next_reward_infos), + expect.end_reward_growths + ); +} + +pub fn assert_swap_tick_state(tick: &Tick, expect: &TickExpectation) { + assert_eq!({ tick.fee_growth_outside_a }, expect.fee_growth_outside_a); + assert_eq!({ tick.fee_growth_outside_b }, expect.fee_growth_outside_b); + assert_eq!( + { tick.reward_growths_outside }, + expect.reward_growths_outside + ); +} + +pub fn build_filled_tick_array(start_index: i32, tick_spacing: u16) -> Vec { + let mut array_ticks: Vec = vec![]; + for n in 0..TICK_ARRAY_SIZE { + let index = start_index + n * tick_spacing as i32; + if index >= MIN_TICK_INDEX && index < MAX_TICK_INDEX { + array_ticks.push(TestTickInfo { + index, + liquidity_net: -5, + ..Default::default() + }); + } + } + array_ticks +} + +impl SwapTestFixture { + pub fn new<'info>(info: SwapTestFixtureInfo) -> SwapTestFixture { + let whirlpool = WhirlpoolBuilder::new() + .liquidity(info.liquidity) + .sqrt_price(sqrt_price_from_tick_index(info.curr_tick_index)) + .tick_spacing(info.tick_spacing) + .tick_current_index(info.curr_tick_index) + .reward_last_updated_timestamp(info.reward_last_updated_timestamp) + .reward_infos(info.reward_infos) + .fee_growth_global_a(info.fee_growth_global_a) + .fee_growth_global_b(info.fee_growth_global_b) + .fee_rate(info.fee_rate) + .protocol_fee_rate(info.protocol_fee_rate) + .build(); + + let array_ticks: Vec>> = vec![ + Some(&info.array_1_ticks), + info.array_2_ticks, + info.array_3_ticks, + ]; + + let mut ref_mut_tick_arrays = Vec::with_capacity(3); + let direction: i32 = if info.a_to_b { -1 } else { 1 }; + let mut array_index = 0; + + for array in array_ticks.iter() { + let array_start_tick_index = info.start_tick_index + + info.tick_spacing as i32 * TICK_ARRAY_SIZE * array_index * direction; + array_index += 1; + + let mut new_ta = TickArray { + start_tick_index: array_start_tick_index, + ticks: [Tick::default(); TICK_ARRAY_SIZE_USIZE], + whirlpool: Pubkey::default(), + }; + + if array.is_none() { + ref_mut_tick_arrays.push(RefCell::new(new_ta)); + continue; + } + + let tick_array = array.unwrap(); + + for tick in tick_array { + let update = TickUpdate::from( + &TickBuilder::default() + .initialized(true) + .liquidity_net(tick.liquidity_net) + .fee_growth_outside_a(tick.fee_growth_outside_a) + .fee_growth_outside_b(tick.fee_growth_outside_b) + .reward_growths_outside(tick.reward_growths_outside) + .build(), + ); + let update_result = new_ta.update_tick(tick.index, info.tick_spacing, &update); + if update_result.is_err() { + panic!("Failed to set tick {}", tick.index); + } + } + + ref_mut_tick_arrays.push(RefCell::new(new_ta)); + } + + SwapTestFixture { + whirlpool, + tick_arrays: ref_mut_tick_arrays, + + trade_amount: info.trade_amount, + sqrt_price_limit: info.sqrt_price_limit, + amount_specified_is_input: info.amount_specified_is_input, + a_to_b: info.a_to_b, + reward_last_updated_timestamp: info.reward_last_updated_timestamp, + } + } + + pub fn run(&self, tick_sequence: &mut SwapTickSequence, next_timestamp: u64) -> PostSwapUpdate { + swap( + &self.whirlpool, + tick_sequence, + self.trade_amount, + self.sqrt_price_limit, + self.amount_specified_is_input, + self.a_to_b, + next_timestamp, + ) + .unwrap() + } + + pub fn eval( + &self, + tick_sequence: &mut SwapTickSequence, + next_timestamp: u64, + ) -> Result { + swap( + &self.whirlpool, + tick_sequence, + self.trade_amount, + self.sqrt_price_limit, + self.amount_specified_is_input, + self.a_to_b, + next_timestamp, + ) + } +} diff --git a/programs/whirlpool/src/util/token.rs b/programs/whirlpool/src/util/token.rs new file mode 100644 index 0000000..95a1311 --- /dev/null +++ b/programs/whirlpool/src/util/token.rs @@ -0,0 +1,214 @@ +use crate::state::Whirlpool; +use anchor_lang::prelude::*; +use anchor_spl::token::{self, Mint, Token, TokenAccount, Transfer}; +use mpl_token_metadata::instruction::create_metadata_accounts_v2; +use solana_program::program::invoke_signed; +use spl_token::instruction::{burn_checked, close_account, mint_to, set_authority, AuthorityType}; + +pub fn transfer_from_owner_to_vault<'info>( + position_authority: &Signer<'info>, + token_owner_account: &Account<'info, TokenAccount>, + token_vault: &Account<'info, TokenAccount>, + token_program: &Program<'info, Token>, + amount: u64, +) -> Result<(), ProgramError> { + token::transfer( + CpiContext::new( + token_program.to_account_info().clone(), + Transfer { + from: token_owner_account.to_account_info().clone(), + to: token_vault.to_account_info().clone(), + authority: position_authority.to_account_info().clone(), + }, + ), + amount, + ) +} + +pub fn transfer_from_vault_to_owner<'info>( + whirlpool: &Account<'info, Whirlpool>, + token_vault: &Account<'info, TokenAccount>, + token_owner_account: &Account<'info, TokenAccount>, + token_program: &Program<'info, Token>, + amount: u64, +) -> Result<(), ProgramError> { + token::transfer( + CpiContext::new_with_signer( + token_program.to_account_info().clone(), + Transfer { + from: token_vault.to_account_info().clone(), + to: token_owner_account.to_account_info().clone(), + authority: whirlpool.to_account_info().clone(), + }, + &[&whirlpool.seeds()], + ), + amount, + ) +} + +pub fn burn_and_close_user_position_token<'info>( + token_authority: &Signer<'info>, + receiver: &UncheckedAccount<'info>, + position_mint: &Account<'info, Mint>, + position_token_account: &Account<'info, TokenAccount>, + token_program: &Program<'info, Token>, +) -> ProgramResult { + // Burn a single token in user account + invoke_signed( + &burn_checked( + token_program.key, + position_token_account.to_account_info().key, + position_mint.to_account_info().key, + token_authority.key, + &[], + 1, + position_mint.decimals, + )?, + &[ + token_program.to_account_info().clone(), + position_token_account.to_account_info().clone(), + position_mint.to_account_info().clone(), + token_authority.to_account_info().clone(), + ], + &[], + )?; + + // Close user account + invoke_signed( + &close_account( + token_program.key, + position_token_account.to_account_info().key, + receiver.key, + token_authority.key, + &[], + )?, + &[ + token_program.to_account_info().clone(), + position_token_account.to_account_info().clone(), + receiver.to_account_info().clone(), + token_authority.to_account_info().clone(), + ], + &[], + ) +} + +pub fn mint_position_token_and_remove_authority<'info>( + whirlpool: &Account<'info, Whirlpool>, + position_mint: &Account<'info, Mint>, + position_token_account: &Account<'info, TokenAccount>, + token_program: &Program<'info, Token>, +) -> ProgramResult { + mint_position_token( + whirlpool, + position_mint, + position_token_account, + token_program, + )?; + remove_position_token_mint_authority(whirlpool, position_mint, token_program) +} + +const WP_METADATA_NAME: &str = "Orca Whirlpool Position"; +const WP_METADATA_SYMBOL: &str = "OWP"; +const WP_METADATA_URI: &str = "https://arweave.net/KZlsubXZyzeSYi2wJhyL7SY-DAot_OXhfWSYQGLmmOc"; + +pub fn mint_position_token_with_metadata_and_remove_authority<'info>( + whirlpool: &Account<'info, Whirlpool>, + position_mint: &Account<'info, Mint>, + position_token_account: &Account<'info, TokenAccount>, + position_metadata_account: &UncheckedAccount<'info>, + metadata_update_auth: &UncheckedAccount<'info>, + funder: &Signer<'info>, + metadata_program: &UncheckedAccount<'info>, + token_program: &Program<'info, Token>, + system_program: &Program<'info, System>, + rent: &Sysvar<'info, Rent>, +) -> ProgramResult { + mint_position_token( + whirlpool, + position_mint, + position_token_account, + token_program, + )?; + + let metadata_mint_auth_account = whirlpool; + invoke_signed( + &create_metadata_accounts_v2( + metadata_program.key(), + position_metadata_account.key(), + position_mint.key(), + metadata_mint_auth_account.key(), + funder.key(), + metadata_update_auth.key(), + WP_METADATA_NAME.to_string(), + WP_METADATA_SYMBOL.to_string(), + WP_METADATA_URI.to_string(), + None, + 0, + false, + true, + None, + None, + ), + &[ + position_metadata_account.to_account_info(), + position_mint.to_account_info(), + metadata_mint_auth_account.to_account_info(), + metadata_update_auth.to_account_info(), + funder.to_account_info(), + metadata_program.to_account_info(), + system_program.to_account_info(), + rent.to_account_info(), + ], + &[&metadata_mint_auth_account.seeds()], + )?; + + remove_position_token_mint_authority(whirlpool, position_mint, token_program) +} + +fn mint_position_token<'info>( + whirlpool: &Account<'info, Whirlpool>, + position_mint: &Account<'info, Mint>, + position_token_account: &Account<'info, TokenAccount>, + token_program: &Program<'info, Token>, +) -> ProgramResult { + invoke_signed( + &mint_to( + token_program.key, + position_mint.to_account_info().key, + position_token_account.to_account_info().key, + whirlpool.to_account_info().key, + &[whirlpool.to_account_info().key], + 1, + )?, + &[ + position_mint.to_account_info().clone(), + position_token_account.to_account_info().clone(), + whirlpool.to_account_info().clone(), + token_program.to_account_info().clone(), + ], + &[&whirlpool.seeds()], + ) +} + +fn remove_position_token_mint_authority<'info>( + whirlpool: &Account<'info, Whirlpool>, + position_mint: &Account<'info, Mint>, + token_program: &Program<'info, Token>, +) -> ProgramResult { + invoke_signed( + &set_authority( + token_program.key, + position_mint.to_account_info().key, + Option::None, + AuthorityType::MintTokens, + whirlpool.to_account_info().key, + &[whirlpool.to_account_info().key], + )?, + &[ + position_mint.to_account_info().clone(), + whirlpool.to_account_info().clone(), + token_program.to_account_info().clone(), + ], + &[&whirlpool.seeds()], + ) +} diff --git a/programs/whirlpool/src/util/util.rs b/programs/whirlpool/src/util/util.rs new file mode 100644 index 0000000..06d99f5 --- /dev/null +++ b/programs/whirlpool/src/util/util.rs @@ -0,0 +1,44 @@ +use anchor_lang::{ + prelude::{AccountInfo, ProgramError, Pubkey, Signer}, + ToAccountInfo, +}; +use anchor_spl::token::TokenAccount; +use solana_program::program_option::COption; +use std::convert::TryFrom; + +use crate::errors::ErrorCode; + +pub fn verify_position_authority<'info>( + position_token_account: &TokenAccount, + position_authority: &Signer<'info>, +) -> Result<(), ProgramError> { + // Check token authority using validate_owner method... + match position_token_account.delegate { + COption::Some(ref delegate) if position_authority.key == delegate => { + validate_owner(delegate, &position_authority.to_account_info())?; + if position_token_account.delegated_amount != 1 { + return Err(ErrorCode::InvalidPositionTokenAmount.into()); + } + } + _ => validate_owner( + &position_token_account.owner, + &position_authority.to_account_info(), + )?, + }; + Ok(()) +} + +fn validate_owner( + expected_owner: &Pubkey, + owner_account_info: &AccountInfo, +) -> Result<(), ProgramError> { + if expected_owner != owner_account_info.key || !owner_account_info.is_signer { + return Err(ErrorCode::MissingOrInvalidDelegate.into()); + } + + Ok(()) +} + +pub fn to_timestamp_u64(t: i64) -> Result { + u64::try_from(t).or(Err(ErrorCode::InvalidTimestampConversion)) +} diff --git a/scripts/calcRentExempt.ts b/scripts/calcRentExempt.ts new file mode 100644 index 0000000..deb91f7 --- /dev/null +++ b/scripts/calcRentExempt.ts @@ -0,0 +1,53 @@ +import * as anchor from "@project-serum/anchor"; +import { readFile } from "mz/fs"; +import Decimal from "decimal.js"; +import { Keypair } from "@solana/web3.js"; + +const toBuffer = (arr: Buffer | Uint8Array | Array): Buffer => { + if (arr instanceof Buffer) { + return arr; + } else if (arr instanceof Uint8Array) { + return Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength); + } else { + return Buffer.from(arr); + } +}; + +async function getKeyPair(keyPath: string): Promise { + const buffer = await readFile(keyPath); + let data = JSON.parse(buffer.toString()); + return Keypair.fromSecretKey(toBuffer(data)); +} + +async function run() { + // https://api.mainnet-beta.solana.com + const wallet = new anchor.Wallet( + await getKeyPair("/Users/ottocheung/dev/solana/pub.json") + ); + const connection = new anchor.web3.Connection( + "https://api.mainnet-beta.solana.com" + ); + const provider = new anchor.Provider( + connection, + wallet, + anchor.Provider.defaultOptions() + ); + + const sizeInBytes = [ + 1024, 5000, 10000, 50000, 1000000, 3000000, 5000000, 10000000, + ]; + const solPrice = 160; + sizeInBytes.forEach(async (size) => { + const result = await provider.connection.getMinimumBalanceForRentExemption( + size + ); + const sol = new Decimal(result).mul(0.000000001); + console.log( + `size - ${size} lamports - ${result} SOL- ${sol} price - ${sol.mul( + solPrice + )}` + ); + }); +} + +run(); diff --git a/scripts/expLogTestCaseConversion.ts b/scripts/expLogTestCaseConversion.ts new file mode 100644 index 0000000..7530f40 --- /dev/null +++ b/scripts/expLogTestCaseConversion.ts @@ -0,0 +1,15 @@ +import Decimal from "decimal.js"; +Decimal.set({ precision: 40, rounding: 4 }); + +const x64 = new Decimal(2).pow(64); + +const number = new Decimal(1).mul(x64); +console.log(`number - ${number}`); + +const exp = new Decimal(1.0001).sqrt().pow(1).mul(x64); +console.log(`exp - ${exp.toFixed(0, 1)}`); + +const log = new Decimal(18445821805675392311) + .div(x64) + .log(new Decimal(1.0001).sqrt()); +console.log(`log - ${log.toString()}`); diff --git a/scripts/genExpBitConstants.ts b/scripts/genExpBitConstants.ts new file mode 100644 index 0000000..aa0fd8d --- /dev/null +++ b/scripts/genExpBitConstants.ts @@ -0,0 +1,68 @@ +import Decimal from "decimal.js"; +Decimal.set({ precision: 40, rounding: 4 }); + +/** + * This script is to generate the magic numbers & unit tests needed for the exponent function + * in Whirlpools. + * + * Explanation on what magic numbers are: + * https://www.notion.so/orcaso/Fixed-Point-Arithmetic-in-Whirlpools-63f9817a852b4029a6eb15dc755c7baf#5df2cfe5d62b4b0aa7e58f5f381c2d55 + */ + +const x32 = new Decimal(2).pow(32); +const x64 = new Decimal(2).pow(64); +const x128 = new Decimal(2).pow(128); +const b = new Decimal("1.0001"); +// Qm.n = Q32.64 +const n = 64; + +console.log( + `Printing bit constants for whirlpool exponent of base ${b.toDecimalPlaces( + 4 + )}` +); +console.log(``); +console.log(`1.0001 x64 const - ${b.mul(x64).toFixed(0, 1)}`); +console.log(``); + +console.log(`With a maximum tick of +/-443636, we'll need 19 bit constants:`); + +for (let j = 0; j <= 18; j++) { + const power = new Decimal(2).pow(j - 1); + const sqrtBPower = b.pow(power); + const iSqrtBPower = new Decimal(1).div(sqrtBPower).mul(x64); + console.log(`${iSqrtBPower.toFixed(0, 1)}`); +} + +const genUnitTestCases = (cases: number[]) => { + console.log(`tick | positive index result | negative index result`); + for (const tick of cases) { + const jsResult = new Decimal(b) + .pow(tick) + .sqrt() + .mul(new Decimal(2).pow(n)) + .toFixed(0, 1); + const njsResult = new Decimal(b) + .pow(-tick) + .sqrt() + .mul(new Decimal(2).pow(n)) + .toFixed(0, 1); + + console.log(tick + " - " + jsResult + " , " + njsResult); + } +}; + +let bitGroup = [ + 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, + 32768, 65536, 131072, 262144, 524288, +]; +let randGroup = [2493, 23750, 395, 129, 39502, 395730, 245847, 120821].sort( + (n1, n2) => n1 - n2 +); + +console.log(" "); +console.log("Printing unit test cases for binary fraction bit cases:"); +genUnitTestCases(bitGroup); +console.log(" "); +console.log("Printing unit test cases for random values:"); +genUnitTestCases(randGroup); diff --git a/scripts/genPositiveExpBitConstants.ts b/scripts/genPositiveExpBitConstants.ts new file mode 100644 index 0000000..40b6fc0 --- /dev/null +++ b/scripts/genPositiveExpBitConstants.ts @@ -0,0 +1,17 @@ +import Decimal from "decimal.js"; +Decimal.set({ toExpPos: 100, toExpNeg: -100, precision: 100 }) + +const b = new Decimal(1.0001); + +const targetBitShift = 64; +const resolution = Decimal.pow(2, targetBitShift); + +const results = []; +for (let j = 0; j < 19; j++) { + // Calculate target price + const index = Decimal.pow(2, j); + console.log("index", index); + const rawPrice = b.pow(index.div(2)); + const targetPrice = rawPrice.mul(Decimal.pow(2, 96)).floor(); + console.log("targetPrice", targetPrice); +} diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000..d4804f9 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,16 @@ +{ + "name": "scripts", + "version": "1.0.0", + "dependencies": { + "@project-serum/anchor": "^0.20.1", + "@solana/spl-token": "^0.1.8", + "@orca-so/whirlpool-client-sdk": "0.0.7" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/mz": "^2.7.3", + "chai": "^4.3.4", + "mocha": "^9.0.3", + "mz": "^2.7.0" + } +} diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json new file mode 100644 index 0000000..8b05245 --- /dev/null +++ b/scripts/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "composite": true, + "target": "es6", + "module": "commonjs", + "allowJs": false, + "declaration": true, + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true + }, + "references": [ + { + "path": "../sdk/src" + } + ] +} diff --git a/scripts/whirlpoolNft.json b/scripts/whirlpoolNft.json new file mode 100644 index 0000000..6a3d0fd --- /dev/null +++ b/scripts/whirlpoolNft.json @@ -0,0 +1,11 @@ +{ + "name": "Orca Whirlpool Position", + "symbol": "OWP", + "description": "Orca Whirlpool Position", + "image": "data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 581.4 581.4' width='120px' height='120px'%3e%3cdefs%3e%3cstyle%3e.cls-1%7bfill:%23ffd15c;%7d%3c/style%3e%3c/defs%3e%3cg id='Layer_3' data-name='Layer 3'%3e%3cpath class='cls-1' d='M523.54,249.16a233.55,233.55,0,0,0-6.7-41.53,222.48,222.48,0,0,0-35.59-75.46,219.47,219.47,0,0,0-27.72-31.06A222.1,222.1,0,0,0,420.62,76,236.75,236.75,0,0,0,384,57.44a260.8,260.8,0,0,0-38.87-12.08,304.15,304.15,0,0,0-80-6.79,4,4,0,0,0,0,8c27.6,1.25,53.31,5.45,76.45,12.49a246,246,0,0,1,35.68,13.78,225.16,225.16,0,0,1,32.68,19.26,209.66,209.66,0,0,1,28.49,24.51,197.65,197.65,0,0,1,40.51,62A199.88,199.88,0,0,1,489.64,214a205.08,205.08,0,0,1,4.22,36.61,218.73,218.73,0,0,1-2.25,36.81A194,194,0,0,1,468.46,356a178.27,178.27,0,0,1-20.76,29.22,167.18,167.18,0,0,1-26.15,24.12,177.22,177.22,0,0,1-64.3,29.73,208.44,208.44,0,0,1-35.61,5.42c-6.45.43-12.39.61-18.26.53-1,0-1.89,0-2.79-.05l-1.47,0-1.34-.07c-.95,0-1.9-.09-2.92-.17-2.93-.2-5.91-.57-8.39-.9a125,125,0,0,1-61.23-26.55,122.38,122.38,0,0,1-38.44-53.58,106.39,106.39,0,0,1-6.14-31.94c-.13-3-.06-5.92,0-8.19s.26-4.91.6-8.2a106.41,106.41,0,0,1,3-16,96.59,96.59,0,0,1,13-28.91A92.54,92.54,0,0,1,219,247.72a102.29,102.29,0,0,1,28.35-14.82,120.85,120.85,0,0,1,32.37-6.14c2.39-.15,5.12-.22,8.35-.22a43.55,43.55,0,0,1,6.33.5,27.2,27.2,0,0,1,9.92,3.39,18.74,18.74,0,0,1,6.23,6,19.74,19.74,0,0,1,2.91,8.37,20.74,20.74,0,0,1-.92,9,19.24,19.24,0,0,1-1.81,3.88,17.87,17.87,0,0,1-2.62,3.24,18.58,18.58,0,0,1-7.5,4.38,27.88,27.88,0,0,1-5.14,1.14l-.72.08c-.24,0-.48.06-.71.07l-1.57.11-4.53.1a91.91,91.91,0,0,0-13.33,1.32A79.66,79.66,0,0,0,261,271.79a68.1,68.1,0,0,0-25.36,16.26,64.19,64.19,0,0,0-15.72,26.82,66.54,66.54,0,0,0,10.52,58.55,68.6,68.6,0,0,0,22.74,19.51,78.85,78.85,0,0,0,26.66,8.55,94.71,94.71,0,0,0,13,.94h1.6l1.39,0c1,0,1.93,0,2.84-.07,1.87-.05,3.79-.14,5.69-.26a167.14,167.14,0,0,0,45-9A148.35,148.35,0,0,0,390.39,371,140,140,0,0,0,441.5,293.6,155.89,155.89,0,0,0,446,247.79a162,162,0,0,0-8.29-44.93,152.92,152.92,0,0,0-21-40.87,155.5,155.5,0,0,0-32-32.74A167,167,0,0,0,301.71,96.4a185.25,185.25,0,0,0-22.24-1.11c-7.17.09-14.4.49-21.51,1.2a239.16,239.16,0,0,0-42.29,8.1,225.88,225.88,0,0,0-76.51,38.84,211.35,211.35,0,0,0-55.49,65.3,219.75,219.75,0,0,0-25.05,81.15A247.29,247.29,0,0,0,57.84,332a234.14,234.14,0,0,0,6.66,41.54A221.33,221.33,0,0,0,100.17,449,217.9,217.9,0,0,0,128,480,220.46,220.46,0,0,0,160.85,505a244.85,244.85,0,0,0,75.4,30.85,295.93,295.93,0,0,0,66,7.27q7,0,14.07-.31a4,4,0,0,0,0-8c-27.43-1.23-53.14-5.48-76.39-12.62-6.29-1.94-12.4-4.05-18.14-6.27-5.94-2.32-11.84-4.9-17.54-7.66A223.72,223.72,0,0,1,171.58,489a200.79,200.79,0,0,1-51.82-53.66,194.09,194.09,0,0,1-28.09-68.13,206.75,206.75,0,0,1-4.18-36.61,218.06,218.06,0,0,1,2.28-36.77,185.5,185.5,0,0,1,23.84-68.1,178.87,178.87,0,0,1,48-52.74,189,189,0,0,1,64.53-30.34,198.5,198.5,0,0,1,35.38-5.81c5.93-.44,12-.62,17.91-.53a141.29,141.29,0,0,1,17.22,1.33c23.12,3.11,44.43,12,61.64,25.75a111.63,111.63,0,0,1,37,53.48,116.89,116.89,0,0,1,5.49,32.61A110.59,110.59,0,0,1,397.11,282,96.37,96.37,0,0,1,384,310.82a93.81,93.81,0,0,1-21.79,22.79,103.63,103.63,0,0,1-28.39,14.88,120,120,0,0,1-32.31,6.19c-1.4.08-2.8.13-4.23.16-.61,0-1.21,0-1.82,0h-2.27a48.07,48.07,0,0,1-6.6-.5A31.48,31.48,0,0,1,275.78,351a20.8,20.8,0,0,1-7-6,19,19,0,0,1-3.41-7.94,18.61,18.61,0,0,1,.46-8.53,16.47,16.47,0,0,1,4.08-6.92,20.27,20.27,0,0,1,7.66-4.76,31.63,31.63,0,0,1,5.38-1.43,45.37,45.37,0,0,1,6.31-.6l5.28-.11h.18l3.31-.23c.85-.06,1.7-.16,2.55-.26l.95-.11a76.87,76.87,0,0,0,14-3.15A65.75,65.75,0,0,0,351.41,283,67.38,67.38,0,0,0,358,269.07,68.91,68.91,0,0,0,361,239.13a67.56,67.56,0,0,0-10.24-28.54,66,66,0,0,0-22-21.15A74.29,74.29,0,0,0,301.6,180a92,92,0,0,0-13.36-1c-4.5,0-8,.13-11.37.36a167.85,167.85,0,0,0-45,8.94,147.55,147.55,0,0,0-41.19,22,139.57,139.57,0,0,0-51,77.56,152.89,152.89,0,0,0-3.93,22.9c-.39,4.39-.61,8-.67,11.48-.09,4.46,0,8.13.16,11.54a151.39,151.39,0,0,0,9.4,45.25,159.53,159.53,0,0,0,21.92,40.09,169,169,0,0,0,70.93,54.75,166.11,166.11,0,0,0,43.7,11.25c4.51.48,8,.75,11.18.88,1.44.08,2.87.11,4.25.14l1.37,0h1.71c1.32,0,2.67,0,3.87,0,6.76-.09,13.92-.49,21.29-1.18a248.58,248.58,0,0,0,42.22-7.6,220.77,220.77,0,0,0,40.43-15.29,208.26,208.26,0,0,0,36.61-23.25,205.59,205.59,0,0,0,54.56-66.34,225.76,225.76,0,0,0,24.06-81.22A248.76,248.76,0,0,0,523.54,249.16Z'/%3e%3c/g%3e%3c/svg%3e", + "external_url": "https://www.orca.so/whirlpools/", + "collection": { + "name": "Orca Whirlpool Position", + "family": "Orca Whirlpool Position" + } +} diff --git a/sdk/.gitignore b/sdk/.gitignore new file mode 100644 index 0000000..d2a0cb3 --- /dev/null +++ b/sdk/.gitignore @@ -0,0 +1 @@ +.npmrc diff --git a/sdk/.prettierignore b/sdk/.prettierignore new file mode 100644 index 0000000..046f212 --- /dev/null +++ b/sdk/.prettierignore @@ -0,0 +1,2 @@ +# Ignore artifacts: +src/artifacts diff --git a/sdk/.prettierrc b/sdk/.prettierrc new file mode 100644 index 0000000..de753c5 --- /dev/null +++ b/sdk/.prettierrc @@ -0,0 +1,3 @@ +{ + "printWidth": 100 +} diff --git a/sdk/package-lock.json b/sdk/package-lock.json new file mode 100644 index 0000000..2654c99 --- /dev/null +++ b/sdk/package-lock.json @@ -0,0 +1,3212 @@ +{ + "name": "@orca-so/whirlpool-client-sdk", + "version": "0.0.6", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@orca-so/whirlpool-client-sdk", + "version": "0.0.6", + "license": "MIT", + "dependencies": { + "@project-serum/anchor": "^0.20.1", + "@solana/spl-token": "^0.1.8", + "decimal.js": "^10.3.1" + }, + "devDependencies": { + "@types/decimal.js": "^7.4.0", + "@types/mocha": "^9.0.0", + "chai": "^4.3.4", + "husky": "^7.0.4", + "mocha": "^9.0.3", + "typescript": "^4.5.5" + } + }, + "node_modules/@babel/runtime": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", + "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.0.tgz", + "integrity": "sha512-3hJPlYemb9V4VLfJF5BfN0+55vltPZSHU3QKUyP9M3Y2TcajbiRrz65UG+xVHOzBereB1b9mn7r12o177xgN7w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/sha2": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@project-serum/anchor": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.20.1.tgz", + "integrity": "sha512-2TuBmGUn9qeYz6sJINJlElrBuPsaUAtYyUsJ3XplEBf1pczrANAgs5ceJUFzdiqGEWLn+84ObSdBeChT/AXYFA==", + "dependencies": { + "@project-serum/borsh": "^0.2.2", + "@solana/web3.js": "^1.17.0", + "base64-js": "^1.5.1", + "bn.js": "^5.1.2", + "bs58": "^4.0.1", + "buffer-layout": "^1.2.2", + "camelcase": "^5.3.1", + "crypto-hash": "^1.3.0", + "eventemitter3": "^4.0.7", + "find": "^0.3.0", + "js-sha256": "^0.9.0", + "pako": "^2.0.3", + "snake-case": "^3.0.4", + "toml": "^3.0.0" + }, + "engines": { + "node": ">=11" + } + }, + "node_modules/@project-serum/borsh": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.5.tgz", + "integrity": "sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==", + "dependencies": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@solana/web3.js": "^1.2.0" + } + }, + "node_modules/@solana/buffer-layout": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz", + "integrity": "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==", + "dependencies": { + "buffer": "~6.0.3" + }, + "engines": { + "node": ">=5.10" + } + }, + "node_modules/@solana/spl-token": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.1.8.tgz", + "integrity": "sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ==", + "dependencies": { + "@babel/runtime": "^7.10.5", + "@solana/web3.js": "^1.21.0", + "bn.js": "^5.1.0", + "buffer": "6.0.3", + "buffer-layout": "^1.2.0", + "dotenv": "10.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@solana/web3.js": { + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.36.0.tgz", + "integrity": "sha512-RNT1451iRR7TyW7EJKMCrH/0OXawIe4zVm0DWQASwXlR/u1jmW6FrmH0lujIh7cGTlfOVbH+2ZU9AVUPLBFzwA==", + "dependencies": { + "@babel/runtime": "^7.12.5", + "@ethersproject/sha2": "^5.5.0", + "@solana/buffer-layout": "^3.0.0", + "bn.js": "^5.0.0", + "borsh": "^0.4.0", + "bs58": "^4.0.1", + "buffer": "6.0.1", + "cross-fetch": "^3.1.4", + "jayson": "^3.4.4", + "js-sha3": "^0.8.0", + "rpc-websockets": "^7.4.2", + "secp256k1": "^4.0.2", + "superstruct": "^0.14.2", + "tweetnacl": "^1.0.0" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/@solana/web3.js/node_modules/buffer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.1.tgz", + "integrity": "sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/decimal.js": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@types/decimal.js/-/decimal.js-7.4.0.tgz", + "integrity": "sha512-TiP45voN8GdDib9QkkdMprTfs86xxHInqTxNPSGbF0m6X0LXVBjkFEKbbL9fqm4ZPoVFkG1p4F26on2MWGvW5w==", + "deprecated": "This is a stub types definition for decimal.js (https://github.com/MikeMcl/decimal.js). decimal.js provides its own type definitions, so you don't need @types/decimal.js installed!", + "dev": true, + "dependencies": { + "decimal.js": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.14.180", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.180.tgz", + "integrity": "sha512-XOKXa1KIxtNXgASAnwj7cnttJxS4fksBRywK/9LzRV5YxrF80BXZIGeQSuoESQ/VkUj30Ae0+YcuHc15wJCB2g==" + }, + "node_modules/@types/mocha": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", + "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", + "dev": true + }, + "node_modules/@types/node": { + "version": "17.0.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", + "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==" + }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "node_modules/borsh": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.4.0.tgz", + "integrity": "sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g==", + "dependencies": { + "@types/bn.js": "^4.11.5", + "bn.js": "^5.0.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", + "engines": { + "node": ">=4.5" + } + }, + "node_modules/bufferutil": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/circular-json": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", + "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==", + "deprecated": "CircularJSON is in maintenance only, flatted is its successor." + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dependencies": { + "node-fetch": "2.6.7" + } + }, + "node_modules/crypto-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", + "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==" + }, + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "engines": { + "node": ">=10" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "node_modules/es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dependencies": { + "es6-promise": "^4.0.3" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "engines": { + "node": "> 0.1.90" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", + "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", + "dependencies": { + "traverse-chain": "~0.1.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true, + "engines": { + "node": ">=4.x" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/jayson": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", + "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", + "dependencies": { + "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "lodash": "^4.17.20", + "uuid": "^8.3.2", + "ws": "^7.4.5" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" + }, + "node_modules/js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.0" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "node_modules/minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", + "dev": true, + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp-build": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pako": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz", + "integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rpc-websockets": { + "version": "7.4.17", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.17.tgz", + "integrity": "sha512-eolVi/qlXS13viIUH9aqrde902wzSLAai0IjmOZSRefp5I3CSG/vCnD0c0fDSYCWuEyUoRL1BHQA8K1baEUyow==", + "dependencies": { + "@babel/runtime": "^7.11.2", + "circular-json": "^0.5.9", + "eventemitter3": "^4.0.7", + "uuid": "^8.3.0", + "ws": "^7.4.5" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "hasInstallScript": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/superstruct": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", + "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==" + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/traverse-chain": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", + "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=" + }, + "node_modules/tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/typescript": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", + "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/ws": { + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", + "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@babel/runtime": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", + "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@ethersproject/bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.0.tgz", + "integrity": "sha512-3hJPlYemb9V4VLfJF5BfN0+55vltPZSHU3QKUyP9M3Y2TcajbiRrz65UG+xVHOzBereB1b9mn7r12o177xgN7w==", + "requires": { + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/logger": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==" + }, + "@ethersproject/sha2": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", + "requires": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "hash.js": "1.1.7" + } + }, + "@project-serum/anchor": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.20.1.tgz", + "integrity": "sha512-2TuBmGUn9qeYz6sJINJlElrBuPsaUAtYyUsJ3XplEBf1pczrANAgs5ceJUFzdiqGEWLn+84ObSdBeChT/AXYFA==", + "requires": { + "@project-serum/borsh": "^0.2.2", + "@solana/web3.js": "^1.17.0", + "base64-js": "^1.5.1", + "bn.js": "^5.1.2", + "bs58": "^4.0.1", + "buffer-layout": "^1.2.2", + "camelcase": "^5.3.1", + "crypto-hash": "^1.3.0", + "eventemitter3": "^4.0.7", + "find": "^0.3.0", + "js-sha256": "^0.9.0", + "pako": "^2.0.3", + "snake-case": "^3.0.4", + "toml": "^3.0.0" + } + }, + "@project-serum/borsh": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.5.tgz", + "integrity": "sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==", + "requires": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + } + }, + "@solana/buffer-layout": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz", + "integrity": "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==", + "requires": { + "buffer": "~6.0.3" + } + }, + "@solana/spl-token": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.1.8.tgz", + "integrity": "sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ==", + "requires": { + "@babel/runtime": "^7.10.5", + "@solana/web3.js": "^1.21.0", + "bn.js": "^5.1.0", + "buffer": "6.0.3", + "buffer-layout": "^1.2.0", + "dotenv": "10.0.0" + } + }, + "@solana/web3.js": { + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.36.0.tgz", + "integrity": "sha512-RNT1451iRR7TyW7EJKMCrH/0OXawIe4zVm0DWQASwXlR/u1jmW6FrmH0lujIh7cGTlfOVbH+2ZU9AVUPLBFzwA==", + "requires": { + "@babel/runtime": "^7.12.5", + "@ethersproject/sha2": "^5.5.0", + "@solana/buffer-layout": "^3.0.0", + "bn.js": "^5.0.0", + "borsh": "^0.4.0", + "bs58": "^4.0.1", + "buffer": "6.0.1", + "cross-fetch": "^3.1.4", + "jayson": "^3.4.4", + "js-sha3": "^0.8.0", + "rpc-websockets": "^7.4.2", + "secp256k1": "^4.0.2", + "superstruct": "^0.14.2", + "tweetnacl": "^1.0.0" + }, + "dependencies": { + "buffer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.1.tgz", + "integrity": "sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + } + } + }, + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/decimal.js": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@types/decimal.js/-/decimal.js-7.4.0.tgz", + "integrity": "sha512-TiP45voN8GdDib9QkkdMprTfs86xxHInqTxNPSGbF0m6X0LXVBjkFEKbbL9fqm4ZPoVFkG1p4F26on2MWGvW5w==", + "dev": true, + "requires": { + "decimal.js": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "@types/lodash": { + "version": "4.14.180", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.180.tgz", + "integrity": "sha512-XOKXa1KIxtNXgASAnwj7cnttJxS4fksBRywK/9LzRV5YxrF80BXZIGeQSuoESQ/VkUj30Ae0+YcuHc15wJCB2g==" + }, + "@types/mocha": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", + "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", + "dev": true + }, + "@types/node": { + "version": "17.0.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", + "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==" + }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, + "@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "requires": { + "@types/node": "*" + } + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "borsh": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.4.0.tgz", + "integrity": "sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g==", + "requires": { + "@types/bn.js": "^4.11.5", + "bn.js": "^5.0.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==" + }, + "bufferutil": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", + "optional": true, + "requires": { + "node-gyp-build": "^4.3.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "circular-json": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", + "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==" + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "requires": { + "node-fetch": "2.6.7" + } + }, + "crypto-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", + "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==" + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==" + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==" + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "requires": { + "es6-promise": "^4.0.3" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", + "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", + "requires": { + "traverse-chain": "~0.1.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "dev": true + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "requires": {} + }, + "jayson": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", + "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", + "requires": { + "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "lodash": "^4.17.20", + "uuid": "^8.3.2", + "ws": "^7.4.5" + }, + "dependencies": { + "@types/node": { + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" + } + } + }, + "js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "requires": { + "get-func-name": "^2.0.0" + } + }, + "lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "requires": { + "tslib": "^2.0.3" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mocha": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "dev": true + }, + "no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "requires": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-gyp-build": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "pako": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz", + "integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "rpc-websockets": { + "version": "7.4.17", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.17.tgz", + "integrity": "sha512-eolVi/qlXS13viIUH9aqrde902wzSLAai0IjmOZSRefp5I3CSG/vCnD0c0fDSYCWuEyUoRL1BHQA8K1baEUyow==", + "requires": { + "@babel/runtime": "^7.11.2", + "bufferutil": "^4.0.1", + "circular-json": "^0.5.9", + "eventemitter3": "^4.0.7", + "utf-8-validate": "^5.0.2", + "uuid": "^8.3.0", + "ws": "^7.4.5" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "requires": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "superstruct": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", + "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==" + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "traverse-chain": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", + "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=" + }, + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typescript": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", + "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "dev": true + }, + "utf-8-validate": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", + "optional": true, + "requires": { + "node-gyp-build": "^4.3.0" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", + "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "requires": {} + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + } + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/sdk/package.json b/sdk/package.json new file mode 100644 index 0000000..7d505ef --- /dev/null +++ b/sdk/package.json @@ -0,0 +1,37 @@ +{ + "name": "@orca-so/whirlpool-client-sdk", + "version": "0.0.8", + "description": "Provides functions to generate instructions needed for Orca's Whirlpool contracts", + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "dependencies": { + "@metaplex-foundation/mpl-token-metadata": "1.2.5", + "@project-serum/anchor": "^0.20.1", + "@solana/spl-token": "^0.1.8", + "decimal.js": "^10.3.1" + }, + "devDependencies": { + "@types/decimal.js": "^7.4.0", + "@types/mocha": "^9.0.0", + "@typescript-eslint/eslint-plugin": "^4.26.0", + "@typescript-eslint/parser": "^4.26.0", + "chai": "^4.3.4", + "eslint-config-prettier": "^8.3.0", + "mocha": "^9.0.3", + "prettier": "^2.3.2", + "typescript": "^4.5.5" + }, + "scripts": { + "build": "tsc -p src", + "watch": "tsc -w -p src", + "prepublishOnly": "yarn build", + "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write" + }, + "lint-staged": { + "*.{ts,md}": "yarn run prettier-format" + }, + "files": [ + "/dist" + ] +} diff --git a/sdk/src/artifacts/whirlpool.json b/sdk/src/artifacts/whirlpool.json new file mode 100644 index 0000000..5a6788e --- /dev/null +++ b/sdk/src/artifacts/whirlpool.json @@ -0,0 +1,1672 @@ +{ + "version": "0.1.0", + "name": "whirlpool", + "instructions": [ + { + "name": "initializeConfig", + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializePool", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": true + }, + { + "name": "feeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "WhirlpoolBumps" + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initialSqrtPrice", + "type": "u128" + } + ] + }, + { + "name": "initializeTickArray", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tickArray", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "startTickIndex", + "type": "i32" + } + ] + }, + { + "name": "initializeFeeTier", + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializeReward", + "accounts": [ + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissions", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + } + ] + }, + { + "name": "openPosition", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "openPositionWithMetadata", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionMetadataAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataUpdateAuth", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionWithMetadataBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "increaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMaxA", + "type": "u64" + }, + { + "name": "tokenMaxB", + "type": "u64" + } + ] + }, + { + "name": "decreaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMinA", + "type": "u64" + }, + { + "name": "tokenMinB", + "type": "u64" + } + ] + }, + { + "name": "updateFeesAndRewards", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": false, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectFees", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectReward", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardOwnerAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "collectProtocolFees", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "swap", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimit", + "type": "u128" + }, + { + "name": "exactInput", + "type": "bool" + }, + { + "name": "aToB", + "type": "bool" + } + ] + }, + { + "name": "closePosition", + "accounts": [ + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setDefaultFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setDefaultProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "feeRate", + "type": "u16" + } + ] + }, + { + "name": "setProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "protocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newFeeAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setCollectProtocolFeesAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newCollectProtocolFeesAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setRewardAuthority", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardAuthorityBySuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissionsSuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "WhirlpoolsConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "FeeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "Position", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey" + }, + { + "name": "positionMint", + "type": "publicKey" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "feeGrowthCheckpointA", + "type": "u128" + }, + { + "name": "feeOwedA", + "type": "u64" + }, + { + "name": "feeGrowthCheckpointB", + "type": "u128" + }, + { + "name": "feeOwedB", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "PositionRewardInfo" + }, + 3 + ] + } + } + ] + } + }, + { + "name": "TickArray", + "type": { + "kind": "struct", + "fields": [ + { + "name": "startTickIndex", + "type": "i32" + }, + { + "name": "ticks", + "type": { + "array": [ + { + "defined": "Tick" + }, + 88 + ] + } + }, + { + "name": "whirlpool", + "type": "publicKey" + } + ] + } + }, + { + "name": "Whirlpool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "whirlpoolBump", + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "tickSpacingSeed", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "feeRate", + "type": "u16" + }, + { + "name": "protocolFeeRate", + "type": "u16" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "sqrtPrice", + "type": "u128" + }, + { + "name": "tickCurrentIndex", + "type": "i32" + }, + { + "name": "protocolFeeOwedA", + "type": "u64" + }, + { + "name": "protocolFeeOwedB", + "type": "u64" + }, + { + "name": "tokenMintA", + "type": "publicKey" + }, + { + "name": "tokenVaultA", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalA", + "type": "u128" + }, + { + "name": "tokenMintB", + "type": "publicKey" + }, + { + "name": "tokenVaultB", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalB", + "type": "u128" + }, + { + "name": "rewardLastUpdatedTimestamp", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "WhirlpoolRewardInfo" + }, + 3 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "OpenPositionBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + } + ] + } + }, + { + "name": "OpenPositionWithMetadataBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + }, + { + "name": "metadataBump", + "type": "u8" + } + ] + } + }, + { + "name": "PositionRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "growthInsideCheckpoint", + "type": "u128" + }, + { + "name": "amountOwed", + "type": "u64" + } + ] + } + }, + { + "name": "Tick", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "type": "bool" + }, + { + "name": "liquidityNet", + "type": "i128" + }, + { + "name": "liquidityGross", + "type": "u128" + }, + { + "name": "feeGrowthOutsideA", + "type": "u128" + }, + { + "name": "feeGrowthOutsideB", + "type": "u128" + }, + { + "name": "rewardGrowthsOutside", + "type": { + "array": [ + "u128", + 3 + ] + } + } + ] + } + }, + { + "name": "WhirlpoolRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "type": "publicKey" + }, + { + "name": "vault", + "type": "publicKey" + }, + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + }, + { + "name": "growthGlobalX64", + "type": "u128" + } + ] + } + }, + { + "name": "WhirlpoolBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolBump", + "type": "u8" + } + ] + } + }, + { + "name": "CurrIndex", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Below" + }, + { + "name": "Inside" + }, + { + "name": "Above" + } + ] + } + }, + { + "name": "TickLabel", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Upper" + }, + { + "name": "Lower" + } + ] + } + }, + { + "name": "Direction", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Left" + }, + { + "name": "Right" + } + ] + } + } + ], + "errors": [ + { + "code": 6000, + "name": "InvalidEnum", + "msg": "Enum value could not be converted" + }, + { + "code": 6001, + "name": "InvalidStartTick", + "msg": "Invalid start tick index provided." + }, + { + "code": 6002, + "name": "TickArrayExistInPool", + "msg": "Tick-array already exists in this whirlpool" + }, + { + "code": 6003, + "name": "TickArrayIndexOutofBounds", + "msg": "Attempt to search for a tick-array failed" + }, + { + "code": 6004, + "name": "InvalidTickSpacing", + "msg": "Tick-spacing is not supported" + }, + { + "code": 6005, + "name": "ClosePositionNotEmpty", + "msg": "Position is not empty It cannot be closed" + }, + { + "code": 6006, + "name": "DivideByZero", + "msg": "Unable to divide by zero" + }, + { + "code": 6007, + "name": "NumberCastError", + "msg": "Unable to cast number into BigInt" + }, + { + "code": 6008, + "name": "NumberDownCastError", + "msg": "Unable to down cast number" + }, + { + "code": 6009, + "name": "TickNotFound", + "msg": "Tick not found within tick array" + }, + { + "code": 6010, + "name": "InvalidTickIndex", + "msg": "Provided tick index is either out of bounds or uninitializable" + }, + { + "code": 6011, + "name": "SqrtPriceOutOfBounds", + "msg": "Provided sqrt price out of bounds" + }, + { + "code": 6012, + "name": "LiquidityZero", + "msg": "Liquidity amount must be greater than zero" + }, + { + "code": 6013, + "name": "LiquidityTooHigh", + "msg": "Liquidity amount must be less than i64::MAX" + }, + { + "code": 6014, + "name": "LiquidityOverflow", + "msg": "Liquidity overflow" + }, + { + "code": 6015, + "name": "LiquidityUnderflow", + "msg": "Liquidity underflow" + }, + { + "code": 6016, + "name": "LiquidityNetError", + "msg": "Tick liquidity net underflowed or overflowed" + }, + { + "code": 6017, + "name": "TokenMaxExceeded", + "msg": "Exceeded token max" + }, + { + "code": 6018, + "name": "TokenMinSubceeded", + "msg": "Did not meet token min" + }, + { + "code": 6019, + "name": "MissingOrInvalidDelegate", + "msg": "Position token account has a missing or invalid delegate" + }, + { + "code": 6020, + "name": "InvalidPositionTokenAmount", + "msg": "Position token amount must be 1" + }, + { + "code": 6021, + "name": "InvalidTimestampConversion", + "msg": "Timestamp should be convertible from i64 to u64" + }, + { + "code": 6022, + "name": "InvalidTimestamp", + "msg": "Timestamp should be greater than the last updated timestamp" + }, + { + "code": 6023, + "name": "InvalidTickArraySequence", + "msg": "Invalid tick array sequence provided for instruction." + }, + { + "code": 6024, + "name": "InvalidTokenMintOrder", + "msg": "Token Mint in wrong order" + }, + { + "code": 6025, + "name": "RewardNotInitialized", + "msg": "Reward not initialized" + }, + { + "code": 6026, + "name": "InvalidRewardIndex", + "msg": "Invalid reward index" + }, + { + "code": 6027, + "name": "RewardVaultAmountInsufficient", + "msg": "Reward vault requires amount to support emissions for at least one day" + }, + { + "code": 6028, + "name": "FeeRateMaxExceeded", + "msg": "Exceeded max fee rate" + }, + { + "code": 6029, + "name": "ProtocolFeeRateMaxExceeded", + "msg": "Exceeded max protocol fee rate" + }, + { + "code": 6030, + "name": "MultiplicationShiftRightOverflow", + "msg": "Multiplication with shift right overflow" + }, + { + "code": 6031, + "name": "MulDivOverflow", + "msg": "Muldiv overflow" + }, + { + "code": 6032, + "name": "MulDivInvalidInput", + "msg": "Invalid div_u256 input" + }, + { + "code": 6033, + "name": "MultiplicationOverflow", + "msg": "Multiplication overflow" + }, + { + "code": 6034, + "name": "InvalidSqrtPriceLimitDirection", + "msg": "Provided SqrtPriceLimit not in the same direction as the swap." + }, + { + "code": 6035, + "name": "ZeroTradableAmount", + "msg": "There are no tradable amount to swap." + }, + { + "code": 6036, + "name": "AmountOutBelowMinimum", + "msg": "Amount out below minimum threshold" + }, + { + "code": 6037, + "name": "AmountInAboveMaximum", + "msg": "Amount in above maximum threshold" + } + ] +} \ No newline at end of file diff --git a/sdk/src/artifacts/whirlpool.ts b/sdk/src/artifacts/whirlpool.ts new file mode 100644 index 0000000..5f875c8 --- /dev/null +++ b/sdk/src/artifacts/whirlpool.ts @@ -0,0 +1,3345 @@ +export type Whirlpool = { + "version": "0.1.0", + "name": "whirlpool", + "instructions": [ + { + "name": "initializeConfig", + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializePool", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": true + }, + { + "name": "feeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "WhirlpoolBumps" + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initialSqrtPrice", + "type": "u128" + } + ] + }, + { + "name": "initializeTickArray", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tickArray", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "startTickIndex", + "type": "i32" + } + ] + }, + { + "name": "initializeFeeTier", + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializeReward", + "accounts": [ + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissions", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + } + ] + }, + { + "name": "openPosition", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "openPositionWithMetadata", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionMetadataAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataUpdateAuth", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionWithMetadataBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "increaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMaxA", + "type": "u64" + }, + { + "name": "tokenMaxB", + "type": "u64" + } + ] + }, + { + "name": "decreaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMinA", + "type": "u64" + }, + { + "name": "tokenMinB", + "type": "u64" + } + ] + }, + { + "name": "updateFeesAndRewards", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": false, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectFees", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectReward", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardOwnerAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "collectProtocolFees", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "swap", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimit", + "type": "u128" + }, + { + "name": "exactInput", + "type": "bool" + }, + { + "name": "aToB", + "type": "bool" + } + ] + }, + { + "name": "closePosition", + "accounts": [ + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setDefaultFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setDefaultProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "feeRate", + "type": "u16" + } + ] + }, + { + "name": "setProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "protocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newFeeAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setCollectProtocolFeesAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newCollectProtocolFeesAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setRewardAuthority", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardAuthorityBySuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissionsSuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "feeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "position", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey" + }, + { + "name": "positionMint", + "type": "publicKey" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "feeGrowthCheckpointA", + "type": "u128" + }, + { + "name": "feeOwedA", + "type": "u64" + }, + { + "name": "feeGrowthCheckpointB", + "type": "u128" + }, + { + "name": "feeOwedB", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "PositionRewardInfo" + }, + 3 + ] + } + } + ] + } + }, + { + "name": "tickArray", + "type": { + "kind": "struct", + "fields": [ + { + "name": "startTickIndex", + "type": "i32" + }, + { + "name": "ticks", + "type": { + "array": [ + { + "defined": "Tick" + }, + 88 + ] + } + }, + { + "name": "whirlpool", + "type": "publicKey" + } + ] + } + }, + { + "name": "whirlpool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "whirlpoolBump", + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "tickSpacingSeed", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "feeRate", + "type": "u16" + }, + { + "name": "protocolFeeRate", + "type": "u16" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "sqrtPrice", + "type": "u128" + }, + { + "name": "tickCurrentIndex", + "type": "i32" + }, + { + "name": "protocolFeeOwedA", + "type": "u64" + }, + { + "name": "protocolFeeOwedB", + "type": "u64" + }, + { + "name": "tokenMintA", + "type": "publicKey" + }, + { + "name": "tokenVaultA", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalA", + "type": "u128" + }, + { + "name": "tokenMintB", + "type": "publicKey" + }, + { + "name": "tokenVaultB", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalB", + "type": "u128" + }, + { + "name": "rewardLastUpdatedTimestamp", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "WhirlpoolRewardInfo" + }, + 3 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "OpenPositionBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + } + ] + } + }, + { + "name": "OpenPositionWithMetadataBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + }, + { + "name": "metadataBump", + "type": "u8" + } + ] + } + }, + { + "name": "PositionRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "growthInsideCheckpoint", + "type": "u128" + }, + { + "name": "amountOwed", + "type": "u64" + } + ] + } + }, + { + "name": "Tick", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "type": "bool" + }, + { + "name": "liquidityNet", + "type": "i128" + }, + { + "name": "liquidityGross", + "type": "u128" + }, + { + "name": "feeGrowthOutsideA", + "type": "u128" + }, + { + "name": "feeGrowthOutsideB", + "type": "u128" + }, + { + "name": "rewardGrowthsOutside", + "type": { + "array": [ + "u128", + 3 + ] + } + } + ] + } + }, + { + "name": "WhirlpoolRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "type": "publicKey" + }, + { + "name": "vault", + "type": "publicKey" + }, + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + }, + { + "name": "growthGlobalX64", + "type": "u128" + } + ] + } + }, + { + "name": "WhirlpoolBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolBump", + "type": "u8" + } + ] + } + }, + { + "name": "CurrIndex", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Below" + }, + { + "name": "Inside" + }, + { + "name": "Above" + } + ] + } + }, + { + "name": "TickLabel", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Upper" + }, + { + "name": "Lower" + } + ] + } + }, + { + "name": "Direction", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Left" + }, + { + "name": "Right" + } + ] + } + } + ], + "errors": [ + { + "code": 6000, + "name": "InvalidEnum", + "msg": "Enum value could not be converted" + }, + { + "code": 6001, + "name": "InvalidStartTick", + "msg": "Invalid start tick index provided." + }, + { + "code": 6002, + "name": "TickArrayExistInPool", + "msg": "Tick-array already exists in this whirlpool" + }, + { + "code": 6003, + "name": "TickArrayIndexOutofBounds", + "msg": "Attempt to search for a tick-array failed" + }, + { + "code": 6004, + "name": "InvalidTickSpacing", + "msg": "Tick-spacing is not supported" + }, + { + "code": 6005, + "name": "ClosePositionNotEmpty", + "msg": "Position is not empty It cannot be closed" + }, + { + "code": 6006, + "name": "DivideByZero", + "msg": "Unable to divide by zero" + }, + { + "code": 6007, + "name": "NumberCastError", + "msg": "Unable to cast number into BigInt" + }, + { + "code": 6008, + "name": "NumberDownCastError", + "msg": "Unable to down cast number" + }, + { + "code": 6009, + "name": "TickNotFound", + "msg": "Tick not found within tick array" + }, + { + "code": 6010, + "name": "InvalidTickIndex", + "msg": "Provided tick index is either out of bounds or uninitializable" + }, + { + "code": 6011, + "name": "SqrtPriceOutOfBounds", + "msg": "Provided sqrt price out of bounds" + }, + { + "code": 6012, + "name": "LiquidityZero", + "msg": "Liquidity amount must be greater than zero" + }, + { + "code": 6013, + "name": "LiquidityTooHigh", + "msg": "Liquidity amount must be less than i64::MAX" + }, + { + "code": 6014, + "name": "LiquidityOverflow", + "msg": "Liquidity overflow" + }, + { + "code": 6015, + "name": "LiquidityUnderflow", + "msg": "Liquidity underflow" + }, + { + "code": 6016, + "name": "LiquidityNetError", + "msg": "Tick liquidity net underflowed or overflowed" + }, + { + "code": 6017, + "name": "TokenMaxExceeded", + "msg": "Exceeded token max" + }, + { + "code": 6018, + "name": "TokenMinSubceeded", + "msg": "Did not meet token min" + }, + { + "code": 6019, + "name": "MissingOrInvalidDelegate", + "msg": "Position token account has a missing or invalid delegate" + }, + { + "code": 6020, + "name": "InvalidPositionTokenAmount", + "msg": "Position token amount must be 1" + }, + { + "code": 6021, + "name": "InvalidTimestampConversion", + "msg": "Timestamp should be convertible from i64 to u64" + }, + { + "code": 6022, + "name": "InvalidTimestamp", + "msg": "Timestamp should be greater than the last updated timestamp" + }, + { + "code": 6023, + "name": "InvalidTickArraySequence", + "msg": "Invalid tick array sequence provided for instruction." + }, + { + "code": 6024, + "name": "InvalidTokenMintOrder", + "msg": "Token Mint in wrong order" + }, + { + "code": 6025, + "name": "RewardNotInitialized", + "msg": "Reward not initialized" + }, + { + "code": 6026, + "name": "InvalidRewardIndex", + "msg": "Invalid reward index" + }, + { + "code": 6027, + "name": "RewardVaultAmountInsufficient", + "msg": "Reward vault requires amount to support emissions for at least one day" + }, + { + "code": 6028, + "name": "FeeRateMaxExceeded", + "msg": "Exceeded max fee rate" + }, + { + "code": 6029, + "name": "ProtocolFeeRateMaxExceeded", + "msg": "Exceeded max protocol fee rate" + }, + { + "code": 6030, + "name": "MultiplicationShiftRightOverflow", + "msg": "Multiplication with shift right overflow" + }, + { + "code": 6031, + "name": "MulDivOverflow", + "msg": "Muldiv overflow" + }, + { + "code": 6032, + "name": "MulDivInvalidInput", + "msg": "Invalid div_u256 input" + }, + { + "code": 6033, + "name": "MultiplicationOverflow", + "msg": "Multiplication overflow" + }, + { + "code": 6034, + "name": "InvalidSqrtPriceLimitDirection", + "msg": "Provided SqrtPriceLimit not in the same direction as the swap." + }, + { + "code": 6035, + "name": "ZeroTradableAmount", + "msg": "There are no tradable amount to swap." + }, + { + "code": 6036, + "name": "AmountOutBelowMinimum", + "msg": "Amount out below minimum threshold" + }, + { + "code": 6037, + "name": "AmountInAboveMaximum", + "msg": "Amount in above maximum threshold" + } + ] +}; + +export const IDL: Whirlpool = { + "version": "0.1.0", + "name": "whirlpool", + "instructions": [ + { + "name": "initializeConfig", + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializePool", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": true + }, + { + "name": "feeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "WhirlpoolBumps" + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initialSqrtPrice", + "type": "u128" + } + ] + }, + { + "name": "initializeTickArray", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tickArray", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "startTickIndex", + "type": "i32" + } + ] + }, + { + "name": "initializeFeeTier", + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializeReward", + "accounts": [ + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissions", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + } + ] + }, + { + "name": "openPosition", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "openPositionWithMetadata", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionMetadataAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataUpdateAuth", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionWithMetadataBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "increaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMaxA", + "type": "u64" + }, + { + "name": "tokenMaxB", + "type": "u64" + } + ] + }, + { + "name": "decreaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMinA", + "type": "u64" + }, + { + "name": "tokenMinB", + "type": "u64" + } + ] + }, + { + "name": "updateFeesAndRewards", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": false, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectFees", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectReward", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardOwnerAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "collectProtocolFees", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "swap", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimit", + "type": "u128" + }, + { + "name": "exactInput", + "type": "bool" + }, + { + "name": "aToB", + "type": "bool" + } + ] + }, + { + "name": "closePosition", + "accounts": [ + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setDefaultFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setDefaultProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "feeRate", + "type": "u16" + } + ] + }, + { + "name": "setProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "protocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newFeeAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setCollectProtocolFeesAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newCollectProtocolFeesAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setRewardAuthority", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardAuthorityBySuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissionsSuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "feeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "position", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey" + }, + { + "name": "positionMint", + "type": "publicKey" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "feeGrowthCheckpointA", + "type": "u128" + }, + { + "name": "feeOwedA", + "type": "u64" + }, + { + "name": "feeGrowthCheckpointB", + "type": "u128" + }, + { + "name": "feeOwedB", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "PositionRewardInfo" + }, + 3 + ] + } + } + ] + } + }, + { + "name": "tickArray", + "type": { + "kind": "struct", + "fields": [ + { + "name": "startTickIndex", + "type": "i32" + }, + { + "name": "ticks", + "type": { + "array": [ + { + "defined": "Tick" + }, + 88 + ] + } + }, + { + "name": "whirlpool", + "type": "publicKey" + } + ] + } + }, + { + "name": "whirlpool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "whirlpoolBump", + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "tickSpacingSeed", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "feeRate", + "type": "u16" + }, + { + "name": "protocolFeeRate", + "type": "u16" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "sqrtPrice", + "type": "u128" + }, + { + "name": "tickCurrentIndex", + "type": "i32" + }, + { + "name": "protocolFeeOwedA", + "type": "u64" + }, + { + "name": "protocolFeeOwedB", + "type": "u64" + }, + { + "name": "tokenMintA", + "type": "publicKey" + }, + { + "name": "tokenVaultA", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalA", + "type": "u128" + }, + { + "name": "tokenMintB", + "type": "publicKey" + }, + { + "name": "tokenVaultB", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalB", + "type": "u128" + }, + { + "name": "rewardLastUpdatedTimestamp", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "WhirlpoolRewardInfo" + }, + 3 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "OpenPositionBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + } + ] + } + }, + { + "name": "OpenPositionWithMetadataBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + }, + { + "name": "metadataBump", + "type": "u8" + } + ] + } + }, + { + "name": "PositionRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "growthInsideCheckpoint", + "type": "u128" + }, + { + "name": "amountOwed", + "type": "u64" + } + ] + } + }, + { + "name": "Tick", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "type": "bool" + }, + { + "name": "liquidityNet", + "type": "i128" + }, + { + "name": "liquidityGross", + "type": "u128" + }, + { + "name": "feeGrowthOutsideA", + "type": "u128" + }, + { + "name": "feeGrowthOutsideB", + "type": "u128" + }, + { + "name": "rewardGrowthsOutside", + "type": { + "array": [ + "u128", + 3 + ] + } + } + ] + } + }, + { + "name": "WhirlpoolRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "type": "publicKey" + }, + { + "name": "vault", + "type": "publicKey" + }, + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + }, + { + "name": "growthGlobalX64", + "type": "u128" + } + ] + } + }, + { + "name": "WhirlpoolBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolBump", + "type": "u8" + } + ] + } + }, + { + "name": "CurrIndex", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Below" + }, + { + "name": "Inside" + }, + { + "name": "Above" + } + ] + } + }, + { + "name": "TickLabel", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Upper" + }, + { + "name": "Lower" + } + ] + } + }, + { + "name": "Direction", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Left" + }, + { + "name": "Right" + } + ] + } + } + ], + "errors": [ + { + "code": 6000, + "name": "InvalidEnum", + "msg": "Enum value could not be converted" + }, + { + "code": 6001, + "name": "InvalidStartTick", + "msg": "Invalid start tick index provided." + }, + { + "code": 6002, + "name": "TickArrayExistInPool", + "msg": "Tick-array already exists in this whirlpool" + }, + { + "code": 6003, + "name": "TickArrayIndexOutofBounds", + "msg": "Attempt to search for a tick-array failed" + }, + { + "code": 6004, + "name": "InvalidTickSpacing", + "msg": "Tick-spacing is not supported" + }, + { + "code": 6005, + "name": "ClosePositionNotEmpty", + "msg": "Position is not empty It cannot be closed" + }, + { + "code": 6006, + "name": "DivideByZero", + "msg": "Unable to divide by zero" + }, + { + "code": 6007, + "name": "NumberCastError", + "msg": "Unable to cast number into BigInt" + }, + { + "code": 6008, + "name": "NumberDownCastError", + "msg": "Unable to down cast number" + }, + { + "code": 6009, + "name": "TickNotFound", + "msg": "Tick not found within tick array" + }, + { + "code": 6010, + "name": "InvalidTickIndex", + "msg": "Provided tick index is either out of bounds or uninitializable" + }, + { + "code": 6011, + "name": "SqrtPriceOutOfBounds", + "msg": "Provided sqrt price out of bounds" + }, + { + "code": 6012, + "name": "LiquidityZero", + "msg": "Liquidity amount must be greater than zero" + }, + { + "code": 6013, + "name": "LiquidityTooHigh", + "msg": "Liquidity amount must be less than i64::MAX" + }, + { + "code": 6014, + "name": "LiquidityOverflow", + "msg": "Liquidity overflow" + }, + { + "code": 6015, + "name": "LiquidityUnderflow", + "msg": "Liquidity underflow" + }, + { + "code": 6016, + "name": "LiquidityNetError", + "msg": "Tick liquidity net underflowed or overflowed" + }, + { + "code": 6017, + "name": "TokenMaxExceeded", + "msg": "Exceeded token max" + }, + { + "code": 6018, + "name": "TokenMinSubceeded", + "msg": "Did not meet token min" + }, + { + "code": 6019, + "name": "MissingOrInvalidDelegate", + "msg": "Position token account has a missing or invalid delegate" + }, + { + "code": 6020, + "name": "InvalidPositionTokenAmount", + "msg": "Position token amount must be 1" + }, + { + "code": 6021, + "name": "InvalidTimestampConversion", + "msg": "Timestamp should be convertible from i64 to u64" + }, + { + "code": 6022, + "name": "InvalidTimestamp", + "msg": "Timestamp should be greater than the last updated timestamp" + }, + { + "code": 6023, + "name": "InvalidTickArraySequence", + "msg": "Invalid tick array sequence provided for instruction." + }, + { + "code": 6024, + "name": "InvalidTokenMintOrder", + "msg": "Token Mint in wrong order" + }, + { + "code": 6025, + "name": "RewardNotInitialized", + "msg": "Reward not initialized" + }, + { + "code": 6026, + "name": "InvalidRewardIndex", + "msg": "Invalid reward index" + }, + { + "code": 6027, + "name": "RewardVaultAmountInsufficient", + "msg": "Reward vault requires amount to support emissions for at least one day" + }, + { + "code": 6028, + "name": "FeeRateMaxExceeded", + "msg": "Exceeded max fee rate" + }, + { + "code": 6029, + "name": "ProtocolFeeRateMaxExceeded", + "msg": "Exceeded max protocol fee rate" + }, + { + "code": 6030, + "name": "MultiplicationShiftRightOverflow", + "msg": "Multiplication with shift right overflow" + }, + { + "code": 6031, + "name": "MulDivOverflow", + "msg": "Muldiv overflow" + }, + { + "code": 6032, + "name": "MulDivInvalidInput", + "msg": "Invalid div_u256 input" + }, + { + "code": 6033, + "name": "MultiplicationOverflow", + "msg": "Multiplication overflow" + }, + { + "code": 6034, + "name": "InvalidSqrtPriceLimitDirection", + "msg": "Provided SqrtPriceLimit not in the same direction as the swap." + }, + { + "code": 6035, + "name": "ZeroTradableAmount", + "msg": "There are no tradable amount to swap." + }, + { + "code": 6036, + "name": "AmountOutBelowMinimum", + "msg": "Amount out below minimum threshold" + }, + { + "code": 6037, + "name": "AmountInAboveMaximum", + "msg": "Amount in above maximum threshold" + } + ] +}; diff --git a/sdk/src/client.ts b/sdk/src/client.ts new file mode 100644 index 0000000..0455946 --- /dev/null +++ b/sdk/src/client.ts @@ -0,0 +1,379 @@ +import { WhirlpoolContext } from "./context"; +import { PublicKey } from "@solana/web3.js"; +import { WhirlpoolConfigAccount } from "./types/public/account-types"; +import { TransactionBuilder } from "./utils/transactions/transactions-builder"; +import { buildInitializeConfigIx } from "./instructions/initialize-config-ix"; +import { + ClosePositionParams, + CollectFeesParams, + CollectProtocolFeesParams, + CollectRewardParams, + InitConfigParams, + InitializeRewardParams, + InitPoolParams, + InitTickArrayParams, + OpenPositionParams, + SetCollectProtocolFeesAuthorityParams, + SetFeeAuthorityParams, + SetRewardAuthorityBySuperAuthorityParams, + parsePosition, + parseTickArray, + parseWhirlpool, + parseWhirlpoolsConfig, + SetRewardAuthorityParams, + SetRewardEmissionsParams, + SetRewardEmissionsSuperAuthorityParams, + SwapParams, + UpdateFeesAndRewardsParams, + SetFeeRateParams, + SetDefaultProtocolFeeRateParams, + SetProtocolFeeRateParams, + SetDefaultFeeRateParams, + DecreaseLiquidityParams, + IncreaseLiquidityParams, + InitFeeTierParams, +} from "."; +import { buildInitPoolIx } from "./instructions/initialize-pool-ix"; +import { + FeeTierData, + PositionData, + TickArrayData, + WhirlpoolData, +} from "./types/public/anchor-types"; +import { + buildOpenPositionIx, + buildOpenPositionWithMetadataIx, +} from "./instructions/open-position-ix"; +import { buildInitTickArrayIx } from "./instructions/initialize-tick-array-ix"; +import { buildIncreaseLiquidityIx } from "./instructions/increase-liquidity-ix"; +import { buildCollectFeesIx } from "./instructions/collect-fees-ix"; +import { buildCollectRewardIx } from "./instructions/collect-reward-ix"; +import { buildSwapIx } from "./instructions/swap-ix"; +import { buildInitializeRewardIx } from "./instructions/initialize-reward-ix"; +import { buildSetRewardEmissionsSuperAuthorityIx } from "./instructions/set-reward-emissions-super-authority-ix"; +import { buildSetRewardAuthorityIx } from "./instructions/set-reward-authority-ix"; +import { buildSetRewardEmissionsIx } from "./instructions/set-reward-emissions-ix"; +import { buildClosePositionIx } from "./instructions/close-position-ix"; +import { buildSetRewardAuthorityBySuperAuthorityIx } from "./instructions/set-reward-authority-by-super-authority-ix"; +import { buildSetFeeAuthorityIx } from "./instructions/set-fee-authority-ix"; +import { buildSetCollectProtocolFeesAuthorityIx } from "./instructions/set-collect-protocol-fees-authority-ix"; +import { buildUpdateFeesAndRewardsIx } from "./instructions/update-fees-and-rewards-ix"; +import { buildCollectProtocolFeesIx } from "./instructions/collect-protocol-fees-ix"; +import { buildDecreaseLiquidityIx } from "./instructions/decrease-liquidity-ix"; +import { buildSetFeeRateIx } from "./instructions/set-fee-rate-ix"; +import { buildSetDefaultProtocolFeeRateIx } from "./instructions/set-default-protocol-fee-rate-ix"; +import { buildSetDefaultFeeRateIx } from "./instructions/set-default-fee-rate-ix"; +import { buildSetProtocolFeeRateIx } from "./instructions/set-protocol-fee-rate-ix"; +import { buildInitializeFeeTier } from "./instructions/initialize-fee-tier"; +import { Decimal } from "decimal.js"; + +// Global rules for Decimals +// - 40 digits of precision for the largest number +// - 20 digits of precision for the smallest number +// - Always round towards 0 to mirror smart contract rules +Decimal.set({ precision: 40, toExpPos: 40, toExpNeg: -20, rounding: 1 }); + +/** + * WhirlpoolClient provides a portal to perform admin-type tasks on the Whirlpool protocol. + */ +export class WhirlpoolClient { + readonly context: WhirlpoolContext; + + public constructor(context: WhirlpoolContext) { + this.context = context; + } + + /** + * Construct a TransactionBuilder to initialize a WhirlpoolConfig account with the provided parameters. + * @param params Parameters to configure the initialized WhirlpoolConfig account + * @returns A TransactionBuilder to initialize a WhirlpoolConfig account with the provided parameters. + */ + public initConfigTx(params: InitConfigParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildInitializeConfigIx(this.context, params) + ); + } + + /** + * Fetches and parses a WhirlpoolConfig account. + * @param poolPubKey A public key of a WhirlpoolConfig account + * @returns A WhirlpoolConfig type containing the parameters stored on the account + */ + public async getConfig(configPubKey: PublicKey): Promise { + const program = this.context.program; + const account = await program.account.whirlpoolsConfig.fetch(configPubKey); + // TODO: If we feel nice we can build a builder or something instead of casting + return account as WhirlpoolConfigAccount; + } + + /** + * Parses a WhirlpoolConfig account. + * @param data A buffer containing data fetched from an account + * @returns A WhirlpoolConfig type containing the parameters stored on the account + */ + public parseConfig(data: Buffer): WhirlpoolConfigAccount | null { + return parseWhirlpoolsConfig(data); + } + + /** + * Construct a TransactionBuilder to initialize a FeeTier account with the provided parameters. + * @param params Parameters to configure the initialized FeeTier account + * @returns A TransactionBuilder to initialize a FeeTier account with the provided parameters. + */ + public initFeeTierTx(params: InitFeeTierParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildInitializeFeeTier(this.context, params) + ); + } + + /** + * Fetches and parses a FeeTier account. + * @param feeTierKey A public key of a FeeTier account + * @returns A FeeTier type containing the parameters stored on the account + */ + public async getFeeTier(feeTierKey: PublicKey): Promise { + const program = this.context.program; + + const feeTierAccount = await program.account.feeTier.fetch(feeTierKey); + return feeTierAccount as unknown as FeeTierData; + } + + /** + * Construct a TransactionBuilder to initialize a Whirlpool account with the provided parameters. + * @param params Parameters to configure the initialized Whirlpool account + * @returns A TransactionBuilder to initialize a Whirlpool account with the provided parameters. + */ + public initPoolTx(params: InitPoolParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildInitPoolIx(this.context, params) + ); + } + + /** + * Fetches and parses a Whirlpool account. + * @param poolPubKey A public key of a Whirlpool account + * @returns A Whirlpool type containing the parameters stored on the account + */ + public async getPool(poolKey: PublicKey): Promise { + const program = this.context.program; + + const whirlpoolAccount = await program.account.whirlpool.fetch(poolKey); + return whirlpoolAccount as unknown as WhirlpoolData; + } + + /** + * Parses a Whirlpool account. + * @param data A buffer containing data fetched from an account + * @returns A Whirlpool type containing the parameters stored on the account + */ + public parsePool(data: Buffer): WhirlpoolData | null { + return parseWhirlpool(data); + } + + /** + * Construct a TransactionBuilder to open a Position account. + * @param params Parameters to configure the initialized Position account. + * @returns A TransactionBuilder to initialize a Position account with the provided parameters. + */ + public openPositionTx(params: OpenPositionParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildOpenPositionIx(this.context, params) + ); + } + + /** + * Construct a TransactionBuilder to open a Position account with metadata. + * @param params Parameters to configure the initialized Position account. + * @returns A TransactionBuilder to initialize a Position account with the provided parameters. + */ + public openPositionWithMetadataTx(params: Required): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildOpenPositionWithMetadataIx(this.context, params) + ); + } + + public closePositionTx(params: ClosePositionParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildClosePositionIx(this.context, params) + ); + } + + /** + * Fetches a Position account. + * @param positionKey The public key of the Position account + * @returns A Position type containing the parameters stored on the account + */ + public async getPosition(positionKey: PublicKey): Promise { + const positionAccount = await this.context.program.account.position.fetch(positionKey); + return positionAccount as unknown as PositionData; + } + + /** + * Parses a Position account. + * @param data A buffer containing data fetched from an account + * @returns A Position type containing the parameters stored on the account + */ + public parsePosition(data: Buffer): PositionData | null { + return parsePosition(data); + } + + /* + * Construct a TransactionBuilder to initialize a TickArray account with the provided parameters. + * @param params Parameters to configure the initialized TickArray account + * @returns A TransactionBuilder to initialize a TickArray account with the provided parameters. + */ + public initTickArrayTx(params: InitTickArrayParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildInitTickArrayIx(this.context, params) + ); + } + + /** + * Fetches and parses a TickArray account. Account is used to store Ticks for a Whirlpool. + * @param arrayPubKey A public key of a TickArray account + * @returns A TickArrayData type containing the parameters stored on the account + */ + public async getTickArray(arrayPubKey: PublicKey): Promise { + const program = this.context.program; + const tickArrayAccount = await program.account.tickArray.fetch(arrayPubKey); + return tickArrayAccount as unknown as TickArrayData; + } + + /** + * Parses a TickArray account. + * @param data A buffer containing data fetched from an account + * @returns A Position type containing the parameters stored on the account + */ + public parseTickArray(data: Buffer): TickArrayData | null { + return parseTickArray(data); + } + + public initializeRewardTx(params: InitializeRewardParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildInitializeRewardIx(this.context, params) + ); + } + + public setRewardEmissionsTx(params: SetRewardEmissionsParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetRewardEmissionsIx(this.context, params) + ); + } + + /** + * Construct a TransactionBuilder to increase the liquidity of a Position. + * @param params Parameters to configure the increase liquidity instruction + * @returns A TransactionBuilder containing one increase liquidity instruction + */ + public increaseLiquidityTx(params: IncreaseLiquidityParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildIncreaseLiquidityIx(this.context, params) + ); + } + + public decreaseLiquidityTx(params: DecreaseLiquidityParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildDecreaseLiquidityIx(this.context, params) + ); + } + + public updateFeesAndRewards(params: UpdateFeesAndRewardsParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildUpdateFeesAndRewardsIx(this.context, params) + ); + } + + /** + * Construct a TransactionBuilder to collect the fees for a Position. + * @param params Parameters to configure the collect fees instruction + * @returns A TransactionBuilder containing one collect fees instruction + */ + public collectFeesTx(params: CollectFeesParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildCollectFeesIx(this.context, params) + ); + } + + /** + * Construct a TransactionBuilder to collect a reward at the specified index for a Position. + * @param params Parameters to configure the collect reward instruction + * @returns A TransactionBuilder containing one collect reward instruction + */ + public collectRewardTx(params: CollectRewardParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildCollectRewardIx(this.context, params) + ); + } + + public collectProtocolFeesTx(params: CollectProtocolFeesParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildCollectProtocolFeesIx(this.context, params) + ); + } + + public swapTx(params: SwapParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSwapIx(this.context, params) + ); + } + + public setRewardEmissionsSuperAuthorityTx( + params: SetRewardEmissionsSuperAuthorityParams + ): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetRewardEmissionsSuperAuthorityIx(this.context, params) + ); + } + + public setRewardAuthorityTx(params: SetRewardAuthorityParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetRewardAuthorityIx(this.context, params) + ); + } + + public setRewardAuthorityBySuperAuthorityTx( + params: SetRewardAuthorityBySuperAuthorityParams + ): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetRewardAuthorityBySuperAuthorityIx(this.context, params) + ); + } + + public setFeeAuthorityTx(params: SetFeeAuthorityParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetFeeAuthorityIx(this.context, params) + ); + } + + public setCollectProtocolFeesAuthorityTx( + params: SetCollectProtocolFeesAuthorityParams + ): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetCollectProtocolFeesAuthorityIx(this.context, params) + ); + } + + public setFeeRateIx(params: SetFeeRateParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetFeeRateIx(this.context, params) + ); + } + + public setProtocolFeeRateIx(params: SetProtocolFeeRateParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetProtocolFeeRateIx(this.context, params) + ); + } + + public setDefaultFeeRateIx(params: SetDefaultFeeRateParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetDefaultFeeRateIx(this.context, params) + ); + } + + public setDefaultProtocolFeeRateIx(params: SetDefaultProtocolFeeRateParams): TransactionBuilder { + return new TransactionBuilder(this.context.provider).addInstruction( + buildSetDefaultProtocolFeeRateIx(this.context, params) + ); + } +} diff --git a/sdk/src/context.ts b/sdk/src/context.ts new file mode 100644 index 0000000..b09c6bd --- /dev/null +++ b/sdk/src/context.ts @@ -0,0 +1,52 @@ +import { PublicKey, Connection, ConfirmOptions } from "@solana/web3.js"; +import { Provider, Program, Idl } from "@project-serum/anchor"; +import WhirlpoolIDL from "./artifacts/whirlpool.json"; +import { Whirlpool } from "./artifacts/whirlpool"; +import { Wallet } from "@project-serum/anchor/dist/cjs/provider"; + +export class WhirlpoolContext { + readonly connection: Connection; + readonly wallet: Wallet; + readonly opts: ConfirmOptions; + readonly program: Program; + readonly provider: Provider; + + public static from( + connection: Connection, + wallet: Wallet, + programId: PublicKey, + opts: ConfirmOptions = Provider.defaultOptions() + ): WhirlpoolContext { + const provider = new Provider(connection, wallet, opts); + const program = new Program(WhirlpoolIDL as Idl, programId, provider); + return new WhirlpoolContext(provider, program, opts); + } + + public static fromWorkspace( + provider: Provider, + program: Program, + opts: ConfirmOptions = Provider.defaultOptions() + ) { + return new WhirlpoolContext(provider, program, opts); + } + + public static withProvider( + provider: Provider, + programId: PublicKey, + opts: ConfirmOptions = Provider.defaultOptions() + ): WhirlpoolContext { + const program = new Program(WhirlpoolIDL as Idl, programId, provider); + return new WhirlpoolContext(provider, program, opts); + } + + public constructor(provider: Provider, program: Program, opts: ConfirmOptions) { + this.connection = provider.connection; + this.wallet = provider.wallet; + this.opts = opts; + // It's a hack but it works on Anchor workspace *shrug* + this.program = program as unknown as Program; + this.provider = provider; + } + + // TODO: Add another factory method to build from on-chain IDL +} diff --git a/sdk/src/index.ts b/sdk/src/index.ts new file mode 100644 index 0000000..7f10f76 --- /dev/null +++ b/sdk/src/index.ts @@ -0,0 +1,7 @@ +export * from "./client"; +export * from "./context"; +export * from "./types/public"; +export * from "./utils/public"; + +export * from "./types/public/anchor-types"; +export * from "./utils/transactions/transactions-builder"; diff --git a/sdk/src/instructions/close-position-ix.ts b/sdk/src/instructions/close-position-ix.ts new file mode 100644 index 0000000..58a8345 --- /dev/null +++ b/sdk/src/instructions/close-position-ix.ts @@ -0,0 +1,28 @@ +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { ClosePositionParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildClosePositionIx( + context: WhirlpoolContext, + params: ClosePositionParams +): Instruction { + const { positionAuthority, receiver, position, positionMint, positionTokenAccount } = params; + + const ix = context.program.instruction.closePosition({ + accounts: { + positionAuthority, + receiver, + position, + positionMint, + positionTokenAccount, + tokenProgram: TOKEN_PROGRAM_ID, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/collect-fees-ix.ts b/sdk/src/instructions/collect-fees-ix.ts new file mode 100644 index 0000000..ab78334 --- /dev/null +++ b/sdk/src/instructions/collect-fees-ix.ts @@ -0,0 +1,40 @@ +import { WhirlpoolContext } from "../context"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { CollectFeesParams } from ".."; + +export function buildCollectFeesIx( + context: WhirlpoolContext, + params: CollectFeesParams +): Instruction { + const { + whirlpool, + positionAuthority, + position, + positionTokenAccount, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA, + tokenVaultB, + } = params; + + const ix = context.program.instruction.collectFees({ + accounts: { + whirlpool, + positionAuthority, + position, + positionTokenAccount, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA, + tokenVaultB, + tokenProgram: TOKEN_PROGRAM_ID, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/collect-protocol-fees-ix.ts b/sdk/src/instructions/collect-protocol-fees-ix.ts new file mode 100644 index 0000000..ff14d21 --- /dev/null +++ b/sdk/src/instructions/collect-protocol-fees-ix.ts @@ -0,0 +1,38 @@ +import { WhirlpoolContext } from "../context"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { CollectProtocolFeesParams } from ".."; + +export function buildCollectProtocolFeesIx( + context: WhirlpoolContext, + params: CollectProtocolFeesParams +): Instruction { + const { + whirlpoolsConfig, + whirlpool, + collectProtocolFeesAuthority, + tokenVaultA, + tokenVaultB, + tokenDestinationA, + tokenDestinationB, + } = params; + + const ix = context.program.instruction.collectProtocolFees({ + accounts: { + whirlpoolsConfig, + whirlpool, + collectProtocolFeesAuthority, + tokenVaultA, + tokenVaultB, + tokenDestinationA, + tokenDestinationB, + tokenProgram: TOKEN_PROGRAM_ID, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/collect-reward-ix.ts b/sdk/src/instructions/collect-reward-ix.ts new file mode 100644 index 0000000..9e279c4 --- /dev/null +++ b/sdk/src/instructions/collect-reward-ix.ts @@ -0,0 +1,37 @@ +import { WhirlpoolContext } from "../context"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { CollectRewardParams } from ".."; + +export function buildCollectRewardIx( + context: WhirlpoolContext, + params: CollectRewardParams +): Instruction { + const { + whirlpool, + positionAuthority, + position, + positionTokenAccount, + rewardOwnerAccount, + rewardVault, + rewardIndex, + } = params; + + const ix = context.program.instruction.collectReward(rewardIndex, { + accounts: { + whirlpool, + positionAuthority, + position, + positionTokenAccount, + rewardOwnerAccount, + rewardVault, + tokenProgram: TOKEN_PROGRAM_ID, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/decrease-liquidity-ix.ts b/sdk/src/instructions/decrease-liquidity-ix.ts new file mode 100644 index 0000000..bb87756 --- /dev/null +++ b/sdk/src/instructions/decrease-liquidity-ix.ts @@ -0,0 +1,47 @@ +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { DecreaseLiquidityParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildDecreaseLiquidityIx( + context: WhirlpoolContext, + params: DecreaseLiquidityParams +): Instruction { + const { + liquidityAmount, + tokenMinA, + tokenMinB, + whirlpool, + positionAuthority, + position, + positionTokenAccount, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA, + tokenVaultB, + tickArrayLower, + tickArrayUpper, + } = params; + + const ix = context.program.instruction.decreaseLiquidity(liquidityAmount, tokenMinA, tokenMinB, { + accounts: { + whirlpool, + tokenProgram: TOKEN_PROGRAM_ID, + positionAuthority, + position, + positionTokenAccount, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA, + tokenVaultB, + tickArrayLower, + tickArrayUpper, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/increase-liquidity-ix.ts b/sdk/src/instructions/increase-liquidity-ix.ts new file mode 100644 index 0000000..2415402 --- /dev/null +++ b/sdk/src/instructions/increase-liquidity-ix.ts @@ -0,0 +1,47 @@ +import { WhirlpoolContext } from "../context"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { IncreaseLiquidityParams } from ".."; + +export function buildIncreaseLiquidityIx( + context: WhirlpoolContext, + params: IncreaseLiquidityParams +): Instruction { + const { + liquidityAmount, + tokenMaxA, + tokenMaxB, + whirlpool, + positionAuthority, + position, + positionTokenAccount, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA, + tokenVaultB, + tickArrayLower, + tickArrayUpper, + } = params; + + const ix = context.program.instruction.increaseLiquidity(liquidityAmount, tokenMaxA, tokenMaxB, { + accounts: { + whirlpool, + tokenProgram: TOKEN_PROGRAM_ID, + positionAuthority, + position, + positionTokenAccount, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA, + tokenVaultB, + tickArrayLower, + tickArrayUpper, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/initialize-config-ix.ts b/sdk/src/instructions/initialize-config-ix.ts new file mode 100644 index 0000000..1f25f62 --- /dev/null +++ b/sdk/src/instructions/initialize-config-ix.ts @@ -0,0 +1,37 @@ +import { SystemProgram } from "@solana/web3.js"; +import { WhirlpoolContext } from "../context"; +import { InitConfigParams } from "../types/public/ix-types"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildInitializeConfigIx( + context: WhirlpoolContext, + params: InitConfigParams +): Instruction { + const { + feeAuthority, + collectProtocolFeesAuthority, + rewardEmissionsSuperAuthority, + defaultProtocolFeeRate, + funder, + } = params; + + const ix = context.program.instruction.initializeConfig( + feeAuthority, + collectProtocolFeesAuthority, + rewardEmissionsSuperAuthority, + defaultProtocolFeeRate, + { + accounts: { + config: params.whirlpoolConfigKeypair.publicKey, + funder, + systemProgram: SystemProgram.programId, + }, + } + ); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [params.whirlpoolConfigKeypair], + }; +} diff --git a/sdk/src/instructions/initialize-fee-tier.ts b/sdk/src/instructions/initialize-fee-tier.ts new file mode 100644 index 0000000..7d9b06a --- /dev/null +++ b/sdk/src/instructions/initialize-fee-tier.ts @@ -0,0 +1,29 @@ +import { SystemProgram } from "@solana/web3.js"; +import { getFeeTierPda } from ".."; +import { WhirlpoolContext } from "../context"; +import { InitFeeTierParams } from "../types/public/ix-types"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildInitializeFeeTier( + context: WhirlpoolContext, + params: InitFeeTierParams +): Instruction { + const { feeTierPda, whirlpoolConfigKey, tickSpacing, feeAuthority, defaultFeeRate, funder } = + params; + + const ix = context.program.instruction.initializeFeeTier(tickSpacing, defaultFeeRate, { + accounts: { + config: whirlpoolConfigKey, + feeTier: feeTierPda.publicKey, + feeAuthority, + funder, + systemProgram: SystemProgram.programId, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/initialize-pool-ix.ts b/sdk/src/instructions/initialize-pool-ix.ts new file mode 100644 index 0000000..0637ed0 --- /dev/null +++ b/sdk/src/instructions/initialize-pool-ix.ts @@ -0,0 +1,49 @@ +import { WhirlpoolContext } from "../context"; +import { SystemProgram, SYSVAR_RENT_PUBKEY } from "@solana/web3.js"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { InitPoolParams } from ".."; +import { WhirlpoolBumpsData } from "../types/public/anchor-types"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; + +export function buildInitPoolIx(context: WhirlpoolContext, params: InitPoolParams): Instruction { + const program = context.program; + + const { + initSqrtPrice, + tokenMintA, + tokenMintB, + whirlpoolConfigKey, + whirlpoolPda, + feeTierKey, + tokenVaultAKeypair, + tokenVaultBKeypair, + tickSpacing, + funder, + } = params; + + const whirlpoolBumps: WhirlpoolBumpsData = { + whirlpoolBump: whirlpoolPda.bump, + }; + + const ix = program.instruction.initializePool(whirlpoolBumps, tickSpacing, initSqrtPrice, { + accounts: { + whirlpoolsConfig: whirlpoolConfigKey, + tokenMintA: tokenMintA, + tokenMintB: tokenMintB, + funder, + whirlpool: whirlpoolPda.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + feeTier: feeTierKey, + tokenProgram: TOKEN_PROGRAM_ID, + systemProgram: SystemProgram.programId, + rent: SYSVAR_RENT_PUBKEY, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [tokenVaultAKeypair, tokenVaultBKeypair], + }; +} diff --git a/sdk/src/instructions/initialize-reward-ix.ts b/sdk/src/instructions/initialize-reward-ix.ts new file mode 100644 index 0000000..6b487ae --- /dev/null +++ b/sdk/src/instructions/initialize-reward-ix.ts @@ -0,0 +1,33 @@ +import * as anchor from "@project-serum/anchor"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { SystemProgram } from "@solana/web3.js"; +import { InitializeRewardParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildInitializeRewardIx( + context: WhirlpoolContext, + params: InitializeRewardParams +): Instruction { + const { rewardAuthority, funder, whirlpool, rewardMint, rewardVaultKeypair, rewardIndex } = + params; + + const ix = context.program.instruction.initializeReward(rewardIndex, { + accounts: { + rewardAuthority, + funder, + whirlpool, + rewardMint, + rewardVault: rewardVaultKeypair.publicKey, + tokenProgram: TOKEN_PROGRAM_ID, + systemProgram: SystemProgram.programId, + rent: anchor.web3.SYSVAR_RENT_PUBKEY, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [rewardVaultKeypair], + }; +} diff --git a/sdk/src/instructions/initialize-tick-array-ix.ts b/sdk/src/instructions/initialize-tick-array-ix.ts new file mode 100644 index 0000000..ca5eecf --- /dev/null +++ b/sdk/src/instructions/initialize-tick-array-ix.ts @@ -0,0 +1,28 @@ +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { InitTickArrayParams } from ".."; +import * as anchor from "@project-serum/anchor"; + +export function buildInitTickArrayIx( + context: WhirlpoolContext, + params: InitTickArrayParams +): Instruction { + const program = context.program; + + const { whirlpool, funder, tickArrayPda } = params; + + const ix = program.instruction.initializeTickArray(params.startTick, { + accounts: { + whirlpool, + funder, + tickArray: tickArrayPda.publicKey, + systemProgram: anchor.web3.SystemProgram.programId, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/open-position-ix.ts b/sdk/src/instructions/open-position-ix.ts new file mode 100644 index 0000000..caa7891 --- /dev/null +++ b/sdk/src/instructions/open-position-ix.ts @@ -0,0 +1,87 @@ +import { WhirlpoolContext } from "../context"; +import { PublicKey, SystemProgram } from "@solana/web3.js"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { OpenPositionParams, PDA } from ".."; +import * as anchor from "@project-serum/anchor"; +import { + OpenPositionBumpsData, + OpenPositionWithMetadataBumpsData, +} from "../types/public/anchor-types"; +import { TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { METADATA_PROGRAM_ADDRESS } from "../utils/public"; + +export function buildOpenPositionIx( + context: WhirlpoolContext, + params: OpenPositionParams +): Instruction { + const { positionPda, tickLowerIndex, tickUpperIndex } = params; + + const bumps: OpenPositionBumpsData = { + positionBump: positionPda.bump, + }; + + const ix = context.program.instruction.openPosition(bumps, tickLowerIndex, tickUpperIndex, { + accounts: openPositionAccounts(params), + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} + +export function buildOpenPositionWithMetadataIx( + context: WhirlpoolContext, + params: OpenPositionParams & { metadataPda: PDA } +): Instruction { + const { positionPda, metadataPda, tickLowerIndex, tickUpperIndex } = params; + + const bumps: OpenPositionWithMetadataBumpsData = { + positionBump: positionPda.bump, + metadataBump: metadataPda.bump, + }; + + const ix = context.program.instruction.openPositionWithMetadata( + bumps, + tickLowerIndex, + tickUpperIndex, + { + accounts: { + ...openPositionAccounts(params), + positionMetadataAccount: metadataPda.publicKey, + metadataProgram: METADATA_PROGRAM_ADDRESS, + metadataUpdateAuth: new PublicKey("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr"), + }, + } + ); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} + +export function openPositionAccounts(params: OpenPositionParams) { + const { + funder, + ownerKey, + positionPda, + positionMintAddress, + positionTokenAccountAddress, + whirlpoolKey, + } = params; + return { + funder: funder, + owner: ownerKey, + position: positionPda.publicKey, + positionMint: positionMintAddress, + positionTokenAccount: positionTokenAccountAddress, + whirlpool: whirlpoolKey, + tokenProgram: TOKEN_PROGRAM_ID, + systemProgram: SystemProgram.programId, + rent: anchor.web3.SYSVAR_RENT_PUBKEY, + associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, + }; +} diff --git a/sdk/src/instructions/set-collect-protocol-fees-authority-ix.ts b/sdk/src/instructions/set-collect-protocol-fees-authority-ix.ts new file mode 100644 index 0000000..2b318ca --- /dev/null +++ b/sdk/src/instructions/set-collect-protocol-fees-authority-ix.ts @@ -0,0 +1,25 @@ +import { SetCollectProtocolFeesAuthorityParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSetCollectProtocolFeesAuthorityIx( + context: WhirlpoolContext, + params: SetCollectProtocolFeesAuthorityParams +): Instruction { + const { whirlpoolsConfig, collectProtocolFeesAuthority, newCollectProtocolFeesAuthority } = + params; + + const ix = context.program.instruction.setCollectProtocolFeesAuthority({ + accounts: { + whirlpoolsConfig, + collectProtocolFeesAuthority, + newCollectProtocolFeesAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-default-fee-rate-ix.ts b/sdk/src/instructions/set-default-fee-rate-ix.ts new file mode 100644 index 0000000..89f9dd5 --- /dev/null +++ b/sdk/src/instructions/set-default-fee-rate-ix.ts @@ -0,0 +1,26 @@ +import { getFeeTierPda, SetDefaultFeeRateParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSetDefaultFeeRateIx( + context: WhirlpoolContext, + params: SetDefaultFeeRateParams +): Instruction { + const { whirlpoolsConfig, feeAuthority, tickSpacing, defaultFeeRate } = params; + + const feeTierPda = getFeeTierPda(context.program.programId, whirlpoolsConfig, tickSpacing); + + const ix = context.program.instruction.setDefaultFeeRate(defaultFeeRate, { + accounts: { + whirlpoolsConfig, + feeTier: feeTierPda.publicKey, + feeAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-default-protocol-fee-rate-ix.ts b/sdk/src/instructions/set-default-protocol-fee-rate-ix.ts new file mode 100644 index 0000000..55b364a --- /dev/null +++ b/sdk/src/instructions/set-default-protocol-fee-rate-ix.ts @@ -0,0 +1,23 @@ +import { SetDefaultProtocolFeeRateParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSetDefaultProtocolFeeRateIx( + context: WhirlpoolContext, + params: SetDefaultProtocolFeeRateParams +): Instruction { + const { whirlpoolsConfig, feeAuthority, defaultProtocolFeeRate } = params; + + const ix = context.program.instruction.setDefaultProtocolFeeRate(defaultProtocolFeeRate, { + accounts: { + whirlpoolsConfig, + feeAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-fee-authority-ix.ts b/sdk/src/instructions/set-fee-authority-ix.ts new file mode 100644 index 0000000..ed7ccc7 --- /dev/null +++ b/sdk/src/instructions/set-fee-authority-ix.ts @@ -0,0 +1,24 @@ +import { SetFeeAuthorityParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSetFeeAuthorityIx( + context: WhirlpoolContext, + params: SetFeeAuthorityParams +): Instruction { + const { whirlpoolsConfig, feeAuthority, newFeeAuthority } = params; + + const ix = context.program.instruction.setFeeAuthority({ + accounts: { + whirlpoolsConfig, + feeAuthority, + newFeeAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-fee-rate-ix.ts b/sdk/src/instructions/set-fee-rate-ix.ts new file mode 100644 index 0000000..6e88568 --- /dev/null +++ b/sdk/src/instructions/set-fee-rate-ix.ts @@ -0,0 +1,24 @@ +import { SetFeeRateParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSetFeeRateIx( + context: WhirlpoolContext, + params: SetFeeRateParams +): Instruction { + const { whirlpoolsConfig, whirlpool, feeAuthority, feeRate } = params; + + const ix = context.program.instruction.setFeeRate(feeRate, { + accounts: { + whirlpoolsConfig, + whirlpool, + feeAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-protocol-fee-rate-ix.ts b/sdk/src/instructions/set-protocol-fee-rate-ix.ts new file mode 100644 index 0000000..d33af13 --- /dev/null +++ b/sdk/src/instructions/set-protocol-fee-rate-ix.ts @@ -0,0 +1,24 @@ +import { SetProtocolFeeRateParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSetProtocolFeeRateIx( + context: WhirlpoolContext, + params: SetProtocolFeeRateParams +): Instruction { + const { whirlpoolsConfig, whirlpool, feeAuthority, protocolFeeRate } = params; + + const ix = context.program.instruction.setProtocolFeeRate(protocolFeeRate, { + accounts: { + whirlpoolsConfig, + whirlpool, + feeAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-reward-authority-by-super-authority-ix.ts b/sdk/src/instructions/set-reward-authority-by-super-authority-ix.ts new file mode 100644 index 0000000..134dafb --- /dev/null +++ b/sdk/src/instructions/set-reward-authority-by-super-authority-ix.ts @@ -0,0 +1,31 @@ +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { SetRewardAuthorityBySuperAuthorityParams } from ".."; + +export function buildSetRewardAuthorityBySuperAuthorityIx( + context: WhirlpoolContext, + params: SetRewardAuthorityBySuperAuthorityParams +): Instruction { + const { + whirlpoolsConfig, + whirlpool, + rewardEmissionsSuperAuthority, + newRewardAuthority, + rewardIndex, + } = params; + + const ix = context.program.instruction.setRewardAuthorityBySuperAuthority(rewardIndex, { + accounts: { + whirlpoolsConfig, + whirlpool, + rewardEmissionsSuperAuthority, + newRewardAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-reward-authority-ix.ts b/sdk/src/instructions/set-reward-authority-ix.ts new file mode 100644 index 0000000..b3c35d2 --- /dev/null +++ b/sdk/src/instructions/set-reward-authority-ix.ts @@ -0,0 +1,23 @@ +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { SetRewardAuthorityParams } from ".."; + +export function buildSetRewardAuthorityIx( + context: WhirlpoolContext, + params: SetRewardAuthorityParams +): Instruction { + const { whirlpool, rewardAuthority, newRewardAuthority, rewardIndex } = params; + const ix = context.program.instruction.setRewardAuthority(rewardIndex, { + accounts: { + whirlpool, + rewardAuthority, + newRewardAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-reward-emissions-ix.ts b/sdk/src/instructions/set-reward-emissions-ix.ts new file mode 100644 index 0000000..aa3dd93 --- /dev/null +++ b/sdk/src/instructions/set-reward-emissions-ix.ts @@ -0,0 +1,24 @@ +import { SetRewardEmissionsParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSetRewardEmissionsIx( + context: WhirlpoolContext, + params: SetRewardEmissionsParams +): Instruction { + const { rewardAuthority, whirlpool, rewardIndex, rewardVault, emissionsPerSecondX64 } = params; + + const ix = context.program.instruction.setRewardEmissions(rewardIndex, emissionsPerSecondX64, { + accounts: { + rewardAuthority, + whirlpool, + rewardVault, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/set-reward-emissions-super-authority-ix.ts b/sdk/src/instructions/set-reward-emissions-super-authority-ix.ts new file mode 100644 index 0000000..a59167d --- /dev/null +++ b/sdk/src/instructions/set-reward-emissions-super-authority-ix.ts @@ -0,0 +1,25 @@ +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; +import { SetRewardEmissionsSuperAuthorityParams } from ".."; + +export function buildSetRewardEmissionsSuperAuthorityIx( + context: WhirlpoolContext, + params: SetRewardEmissionsSuperAuthorityParams +): Instruction { + const { whirlpoolsConfig, rewardEmissionsSuperAuthority, newRewardEmissionsSuperAuthority } = + params; + + const ix = context.program.instruction.setRewardEmissionsSuperAuthority({ + accounts: { + whirlpoolsConfig, + rewardEmissionsSuperAuthority: rewardEmissionsSuperAuthority, + newRewardEmissionsSuperAuthority, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/swap-ix.ts b/sdk/src/instructions/swap-ix.ts new file mode 100644 index 0000000..9fc7ff5 --- /dev/null +++ b/sdk/src/instructions/swap-ix.ts @@ -0,0 +1,53 @@ +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { SwapParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildSwapIx(context: WhirlpoolContext, params: SwapParams): Instruction { + const { + amount, + otherAmountThreshold, + sqrtPriceLimit, + amountSpecifiedIsInput, + aToB, + whirlpool, + tokenAuthority, + tokenOwnerAccountA, + tokenVaultA, + tokenOwnerAccountB, + tokenVaultB, + tickArray0, + tickArray1, + tickArray2, + oracle, + } = params; + + const ix = context.program.instruction.swap( + amount, + otherAmountThreshold, + sqrtPriceLimit, + amountSpecifiedIsInput, + aToB, + { + accounts: { + tokenProgram: TOKEN_PROGRAM_ID, + tokenAuthority: tokenAuthority, + whirlpool, + tokenOwnerAccountA, + tokenVaultA, + tokenOwnerAccountB, + tokenVaultB, + tickArray0, + tickArray1, + tickArray2, + oracle, + }, + } + ); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/instructions/update-fees-and-rewards-ix.ts b/sdk/src/instructions/update-fees-and-rewards-ix.ts new file mode 100644 index 0000000..e97527a --- /dev/null +++ b/sdk/src/instructions/update-fees-and-rewards-ix.ts @@ -0,0 +1,25 @@ +import { UpdateFeesAndRewardsParams } from ".."; +import { WhirlpoolContext } from "../context"; +import { Instruction } from "../utils/transactions/transactions-builder"; + +export function buildUpdateFeesAndRewardsIx( + context: WhirlpoolContext, + params: UpdateFeesAndRewardsParams +): Instruction { + const { whirlpool, position, tickArrayLower, tickArrayUpper } = params; + + const ix = context.program.instruction.updateFeesAndRewards({ + accounts: { + whirlpool, + position, + tickArrayLower, + tickArrayUpper, + }, + }); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; +} diff --git a/sdk/src/tsconfig.json b/sdk/src/tsconfig.json new file mode 100644 index 0000000..4515aa4 --- /dev/null +++ b/sdk/src/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "composite": true, + }, + "include": [ + "./**/*", + "./artifacts/**/*.json" + ] +} diff --git a/sdk/src/types/public/account-types.ts b/sdk/src/types/public/account-types.ts new file mode 100644 index 0000000..3e85836 --- /dev/null +++ b/sdk/src/types/public/account-types.ts @@ -0,0 +1,16 @@ +import { PublicKey } from "@solana/web3.js"; + +/** + * This file contains the types that the client exposes to SDK users. + * + * TODO: This file may or may not exist pending SDK's approach on parsing + * the Whirlpool Accounts. + * + */ +export interface WhirlpoolConfigAccount { + feeAuthority: PublicKey; + collectProtocolFeesAuthority: PublicKey; + rewardEmissionsSuperAuthority: PublicKey; + defaultFeeRate: number; + defaultProtocolFeeRate: number; +} diff --git a/sdk/src/types/public/anchor-types.ts b/sdk/src/types/public/anchor-types.ts new file mode 100644 index 0000000..178b0ae --- /dev/null +++ b/sdk/src/types/public/anchor-types.ts @@ -0,0 +1,103 @@ +import { BN } from "@project-serum/anchor"; +import { PublicKey } from "@solana/web3.js"; + +/** + * This file contains the types that has the same structure as the types anchor functions returns. + * These types are hard-casted by the client function. + * + * This file must be manually updated every time the idl updates as accounts will + * be hard-casted to fit the type. + */ + +export enum AccountName { + WhirlpoolsConfig = "WhirlpoolsConfig", + Position = "Position", + TickArray = "TickArray", + Whirlpool = "Whirlpool", +} + +export type TickSpacingData = { + stable?: {}; + standard?: {}; +}; + +export type WhirlpoolRewardInfoData = { + mint: PublicKey; + vault: PublicKey; + authority: PublicKey; + emissionsPerSecondX64: BN; + growthGlobalX64: BN; +}; + +export type WhirlpoolBumpsData = { + whirlpoolBump: number; +}; + +export type WhirlpoolData = { + whirlpoolsConfig: PublicKey; + whirlpoolBump: number[]; + feeRate: number; + protocolFeeRate: number; + liquidity: BN; + sqrtPrice: BN; + tickCurrentIndex: number; + protocolFeeOwedA: BN; + protocolFeeOwedB: BN; + tokenMintA: PublicKey; + tokenVaultA: PublicKey; + feeGrowthGlobalA: BN; + tokenMintB: PublicKey; + tokenVaultB: PublicKey; + feeGrowthGlobalB: BN; + rewardLastUpdatedTimestamp: BN; + rewardInfos: WhirlpoolRewardInfoData[]; + tickSpacing: number; +}; + +export type TickArrayData = { + whirlpool: PublicKey; + startTickIndex: number; + ticks: TickData[]; +}; + +export type TickData = { + initialized: boolean; + liquidityNet: BN; + liquidityGross: BN; + feeGrowthOutsideA: BN; + feeGrowthOutsideB: BN; + rewardGrowthsOutside: BN[]; +}; + +export type PositionRewardInfoData = { + growthInsideCheckpoint: BN; + amountOwed: BN; +}; + +export type OpenPositionBumpsData = { + positionBump: number; +}; + +export type OpenPositionWithMetadataBumpsData = { + positionBump: number; + metadataBump: number; +}; + +export type PositionData = { + whirlpool: PublicKey; + positionMint: PublicKey; + liquidity: BN; + tickLowerIndex: number; + tickUpperIndex: number; + feeGrowthCheckpointA: BN; + feeOwedA: BN; + feeGrowthCheckpointB: BN; + feeOwedB: BN; + rewardInfos: PositionRewardInfoData[]; +}; + +export type FeeTierData = { + whirlpoolsConfig: PublicKey; + tickSpacing: number; + defaultFeeRate: number; +}; diff --git a/sdk/src/types/public/constants.ts b/sdk/src/types/public/constants.ts new file mode 100644 index 0000000..689dc2d --- /dev/null +++ b/sdk/src/types/public/constants.ts @@ -0,0 +1,2 @@ +// The number of rewards supported by this whirlpool. +export const NUM_REWARDS = 3; diff --git a/sdk/src/types/public/helper-types.ts b/sdk/src/types/public/helper-types.ts new file mode 100644 index 0000000..a7a6410 --- /dev/null +++ b/sdk/src/types/public/helper-types.ts @@ -0,0 +1,3 @@ +import { PublicKey } from "@solana/web3.js"; + +export type PDA = { publicKey: PublicKey; bump: number }; diff --git a/sdk/src/types/public/index.ts b/sdk/src/types/public/index.ts new file mode 100644 index 0000000..f5c7abd --- /dev/null +++ b/sdk/src/types/public/index.ts @@ -0,0 +1,5 @@ +export * from "./ix-types"; +export * from "./account-types"; +export * from "./constants"; +export * from "./helper-types"; +export * from "./anchor-types"; diff --git a/sdk/src/types/public/ix-types.ts b/sdk/src/types/public/ix-types.ts new file mode 100644 index 0000000..6bebed0 --- /dev/null +++ b/sdk/src/types/public/ix-types.ts @@ -0,0 +1,227 @@ +import { u64 } from "@solana/spl-token"; +import { Keypair, PublicKey } from "@solana/web3.js"; +import BN from "bn.js"; +import { PDA } from "./helper-types"; + +export type InitConfigParams = { + whirlpoolConfigKeypair: Keypair; + feeAuthority: PublicKey; + collectProtocolFeesAuthority: PublicKey; + rewardEmissionsSuperAuthority: PublicKey; + defaultProtocolFeeRate: number; + funder: PublicKey; +}; + +export type InitFeeTierParams = { + feeTierPda: PDA; + feeAuthority: PublicKey; + whirlpoolConfigKey: PublicKey; + tickSpacing: number; + defaultFeeRate: number; + funder: PublicKey; +}; + +export type InitPoolParams = { + initSqrtPrice: BN; + whirlpoolConfigKey: PublicKey; + tokenMintA: PublicKey; + tokenMintB: PublicKey; + whirlpoolPda: PDA; + feeTierKey: PublicKey; + tokenVaultAKeypair: Keypair; + tokenVaultBKeypair: Keypair; + tickSpacing: number; + funder: PublicKey; +}; + +export type InitTickArrayParams = { + whirlpool: PublicKey; + tickArrayPda: PDA; + startTick: number; + funder: PublicKey; +}; + +export type InitializeRewardParams = { + rewardAuthority: PublicKey; + funder: PublicKey; + whirlpool: PublicKey; + rewardMint: PublicKey; + rewardVaultKeypair: Keypair; + rewardIndex: number; +}; + +export type SetRewardEmissionsParams = { + rewardAuthority: PublicKey; + whirlpool: PublicKey; + rewardIndex: number; + rewardVault: PublicKey; + emissionsPerSecondX64: BN; +}; + +export type OpenPositionParams = { + funder: PublicKey; + ownerKey: PublicKey; + positionPda: PDA; + metadataPda?: PDA; + positionMintAddress: PublicKey; + positionTokenAccountAddress: PublicKey; + whirlpoolKey: PublicKey; + tickLowerIndex: number; + tickUpperIndex: number; +}; + +export type ClosePositionParams = { + positionAuthority: PublicKey; + receiver: PublicKey; + position: PublicKey; + positionMint: PublicKey; + positionTokenAccount: PublicKey; +}; + +export type IncreaseLiquidityParams = { + liquidityAmount: BN; + tokenMaxA: u64; + tokenMaxB: u64; + whirlpool: PublicKey; + positionAuthority: PublicKey; + position: PublicKey; + positionTokenAccount: PublicKey; + tokenOwnerAccountA: PublicKey; + tokenOwnerAccountB: PublicKey; + tokenVaultA: PublicKey; + tokenVaultB: PublicKey; + tickArrayLower: PublicKey; + tickArrayUpper: PublicKey; +}; + +export type DecreaseLiquidityParams = { + liquidityAmount: BN; + tokenMinA: u64; + tokenMinB: u64; + whirlpool: PublicKey; + positionAuthority: PublicKey; + position: PublicKey; + positionTokenAccount: PublicKey; + tokenOwnerAccountA: PublicKey; + tokenOwnerAccountB: PublicKey; + tokenVaultA: PublicKey; + tokenVaultB: PublicKey; + tickArrayLower: PublicKey; + tickArrayUpper: PublicKey; +}; + +export type UpdateFeesAndRewardsParams = { + whirlpool: PublicKey; + position: PublicKey; + tickArrayLower: PublicKey; + tickArrayUpper: PublicKey; +}; + +export type CollectFeesParams = { + whirlpool: PublicKey; + positionAuthority: PublicKey; + position: PublicKey; + positionTokenAccount: PublicKey; + tokenOwnerAccountA: PublicKey; + tokenOwnerAccountB: PublicKey; + tokenVaultA: PublicKey; + tokenVaultB: PublicKey; +}; + +export type CollectRewardParams = { + whirlpool: PublicKey; + positionAuthority: PublicKey; + position: PublicKey; + positionTokenAccount: PublicKey; + rewardOwnerAccount: PublicKey; + rewardVault: PublicKey; + rewardIndex: number; +}; + +export type CollectProtocolFeesParams = { + whirlpoolsConfig: PublicKey; + whirlpool: PublicKey; + collectProtocolFeesAuthority: PublicKey; + tokenVaultA: PublicKey; + tokenVaultB: PublicKey; + tokenDestinationA: PublicKey; + tokenDestinationB: PublicKey; +}; + +export type SwapParams = { + amount: u64; + otherAmountThreshold: u64; + sqrtPriceLimit: BN; + amountSpecifiedIsInput: boolean; + aToB: boolean; + whirlpool: PublicKey; + tokenAuthority: PublicKey; + tokenOwnerAccountA: PublicKey; + tokenVaultA: PublicKey; + tokenOwnerAccountB: PublicKey; + tokenVaultB: PublicKey; + tickArray0: PublicKey; + tickArray1: PublicKey; + tickArray2: PublicKey; + oracle: PublicKey; +}; + +export type SetRewardEmissionsSuperAuthorityParams = { + whirlpoolsConfig: PublicKey; + rewardEmissionsSuperAuthority: PublicKey; + newRewardEmissionsSuperAuthority: PublicKey; +}; + +export type SetRewardAuthorityParams = { + whirlpool: PublicKey; + rewardAuthority: PublicKey; + newRewardAuthority: PublicKey; + rewardIndex: number; +}; + +export type SetRewardAuthorityBySuperAuthorityParams = { + whirlpoolsConfig: PublicKey; + whirlpool: PublicKey; + rewardEmissionsSuperAuthority: PublicKey; + newRewardAuthority: PublicKey; + rewardIndex: number; +}; + +export type SetFeeAuthorityParams = { + whirlpoolsConfig: PublicKey; + feeAuthority: PublicKey; + newFeeAuthority: PublicKey; +}; + +export type SetCollectProtocolFeesAuthorityParams = { + whirlpoolsConfig: PublicKey; + collectProtocolFeesAuthority: PublicKey; + newCollectProtocolFeesAuthority: PublicKey; +}; + +export type SetFeeRateParams = { + whirlpool: PublicKey; + whirlpoolsConfig: PublicKey; + feeAuthority: PublicKey; + feeRate: number; +}; + +export type SetProtocolFeeRateParams = { + whirlpool: PublicKey; + whirlpoolsConfig: PublicKey; + feeAuthority: PublicKey; + protocolFeeRate: number; +}; + +export type SetDefaultFeeRateParams = { + whirlpoolsConfig: PublicKey; + feeAuthority: PublicKey; + tickSpacing: number; + defaultFeeRate: number; +}; + +export type SetDefaultProtocolFeeRateParams = { + whirlpoolsConfig: PublicKey; + feeAuthority: PublicKey; + defaultProtocolFeeRate: number; +}; diff --git a/sdk/src/utils/find-program-address.ts b/sdk/src/utils/find-program-address.ts new file mode 100644 index 0000000..6327f81 --- /dev/null +++ b/sdk/src/utils/find-program-address.ts @@ -0,0 +1,8 @@ +import { utils } from "@project-serum/anchor"; +import { PublicKey } from "@solana/web3.js"; +import { PDA } from "../types/public/helper-types"; + +export function findProgramAddress(seeds: (Uint8Array | Buffer)[], programId: PublicKey): PDA { + const [publicKey, bump] = utils.publicKey.findProgramAddressSync(seeds, programId); + return { publicKey, bump }; +} diff --git a/sdk/src/utils/public/addresses.ts b/sdk/src/utils/public/addresses.ts new file mode 100644 index 0000000..dd37df8 --- /dev/null +++ b/sdk/src/utils/public/addresses.ts @@ -0,0 +1,108 @@ +import { PublicKey } from "@solana/web3.js"; +import { findProgramAddress } from "../find-program-address"; +import { BN } from "@project-serum/anchor"; + +const PDA_WHIRLPOOL_SEED = "whirlpool"; +const PDA_VAULT_A_SEED = "token_vault_a"; +const PDA_VAULT_B_SEED = "token_vault_b"; +const PDA_POSITION_SEED = "position"; +const PDA_METADATA_SEED = "metadata"; +const PDA_TICK_ARRAY_SEED = "tick_array"; +const PDA_FEE_TIER_SEED = "fee_tier"; +const PDA_ORACLE_SEED = "oracle"; + +export function getWhirlpoolPda( + programId: PublicKey, + whirlpoolConfigKey: PublicKey, + tokenMintAKey: PublicKey, + tokenMintBKey: PublicKey, + tickSpacing: number +) { + return findProgramAddress( + [ + Buffer.from(PDA_WHIRLPOOL_SEED), + whirlpoolConfigKey.toBuffer(), + tokenMintAKey.toBuffer(), + tokenMintBKey.toBuffer(), + new BN(tickSpacing).toArrayLike(Buffer, "le", 2), + ], + programId + ); +} + +export function getWhirlpoolVaultAPda( + programId: PublicKey, + whirlpoolKey: PublicKey, + tokenMintAKey: PublicKey +) { + return findProgramAddress( + [Buffer.from(PDA_VAULT_A_SEED), whirlpoolKey.toBuffer(), tokenMintAKey.toBuffer()], + programId + ); +} + +export function getWhirlpoolVaultBPda( + programId: PublicKey, + whirlpoolKey: PublicKey, + tokenMintBKey: PublicKey +) { + return findProgramAddress( + [Buffer.from(PDA_VAULT_B_SEED), whirlpoolKey.toBuffer(), tokenMintBKey.toBuffer()], + programId + ); +} + +export function getPositionPda(programId: PublicKey, positionMintKey: PublicKey) { + return findProgramAddress( + [Buffer.from(PDA_POSITION_SEED), positionMintKey.toBuffer()], + programId + ); +} + +export const METADATA_PROGRAM_ADDRESS = new PublicKey( + "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" +); +export function getPositionMetadataPda(positionMintKey: PublicKey) { + return findProgramAddress( + [ + Buffer.from(PDA_METADATA_SEED), + METADATA_PROGRAM_ADDRESS.toBuffer(), + positionMintKey.toBuffer(), + ], + METADATA_PROGRAM_ADDRESS + ); +} + +export function getTickArrayPda( + programId: PublicKey, + whirlpoolAddress: PublicKey, + startTick: number +) { + return findProgramAddress( + [ + Buffer.from(PDA_TICK_ARRAY_SEED), + whirlpoolAddress.toBuffer(), + Buffer.from(startTick.toString()), + ], + programId + ); +} + +export function getFeeTierPda( + programId: PublicKey, + whirlpoolsConfigAddress: PublicKey, + tickSpacing: number +) { + return findProgramAddress( + [ + Buffer.from(PDA_FEE_TIER_SEED), + whirlpoolsConfigAddress.toBuffer(), + new BN(tickSpacing).toArrayLike(Buffer, "le", 2), + ], + programId + ); +} + +export function getOraclePda(programId: PublicKey, whirlpoolAddress: PublicKey) { + return findProgramAddress([Buffer.from(PDA_ORACLE_SEED), whirlpoolAddress.toBuffer()], programId); +} diff --git a/sdk/src/utils/public/index.ts b/sdk/src/utils/public/index.ts new file mode 100644 index 0000000..49949d3 --- /dev/null +++ b/sdk/src/utils/public/index.ts @@ -0,0 +1,5 @@ +export * from "./addresses"; +export * from "./math"; +export * from "./parse"; +export * from "./tick-utils"; +export * from "./liquidity"; diff --git a/sdk/src/utils/public/liquidity.ts b/sdk/src/utils/public/liquidity.ts new file mode 100644 index 0000000..5d0d9c0 --- /dev/null +++ b/sdk/src/utils/public/liquidity.ts @@ -0,0 +1,134 @@ +import { BN } from "@project-serum/anchor"; +import { u64 } from "@solana/spl-token"; +import { min } from "bn.js"; +import Decimal from "decimal.js"; +import { + fromX64_BN, + fromX64_Decimal, + tickIndexToSqrtPriceX64, + toX64, + toX64_BN, + toX64_Decimal, +} from "."; + +export type TokenAmounts = { + tokenA: u64; + tokenB: u64; +}; + +export function toTokenAmount(a: number, b: number): TokenAmounts { + return { + tokenA: new u64(a.toString()), + tokenB: new u64(b.toString()), + }; +} + +/** + * Estimate the liquidity amount required to increase/decrease liquidity. + * + * // TODO: At the top end of the price range, tick calcuation is off therefore the results can be off + * + * @param currTick - Whirlpool's current tick index (aka price) + * @param lowerTick - Position lower tick index + * @param upperTick - Position upper tick index + * @param tokenAmount - The desired amount of tokens to deposit/withdraw + * @returns An estimated amount of liquidity needed to deposit/withdraw the desired amount of tokens. + */ +export function estimateLiquidityFromTokenAmounts( + currTick: number, + lowerTick: number, + upperTick: number, + tokenAmount: TokenAmounts +): BN { + if (upperTick < lowerTick) { + throw new Error("upper tick cannot be lower than the lower tick"); + } + + const currSqrtPrice = tickIndexToSqrtPriceX64(currTick); + const lowerSqrtPrice = tickIndexToSqrtPriceX64(lowerTick); + const upperSqrtPrice = tickIndexToSqrtPriceX64(upperTick); + + if (currTick >= upperTick) { + return estLiquidityForTokenB(upperSqrtPrice, lowerSqrtPrice, tokenAmount.tokenB); + } else if (currTick < lowerTick) { + return estLiquidityForTokenA(lowerSqrtPrice, upperSqrtPrice, tokenAmount.tokenA); + } else { + const estLiquidityAmountA = estLiquidityForTokenA( + currSqrtPrice, + upperSqrtPrice, + tokenAmount.tokenA + ); + const estLiquidityAmountB = estLiquidityForTokenB( + currSqrtPrice, + lowerSqrtPrice, + tokenAmount.tokenB + ); + return BN.min(estLiquidityAmountA, estLiquidityAmountB); + } +} + +export function getTokenAmountsFromLiquidity( + liquidity: u64, + currentPrice: u64, + lowerPrice: u64, + upperPrice: u64, + round_up: boolean +): TokenAmounts { + const _liquidity = new Decimal(liquidity.toString()); + const _currentPrice = new Decimal(currentPrice.toString()); + const _lowerPrice = new Decimal(lowerPrice.toString()); + const _upperPrice = new Decimal(upperPrice.toString()); + let tokenA, tokenB; + if (currentPrice.lt(lowerPrice)) { + // x = L * (pb - pa) / (pa * pb) + tokenA = toX64_Decimal(_liquidity) + .mul(_upperPrice.sub(_lowerPrice)) + .div(_lowerPrice.mul(_upperPrice)); + tokenB = new Decimal(0); + } else if (currentPrice.lt(upperPrice)) { + // x = L * (pb - p) / (p * pb) + // y = L * (p - pa) + tokenA = toX64_Decimal(_liquidity) + .mul(_upperPrice.sub(_currentPrice)) + .div(_currentPrice.mul(_upperPrice)); + tokenB = fromX64_Decimal(_liquidity.mul(_currentPrice.sub(_lowerPrice))); + } else { + // y = L * (pb - pa) + tokenA = new Decimal(0); + tokenB = fromX64_Decimal(_liquidity.mul(_upperPrice.sub(_lowerPrice))); + } + + // TODO: round up + if (round_up) { + return { + tokenA: new u64(tokenA.ceil().toString()), + tokenB: new u64(tokenB.ceil().toString()), + }; + } else { + return { + tokenA: new u64(tokenA.floor().toString()), + tokenB: new u64(tokenB.floor().toString()), + }; + } +} + +// Convert this function based on Delta A = Delta L * (1/sqrt(lower) - 1/sqrt(upper)) +function estLiquidityForTokenA(sqrtPrice1: BN, sqrtPrice2: BN, tokenAmount: u64) { + const lowerSqrtPriceX64 = BN.min(sqrtPrice1, sqrtPrice2); + const upperSqrtPriceX64 = BN.max(sqrtPrice1, sqrtPrice2); + + const num = fromX64_BN(tokenAmount.mul(upperSqrtPriceX64).mul(lowerSqrtPriceX64)); + const dem = upperSqrtPriceX64.sub(lowerSqrtPriceX64); + + return num.div(dem); +} + +// Convert this function based on Delta B = Delta L * (sqrt_price(upper) - sqrt_price(lower)) +function estLiquidityForTokenB(sqrtPrice1: BN, sqrtPrice2: BN, tokenAmount: u64) { + const lowerSqrtPriceX64 = BN.min(sqrtPrice1, sqrtPrice2); + const upperSqrtPriceX64 = BN.max(sqrtPrice1, sqrtPrice2); + + const delta = upperSqrtPriceX64.sub(lowerSqrtPriceX64); + + return toX64_BN(tokenAmount).div(delta); +} diff --git a/sdk/src/utils/public/math.ts b/sdk/src/utils/public/math.ts new file mode 100644 index 0000000..96683ba --- /dev/null +++ b/sdk/src/utils/public/math.ts @@ -0,0 +1,26 @@ +import { BN } from "@project-serum/anchor"; +import Decimal from "decimal.js"; + +export function toX64_BN(num: BN): BN { + return num.mul(new BN(2).pow(new BN(64))); +} + +export function toX64_Decimal(num: Decimal): Decimal { + return num.mul(Decimal.pow(2, 64)); +} + +export function toX64(num: Decimal): BN { + return new BN(num.mul(Decimal.pow(2, 64)).floor().toFixed()); +} + +export function fromX64(num: BN): Decimal { + return new Decimal(num.toString()).mul(Decimal.pow(2, -64)); +} + +export function fromX64_Decimal(num: Decimal): Decimal { + return num.mul(Decimal.pow(2, -64)); +} + +export function fromX64_BN(num: BN): BN { + return num.div(new BN(2).pow(new BN(64))); +} diff --git a/sdk/src/utils/public/parse.ts b/sdk/src/utils/public/parse.ts new file mode 100644 index 0000000..e17f640 --- /dev/null +++ b/sdk/src/utils/public/parse.ts @@ -0,0 +1,42 @@ +import { AccountsCoder, Coder, Idl } from "@project-serum/anchor"; +import { WhirlpoolConfigAccount } from "../.."; +import { + AccountName, + PositionData, + TickArrayData, + WhirlpoolData, +} from "../../types/public/anchor-types"; +import * as WhirlpoolIDL from "../../artifacts/whirlpool.json"; + +const WhirlpoolCoder = new Coder(WhirlpoolIDL as Idl); + +export function parseWhirlpoolsConfig(data: Buffer): WhirlpoolConfigAccount | null { + return parse(AccountName.WhirlpoolsConfig, data); +} + +export function parseWhirlpool(data: Buffer): WhirlpoolData | null { + return parse(AccountName.Whirlpool, data); +} + +export function parsePosition(data: Buffer): PositionData | null { + return parse(AccountName.Position, data); +} + +export function parseTickArray(data: Buffer): TickArrayData | null { + return parse(AccountName.TickArray, data); +} + +function parse(accountName: AccountName, data: Buffer) { + const discriminator = AccountsCoder.accountDiscriminator(accountName); + if (discriminator.compare(data.slice(0, 8))) { + console.error("incorrect account name during parsing"); + return null; + } + + try { + return WhirlpoolCoder.accounts.decode(accountName, data); + } catch (_e) { + console.error("unknown account name during parsing"); + return null; + } +} diff --git a/sdk/src/utils/public/tick-utils.ts b/sdk/src/utils/public/tick-utils.ts new file mode 100644 index 0000000..43bdbed --- /dev/null +++ b/sdk/src/utils/public/tick-utils.ts @@ -0,0 +1,229 @@ +import { BN } from "@project-serum/anchor"; + +export const MAX_TICK_INDEX = 443636; +export const MIN_TICK_INDEX = -443636; +export const TICK_ARRAY_SIZE = 88; + +export const MAX_SQRT_PRICE = "79226673515401279992447579055"; +export const MIN_SQRT_PRICE = "4295048016"; + +const BIT_PRECISION = 14; +const LOG_B_2_X32 = "59543866431248"; +const LOG_B_P_ERR_MARGIN_LOWER_X64 = "184467440737095516"; +const LOG_B_P_ERR_MARGIN_UPPER_X64 = "15793534762490258745"; + +export function tickIndexToSqrtPriceX64(tickIndex: number): BN { + if (tickIndex > MAX_TICK_INDEX || tickIndex < MIN_TICK_INDEX) { + throw new Error("Provided tick index does not fit within supported tick index range."); + } + + if (tickIndex > 0) { + return new BN(tickIndexToSqrtPricePositive(tickIndex)); + } else { + return new BN(tickIndexToSqrtPriceNegative(tickIndex)); + } +} + +export function sqrtPriceX64ToTickIndex(sqrtPriceX64: BN): number { + if (sqrtPriceX64.gt(new BN(MAX_SQRT_PRICE)) || sqrtPriceX64.lt(new BN(MIN_SQRT_PRICE))) { + throw new Error("Provided sqrtPrice is not within the supported sqrtPrice range."); + } + + const msb = sqrtPriceX64.bitLength() - 1; + const adjustedMsb = new BN(msb - 64); + const log2pIntegerX32 = signedShiftLeft(adjustedMsb, 32, 128); + + let bit = new BN("8000000000000000", "hex"); + let precision = 0; + let log2pFractionX64 = new BN(0); + + let r = msb >= 64 ? sqrtPriceX64.shrn(msb - 63) : sqrtPriceX64.shln(63 - msb); + + while (bit.gt(new BN(0)) && precision < BIT_PRECISION) { + r = r.mul(r); + let rMoreThanTwo = r.shrn(127); + r = r.shrn(63 + rMoreThanTwo.toNumber()); + log2pFractionX64 = log2pFractionX64.add(bit.mul(rMoreThanTwo)); + bit = bit.shrn(1); + precision += 1; + } + + const log2pFractionX32 = log2pFractionX64.shrn(32); + + const log2pX32 = log2pIntegerX32.add(log2pFractionX32); + const logbpX64 = log2pX32.mul(new BN(LOG_B_2_X32)); + + const tickLow = signedShiftRight( + logbpX64.sub(new BN(LOG_B_P_ERR_MARGIN_LOWER_X64)), + 64, + 128 + ).toNumber(); + const tickHigh = signedShiftRight( + logbpX64.add(new BN(LOG_B_P_ERR_MARGIN_UPPER_X64)), + 64, + 128 + ).toNumber(); + + if (tickLow == tickHigh) { + return tickLow; + } else { + const derivedTickHighSqrtPriceX64 = tickIndexToSqrtPriceX64(tickHigh); + if (derivedTickHighSqrtPriceX64.lte(sqrtPriceX64)) { + return tickHigh; + } else { + return tickLow; + } + } +} + +export function getStartTickIndex(tickIndex: number, tickSpacing: number): number { + const ticksInArray = tickSpacing * TICK_ARRAY_SIZE; + return Math.floor(tickIndex / ticksInArray) * ticksInArray; +} + +function tickIndexToSqrtPricePositive(tick: number) { + let ratio: BN; + + if ((tick & 1) != 0) { + ratio = new BN("79232123823359799118286999567"); + } else { + ratio = new BN("79228162514264337593543950336"); + } + + if ((tick & 2) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("79236085330515764027303304731")), 96, 256); + } + if ((tick & 4) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("79244008939048815603706035061")), 96, 256); + } + if ((tick & 8) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("79259858533276714757314932305")), 96, 256); + } + if ((tick & 16) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("79291567232598584799939703904")), 96, 256); + } + if ((tick & 32) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("79355022692464371645785046466")), 96, 256); + } + if ((tick & 64) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("79482085999252804386437311141")), 96, 256); + } + if ((tick & 128) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("79736823300114093921829183326")), 96, 256); + } + if ((tick & 256) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("80248749790819932309965073892")), 96, 256); + } + if ((tick & 512) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("81282483887344747381513967011")), 96, 256); + } + if ((tick & 1024) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("83390072131320151908154831281")), 96, 256); + } + if ((tick & 2048) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("87770609709833776024991924138")), 96, 256); + } + if ((tick & 4096) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("97234110755111693312479820773")), 96, 256); + } + if ((tick & 8192) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("119332217159966728226237229890")), 96, 256); + } + if ((tick & 16384) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("179736315981702064433883588727")), 96, 256); + } + if ((tick & 32768) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("407748233172238350107850275304")), 96, 256); + } + if ((tick & 65536) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("2098478828474011932436660412517")), 96, 256); + } + if ((tick & 131072) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("55581415166113811149459800483533")), 96, 256); + } + if ((tick & 262144) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("38992368544603139932233054999993551")), 96, 256); + } + + return signedShiftRight(ratio, 32, 256); +} + +function tickIndexToSqrtPriceNegative(tickIndex: number) { + let tick = Math.abs(tickIndex); + let ratio: BN; + + if ((tick & 1) != 0) { + ratio = new BN("18445821805675392311"); + } else { + ratio = new BN("18446744073709551616"); + } + + if ((tick & 2) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18444899583751176498")), 64, 256); + } + if ((tick & 4) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18443055278223354162")), 64, 256); + } + if ((tick & 8) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18439367220385604838")), 64, 256); + } + if ((tick & 16) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18431993317065449817")), 64, 256); + } + if ((tick & 32) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18417254355718160513")), 64, 256); + } + if ((tick & 64) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18387811781193591352")), 64, 256); + } + if ((tick & 128) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18329067761203520168")), 64, 256); + } + if ((tick & 256) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("18212142134806087854")), 64, 256); + } + if ((tick & 512) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("17980523815641551639")), 64, 256); + } + if ((tick & 1024) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("17526086738831147013")), 64, 256); + } + if ((tick & 2048) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("16651378430235024244")), 64, 256); + } + if ((tick & 4096) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("15030750278693429944")), 64, 256); + } + if ((tick & 8192) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("12247334978882834399")), 64, 256); + } + if ((tick & 16384) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("8131365268884726200")), 64, 256); + } + if ((tick & 32768) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("3584323654723342297")), 64, 256); + } + if ((tick & 65536) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("696457651847595233")), 64, 256); + } + if ((tick & 131072) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("26294789957452057")), 64, 256); + } + if ((tick & 262144) != 0) { + ratio = signedShiftRight(ratio.mul(new BN("37481735321082")), 64, 256); + } + + return ratio; +} + +function signedShiftLeft(n0: BN, shiftBy: number, bitWidth: number) { + let twosN0 = n0.toTwos(bitWidth).shln(shiftBy); + twosN0.imaskn(bitWidth + 1); + return twosN0.fromTwos(bitWidth); +} + +function signedShiftRight(n0: BN, shiftBy: number, bitWidth: number) { + let twoN0 = n0.toTwos(bitWidth).shrn(shiftBy); + twoN0.imaskn(bitWidth - shiftBy + 1); + return twoN0.fromTwos(bitWidth - shiftBy); +} diff --git a/sdk/src/utils/transactions/transactions-builder.ts b/sdk/src/utils/transactions/transactions-builder.ts new file mode 100644 index 0000000..1cc8588 --- /dev/null +++ b/sdk/src/utils/transactions/transactions-builder.ts @@ -0,0 +1,107 @@ +import { Provider } from "@project-serum/anchor"; +import { Transaction, Signer, TransactionInstruction } from "@solana/web3.js"; + +export const EMPTY_INSTRUCTION: Instruction = { + instructions: [], + cleanupInstructions: [], + signers: [], +}; + +export type Instruction = { + instructions: TransactionInstruction[]; + cleanupInstructions: TransactionInstruction[]; + signers: Signer[]; +}; + +export type TransactionPayload = { + transaction: Transaction; + signers: Signer[]; +}; + +export class TransactionBuilder { + private provider: Provider; + private instructions: Instruction[]; + private signers: Signer[]; + + constructor(provider: Provider) { + this.provider = provider; + this.instructions = []; + this.signers = []; + } + + addInstruction(instruction: Instruction): TransactionBuilder { + this.instructions.push(instruction); + return this; + } + + addSigner(signer: Signer): TransactionBuilder { + this.signers.push(signer); + return this; + } + + isEmpty(): boolean { + return this.instructions.length == 0; + } + + /** + * Compresses all instructions & signers in this builder + * into one single instruction + * @param compressPost Compress all post instructions into the instructions field + * @returns Instruction object containing all + */ + compressIx(compressPost: boolean): Instruction { + let instructions: TransactionInstruction[] = []; + let cleanupInstructions: TransactionInstruction[] = []; + let signers: Signer[] = []; + this.instructions.forEach((curr) => { + instructions = instructions.concat(curr.instructions); + // Cleanup instructions should execute in reverse order + cleanupInstructions = curr.cleanupInstructions.concat(cleanupInstructions); + signers = signers.concat(curr.signers); + }); + + if (compressPost) { + instructions = instructions.concat(cleanupInstructions); + cleanupInstructions = []; + } + + return { + instructions: [...instructions], + cleanupInstructions: [...cleanupInstructions], + signers, + }; + } + + /** + * Constructs a transaction payload with the gathered instructions + * @returns a TransactionPayload object that can be excuted or agregated into other transactions + */ + async build(): Promise { + const recentBlockHash = (await this.provider.connection.getRecentBlockhash("singleGossip")) + .blockhash; + + const transaction = new Transaction({ + recentBlockhash: recentBlockHash, + feePayer: this.provider.wallet.publicKey, + }); + + const ix = this.compressIx(true); + + transaction.add(...ix.instructions); + transaction.feePayer = this.provider.wallet.publicKey; + + return { + transaction: transaction, + signers: ix.signers.concat(this.signers), + }; + } + + /** + * Constructs a transaction payload with the gathered instructions, sign it with the provider and send it out + * @returns the txId of the transaction + */ + async buildAndExecute(): Promise { + const tx = await this.build(); + return this.provider.send(tx.transaction, tx.signers, { commitment: "confirmed" }); + } +} diff --git a/sdk/tests/close_position.ts b/sdk/tests/close_position.ts new file mode 100644 index 0000000..23917b4 --- /dev/null +++ b/sdk/tests/close_position.ts @@ -0,0 +1,442 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initTestPool, initTestPoolWithLiquidity, openPosition } from "./utils/init-utils"; +import { + approveToken, + createAndMintToTokenAccount, + createTokenAccount, + setAuthority, + TickSpacing, + transfer, + ZERO_BN, +} from "./utils"; +import { WhirlpoolTestFixture } from "./utils/fixture"; + +describe("close_position", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully closes an open position", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const { params } = await openPosition(client, poolInitInfo.whirlpoolPda.publicKey, 0, 128); + const receiverKeypair = anchor.web3.Keypair.generate(); + + await client + .closePositionTx({ + positionAuthority: provider.wallet.publicKey, + receiver: receiverKeypair.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .buildAndExecute(); + + const supplyResponse = await provider.connection.getTokenSupply(params.positionMintAddress); + assert.equal(supplyResponse.value.uiAmount, 0); + + assert.equal(await provider.connection.getAccountInfo(params.positionPda.publicKey), undefined); + assert.equal( + await provider.connection.getAccountInfo(params.positionTokenAccountAddress), + undefined + ); + + const receiverAccount = await provider.connection.getAccountInfo(receiverKeypair.publicKey); + const lamports = receiverAccount?.lamports; + assert.ok(lamports != undefined && lamports > 0); + }); + + it("succeeds if the position is delegated", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const owner = anchor.web3.Keypair.generate(); + const delegate = anchor.web3.Keypair.generate(); + + const { params } = await openPosition( + client, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + owner.publicKey + ); + + await approveToken( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + 1, + owner + ); + await setAuthority( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + "CloseAccount", + owner + ); + + await client + .closePositionTx({ + positionAuthority: delegate.publicKey, + receiver: owner.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .addSigner(delegate) + .buildAndExecute(); + }); + + it("succeeds with the owner's signature even if the token is delegated", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const owner = anchor.web3.Keypair.generate(); + const delegate = anchor.web3.Keypair.generate(); + + const { params } = await openPosition( + client, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + owner.publicKey + ); + + await approveToken( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + 1, + owner + ); + + await client + .closePositionTx({ + positionAuthority: owner.publicKey, + receiver: owner.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .addSigner(owner) + .buildAndExecute(); + }); + + it("succeeds with position token that was transferred to new owner", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: ZERO_BN }], + }); + const position = fixture.getInfos().positions[0]; + + const newOwner = anchor.web3.Keypair.generate(); + const newOwnerPositionTokenAccount = await createTokenAccount( + provider, + position.mintKeypair.publicKey, + newOwner.publicKey + ); + + await transfer(provider, position.tokenAccount, newOwnerPositionTokenAccount, 1); + + await client + .closePositionTx({ + positionAuthority: newOwner.publicKey, + receiver: newOwner.publicKey, + position: position.publicKey, + positionMint: position.mintKeypair.publicKey, + positionTokenAccount: newOwnerPositionTokenAccount, + }) + .addSigner(newOwner) + .buildAndExecute(); + }); + + it("fails to close a position with liquidity", async () => { + const { positionInfo } = await initTestPoolWithLiquidity(client); + + const receiverKeypair = anchor.web3.Keypair.generate(); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: provider.wallet.publicKey, + receiver: receiverKeypair.publicKey, + position: positionInfo.positionPda.publicKey, + positionMint: positionInfo.positionMintAddress, + positionTokenAccount: positionInfo.positionTokenAccountAddress, + }) + .buildAndExecute(), + /0x1775/ // ClosePositionNotEmpty + ); + }); + + it("fails if owner is not signer", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const owner = anchor.web3.Keypair.generate(); + + const { params } = await openPosition( + client, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + owner.publicKey + ); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: owner.publicKey, + receiver: owner.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails if delegate is not signer", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const owner = anchor.web3.Keypair.generate(); + const delegate = anchor.web3.Keypair.generate(); + + const { params } = await openPosition( + client, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + owner.publicKey + ); + + await approveToken( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + 1, + owner + ); + await setAuthority( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + "CloseAccount", + owner + ); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: delegate.publicKey, + receiver: owner.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails if the authority does not match", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const owner = anchor.web3.Keypair.generate(); + const fakeOwner = anchor.web3.Keypair.generate(); + + const { params } = await openPosition( + client, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + owner.publicKey + ); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: fakeOwner.publicKey, + receiver: owner.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .addSigner(fakeOwner) + .buildAndExecute(), + /0x1783/ // MissingOrInvalidDelegate + ); + }); + + it("fails if position token account does not contain exactly one token", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: ZERO_BN }], + }); + const position = fixture.getInfos().positions[0]; + + const fakePositionTokenAccount = await createTokenAccount( + provider, + position.mintKeypair.publicKey, + provider.wallet.publicKey + ); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: provider.wallet.publicKey, + receiver: provider.wallet.publicKey, + position: position.publicKey, + positionMint: position.mintKeypair.publicKey, + positionTokenAccount: fakePositionTokenAccount, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails if delegated amount is 0", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const owner = anchor.web3.Keypair.generate(); + const delegate = anchor.web3.Keypair.generate(); + + const { params } = await openPosition( + client, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + owner.publicKey + ); + + await approveToken( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + 0, + owner + ); + await setAuthority( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + "CloseAccount", + owner + ); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: delegate.publicKey, + receiver: owner.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1784/ // InvalidPositionTokenAmount + ); + }); + + it("fails if positionAuthority does not match delegate", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const owner = anchor.web3.Keypair.generate(); + const delegate = anchor.web3.Keypair.generate(); + const fakeDelegate = anchor.web3.Keypair.generate(); + + const { params } = await openPosition( + client, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + owner.publicKey + ); + + await approveToken( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + 1, + owner + ); + await setAuthority( + client.context.provider, + params.positionTokenAccountAddress, + delegate.publicKey, + "CloseAccount", + owner + ); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: fakeDelegate.publicKey, + receiver: owner.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .addSigner(fakeDelegate) + .buildAndExecute(), + /0x1783/ // MissingOrInvalidDelegate + ); + }); + + it("fails if position token account mint does not match position mint", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: ZERO_BN }], + }); + const { + poolInitInfo: { tokenMintA }, + positions, + } = fixture.getInfos(); + const position = positions[0]; + + const fakePositionTokenAccount = await createAndMintToTokenAccount(provider, tokenMintA, 1); + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: provider.wallet.publicKey, + receiver: provider.wallet.publicKey, + position: position.publicKey, + positionMint: position.mintKeypair.publicKey, + positionTokenAccount: fakePositionTokenAccount, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails if position_mint does not match position's position_mint field", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: ZERO_BN }], + }); + const { + poolInitInfo: { tokenMintA }, + positions, + } = fixture.getInfos(); + const position = positions[0]; + + await assert.rejects( + client + .closePositionTx({ + positionAuthority: provider.wallet.publicKey, + receiver: provider.wallet.publicKey, + position: position.publicKey, + positionMint: tokenMintA, + positionTokenAccount: position.tokenAccount, + }) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); +}); diff --git a/sdk/tests/collect_fees.ts b/sdk/tests/collect_fees.ts new file mode 100644 index 0000000..929fd8d --- /dev/null +++ b/sdk/tests/collect_fees.ts @@ -0,0 +1,623 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { + approveToken, + createTokenAccount, + getTokenBalance, + TickSpacing, + transfer, + ZERO_BN, +} from "./utils"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { getOraclePda, getPositionPda, getTickArrayPda, toX64 } from "../src"; +import { WhirlpoolTestFixture } from "./utils/fixture"; +import Decimal from "decimal.js"; +import { u64 } from "@solana/spl-token"; +import { initTestPool } from "./utils/init-utils"; + +describe("collect_fees", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully collect fees", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }, // In range position + { tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: new u64(1_000_000) }, // Out of range position + ], + }); + const { + poolInitInfo: { + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tokenMintA, + tokenMintB, + }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const tickArrayPda = getTickArrayPda(context.program.programId, whirlpoolPda.publicKey, 22528); + const positionBeforeSwap = await client.getPosition(positions[0].publicKey); + assert.ok(positionBeforeSwap.feeOwedA.eq(ZERO_BN)); + assert.ok(positionBeforeSwap.feeOwedB.eq(ZERO_BN)); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + // Accrue fees in token A + await client + .swapTx({ + amount: new u64(200_000), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArray0: tickArrayPda.publicKey, + tickArray1: tickArrayPda.publicKey, + tickArray2: tickArrayPda.publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + // Accrue fees in token B + await client + .swapTx({ + amount: new u64(200_000), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(5)), + amountSpecifiedIsInput: true, + aToB: false, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArray0: tickArrayPda.publicKey, + tickArray1: tickArrayPda.publicKey, + tickArray2: tickArrayPda.publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + await client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(); + + const positionBeforeCollect = await client.getPosition(positions[0].publicKey); + assert.ok(positionBeforeCollect.feeOwedA.eq(new u64(581))); + assert.ok(positionBeforeCollect.feeOwedB.eq(new u64(581))); + + const feeAccountA = await createTokenAccount(provider, tokenMintA, provider.wallet.publicKey); + const feeAccountB = await createTokenAccount(provider, tokenMintB, provider.wallet.publicKey); + + await client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: feeAccountA, + tokenOwnerAccountB: feeAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(); + const positionAfter = await client.getPosition(positions[0].publicKey); + const feeBalanceA = await getTokenBalance(provider, feeAccountA); + const feeBalanceB = await getTokenBalance(provider, feeAccountB); + assert.equal(feeBalanceA, "581"); + assert.equal(feeBalanceB, "581"); + assert.ok(positionAfter.feeOwedA.eq(ZERO_BN)); + assert.ok(positionAfter.feeOwedB.eq(ZERO_BN)); + + // Assert out of range position values + await client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[1].publicKey, + tickArrayLower: positions[1].tickArrayLower, + tickArrayUpper: positions[1].tickArrayUpper, + }) + .buildAndExecute(); + const outOfRangePosition = await client.getPosition(positions[1].publicKey); + assert.ok(outOfRangePosition.feeOwedA.eq(ZERO_BN)); + assert.ok(outOfRangePosition.feeOwedB.eq(ZERO_BN)); + }); + + it("successfully collect fees with approved delegate", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: new u64(10_000_000) }, // In range position + ], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + positions, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + const position = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, position.tokenAccount, delegate.publicKey, 1); + + await client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .addSigner(delegate) + .buildAndExecute(); + }); + + it("successfully collect fees with owner even if there is approved delegate", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: new u64(10_000_000) }, // In range position + ], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + positions, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + const position = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, position.tokenAccount, delegate.publicKey, 1); + + await client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(); + }); + + it("successfully collect fees with transferred position token", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 0, tickUpperIndex: 128, liquidityAmount: new u64(10_000_000) }, // In range position + ], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + positions, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + const position = positions[0]; + + const newOwner = anchor.web3.Keypair.generate(); + const newOwnerPositionTokenAccount = await createTokenAccount( + provider, + position.mintKeypair.publicKey, + newOwner.publicKey + ); + + await transfer(provider, position.tokenAccount, newOwnerPositionTokenAccount, 1); + + await client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: newOwner.publicKey, + position: position.publicKey, + positionTokenAccount: newOwnerPositionTokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .addSigner(newOwner) + .buildAndExecute(); + }); + + it("fails when position does not match whirlpool", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { tokenVaultAKeypair, tokenVaultBKeypair }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const { + poolInitInfo: { whirlpoolPda: whirlpoolPda2 }, + } = await initTestPool(client, tickSpacing); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda2.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /0x7d1/ // ConstraintHasOne + ); + }); + + it("fails when position token account does not contain exactly one token", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const positionTokenAccount2 = await createTokenAccount( + provider, + positions[0].mintKeypair.publicKey, + provider.wallet.publicKey + ); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positionTokenAccount2, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + await transfer(provider, positions[0].tokenAccount, positionTokenAccount2, 1); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when position authority is not approved delegate for position token account", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const delegate = anchor.web3.Keypair.generate(); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1783/ // MissingOrInvalidDelegate + ); + }); + + it("fails when position authority is not authorized to transfer exactly one token", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 2); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1784/ // InvalidPositionTokenAmount + ); + }); + + it("fails when position authority is not a signer", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 1); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when position token account mint does not equal position mint", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair, tokenMintA }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const fakePositionTokenAccount = await createTokenAccount( + provider, + tokenMintA, + provider.wallet.publicKey + ); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: fakePositionTokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when token vault does not match whirlpool token vault", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tokenMintA, + tokenMintB, + }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const fakeVaultA = await createTokenAccount(provider, tokenMintA, provider.wallet.publicKey); + const fakeVaultB = await createTokenAccount(provider, tokenMintB, provider.wallet.publicKey); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: fakeVaultA, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: fakeVaultB, + }) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); + + it("fails when owner token account mint does not match whirlpool token mint", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tokenMintA, + tokenMintB, + }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const invalidOwnerAccountA = await createTokenAccount( + provider, + tokenMintB, + provider.wallet.publicKey + ); + const invalidOwnerAccountB = await createTokenAccount( + provider, + tokenMintA, + provider.wallet.publicKey + ); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: invalidOwnerAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + await assert.rejects( + client + .collectFeesTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: invalidOwnerAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); +}); diff --git a/sdk/tests/collect_protocol_fees.ts b/sdk/tests/collect_protocol_fees.ts new file mode 100644 index 0000000..64cf5ee --- /dev/null +++ b/sdk/tests/collect_protocol_fees.ts @@ -0,0 +1,348 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initTestPool } from "./utils/init-utils"; +import { getOraclePda, toX64 } from "../src"; +import { WhirlpoolTestFixture } from "./utils/fixture"; +import { u64 } from "@solana/spl-token"; +import Decimal from "decimal.js"; +import { createTokenAccount, getTokenBalance, TickSpacing, ZERO_BN } from "./utils"; + +describe("collect_protocol_fees", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully collects fees", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(10_000_000) }], + }); + const { + poolInitInfo: { + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tokenMintA, + tokenMintB, + }, + configKeypairs: { feeAuthorityKeypair, collectProtocolFeesAuthorityKeypair }, + configInitInfo: { whirlpoolConfigKeypair }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + await client + .setProtocolFeeRateIx({ + whirlpool: whirlpoolPda.publicKey, + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + feeAuthority: feeAuthorityKeypair.publicKey, + protocolFeeRate: 2500, + }) + .addSigner(feeAuthorityKeypair) + .buildAndExecute(); + + const poolBefore = await client.getPool(whirlpoolPda.publicKey); + assert.ok(poolBefore.protocolFeeOwedA.eq(ZERO_BN)); + assert.ok(poolBefore.protocolFeeOwedB.eq(ZERO_BN)); + + const tickArrayPda = positions[0].tickArrayLower; + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + // Accrue fees in token A + await client + .swapTx({ + amount: new u64(200_000), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArray0: tickArrayPda, + tickArray1: tickArrayPda, + tickArray2: tickArrayPda, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + // Accrue fees in token B + await client + .swapTx({ + amount: new u64(200_000), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(5)), + amountSpecifiedIsInput: true, + aToB: false, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArray0: tickArrayPda, + tickArray1: tickArrayPda, + tickArray2: tickArrayPda, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + const poolAfter = await client.getPool(whirlpoolPda.publicKey); + assert.ok(poolAfter.protocolFeeOwedA.eq(new u64(150))); + assert.ok(poolAfter.protocolFeeOwedB.eq(new u64(150))); + + const destA = await createTokenAccount(provider, tokenMintA, provider.wallet.publicKey); + const destB = await createTokenAccount(provider, tokenMintB, provider.wallet.publicKey); + + await client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tokenDestinationA: destA, + tokenDestinationB: destB, + }) + .addSigner(collectProtocolFeesAuthorityKeypair) + .buildAndExecute(); + + const balanceDestA = await getTokenBalance(provider, destA); + const balanceDestB = await getTokenBalance(provider, destB); + assert.equal(balanceDestA, "150"); + assert.equal(balanceDestB, "150"); + assert.ok(poolBefore.protocolFeeOwedA.eq(ZERO_BN)); + assert.ok(poolBefore.protocolFeeOwedB.eq(ZERO_BN)); + }); + + it("fails to collect fees without the authority's signature", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 29440, tickUpperIndex: 33536, liquidityAmount: new u64(10_000_000) }, + ], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + configKeypairs: { collectProtocolFeesAuthorityKeypair }, + configInitInfo: { whirlpoolConfigKeypair }, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + + await assert.rejects( + client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tokenDestinationA: tokenAccountA, + tokenDestinationB: tokenAccountB, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when collect_protocol_fees_authority is invalid", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 29440, tickUpperIndex: 33536, liquidityAmount: new u64(10_000_000) }, + ], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + configKeypairs: { rewardEmissionsSuperAuthorityKeypair }, + configInitInfo: { whirlpoolConfigKeypair }, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + + await assert.rejects( + client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda.publicKey, + collectProtocolFeesAuthority: rewardEmissionsSuperAuthorityKeypair.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tokenDestinationA: tokenAccountA, + tokenDestinationB: tokenAccountB, + }) + .addSigner(rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); + + it("fails when whirlpool does not match config", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 29440, tickUpperIndex: 33536, liquidityAmount: new u64(10_000_000) }, + ], + }); + const { + poolInitInfo: { tokenVaultAKeypair, tokenVaultBKeypair }, + configKeypairs: { collectProtocolFeesAuthorityKeypair }, + configInitInfo: { whirlpoolConfigKeypair }, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + const { + poolInitInfo: { whirlpoolPda: whirlpoolPda2 }, + } = await initTestPool(client, tickSpacing); + + await assert.rejects( + client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda2.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tokenDestinationA: tokenAccountA, + tokenDestinationB: tokenAccountB, + }) + .addSigner(collectProtocolFeesAuthorityKeypair) + .buildAndExecute(), + /0x7d1/ // ConstraintHasOne + ); + }); + + it("fails when vaults do not match whirlpool vaults", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 29440, tickUpperIndex: 33536, liquidityAmount: new u64(10_000_000) }, + ], + }); + const { + poolInitInfo: { + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tokenMintA, + tokenMintB, + }, + configKeypairs: { collectProtocolFeesAuthorityKeypair }, + configInitInfo: { whirlpoolConfigKeypair }, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + + const fakeVaultA = await createTokenAccount(provider, tokenMintA, provider.wallet.publicKey); + const fakeVaultB = await createTokenAccount(provider, tokenMintB, provider.wallet.publicKey); + + await assert.rejects( + client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: fakeVaultA, + tokenVaultB: tokenVaultBKeypair.publicKey, + tokenDestinationA: tokenAccountA, + tokenDestinationB: tokenAccountB, + }) + .addSigner(collectProtocolFeesAuthorityKeypair) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + + await assert.rejects( + client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: fakeVaultB, + tokenDestinationA: tokenAccountA, + tokenDestinationB: tokenAccountB, + }) + .addSigner(collectProtocolFeesAuthorityKeypair) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); + + it("fails when destination mints do not match whirlpool mints", async () => { + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [ + { tickLowerIndex: 29440, tickUpperIndex: 33536, liquidityAmount: new u64(10_000_000) }, + ], + }); + const { + poolInitInfo: { + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tokenMintA, + tokenMintB, + }, + configKeypairs: { collectProtocolFeesAuthorityKeypair }, + configInitInfo: { whirlpoolConfigKeypair }, + tokenAccountA, + tokenAccountB, + } = fixture.getInfos(); + + const invalidDestA = await createTokenAccount(provider, tokenMintB, provider.wallet.publicKey); + const invalidDestB = await createTokenAccount(provider, tokenMintA, provider.wallet.publicKey); + + await assert.rejects( + client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tokenDestinationA: invalidDestA, + tokenDestinationB: tokenAccountB, + }) + .addSigner(collectProtocolFeesAuthorityKeypair) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + await assert.rejects( + client + .collectProtocolFeesTx({ + whirlpoolsConfig: whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolPda.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tokenDestinationA: tokenAccountA, + tokenDestinationB: invalidDestB, + }) + .addSigner(collectProtocolFeesAuthorityKeypair) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); +}); diff --git a/sdk/tests/collect_reward.ts b/sdk/tests/collect_reward.ts new file mode 100644 index 0000000..441e063 --- /dev/null +++ b/sdk/tests/collect_reward.ts @@ -0,0 +1,605 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { + approveToken, + createAndMintToTokenAccount, + createMint, + createTokenAccount, + getTokenBalance, + sleep, + TickSpacing, + transfer, + ZERO_BN, +} from "./utils"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { u64 } from "@solana/spl-token"; +import { NUM_REWARDS, toX64 } from "../src"; +import Decimal from "decimal.js"; +import { WhirlpoolTestFixture } from "./utils/fixture"; +import { initTestPool } from "./utils/init-utils"; + +describe("collect_reward", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully collect rewards", async () => { + const vaultStartBalance = 1_000_000; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [ + { emissionsPerSecondX64: toX64(new Decimal(10)), vaultAmount: new u64(vaultStartBalance) }, + { emissionsPerSecondX64: toX64(new Decimal(10)), vaultAmount: new u64(vaultStartBalance) }, + { emissionsPerSecondX64: toX64(new Decimal(10)), vaultAmount: new u64(vaultStartBalance) }, + ], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + await sleep(500); + await client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: positions[0].tickArrayLower, + tickArrayUpper: positions[0].tickArrayUpper, + }) + .buildAndExecute(); + + for (let i = 0; i < NUM_REWARDS; i++) { + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[i].rewardMint, + provider.wallet.publicKey + ); + await client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount: rewardOwnerAccount, + rewardVault: rewards[i].rewardVaultKeypair.publicKey, + rewardIndex: i, + }) + .buildAndExecute(); + + const collectedBalance = parseInt(await getTokenBalance(provider, rewardOwnerAccount)); + assert.ok(collectedBalance > 0); + const vaultBalance = parseInt( + await getTokenBalance(provider, rewards[i].rewardVaultKeypair.publicKey) + ); + assert.equal(vaultStartBalance - collectedBalance, vaultBalance); + const position = await client.getPosition(positions[0].publicKey); + assert.equal(position.rewardInfos[i].amountOwed, 0); + assert.ok(position.rewardInfos[i].growthInsideCheckpoint.gte(ZERO_BN)); + } + }); + + it("successfully collect reward with a position authority delegate", async () => { + const vaultStartBalance = 1_000_000; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [ + { emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(vaultStartBalance) }, + ], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + + await client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: positions[0].tickArrayLower, + tickArrayUpper: positions[0].tickArrayUpper, + }) + .buildAndExecute(); + + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 1); + + await client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .addSigner(delegate) + .buildAndExecute(); + }); + + it("successfully collect reward with transferred position token", async () => { + const vaultStartBalance = 1_000_000; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [ + { emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(vaultStartBalance) }, + ], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + + const delegate = anchor.web3.Keypair.generate(); + const delegatePositionAccount = await createTokenAccount( + provider, + positions[0].mintKeypair.publicKey, + delegate.publicKey + ); + await transfer(provider, positions[0].tokenAccount, delegatePositionAccount, 1); + + await client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: positions[0].tickArrayLower, + tickArrayUpper: positions[0].tickArrayUpper, + }) + .buildAndExecute(); + + await client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: delegatePositionAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .addSigner(delegate) + .buildAndExecute(); + }); + + it("successfully collect reward with owner even when there is a delegate", async () => { + const vaultStartBalance = 1_000_000; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [ + { emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(vaultStartBalance) }, + ], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + + await client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: positions[0].tickArrayLower, + tickArrayUpper: positions[0].tickArrayUpper, + }) + .buildAndExecute(); + + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 1); + + await client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(); + }); + + it("fails when reward index references an uninitialized reward", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + } = fixture.getInfos(); + const fakeRewardMint = await createMint(provider); + const rewardOwnerAccount = await createTokenAccount( + provider, + fakeRewardMint, + provider.wallet.publicKey + ); + + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: anchor.web3.PublicKey.default, + rewardIndex: 0, + }) + .buildAndExecute(), + /0xbbf/ // AccountNotInitialized + ); + }); + + it("fails when position does not match whirlpool", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { positions, rewards } = fixture.getInfos(); + + const { + poolInitInfo: { whirlpoolPda }, + } = await initTestPool(client, TickSpacing.Standard); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(), + /0x7d1/ // ConstraintHasOne + ); + }); + + it("fails when position token account does not have exactly one token", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + const otherPositionAcount = await createTokenAccount( + provider, + positions[0].mintKeypair.publicKey, + provider.wallet.publicKey + ); + await transfer(provider, positions[0].tokenAccount, otherPositionAcount, 1); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when position token account mint does not match position mint", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenMintA }, + positions, + rewards, + } = fixture.getInfos(); + + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + + const fakePositionTokenAccount = await createAndMintToTokenAccount(provider, tokenMintA, 1); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: fakePositionTokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when position authority is not approved delegate for position token account", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + const delegate = anchor.web3.Keypair.generate(); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1783/ // MissingOrInvalidDelegate + ); + }); + + it("fails when position authority is not authorized for exactly one token", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 2); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1784/ // InvalidPositionTokenAmount + ); + }); + + it("fails when position authority was not a signer", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 1); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when reward vault does not match whirlpool reward vault", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + rewards[0].rewardMint, + provider.wallet.publicKey + ); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewardOwnerAccount, + rewardIndex: 0, + }) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); + + it("fails when reward owner account mint does not match whirlpool reward mint", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenMintA }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + tokenMintA, + provider.wallet.publicKey + ); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when reward index is out of bounds", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [ + { tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: new anchor.BN(1_000_000) }, + ], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenMintA }, + positions, + rewards, + } = fixture.getInfos(); + const rewardOwnerAccount = await createTokenAccount( + provider, + tokenMintA, + provider.wallet.publicKey + ); + await assert.rejects( + client + .collectRewardTx({ + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + rewardOwnerAccount, + rewardVault: rewards[0].rewardVaultKeypair.publicKey, + rewardIndex: 4, + }) + .buildAndExecute(), + /Program failed to complete/ // index out of bounds + ); + }); +}); diff --git a/sdk/tests/decrease_liquidity.ts b/sdk/tests/decrease_liquidity.ts new file mode 100644 index 0000000..141b8a7 --- /dev/null +++ b/sdk/tests/decrease_liquidity.ts @@ -0,0 +1,812 @@ +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import * as assert from "assert"; +import { initTestPool, initTickArray, openPosition } from "./utils/init-utils"; +import { + approveToken, + createAndMintToTokenAccount, + createMint, + createTokenAccount, + transfer, +} from "./utils/token"; +import { u64 } from "@solana/spl-token"; +import { toX64 } from "../src"; +import Decimal from "decimal.js"; +import { assertTick, TickSpacing, ZERO_BN } from "./utils"; +import { WhirlpoolTestFixture } from "./utils/fixture"; + +describe("decrease_liquidity", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + // TODO: Convert these test cases to take a non-zero min token amount to verify that the calculation is working. + + it("successfully decrease liquidity from position in one tick array", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1.48)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, tokenAccountA, tokenAccountB, positions } = fixture.getInfos(); + const { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair } = poolInitInfo; + const poolBefore = await client.getPool(whirlpoolPda.publicKey); + + const removeAmount = new u64(1_000_000); + await client + .decreaseLiquidityTx({ + liquidityAmount: removeAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positions[0].publicKey, + positionTokenAccount: positions[0].tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArrayLower: positions[0].tickArrayLower, + tickArrayUpper: positions[0].tickArrayUpper, + }) + .buildAndExecute(); + + const remainingLiquidity = liquidityAmount.sub(removeAmount); + const poolAfter = await client.getPool(whirlpoolPda.publicKey); + assert.ok(poolAfter.rewardLastUpdatedTimestamp.gte(poolBefore.rewardLastUpdatedTimestamp)); + assert.ok(poolAfter.liquidity.eq(remainingLiquidity)); + + const position = await client.getPosition(positions[0].publicKey); + assert.ok(position.liquidity.eq(remainingLiquidity)); + + const tickArray = await client.getTickArray(positions[0].tickArrayLower); + assertTick(tickArray.ticks[56], true, remainingLiquidity, remainingLiquidity); + assertTick(tickArray.ticks[70], true, remainingLiquidity, remainingLiquidity.neg()); + }); + + it("successfully decrease liquidity from position in two tick arrays", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair } = poolInitInfo; + const position = positions[0]; + const poolBefore = await client.getPool(whirlpoolPda.publicKey); + + const removeAmount = new u64(1_000_000); + await client + .decreaseLiquidityTx({ + liquidityAmount: removeAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(); + + const remainingLiquidity = liquidityAmount.sub(removeAmount); + const poolAfter = await client.getPool(whirlpoolPda.publicKey); + + assert.ok(poolAfter.rewardLastUpdatedTimestamp.gte(poolBefore.rewardLastUpdatedTimestamp)); + assert.ok(poolAfter.liquidity.eq(remainingLiquidity)); + + const positionAfter = await client.getPosition(position.publicKey); + assert.ok(positionAfter.liquidity.eq(remainingLiquidity)); + + const tickArrayLower = await client.getTickArray(position.tickArrayLower); + assertTick(tickArrayLower.ticks[78], true, remainingLiquidity, remainingLiquidity); + const tickArrayUpper = await client.getTickArray(position.tickArrayUpper); + assertTick(tickArrayUpper.ticks[10], true, remainingLiquidity, remainingLiquidity.neg()); + }); + + it("successfully decrease liquidity with approved delegate", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 1); + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + const removeAmount = new u64(1_000_000); + + await client + .decreaseLiquidityTx({ + liquidityAmount: removeAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .addSigner(delegate) + .buildAndExecute(); + }); + + it("successfully decrease liquidity with owner even if there is approved delegate", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1.48)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + + await approveToken(provider, positions[0].tokenAccount, delegate.publicKey, 1); + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + const removeAmount = new u64(1_000_000); + + await client + .decreaseLiquidityTx({ + liquidityAmount: removeAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(); + }); + + it("successfully decrease liquidity with transferred position token", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1.48)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + + const removeAmount = new u64(1_000_000); + const newOwner = anchor.web3.Keypair.generate(); + const newOwnerPositionTokenAccount = await createTokenAccount( + provider, + position.mintKeypair.publicKey, + newOwner.publicKey + ); + await transfer(provider, position.tokenAccount, newOwnerPositionTokenAccount, 1); + + await client + .decreaseLiquidityTx({ + liquidityAmount: removeAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: newOwner.publicKey, + position: position.publicKey, + positionTokenAccount: newOwnerPositionTokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .addSigner(newOwner) + .buildAndExecute(); + }); + + it("fails when liquidity amount is zero", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair } = poolInitInfo; + const position = positions[0]; + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount: new u64(0), + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x177c/ // LiquidityZero + ); + }); + + it("fails when position has insufficient liquidity for the withdraw amount", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair } = poolInitInfo; + const position = positions[0]; + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount: new u64(1_000), + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x177f/ // LiquidityUnderflow + ); + }); + + it("fails when token min a subceeded", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(0.005)), + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair } = poolInitInfo; + const position = positions[0]; + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(1_000_000), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x1782/ // TokenMinSubceeded + ); + }); + + it("fails when token min b subceeded", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(5)), + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair } = poolInitInfo; + const position = positions[0]; + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x1782/ // TokenMinSubceeded + ); + }); + + it("fails when position account does not have exactly 1 token", async () => { + const liquidityAmount = new u64(1_250_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + + // Create a position token account that contains 0 tokens + const newPositionTokenAccount = await createTokenAccount( + provider, + positions[0].mintKeypair.publicKey, + provider.wallet.publicKey + ); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: newPositionTokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + // Send position token to other position token account + await transfer(provider, position.tokenAccount, newPositionTokenAccount, 1); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when position token account mint does not match position mint", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenMintA } = poolInitInfo; + const position = positions[0]; + + const invalidPositionTokenAccount = await createAndMintToTokenAccount(provider, tokenMintA, 1); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: invalidPositionTokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // A raw constraint was violated + ); + }); + + it("fails when position does not match whirlpool", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const tickArray = positions[0].tickArrayLower; + + const { poolInitInfo: poolInitInfo2 } = await initTestPool(client, TickSpacing.Standard); + const { + params: { positionPda, positionTokenAccountAddress }, + } = await openPosition(client, poolInitInfo2.whirlpoolPda.publicKey, 7168, 8960); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionPda.publicKey, + positionTokenAccount: positionTokenAccountAddress, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArray, + tickArrayUpper: tickArray, + }) + .buildAndExecute(), + /0x7d1/ // A has_one constraint was violated + ); + }); + + it("fails when token vaults do not match whirlpool vaults", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenMintA, tokenMintB } = poolInitInfo; + const position = positions[0]; + + const fakeVaultA = await createAndMintToTokenAccount(provider, tokenMintA, 1_000); + const fakeVaultB = await createAndMintToTokenAccount(provider, tokenMintB, 1_000); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: fakeVaultA, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: fakeVaultB, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when owner token account mint does not match whirlpool token mint", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const invalidMint = await createMint(provider); + const invalidTokenAccount = await createAndMintToTokenAccount(provider, invalidMint, 1_000_000); + const position = positions[0]; + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: invalidTokenAccount, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: invalidTokenAccount, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when position authority is not approved delegate for position token account", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + const delegate = anchor.web3.Keypair.generate(); + + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1783/ // MissingOrInvalidDelegate + ); + }); + + it("fails when position authority is not authorized for exactly 1 token", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + const delegate = anchor.web3.Keypair.generate(); + + await approveToken(provider, position.tokenAccount, delegate.publicKey, 0); + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1784/ // InvalidPositionTokenAmount + ); + }); + + it("fails when position authority was not a signer", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + const delegate = anchor.web3.Keypair.generate(); + + await approveToken(provider, position.tokenAccount, delegate.publicKey, 1); + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(167_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: position.tickArrayLower, + tickArrayUpper: position.tickArrayUpper, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when tick arrays do not match the position", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + + const { + params: { tickArrayPda: tickArrayLowerPda }, + } = await initTickArray(client, whirlpoolPda.publicKey, 11264); + + const { + params: { tickArrayPda: tickArrayUpperPda }, + } = await initTickArray(client, whirlpoolPda.publicKey, 22528); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayLowerPda.publicKey, + tickArrayUpper: tickArrayUpperPda.publicKey, + }) + .buildAndExecute(), + /0x1779/ // TicKNotFound + ); + }); + + it("fails when the tick arrays are for a different whirlpool", async () => { + const liquidityAmount = new u64(6_500_000); + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(2.2)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const position = positions[0]; + + const { poolInitInfo: poolInitInfo2 } = await initTestPool(client, TickSpacing.Standard); + + const { + params: { tickArrayPda: tickArrayLowerPda }, + } = await initTickArray(client, poolInitInfo2.whirlpoolPda.publicKey, -11264); + + const { + params: { tickArrayPda: tickArrayUpperPda }, + } = await initTickArray(client, poolInitInfo2.whirlpoolPda.publicKey, 0); + + await assert.rejects( + client + .decreaseLiquidityTx({ + liquidityAmount, + tokenMinA: new u64(0), + tokenMinB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: position.publicKey, + positionTokenAccount: position.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayLowerPda.publicKey, + tickArrayUpper: tickArrayUpperPda.publicKey, + }) + .buildAndExecute(), + /0x7d1/ // A has one constraint was violated + ); + }); +}); diff --git a/sdk/tests/increase_liquidity.ts b/sdk/tests/increase_liquidity.ts new file mode 100644 index 0000000..179ddd9 --- /dev/null +++ b/sdk/tests/increase_liquidity.ts @@ -0,0 +1,1059 @@ +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import * as assert from "assert"; +import { initTestPool, initTickArray, openPosition } from "./utils/init-utils"; +import { + approveToken, + createAndMintToTokenAccount, + createMint, + createTokenAccount, + getTokenBalance, + transfer, +} from "./utils/token"; +import { + estimateLiquidityFromTokenAmounts, + getStartTickIndex, + getTickArrayPda, + tickIndexToSqrtPriceX64, + toTokenAmount, + toX64, + TransactionBuilder, +} from "../src"; +import Decimal from "decimal.js"; +import { u64 } from "@solana/spl-token"; +import { assertTick, MAX_U64, TickSpacing, ZERO_BN } from "./utils"; +import { WhirlpoolTestFixture } from "./utils/fixture"; +import { BN } from "@project-serum/anchor"; +import { buildIncreaseLiquidityIx } from "../src/instructions/increase-liquidity-ix"; +import { + buildOpenPositionIx, + buildOpenPositionWithMetadataIx, +} from "../src/instructions/open-position-ix"; +import { + generateDefaultInitTickArrayParams, + generateDefaultOpenPositionParams, +} from "./utils/test-builders"; +import { buildInitTickArrayIx } from "../src/instructions/initialize-tick-array-ix"; + +describe("increase_liquidity", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("increase liquidity of a position spanning two tick arrays", async () => { + const currTick = 0; + const tickLowerIndex = -1280, + tickUpperIndex = 1280; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: ZERO_BN }], + initialSqrtPrice: tickIndexToSqrtPriceX64(currTick), + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const poolBefore = await client.getPool(whirlpoolPda.publicKey); + const tokenAmount = toTokenAmount(167_000, 167_000); + const liquidityAmount = estimateLiquidityFromTokenAmounts( + currTick, + tickLowerIndex, + tickUpperIndex, + tokenAmount + ); + + await client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: tokenAmount.tokenA, + tokenMaxB: tokenAmount.tokenB, + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(); + + const position = await client.getPosition(positionInitInfo.publicKey); + assert.ok(position.liquidity.eq(liquidityAmount)); + + const poolAfter = await client.getPool(whirlpoolPda.publicKey); + assert.ok(poolAfter.rewardLastUpdatedTimestamp.gte(poolBefore.rewardLastUpdatedTimestamp)); + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey), + tokenAmount.tokenA.toString() + ); + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey), + tokenAmount.tokenB.toString() + ); + assert.ok(poolAfter.liquidity.eq(new BN(liquidityAmount))); + + const tickArrayLower = await client.getTickArray(positionInitInfo.tickArrayLower); + assertTick(tickArrayLower.ticks[78], true, liquidityAmount, liquidityAmount); + const tickArrayUpper = await client.getTickArray(positionInitInfo.tickArrayUpper); + assertTick(tickArrayUpper.ticks[10], true, liquidityAmount, liquidityAmount.neg()); + }); + + it("increase liquidity of a position contained in one tick array", async () => { + const currTick = 500; + const tickLowerIndex = 7168; + const tickUpperIndex = 8960; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: ZERO_BN }], + initialSqrtPrice: tickIndexToSqrtPriceX64(currTick), + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + const poolBefore = await client.getPool(whirlpoolPda.publicKey); + + const tokenAmount = toTokenAmount(1_000_000, 0); + const liquidityAmount = estimateLiquidityFromTokenAmounts( + currTick, + tickLowerIndex, + tickUpperIndex, + tokenAmount + ); + + await client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: tokenAmount.tokenA, + tokenMaxB: tokenAmount.tokenB, + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(); + + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey), + tokenAmount.tokenA.toString() + ); + + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey), + tokenAmount.tokenB.toString() + ); + + const expectedLiquidity = new anchor.BN(liquidityAmount); + const position = await client.getPosition(positionInitInfo.publicKey); + assert.ok(position.liquidity.eq(expectedLiquidity)); + + const tickArray = await client.getTickArray(positionInitInfo.tickArrayLower); + + assertTick(tickArray.ticks[56], true, expectedLiquidity, expectedLiquidity); + assertTick(tickArray.ticks[70], true, expectedLiquidity, expectedLiquidity.neg()); + + const poolAfter = await client.getPool(whirlpoolPda.publicKey); + assert.ok(poolAfter.rewardLastUpdatedTimestamp.gte(poolBefore.rewardLastUpdatedTimestamp)); + assert.equal(poolAfter.liquidity, 0); + }); + + it("initialize and increase liquidity of a position in a single transaction", async () => { + const currTick = 500; + const tickLowerIndex = 7168; + const tickUpperIndex = 8960; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: tickIndexToSqrtPriceX64(currTick), + }); + const { poolInitInfo, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tickSpacing } = poolInitInfo; + const poolBefore = await client.getPool(whirlpoolPda.publicKey); + + const tokenAmount = toTokenAmount(1_000_000, 0); + const liquidityAmount = estimateLiquidityFromTokenAmounts( + currTick, + tickLowerIndex, + tickUpperIndex, + tokenAmount + ); + + const { params, mint } = await generateDefaultOpenPositionParams( + client.context, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex, + context.wallet.publicKey + ); + + const tickArrayLower = getTickArrayPda( + client.context.program.programId, + whirlpoolPda.publicKey, + getStartTickIndex(tickLowerIndex, tickSpacing) + ).publicKey; + + const tickArrayUpper = getTickArrayPda( + client.context.program.programId, + whirlpoolPda.publicKey, + getStartTickIndex(tickUpperIndex, tickSpacing) + ).publicKey; + + await new TransactionBuilder(client.context.provider) + // TODO: create a ComputeBudgetInstruction to request more compute + .addInstruction( + buildInitTickArrayIx( + client.context, + generateDefaultInitTickArrayParams( + client.context, + whirlpoolPda.publicKey, + getStartTickIndex(tickLowerIndex, tickSpacing) + ) + ) + ) + // .addInstruction( + // buildInitTickArrayIx(client.context, generateDefaultInitTickArrayParams( + // client.context, + // whirlpoolPda.publicKey, + // getStartTickIndex(pos[0].tickLowerIndex + TICK_ARRAY_SIZE * tickSpacing, tickSpacing), + // )) + // ) + .addInstruction(buildOpenPositionIx(client.context, params)) + // .addInstruction( + // buildOpenPositionWithMetadataIx(client.context, params) + // ) + .addSigner(mint) + .addInstruction( + buildIncreaseLiquidityIx(client.context, { + liquidityAmount, + tokenMaxA: tokenAmount.tokenA, + tokenMaxB: tokenAmount.tokenB, + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: params.positionPda.publicKey, + positionTokenAccount: params.positionTokenAccountAddress, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayLower, + tickArrayUpper: tickArrayUpper, + }) + ) + .buildAndExecute(); + + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey), + tokenAmount.tokenA.toString() + ); + + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey), + tokenAmount.tokenB.toString() + ); + + const expectedLiquidity = new anchor.BN(liquidityAmount); + const position = await client.getPosition(params.positionPda.publicKey); + assert.ok(position.liquidity.eq(expectedLiquidity)); + + const tickArray = await client.getTickArray(tickArrayLower); + + assertTick(tickArray.ticks[56], true, expectedLiquidity, expectedLiquidity); + assertTick(tickArray.ticks[70], true, expectedLiquidity, expectedLiquidity.neg()); + + const poolAfter = await client.getPool(whirlpoolPda.publicKey); + assert.ok(poolAfter.rewardLastUpdatedTimestamp.gte(poolBefore.rewardLastUpdatedTimestamp)); + assert.equal(poolAfter.liquidity, 0); + }); + + it("increase liquidity of a position with an approved position authority delegate", async () => { + const currTick = 1300; + const tickLowerIndex = -1280, + tickUpperIndex = 1280; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: ZERO_BN }], + initialSqrtPrice: tickIndexToSqrtPriceX64(currTick), + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const poolBefore = await client.getPool(whirlpoolPda.publicKey); + const tokenAmount = toTokenAmount(0, 167_000); + const liquidityAmount = estimateLiquidityFromTokenAmounts( + currTick, + tickLowerIndex, + tickUpperIndex, + tokenAmount + ); + + const delegate = anchor.web3.Keypair.generate(); + await approveToken(provider, positionInitInfo.tokenAccount, delegate.publicKey, 1); + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + await client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: tokenAmount.tokenA, + tokenMaxB: tokenAmount.tokenB, + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .addSigner(delegate) + .buildAndExecute(); + + const position = await client.getPosition(positionInitInfo.publicKey); + assert.ok(position.liquidity.eq(liquidityAmount)); + + const poolAfter = await client.getPool(whirlpoolPda.publicKey); + assert.ok(poolAfter.rewardLastUpdatedTimestamp.gte(poolBefore.rewardLastUpdatedTimestamp)); + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey), + tokenAmount.tokenA.toString() + ); + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey), + tokenAmount.tokenB.toString() + ); + assert.equal(poolAfter.liquidity, 0); + + const tickArrayLower = await client.getTickArray(positionInitInfo.tickArrayLower); + assertTick(tickArrayLower.ticks[78], true, liquidityAmount, liquidityAmount); + const tickArrayUpper = await client.getTickArray(positionInitInfo.tickArrayUpper); + assertTick(tickArrayUpper.ticks[10], true, liquidityAmount, liquidityAmount.neg()); + }); + + it("add maximum amount of liquidity near minimum price", async () => { + const currTick = -443621; + const { poolInitInfo } = await initTestPool( + client, + TickSpacing.Stable, + tickIndexToSqrtPriceX64(currTick) + ); + + const { tokenMintA, tokenMintB, whirlpoolPda } = poolInitInfo; + const tokenAccountA = await createAndMintToTokenAccount(provider, tokenMintA, MAX_U64); + const tokenAccountB = await createAndMintToTokenAccount(provider, tokenMintB, MAX_U64); + + const { + params: { tickArrayPda }, + } = await initTickArray(client, whirlpoolPda.publicKey, -444224); + + const tickLowerIndex = -443632; + const tickUpperIndex = -443624; + const positionInfo = await openPosition( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex + ); + const { positionPda, positionTokenAccountAddress } = positionInfo.params; + + const tokenAmount = { + tokenA: new u64(0), + tokenB: MAX_U64, + }; + const estLiquidityAmount = estimateLiquidityFromTokenAmounts( + currTick, + tickLowerIndex, + tickUpperIndex, + tokenAmount + ); + + await client + .increaseLiquidityTx({ + liquidityAmount: estLiquidityAmount, + tokenMaxA: tokenAmount.tokenA, + tokenMaxB: tokenAmount.tokenB, + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionPda.publicKey, + positionTokenAccount: positionTokenAccountAddress, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(); + + const position = await client.getPosition(positionPda.publicKey); + assert.ok(position.liquidity.eq(estLiquidityAmount)); + }); + + it("add maximum amount of liquidity near maximum price", async () => { + const currTick = 443635; + const { poolInitInfo } = await initTestPool( + client, + TickSpacing.Stable, + tickIndexToSqrtPriceX64(currTick) + ); + + const { tokenMintA, tokenMintB, whirlpoolPda } = poolInitInfo; + const tokenAccountA = await createAndMintToTokenAccount(provider, tokenMintA, MAX_U64); + const tokenAccountB = await createAndMintToTokenAccount(provider, tokenMintB, MAX_U64); + + const { + params: { tickArrayPda }, + } = await initTickArray(client, whirlpoolPda.publicKey, 436480); + + const tickLowerIndex = 436488; + const tickUpperIndex = 436496; + const positionInfo = await openPosition( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex + ); + const { positionPda, positionTokenAccountAddress } = positionInfo.params; + + const tokenAmount = { + tokenA: new u64(0), + tokenB: MAX_U64, + }; + const estLiquidityAmount = estimateLiquidityFromTokenAmounts( + currTick, + tickLowerIndex, + tickUpperIndex, + tokenAmount + ); + + await client + .increaseLiquidityTx({ + liquidityAmount: estLiquidityAmount, + tokenMaxA: tokenAmount.tokenA, + tokenMaxB: tokenAmount.tokenB, + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionPda.publicKey, + positionTokenAccount: positionTokenAccountAddress, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(); + + const position = await client.getPosition(positionPda.publicKey); + assert.ok(position.liquidity.eq(estLiquidityAmount)); + }); + + it("fails with zero liquidity amount", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount: ZERO_BN, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x177c/ // LiquidityZero + ); + }); + + it("fails when token max a exceeded", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + initialSqrtPrice: toX64(new Decimal(1)), + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const liquidityAmount = new u64(6_500_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(999_999_999), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x1781/ // TokenMaxExceeded + ); + }); + + it("fails when token max b exceeded", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const liquidityAmount = new u64(6_500_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(999_999_999), + tokenMaxB: new u64(0), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x1781/ // TokenMaxExceeded + ); + }); + + it("fails when position account does not have exactly 1 token", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + // Create a position token account that contains 0 tokens + const newPositionTokenAccount = await createTokenAccount( + provider, + positionInitInfo.mintKeypair.publicKey, + provider.wallet.publicKey + ); + + const liquidityAmount = new u64(6_500_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: newPositionTokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + // Send position token to other position token account + await transfer(provider, positionInitInfo.tokenAccount, newPositionTokenAccount, 1); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when position token account mint does not match position mint", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenMintA } = poolInitInfo; + const positionInitInfo = positions[0]; + + // Create a position token account that contains 0 tokens + const invalidPositionTokenAccount = await createAndMintToTokenAccount(provider, tokenMintA, 1); + + const liquidityAmount = new u64(6_500_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: invalidPositionTokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // A raw constraint was violated + ); + }); + + it("fails when position does not match whirlpool", async () => { + const tickLowerIndex = 7168; + const tickUpperIndex = 8960; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + + const { poolInitInfo: poolInitInfo2 } = await initTestPool(client, TickSpacing.Standard); + const positionInitInfo = await openPosition( + client, + poolInitInfo2.whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex + ); + const { positionPda, positionTokenAccountAddress } = positionInitInfo.params; + + const { + params: { tickArrayPda }, + } = await initTickArray(client, poolInitInfo2.whirlpoolPda.publicKey, 0); + + const liquidityAmount = new u64(6_500_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionPda.publicKey, + positionTokenAccount: positionTokenAccountAddress, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(), + /0x7d1/ // A has_one constraint was violated + ); + }); + + it("fails when token vaults do not match whirlpool vaults", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda, tokenMintA, tokenMintB } = poolInitInfo; + const positionInitInfo = positions[0]; + const liquidityAmount = new u64(6_500_000); + + const fakeVaultA = await createAndMintToTokenAccount(provider, tokenMintA, 1_000); + const fakeVaultB = await createAndMintToTokenAccount(provider, tokenMintB, 1_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: fakeVaultA, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: fakeVaultB, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when owner token account mint does not match whirlpool token mint", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: 7168, tickUpperIndex: 8960, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + const liquidityAmount = new u64(6_500_000); + + const invalidMint = await createMint(provider); + const invalidTokenAccount = await createAndMintToTokenAccount(provider, invalidMint, 1_000_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: invalidTokenAccount, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(1_000_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: invalidTokenAccount, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails when position authority is not approved delegate for position token account", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + + const liquidityAmount = new u64(1_250_000); + + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(167_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1783/ // MissingOrInvalidDelegate + ); + }); + + it("fails when position authority is not authorized for exactly 1 token", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + + const liquidityAmount = new u64(1_250_000); + + await approveToken(provider, positionInitInfo.tokenAccount, delegate.publicKey, 0); + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(167_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x1784/ // InvalidPositionTokenAmount + ); + }); + + it("fails when position authority was not a signer", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + + const liquidityAmount = new u64(1_250_000); + + await approveToken(provider, positionInitInfo.tokenAccount, delegate.publicKey, 1); + await approveToken(provider, tokenAccountA, delegate.publicKey, 1_000_000); + await approveToken(provider, tokenAccountB, delegate.publicKey, 1_000_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(167_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when position authority is not approved for token owner accounts", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const delegate = anchor.web3.Keypair.generate(); + + const liquidityAmount = new u64(1_250_000); + + await approveToken(provider, positionInitInfo.tokenAccount, delegate.publicKey, 1); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(167_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: delegate.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: positionInitInfo.tickArrayLower, + tickArrayUpper: positionInitInfo.tickArrayUpper, + }) + .addSigner(delegate) + .buildAndExecute(), + /0x4/ // owner does not match + ); + }); + + it("fails when tick arrays do not match the position", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const { + params: { tickArrayPda: tickArrayLowerPda }, + } = await initTickArray(client, whirlpoolPda.publicKey, 11264); + + const { + params: { tickArrayPda: tickArrayUpperPda }, + } = await initTickArray(client, whirlpoolPda.publicKey, 22528); + + const liquidityAmount = new u64(1_250_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(167_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayLowerPda.publicKey, + tickArrayUpper: tickArrayUpperPda.publicKey, + }) + .buildAndExecute(), + /0x1779/ // TicKNotFound + ); + }); + + it("fails when the tick arrays are for a different whirlpool", async () => { + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing: TickSpacing.Standard, + positions: [{ tickLowerIndex: -1280, tickUpperIndex: 1280, liquidityAmount: ZERO_BN }], + }); + const { poolInitInfo, positions, tokenAccountA, tokenAccountB } = fixture.getInfos(); + const { whirlpoolPda } = poolInitInfo; + const positionInitInfo = positions[0]; + + const { poolInitInfo: poolInitInfo2 } = await initTestPool(client, TickSpacing.Standard); + + const { + params: { tickArrayPda: tickArrayLowerPda }, + } = await initTickArray(client, poolInitInfo2.whirlpoolPda.publicKey, -11264); + + const { + params: { tickArrayPda: tickArrayUpperPda }, + } = await initTickArray(client, poolInitInfo2.whirlpoolPda.publicKey, 0); + + const liquidityAmount = new u64(1_250_000); + + await assert.rejects( + client + .increaseLiquidityTx({ + liquidityAmount, + tokenMaxA: new u64(0), + tokenMaxB: new u64(167_000), + whirlpool: whirlpoolPda.publicKey, + positionAuthority: provider.wallet.publicKey, + position: positionInitInfo.publicKey, + positionTokenAccount: positionInitInfo.tokenAccount, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArrayLower: tickArrayLowerPda.publicKey, + tickArrayUpper: tickArrayUpperPda.publicKey, + }) + .buildAndExecute(), + /0x7d1/ // A has one constraint was violated + ); + }); +}); diff --git a/sdk/tests/initialize_config.ts b/sdk/tests/initialize_config.ts new file mode 100644 index 0000000..0651e6c --- /dev/null +++ b/sdk/tests/initialize_config.ts @@ -0,0 +1,55 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { InitConfigParams } from "../src/types/public/ix-types"; +import { generateDefaultConfigParams } from "./utils/test-builders"; +import { ONE_SOL, systemTransferTx } from "./utils"; + +describe("initialize_config", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + let initializedConfigInfo: InitConfigParams; + + it("successfully init a WhirlpoolsConfig account", async () => { + const { configInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + const configAccount = await client.getConfig(configInitInfo.whirlpoolConfigKeypair.publicKey); + + assert.ok( + configAccount.collectProtocolFeesAuthority.equals(configInitInfo.collectProtocolFeesAuthority) + ); + + assert.ok(configAccount.feeAuthority.equals(configInitInfo.feeAuthority)); + + assert.ok( + configAccount.rewardEmissionsSuperAuthority.equals( + configInitInfo.rewardEmissionsSuperAuthority + ) + ); + + assert.equal(configAccount.defaultProtocolFeeRate, configInitInfo.defaultProtocolFeeRate); + + initializedConfigInfo = configInitInfo; + }); + + it("fail on passing in already initialized whirlpool account", async () => { + let infoWithDupeConfigKey = { + ...generateDefaultConfigParams(context).configInitInfo, + whirlpoolConfigKeypair: initializedConfigInfo.whirlpoolConfigKeypair, + }; + await assert.rejects(client.initConfigTx(infoWithDupeConfigKey).buildAndExecute(), /0x0/); + }); + + it("succeeds when funder is different than account paying for transaction fee", async () => { + const funderKeypair = anchor.web3.Keypair.generate(); + await systemTransferTx(provider, funderKeypair.publicKey, ONE_SOL).buildAndExecute(); + const { configInitInfo } = generateDefaultConfigParams(context, funderKeypair.publicKey); + await client.initConfigTx(configInitInfo).addSigner(funderKeypair).buildAndExecute(); + }); +}); diff --git a/sdk/tests/initialize_fee_tier.ts b/sdk/tests/initialize_fee_tier.ts new file mode 100644 index 0000000..aed0339 --- /dev/null +++ b/sdk/tests/initialize_fee_tier.ts @@ -0,0 +1,137 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initFeeTier } from "./utils/init-utils"; +import { + generateDefaultConfigParams, + generateDefaultInitFeeTierParams, +} from "./utils/test-builders"; +import { getFeeTierPda } from "../src"; +import { systemTransferTx, ONE_SOL, TickSpacing } from "./utils"; + +describe("initialize_fee_tier", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully init a FeeRate stable account", async () => { + const { configInitInfo, configKeypairs } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + const testTickSpacing = TickSpacing.Stable; + const { params } = await initFeeTier( + client, + configInitInfo, + configKeypairs.feeAuthorityKeypair, + testTickSpacing, + 800 + ); + + const generatedPda = getFeeTierPda( + client.context.program.programId, + configInitInfo.whirlpoolConfigKeypair.publicKey, + testTickSpacing + ); + + const feeTierAccount = await client.getFeeTier(generatedPda.publicKey); + + assert.ok(feeTierAccount.tickSpacing == params.tickSpacing); + assert.ok(feeTierAccount.defaultFeeRate == params.defaultFeeRate); + }); + + it("successfully init a FeeRate standard account", async () => { + const { configInitInfo, configKeypairs } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + const testTickSpacing = TickSpacing.Standard; + const { params } = await initFeeTier( + client, + configInitInfo, + configKeypairs.feeAuthorityKeypair, + testTickSpacing, + 3000 + ); + + const feeTierAccount = await client.getFeeTier(params.feeTierPda.publicKey); + + assert.ok(feeTierAccount.tickSpacing == params.tickSpacing); + assert.ok(feeTierAccount.defaultFeeRate == params.defaultFeeRate); + }); + + it("successfully init a FeeRate with another funder wallet", async () => { + const { configInitInfo, configKeypairs } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + const funderKeypair = anchor.web3.Keypair.generate(); + await systemTransferTx(provider, funderKeypair.publicKey, ONE_SOL).buildAndExecute(); + + await initFeeTier( + client, + configInitInfo, + configKeypairs.feeAuthorityKeypair, + TickSpacing.Stable, + 3000, + funderKeypair + ); + }); + + it("fails when default fee rate exceeds max", async () => { + const { configInitInfo, configKeypairs } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + initFeeTier( + client, + configInitInfo, + configKeypairs.feeAuthorityKeypair, + TickSpacing.Stable, + 20_000 + ), + /0x178c/ // FeeRateMaxExceeded + ); + }); + + it("fails when fee authority is not a signer", async () => { + const { configInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + client + .initFeeTierTx( + generateDefaultInitFeeTierParams( + client.context, + configInitInfo.whirlpoolConfigKeypair.publicKey, + configInitInfo.feeAuthority, + TickSpacing.Stable, + 3000 + ) + ) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when invalid fee authority provided", async () => { + const { configInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + const fakeFeeAuthorityKeypair = anchor.web3.Keypair.generate(); + + await assert.rejects( + client + .initFeeTierTx( + generateDefaultInitFeeTierParams( + client.context, + configInitInfo.whirlpoolConfigKeypair.publicKey, + fakeFeeAuthorityKeypair.publicKey, + TickSpacing.Stable, + 3000 + ) + ) + .addSigner(fakeFeeAuthorityKeypair) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); +}); diff --git a/sdk/tests/initialize_pool.ts b/sdk/tests/initialize_pool.ts new file mode 100644 index 0000000..97e2194 --- /dev/null +++ b/sdk/tests/initialize_pool.ts @@ -0,0 +1,259 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { + createMint, + asyncAssertTokenVault, + ZERO_BN, + systemTransferTx, + ONE_SOL, + TickSpacing, +} from "./utils"; +import { buildTestPoolParams, initTestPool } from "./utils/init-utils"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import { + getWhirlpoolPda, + InitPoolParams, + toX64, + sqrtPriceX64ToTickIndex, + MAX_SQRT_PRICE, + MIN_SQRT_PRICE, +} from "../src"; +import Decimal from "decimal.js"; + +describe("initialize_pool", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully init a Standard account", async () => { + const price = toX64(new Decimal(5)); + const { configInitInfo, poolInitInfo, feeTierParams } = await initTestPool( + client, + TickSpacing.Standard, + price + ); + const whirlpool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + + const expectedWhirlpoolPda = getWhirlpoolPda( + program.programId, + configInitInfo.whirlpoolConfigKeypair.publicKey, + poolInitInfo.tokenMintA, + poolInitInfo.tokenMintB, + TickSpacing.Standard + ); + + assert.ok(poolInitInfo.whirlpoolPda.publicKey.equals(expectedWhirlpoolPda.publicKey)); + assert.equal(expectedWhirlpoolPda.bump, whirlpool.whirlpoolBump[0]); + + assert.ok(whirlpool.whirlpoolsConfig.equals(poolInitInfo.whirlpoolConfigKey)); + assert.ok(whirlpool.tokenMintA.equals(poolInitInfo.tokenMintA)); + assert.ok(whirlpool.tokenVaultA.equals(poolInitInfo.tokenVaultAKeypair.publicKey)); + + assert.ok(whirlpool.tokenMintB.equals(poolInitInfo.tokenMintB)); + assert.ok(whirlpool.tokenVaultB.equals(poolInitInfo.tokenVaultBKeypair.publicKey)); + + assert.equal(whirlpool.feeRate, feeTierParams.defaultFeeRate); + assert.equal(whirlpool.protocolFeeRate, configInitInfo.defaultProtocolFeeRate); + + assert.ok(whirlpool.sqrtPrice.eq(new anchor.BN(poolInitInfo.initSqrtPrice.toString()))); + assert.ok(whirlpool.liquidity.eq(ZERO_BN)); + + assert.equal(whirlpool.tickCurrentIndex, sqrtPriceX64ToTickIndex(poolInitInfo.initSqrtPrice)); + + assert.ok(whirlpool.protocolFeeOwedA.eq(ZERO_BN)); + assert.ok(whirlpool.protocolFeeOwedB.eq(ZERO_BN)); + assert.ok(whirlpool.feeGrowthGlobalA.eq(ZERO_BN)); + assert.ok(whirlpool.feeGrowthGlobalB.eq(ZERO_BN)); + + assert.ok(whirlpool.tickSpacing === TickSpacing.Standard); + + await asyncAssertTokenVault(program, poolInitInfo.tokenVaultAKeypair.publicKey, { + expectedOwner: poolInitInfo.whirlpoolPda.publicKey, + expectedMint: poolInitInfo.tokenMintA, + }); + await asyncAssertTokenVault(program, poolInitInfo.tokenVaultBKeypair.publicKey, { + expectedOwner: poolInitInfo.whirlpoolPda.publicKey, + expectedMint: poolInitInfo.tokenMintB, + }); + + whirlpool.rewardInfos.forEach((rewardInfo) => { + assert.equal(rewardInfo.emissionsPerSecondX64, 0); + assert.equal(rewardInfo.growthGlobalX64, 0); + assert.ok(rewardInfo.authority.equals(configInitInfo.rewardEmissionsSuperAuthority)); + assert.ok(rewardInfo.mint.equals(anchor.web3.PublicKey.default)); + assert.ok(rewardInfo.vault.equals(anchor.web3.PublicKey.default)); + }); + }); + + it("successfully init a Stable account", async () => { + const price = toX64(new Decimal(5)); + const { configInitInfo, poolInitInfo, feeTierParams } = await initTestPool( + client, + TickSpacing.Stable, + price + ); + const whirlpool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + + assert.ok(whirlpool.whirlpoolsConfig.equals(poolInitInfo.whirlpoolConfigKey)); + assert.ok(whirlpool.tokenMintA.equals(poolInitInfo.tokenMintA)); + assert.ok(whirlpool.tokenVaultA.equals(poolInitInfo.tokenVaultAKeypair.publicKey)); + + assert.ok(whirlpool.tokenMintB.equals(poolInitInfo.tokenMintB)); + assert.ok(whirlpool.tokenVaultB.equals(poolInitInfo.tokenVaultBKeypair.publicKey)); + + assert.equal(whirlpool.feeRate, feeTierParams.defaultFeeRate); + assert.equal(whirlpool.protocolFeeRate, configInitInfo.defaultProtocolFeeRate); + + assert.ok(whirlpool.sqrtPrice.eq(new anchor.BN(poolInitInfo.initSqrtPrice.toString()))); + assert.ok(whirlpool.liquidity.eq(ZERO_BN)); + + assert.equal(whirlpool.tickCurrentIndex, sqrtPriceX64ToTickIndex(poolInitInfo.initSqrtPrice)); + + assert.ok(whirlpool.protocolFeeOwedA.eq(ZERO_BN)); + assert.ok(whirlpool.protocolFeeOwedB.eq(ZERO_BN)); + assert.ok(whirlpool.feeGrowthGlobalA.eq(ZERO_BN)); + assert.ok(whirlpool.feeGrowthGlobalB.eq(ZERO_BN)); + + assert.ok(whirlpool.tickSpacing === TickSpacing.Stable); + + await asyncAssertTokenVault(program, poolInitInfo.tokenVaultAKeypair.publicKey, { + expectedOwner: poolInitInfo.whirlpoolPda.publicKey, + expectedMint: poolInitInfo.tokenMintA, + }); + await asyncAssertTokenVault(program, poolInitInfo.tokenVaultBKeypair.publicKey, { + expectedOwner: poolInitInfo.whirlpoolPda.publicKey, + expectedMint: poolInitInfo.tokenMintB, + }); + + whirlpool.rewardInfos.forEach((rewardInfo) => { + assert.equal(rewardInfo.emissionsPerSecondX64, 0); + assert.equal(rewardInfo.growthGlobalX64, 0); + assert.ok(rewardInfo.authority.equals(configInitInfo.rewardEmissionsSuperAuthority)); + assert.ok(rewardInfo.mint.equals(anchor.web3.PublicKey.default)); + assert.ok(rewardInfo.vault.equals(anchor.web3.PublicKey.default)); + }); + }); + + it("succeeds when funder is different than account paying for transaction fee", async () => { + const funderKeypair = anchor.web3.Keypair.generate(); + await systemTransferTx(provider, funderKeypair.publicKey, ONE_SOL).buildAndExecute(); + await initTestPool(client, TickSpacing.Standard, toX64(new Decimal(5)), funderKeypair); + }); + + it("fails when tokenVaultA mint does not match tokenA mint", async () => { + const { poolInitInfo } = await buildTestPoolParams(client, TickSpacing.Standard); + const otherTokenPublicKey = await createMint(provider); + + const modifiedPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + tokenMintA: otherTokenPublicKey, + }; + + await assert.rejects( + client.initPoolTx(modifiedPoolInitInfo).buildAndExecute(), + /failed to complete|seeds|unauthorized/ + ); + }); + + it("fails when tokenVaultB mint does not match tokenB mint", async () => { + const { poolInitInfo } = await buildTestPoolParams(client, TickSpacing.Standard); + const otherTokenPublicKey = await createMint(provider); + + const modifiedPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + tokenMintB: otherTokenPublicKey, + }; + + await assert.rejects( + client.initPoolTx(modifiedPoolInitInfo).buildAndExecute(), + /failed to complete|seeds|unauthorized/ + ); + }); + + it("fails when token mints are in the wrong order", async () => { + const { poolInitInfo, configInitInfo } = await buildTestPoolParams( + client, + TickSpacing.Standard + ); + + const whirlpoolPda = getWhirlpoolPda( + context.program.programId, + configInitInfo.whirlpoolConfigKeypair.publicKey, + poolInitInfo.tokenMintB, + poolInitInfo.tokenMintA, + TickSpacing.Stable + ); + + const modifiedPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + whirlpoolPda, + tickSpacing: TickSpacing.Stable, + tokenMintA: poolInitInfo.tokenMintB, + tokenMintB: poolInitInfo.tokenMintA, + }; + + await assert.rejects( + client.initPoolTx(modifiedPoolInitInfo).buildAndExecute(), + /custom program error: 0x1788/ // InvalidTokenMintOrder + ); + }); + + it("fails when the same token mint is passed in", async () => { + const { poolInitInfo, configInitInfo } = await buildTestPoolParams( + client, + TickSpacing.Standard + ); + + const whirlpoolPda = getWhirlpoolPda( + context.program.programId, + configInitInfo.whirlpoolConfigKeypair.publicKey, + poolInitInfo.tokenMintA, + poolInitInfo.tokenMintA, + TickSpacing.Stable + ); + + const modifiedPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + whirlpoolPda, + tickSpacing: TickSpacing.Stable, + tokenMintB: poolInitInfo.tokenMintA, + }; + + await assert.rejects( + client.initPoolTx(modifiedPoolInitInfo).buildAndExecute(), + /custom program error: 0x1788/ // InvalidTokenMintOrder + ); + }); + + it("fails when sqrt-price exceeds max", async () => { + const { poolInitInfo } = await buildTestPoolParams(client, TickSpacing.Standard); + const otherTokenPublicKey = await createMint(provider); + + const modifiedPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + initSqrtPrice: new anchor.BN(MAX_SQRT_PRICE).add(new anchor.BN(1)), + }; + + await assert.rejects( + client.initPoolTx(modifiedPoolInitInfo).buildAndExecute(), + /custom program error: 0x177b/ // SqrtPriceOutOfBounds + ); + }); + + it("fails when sqrt-price subceeds min", async () => { + const { poolInitInfo } = await buildTestPoolParams(client, TickSpacing.Standard); + + const modifiedPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + initSqrtPrice: new anchor.BN(MIN_SQRT_PRICE).sub(new anchor.BN(1)), + }; + + await assert.rejects( + client.initPoolTx(modifiedPoolInitInfo).buildAndExecute(), + /custom program error: 0x177b/ // SqrtPriceOutOfBounds + ); + }); +}); diff --git a/sdk/tests/initialize_reward.ts b/sdk/tests/initialize_reward.ts new file mode 100644 index 0000000..ae863bf --- /dev/null +++ b/sdk/tests/initialize_reward.ts @@ -0,0 +1,114 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initializeReward, initTestPool } from "./utils/init-utils"; + +import { createMint, ONE_SOL, systemTransferTx, TickSpacing } from "./utils"; + +describe("initialize_reward", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully initializes reward at index 0", async () => { + const { poolInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + + const { params } = await initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + 0 + ); + + const whirlpool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + + assert.ok(whirlpool.rewardInfos[0].mint.equals(params.rewardMint)); + assert.ok(whirlpool.rewardInfos[0].vault.equals(params.rewardVaultKeypair.publicKey)); + + await assert.rejects( + initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + 0 + ), + /custom program error: 0x178a/ // InvalidRewardIndex + ); + + const { params: params2 } = await initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + 1 + ); + + const whirlpool2 = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + + assert.ok(whirlpool2.rewardInfos[0].mint.equals(params.rewardMint)); + assert.ok(whirlpool2.rewardInfos[0].vault.equals(params.rewardVaultKeypair.publicKey)); + assert.ok(whirlpool2.rewardInfos[1].mint.equals(params2.rewardMint)); + assert.ok(whirlpool2.rewardInfos[1].vault.equals(params2.rewardVaultKeypair.publicKey)); + assert.ok(whirlpool2.rewardInfos[2].mint.equals(anchor.web3.PublicKey.default)); + assert.ok(whirlpool2.rewardInfos[2].vault.equals(anchor.web3.PublicKey.default)); + }); + + it("succeeds when funder is different than account paying for transaction fee", async () => { + const { poolInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + const funderKeypair = anchor.web3.Keypair.generate(); + await systemTransferTx(provider, funderKeypair.publicKey, ONE_SOL).buildAndExecute(); + await initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + 0, + funderKeypair + ); + }); + + it("fails to initialize reward at index 1", async () => { + const { poolInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + + await assert.rejects( + initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + 1 + ), + /custom program error: 0x178a/ // InvalidRewardIndex + ); + }); + + it("fails to initialize reward at out-of-bound index", async () => { + const { poolInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + + await assert.rejects( + initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + 3 + ) + ); + }); + + it("fails to initialize if authority signature is missing", async () => { + const { poolInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + + await assert.rejects( + client + .initializeRewardTx({ + rewardAuthority: configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + funder: provider.wallet.publicKey, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardMint: await createMint(provider), + rewardVaultKeypair: anchor.web3.Keypair.generate(), + rewardIndex: 0, + }) + .buildAndExecute() + ); + }); +}); diff --git a/sdk/tests/initialize_tick_array.ts b/sdk/tests/initialize_tick_array.ts new file mode 100644 index 0000000..e709145 --- /dev/null +++ b/sdk/tests/initialize_tick_array.ts @@ -0,0 +1,92 @@ +import * as anchor from "@project-serum/anchor"; +import * as assert from "assert"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initTestPool, initTickArray } from "./utils/init-utils"; +import { generateDefaultInitTickArrayParams } from "./utils/test-builders"; +import { InitPoolParams, InitTickArrayParams, TICK_ARRAY_SIZE } from "../src"; +import { ONE_SOL, systemTransferTx, TickSpacing } from "./utils"; + +describe("initialize_tick_array", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully init a TickArray account", async () => { + const tickSpacing = TickSpacing.Standard; + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + const startTick = TICK_ARRAY_SIZE * tickSpacing * 2; + + const tickArrayInitInfo = generateDefaultInitTickArrayParams( + context, + poolInitInfo.whirlpoolPda.publicKey, + startTick + ); + + await client.initTickArrayTx(tickArrayInitInfo).buildAndExecute(); + assertTickArrayInitialized(client, tickArrayInitInfo, poolInitInfo, startTick); + }); + + it("successfully init a TickArray account with a negative index", async () => { + const tickSpacing = TickSpacing.Standard; + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + const startTick = TICK_ARRAY_SIZE * tickSpacing * -2; + + const tickArrayInitInfo = generateDefaultInitTickArrayParams( + context, + poolInitInfo.whirlpoolPda.publicKey, + startTick + ); + + await client.initTickArrayTx(tickArrayInitInfo).buildAndExecute(); + assertTickArrayInitialized(client, tickArrayInitInfo, poolInitInfo, startTick); + }); + + it("succeeds when funder is different than account paying for transaction fee", async () => { + const tickSpacing = TickSpacing.Standard; + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + const funderKeypair = anchor.web3.Keypair.generate(); + await systemTransferTx(provider, funderKeypair.publicKey, ONE_SOL).buildAndExecute(); + await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + const startTick = TICK_ARRAY_SIZE * tickSpacing * 3; + await initTickArray(client, poolInitInfo.whirlpoolPda.publicKey, startTick, funderKeypair); + }); + + it("fails when start tick index is not a valid start index", async () => { + const tickSpacing = TickSpacing.Standard; + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + const startTick = TICK_ARRAY_SIZE * tickSpacing * 2 + 1; + + const params = generateDefaultInitTickArrayParams( + context, + poolInitInfo.whirlpoolPda.publicKey, + startTick + ); + + try { + await client.initTickArrayTx(params).buildAndExecute(); + assert.fail( + "should fail if start-tick is not a multiple of tick spacing and num ticks in array" + ); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0x1771/); // InvalidStartTick + } + }); + + async function assertTickArrayInitialized( + client: WhirlpoolClient, + tickArrayInitInfo: InitTickArrayParams, + poolInitInfo: InitPoolParams, + startTick: number + ) { + let tickArrayData = await client.getTickArray(tickArrayInitInfo.tickArrayPda.publicKey); + assert.ok(tickArrayData.whirlpool.equals(poolInitInfo.whirlpoolPda.publicKey)); + assert.ok(tickArrayData.startTickIndex == startTick); + } +}); diff --git a/sdk/tests/integration/position_management.ts b/sdk/tests/integration/position_management.ts new file mode 100644 index 0000000..99f251d --- /dev/null +++ b/sdk/tests/integration/position_management.ts @@ -0,0 +1,49 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../../src/context"; +import { WhirlpoolClient } from "../../src/client"; +import { initTestPool, openPosition } from "../utils/init-utils"; +import { buildOpenPositionIx } from "../../src/instructions/open-position-ix"; +import { generateDefaultOpenPositionParams } from "../utils/test-builders"; +import { TickSpacing } from "../utils"; + +describe("position management tests", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully closes and opens a position in one transaction", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const { params } = await openPosition(client, poolInitInfo.whirlpoolPda.publicKey, 0, 128); + const receiverKeypair = anchor.web3.Keypair.generate(); + + const { params: newParams, mint } = await generateDefaultOpenPositionParams( + context, + poolInitInfo.whirlpoolPda.publicKey, + 0, + 128, + context.wallet.publicKey, + context.wallet.publicKey + ); + + await client + .closePositionTx({ + positionAuthority: provider.wallet.publicKey, + receiver: receiverKeypair.publicKey, + position: params.positionPda.publicKey, + positionMint: params.positionMintAddress, + positionTokenAccount: params.positionTokenAccountAddress, + }) + .addInstruction(buildOpenPositionIx(context, newParams)) + .addSigner(mint) + .buildAndExecute(); + + const closedResponse = await provider.connection.getTokenSupply(params.positionMintAddress); + assert.equal(closedResponse.value.uiAmount, 0); + const openResponse = await provider.connection.getTokenSupply(newParams.positionMintAddress); + assert.equal(openResponse.value.uiAmount, 1); + }); +}); diff --git a/sdk/tests/open_position.ts b/sdk/tests/open_position.ts new file mode 100644 index 0000000..11b78fa --- /dev/null +++ b/sdk/tests/open_position.ts @@ -0,0 +1,221 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { web3 } from "@project-serum/anchor"; +import { Keypair } from "@solana/web3.js"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import { initTestPool, openPosition } from "./utils/init-utils"; +import { + getPositionPda, + InitPoolParams, + MAX_TICK_INDEX, + MIN_TICK_INDEX, + OpenPositionParams, + PDA, +} from "../src"; +import { + createMint, + createMintInstructions, + mintToByAuthority, + ONE_SOL, + systemTransferTx, + TickSpacing, + ZERO_BN, +} from "./utils"; +import { ASSOCIATED_TOKEN_PROGRAM_ID, Token } from "@solana/spl-token"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { generateDefaultOpenPositionParams } from "./utils/test-builders"; + +describe("open_position", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + let defaultParams: OpenPositionParams; + let defaultMint: Keypair; + const tickLowerIndex = 0; + const tickUpperIndex = 128; + let poolInitInfo: InitPoolParams; + let whirlpoolPda: PDA; + const funderKeypair = anchor.web3.Keypair.generate(); + + before(async () => { + poolInitInfo = (await initTestPool(client, TickSpacing.Standard)).poolInitInfo; + whirlpoolPda = poolInitInfo.whirlpoolPda; + + const { params, mint } = await generateDefaultOpenPositionParams( + client.context, + whirlpoolPda.publicKey, + 0, + 128, + provider.wallet.publicKey + ); + defaultParams = params; + defaultMint = mint; + await systemTransferTx(provider, funderKeypair.publicKey, ONE_SOL).buildAndExecute(); + }); + + it("successfully opens position and verify position address contents", async () => { + const positionInitInfo = await openPosition( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex + ); + const { positionPda, positionMintAddress } = positionInitInfo.params; + + const position = await client.getPosition(positionPda.publicKey); + + assert.strictEqual(position.tickLowerIndex, tickLowerIndex); + assert.strictEqual(position.tickUpperIndex, tickUpperIndex); + assert.ok(position.whirlpool.equals(poolInitInfo.whirlpoolPda.publicKey)); + assert.ok(position.positionMint.equals(positionMintAddress)); + assert.ok(position.liquidity.eq(ZERO_BN)); + assert.ok(position.feeGrowthCheckpointA.eq(ZERO_BN)); + assert.ok(position.feeGrowthCheckpointB.eq(ZERO_BN)); + assert.ok(position.feeOwedA.eq(ZERO_BN)); + assert.ok(position.feeOwedB.eq(ZERO_BN)); + + // TODO: Add tests for rewards + }); + + it("succeeds when funder is different than account paying for transaction fee", async () => { + await openPosition( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex, + provider.wallet.publicKey, + funderKeypair + ); + }); + + it("open position & verify position mint behavior", async () => { + const newOwner = web3.Keypair.generate(); + + const positionInitInfo = await openPosition( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex, + newOwner.publicKey + ); + const { positionMintAddress, positionTokenAccountAddress } = positionInitInfo.params; + + const token = new Token( + context.connection, + positionMintAddress, + TOKEN_PROGRAM_ID, + web3.Keypair.generate() + ); + + const userTokenAccount = await token.getAccountInfo(positionTokenAccountAddress); + assert.ok(userTokenAccount.amount.eq(new anchor.BN(1))); + assert.ok(userTokenAccount.owner.equals(newOwner.publicKey)); + + await assert.rejects( + mintToByAuthority(provider, positionMintAddress, positionTokenAccountAddress, 1), + /0x5/ // the total supply of this token is fixed + ); + }); + + it("user must pass the valid token ATA account", async () => { + const anotherMintKey = await createMint(provider, provider.wallet.publicKey); + const positionTokenAccountAddress = await Token.getAssociatedTokenAddress( + ASSOCIATED_TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID, + anotherMintKey, + context.provider.wallet.publicKey + ); + + await assert.rejects( + client + .openPositionTx({ ...defaultParams, positionTokenAccountAddress }) + .addSigner(defaultMint) + .buildAndExecute(), + /An account required by the instruction is missing/ + ); + }); + + describe("invalid ticks", () => { + async function assertTicksFail(lowerTick: number, upperTick: number) { + await assert.rejects( + openPosition( + client, + whirlpoolPda.publicKey, + lowerTick, + upperTick, + provider.wallet.publicKey, + funderKeypair + ), + /0x177a/ // InvalidTickIndex + ); + } + + it("fail when user pass in an out of bound tick index for upper-index", async () => { + await assertTicksFail(0, MAX_TICK_INDEX + 1); + }); + + it("fail when user pass in a lower tick index that is higher than the upper-index", async () => { + await assertTicksFail(-22534, -22534 - 1); + }); + + it("fail when user pass in a lower tick index that equals the upper-index", async () => { + await assertTicksFail(22365, 22365); + }); + + it("fail when user pass in an out of bound tick index for lower-index", async () => { + await assertTicksFail(MIN_TICK_INDEX - 1, 0); + }); + + it("fail when user pass in a non-initializable tick index for upper-index", async () => { + await assertTicksFail(0, 1); + }); + + it("fail when user pass in a non-initializable tick index for lower-index", async () => { + await assertTicksFail(1, 2); + }); + }); + + it("fail when position mint already exists", async () => { + const positionMintKeypair = anchor.web3.Keypair.generate(); + const positionPda = getPositionPda(context.program.programId, positionMintKeypair.publicKey); + + const positionTokenAccountAddress = await Token.getAssociatedTokenAddress( + ASSOCIATED_TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID, + positionMintKeypair.publicKey, + provider.wallet.publicKey + ); + + const tx = new web3.Transaction(); + tx.add( + ...(await createMintInstructions( + provider, + provider.wallet.publicKey, + positionMintKeypair.publicKey + )) + ); + + await provider.send(tx, [positionMintKeypair], { commitment: "confirmed" }); + + await assert.rejects( + client + .openPositionTx({ + funder: provider.wallet.publicKey, + ownerKey: provider.wallet.publicKey, + positionPda, + positionMintAddress: positionMintKeypair.publicKey, + positionTokenAccountAddress: positionTokenAccountAddress, + whirlpoolKey: whirlpoolPda.publicKey, + tickLowerIndex: 0, + tickUpperIndex: 128, + }) + .addSigner(positionMintKeypair) + .buildAndExecute(), + /0x0/ + ); + }); +}); diff --git a/sdk/tests/open_position_with_metadata.ts b/sdk/tests/open_position_with_metadata.ts new file mode 100644 index 0000000..515b6c3 --- /dev/null +++ b/sdk/tests/open_position_with_metadata.ts @@ -0,0 +1,345 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { Metadata } from "@metaplex-foundation/mpl-token-metadata"; +import { web3 } from "@project-serum/anchor"; +import { Keypair, PublicKey } from "@solana/web3.js"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import { initTestPool, openPositionWithMetadata } from "./utils/init-utils"; +import { + getPositionMetadataPda, + getPositionPda, + InitPoolParams, + MAX_TICK_INDEX, + METADATA_PROGRAM_ADDRESS, + MIN_TICK_INDEX, + OpenPositionParams, + OpenPositionWithMetadataBumpsData, + PDA, + TransactionBuilder, +} from "../src"; +import { openPositionAccounts } from "../src/instructions/open-position-ix"; +import { + createMint, + createMintInstructions, + mintToByAuthority, + ONE_SOL, + systemTransferTx, + TickSpacing, + ZERO_BN, +} from "./utils"; +import { ASSOCIATED_TOKEN_PROGRAM_ID, Token } from "@solana/spl-token"; +import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { generateDefaultOpenPositionParams } from "./utils/test-builders"; + +describe("open_position_with_metadata", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + let defaultParams: Required; + let defaultMint: Keypair; + const tickLowerIndex = 0; + const tickUpperIndex = 128; + let poolInitInfo: InitPoolParams; + let whirlpoolPda: PDA; + const funderKeypair = anchor.web3.Keypair.generate(); + + before(async () => { + poolInitInfo = (await initTestPool(client, TickSpacing.Standard)).poolInitInfo; + whirlpoolPda = poolInitInfo.whirlpoolPda; + + const { params, mint } = await generateDefaultOpenPositionParams( + client.context, + whirlpoolPda.publicKey, + 0, + 128, + provider.wallet.publicKey + ); + defaultParams = params; + defaultMint = mint; + await systemTransferTx(provider, funderKeypair.publicKey, ONE_SOL).buildAndExecute(); + }); + + async function checkMetadata(metadataPda: PDA | undefined, positionMint: PublicKey) { + assert.ok(metadataPda != null); + const metadata = await Metadata.load(provider.connection, metadataPda.publicKey); + assert.ok(metadata.data.updateAuthority === "3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr"); + assert.ok(metadata.data.mint === positionMint.toString()); + assert.ok( + metadata.data.data.uri === `https://arweave.net/KZlsubXZyzeSYi2wJhyL7SY-DAot_OXhfWSYQGLmmOc` + ); + } + + it("successfully opens position and verify position address contents", async () => { + const positionInitInfo = await openPositionWithMetadata( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex + ); + const { positionPda, metadataPda, positionMintAddress } = positionInitInfo.params; + const position = await client.getPosition(positionPda.publicKey); + + assert.strictEqual(position.tickLowerIndex, tickLowerIndex); + assert.strictEqual(position.tickUpperIndex, tickUpperIndex); + assert.ok(position.whirlpool.equals(poolInitInfo.whirlpoolPda.publicKey)); + assert.ok(position.positionMint.equals(positionMintAddress)); + assert.ok(position.liquidity.eq(ZERO_BN)); + assert.ok(position.feeGrowthCheckpointA.eq(ZERO_BN)); + assert.ok(position.feeGrowthCheckpointB.eq(ZERO_BN)); + assert.ok(position.feeOwedA.eq(ZERO_BN)); + assert.ok(position.feeOwedB.eq(ZERO_BN)); + + await checkMetadata(metadataPda, position.positionMint); + // TODO: Add tests for rewards + }); + + it("succeeds when funder is different than account paying for transaction fee", async () => { + const { params } = await openPositionWithMetadata( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex, + provider.wallet.publicKey, + funderKeypair + ); + + await checkMetadata(params.metadataPda, params.positionMintAddress); + }); + + it("open position & verify position mint behavior", async () => { + const newOwner = web3.Keypair.generate(); + + const positionInitInfo = await openPositionWithMetadata( + client, + whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex, + newOwner.publicKey + ); + const { metadataPda, positionMintAddress, positionTokenAccountAddress } = + positionInitInfo.params; + + const token = new Token( + context.connection, + positionMintAddress, + TOKEN_PROGRAM_ID, + web3.Keypair.generate() + ); + + await checkMetadata(metadataPda, positionMintAddress); + + const userTokenAccount = await token.getAccountInfo(positionTokenAccountAddress); + assert.ok(userTokenAccount.amount.eq(new anchor.BN(1))); + assert.ok(userTokenAccount.owner.equals(newOwner.publicKey)); + + await assert.rejects( + mintToByAuthority(provider, positionMintAddress, positionTokenAccountAddress, 1), + /0x5/ // the total supply of this token is fixed + ); + }); + + it("user must pass the valid token ATA account", async () => { + const anotherMintKey = await createMint(provider, provider.wallet.publicKey); + const positionTokenAccountAddress = await Token.getAssociatedTokenAddress( + ASSOCIATED_TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID, + anotherMintKey, + context.provider.wallet.publicKey + ); + + await assert.rejects( + client + .openPositionWithMetadataTx({ ...defaultParams, positionTokenAccountAddress }) + .addSigner(defaultMint) + .buildAndExecute(), + /An account required by the instruction is missing/ + ); + }); + + describe("invalid ticks", () => { + async function assertTicksFail(lowerTick: number, upperTick: number) { + await assert.rejects( + openPositionWithMetadata( + client, + whirlpoolPda.publicKey, + lowerTick, + upperTick, + provider.wallet.publicKey, + funderKeypair + ), + /0x177a/ // InvalidTickIndex + ); + } + + it("fail when user pass in an out of bound tick index for upper-index", async () => { + await assertTicksFail(0, MAX_TICK_INDEX + 1); + }); + + it("fail when user pass in a lower tick index that is higher than the upper-index", async () => { + await assertTicksFail(-22534, -22534 - 1); + }); + + it("fail when user pass in a lower tick index that equals the upper-index", async () => { + await assertTicksFail(22365, 22365); + }); + + it("fail when user pass in an out of bound tick index for lower-index", async () => { + await assertTicksFail(MIN_TICK_INDEX - 1, 0); + }); + + it("fail when user pass in a non-initializable tick index for upper-index", async () => { + await assertTicksFail(0, 1); + }); + + it("fail when user pass in a non-initializable tick index for lower-index", async () => { + await assertTicksFail(1, 2); + }); + }); + + it("fail when position mint already exists", async () => { + const positionMintKeypair = anchor.web3.Keypair.generate(); + const positionPda = getPositionPda(context.program.programId, positionMintKeypair.publicKey); + const metadataPda = getPositionMetadataPda(positionMintKeypair.publicKey); + + const positionTokenAccountAddress = await Token.getAssociatedTokenAddress( + ASSOCIATED_TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID, + positionMintKeypair.publicKey, + provider.wallet.publicKey + ); + + const tx = new web3.Transaction(); + tx.add( + ...(await createMintInstructions( + provider, + provider.wallet.publicKey, + positionMintKeypair.publicKey + )) + ); + + await provider.send(tx, [positionMintKeypair], { commitment: "confirmed" }); + + await assert.rejects( + client + .openPositionWithMetadataTx({ + ...defaultParams, + positionPda, + metadataPda, + positionMintAddress: positionMintKeypair.publicKey, + positionTokenAccountAddress: positionTokenAccountAddress, + whirlpoolKey: whirlpoolPda.publicKey, + tickLowerIndex, + tickUpperIndex, + }) + .addSigner(positionMintKeypair) + .buildAndExecute(), + /0x0/ + ); + }); + + describe("invalid account constraints", () => { + function buildOpenWithAccountOverrides( + overrides: Partial< + ReturnType & { + positionMetadataAccount: PublicKey; + metadataProgram: PublicKey; + metadataUpdateAuth: PublicKey; + } + > + ) { + const { positionPda, metadataPda, tickLowerIndex, tickUpperIndex } = defaultParams; + + const bumps: OpenPositionWithMetadataBumpsData = { + positionBump: positionPda.bump, + metadataBump: metadataPda.bump, + }; + + const ix = context.program.instruction.openPositionWithMetadata( + bumps, + tickLowerIndex, + tickUpperIndex, + { + accounts: { + ...openPositionAccounts(defaultParams), + positionMetadataAccount: metadataPda.publicKey, + metadataProgram: METADATA_PROGRAM_ADDRESS, + metadataUpdateAuth: new PublicKey("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr"), + ...overrides, + }, + } + ); + + return { + instructions: [ix], + cleanupInstructions: [], + signers: [], + }; + } + + it("fails with non-mint metadataPda", async () => { + const notMintKeypair = Keypair.generate(); + const invalidParams = { + ...defaultParams, + metadataPda: getPositionMetadataPda(notMintKeypair.publicKey), + }; + + await assert.rejects( + client.openPositionWithMetadataTx(invalidParams).addSigner(defaultMint).buildAndExecute(), + // Invalid Metadata Key + // https://github.com/metaplex-foundation/metaplex-program-library/blob/master/token-metadata/program/src/error.rs#L36 + /0x5/ + ); + }); + + it("fails with non-program metadata program", async () => { + const notMetadataProgram = Keypair.generate(); + const tx = new TransactionBuilder(context.provider).addInstruction( + buildOpenWithAccountOverrides({ + metadataProgram: notMetadataProgram.publicKey, + }) + ); + + await assert.rejects( + tx.addSigner(defaultMint).buildAndExecute(), + // AddressConstraint + // https://github.com/project-serum/anchor/blob/master/lang/src/error.rs#L84 + /0x7dc/ + ); + }); + + it("fails with non-metadata program ", async () => { + const tx = new TransactionBuilder(context.provider).addInstruction( + buildOpenWithAccountOverrides({ + metadataProgram: TOKEN_PROGRAM_ID, + }) + ); + + await assert.rejects( + tx.addSigner(defaultMint).buildAndExecute(), + // AddressConstraint + // https://github.com/project-serum/anchor/blob/master/lang/src/error.rs#L84 + /0x7dc/ + ); + }); + + it("fails with non-valid update_authority program", async () => { + const notUpdateAuth = Keypair.generate(); + const tx = new TransactionBuilder(context.provider).addInstruction( + buildOpenWithAccountOverrides({ + metadataUpdateAuth: notUpdateAuth.publicKey, + }) + ); + + await assert.rejects( + tx.addSigner(defaultMint).buildAndExecute(), + // AddressConstraint + // https://github.com/project-serum/anchor/blob/master/lang/src/error.rs#L84 + /0x7dc/ + ); + }); + }); +}); diff --git a/sdk/tests/set_collect_protocol_fee_authority.ts b/sdk/tests/set_collect_protocol_fee_authority.ts new file mode 100644 index 0000000..b0f2150 --- /dev/null +++ b/sdk/tests/set_collect_protocol_fee_authority.ts @@ -0,0 +1,67 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { generateDefaultConfigParams } from "./utils/test-builders"; + +describe("set_collect_protocol_fee_authority", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully set_collect_protocol_fee_authority", async () => { + const { + configInitInfo, + configKeypairs: { collectProtocolFeesAuthorityKeypair }, + } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + const newAuthorityKeypair = anchor.web3.Keypair.generate(); + await client + .setCollectProtocolFeesAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + newCollectProtocolFeesAuthority: newAuthorityKeypair.publicKey, + }) + .addSigner(collectProtocolFeesAuthorityKeypair) + .buildAndExecute(); + const config = await client.getConfig(configInitInfo.whirlpoolConfigKeypair.publicKey); + assert.ok(config.collectProtocolFeesAuthority.equals(newAuthorityKeypair.publicKey)); + }); + + it("fails if current collect_protocol_fee_authority is not a signer", async () => { + const { + configInitInfo, + configKeypairs: { collectProtocolFeesAuthorityKeypair }, + } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + client + .setCollectProtocolFeesAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + collectProtocolFeesAuthority: collectProtocolFeesAuthorityKeypair.publicKey, + newCollectProtocolFeesAuthority: provider.wallet.publicKey, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails if invalid collect_protocol_fee_authority provided", async () => { + const { configInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + client + .setCollectProtocolFeesAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + collectProtocolFeesAuthority: provider.wallet.publicKey, + newCollectProtocolFeesAuthority: provider.wallet.publicKey, + }) + .buildAndExecute(), + /0x7dc/ // An address constraint was violated + ); + }); +}); diff --git a/sdk/tests/set_default_fee_rate.ts b/sdk/tests/set_default_fee_rate.ts new file mode 100644 index 0000000..4778f81 --- /dev/null +++ b/sdk/tests/set_default_fee_rate.ts @@ -0,0 +1,158 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { getFeeTierPda, getWhirlpoolPda, InitPoolParams } from "../src"; +import { initTestPool } from "./utils/init-utils"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { createInOrderMints, generateDefaultConfigParams } from "./utils/test-builders"; +import { TickSpacing } from "./utils"; + +describe("set_default_fee_rate", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully set_default_fee_rate", async () => { + const { poolInitInfo, configInitInfo, configKeypairs, feeTierParams } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newDefaultFeeRate = 45; + + // Fetch initial whirlpool and check it is default + let whirlpool_0 = await client.getPool(whirlpoolKey); + assert.equal(whirlpool_0.feeRate, feeTierParams.defaultFeeRate); + + await client + .setDefaultFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + feeAuthority: feeAuthorityKeypair.publicKey, + tickSpacing: TickSpacing.Standard, + defaultFeeRate: newDefaultFeeRate, + }) + .addSigner(feeAuthorityKeypair) + .buildAndExecute(); + + // Setting the default rate did not change existing whirlpool fee rate + whirlpool_0 = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + assert.equal(whirlpool_0.feeRate, feeTierParams.defaultFeeRate); + + // Newly initialized whirlpools have new default fee rate + const [tokenMintA, tokenMintB] = await createInOrderMints(context); + const whirlpoolPda = getWhirlpoolPda( + context.program.programId, + whirlpoolsConfigKey, + tokenMintA, + tokenMintB, + TickSpacing.Stable + ); + const tokenVaultAKeypair = anchor.web3.Keypair.generate(); + const tokenVaultBKeypair = anchor.web3.Keypair.generate(); + + const newPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + tokenMintA, + tokenMintB, + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tickSpacing: TickSpacing.Stable, + }; + await client.initPoolTx(newPoolInitInfo).buildAndExecute(); + + const whirlpool_1 = await client.getPool(whirlpoolPda.publicKey); + assert.equal(whirlpool_1.feeRate, newDefaultFeeRate); + }); + + it("fails when default fee rate exceeds max", async () => { + const { configInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newDefaultFeeRate = 20_000; + await assert.rejects( + client + .setDefaultFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + feeAuthority: feeAuthorityKeypair.publicKey, + tickSpacing: TickSpacing.Standard, + defaultFeeRate: newDefaultFeeRate, + }) + .addSigner(feeAuthorityKeypair) + .buildAndExecute(), + /0x178c/ // FeeRateMaxExceeded + ); + }); + + it("fails when fee tier account has not been initialized", async () => { + const { configInitInfo, configKeypairs } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + await assert.rejects( + client + .setDefaultFeeRateIx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + feeAuthority: feeAuthorityKeypair.publicKey, + tickSpacing: TickSpacing.Standard, + defaultFeeRate: 500, + }) + .addSigner(feeAuthorityKeypair) + .buildAndExecute(), + /0xbc4/ // AccountNotInitialized + ); + }); + + it("fails when fee authority is not a signer", async () => { + const { configInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + const feeTierPda = getFeeTierPda( + context.program.programId, + configInitInfo.whirlpoolConfigKeypair.publicKey, + TickSpacing.Standard + ); + + const newDefaultFeeRate = 1000; + await assert.rejects( + program.rpc.setDefaultFeeRate(newDefaultFeeRate, { + accounts: { + whirlpoolsConfig: whirlpoolsConfigKey, + feeTier: feeTierPda.publicKey, + feeAuthority: feeAuthorityKeypair.publicKey, + }, + }), + /Signature verification failed/ + ); + }); + + it("fails when invalid fee authority provided", async () => { + const { configInitInfo } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const fakeFeeAuthorityKeypair = anchor.web3.Keypair.generate(); + const feeTierPda = getFeeTierPda( + context.program.programId, + configInitInfo.whirlpoolConfigKeypair.publicKey, + TickSpacing.Standard + ); + + const newDefaultFeeRate = 1000; + await assert.rejects( + program.rpc.setDefaultFeeRate(newDefaultFeeRate, { + accounts: { + whirlpoolsConfig: whirlpoolsConfigKey, + feeTier: feeTierPda.publicKey, + feeAuthority: fakeFeeAuthorityKeypair.publicKey, + }, + signers: [fakeFeeAuthorityKeypair], + }), + /An address constraint was violated/ // ConstraintAddress + ); + }); +}); diff --git a/sdk/tests/set_default_protocol_fee_rate.ts b/sdk/tests/set_default_protocol_fee_rate.ts new file mode 100644 index 0000000..eda1297 --- /dev/null +++ b/sdk/tests/set_default_protocol_fee_rate.ts @@ -0,0 +1,124 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { getWhirlpoolPda, InitPoolParams } from "../src"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initTestPool } from "./utils/init-utils"; +import { createInOrderMints } from "./utils/test-builders"; +import { TickSpacing } from "./utils"; + +describe("set_default_protocol_fee_rate", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully set_default_protocol_fee_rate", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newDefaultProtocolFeeRate = 45; + + // Fetch initial whirlpool and check it is default + let whirlpool_0 = await client.getPool(whirlpoolKey); + assert.equal(whirlpool_0.protocolFeeRate, configInitInfo.defaultProtocolFeeRate); + + await client + .setDefaultProtocolFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + feeAuthority: feeAuthorityKeypair.publicKey, + defaultProtocolFeeRate: newDefaultProtocolFeeRate, + }) + .addSigner(feeAuthorityKeypair) + .buildAndExecute(); + + // Setting the default rate did not change existing whirlpool fee rate + whirlpool_0 = await client.getPool(whirlpoolKey); + assert.equal(whirlpool_0.protocolFeeRate, configInitInfo.defaultProtocolFeeRate); + + const [tokenMintA, tokenMintB] = await createInOrderMints(context); + const whirlpoolPda = getWhirlpoolPda( + context.program.programId, + whirlpoolsConfigKey, + tokenMintA, + tokenMintB, + TickSpacing.Stable + ); + const tokenVaultAKeypair = anchor.web3.Keypair.generate(); + const tokenVaultBKeypair = anchor.web3.Keypair.generate(); + + const newPoolInitInfo: InitPoolParams = { + ...poolInitInfo, + tokenMintA, + tokenMintB, + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + tickSpacing: TickSpacing.Stable, + }; + await client.initPoolTx(newPoolInitInfo).buildAndExecute(); + + const whirlpool_1 = await client.getPool(whirlpoolPda.publicKey); + assert.equal(whirlpool_1.protocolFeeRate, newDefaultProtocolFeeRate); + }); + + it("fails when default fee rate exceeds max", async () => { + const { configInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newDefaultProtocolFeeRate = 20_000; + await assert.rejects( + client + .setDefaultProtocolFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + feeAuthority: feeAuthorityKeypair.publicKey, + defaultProtocolFeeRate: newDefaultProtocolFeeRate, + }) + .addSigner(feeAuthorityKeypair) + .buildAndExecute(), + /0x178d/ // ProtocolFeeRateMaxExceeded + ); + }); + + it("fails when fee authority is not a signer", async () => { + const { configInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newDefaultProtocolFeeRate = 1000; + await assert.rejects( + program.rpc.setDefaultProtocolFeeRate(newDefaultProtocolFeeRate, { + accounts: { + whirlpoolsConfig: whirlpoolsConfigKey, + feeAuthority: feeAuthorityKeypair.publicKey, + }, + }), + /Signature verification failed/ + ); + }); + + it("fails when invalid fee authority provided", async () => { + const { configInitInfo } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const fakeFeeAuthorityKeypair = anchor.web3.Keypair.generate(); + + const newDefaultProtocolFeeRate = 1000; + await assert.rejects( + program.rpc.setDefaultProtocolFeeRate(newDefaultProtocolFeeRate, { + accounts: { + whirlpoolsConfig: whirlpoolsConfigKey, + feeAuthority: fakeFeeAuthorityKeypair.publicKey, + }, + signers: [fakeFeeAuthorityKeypair], + }), + /An address constraint was violated/ + ); + }); +}); diff --git a/sdk/tests/set_fee_authority.ts b/sdk/tests/set_fee_authority.ts new file mode 100644 index 0000000..33bcb99 --- /dev/null +++ b/sdk/tests/set_fee_authority.ts @@ -0,0 +1,67 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { generateDefaultConfigParams } from "./utils/test-builders"; + +describe("set_fee_authority", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully set_fee_authority", async () => { + const { + configInitInfo, + configKeypairs: { feeAuthorityKeypair }, + } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + const newAuthorityKeypair = anchor.web3.Keypair.generate(); + await client + .setFeeAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + feeAuthority: feeAuthorityKeypair.publicKey, + newFeeAuthority: newAuthorityKeypair.publicKey, + }) + .addSigner(feeAuthorityKeypair) + .buildAndExecute(); + const config = await client.getConfig(configInitInfo.whirlpoolConfigKeypair.publicKey); + assert.ok(config.feeAuthority.equals(newAuthorityKeypair.publicKey)); + }); + + it("fails if current fee_authority is not a signer", async () => { + const { + configInitInfo, + configKeypairs: { feeAuthorityKeypair }, + } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + client + .setFeeAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + feeAuthority: feeAuthorityKeypair.publicKey, + newFeeAuthority: provider.wallet.publicKey, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails if invalid fee_authority provided", async () => { + const { configInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + client + .setFeeAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + feeAuthority: provider.wallet.publicKey, + newFeeAuthority: provider.wallet.publicKey, + }) + .buildAndExecute(), + /0x7dc/ // An address constraint was violated + ); + }); +}); diff --git a/sdk/tests/set_fee_rate.ts b/sdk/tests/set_fee_rate.ts new file mode 100644 index 0000000..da69af3 --- /dev/null +++ b/sdk/tests/set_fee_rate.ts @@ -0,0 +1,136 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; + +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initTestPool } from "./utils/init-utils"; +import { generateDefaultConfigParams } from "./utils/test-builders"; +import { TickSpacing } from "./utils"; + +describe("set_fee_rate", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully sets_fee_rate", async () => { + const { poolInitInfo, configInitInfo, configKeypairs, feeTierParams } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newFeeRate = 50; + + let whirlpool = await client.getPool(whirlpoolKey); + + assert.equal(whirlpool.feeRate, feeTierParams.defaultFeeRate); + + await program.rpc.setFeeRate(newFeeRate, { + accounts: { + whirlpoolsConfig: whirlpoolsConfigKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + }, + signers: [feeAuthorityKeypair], + }); + + whirlpool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + assert.equal(whirlpool.feeRate, newFeeRate); + }); + + it("fails when fee rate exceeds max", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newFeeRate = 20_000; + await assert.rejects( + client + .setFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + feeRate: newFeeRate, + }) + .addSigner(configKeypairs.feeAuthorityKeypair) + .buildAndExecute(), + /0x178c/ // FeeRateMaxExceeded + ); + }); + + it("fails when fee authority is not signer", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newFeeRate = 1000; + await assert.rejects( + client + .setFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + feeRate: newFeeRate, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when whirlpool and whirlpools config don't match", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const { configInitInfo: otherConfigInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(otherConfigInitInfo).buildAndExecute(); + + const newFeeRate = 1000; + await assert.rejects( + context.program.rpc.setFeeRate(newFeeRate, { + accounts: { + whirlpoolsConfig: otherConfigInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + }, + signers: [configKeypairs.feeAuthorityKeypair], + }), + /A has_one constraint was violated/ // ConstraintHasOne + ); + }); + + it("fails when fee authority is invalid", async () => { + const { poolInitInfo, configInitInfo } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + + const fakeAuthorityKeypair = anchor.web3.Keypair.generate(); + + const newFeeRate = 1000; + await assert.rejects( + context.program.rpc.setFeeRate(newFeeRate, { + accounts: { + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolKey, + feeAuthority: fakeAuthorityKeypair.publicKey, + }, + signers: [fakeAuthorityKeypair], + }), + /An address constraint was violated/ // ConstraintAddress + ); + }); +}); diff --git a/sdk/tests/set_protocol_fee_rate.ts b/sdk/tests/set_protocol_fee_rate.ts new file mode 100644 index 0000000..2e73719 --- /dev/null +++ b/sdk/tests/set_protocol_fee_rate.ts @@ -0,0 +1,131 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initTestPool } from "./utils/init-utils"; +import { generateDefaultConfigParams } from "./utils/test-builders"; +import { TickSpacing } from "./utils"; + +describe("set_protocol_fee_rate", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully sets_protocol_fee_rate", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newProtocolFeeRate = 50; + + let whirlpool = await client.getPool(whirlpoolKey); + + assert.equal(whirlpool.protocolFeeRate, configInitInfo.defaultProtocolFeeRate); + + await program.rpc.setProtocolFeeRate(newProtocolFeeRate, { + accounts: { + whirlpoolsConfig: whirlpoolsConfigKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + }, + signers: [feeAuthorityKeypair], + }); + + whirlpool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + assert.equal(whirlpool.protocolFeeRate, newProtocolFeeRate); + }); + + it("fails when protocol fee rate exceeds max", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newProtocolFeeRate = 3_000; + await assert.rejects( + client + .setProtocolFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + protocolFeeRate: newProtocolFeeRate, + }) + .addSigner(configKeypairs.feeAuthorityKeypair) + .buildAndExecute(), + /0x178d/ // ProtocolFeeRateMaxExceeded + ); + }); + + it("fails when fee authority is not signer", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const whirlpoolsConfigKey = configInitInfo.whirlpoolConfigKeypair.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const newProtocolFeeRate = 1000; + await assert.rejects( + client + .setProtocolFeeRateIx({ + whirlpoolsConfig: whirlpoolsConfigKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + protocolFeeRate: newProtocolFeeRate, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails when whirlpool and whirlpools config don't match", async () => { + const { poolInitInfo, configKeypairs } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair; + + const { configInitInfo: otherConfigInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(otherConfigInitInfo).buildAndExecute(); + + const newProtocolFeeRate = 1000; + await assert.rejects( + context.program.rpc.setProtocolFeeRate(newProtocolFeeRate, { + accounts: { + whirlpoolsConfig: otherConfigInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolKey, + feeAuthority: feeAuthorityKeypair.publicKey, + }, + signers: [configKeypairs.feeAuthorityKeypair], + }), + /A has_one constraint was violated/ // ConstraintHasOne + ); + }); + + it("fails when fee authority is invalid", async () => { + const { poolInitInfo, configInitInfo } = await initTestPool(client, TickSpacing.Standard); + const whirlpoolKey = poolInitInfo.whirlpoolPda.publicKey; + const fakeAuthorityKeypair = anchor.web3.Keypair.generate(); + + const newProtocolFeeRate = 1000; + await assert.rejects( + context.program.rpc.setProtocolFeeRate(newProtocolFeeRate, { + accounts: { + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: whirlpoolKey, + feeAuthority: fakeAuthorityKeypair.publicKey, + }, + signers: [fakeAuthorityKeypair], + }), + /An address constraint was violated/ // ConstraintAddress + ); + }); +}); diff --git a/sdk/tests/set_reward_authority.ts b/sdk/tests/set_reward_authority.ts new file mode 100644 index 0000000..5698a18 --- /dev/null +++ b/sdk/tests/set_reward_authority.ts @@ -0,0 +1,113 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { NUM_REWARDS } from "../src/types/public"; +import { TransactionBuilder } from "../src/utils/transactions/transactions-builder"; +import { buildSetRewardAuthorityIx } from "../src/instructions/set-reward-authority-ix"; +import { initTestPool } from "./utils/init-utils"; +import { TickSpacing } from "./utils"; + +describe("set_reward_authority", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully set_reward_authority at every reward index", async () => { + const { configKeypairs, poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const newKeypairs = generateKeypairs(NUM_REWARDS); + const txBuilder = new TransactionBuilder(provider); + for (let i = 0; i < NUM_REWARDS; i++) { + txBuilder.addInstruction( + buildSetRewardAuthorityIx(context, { + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardAuthority: configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: newKeypairs[i].publicKey, + rewardIndex: i, + }) + ); + } + await txBuilder + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(); + + const pool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + for (let i = 0; i < NUM_REWARDS; i++) { + assert.ok(pool.rewardInfos[i].authority.equals(newKeypairs[i].publicKey)); + } + }); + + it("fails when provided reward_authority does not match whirlpool reward authority", async () => { + const { poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const fakeAuthority = anchor.web3.Keypair.generate(); + const newAuthority = anchor.web3.Keypair.generate(); + await assert.rejects( + client + .setRewardAuthorityTx({ + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardAuthority: fakeAuthority.publicKey, + newRewardAuthority: newAuthority.publicKey, + rewardIndex: 0, + }) + .addSigner(fakeAuthority) + .buildAndExecute(), + /0x7dc/ // An address constraint was violated + ); + }); + + it("fails on invalid reward index", async () => { + const { configKeypairs, poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const newAuthority = anchor.web3.Keypair.generate(); + assert.throws(() => { + client.setRewardAuthorityTx({ + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardAuthority: configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: newAuthority.publicKey, + rewardIndex: -1, + }); + }, /out of range/); + + await assert.rejects( + client + .setRewardAuthorityTx({ + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardAuthority: configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: newAuthority.publicKey, + rewardIndex: 255, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute() + // /failed to send transaction/ + ); + }); + + it("fails when reward_authority is not a signer", async () => { + const { configKeypairs, poolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const newAuthority = anchor.web3.Keypair.generate(); + await assert.rejects( + client + .setRewardAuthorityTx({ + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardAuthority: configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: newAuthority.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); +}); + +function generateKeypairs(n: number): anchor.web3.Keypair[] { + const keypairs = []; + for (let i = 0; i < n; i++) { + keypairs.push(anchor.web3.Keypair.generate()); + } + return keypairs; +} diff --git a/sdk/tests/set_reward_authority_by_super_authority.ts b/sdk/tests/set_reward_authority_by_super_authority.ts new file mode 100644 index 0000000..32d798a --- /dev/null +++ b/sdk/tests/set_reward_authority_by_super_authority.ts @@ -0,0 +1,133 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { initTestPool } from "./utils/init-utils"; +import { TickSpacing } from "./utils"; + +describe("set_reward_authority_by_super_authority", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully set_reward_authority_by_super_authority", async () => { + const { configKeypairs, poolInitInfo, configInitInfo } = await initTestPool( + client, + TickSpacing.Standard + ); + const newAuthorityKeypair = anchor.web3.Keypair.generate(); + await client + .setRewardAuthorityBySuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardEmissionsSuperAuthority: + configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: newAuthorityKeypair.publicKey, + rewardIndex: 0, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(); + const pool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + assert.ok(pool.rewardInfos[0].authority.equals(newAuthorityKeypair.publicKey)); + }); + + it("fails if invalid whirlpool provided", async () => { + const { configKeypairs, configInitInfo } = await initTestPool(client, TickSpacing.Standard); + const { + poolInitInfo: { whirlpoolPda: invalidPool }, + } = await initTestPool(client, TickSpacing.Standard); + + await assert.rejects( + client + .setRewardAuthorityBySuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: invalidPool.publicKey, + rewardEmissionsSuperAuthority: + configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: provider.wallet.publicKey, + rewardIndex: 0, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(), + /0x7d1/ // A has_one constraint was violated + ); + }); + + it("fails if invalid super authority provided", async () => { + const { poolInitInfo, configInitInfo } = await initTestPool(client, TickSpacing.Standard); + const invalidSuperAuthorityKeypair = anchor.web3.Keypair.generate(); + + await assert.rejects( + client + .setRewardAuthorityBySuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardEmissionsSuperAuthority: invalidSuperAuthorityKeypair.publicKey, + newRewardAuthority: provider.wallet.publicKey, + rewardIndex: 0, + }) + .addSigner(invalidSuperAuthorityKeypair) + .buildAndExecute(), + /0x7dc/ // An address constraint was violated + ); + }); + + it("fails if super authority is not a signer", async () => { + const { configKeypairs, poolInitInfo, configInitInfo } = await initTestPool( + client, + TickSpacing.Standard + ); + + await assert.rejects( + client + .setRewardAuthorityBySuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardEmissionsSuperAuthority: + configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: provider.wallet.publicKey, + rewardIndex: 0, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); + + it("fails on invalid reward index", async () => { + const { configKeypairs, poolInitInfo, configInitInfo } = await initTestPool( + client, + TickSpacing.Standard + ); + + assert.throws(() => { + client + .setRewardAuthorityBySuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardEmissionsSuperAuthority: + configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: provider.wallet.publicKey, + rewardIndex: -1, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(); + }, /out of range/); + + await assert.rejects( + client + .setRewardAuthorityBySuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardEmissionsSuperAuthority: + configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardAuthority: provider.wallet.publicKey, + rewardIndex: 200, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(), + /0x178a/ // InvalidRewardIndex + ); + }); +}); diff --git a/sdk/tests/set_reward_emissions.ts b/sdk/tests/set_reward_emissions.ts new file mode 100644 index 0000000..db71fd5 --- /dev/null +++ b/sdk/tests/set_reward_emissions.ts @@ -0,0 +1,182 @@ +import * as anchor from "@project-serum/anchor"; +import * as assert from "assert"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import { createAndMintToTokenAccount, mintToByAuthority, TickSpacing, ZERO_BN } from "./utils"; +import { initializeReward, initTestPool } from "./utils/init-utils"; + +describe("set_reward_emissions", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + const emissionsPerSecondX64 = new anchor.BN(10_000).shln(64).div(new anchor.BN(60 * 60 * 24)); + + it("successfully set_reward_emissions", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + + const rewardIndex = 0; + + const { + params: { rewardVaultKeypair, rewardMint }, + } = await initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + rewardIndex + ); + + await mintToByAuthority(provider, rewardMint, rewardVaultKeypair.publicKey, 10000); + + await client + .setRewardEmissionsTx({ + rewardAuthority: configInitInfo.rewardEmissionsSuperAuthority, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardIndex, + rewardVault: rewardVaultKeypair.publicKey, + emissionsPerSecondX64, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(); + + let whirlpool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + assert.ok(whirlpool.rewardInfos[0].emissionsPerSecondX64.eq(emissionsPerSecondX64)); + + // Successfuly set emissions back to zero + await client + .setRewardEmissionsTx({ + rewardAuthority: configInitInfo.rewardEmissionsSuperAuthority, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardIndex, + rewardVault: rewardVaultKeypair.publicKey, + emissionsPerSecondX64: ZERO_BN, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(); + + whirlpool = await client.getPool(poolInitInfo.whirlpoolPda.publicKey); + assert.ok(whirlpool.rewardInfos[0].emissionsPerSecondX64.eq(ZERO_BN)); + }); + + it("fails when token vault does not contain at least 1 day of emission runway", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + + const rewardIndex = 0; + + const { + params: { rewardVaultKeypair }, + } = await initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + rewardIndex + ); + + await assert.rejects( + client + .setRewardEmissionsTx({ + rewardAuthority: configInitInfo.rewardEmissionsSuperAuthority, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardIndex, + rewardVault: rewardVaultKeypair.publicKey, + emissionsPerSecondX64, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(), + /0x178b/ // RewardVaultAmountInsufficient + ); + }); + + it("fails if provided reward vault does not match whirlpool reward vault", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + + const rewardIndex = 0; + const { + params: { rewardVaultKeypair, rewardMint }, + } = await initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + rewardIndex + ); + + const fakeVault = await createAndMintToTokenAccount(provider, rewardMint, 10000); + + await assert.rejects( + client + .setRewardEmissionsTx({ + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardAuthority: configInitInfo.rewardEmissionsSuperAuthority, + rewardVault: fakeVault, + rewardIndex, + emissionsPerSecondX64, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(), + /0x7dc/ // An address constraint was violated + ); + }); + + it("cannot set emission for an uninitialized reward", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + + const rewardIndex = 0; + + await assert.rejects( + client + .setRewardEmissionsTx({ + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardAuthority: configInitInfo.rewardEmissionsSuperAuthority, + rewardVault: anchor.web3.PublicKey.default, + rewardIndex: rewardIndex, + emissionsPerSecondX64, + }) + .addSigner(configKeypairs.rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(), + /0xbbf/ // AccountOwnedByWrongProgram + ); + }); + + it("cannot set emission without the authority's signature", async () => { + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + TickSpacing.Standard + ); + + const rewardIndex = 0; + + await initializeReward( + client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + rewardIndex + ); + + await assert.rejects( + client + .setRewardEmissionsTx({ + rewardAuthority: configInitInfo.rewardEmissionsSuperAuthority, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + rewardIndex, + rewardVault: provider.wallet.publicKey, // TODO fix + emissionsPerSecondX64, + }) + .buildAndExecute(), + /Signature verification failed/ + ); + }); +}); diff --git a/sdk/tests/set_reward_emissions_super_authority.ts b/sdk/tests/set_reward_emissions_super_authority.ts new file mode 100644 index 0000000..d2c29ad --- /dev/null +++ b/sdk/tests/set_reward_emissions_super_authority.ts @@ -0,0 +1,70 @@ +import * as assert from "assert"; +import * as anchor from "@project-serum/anchor"; +import { WhirlpoolContext } from "../src/context"; +import { WhirlpoolClient } from "../src/client"; +import { generateDefaultConfigParams } from "./utils/test-builders"; + +describe("set_reward_emissions_super_authority", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully set_reward_emissions_super_authority with super authority keypair", async () => { + const { + configInitInfo, + configKeypairs: { rewardEmissionsSuperAuthorityKeypair }, + } = generateDefaultConfigParams(context); + + await client.initConfigTx(configInitInfo).buildAndExecute(); + const newAuthorityKeypair = anchor.web3.Keypair.generate(); + + await client + .setRewardEmissionsSuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + rewardEmissionsSuperAuthority: rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardEmissionsSuperAuthority: newAuthorityKeypair.publicKey, + }) + .addSigner(rewardEmissionsSuperAuthorityKeypair) + .buildAndExecute(); + + const config = await client.getConfig(configInitInfo.whirlpoolConfigKeypair.publicKey); + assert.ok(config.rewardEmissionsSuperAuthority.equals(newAuthorityKeypair.publicKey)); + }); + + it("fails if current reward_emissions_super_authority is not a signer", async () => { + const { + configInitInfo, + configKeypairs: { rewardEmissionsSuperAuthorityKeypair }, + } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + context.program.rpc.setRewardEmissionsSuperAuthority({ + accounts: { + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + rewardEmissionsSuperAuthority: rewardEmissionsSuperAuthorityKeypair.publicKey, + newRewardEmissionsSuperAuthority: provider.wallet.publicKey, + }, + }), + /Signature verification failed/ + ); + }); + + it("fails if incorrect reward_emissions_super_authority is passed in", async () => { + const { configInitInfo } = generateDefaultConfigParams(context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + await assert.rejects( + client + .setRewardEmissionsSuperAuthorityTx({ + whirlpoolsConfig: configInitInfo.whirlpoolConfigKeypair.publicKey, + rewardEmissionsSuperAuthority: provider.wallet.publicKey, + newRewardEmissionsSuperAuthority: provider.wallet.publicKey, + }) + .buildAndExecute(), + /0x7dc/ // An address constraint was violated + ); + }); +}); diff --git a/sdk/tests/swap.ts b/sdk/tests/swap.ts new file mode 100644 index 0000000..1212f1b --- /dev/null +++ b/sdk/tests/swap.ts @@ -0,0 +1,1322 @@ +import * as anchor from "@project-serum/anchor"; +import { web3 } from "@project-serum/anchor"; +import Decimal from "decimal.js"; +import { + getTickArrayPda, + SwapParams, + tickIndexToSqrtPriceX64, + MAX_SQRT_PRICE, + toX64, + MIN_SQRT_PRICE, + getOraclePda, +} from "../src"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import { + FundedPositionParams, + fundPositions, + initTestPoolWithLiquidity, + initTestPoolWithTokens, + initTickArrayRange, + initTestPool, + withdrawPositions, +} from "./utils/init-utils"; +import * as assert from "assert"; +import { getTokenBalance, MAX_U64, TickSpacing, ZERO_BN } from "./utils"; +import { u64 } from "@solana/spl-token"; + +describe("swap", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("fail on token vault mint a does not match whirlpool token a", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const { poolInitInfo: anotherPoolInitInfo } = await initTestPoolWithTokens( + client, + TickSpacing.Stable + ); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: anotherPoolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); + + it("fail on token vault mint b does not match whirlpool token b", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const { poolInitInfo: anotherPoolInitInfo } = await initTestPoolWithTokens( + client, + TickSpacing.Stable + ); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: anotherPoolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x7dc/ // ConstraintAddress + ); + }); + + it("fail on token owner account a does not match vault a mint", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountB } = await initTestPoolWithTokens( + client, + TickSpacing.Standard + ); + + const { tokenAccountA: anotherTokenAccountA } = await initTestPoolWithTokens( + client, + TickSpacing.Stable + ); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: anotherTokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fail on token owner account b does not match vault b mint", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA } = await initTestPoolWithTokens( + client, + TickSpacing.Standard + ); + + const { tokenAccountB: anotherTokenAccountB } = await initTestPoolWithTokens( + client, + TickSpacing.Stable + ); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: anotherTokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails to swap with incorrect token authority", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const otherTokenAuthority = web3.Keypair.generate(); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: otherTokenAuthority.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .addSigner(otherTokenAuthority) + .buildAndExecute(), + /0x4/ // OwnerMismatch + ); + }); + + it("fails on passing in the wrong tick-array", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard, toX64(new Decimal(0.0242).sqrt())); // Negative Tick + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: tickIndexToSqrtPriceX64(-50000), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x1787/ // InvalidTickArraySequence + ); + }); + + it("fails on passing in the wrong whirlpool", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const { poolInitInfo: anotherPoolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: anotherPoolInitInfo.whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails on passing in the tick-arrays from another whirlpool", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const { poolInitInfo: anotherPoolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + anotherPoolInitInfo.whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: anotherPoolInitInfo.whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x7d3/ // ConstraintRaw + ); + }); + + it("fails on passing in an account of another type for the oracle", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: tickArrays[0].publicKey, + }) + .buildAndExecute(), + /0x7d6/ // ConstraintSeeds + ); + }); + + it("fails on passing in an incorrectly hashed oracle PDA", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const { poolInitInfo: anotherPoolInitInfo } = await initTestPool(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, + 3, + TickSpacing.Standard, + false + ); + + const anotherOraclePda = getOraclePda( + client.context.program.programId, + anotherPoolInitInfo.whirlpoolPda.publicKey + ); + + await assert.rejects( + client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: anotherOraclePda.publicKey, + }) + .buildAndExecute(), + /0x7d6/ // ConstraintSeeds + ); + }); + + it("fail on passing in zero tradable amount", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 33792, + 3, + TickSpacing.Standard, + false + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await assert.rejects( + client + .swapTx({ + amount: new u64(0), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(), + /0x1793/ // ZeroTradableAmount + ); + }); + + it("swaps across one tick array", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, // to 33792 + 3, + TickSpacing.Standard, + false + ); + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(100_000), + tickLowerIndex: 29440, + tickUpperIndex: 33536, + }, + ]; + + await fundPositions(client, poolInitInfo, tokenAccountA, tokenAccountB, fundParams); + + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey), + "1302" + ); + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey), + "64238" + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await client + .swapTx({ + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + }); + + it("swaps across three tick arrays", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Stable, tickIndexToSqrtPriceX64(27500)); + + const aToB = false; + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 27456, // to 28160, 28864 + 5, + TickSpacing.Stable, + false + ); + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(100_000_000), + tickLowerIndex: 27456, + tickUpperIndex: 27840, + }, + { + liquidityAmount: new u64(100_000_000), + tickLowerIndex: 28864, + tickUpperIndex: 28928, + }, + { + liquidityAmount: new u64(100_000_000), + tickLowerIndex: 27712, + tickUpperIndex: 28928, + }, + ]; + + await fundPositions(client, poolInitInfo, tokenAccountA, tokenAccountB, fundParams); + + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey), + "1977429" + ); + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey), + "869058" + ); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + // Tick + await client + .swapTx({ + amount: new u64(7051000), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: tickIndexToSqrtPriceX64(28500), + amountSpecifiedIsInput: true, + aToB: aToB, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[2].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey), + "1535201" + ); + assert.equal( + await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey), + "7920058" + ); + + // TODO: Verify fees and other whirlpool params + }); + + it("Error on passing in uninitialized tick-array", async () => { + const { poolInitInfo, tokenAccountA, tokenAccountB, tickArrays } = + await initTestPoolWithLiquidity(client); + const whirlpool = poolInitInfo.whirlpoolPda.publicKey; + + const uninitializedTickArrayPda = getTickArrayPda(context.program.programId, whirlpool, 0); + + const oraclePda = getOraclePda( + client.context.program.programId, + poolInitInfo.whirlpoolPda.publicKey + ); + + const params: SwapParams = { + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4294886578)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpool, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: uninitializedTickArrayPda.publicKey, + tickArray2: tickArrays[2].publicKey, + oracle: oraclePda.publicKey, + }; + + try { + await client.swapTx(params).buildAndExecute(); + assert.fail("should fail if a tick-array is uninitialized"); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0xbbf/); // AccountOwnedByWrongProgram + } + }); + + it("Error if sqrt_price_limit exceeds max", async () => { + const { poolInitInfo, tokenAccountA, tokenAccountB, tickArrays } = + await initTestPoolWithLiquidity(client); + const whirlpool = poolInitInfo.whirlpoolPda.publicKey; + + const oraclePda = getOraclePda( + client.context.program.programId, + poolInitInfo.whirlpoolPda.publicKey + ); + + const params: SwapParams = { + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: new u64(MAX_SQRT_PRICE).add(new u64(1)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpool, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[2].publicKey, + oracle: oraclePda.publicKey, + }; + + try { + await client.swapTx(params).buildAndExecute(); + assert.fail("should fail if sqrt_price exceeds maximum"); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0x177b/); // SqrtPriceOutOfBounds + } + }); + + it("Error if sqrt_price_limit subceed min", async () => { + const { poolInitInfo, tokenAccountA, tokenAccountB, tickArrays } = + await initTestPoolWithLiquidity(client); + const whirlpool = poolInitInfo.whirlpoolPda.publicKey; + + const oraclePda = getOraclePda( + client.context.program.programId, + poolInitInfo.whirlpoolPda.publicKey + ); + + const params: SwapParams = { + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: new u64(MIN_SQRT_PRICE).sub(new u64(1)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpool, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[2].publicKey, + oracle: oraclePda.publicKey, + }; + + try { + await client.swapTx(params).buildAndExecute(); + assert.fail("should fail if sqrt_price subceeds minimum"); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0x177b/); // SqrtPriceOutOfBounds + } + }); + + it("Error if a to b swap below minimum output", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, // to 33792 + 3, + TickSpacing.Standard, + false + ); + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(100_000), + tickLowerIndex: 29440, + tickUpperIndex: 33536, + }, + ]; + + await fundPositions(client, poolInitInfo, tokenAccountA, tokenAccountB, fundParams); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + const params = { + amount: new u64(10), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: new anchor.BN(MIN_SQRT_PRICE), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }; + + try { + await client.swapTx(params).buildAndExecute(); + assert.fail("should fail if amount out is below threshold"); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0x1794/); // AmountOutBelowMinimum + } + }); + + it("Error if b to a swap below minimum output", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, // to 33792 + 3, + TickSpacing.Standard, + false + ); + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(100_000), + tickLowerIndex: 29440, + tickUpperIndex: 33536, + }, + ]; + + await fundPositions(client, poolInitInfo, tokenAccountA, tokenAccountB, fundParams); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + const params = { + amount: new u64(10), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: new anchor.BN(MAX_SQRT_PRICE), + amountSpecifiedIsInput: true, + aToB: false, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }; + + try { + await client.swapTx(params).buildAndExecute(); + assert.fail("should fail if amount out is below threshold"); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0x1794/); // AmountOutBelowMinimum + } + }); + + it("Error if a to b swap above maximum input", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, // to 33792 + 3, + TickSpacing.Standard, + false + ); + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(100_000), + tickLowerIndex: 29440, + tickUpperIndex: 33536, + }, + ]; + + await fundPositions(client, poolInitInfo, tokenAccountA, tokenAccountB, fundParams); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + const params = { + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: new anchor.BN(MIN_SQRT_PRICE), + amountSpecifiedIsInput: false, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }; + + try { + await client.swapTx(params).buildAndExecute(); + assert.fail("should fail if amount out is below threshold"); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0x1795/); // AmountInAboveMaximum + } + }); + + it("Error if b to a swap below maximum input", async () => { + const { poolInitInfo, whirlpoolPda, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, // to 33792 + 3, + TickSpacing.Standard, + false + ); + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(100_000), + tickLowerIndex: 29440, + tickUpperIndex: 33536, + }, + ]; + + await fundPositions(client, poolInitInfo, tokenAccountA, tokenAccountB, fundParams); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + const params = { + amount: new u64(10), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: new anchor.BN(MAX_SQRT_PRICE), + amountSpecifiedIsInput: false, + aToB: false, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[0].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }; + + try { + await client.swapTx(params).buildAndExecute(); + assert.fail("should fail if amount out is below threshold"); + } catch (e) { + const error = e as Error; + assert.match(error.message, /0x1795/); // AmountInAboveMaximum + } + }); + + it("swaps across ten tick arrays", async () => { + const { + poolInitInfo, + configInitInfo, + configKeypairs, + whirlpoolPda, + tokenAccountA, + tokenAccountB, + } = await initTestPoolWithTokens(client, TickSpacing.Stable, tickIndexToSqrtPriceX64(27500)); + + const aToB = false; + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 27456, // to 30528 + 3, + TickSpacing.Stable, + aToB + ); + + // tick array range: 27658 to 29386 + // tick arrays: (27456, 28152), (28160, 28856), (28864, 29,560) + // current tick: 27727 + // initialized ticks: + // 27712, 27736, 27840, 28288, 28296, 28304, 28416, 28576, 28736, 29112, 29120, 29240, 29360 + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 27712, + tickUpperIndex: 29360, + }, + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 27736, + tickUpperIndex: 29240, + }, + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 27840, + tickUpperIndex: 29120, + }, + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 28288, + tickUpperIndex: 29112, + }, + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 28416, + tickUpperIndex: 29112, + }, + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 28288, + tickUpperIndex: 28304, + }, + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 28296, + tickUpperIndex: 29112, + }, + { + liquidityAmount: new u64(10_000_000), + tickLowerIndex: 28576, + tickUpperIndex: 28736, + }, + ]; + + const positionInfos = await fundPositions( + client, + poolInitInfo, + tokenAccountA, + tokenAccountB, + fundParams + ); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + // Tick + await client + .swapTx({ + amount: new u64(829996), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: tickIndexToSqrtPriceX64(29240), + amountSpecifiedIsInput: false, + aToB, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[2].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + await client + .swapTx({ + amount: new u64(14538074), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: tickIndexToSqrtPriceX64(27712), + amountSpecifiedIsInput: false, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[2].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + await client + .swapTx({ + amount: new u64(829996), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: tickIndexToSqrtPriceX64(29240), + amountSpecifiedIsInput: false, + aToB, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[2].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + await client + .swapTx({ + amount: new u64(14538074), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: tickIndexToSqrtPriceX64(27712), + amountSpecifiedIsInput: false, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[2].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + await client + .swapTx({ + amount: new u64(829996), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: tickIndexToSqrtPriceX64(29240), + amountSpecifiedIsInput: false, + aToB, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[0].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[2].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + await client + .swapTx({ + amount: new u64(14538074), + otherAmountThreshold: MAX_U64, + sqrtPriceLimit: tickIndexToSqrtPriceX64(27712), + amountSpecifiedIsInput: false, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tickArray0: tickArrays[2].publicKey, + tickArray1: tickArrays[1].publicKey, + tickArray2: tickArrays[0].publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + await withdrawPositions(client, positionInfos, tokenAccountA, tokenAccountB); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + + ( + await Promise.all(tickArrays.map((tickArray) => client.getTickArray(tickArray.publicKey))) + ).map((tickArray) => { + tickArray.ticks.forEach((tick, index) => { + if (!tick.initialized) { + return; + } + + console.log( + tickArray.startTickIndex + index * TickSpacing.Stable, + tick.feeGrowthOutsideA.toString(), + tick.feeGrowthOutsideB.toString() + ); + }); + }); + + await client + .collectProtocolFeesTx({ + whirlpoolsConfig: poolInitInfo.whirlpoolConfigKey, + whirlpool: poolInitInfo.whirlpoolPda.publicKey, + collectProtocolFeesAuthority: configKeypairs.collectProtocolFeesAuthorityKeypair.publicKey, + tokenVaultA: poolInitInfo.tokenVaultAKeypair.publicKey, + tokenVaultB: poolInitInfo.tokenVaultBKeypair.publicKey, + tokenDestinationA: tokenAccountA, + tokenDestinationB: tokenAccountB, + }) + .addSigner(configKeypairs.collectProtocolFeesAuthorityKeypair) + .buildAndExecute(); + + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultAKeypair.publicKey)); + console.log(await getTokenBalance(provider, poolInitInfo.tokenVaultBKeypair.publicKey)); + }); +}); diff --git a/sdk/tests/tsconfig.json b/sdk/tests/tsconfig.json new file mode 100644 index 0000000..2339569 --- /dev/null +++ b/sdk/tests/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig-base.json", + "references": [ + { + "path": "../src" + } + ] +} diff --git a/sdk/tests/update_fees_and_rewards.ts b/sdk/tests/update_fees_and_rewards.ts new file mode 100644 index 0000000..5572746 --- /dev/null +++ b/sdk/tests/update_fees_and_rewards.ts @@ -0,0 +1,217 @@ +import * as anchor from "@project-serum/anchor"; +import * as assert from "assert"; +import { u64 } from "@solana/spl-token"; +import Decimal from "decimal.js"; +import { getOraclePda, getTickArrayPda, toX64 } from "../src"; +import { WhirlpoolClient } from "../src/client"; +import { WhirlpoolContext } from "../src/context"; +import { sleep, TickSpacing, ZERO_BN } from "./utils"; +import { WhirlpoolTestFixture } from "./utils/fixture"; +import { initTestPool } from "./utils/init-utils"; + +describe("update_fees_and_rewards", () => { + const provider = anchor.Provider.local(); + anchor.setProvider(anchor.Provider.env()); + const program = anchor.workspace.Whirlpool; + const context = WhirlpoolContext.fromWorkspace(provider, program); + const client = new WhirlpoolClient(context); + + it("successfully updates fees and rewards", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(1_000_000) }], + rewards: [{ emissionsPerSecondX64: toX64(new Decimal(2)), vaultAmount: new u64(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda, tokenVaultAKeypair, tokenVaultBKeypair }, + tokenAccountA, + tokenAccountB, + positions, + } = fixture.getInfos(); + + const tickArrayPda = getTickArrayPda(context.program.programId, whirlpoolPda.publicKey, 22528); + + const positionBefore = await client.getPosition(positions[0].publicKey); + assert.ok(positionBefore.feeGrowthCheckpointA.eq(ZERO_BN)); + assert.ok(positionBefore.feeGrowthCheckpointB.eq(ZERO_BN)); + assert.ok(positionBefore.rewardInfos[0].amountOwed.eq(ZERO_BN)); + assert.ok(positionBefore.rewardInfos[0].growthInsideCheckpoint.eq(ZERO_BN)); + + const oraclePda = getOraclePda(client.context.program.programId, whirlpoolPda.publicKey); + + await client + .swapTx({ + amount: new u64(100_000), + otherAmountThreshold: ZERO_BN, + sqrtPriceLimit: toX64(new Decimal(4.95)), + amountSpecifiedIsInput: true, + aToB: true, + whirlpool: whirlpoolPda.publicKey, + tokenAuthority: context.wallet.publicKey, + tokenOwnerAccountA: tokenAccountA, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenOwnerAccountB: tokenAccountB, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArray0: tickArrayPda.publicKey, + tickArray1: tickArrayPda.publicKey, + tickArray2: tickArrayPda.publicKey, + oracle: oraclePda.publicKey, + }) + .buildAndExecute(); + + await sleep(1_000); + + await client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(); + const positionAfter = await client.getPosition(positions[0].publicKey); + assert.ok(positionAfter.feeOwedA.gt(positionBefore.feeOwedA)); + assert.ok(positionAfter.feeOwedB.eq(ZERO_BN)); + assert.ok(positionAfter.feeGrowthCheckpointA.gt(positionBefore.feeGrowthCheckpointA)); + assert.ok(positionAfter.feeGrowthCheckpointB.eq(positionBefore.feeGrowthCheckpointB)); + assert.ok(positionAfter.rewardInfos[0].amountOwed.gt(positionBefore.rewardInfos[0].amountOwed)); + assert.ok( + positionAfter.rewardInfos[0].growthInsideCheckpoint.gt( + positionBefore.rewardInfos[0].growthInsideCheckpoint + ) + ); + assert.ok(positionAfter.liquidity.eq(positionBefore.liquidity)); + }); + + it("fails when position has zero liquidity", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: ZERO_BN }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + } = fixture.getInfos(); + + const tickArrayPda = getTickArrayPda(context.program.programId, whirlpoolPda.publicKey, 22528); + + await assert.rejects( + client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(), + /0x177c/ // LiquidityZero + ); + }); + + it("fails when position does not match whirlpool", async () => { + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + + const tickSpacing = TickSpacing.Standard; + const { + poolInitInfo: { whirlpoolPda }, + } = await initTestPool(client, tickSpacing); + const tickArrayPda = getTickArrayPda(context.program.programId, whirlpoolPda.publicKey, 22528); + + const other = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new u64(1_000_000) }], + }); + const { positions: otherPositions } = other.getInfos(); + + await assert.rejects( + client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: otherPositions[0].publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(), + /0xbbf/ // AccountOwnedByWrongProgram + ); + }); + + it("fails when tick arrays do not match position", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: new anchor.BN(1_000_000) }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + } = fixture.getInfos(); + + const tickArrayPda = getTickArrayPda(context.program.programId, whirlpoolPda.publicKey, 0); + + await assert.rejects( + client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(), + /0xbbf/ // AccountOwnedByWrongProgram + ); + }); + + it("fails when tick arrays do not match whirlpool", async () => { + // In same tick array - start index 22528 + const tickLowerIndex = 29440; + const tickUpperIndex = 33536; + + const tickSpacing = TickSpacing.Standard; + const fixture = await new WhirlpoolTestFixture(client).init({ + tickSpacing, + positions: [{ tickLowerIndex, tickUpperIndex, liquidityAmount: ZERO_BN }], + }); + const { + poolInitInfo: { whirlpoolPda }, + positions, + } = fixture.getInfos(); + + const { + poolInitInfo: { whirlpoolPda: otherWhirlpoolPda }, + } = await initTestPool(client, tickSpacing); + + const tickArrayPda = getTickArrayPda( + context.program.programId, + otherWhirlpoolPda.publicKey, + 22528 + ); + + await assert.rejects( + client + .updateFeesAndRewards({ + whirlpool: whirlpoolPda.publicKey, + position: positions[0].publicKey, + tickArrayLower: tickArrayPda.publicKey, + tickArrayUpper: tickArrayPda.publicKey, + }) + .buildAndExecute(), + /0xbbf/ // AccountOwnedByWrongProgram + ); + }); +}); diff --git a/sdk/tests/utils/assert.ts b/sdk/tests/utils/assert.ts new file mode 100644 index 0000000..f93db87 --- /dev/null +++ b/sdk/tests/utils/assert.ts @@ -0,0 +1,37 @@ +import * as assert from "assert"; +import { Program, web3, Coder, BN } from "@project-serum/anchor"; +import { AccountLayout } from "@solana/spl-token"; +import { TEST_TOKEN_PROGRAM_ID } from "./test-consts"; +import { Whirlpool } from "../../src/artifacts/whirlpool"; +import { TickData } from "../../src/types/anchor-types"; + +// Helper for token vault assertion checks. +export async function asyncAssertTokenVault( + program: Program, + tokenVaultPublicKey: web3.PublicKey, + expectedValues: { + expectedOwner: web3.PublicKey; + expectedMint: web3.PublicKey; + } +) { + const tokenVault: web3.AccountInfo | null = + await program.provider.connection.getAccountInfo(tokenVaultPublicKey); + if (!tokenVault) { + assert.fail(`token vault does not exist at ${tokenVaultPublicKey.toBase58()}`); + } + const tokenVaultAData = AccountLayout.decode(tokenVault.data); + assert.ok(tokenVault.owner.equals(TEST_TOKEN_PROGRAM_ID)); + assert.ok(expectedValues.expectedOwner.equals(new web3.PublicKey(tokenVaultAData.owner))); + assert.ok(expectedValues.expectedMint.equals(new web3.PublicKey(tokenVaultAData.mint))); +} + +export function assertTick( + tick: TickData, + initialized: boolean, + liquidityGross: BN, + liquidityNet: BN +) { + assert.ok(tick.initialized == initialized); + assert.ok(tick.liquidityNet.eq(liquidityNet)); + assert.ok(tick.liquidityGross.eq(liquidityGross)); +} diff --git a/sdk/tests/utils/fixture.ts b/sdk/tests/utils/fixture.ts new file mode 100644 index 0000000..8d3bf20 --- /dev/null +++ b/sdk/tests/utils/fixture.ts @@ -0,0 +1,151 @@ +import { PublicKey, Keypair } from "@solana/web3.js"; +import { u64 } from "@solana/spl-token"; +import { getStartTickIndex, InitPoolParams, WhirlpoolClient } from "../../src"; +import { + FundedPositionInfo, + FundedPositionParams, + fundPositions, + initRewardAndSetEmissions, + initTestPoolWithTokens, + initTickArray, +} from "./init-utils"; +import { BN } from "@project-serum/anchor"; +import { TickSpacing, ZERO_BN } from "."; + +interface InitFixtureParams { + tickSpacing: number; + initialSqrtPrice?: BN; + positions?: FundedPositionParams[]; + rewards?: RewardParam[]; +} + +interface RewardParam { + emissionsPerSecondX64: BN; + vaultAmount: u64; +} + +interface InitializedRewardInfo { + rewardMint: PublicKey; + rewardVaultKeypair: Keypair; +} + +export class WhirlpoolTestFixture { + private client: WhirlpoolClient; + private poolInitInfo = defaultPoolInitInfo; + private configInitInfo = defaultConfigInitInfo; + private configKeypairs = defaultConfigKeypairs; + private positions: FundedPositionInfo[] = []; + private rewards: InitializedRewardInfo[] = []; + private tokenAccountA = PublicKey.default; + private tokenAccountB = PublicKey.default; + private initialized = false; + + constructor(client: WhirlpoolClient) { + this.client = client; + } + + async init(params: InitFixtureParams): Promise { + const { tickSpacing, initialSqrtPrice, positions, rewards } = params; + + const { poolInitInfo, configInitInfo, configKeypairs, tokenAccountA, tokenAccountB } = + await initTestPoolWithTokens(this.client, tickSpacing, initialSqrtPrice); + + this.poolInitInfo = poolInitInfo; + this.configInitInfo = configInitInfo; + this.configKeypairs = configKeypairs; + this.tokenAccountA = tokenAccountA; + this.tokenAccountB = tokenAccountB; + + if (positions) { + await initTickArrays(this.client, poolInitInfo, positions); + + this.positions = await fundPositions( + this.client, + poolInitInfo, + tokenAccountA, + tokenAccountB, + positions + ); + } + + if (rewards) { + const initRewards: InitializedRewardInfo[] = []; + for (let i = 0; i < rewards.length; i++) { + // Iterate because we enforce sequential initialization on the smart contract + initRewards.push( + await initRewardAndSetEmissions( + this.client, + configKeypairs.rewardEmissionsSuperAuthorityKeypair, + poolInitInfo.whirlpoolPda.publicKey, + i, + rewards[i].vaultAmount, + rewards[i].emissionsPerSecondX64 + ) + ); + } + this.rewards = initRewards; + } + this.initialized = true; + return this; + } + + getInfos() { + if (!this.initialized) { + throw new Error("Test fixture is not initialized"); + } + return { + poolInitInfo: this.poolInitInfo, + configInitInfo: this.configInitInfo, + configKeypairs: this.configKeypairs, + tokenAccountA: this.tokenAccountA, + tokenAccountB: this.tokenAccountB, + positions: this.positions, + rewards: this.rewards, + }; + } +} + +async function initTickArrays( + client: WhirlpoolClient, + poolInitInfo: InitPoolParams, + positions: FundedPositionParams[] +) { + const startTickSet = new Set(); + positions.forEach((p) => { + startTickSet.add(getStartTickIndex(p.tickLowerIndex, poolInitInfo.tickSpacing)); + startTickSet.add(getStartTickIndex(p.tickUpperIndex, poolInitInfo.tickSpacing)); + }); + + return Promise.all( + Array.from(startTickSet).map((startTick) => + initTickArray(client, poolInitInfo.whirlpoolPda.publicKey, startTick) + ) + ); +} + +const defaultPoolInitInfo = { + initSqrtPrice: ZERO_BN, + whirlpoolConfigKey: PublicKey.default, + tokenMintA: PublicKey.default, + tokenMintB: PublicKey.default, + whirlpoolPda: { publicKey: PublicKey.default, bump: 0 }, + tokenVaultAKeypair: Keypair.generate(), + tokenVaultBKeypair: Keypair.generate(), + tickSpacing: TickSpacing.Standard, + funder: PublicKey.default, +}; + +const defaultConfigInitInfo = { + whirlpoolConfigKeypair: Keypair.generate(), + feeAuthority: PublicKey.default, + collectProtocolFeesAuthority: PublicKey.default, + rewardEmissionsSuperAuthority: PublicKey.default, + defaultProtocolFeeRate: 0, + funder: PublicKey.default, +}; + +const defaultConfigKeypairs = { + feeAuthorityKeypair: Keypair.generate(), + collectProtocolFeesAuthorityKeypair: Keypair.generate(), + rewardEmissionsSuperAuthorityKeypair: Keypair.generate(), +}; diff --git a/sdk/tests/utils/index.ts b/sdk/tests/utils/index.ts new file mode 100644 index 0000000..e934fc0 --- /dev/null +++ b/sdk/tests/utils/index.ts @@ -0,0 +1,12 @@ +export * from "./test-consts"; +export * from "./token"; +export * from "./utils"; +export * from "./assert"; + +export enum TickSpacing { + One = 1, + Stable = 8, + ThirtyTwo = 32, + SixtyFour = 64, + Standard = 128, +} diff --git a/sdk/tests/utils/init-utils.ts b/sdk/tests/utils/init-utils.ts new file mode 100644 index 0000000..a82e517 --- /dev/null +++ b/sdk/tests/utils/init-utils.ts @@ -0,0 +1,538 @@ +import * as anchor from "@project-serum/anchor"; +import { + InitTickArrayParams, + OpenPositionParams, + InitPoolParams, + InitializeRewardParams, + TICK_ARRAY_SIZE, + tickIndexToSqrtPriceX64, + getTokenAmountsFromLiquidity, + toX64_BN, + getTickArrayPda, + getStartTickIndex, + InitConfigParams, +} from "../../src"; +import { WhirlpoolClient } from "../../src/client"; +import { + generateDefaultConfigParams, + generateDefaultInitFeeTierParams, + generateDefaultInitPoolParams, + generateDefaultInitTickArrayParams, + generateDefaultOpenPositionParams, +} from "./test-builders"; +import { PublicKey, Keypair } from "@solana/web3.js"; +import { + createAndMintToTokenAccount, + createMint, + mintToByAuthority, + TickSpacing, + ZERO_BN, +} from "."; +import { u64 } from "@solana/spl-token"; +import { PDA } from "../../src/types/public/helper-types"; + +const defaultInitSqrtPrice = toX64_BN(new u64(5)); + +/** + * Initialize a brand new WhirlpoolConfig account and construct a set of InitPoolParams + * that can be used to initialize a pool with. + * @param client - an instance of whirlpool client containing the program & provider + * @param initSqrtPrice - the initial sqrt-price for this newly generated pool + * @returns An object containing the params used to init the config account & the param that can be used to init the pool account. + */ +export async function buildTestPoolParams( + client: WhirlpoolClient, + tickSpacing: number, + defaultFeeRate = 3000, + initSqrtPrice = defaultInitSqrtPrice, + funder?: PublicKey +) { + const { configInitInfo, configKeypairs } = generateDefaultConfigParams(client.context); + await client.initConfigTx(configInitInfo).buildAndExecute(); + + const { params: feeTierParams } = await initFeeTier( + client, + configInitInfo, + configKeypairs.feeAuthorityKeypair, + tickSpacing, + defaultFeeRate + ); + const poolInitInfo = await generateDefaultInitPoolParams( + client.context, + configInitInfo.whirlpoolConfigKeypair.publicKey, + feeTierParams.feeTierPda.publicKey, + tickSpacing, + initSqrtPrice, + funder + ); + return { + configInitInfo, + configKeypairs, + poolInitInfo, + feeTierParams, + }; +} + +/** + * Initialize a brand new set of WhirlpoolConfig & Whirlpool account + * @param client - an instance of whirlpool client containing the program & provider + * @param initSqrtPrice - the initial sqrt-price for this newly generated pool + * @returns An object containing the params used to initialize both accounts. + */ +export async function initTestPool( + client: WhirlpoolClient, + tickSpacing: number, + initSqrtPrice = defaultInitSqrtPrice, + funder?: Keypair +) { + const { configInitInfo, poolInitInfo, configKeypairs, feeTierParams } = await buildTestPoolParams( + client, + tickSpacing, + 3000, + initSqrtPrice, + funder?.publicKey + ); + + const tx = client.initPoolTx(poolInitInfo); + if (funder) { + tx.addSigner(funder); + } + + return { + txId: await tx.buildAndExecute(), + configInitInfo, + configKeypairs, + poolInitInfo, + feeTierParams, + }; +} + +export async function initFeeTier( + client: WhirlpoolClient, + configInitInfo: InitConfigParams, + feeAuthorityKeypair: Keypair, + tickSpacing: number, + defaultFeeRate: number, + funder?: Keypair +) { + const params = generateDefaultInitFeeTierParams( + client.context, + configInitInfo.whirlpoolConfigKeypair.publicKey, + configInitInfo.feeAuthority, + tickSpacing, + defaultFeeRate, + funder?.publicKey + ); + + const tx = client.initFeeTierTx(params).addSigner(feeAuthorityKeypair); + if (funder) { + tx.addSigner(funder); + } + + return { + txId: await tx.buildAndExecute(), + params, + }; +} + +export async function initializeReward( + client: WhirlpoolClient, + rewardAuthorityKeypair: anchor.web3.Keypair, + whirlpool: PublicKey, + rewardIndex: number, + funder?: Keypair +): Promise<{ txId: string; params: InitializeRewardParams }> { + const provider = client.context.provider; + const rewardMint = await createMint(provider); + const rewardVaultKeypair = anchor.web3.Keypair.generate(); + + const params = { + rewardAuthority: rewardAuthorityKeypair.publicKey, + funder: funder?.publicKey || client.context.wallet.publicKey, + whirlpool, + rewardMint, + rewardVaultKeypair, + rewardIndex, + }; + + const tx = client.initializeRewardTx(params).addSigner(rewardAuthorityKeypair); + if (funder) { + tx.addSigner(funder); + } + + return { + txId: await tx.buildAndExecute(), + params, + }; +} + +export async function initRewardAndSetEmissions( + client: WhirlpoolClient, + rewardAuthorityKeypair: anchor.web3.Keypair, + whirlpool: PublicKey, + rewardIndex: number, + vaultAmount: u64 | number, + emissionsPerSecondX64: anchor.BN, + funder?: Keypair +) { + const { + params: { rewardMint, rewardVaultKeypair }, + } = await initializeReward(client, rewardAuthorityKeypair, whirlpool, rewardIndex, funder); + await mintToByAuthority( + client.context.provider, + rewardMint, + rewardVaultKeypair.publicKey, + vaultAmount + ); + await client + .setRewardEmissionsTx({ + rewardAuthority: rewardAuthorityKeypair.publicKey, + whirlpool, + rewardIndex, + rewardVault: rewardVaultKeypair.publicKey, + emissionsPerSecondX64, + }) + .addSigner(rewardAuthorityKeypair) + .buildAndExecute(); + return { rewardMint, rewardVaultKeypair }; +} + +export async function openPosition( + client: WhirlpoolClient, + whirlpool: PublicKey, + tickLowerIndex: number, + tickUpperIndex: number, + owner: PublicKey = client.context.provider.wallet.publicKey, + funder?: Keypair +) { + return openPositionWithOptMetadata( + client, + whirlpool, + tickLowerIndex, + tickUpperIndex, + false, + owner, + funder + ); +} + +export async function openPositionWithMetadata( + client: WhirlpoolClient, + whirlpool: PublicKey, + tickLowerIndex: number, + tickUpperIndex: number, + owner: PublicKey = client.context.provider.wallet.publicKey, + funder?: Keypair +) { + return openPositionWithOptMetadata( + client, + whirlpool, + tickLowerIndex, + tickUpperIndex, + true, + owner, + funder + ); +} + +async function openPositionWithOptMetadata( + client: WhirlpoolClient, + whirlpool: PublicKey, + tickLowerIndex: number, + tickUpperIndex: number, + withMetadata: boolean = false, + owner: PublicKey = client.context.provider.wallet.publicKey, + funder?: Keypair +) { + const { params, mint } = await generateDefaultOpenPositionParams( + client.context, + whirlpool, + tickLowerIndex, + tickUpperIndex, + owner, + funder?.publicKey || client.context.provider.wallet.publicKey + ); + let tx = withMetadata ? client.openPositionWithMetadataTx(params) : client.openPositionTx(params); + tx.addSigner(mint); + if (funder) { + tx.addSigner(funder); + } + const txId = await tx.buildAndExecute(); + return { txId, params, mint }; +} + +export async function initTickArray( + client: WhirlpoolClient, + whirlpool: PublicKey, + startTickIndex: number, + funder?: Keypair +): Promise<{ txId: string; params: InitTickArrayParams }> { + const params = generateDefaultInitTickArrayParams( + client.context, + whirlpool, + startTickIndex, + funder?.publicKey + ); + const tx = client.initTickArrayTx(params); + if (funder) { + tx.addSigner(funder); + } + return { txId: await tx.buildAndExecute(), params }; +} + +export async function initTestPoolWithTokens( + client: WhirlpoolClient, + tickSpacing: number, + initSqrtPrice = defaultInitSqrtPrice +) { + const provider = client.context.provider; + + const { poolInitInfo, configInitInfo, configKeypairs } = await initTestPool( + client, + tickSpacing, + initSqrtPrice + ); + + const { tokenMintA, tokenMintB, whirlpoolPda } = poolInitInfo; + const tokenAccountA = await createAndMintToTokenAccount(provider, tokenMintA, 15_000_000); + const tokenAccountB = await createAndMintToTokenAccount(provider, tokenMintB, 15_000_000); + return { + poolInitInfo, + configInitInfo, + configKeypairs, + whirlpoolPda, + tokenAccountA, + tokenAccountB, + }; +} + +export async function initTickArrayRange( + client: WhirlpoolClient, + whirlpool: PublicKey, + startTickIndex: number, + arrayCount: number, + tickSpacing: number, + aToB: boolean +): Promise { + const ticksInArray = tickSpacing * TICK_ARRAY_SIZE; + const direction = aToB ? -1 : 1; + const result: PDA[] = []; + + for (let i = 0; i < arrayCount; i++) { + const { params } = await initTickArray( + client, + whirlpool, + startTickIndex + direction * ticksInArray * i + ); + result.push(params.tickArrayPda); + } + + return result; +} + +export type FundedPositionParams = { + tickLowerIndex: number; + tickUpperIndex: number; + liquidityAmount: anchor.BN; +}; + +export async function withdrawPositions( + client: WhirlpoolClient, + positionInfos: FundedPositionInfo[], + tokenOwnerAccountA: PublicKey, + tokenOwnerAccountB: PublicKey +) { + await Promise.all( + positionInfos.map(async (info) => { + const pool = await client.getPool(info.initParams.whirlpoolKey); + const position = await client.getPosition(info.initParams.positionPda.publicKey); + + const priceLower = tickIndexToSqrtPriceX64(position.tickLowerIndex); + const priceUpper = tickIndexToSqrtPriceX64(position.tickUpperIndex); + + const { tokenA, tokenB } = getTokenAmountsFromLiquidity( + position.liquidity, + pool.sqrtPrice, + priceLower, + priceUpper, + false + ); + + const numTicksInTickArray = pool.tickSpacing * TICK_ARRAY_SIZE; + const lowerStartTick = + position.tickLowerIndex - (position.tickLowerIndex % numTicksInTickArray); + const tickArrayLower = getTickArrayPda( + client.context.program.programId, + info.initParams.whirlpoolKey, + lowerStartTick + ); + const upperStartTick = + position.tickUpperIndex - (position.tickUpperIndex % numTicksInTickArray); + const tickArrayUpper = getTickArrayPda( + client.context.program.programId, + info.initParams.whirlpoolKey, + upperStartTick + ); + + await client + .decreaseLiquidityTx({ + liquidityAmount: position.liquidity, + tokenMinA: tokenA, + tokenMinB: tokenB, + whirlpool: info.initParams.whirlpoolKey, + positionAuthority: client.context.provider.wallet.publicKey, + position: info.initParams.positionPda.publicKey, + positionTokenAccount: info.initParams.positionTokenAccountAddress, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA: pool.tokenVaultA, + tokenVaultB: pool.tokenVaultB, + tickArrayLower: tickArrayLower.publicKey, + tickArrayUpper: tickArrayUpper.publicKey, + }) + .buildAndExecute(); + + await client + .collectFeesTx({ + whirlpool: info.initParams.whirlpoolKey, + positionAuthority: client.context.provider.wallet.publicKey, + position: info.initParams.positionPda.publicKey, + positionTokenAccount: info.initParams.positionTokenAccountAddress, + tokenOwnerAccountA, + tokenOwnerAccountB, + tokenVaultA: pool.tokenVaultA, + tokenVaultB: pool.tokenVaultB, + }) + .buildAndExecute(); + }) + ); +} + +export interface FundedPositionInfo { + initParams: OpenPositionParams; + publicKey: PublicKey; + tokenAccount: PublicKey; + mintKeypair: Keypair; + tickArrayLower: PublicKey; + tickArrayUpper: PublicKey; +} + +export async function fundPositions( + client: WhirlpoolClient, + poolInitInfo: InitPoolParams, + tokenAccountA: PublicKey, + tokenAccountB: PublicKey, + fundParams: FundedPositionParams[] +): Promise { + const { + whirlpoolPda: { publicKey: whirlpool }, + tickSpacing, + tokenVaultAKeypair, + tokenVaultBKeypair, + initSqrtPrice, + } = poolInitInfo; + + return await Promise.all( + fundParams.map(async (param): Promise => { + const { params: positionInfo, mint } = await openPosition( + client, + whirlpool, + param.tickLowerIndex, + param.tickUpperIndex + ); + + const tickArrayLower = getTickArrayPda( + client.context.program.programId, + whirlpool, + getStartTickIndex(param.tickLowerIndex, tickSpacing) + ).publicKey; + + const tickArrayUpper = getTickArrayPda( + client.context.program.programId, + whirlpool, + getStartTickIndex(param.tickUpperIndex, tickSpacing) + ).publicKey; + + if (param.liquidityAmount.gt(ZERO_BN)) { + const { tokenA, tokenB } = getTokenAmountsFromLiquidity( + param.liquidityAmount, + initSqrtPrice, + tickIndexToSqrtPriceX64(param.tickLowerIndex), + tickIndexToSqrtPriceX64(param.tickUpperIndex), + true + ); + await client + .increaseLiquidityTx({ + liquidityAmount: param.liquidityAmount, + tokenMaxA: tokenA, + tokenMaxB: tokenB, + whirlpool: whirlpool, + positionAuthority: client.context.provider.wallet.publicKey, + position: positionInfo.positionPda.publicKey, + positionTokenAccount: positionInfo.positionTokenAccountAddress, + tokenOwnerAccountA: tokenAccountA, + tokenOwnerAccountB: tokenAccountB, + tokenVaultA: tokenVaultAKeypair.publicKey, + tokenVaultB: tokenVaultBKeypair.publicKey, + tickArrayLower, + tickArrayUpper, + }) + .buildAndExecute(); + } + return { + initParams: positionInfo, + publicKey: positionInfo.positionPda.publicKey, + tokenAccount: positionInfo.positionTokenAccountAddress, + mintKeypair: mint, + tickArrayLower, + tickArrayUpper, + }; + }) + ); +} + +export async function initTestPoolWithLiquidity(client: WhirlpoolClient) { + const { + poolInitInfo, + configInitInfo, + configKeypairs, + whirlpoolPda, + tokenAccountA, + tokenAccountB, + } = await initTestPoolWithTokens(client, TickSpacing.Standard); + + const tickArrays = await initTickArrayRange( + client, + whirlpoolPda.publicKey, + 22528, // to 33792 + 3, + TickSpacing.Standard, + false + ); + + const fundParams: FundedPositionParams[] = [ + { + liquidityAmount: new u64(100_000), + tickLowerIndex: 27904, + tickUpperIndex: 33408, + }, + ]; + + const positionInfos = await fundPositions( + client, + poolInitInfo, + tokenAccountA, + tokenAccountB, + fundParams + ); + + return { + poolInitInfo, + configInitInfo, + configKeypairs, + positionInfo: positionInfos[0].initParams, + tokenAccountA, + tokenAccountB, + tickArrays, + }; +} diff --git a/sdk/tests/utils/test-builders.ts b/sdk/tests/utils/test-builders.ts new file mode 100644 index 0000000..2f3d883 --- /dev/null +++ b/sdk/tests/utils/test-builders.ts @@ -0,0 +1,170 @@ +import { ASSOCIATED_TOKEN_PROGRAM_ID, Token, TOKEN_PROGRAM_ID } from "@solana/spl-token"; +import { Keypair, PublicKey } from "@solana/web3.js"; +import Decimal from "decimal.js"; +import { createMint } from "."; +import { + getFeeTierPda, + getPositionMetadataPda, + getPositionPda, + getTickArrayPda, + getWhirlpoolPda, + InitConfigParams, + InitFeeTierParams, + InitPoolParams, + InitTickArrayParams, + OpenPositionParams, + toX64, +} from "../../src"; +import { WhirlpoolContext } from "../../src/context"; + +export interface TestWhirlpoolsConfigKeypairs { + feeAuthorityKeypair: Keypair; + collectProtocolFeesAuthorityKeypair: Keypair; + rewardEmissionsSuperAuthorityKeypair: Keypair; +} + +export const generateDefaultConfigParams = ( + context: WhirlpoolContext, + funder?: PublicKey +): { + configInitInfo: InitConfigParams; + configKeypairs: TestWhirlpoolsConfigKeypairs; +} => { + const configKeypairs: TestWhirlpoolsConfigKeypairs = { + feeAuthorityKeypair: Keypair.generate(), + collectProtocolFeesAuthorityKeypair: Keypair.generate(), + rewardEmissionsSuperAuthorityKeypair: Keypair.generate(), + }; + const configInitInfo = { + whirlpoolConfigKeypair: Keypair.generate(), + feeAuthority: configKeypairs.feeAuthorityKeypair.publicKey, + collectProtocolFeesAuthority: configKeypairs.collectProtocolFeesAuthorityKeypair.publicKey, + rewardEmissionsSuperAuthority: configKeypairs.rewardEmissionsSuperAuthorityKeypair.publicKey, + defaultProtocolFeeRate: 300, + funder: funder || context.wallet.publicKey, + }; + return { configInitInfo, configKeypairs }; +}; + +export const createInOrderMints = async (context: WhirlpoolContext) => { + const provider = context.provider; + const tokenXMintPubKey = await createMint(provider); + const tokenYMintPubKey = await createMint(provider); + + let tokenAMintPubKey, tokenBMintPubKey; + if (Buffer.compare(tokenXMintPubKey.toBuffer(), tokenYMintPubKey.toBuffer()) < 0) { + tokenAMintPubKey = tokenXMintPubKey; + tokenBMintPubKey = tokenYMintPubKey; + } else { + tokenAMintPubKey = tokenYMintPubKey; + tokenBMintPubKey = tokenXMintPubKey; + } + + return [tokenAMintPubKey, tokenBMintPubKey]; +}; + +export const generateDefaultInitPoolParams = async ( + context: WhirlpoolContext, + configKey: PublicKey, + feeTierKey: PublicKey, + tickSpacing: number, + initSqrtPrice = toX64(new Decimal(5)), + funder?: PublicKey +): Promise => { + const [tokenAMintPubKey, tokenBMintPubKey] = await createInOrderMints(context); + + const whirlpoolPda = getWhirlpoolPda( + context.program.programId, + configKey, + tokenAMintPubKey, + tokenBMintPubKey, + tickSpacing + ); + const tokenVaultAKeypair = Keypair.generate(); + const tokenVaultBKeypair = Keypair.generate(); + + return { + initSqrtPrice, + whirlpoolConfigKey: configKey, + tokenMintA: tokenAMintPubKey, + tokenMintB: tokenBMintPubKey, + whirlpoolPda, + tokenVaultAKeypair, + tokenVaultBKeypair, + feeTierKey, + tickSpacing, + funder: funder || context.wallet.publicKey, + }; +}; + +export const generateDefaultInitFeeTierParams = ( + context: WhirlpoolContext, + whirlpoolConfigKey: PublicKey, + whirlpoolFeeAuthority: PublicKey, + tickSpacing: number, + defaultFeeRate: number, + funder?: PublicKey +): InitFeeTierParams => { + const feeTierPda = getFeeTierPda(context.program.programId, whirlpoolConfigKey, tickSpacing); + return { + feeTierPda, + whirlpoolConfigKey, + tickSpacing, + defaultFeeRate, + feeAuthority: whirlpoolFeeAuthority, + funder: funder || context.wallet.publicKey, + }; +}; + +export const generateDefaultInitTickArrayParams = ( + context: WhirlpoolContext, + whirlpool: PublicKey, + startTick: number, + funder?: PublicKey +): InitTickArrayParams => { + const tickArrayPda = getTickArrayPda(context.program.programId, whirlpool, startTick); + + return { + whirlpool, + tickArrayPda: tickArrayPda, + startTick, + funder: funder || context.wallet.publicKey, + }; +}; + +export async function generateDefaultOpenPositionParams( + context: WhirlpoolContext, + whirlpool: PublicKey, + tickLowerIndex: number, + tickUpperIndex: number, + owner: PublicKey, + funder?: PublicKey +): Promise<{ params: Required; mint: Keypair }> { + const positionMintKeypair = Keypair.generate(); + const positionPda = getPositionPda(context.program.programId, positionMintKeypair.publicKey); + + const metadataPda = getPositionMetadataPda(positionMintKeypair.publicKey); + + const positionTokenAccountAddress = await Token.getAssociatedTokenAddress( + ASSOCIATED_TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID, + positionMintKeypair.publicKey, + owner + ); + + const params: Required = { + funder: funder || context.wallet.publicKey, + ownerKey: owner, + positionPda, + metadataPda, + positionMintAddress: positionMintKeypair.publicKey, + positionTokenAccountAddress: positionTokenAccountAddress, + whirlpoolKey: whirlpool, + tickLowerIndex, + tickUpperIndex, + }; + return { + params, + mint: positionMintKeypair, + }; +} diff --git a/sdk/tests/utils/test-consts.ts b/sdk/tests/utils/test-consts.ts new file mode 100644 index 0000000..e19578a --- /dev/null +++ b/sdk/tests/utils/test-consts.ts @@ -0,0 +1,10 @@ +import { TOKEN_PROGRAM_ID, u64 } from "@solana/spl-token"; +import * as anchor from "@project-serum/anchor"; + +export const TEST_TOKEN_PROGRAM_ID = new anchor.web3.PublicKey(TOKEN_PROGRAM_ID.toString()); + +export const ZERO_BN = new anchor.BN(0); + +export const ONE_SOL = 1000000000; + +export const MAX_U64 = new u64(new u64(2).pow(new u64(64).sub(new u64(1))).toString()); diff --git a/sdk/tests/utils/token.ts b/sdk/tests/utils/token.ts new file mode 100644 index 0000000..d96b17b --- /dev/null +++ b/sdk/tests/utils/token.ts @@ -0,0 +1,184 @@ +import { BN, Provider, web3 } from "@project-serum/anchor"; +import { AuthorityType, Token, TOKEN_PROGRAM_ID, u64 } from "@solana/spl-token"; +import { TEST_TOKEN_PROGRAM_ID } from "./test-consts"; + +export async function createMint( + provider: Provider, + authority?: web3.PublicKey +): Promise { + if (authority === undefined) { + authority = provider.wallet.publicKey; + } + const mint = web3.Keypair.generate(); + const instructions = await createMintInstructions(provider, authority, mint.publicKey); + + const tx = new web3.Transaction(); + tx.add(...instructions); + + await provider.send(tx, [mint], { commitment: "confirmed" }); + + return mint.publicKey; +} + +export async function createMintInstructions( + provider: Provider, + authority: web3.PublicKey, + mint: web3.PublicKey +) { + let instructions = [ + web3.SystemProgram.createAccount({ + fromPubkey: provider.wallet.publicKey, + newAccountPubkey: mint, + space: 82, + lamports: await provider.connection.getMinimumBalanceForRentExemption(82), + programId: TEST_TOKEN_PROGRAM_ID, + }), + Token.createInitMintInstruction(TEST_TOKEN_PROGRAM_ID, mint, 0, authority, null), + ]; + return instructions; +} + +export async function createTokenAccount( + provider: Provider, + mint: web3.PublicKey, + owner: web3.PublicKey +) { + const tokenAccount = web3.Keypair.generate(); + const tx = new web3.Transaction(); + tx.add(...(await createTokenAccountInstrs(provider, tokenAccount.publicKey, mint, owner))); + await provider.send(tx, [tokenAccount], { commitment: "confirmed" }); + return tokenAccount.publicKey; +} + +async function createTokenAccountInstrs( + provider: Provider, + newAccountPubkey: web3.PublicKey, + mint: web3.PublicKey, + owner: web3.PublicKey, + lamports?: number +) { + if (lamports === undefined) { + lamports = await provider.connection.getMinimumBalanceForRentExemption(165); + } + return [ + web3.SystemProgram.createAccount({ + fromPubkey: provider.wallet.publicKey, + newAccountPubkey, + space: 165, + lamports, + programId: TEST_TOKEN_PROGRAM_ID, + }), + Token.createInitAccountInstruction(TEST_TOKEN_PROGRAM_ID, mint, newAccountPubkey, owner), + ]; +} + +/** + * Mints tokens to the specified destination token account. + * @param provider An anchor Provider object used to send transactions + * @param mint Mint address of the token + * @param destination Destination token account to receive tokens + * @param amount Number of tokens to mint + */ +export async function mintToByAuthority( + provider: Provider, + mint: web3.PublicKey, + destination: web3.PublicKey, + amount: number | BN +): Promise { + const tx = new web3.Transaction(); + tx.add( + Token.createMintToInstruction( + TOKEN_PROGRAM_ID, + mint, + destination, + provider.wallet.publicKey, + [], + amount + ) + ); + return provider.send(tx, [], { commitment: "confirmed" }); +} + +/** + * Creates a token account for the mint and mints the specified amount of tokens into the token account. + * The caller is assumed to be the mint authority. + * @param provider An anchor Provider object used to send transactions + * @param mint The mint address of the token + * @param amount Number of tokens to mint to the newly created token account + */ +export async function createAndMintToTokenAccount( + provider: Provider, + mint: web3.PublicKey, + amount: number | BN +): Promise { + const tokenAccount = await createTokenAccount(provider, mint, provider.wallet.publicKey); + await mintToByAuthority(provider, mint, tokenAccount, amount); + return tokenAccount; +} + +export async function getTokenBalance(provider: Provider, vault: web3.PublicKey) { + return (await provider.connection.getTokenAccountBalance(vault, "confirmed")).value.amount; +} + +export async function approveToken( + provider: Provider, + tokenAccount: web3.PublicKey, + delegate: web3.PublicKey, + amount: number | u64, + owner?: web3.Keypair +) { + const tx = new web3.Transaction(); + tx.add( + Token.createApproveInstruction( + TOKEN_PROGRAM_ID, + tokenAccount, + delegate, + owner?.publicKey || provider.wallet.publicKey, + [], + amount + ) + ); + return provider.send(tx, [owner], { commitment: "confirmed" }); +} + +export async function setAuthority( + provider: Provider, + tokenAccount: web3.PublicKey, + newAuthority: web3.PublicKey, + authorityType: AuthorityType, + authority: web3.Keypair +) { + const tx = new web3.Transaction(); + tx.add( + Token.createSetAuthorityInstruction( + TOKEN_PROGRAM_ID, + tokenAccount, + newAuthority, + authorityType, + authority.publicKey, + [] + ) + ); + + return provider.send(tx, [authority], { commitment: "confirmed" }); +} + +export async function transfer( + provider: Provider, + source: web3.PublicKey, + destination: web3.PublicKey, + amount: number +) { + const tx = new web3.Transaction(); + tx.add( + Token.createTransferInstruction( + TOKEN_PROGRAM_ID, + source, + destination, + provider.wallet.publicKey, + [], + amount + ) + ); + return provider.send(tx, [], { commitment: "confirmed" }); +} diff --git a/sdk/tests/utils/utils.ts b/sdk/tests/utils/utils.ts new file mode 100644 index 0000000..43676d7 --- /dev/null +++ b/sdk/tests/utils/utils.ts @@ -0,0 +1,31 @@ +import { web3, utils, Provider } from "@project-serum/anchor"; +import { PDA } from "../../src/types/public/helper-types"; +import { TransactionBuilder } from "../../src/utils/transactions/transactions-builder"; + +// Wrapper around findProgramAddress that returns a PDA object +export function findProgramAddress(seeds: (Uint8Array | Buffer)[], programId: web3.PublicKey): PDA { + const [publicKey, bump] = utils.publicKey.findProgramAddressSync(seeds, programId); + return { publicKey, bump }; +} + +export function systemTransferTx( + provider: Provider, + toPubkey: web3.PublicKey, + lamports: number +): TransactionBuilder { + return new TransactionBuilder(provider).addInstruction({ + instructions: [ + web3.SystemProgram.transfer({ + fromPubkey: provider.wallet.publicKey, + toPubkey, + lamports, + }), + ], + cleanupInstructions: [], + signers: [], + }); +} + +export function sleep(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} diff --git a/sdk/tsconfig-base.json b/sdk/tsconfig-base.json new file mode 100644 index 0000000..18dcec1 --- /dev/null +++ b/sdk/tsconfig-base.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "allowJs": false, + "declaration": true, + "lib": ["DOM", "ES6", "DOM.Iterable", "ScriptHost", "ES2016.Array.Include"], + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + } +} diff --git a/sdk/yarn-error.log b/sdk/yarn-error.log new file mode 100644 index 0000000..1a5cc53 --- /dev/null +++ b/sdk/yarn-error.log @@ -0,0 +1,1195 @@ +Arguments: + /Users/ottocheung/.nvm/versions/node/v16.4.0/bin/node /usr/local/Cellar/yarn/1.22.10/libexec/bin/yarn.js + +PATH: + /Users/ottocheung/.nvm/versions/node/v16.4.0/bin:/Users/ottocheung/.local/share/solana/install/active_release/bin:/Users/ottocheung/.rbenv/shims:/usr/local/opt/python/libexec/bin:/Users/ottocheung/.local/share/solana/install/active_release/bin:/Users/ottocheung/.local/share/solana/install/active_release/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/ottocheung/.cargo/bin:/usr/local/opt/fzf/bin + +Yarn version: + 1.22.10 + +Node version: + 16.4.0 + +Platform: + darwin x64 + +Trace: + SyntaxError: /Users/ottocheung/dev/orca/whirlpool/sdk/package.json: Unexpected token } in JSON at position 672 + at JSON.parse () + at /usr/local/Cellar/yarn/1.22.10/libexec/lib/cli.js:1625:59 + at Generator.next () + at step (/usr/local/Cellar/yarn/1.22.10/libexec/lib/cli.js:310:30) + at /usr/local/Cellar/yarn/1.22.10/libexec/lib/cli.js:321:13 + +npm manifest: + { + "name": "@orca-so/whirlpool-client-sdk", + "version": "0.0.6", + "description": "Provides functions to generate instructions needed for Orca's Whirlpool contracts", + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "dependencies": { + "@project-serum/anchor": "^0.20.1", + "@solana/spl-token": "^0.1.8", + "decimal.js": "^10.3.1" + }, + "devDependencies": { + "@types/decimal.js": "^7.4.0", + "@types/mocha": "^9.0.0", + "chai": "^4.3.4", + "mocha": "^9.0.3", + "typescript": "^4.5.5", + "@typescript-eslint/eslint-plugin": "^4.26.0", + "@typescript-eslint/parser": "^4.26.0", + "eslint-config-prettier": "^8.3.0", + }, + "scripts": { + "build": "tsc -p src", + "watch": "tsc -w -p src", + "prepublishOnly": "yarn build", + "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write" + }, + "lint-staged": { + "*.{ts,md}": "yarn run prettier-format" + }, + "files": [ + "/dist" + ] + } + +yarn manifest: + No manifest + +Lockfile: + # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + # yarn lockfile v1 + + + "@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" + integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== + dependencies: + regenerator-runtime "^0.13.4" + + "@ethersproject/bytes@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" + integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + dependencies: + "@ethersproject/logger" "^5.5.0" + + "@ethersproject/logger@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" + integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + + "@ethersproject/sha2@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" + integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + hash.js "1.1.7" + + "@project-serum/anchor@^0.20.1": + version "0.20.1" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.20.1.tgz#0937807e807e8332aa708cfef4bcb6cbb88b4129" + integrity sha512-2TuBmGUn9qeYz6sJINJlElrBuPsaUAtYyUsJ3XplEBf1pczrANAgs5ceJUFzdiqGEWLn+84ObSdBeChT/AXYFA== + dependencies: + "@project-serum/borsh" "^0.2.2" + "@solana/web3.js" "^1.17.0" + base64-js "^1.5.1" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^5.3.1" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + find "^0.3.0" + js-sha256 "^0.9.0" + pako "^2.0.3" + snake-case "^3.0.4" + toml "^3.0.0" + + "@project-serum/borsh@^0.2.2": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.3.tgz#1d705c5887484cb6a127dd5feff58e90cbfcb558" + integrity sha512-lH9zEYADZE3cxrgiFym8+jbUE3NM/LH+WOKYcUjs65CT10Q64Hv45bcAAa/phwYk4Tpz0uQ1x+ergFaAoGt67Q== + dependencies: + bn.js "^5.1.2" + buffer-layout "^1.2.0" + + "@solana/buffer-layout@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326" + integrity sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w== + dependencies: + buffer "~6.0.3" + + "@solana/spl-token@^0.1.8": + version "0.1.8" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" + integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ== + dependencies: + "@babel/runtime" "^7.10.5" + "@solana/web3.js" "^1.21.0" + bn.js "^5.1.0" + buffer "6.0.3" + buffer-layout "^1.2.0" + dotenv "10.0.0" + + "@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0": + version "1.31.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.31.0.tgz#7a313d4c1a90b77f27ddbfe845a10d6883e06452" + integrity sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^3.0.0" + bn.js "^5.0.0" + borsh "^0.4.0" + bs58 "^4.0.1" + buffer "6.0.1" + cross-fetch "^3.1.4" + jayson "^3.4.4" + js-sha3 "^0.8.0" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + + "@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + + "@types/connect@^3.4.33": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + + "@types/decimal.js@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@types/decimal.js/-/decimal.js-7.4.0.tgz#0289c1903c31a4e9b94caa741916a9bc64d1c585" + integrity sha512-TiP45voN8GdDib9QkkdMprTfs86xxHInqTxNPSGbF0m6X0LXVBjkFEKbbL9fqm4ZPoVFkG1p4F26on2MWGvW5w== + dependencies: + decimal.js "*" + + "@types/express-serve-static-core@^4.17.9": + version "4.17.26" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.26.tgz#5d9a8eeecb9d5f9d7fc1d85f541512a84638ae88" + integrity sha512-zeu3tpouA043RHxW0gzRxwCHchMgftE8GArRsvYT0ByDMbn19olQHx5jLue0LxWY6iYtXb7rXmuVtSkhy9YZvQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + + "@types/lodash@^4.14.159": + version "4.14.178" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" + integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== + + "@types/mocha@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" + integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== + + "@types/node@*": + version "16.11.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10" + integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw== + + "@types/node@^12.12.54": + version "12.20.37" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.37.tgz#abb38afa9d6e8a2f627a8cb52290b3c80fbe61ed" + integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== + + "@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + + "@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + + "@types/ws@^7.4.4": + version "7.4.7" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" + integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== + dependencies: + "@types/node" "*" + + "@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + + JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + + ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + + ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + + ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + + anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + + argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + + assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + + balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + + base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + + base64-js@^1.3.1, base64-js@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + + binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + + bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + + bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + + borsh@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.4.0.tgz#9dd6defe741627f1315eac2a73df61421f6ddb9f" + integrity sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g== + dependencies: + "@types/bn.js" "^4.11.5" + bn.js "^5.0.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + + brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + + braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + + brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + + browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + + bs58@^4.0.0, bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + + buffer-layout@^1.2.0, buffer-layout@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" + integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== + + buffer@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" + integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + + buffer@6.0.3, buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + + bufferutil@^4.0.1: + version "4.0.5" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" + integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== + dependencies: + node-gyp-build "^4.3.0" + + camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + + camelcase@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" + integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== + + chai@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.1" + type-detect "^4.0.5" + + chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + + check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= + + chokidar@3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + + circular-json@^0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + + cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + + color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + + color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + + commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + + concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + + cross-fetch@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" + integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== + dependencies: + node-fetch "2.6.1" + + crypto-hash@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" + integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== + + debug@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + + decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + + decimal.js@*, decimal.js@^10.3.1: + version "10.3.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" + integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== + + deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + + delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + + diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + + dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + + dotenv@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" + integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== + + elliptic@^6.5.2: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + + emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + + es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + + es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + + escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + + escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + + eventemitter3@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + + eyes@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= + + fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + + find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + + find@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" + integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== + dependencies: + traverse-chain "~0.1.0" + + flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + + fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + + fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + + get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + + get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + + glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + + glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + + growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + + has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + + hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + + he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + + hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + + ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + + inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + + inherits@2, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + + is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + + is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + + is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + + is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + + is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + + is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + + is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + + isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + + isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + + jayson@^3.4.4: + version "3.6.5" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.5.tgz#e560bcad4daf098c7391f46ba8efc9d6f34a4102" + integrity sha512-wmOjX+eQcnCDyPF4KORomaIj9wj3h0B5VEbeD0+2VHfTfErB+h1zpR7oBkgCZp36AFjp3+a4CLz6U72BYpFHAw== + dependencies: + "@types/connect" "^3.4.33" + "@types/express-serve-static-core" "^4.17.9" + "@types/lodash" "^4.14.159" + "@types/node" "^12.12.54" + "@types/ws" "^7.4.4" + JSONStream "^1.3.5" + commander "^2.20.3" + delay "^5.0.0" + es6-promisify "^5.0.0" + eyes "^0.1.8" + isomorphic-ws "^4.0.1" + json-stringify-safe "^5.0.1" + lodash "^4.17.20" + uuid "^3.4.0" + ws "^7.4.5" + + js-sha256@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + + js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + + js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + + json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + + jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + + locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + + lodash@^4.17.20: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + + log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + + lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + + minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + + minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + + mocha@^9.0.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" + integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.2" + debug "4.3.2" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.7" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "3.0.4" + ms "2.1.3" + nanoid "3.1.25" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.1.5" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + + ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + + ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + + nanoid@3.1.25: + version "3.1.25" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== + + no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + + node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + + node-fetch@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + + node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" + integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== + + normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + + once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + + p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + + p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + + pako@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" + integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== + + path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + + path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + + pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + + picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + + randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + + readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + + regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + + require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + + rpc-websockets@^7.4.2: + version "7.4.16" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.16.tgz#eb701cdef577d4357ba5f526d50e25f370396fac" + integrity sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ== + dependencies: + "@babel/runtime" "^7.11.2" + circular-json "^0.5.9" + eventemitter3 "^4.0.7" + uuid "^8.3.0" + ws "^7.4.5" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + + safe-buffer@^5.0.1, safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + + secp256k1@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" + integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== + dependencies: + elliptic "^6.5.2" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + + serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + + snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + + string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + + strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + + strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + + superstruct@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" + integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== + + supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + + supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + + text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + + "through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + + to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + + toml@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + + traverse-chain@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" + integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= + + tslib@^2.0.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + + tweetnacl@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + + type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + + typescript@^4.5.5: + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== + + utf-8-validate@^5.0.2: + version "5.0.7" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" + integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== + dependencies: + node-gyp-build "^4.3.0" + + uuid@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + + uuid@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + + which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + + workerpool@6.1.5: + version "6.1.5" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" + integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== + + wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + + wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + + ws@^7.4.5: + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== + + y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + + yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + + yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + + yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + + yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + + yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/sdk/yarn.lock b/sdk/yarn.lock new file mode 100644 index 0000000..4597a84 --- /dev/null +++ b/sdk/yarn.lock @@ -0,0 +1,1131 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" + integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== + dependencies: + regenerator-runtime "^0.13.4" + +"@ethersproject/bytes@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" + integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/logger@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" + integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + +"@ethersproject/sha2@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" + integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + hash.js "1.1.7" + +"@project-serum/anchor@^0.20.1": + version "0.20.1" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.20.1.tgz#0937807e807e8332aa708cfef4bcb6cbb88b4129" + integrity sha512-2TuBmGUn9qeYz6sJINJlElrBuPsaUAtYyUsJ3XplEBf1pczrANAgs5ceJUFzdiqGEWLn+84ObSdBeChT/AXYFA== + dependencies: + "@project-serum/borsh" "^0.2.2" + "@solana/web3.js" "^1.17.0" + base64-js "^1.5.1" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^5.3.1" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + find "^0.3.0" + js-sha256 "^0.9.0" + pako "^2.0.3" + snake-case "^3.0.4" + toml "^3.0.0" + +"@project-serum/borsh@^0.2.2": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.3.tgz#1d705c5887484cb6a127dd5feff58e90cbfcb558" + integrity sha512-lH9zEYADZE3cxrgiFym8+jbUE3NM/LH+WOKYcUjs65CT10Q64Hv45bcAAa/phwYk4Tpz0uQ1x+ergFaAoGt67Q== + dependencies: + bn.js "^5.1.2" + buffer-layout "^1.2.0" + +"@solana/buffer-layout@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326" + integrity sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w== + dependencies: + buffer "~6.0.3" + +"@solana/spl-token@^0.1.8": + version "0.1.8" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" + integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ== + dependencies: + "@babel/runtime" "^7.10.5" + "@solana/web3.js" "^1.21.0" + bn.js "^5.1.0" + buffer "6.0.3" + buffer-layout "^1.2.0" + dotenv "10.0.0" + +"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0": + version "1.31.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.31.0.tgz#7a313d4c1a90b77f27ddbfe845a10d6883e06452" + integrity sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^3.0.0" + bn.js "^5.0.0" + borsh "^0.4.0" + bs58 "^4.0.1" + buffer "6.0.1" + cross-fetch "^3.1.4" + jayson "^3.4.4" + js-sha3 "^0.8.0" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + +"@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/connect@^3.4.33": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/decimal.js@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@types/decimal.js/-/decimal.js-7.4.0.tgz#0289c1903c31a4e9b94caa741916a9bc64d1c585" + integrity sha512-TiP45voN8GdDib9QkkdMprTfs86xxHInqTxNPSGbF0m6X0LXVBjkFEKbbL9fqm4ZPoVFkG1p4F26on2MWGvW5w== + dependencies: + decimal.js "*" + +"@types/express-serve-static-core@^4.17.9": + version "4.17.26" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.26.tgz#5d9a8eeecb9d5f9d7fc1d85f541512a84638ae88" + integrity sha512-zeu3tpouA043RHxW0gzRxwCHchMgftE8GArRsvYT0ByDMbn19olQHx5jLue0LxWY6iYtXb7rXmuVtSkhy9YZvQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/lodash@^4.14.159": + version "4.14.178" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" + integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== + +"@types/mocha@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" + integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== + +"@types/node@*": + version "16.11.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10" + integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw== + +"@types/node@^12.12.54": + version "12.20.37" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.37.tgz#abb38afa9d6e8a2f627a8cb52290b3c80fbe61ed" + integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== + +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + +"@types/ws@^7.4.4": + version "7.4.7" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" + integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== + dependencies: + "@types/node" "*" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1, base64-js@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + +borsh@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.4.0.tgz#9dd6defe741627f1315eac2a73df61421f6ddb9f" + integrity sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g== + dependencies: + "@types/bn.js" "^4.11.5" + bn.js "^5.0.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +bs58@^4.0.0, bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + +buffer-layout@^1.2.0, buffer-layout@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" + integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== + +buffer@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" + integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +buffer@6.0.3, buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bufferutil@^4.0.1: + version "4.0.5" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" + integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== + dependencies: + node-gyp-build "^4.3.0" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" + integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== + +chai@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.1" + type-detect "^4.0.5" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= + +chokidar@3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +circular-json@^0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +cross-fetch@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" + integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== + dependencies: + node-fetch "2.6.1" + +crypto-hash@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" + integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== + +debug@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decimal.js@*, decimal.js@^10.3.1: + version "10.3.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" + integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== + +deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + +delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +dotenv@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" + integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== + +elliptic@^6.5.2: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eventemitter3@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +eyes@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" + integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== + dependencies: + traverse-chain "~0.1.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +jayson@^3.4.4: + version "3.6.5" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.5.tgz#e560bcad4daf098c7391f46ba8efc9d6f34a4102" + integrity sha512-wmOjX+eQcnCDyPF4KORomaIj9wj3h0B5VEbeD0+2VHfTfErB+h1zpR7oBkgCZp36AFjp3+a4CLz6U72BYpFHAw== + dependencies: + "@types/connect" "^3.4.33" + "@types/express-serve-static-core" "^4.17.9" + "@types/lodash" "^4.14.159" + "@types/node" "^12.12.54" + "@types/ws" "^7.4.4" + JSONStream "^1.3.5" + commander "^2.20.3" + delay "^5.0.0" + es6-promisify "^5.0.0" + eyes "^0.1.8" + isomorphic-ws "^4.0.1" + json-stringify-safe "^5.0.1" + lodash "^4.17.20" + uuid "^3.4.0" + ws "^7.4.5" + +js-sha256@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + +js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.20: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +mocha@^9.0.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" + integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.2" + debug "4.3.2" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.7" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "3.0.4" + ms "2.1.3" + nanoid "3.1.25" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.1.5" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@3.1.25: + version "3.1.25" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-fetch@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" + integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +pako@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" + integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +rpc-websockets@^7.4.2: + version "7.4.16" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.16.tgz#eb701cdef577d4357ba5f526d50e25f370396fac" + integrity sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ== + dependencies: + "@babel/runtime" "^7.11.2" + circular-json "^0.5.9" + eventemitter3 "^4.0.7" + uuid "^8.3.0" + ws "^7.4.5" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +secp256k1@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" + integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== + dependencies: + elliptic "^6.5.2" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +superstruct@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" + integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toml@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + +traverse-chain@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" + integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= + +tslib@^2.0.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + +tweetnacl@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +typescript@^4.5.5: + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== + +utf-8-validate@^5.0.2: + version "5.0.7" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" + integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== + dependencies: + node-gyp-build "^4.3.0" + +uuid@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +workerpool@6.1.5: + version "6.1.5" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" + integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +ws@^7.4.5: + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..837bc21 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "exclude": [ + "/**/tests/**", + "/**/dist/**" +], + "references": [ + { + "path": "./sdk" + }, + { + "path": "./scripts" + } +] +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..c4ba5d0 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1486 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.5.tgz#7f3e34bf8bdbbadf03fbb7b1ea0d929569c9487a" + integrity sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA== + dependencies: + regenerator-runtime "^0.13.4" + +"@ethersproject/bytes@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" + integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/logger@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" + integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + +"@ethersproject/sha2@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" + integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + hash.js "1.1.7" + +"@metaplex-foundation/mpl-core@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-core/-/mpl-core-0.0.2.tgz#17ee2cc216e17629d6df1dbba75964625ebbd603" + integrity sha512-UUJ4BlYiWdDegAWmjsNQiNehwYU3QfSFWs3sv4VX0J6/ZrQ28zqosGhQ+I2ZCTEy216finJ82sZWNjuwSWCYyQ== + dependencies: + "@solana/web3.js" "^1.31.0" + bs58 "^4.0.1" + +"@metaplex-foundation/mpl-token-metadata@1.2.5": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-token-metadata/-/mpl-token-metadata-1.2.5.tgz#1a927b1c7d30cd634a1e4782022712a02f6865c2" + integrity sha512-pxRG53JsTSwXpiJJMHNulJhH8kO3hHztQ3QxslUoKw2hBYKXsg9TGsiHgNIhN2MPZGBJ2pDeK6kNGv0sd54HhA== + dependencies: + "@metaplex-foundation/mpl-core" "^0.0.2" + "@solana/spl-token" "^0.1.8" + "@solana/web3.js" "^1.31.0" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@project-serum/anchor@^0.20.1": + version "0.20.1" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.20.1.tgz#0937807e807e8332aa708cfef4bcb6cbb88b4129" + integrity sha512-2TuBmGUn9qeYz6sJINJlElrBuPsaUAtYyUsJ3XplEBf1pczrANAgs5ceJUFzdiqGEWLn+84ObSdBeChT/AXYFA== + dependencies: + "@project-serum/borsh" "^0.2.2" + "@solana/web3.js" "^1.17.0" + base64-js "^1.5.1" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^5.3.1" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + find "^0.3.0" + js-sha256 "^0.9.0" + pako "^2.0.3" + snake-case "^3.0.4" + toml "^3.0.0" + +"@project-serum/borsh@^0.2.2": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.3.tgz#1d705c5887484cb6a127dd5feff58e90cbfcb558" + integrity sha512-lH9zEYADZE3cxrgiFym8+jbUE3NM/LH+WOKYcUjs65CT10Q64Hv45bcAAa/phwYk4Tpz0uQ1x+ergFaAoGt67Q== + dependencies: + bn.js "^5.1.2" + buffer-layout "^1.2.0" + +"@solana/buffer-layout@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326" + integrity sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w== + dependencies: + buffer "~6.0.3" + +"@solana/spl-token@^0.1.8": + version "0.1.8" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" + integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ== + dependencies: + "@babel/runtime" "^7.10.5" + "@solana/web3.js" "^1.21.0" + bn.js "^5.1.0" + buffer "6.0.3" + buffer-layout "^1.2.0" + dotenv "10.0.0" + +"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0": + version "1.31.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.31.0.tgz#7a313d4c1a90b77f27ddbfe845a10d6883e06452" + integrity sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^3.0.0" + bn.js "^5.0.0" + borsh "^0.4.0" + bs58 "^4.0.1" + buffer "6.0.1" + cross-fetch "^3.1.4" + jayson "^3.4.4" + js-sha3 "^0.8.0" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + +"@solana/web3.js@^1.31.0": + version "1.36.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.36.0.tgz#79d7d5217b49b80139f4de68953adc5b9a9a264f" + integrity sha512-RNT1451iRR7TyW7EJKMCrH/0OXawIe4zVm0DWQASwXlR/u1jmW6FrmH0lujIh7cGTlfOVbH+2ZU9AVUPLBFzwA== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^3.0.0" + bn.js "^5.0.0" + borsh "^0.4.0" + bs58 "^4.0.1" + buffer "6.0.1" + cross-fetch "^3.1.4" + jayson "^3.4.4" + js-sha3 "^0.8.0" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + +"@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/connect@^3.4.33": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/decimal.js@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@types/decimal.js/-/decimal.js-7.4.0.tgz#0289c1903c31a4e9b94caa741916a9bc64d1c585" + integrity sha512-TiP45voN8GdDib9QkkdMprTfs86xxHInqTxNPSGbF0m6X0LXVBjkFEKbbL9fqm4ZPoVFkG1p4F26on2MWGvW5w== + dependencies: + decimal.js "*" + +"@types/express-serve-static-core@^4.17.9": + version "4.17.26" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.26.tgz#5d9a8eeecb9d5f9d7fc1d85f541512a84638ae88" + integrity sha512-zeu3tpouA043RHxW0gzRxwCHchMgftE8GArRsvYT0ByDMbn19olQHx5jLue0LxWY6iYtXb7rXmuVtSkhy9YZvQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/json-schema@^7.0.7": + version "7.0.10" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.10.tgz#9b05b7896166cd00e9cbd59864853abf65d9ac23" + integrity sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A== + +"@types/lodash@^4.14.159": + version "4.14.178" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" + integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== + +"@types/mocha@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" + integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== + +"@types/mz@^2.7.3": + version "2.7.4" + resolved "https://registry.yarnpkg.com/@types/mz/-/mz-2.7.4.tgz#f9d1535cb5171199b28ae6abd6ec29e856551401" + integrity sha512-Zs0imXxyWT20j3Z2NwKpr0IO2LmLactBblNyLua5Az4UHuqOQ02V3jPTgyKwDkuc33/ahw+C3O1PIZdrhFMuQA== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "17.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.0.tgz#62797cee3b8b497f6547503b2312254d4fe3c2bb" + integrity sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw== + +"@types/node@^12.12.54": + version "12.20.37" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.37.tgz#abb38afa9d6e8a2f627a8cb52290b3c80fbe61ed" + integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== + +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + +"@types/ws@^7.4.4": + version "7.4.7" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" + integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== + dependencies: + "@types/node" "*" + +"@typescript-eslint/eslint-plugin@^4.26.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" + integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== + dependencies: + "@typescript-eslint/experimental-utils" "4.33.0" + "@typescript-eslint/scope-manager" "4.33.0" + debug "^4.3.1" + functional-red-black-tree "^1.0.1" + ignore "^5.1.8" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" + integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^4.26.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" + integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== + dependencies: + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" + debug "^4.3.1" + +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== + dependencies: + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" + +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== + +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== + dependencies: + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== + dependencies: + "@typescript-eslint/types" "4.33.0" + eslint-visitor-keys "^2.0.0" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1, base64-js@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + +borsh@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.4.0.tgz#9dd6defe741627f1315eac2a73df61421f6ddb9f" + integrity sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g== + dependencies: + "@types/bn.js" "^4.11.5" + bn.js "^5.0.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.1, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +bs58@^4.0.0, bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + +buffer-layout@^1.2.0, buffer-layout@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" + integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== + +buffer@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" + integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +buffer@6.0.3, buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bufferutil@^4.0.1: + version "4.0.5" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" + integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== + dependencies: + node-gyp-build "^4.3.0" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" + integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== + +chai@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.1" + type-detect "^4.0.5" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= + +chokidar@3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +circular-json@^0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +cross-fetch@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" + integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== + dependencies: + node-fetch "2.6.1" + +crypto-hash@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" + integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== + +debug@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + +debug@^4.3.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decimal.js@*, decimal.js@^10.3.1: + version "10.3.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" + integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== + +deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + +delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +dotenv@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" + integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== + +elliptic@^6.5.2: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-prettier@^8.3.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" + integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +eventemitter3@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +eyes@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= + +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" + integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== + dependencies: + traverse-chain "~0.1.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globby@^11.0.3: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +ignore@^5.1.8, ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +jayson@^3.4.4: + version "3.6.6" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.6.tgz#189984f624e398f831bd2be8e8c80eb3abf764a1" + integrity sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ== + dependencies: + "@types/connect" "^3.4.33" + "@types/express-serve-static-core" "^4.17.9" + "@types/lodash" "^4.14.159" + "@types/node" "^12.12.54" + "@types/ws" "^7.4.4" + JSONStream "^1.3.5" + commander "^2.20.3" + delay "^5.0.0" + es6-promisify "^5.0.0" + eyes "^0.1.8" + isomorphic-ws "^4.0.1" + json-stringify-safe "^5.0.1" + lodash "^4.17.20" + uuid "^8.3.2" + ws "^7.4.5" + +js-sha256@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + +js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.20: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +mocha@^9.0.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" + integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.2" + debug "4.3.2" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.7" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "3.0.4" + ms "2.1.3" + nanoid "3.1.25" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.1.5" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +mz@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + +nanoid@3.1.25: + version "3.1.25" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-fetch@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" + integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +pako@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" + integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + +picomatch@^2.2.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +prettier@^2.3.2: + version "2.6.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.0.tgz#12f8f504c4d8ddb76475f441337542fa799207d4" + integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +regexpp@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rpc-websockets@^7.4.2: + version "7.4.16" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.16.tgz#eb701cdef577d4357ba5f526d50e25f370396fac" + integrity sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ== + dependencies: + "@babel/runtime" "^7.11.2" + circular-json "^0.5.9" + eventemitter3 "^4.0.7" + uuid "^8.3.0" + ws "^7.4.5" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +secp256k1@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" + integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== + dependencies: + elliptic "^6.5.2" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +semver@^7.3.5: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +superstruct@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" + integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toml@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + +traverse-chain@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" + integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.0.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +tweetnacl@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +typescript@^4.5.5: + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== + +utf-8-validate@^5.0.2: + version "5.0.7" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" + integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== + dependencies: + node-gyp-build "^4.3.0" + +uuid@^8.3.0, uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +workerpool@6.1.5: + version "6.1.5" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" + integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +ws@^7.4.5: + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==