From 51ff8cf795d22390756761dc294c48e7374eed3e Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 24 Jan 2024 09:08:15 -0600 Subject: [PATCH] fix: stableswap unbound function --- .changeset/short-worms-serve.md | 5 +++++ src/lib/swap/stableswapCurve/stable.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/short-worms-serve.md diff --git a/.changeset/short-worms-serve.md b/.changeset/short-worms-serve.md new file mode 100644 index 0000000..76395ad --- /dev/null +++ b/.changeset/short-worms-serve.md @@ -0,0 +1,5 @@ +--- +"@shadeprotocol/shadejs": patch +--- + +fix unbound function in stableswap math diff --git a/src/lib/swap/stableswapCurve/stable.ts b/src/lib/swap/stableswapCurve/stable.ts index e5651e0..1cabbc6 100644 --- a/src/lib/swap/stableswapCurve/stable.ts +++ b/src/lib/swap/stableswapCurve/stable.ts @@ -738,7 +738,7 @@ export class StableConfig { initialGuessNewton: tvl, upperBoundBisect: tvl, ignoreNegativeResult: true, - lazyLowerBoundBisect: this.geometricMeanDoubled, + lazyLowerBoundBisect: this.geometricMeanDoubled.bind(this), lowerBoundBisect: undefined, }); }