From 789da217e5c7daf86e1902c058aa35a7b5c0a2a9 Mon Sep 17 00:00:00 2001 From: Phu Ngo <12547020+NgoKimPhu@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:59:35 +0700 Subject: [PATCH] feat: use github.com/goccy/go-json (#557) * feat: custom clone funcs for pool. implement for uniswap-v3 to avoid reflection when implemented * feat: custom clone funcs for swap limits. refactor to common types * feat: apply uniswapv3 uint256 for pancake-v3 * feat: use github.com/goccy/go-json --- pkg/entity/bestpath.go | 2 +- pkg/entity/pool.go | 3 ++- pkg/liquidity-source/ambient/pool_list_updater.go | 2 +- .../ambient/pool_list_updater_test.go | 7 ++++--- pkg/liquidity-source/ambient/pool_tracker.go | 7 ++++--- pkg/liquidity-source/ambient/pool_tracker_test.go | 2 +- pkg/liquidity-source/ambient/types_test.go | 5 +++-- .../balancer-v2/shared/pools_list_updater.go | 2 +- pkg/liquidity-source/bancor-v21/common_rpc.go | 2 +- pkg/liquidity-source/bancor-v21/pool_simulator.go | 2 +- .../bancor-v21/pool_simulator_test.go | 2 +- pkg/liquidity-source/bancor-v21/pool_tracker.go | 2 +- .../bancor-v21/pools_list_updater.go | 2 +- pkg/liquidity-source/bancor-v3/pool_simulator.go | 2 +- pkg/liquidity-source/bebop/client/http.go | 5 +++-- pkg/liquidity-source/bebop/pool_simulator.go | 2 +- pkg/liquidity-source/clipper/pool_simulator.go | 5 +++-- .../clipper/pool_simulator_test.go | 5 +++-- pkg/liquidity-source/curve/plain/pool_simulator.go | 2 +- .../curve/plain/pool_simulator_compare_test.go | 2 +- .../curve/plain/pool_simulator_test.go | 2 +- pkg/liquidity-source/curve/plain/pool_tracker.go | 11 ++++++----- .../curve/plain/pools_list_updater.go | 9 +++++---- .../curve/shared/pools_list_updater.go | 5 +++-- pkg/liquidity-source/curve/shared/type.go | 2 +- .../curve/stable-meta-ng/benchmark_test.go | 5 +++-- .../curve/stable-meta-ng/pool_simulator_test.go | 2 +- .../curve/stable-meta-ng/pool_tracker.go | 9 +++++---- .../curve/stable-meta-ng/pools_list_updater.go | 7 ++++--- .../curve/stable-ng/pool_simulator.go | 2 +- .../curve/stable-ng/pool_simulator_test.go | 2 +- .../curve/stable-ng/pool_tracker.go | 9 +++++---- .../curve/stable-ng/pools_list_updater.go | 7 ++++--- .../curve/tricrypto-ng/pool_simulator.go | 2 +- .../curve/tricrypto-ng/pool_simulator_test.go | 2 +- .../curve/tricrypto-ng/pool_tracker.go | 9 +++++---- .../curve/tricrypto-ng/pools_list_updater.go | 7 ++++--- .../curve/twocrypto-ng/pool_simulator.go | 2 +- .../curve/twocrypto-ng/pool_simulator_test.go | 2 +- .../curve/twocrypto-ng/pool_tracker.go | 6 +++--- .../curve/twocrypto-ng/pools_list_updater.go | 2 +- .../dai-usds/pools_list_updater.go | 2 +- .../deltaswap-v1/pool_tracker_test.go | 7 ++++--- pkg/liquidity-source/dexalot/client/http.go | 7 ++++--- pkg/liquidity-source/dexalot/pool_simulator.go | 7 ++++--- .../dodo/classical/pool_simulator.go | 2 +- .../dodo/classical/pools_list_updater.go | 2 +- .../dodo/dpp/pools_list_updater.go | 2 +- .../dodo/dsp/pools_list_updater.go | 2 +- .../dodo/dvm/pools_list_updater.go | 2 +- pkg/liquidity-source/dodo/shared/pool_tracker.go | 2 +- .../dodo/shared/pools_list_updater.go | 2 +- .../etherfi/eeth/pool_list_updater.go | 2 +- pkg/liquidity-source/etherfi/eeth/pool_tracker.go | 6 +++--- .../etherfi/weeth/pool_list_updater.go | 2 +- pkg/liquidity-source/etherfi/weeth/pool_tracker.go | 6 +++--- .../fluid/dex-t1/pool_list_updater.go | 2 +- .../fluid/dex-t1/pool_list_updater_test.go | 5 +++-- .../fluid/dex-t1/pool_simulator.go | 2 +- pkg/liquidity-source/fluid/dex-t1/pool_tracker.go | 2 +- .../fluid/dex-t1/pool_tracker_test.go | 2 +- .../fluid/vault-t1/pool_list_updater.go | 2 +- .../fluid/vault-t1/pool_list_updater_test.go | 5 +++-- .../fluid/vault-t1/pool_simulator.go | 2 +- .../fluid/vault-t1/pool_tracker.go | 4 ++-- .../fluid/vault-t1/pool_tracker_test.go | 9 +++++---- .../generic-simple-rate/pool_list_updater.go | 2 +- .../generic-simple-rate/pool_list_updater_test.go | 9 +++++---- .../generic-simple-rate/pool_simulator.go | 5 +++-- .../generic-simple-rate/pool_tracker.go | 11 ++++++----- .../gyroscope/2clp/pool_simulator.go | 2 +- .../gyroscope/2clp/pool_simulator_test.go | 2 +- .../gyroscope/2clp/pool_tracker.go | 4 ++-- .../gyroscope/2clp/pools_list_updater.go | 2 +- .../gyroscope/3clp/pool_simulator.go | 2 +- .../gyroscope/3clp/pool_simulator_test.go | 2 +- .../gyroscope/3clp/pool_tracker.go | 4 ++-- .../gyroscope/3clp/pools_list_updater.go | 2 +- .../gyroscope/eclp/pools_list_updater.go | 2 +- .../gyroscope/shared/pools_list_updater.go | 2 +- pkg/liquidity-source/hashflow-v3/pool_simulator.go | 2 +- pkg/liquidity-source/integral/pool_tracker_test.go | 7 ++++--- .../kelp/rseth/pool_list_updater.go | 6 +++--- pkg/liquidity-source/kelp/rseth/pool_simulator.go | 2 +- pkg/liquidity-source/kelp/rseth/pool_tracker.go | 7 ++++--- .../maker/savingsdai/pool_simulator.go | 2 +- .../mantle/meth/pool_list_updater.go | 7 ++++--- pkg/liquidity-source/mantle/meth/pool_simulator.go | 7 ++++--- pkg/liquidity-source/mantle/meth/pool_tracker.go | 7 ++++--- .../maverick-v2/pool_list_updater.go | 2 +- pkg/liquidity-source/mkr-sky/pool_simulator.go | 5 +++-- pkg/liquidity-source/mkr-sky/pools_list_updater.go | 2 +- .../nomiswap/nomiswapstable/pool_simulator.go | 5 +++-- pkg/liquidity-source/nomiswap/pool_tracker.go | 7 ++++--- .../nomiswap/pools_list_updater.go | 7 ++++--- .../ondo-usdy/pool_list_updater.go | 5 +++-- pkg/liquidity-source/ondo-usdy/pool_simulator.go | 7 ++++--- pkg/liquidity-source/ondo-usdy/pool_tracker.go | 3 ++- .../ondo-usdy/pool_tracker_test.go | 7 ++++--- pkg/liquidity-source/primeeth/pool_list_updater.go | 10 ++++++---- pkg/liquidity-source/primeeth/pool_simulator.go | 8 +++++--- pkg/liquidity-source/primeeth/pool_tracker.go | 7 ++++--- .../puffer/pufeth/pool_list_updater.go | 2 +- pkg/liquidity-source/puffer/pufeth/pool_tracker.go | 6 +++--- .../renzo/ezeth/pool_list_updater.go | 4 ++-- pkg/liquidity-source/renzo/ezeth/pool_simulator.go | 2 +- pkg/liquidity-source/renzo/ezeth/pool_tracker.go | 7 ++++--- .../rocketpool/reth/pool_list_updater.go | 4 ++-- .../rocketpool/reth/pool_tracker.go | 6 +++--- .../staderethx/pool_list_updater.go | 10 ++++++---- pkg/liquidity-source/staderethx/pool_simulator.go | 10 ++++++---- pkg/liquidity-source/staderethx/pool_tracker.go | 7 ++++--- .../swell/rsweth/pool_list_updater.go | 2 +- pkg/liquidity-source/swell/rsweth/pool_tracker.go | 6 +++--- .../swell/sweth/pool_list_updater.go | 2 +- pkg/liquidity-source/swell/sweth/pool_tracker.go | 6 +++--- pkg/liquidity-source/uniswap-v2/pool_tracker.go | 2 +- pkg/liquidity-source/usd0pp/pool_list_updater.go | 10 ++++++---- .../usd0pp/pool_list_updater_test.go | 7 ++++--- pkg/liquidity-source/usd0pp/pool_simulator.go | 10 ++++++---- pkg/liquidity-source/usd0pp/pool_tracker.go | 10 ++++++---- pkg/liquidity-source/usd0pp/pool_tracker_test.go | 10 ++++++---- pkg/liquidity-source/woofi-v2/pool_simulator.go | 7 ++++--- pkg/liquidity-source/woofi-v2/pool_tracker.go | 8 ++++---- pkg/liquidity-source/woofi-v21/pool_simulator.go | 7 ++++--- pkg/liquidity-source/woofi-v21/pool_tracker.go | 8 ++++---- .../woofi-v21/pool_tracker_test.go | 7 ++++--- pkg/source/algebrav1/pool_list_updater.go | 2 +- pkg/source/algebrav1/pool_simulator.go | 7 +++---- pkg/source/algebrav1/pool_tracker.go | 2 +- pkg/source/algebrav1/ticklens.go | 10 ++++------ .../balancer-composable-stable/pool_simulator.go | 3 ++- .../balancer-composable-stable/pool_tracker.go | 2 +- .../pools_list_updater.go | 2 +- pkg/source/balancer/pool_tracker.go | 2 +- pkg/source/balancer/pools_list_updater.go | 2 +- pkg/source/balancer/stable/pool_simulator.go | 2 +- pkg/source/balancer/weighted/pool_simulator.go | 6 +++--- pkg/source/biswap/pools_list_updater.go | 2 +- pkg/source/camelot/pool_lists_updater.go | 2 +- pkg/source/camelot/pool_simulator.go | 3 ++- pkg/source/camelot/pool_tracker.go | 2 +- pkg/source/curve/aave/pool_simulator.go | 3 ++- pkg/source/curve/base/pool_simulator.go | 3 ++- pkg/source/curve/base/pool_simulator_test.go | 2 +- pkg/source/curve/compound/pool_simulator.go | 3 ++- pkg/source/curve/meta/pool_simulator.go | 3 ++- pkg/source/curve/plain-oracle/pool_simulator.go | 3 ++- .../curve/plain-oracle/pool_simulator_test.go | 2 +- pkg/source/curve/pool_aave.go | 4 ++-- pkg/source/curve/pool_base.go | 2 +- pkg/source/curve/pool_compound.go | 4 ++-- pkg/source/curve/pool_meta.go | 4 ++-- pkg/source/curve/pool_plain_oracle.go | 4 ++-- pkg/source/curve/pool_tricrypto.go | 4 ++-- pkg/source/curve/pool_two.go | 4 ++-- pkg/source/curve/pools_list_updater.go | 2 +- pkg/source/curve/tricrypto/pool_simulator.go | 3 ++- pkg/source/curve/two/pool_simulator.go | 3 ++- pkg/source/dmm/pool_simulator.go | 3 ++- pkg/source/dmm/pool_tracker.go | 2 +- pkg/source/dmm/pools_list_updater.go | 2 +- pkg/source/dodo/pool_simulator.go | 3 ++- pkg/source/dodo/pool_simulator_test.go | 2 +- pkg/source/dodo/pool_tracker.go | 2 +- pkg/source/dodo/pools_list_updater.go | 2 +- pkg/source/dystopia/pools_list_updater.go | 2 +- pkg/source/elastic/pool_simulator.go | 2 +- pkg/source/elastic/pool_tracker.go | 2 +- pkg/source/elastic/pools_list_updater.go | 2 +- pkg/source/equalizer/helper.go | 2 +- pkg/source/equalizer/pool_simulator_test.go | 2 +- pkg/source/equalizer/pools_list_updater.go | 2 +- pkg/source/fraxswap/pool_simulator.go | 2 +- pkg/source/fraxswap/pool_tracker.go | 2 +- pkg/source/fraxswap/pools_list_updater.go | 2 +- pkg/source/fulcrom/pool_simulator.go | 3 ++- pkg/source/fulcrom/pool_simulator_test.go | 2 +- pkg/source/fulcrom/pool_tracker.go | 2 +- pkg/source/fulcrom/pools_list_updater.go | 2 +- pkg/source/fxdx/pool_simulator.go | 2 +- pkg/source/fxdx/pool_simulator_test.go | 2 +- pkg/source/fxdx/pool_tracker.go | 2 +- pkg/source/fxdx/pools_list_updater.go | 2 +- pkg/source/gmx-glp/pool_simulator.go | 2 +- pkg/source/gmx-glp/pool_tracker.go | 2 +- pkg/source/gmx-glp/pools_list_updater.go | 2 +- pkg/source/gmx-glp/vault_price_feed.go | 5 +++-- pkg/source/gmx/pool_simulator.go | 3 ++- pkg/source/gmx/pool_tracker.go | 2 +- pkg/source/gmx/pools_list_updater.go | 2 +- pkg/source/gmx/vault_price_feed.go | 5 +++-- pkg/source/ironstable/pool_tracker.go | 2 +- pkg/source/ironstable/pools_list_updater.go | 2 +- pkg/source/iziswap/pool_simulator.go | 2 +- pkg/source/iziswap/pool_tracker.go | 7 ++++--- pkg/source/iziswap/pools_list_updater.go | 5 +++-- pkg/source/kokonut-crypto/pool_simulator.go | 4 ++-- pkg/source/kokonut-crypto/pool_tracker.go | 12 +++++++----- pkg/source/kokonut-crypto/pools_list_updater.go | 14 ++++++++------ pkg/source/kyber-pmm/pool_simulator.go | 2 +- pkg/source/kyber-pmm/pool_tracker.go | 2 +- pkg/source/kyber-pmm/pools_list_updater.go | 2 +- pkg/source/kyber-pmm/rfq.go | 2 +- pkg/source/lido-steth/pools_list_updater.go | 2 +- pkg/source/lido/pool_simulator.go | 3 ++- pkg/source/lido/pool_tracker.go | 2 +- pkg/source/lido/pools_list_updater.go | 2 +- pkg/source/limitorder/pool_simulator.go | 2 +- pkg/source/limitorder/pool_simulator_test.go | 2 +- pkg/source/limitorder/pool_tracker.go | 2 +- pkg/source/limitorder/pools_list_updater.go | 2 +- pkg/source/limitorder/rfq.go | 2 +- pkg/source/liquiditybookv20/pool_simulator.go | 2 +- pkg/source/liquiditybookv20/pool_simulator_test.go | 2 +- pkg/source/liquiditybookv20/pool_tracker.go | 2 +- pkg/source/liquiditybookv20/pools_list_updater.go | 2 +- pkg/source/liquiditybookv21/pool_simulator.go | 2 +- pkg/source/liquiditybookv21/pool_simulator_test.go | 2 +- pkg/source/liquiditybookv21/pool_tracker.go | 2 +- pkg/source/liquiditybookv21/pools_list_updater.go | 2 +- pkg/source/madmex/pool_simulator.go | 3 ++- pkg/source/madmex/pool_tracker.go | 2 +- pkg/source/madmex/pools_list_updater.go | 2 +- pkg/source/madmex/vault_price_feed.go | 5 +++-- pkg/source/makerpsm/pool_simulator.go | 3 ++- pkg/source/makerpsm/pool_tracker.go | 6 +++--- pkg/source/makerpsm/pools_list_updater.go | 2 +- pkg/source/mantisswap/pool_simulator.go | 2 +- pkg/source/mantisswap/pool_simulator_test.go | 2 +- pkg/source/mantisswap/pool_tracker.go | 5 +++-- pkg/source/mantisswap/pools_list_updater.go | 14 ++++++++------ pkg/source/maverickv1/pool_list_updater.go | 2 +- pkg/source/maverickv1/pool_simulator.go | 2 +- pkg/source/maverickv1/pool_simulator_test.go | 2 +- pkg/source/maverickv1/pool_tracker.go | 7 ++++--- pkg/source/metavault/pool_simulator.go | 3 ++- pkg/source/metavault/pool_tracker.go | 2 +- pkg/source/metavault/pools_list_updater.go | 2 +- pkg/source/metavault/vault_price_feed.go | 5 +++-- pkg/source/muteswitch/pools_list_updater.go | 2 +- pkg/source/nerve/pool_tracker.go | 2 +- pkg/source/nerve/pools_list_updater.go | 2 +- pkg/source/nuriv2/pool_simulator.go | 2 +- pkg/source/nuriv2/pools_list_updater.go | 2 +- pkg/source/oneswap/pool_tracker.go | 2 +- pkg/source/oneswap/pools_list_updater.go | 2 +- pkg/source/pancakev3/pool_simulator.go | 2 +- pkg/source/pancakev3/pool_simulator_bigint.go | 2 +- pkg/source/pancakev3/pool_simulator_test.go | 2 +- pkg/source/pancakev3/pool_tracker.go | 2 +- pkg/source/pancakev3/pools_list_updater.go | 2 +- pkg/source/pearl/helper.go | 2 +- pkg/source/pearl/pools_list_updater.go | 2 +- pkg/source/platypus/pool_simulator.go | 3 ++- pkg/source/platypus/pool_tracker.go | 2 +- pkg/source/platypus/pools_list_updater.go | 2 +- pkg/source/pol-matic/pool_list_updater.go | 2 +- pkg/source/pol-matic/pool_simulator_test.go | 2 +- pkg/source/polydex/pools_list_updater.go | 2 +- pkg/source/quickperps/pool_simulator.go | 3 ++- pkg/source/quickperps/pool_simulator_test.go | 2 +- pkg/source/quickperps/pool_tracker.go | 2 +- pkg/source/quickperps/pools_list_updater.go | 2 +- pkg/source/quickperps/vault_price_feed.go | 5 +++-- pkg/source/ramses/pool_tracker.go | 5 ++--- pkg/source/ramses/pools_list_updater.go | 2 +- pkg/source/ramsesv2/pool_simulator.go | 2 +- pkg/source/ramsesv2/pools_list_updater.go | 2 +- pkg/source/saddle/pool_simulator.go | 3 ++- pkg/source/saddle/pool_tracker.go | 6 +++--- pkg/source/saddle/pools_list_updater.go | 2 +- pkg/source/slipstream/pool_simulator.go | 2 +- pkg/source/slipstream/pool_simulator_test.go | 2 +- pkg/source/slipstream/pools_list_updater.go | 2 +- pkg/source/smardex/pool_list_updater.go | 5 +++-- pkg/source/smardex/pool_list_updater_test.go | 2 +- pkg/source/smardex/pool_simulator.go | 2 +- pkg/source/smardex/pool_simulator_test.go | 2 +- pkg/source/smardex/pool_tracker.go | 7 ++++--- pkg/source/smardex/pool_tracker_test.go | 7 ++++--- pkg/source/solidly-v3/pool_simulator.go | 2 +- pkg/source/solidly-v3/pool_simulator_test.go | 2 +- pkg/source/solidly-v3/pools_list_updater.go | 2 +- pkg/source/swapbased-perp/pool_simulator.go | 3 ++- pkg/source/swapbased-perp/pool_tracker.go | 2 +- pkg/source/swapbased-perp/pools_list_updater.go | 2 +- pkg/source/swapbased-perp/vault_price_feed.go | 5 +++-- pkg/source/syncswap/pool_tracker.go | 2 +- pkg/source/syncswap/pools_list_updater.go | 8 ++++---- .../syncswap/syncswapclassic/pool_simulator.go | 2 +- .../syncswap/syncswapstable/pool_simulator.go | 2 +- pkg/source/synthetix/pool_simulator.go | 2 +- pkg/source/synthetix/pool_tracker.go | 2 +- pkg/source/traderjoecommon/pools_list_updater.go | 2 +- pkg/source/traderjoev20/pool_test.go | 4 ++-- pkg/source/traderjoev20/pool_tracker.go | 2 +- pkg/source/traderjoev21/pool_test.go | 4 ++-- pkg/source/traderjoev21/pool_tracker.go | 2 +- pkg/source/uniswap/pool_simulator_test.go | 2 +- pkg/source/uniswap/pools_list_updater.go | 2 +- pkg/source/uniswapv3/bench_test.go | 3 ++- pkg/source/uniswapv3/pool_simulator.go | 2 +- pkg/source/uniswapv3/pool_simulator_bigint.go | 2 +- pkg/source/uniswapv3/pool_simulator_bigint_test.go | 2 +- pkg/source/uniswapv3/pool_simulator_test.go | 2 +- pkg/source/uniswapv3/pools_list_updater.go | 2 +- pkg/source/usdfi/helper.go | 2 +- pkg/source/usdfi/pool_tracker.go | 2 +- pkg/source/usdfi/pools_list_updater.go | 2 +- pkg/source/velocimeter/helper.go | 2 +- pkg/source/velocimeter/pools_list_updater.go | 2 +- pkg/source/velodrome/helper.go | 2 +- pkg/source/velodrome/pools_list_updater.go | 2 +- pkg/source/velodromev2/helper.go | 2 +- pkg/source/velodromev2/pools_list_updater.go | 2 +- pkg/source/vooi/pool_list_updater.go | 2 +- pkg/source/vooi/pool_simulator.go | 4 ++-- pkg/source/vooi/pool_tracker.go | 2 +- pkg/source/wombat/pool_tracker.go | 4 ++-- pkg/source/wombat/pools_list_updater.go | 2 +- pkg/source/wombat/wombatlsd/pool_simulator.go | 5 +++-- pkg/source/wombat/wombatlsd/pool_simulator_test.go | 2 +- pkg/source/wombat/wombatmain/pool_simulator.go | 5 +++-- .../wombat/wombatmain/pool_simulator_test.go | 2 +- pkg/source/woofiv2/pool_simulator.go | 2 +- pkg/source/woofiv2/pool_simulator_test.go | 2 +- pkg/source/woofiv2/pool_tracker.go | 7 ++++--- pkg/source/zkera-finance/pool_simulator.go | 3 ++- pkg/source/zkera-finance/pool_tracker.go | 2 +- pkg/source/zkera-finance/pools_list_updater.go | 2 +- pkg/source/zkera-finance/vault_price_feed.go | 2 +- pkg/util/ticklens/ticklens.go | 8 +++----- 333 files changed, 639 insertions(+), 538 deletions(-) diff --git a/pkg/entity/bestpath.go b/pkg/entity/bestpath.go index 62750e761..b0d6ec242 100644 --- a/pkg/entity/bestpath.go +++ b/pkg/entity/bestpath.go @@ -1,6 +1,6 @@ package entity -import "encoding/json" +import "github.com/goccy/go-json" const BestPathKey = "bestpaths" diff --git a/pkg/entity/pool.go b/pkg/entity/pool.go index f9b293252..1b2dc5d86 100644 --- a/pkg/entity/pool.go +++ b/pkg/entity/pool.go @@ -1,10 +1,11 @@ package entity import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) diff --git a/pkg/liquidity-source/ambient/pool_list_updater.go b/pkg/liquidity-source/ambient/pool_list_updater.go index 508c1f1da..b484c6c0e 100644 --- a/pkg/liquidity-source/ambient/pool_list_updater.go +++ b/pkg/liquidity-source/ambient/pool_list_updater.go @@ -2,13 +2,13 @@ package ambient import ( "context" - "encoding/json" "fmt" "strings" "time" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/ambient/pool_list_updater_test.go b/pkg/liquidity-source/ambient/pool_list_updater_test.go index b7f2bc0df..ee413e9b9 100644 --- a/pkg/liquidity-source/ambient/pool_list_updater_test.go +++ b/pkg/liquidity-source/ambient/pool_list_updater_test.go @@ -2,7 +2,6 @@ package ambient_test import ( "context" - "encoding/json" "fmt" "math/big" "os" @@ -10,10 +9,12 @@ import ( "time" "github.com/KyberNetwork/blockchain-toolkit/time/durationjson" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/ambient" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/ambient" ) type mockPoolDataStore struct { diff --git a/pkg/liquidity-source/ambient/pool_tracker.go b/pkg/liquidity-source/ambient/pool_tracker.go index 0de38cf13..d3eb2d580 100644 --- a/pkg/liquidity-source/ambient/pool_tracker.go +++ b/pkg/liquidity-source/ambient/pool_tracker.go @@ -2,16 +2,17 @@ package ambient import ( "context" - "encoding/json" "fmt" "math/big" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/ambient/pool_tracker_test.go b/pkg/liquidity-source/ambient/pool_tracker_test.go index 0d4c2c7d5..38e7df8b4 100644 --- a/pkg/liquidity-source/ambient/pool_tracker_test.go +++ b/pkg/liquidity-source/ambient/pool_tracker_test.go @@ -2,13 +2,13 @@ package ambient_test import ( "context" - "encoding/json" "math/big" "os" "testing" "github.com/KyberNetwork/ethrpc" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/ambient/types_test.go b/pkg/liquidity-source/ambient/types_test.go index 51f294306..e8b0f0aa4 100644 --- a/pkg/liquidity-source/ambient/types_test.go +++ b/pkg/liquidity-source/ambient/types_test.go @@ -1,12 +1,13 @@ package ambient import ( - "encoding/json" "testing" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) func TestNTokenPool_CanSwapTo(t *testing.T) { diff --git a/pkg/liquidity-source/balancer-v2/shared/pools_list_updater.go b/pkg/liquidity-source/balancer-v2/shared/pools_list_updater.go index 4a754ff14..c75de9126 100644 --- a/pkg/liquidity-source/balancer-v2/shared/pools_list_updater.go +++ b/pkg/liquidity-source/balancer-v2/shared/pools_list_updater.go @@ -2,11 +2,11 @@ package shared import ( "context" - "encoding/json" "math/big" "net/http" "time" + "github.com/goccy/go-json" "github.com/machinebox/graphql" graphqlpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/graphql" diff --git a/pkg/liquidity-source/bancor-v21/common_rpc.go b/pkg/liquidity-source/bancor-v21/common_rpc.go index 908696376..ed72164b9 100644 --- a/pkg/liquidity-source/bancor-v21/common_rpc.go +++ b/pkg/liquidity-source/bancor-v21/common_rpc.go @@ -2,7 +2,6 @@ package bancorv21 import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/liquidity-source/bancor-v21/pool_simulator.go b/pkg/liquidity-source/bancor-v21/pool_simulator.go index 0bdc69731..7b88eac5c 100644 --- a/pkg/liquidity-source/bancor-v21/pool_simulator.go +++ b/pkg/liquidity-source/bancor-v21/pool_simulator.go @@ -1,13 +1,13 @@ package bancorv21 import ( - "encoding/json" "errors" "fmt" "math/big" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/bancor-v21/pool_simulator_test.go b/pkg/liquidity-source/bancor-v21/pool_simulator_test.go index ec0d3d8c2..3e3e2e367 100644 --- a/pkg/liquidity-source/bancor-v21/pool_simulator_test.go +++ b/pkg/liquidity-source/bancor-v21/pool_simulator_test.go @@ -2,12 +2,12 @@ package bancorv21 import ( "embed" - "encoding/json" "fmt" "math/big" "strings" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/bancor-v21/pool_tracker.go b/pkg/liquidity-source/bancor-v21/pool_tracker.go index d48ca236a..c4a9245d6 100644 --- a/pkg/liquidity-source/bancor-v21/pool_tracker.go +++ b/pkg/liquidity-source/bancor-v21/pool_tracker.go @@ -2,7 +2,6 @@ package bancorv21 import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/liquidity-source/bancor-v21/pools_list_updater.go b/pkg/liquidity-source/bancor-v21/pools_list_updater.go index ec2bce7d6..d5b978b36 100644 --- a/pkg/liquidity-source/bancor-v21/pools_list_updater.go +++ b/pkg/liquidity-source/bancor-v21/pools_list_updater.go @@ -2,10 +2,10 @@ package bancorv21 import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/liquidity-source/bancor-v3/pool_simulator.go b/pkg/liquidity-source/bancor-v3/pool_simulator.go index fa0fc24f1..e96d4e11d 100644 --- a/pkg/liquidity-source/bancor-v3/pool_simulator.go +++ b/pkg/liquidity-source/bancor-v3/pool_simulator.go @@ -1,11 +1,11 @@ package bancorv3 import ( - "encoding/json" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/number" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/pkg/errors" diff --git a/pkg/liquidity-source/bebop/client/http.go b/pkg/liquidity-source/bebop/client/http.go index cca4a5280..3390ad0eb 100644 --- a/pkg/liquidity-source/bebop/client/http.go +++ b/pkg/liquidity-source/bebop/client/http.go @@ -2,13 +2,14 @@ package client import ( "context" - "encoding/json" "errors" - bebop "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/bebop" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/go-resty/resty/v2" + "github.com/goccy/go-json" + + bebop "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/bebop" ) const ( diff --git a/pkg/liquidity-source/bebop/pool_simulator.go b/pkg/liquidity-source/bebop/pool_simulator.go index 94285b7ee..8af9157a2 100644 --- a/pkg/liquidity-source/bebop/pool_simulator.go +++ b/pkg/liquidity-source/bebop/pool_simulator.go @@ -1,12 +1,12 @@ package bebop import ( - "encoding/json" "errors" "math" "math/big" "strings" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/clipper/pool_simulator.go b/pkg/liquidity-source/clipper/pool_simulator.go index 7e86363af..72cef7199 100644 --- a/pkg/liquidity-source/clipper/pool_simulator.go +++ b/pkg/liquidity-source/clipper/pool_simulator.go @@ -1,16 +1,17 @@ package clipper import ( - "encoding/json" "errors" "math" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/samber/lo" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/samber/lo" ) var ( diff --git a/pkg/liquidity-source/clipper/pool_simulator_test.go b/pkg/liquidity-source/clipper/pool_simulator_test.go index 8aee8e862..f5fefa5ce 100644 --- a/pkg/liquidity-source/clipper/pool_simulator_test.go +++ b/pkg/liquidity-source/clipper/pool_simulator_test.go @@ -1,13 +1,14 @@ package clipper import ( - "encoding/json" "math/big" "testing" + "github.com/goccy/go-json" + "github.com/stretchr/testify/assert" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/stretchr/testify/assert" ) var poolEntityStr = "{\"address\":\"0x655edce464cc797526600a462a8154650eee4b77\",\"reserveUsd\":3099576.562241563,\"amplifiedTvl\":3099576.562241563,\"exchange\":\"clipper\",\"type\":\"clipper\",\"timestamp\":1729014768,\"reserves\":[\"491115278550168767440992\",\"597835189535037939399\",\"650931997785\",\"410635515666\"],\"tokens\":[{\"address\":\"0x6b175474e89094c44da98b954eedeac495271d0f\",\"name\":\"Dai Stablecoin\",\"symbol\":\"DAI\",\"decimals\":18},{\"address\":\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"name\":\"Wrapped Ether\",\"symbol\":\"WETH\",\"decimals\":18},{\"address\":\"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"name\":\"USD Coin\",\"symbol\":\"USDC\",\"decimals\":6},{\"address\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"name\":\"Tether USD\",\"symbol\":\"USDT\",\"decimals\":6}],\"extra\":\"{\\\"SwapsEnabled\\\":true,\\\"K\\\":0.02,\\\"TimeInSeconds\\\":60,\\\"Assets\\\":[{\\\"Address\\\":\\\"0x6b175474e89094c44da98b954eedeac495271d0f\\\",\\\"Symbol\\\":\\\"DAI\\\",\\\"Decimals\\\":18,\\\"PriceInUSD\\\":1,\\\"Quantity\\\":491115278550168767440992,\\\"ListingWeight\\\":250},{\\\"Address\\\":\\\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\\\",\\\"Symbol\\\":\\\"ETH\\\",\\\"Decimals\\\":18,\\\"PriceInUSD\\\":2587.488,\\\"Quantity\\\":597835189535037939399,\\\"ListingWeight\\\":79},{\\\"Address\\\":\\\"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\\\",\\\"Symbol\\\":\\\"USDC\\\",\\\"Decimals\\\":6,\\\"PriceInUSD\\\":1,\\\"Quantity\\\":650931997785,\\\"ListingWeight\\\":188},{\\\"Address\\\":\\\"0xdac17f958d2ee523a2206206994597c13d831ec7\\\",\\\"Symbol\\\":\\\"USDT\\\",\\\"Decimals\\\":6,\\\"PriceInUSD\\\":1,\\\"Quantity\\\":410635515666,\\\"ListingWeight\\\":305}],\\\"Pairs\\\":[{\\\"Assets\\\":[\\\"ETH\\\",\\\"USDC\\\"],\\\"FeeInBasisPoints\\\":4},{\\\"Assets\\\":[\\\"ETH\\\",\\\"USDT\\\"],\\\"FeeInBasisPoints\\\":4},{\\\"Assets\\\":[\\\"ETH\\\",\\\"DAI\\\"],\\\"FeeInBasisPoints\\\":4},{\\\"Assets\\\":[\\\"USDC\\\",\\\"USDT\\\"],\\\"FeeInBasisPoints\\\":1},{\\\"Assets\\\":[\\\"USDC\\\",\\\"DAI\\\"],\\\"FeeInBasisPoints\\\":1},{\\\"Assets\\\":[\\\"USDT\\\",\\\"DAI\\\"],\\\"FeeInBasisPoints\\\":0}]}\"}" diff --git a/pkg/liquidity-source/curve/plain/pool_simulator.go b/pkg/liquidity-source/curve/plain/pool_simulator.go index fac423d44..9af61ec8d 100644 --- a/pkg/liquidity-source/curve/plain/pool_simulator.go +++ b/pkg/liquidity-source/curve/plain/pool_simulator.go @@ -1,12 +1,12 @@ package plain import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/number" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/curve/plain/pool_simulator_compare_test.go b/pkg/liquidity-source/curve/plain/pool_simulator_compare_test.go index 3bd36f28d..6b586f7e4 100644 --- a/pkg/liquidity-source/curve/plain/pool_simulator_compare_test.go +++ b/pkg/liquidity-source/curve/plain/pool_simulator_compare_test.go @@ -1,10 +1,10 @@ package plain import ( - "encoding/json" "fmt" "testing" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/liquidity-source/curve/plain/pool_simulator_test.go b/pkg/liquidity-source/curve/plain/pool_simulator_test.go index 7b983baa7..a3c4d1f51 100644 --- a/pkg/liquidity-source/curve/plain/pool_simulator_test.go +++ b/pkg/liquidity-source/curve/plain/pool_simulator_test.go @@ -1,12 +1,12 @@ package plain import ( - "encoding/json" "fmt" "math/big" "testing" "time" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/liquidity-source/curve/plain/pool_tracker.go b/pkg/liquidity-source/curve/plain/pool_tracker.go index de0201717..cd60855ce 100644 --- a/pkg/liquidity-source/curve/plain/pool_tracker.go +++ b/pkg/liquidity-source/curve/plain/pool_tracker.go @@ -2,20 +2,21 @@ package plain import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" - poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" + poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/curve/plain/pools_list_updater.go b/pkg/liquidity-source/curve/plain/pools_list_updater.go index 8da9b815e..b4a703d9a 100644 --- a/pkg/liquidity-source/curve/plain/pools_list_updater.go +++ b/pkg/liquidity-source/curve/plain/pools_list_updater.go @@ -2,20 +2,21 @@ package plain import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" ) type PoolsListUpdater struct { diff --git a/pkg/liquidity-source/curve/shared/pools_list_updater.go b/pkg/liquidity-source/curve/shared/pools_list_updater.go index 59f2aac60..96fe850e1 100644 --- a/pkg/liquidity-source/curve/shared/pools_list_updater.go +++ b/pkg/liquidity-source/curve/shared/pools_list_updater.go @@ -2,18 +2,19 @@ package shared import ( "context" - "encoding/json" "fmt" "strings" "time" "github.com/KyberNetwork/blockchain-toolkit/time/durationjson" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" "github.com/go-resty/resty/v2" + "github.com/goccy/go-json" "github.com/pkg/errors" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" ) type ( diff --git a/pkg/liquidity-source/curve/shared/type.go b/pkg/liquidity-source/curve/shared/type.go index 55fbf8137..4f328a914 100644 --- a/pkg/liquidity-source/curve/shared/type.go +++ b/pkg/liquidity-source/curve/shared/type.go @@ -1,11 +1,11 @@ package shared import ( - "encoding/json" "strconv" "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" ) type ( diff --git a/pkg/liquidity-source/curve/stable-meta-ng/benchmark_test.go b/pkg/liquidity-source/curve/stable-meta-ng/benchmark_test.go index e425fd22c..7aacf3a70 100644 --- a/pkg/liquidity-source/curve/stable-meta-ng/benchmark_test.go +++ b/pkg/liquidity-source/curve/stable-meta-ng/benchmark_test.go @@ -1,15 +1,16 @@ package stablemetang import ( - "encoding/json" "testing" + "github.com/goccy/go-json" + "github.com/stretchr/testify/require" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/plain" stableng "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/stable-ng" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/stretchr/testify/require" ) var ( diff --git a/pkg/liquidity-source/curve/stable-meta-ng/pool_simulator_test.go b/pkg/liquidity-source/curve/stable-meta-ng/pool_simulator_test.go index de815423d..3d42209e5 100644 --- a/pkg/liquidity-source/curve/stable-meta-ng/pool_simulator_test.go +++ b/pkg/liquidity-source/curve/stable-meta-ng/pool_simulator_test.go @@ -1,10 +1,10 @@ package stablemetang import ( - "encoding/json" "fmt" "testing" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/liquidity-source/curve/stable-meta-ng/pool_tracker.go b/pkg/liquidity-source/curve/stable-meta-ng/pool_tracker.go index a3153b049..8aac12815 100644 --- a/pkg/liquidity-source/curve/stable-meta-ng/pool_tracker.go +++ b/pkg/liquidity-source/curve/stable-meta-ng/pool_tracker.go @@ -2,19 +2,20 @@ package stablemetang import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" - poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" + poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/curve/stable-meta-ng/pools_list_updater.go b/pkg/liquidity-source/curve/stable-meta-ng/pools_list_updater.go index 40a99113a..576324c46 100644 --- a/pkg/liquidity-source/curve/stable-meta-ng/pools_list_updater.go +++ b/pkg/liquidity-source/curve/stable-meta-ng/pools_list_updater.go @@ -2,19 +2,20 @@ package stablemetang import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/samber/lo" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" ) type PoolsListUpdater struct { diff --git a/pkg/liquidity-source/curve/stable-ng/pool_simulator.go b/pkg/liquidity-source/curve/stable-ng/pool_simulator.go index dbf15ac02..0440857cc 100644 --- a/pkg/liquidity-source/curve/stable-ng/pool_simulator.go +++ b/pkg/liquidity-source/curve/stable-ng/pool_simulator.go @@ -1,12 +1,12 @@ package stableng import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/number" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/curve/stable-ng/pool_simulator_test.go b/pkg/liquidity-source/curve/stable-ng/pool_simulator_test.go index 57aa300f1..abe651e23 100644 --- a/pkg/liquidity-source/curve/stable-ng/pool_simulator_test.go +++ b/pkg/liquidity-source/curve/stable-ng/pool_simulator_test.go @@ -1,11 +1,11 @@ package stableng import ( - "encoding/json" "fmt" "math/big" "testing" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/liquidity-source/curve/stable-ng/pool_tracker.go b/pkg/liquidity-source/curve/stable-ng/pool_tracker.go index ecc4a771a..812b7e8ca 100644 --- a/pkg/liquidity-source/curve/stable-ng/pool_tracker.go +++ b/pkg/liquidity-source/curve/stable-ng/pool_tracker.go @@ -2,19 +2,20 @@ package stableng import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" - poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" + poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/curve/stable-ng/pools_list_updater.go b/pkg/liquidity-source/curve/stable-ng/pools_list_updater.go index c22659d9e..b3953c4c2 100644 --- a/pkg/liquidity-source/curve/stable-ng/pools_list_updater.go +++ b/pkg/liquidity-source/curve/stable-ng/pools_list_updater.go @@ -2,18 +2,19 @@ package stableng import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" ) type PoolsListUpdater struct { diff --git a/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator.go b/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator.go index f572ef1dd..555853903 100644 --- a/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator.go +++ b/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator.go @@ -1,13 +1,13 @@ package tricryptong import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator_test.go b/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator_test.go index 8e01ea2bc..f61845dd9 100644 --- a/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator_test.go +++ b/pkg/liquidity-source/curve/tricrypto-ng/pool_simulator_test.go @@ -1,11 +1,11 @@ package tricryptong import ( - "encoding/json" "fmt" "math/big" "testing" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/liquidity-source/curve/tricrypto-ng/pool_tracker.go b/pkg/liquidity-source/curve/tricrypto-ng/pool_tracker.go index a13481def..a234d7118 100644 --- a/pkg/liquidity-source/curve/tricrypto-ng/pool_tracker.go +++ b/pkg/liquidity-source/curve/tricrypto-ng/pool_tracker.go @@ -2,20 +2,21 @@ package tricryptong import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" - poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/samber/lo" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" + poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/curve/tricrypto-ng/pools_list_updater.go b/pkg/liquidity-source/curve/tricrypto-ng/pools_list_updater.go index 4da1d7f5a..16404cd8d 100644 --- a/pkg/liquidity-source/curve/tricrypto-ng/pools_list_updater.go +++ b/pkg/liquidity-source/curve/tricrypto-ng/pools_list_updater.go @@ -2,15 +2,16 @@ package tricryptong import ( "context" - "encoding/json" "strings" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" ) type PoolsListUpdater struct { diff --git a/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator.go b/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator.go index 583dcd20a..7ad4e3b40 100644 --- a/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator.go +++ b/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator.go @@ -1,13 +1,13 @@ package twocryptong import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator_test.go b/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator_test.go index 60a455365..a669a5a7c 100644 --- a/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator_test.go +++ b/pkg/liquidity-source/curve/twocrypto-ng/pool_simulator_test.go @@ -1,11 +1,11 @@ package twocryptong import ( - "encoding/json" "fmt" "math/big" "testing" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/liquidity-source/curve/twocrypto-ng/pool_tracker.go b/pkg/liquidity-source/curve/twocrypto-ng/pool_tracker.go index e55e3561c..f6eec59d7 100644 --- a/pkg/liquidity-source/curve/twocrypto-ng/pool_tracker.go +++ b/pkg/liquidity-source/curve/twocrypto-ng/pool_tracker.go @@ -2,21 +2,21 @@ package twocryptong import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/curve/twocrypto-ng/pools_list_updater.go b/pkg/liquidity-source/curve/twocrypto-ng/pools_list_updater.go index 0f1696685..bd73da81d 100644 --- a/pkg/liquidity-source/curve/twocrypto-ng/pools_list_updater.go +++ b/pkg/liquidity-source/curve/twocrypto-ng/pools_list_updater.go @@ -2,13 +2,13 @@ package twocryptong import ( "context" - "encoding/json" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/curve/shared" diff --git a/pkg/liquidity-source/dai-usds/pools_list_updater.go b/pkg/liquidity-source/dai-usds/pools_list_updater.go index 9f1f1d9a3..b7cc7a40d 100644 --- a/pkg/liquidity-source/dai-usds/pools_list_updater.go +++ b/pkg/liquidity-source/dai-usds/pools_list_updater.go @@ -2,13 +2,13 @@ package dai_usds import ( "context" - "encoding/json" "errors" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/liquidity-source/deltaswap-v1/pool_tracker_test.go b/pkg/liquidity-source/deltaswap-v1/pool_tracker_test.go index a06e89115..e3a929136 100644 --- a/pkg/liquidity-source/deltaswap-v1/pool_tracker_test.go +++ b/pkg/liquidity-source/deltaswap-v1/pool_tracker_test.go @@ -2,15 +2,16 @@ package deltaswapv1 import ( "context" - "encoding/json" "testing" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolListTrackerTestSuite struct { diff --git a/pkg/liquidity-source/dexalot/client/http.go b/pkg/liquidity-source/dexalot/client/http.go index fbda09420..be9c6def0 100644 --- a/pkg/liquidity-source/dexalot/client/http.go +++ b/pkg/liquidity-source/dexalot/client/http.go @@ -2,15 +2,16 @@ package client import ( "context" - "encoding/json" "errors" "math/big" - dexalot "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/dexalot" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/go-resty/resty/v2" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/dexalot" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) const ( diff --git a/pkg/liquidity-source/dexalot/pool_simulator.go b/pkg/liquidity-source/dexalot/pool_simulator.go index 14da9269f..549d5364b 100644 --- a/pkg/liquidity-source/dexalot/pool_simulator.go +++ b/pkg/liquidity-source/dexalot/pool_simulator.go @@ -1,17 +1,18 @@ package dexalot import ( - "encoding/json" "errors" "math" "math/big" "strings" + "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" + "github.com/samber/lo" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/KyberNetwork/logger" - "github.com/samber/lo" ) var ( diff --git a/pkg/liquidity-source/dodo/classical/pool_simulator.go b/pkg/liquidity-source/dodo/classical/pool_simulator.go index bf80d2157..e4e636405 100644 --- a/pkg/liquidity-source/dodo/classical/pool_simulator.go +++ b/pkg/liquidity-source/dodo/classical/pool_simulator.go @@ -1,12 +1,12 @@ package classical import ( - "encoding/json" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/blockchain-toolkit/number" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/dodo/classical/pools_list_updater.go b/pkg/liquidity-source/dodo/classical/pools_list_updater.go index 33795b5fa..ef9883e87 100644 --- a/pkg/liquidity-source/dodo/classical/pools_list_updater.go +++ b/pkg/liquidity-source/dodo/classical/pools_list_updater.go @@ -2,10 +2,10 @@ package classical import ( "context" - "encoding/json" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/dodo/shared" diff --git a/pkg/liquidity-source/dodo/dpp/pools_list_updater.go b/pkg/liquidity-source/dodo/dpp/pools_list_updater.go index 3f0bf484c..4606d3d4d 100644 --- a/pkg/liquidity-source/dodo/dpp/pools_list_updater.go +++ b/pkg/liquidity-source/dodo/dpp/pools_list_updater.go @@ -2,10 +2,10 @@ package dpp import ( "context" - "encoding/json" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/dodo/shared" diff --git a/pkg/liquidity-source/dodo/dsp/pools_list_updater.go b/pkg/liquidity-source/dodo/dsp/pools_list_updater.go index 076062643..d65df3d96 100644 --- a/pkg/liquidity-source/dodo/dsp/pools_list_updater.go +++ b/pkg/liquidity-source/dodo/dsp/pools_list_updater.go @@ -2,10 +2,10 @@ package dsp import ( "context" - "encoding/json" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/dodo/shared" diff --git a/pkg/liquidity-source/dodo/dvm/pools_list_updater.go b/pkg/liquidity-source/dodo/dvm/pools_list_updater.go index 202c60086..823d335d7 100644 --- a/pkg/liquidity-source/dodo/dvm/pools_list_updater.go +++ b/pkg/liquidity-source/dodo/dvm/pools_list_updater.go @@ -2,10 +2,10 @@ package dvm import ( "context" - "encoding/json" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/dodo/shared" diff --git a/pkg/liquidity-source/dodo/shared/pool_tracker.go b/pkg/liquidity-source/dodo/shared/pool_tracker.go index bf92af388..544de87bb 100644 --- a/pkg/liquidity-source/dodo/shared/pool_tracker.go +++ b/pkg/liquidity-source/dodo/shared/pool_tracker.go @@ -2,7 +2,6 @@ package shared import ( "context" - "encoding/json" "fmt" "math/big" "time" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" cmap "github.com/orcaman/concurrent-map" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/dodo/shared/pools_list_updater.go b/pkg/liquidity-source/dodo/shared/pools_list_updater.go index 21e69c161..a3cbce405 100644 --- a/pkg/liquidity-source/dodo/shared/pools_list_updater.go +++ b/pkg/liquidity-source/dodo/shared/pools_list_updater.go @@ -2,12 +2,12 @@ package shared import ( "context" - "encoding/json" "fmt" "math/big" "strconv" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/etherfi/eeth/pool_list_updater.go b/pkg/liquidity-source/etherfi/eeth/pool_list_updater.go index d63c799e0..e7d76ae8b 100644 --- a/pkg/liquidity-source/etherfi/eeth/pool_list_updater.go +++ b/pkg/liquidity-source/etherfi/eeth/pool_list_updater.go @@ -2,12 +2,12 @@ package eeth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/etherfi/common" diff --git a/pkg/liquidity-source/etherfi/eeth/pool_tracker.go b/pkg/liquidity-source/etherfi/eeth/pool_tracker.go index 725034f28..b8d27174e 100644 --- a/pkg/liquidity-source/etherfi/eeth/pool_tracker.go +++ b/pkg/liquidity-source/etherfi/eeth/pool_tracker.go @@ -2,17 +2,17 @@ package eeth import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/etherfi/common" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/etherfi/weeth/pool_list_updater.go b/pkg/liquidity-source/etherfi/weeth/pool_list_updater.go index 19fdac3e8..22813c7ee 100644 --- a/pkg/liquidity-source/etherfi/weeth/pool_list_updater.go +++ b/pkg/liquidity-source/etherfi/weeth/pool_list_updater.go @@ -2,12 +2,12 @@ package weeth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/etherfi/common" diff --git a/pkg/liquidity-source/etherfi/weeth/pool_tracker.go b/pkg/liquidity-source/etherfi/weeth/pool_tracker.go index b6ef01c0f..94b08ec24 100644 --- a/pkg/liquidity-source/etherfi/weeth/pool_tracker.go +++ b/pkg/liquidity-source/etherfi/weeth/pool_tracker.go @@ -2,17 +2,17 @@ package weeth import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/etherfi/common" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/fluid/dex-t1/pool_list_updater.go b/pkg/liquidity-source/fluid/dex-t1/pool_list_updater.go index a792e497c..e13ac35dd 100644 --- a/pkg/liquidity-source/fluid/dex-t1/pool_list_updater.go +++ b/pkg/liquidity-source/fluid/dex-t1/pool_list_updater.go @@ -2,13 +2,13 @@ package dexT1 import ( "context" - "encoding/json" "math/big" "strings" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" diff --git a/pkg/liquidity-source/fluid/dex-t1/pool_list_updater_test.go b/pkg/liquidity-source/fluid/dex-t1/pool_list_updater_test.go index 25f052e2f..708221552 100644 --- a/pkg/liquidity-source/fluid/dex-t1/pool_list_updater_test.go +++ b/pkg/liquidity-source/fluid/dex-t1/pool_list_updater_test.go @@ -2,17 +2,18 @@ package dexT1 import ( "context" - "encoding/json" "math/big" "os" "strings" "testing" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) func TestPoolListUpdater(t *testing.T) { diff --git a/pkg/liquidity-source/fluid/dex-t1/pool_simulator.go b/pkg/liquidity-source/fluid/dex-t1/pool_simulator.go index aae71448e..bbf91b55c 100644 --- a/pkg/liquidity-source/fluid/dex-t1/pool_simulator.go +++ b/pkg/liquidity-source/fluid/dex-t1/pool_simulator.go @@ -1,10 +1,10 @@ package dexT1 import ( - "encoding/json" "errors" "math/big" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/fluid/dex-t1/pool_tracker.go b/pkg/liquidity-source/fluid/dex-t1/pool_tracker.go index 2e86d8551..7d3450373 100644 --- a/pkg/liquidity-source/fluid/dex-t1/pool_tracker.go +++ b/pkg/liquidity-source/fluid/dex-t1/pool_tracker.go @@ -2,7 +2,6 @@ package dexT1 import ( "context" - "encoding/json" "math/big" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/liquidity-source/fluid/dex-t1/pool_tracker_test.go b/pkg/liquidity-source/fluid/dex-t1/pool_tracker_test.go index 7f34aa8e8..9d29e1b1b 100644 --- a/pkg/liquidity-source/fluid/dex-t1/pool_tracker_test.go +++ b/pkg/liquidity-source/fluid/dex-t1/pool_tracker_test.go @@ -2,7 +2,6 @@ package dexT1 import ( "context" - "encoding/json" "math/big" "os" "testing" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/fluid/vault-t1/pool_list_updater.go b/pkg/liquidity-source/fluid/vault-t1/pool_list_updater.go index 558852e54..da045f41d 100644 --- a/pkg/liquidity-source/fluid/vault-t1/pool_list_updater.go +++ b/pkg/liquidity-source/fluid/vault-t1/pool_list_updater.go @@ -2,11 +2,11 @@ package vaultT1 import ( "context" - "encoding/json" "strings" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" diff --git a/pkg/liquidity-source/fluid/vault-t1/pool_list_updater_test.go b/pkg/liquidity-source/fluid/vault-t1/pool_list_updater_test.go index 7be40c83a..a449d0977 100644 --- a/pkg/liquidity-source/fluid/vault-t1/pool_list_updater_test.go +++ b/pkg/liquidity-source/fluid/vault-t1/pool_list_updater_test.go @@ -2,15 +2,16 @@ package vaultT1 import ( "context" - "encoding/json" "os" "testing" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) func TestPoolListUpdater(t *testing.T) { diff --git a/pkg/liquidity-source/fluid/vault-t1/pool_simulator.go b/pkg/liquidity-source/fluid/vault-t1/pool_simulator.go index caa15c75f..e83bdedab 100644 --- a/pkg/liquidity-source/fluid/vault-t1/pool_simulator.go +++ b/pkg/liquidity-source/fluid/vault-t1/pool_simulator.go @@ -1,11 +1,11 @@ package vaultT1 import ( - "encoding/json" "errors" "math/big" "strings" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/fluid/vault-t1/pool_tracker.go b/pkg/liquidity-source/fluid/vault-t1/pool_tracker.go index 8543be686..78df46da6 100644 --- a/pkg/liquidity-source/fluid/vault-t1/pool_tracker.go +++ b/pkg/liquidity-source/fluid/vault-t1/pool_tracker.go @@ -2,16 +2,16 @@ package vaultT1 import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/fluid/vault-t1/pool_tracker_test.go b/pkg/liquidity-source/fluid/vault-t1/pool_tracker_test.go index 335508a97..4191d459b 100644 --- a/pkg/liquidity-source/fluid/vault-t1/pool_tracker_test.go +++ b/pkg/liquidity-source/fluid/vault-t1/pool_tracker_test.go @@ -2,17 +2,18 @@ package vaultT1 import ( "context" - "encoding/json" "math/big" "testing" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" ) func TestPoolTracker(t *testing.T) { diff --git a/pkg/liquidity-source/generic-simple-rate/pool_list_updater.go b/pkg/liquidity-source/generic-simple-rate/pool_list_updater.go index 3426f623c..cb87b7c96 100644 --- a/pkg/liquidity-source/generic-simple-rate/pool_list_updater.go +++ b/pkg/liquidity-source/generic-simple-rate/pool_list_updater.go @@ -2,7 +2,6 @@ package generic_simple_rate import ( "context" - "encoding/json" "errors" "math/big" "strings" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/generic-simple-rate/pool_list_updater_test.go b/pkg/liquidity-source/generic-simple-rate/pool_list_updater_test.go index cb4abfe7d..f171dbab7 100644 --- a/pkg/liquidity-source/generic-simple-rate/pool_list_updater_test.go +++ b/pkg/liquidity-source/generic-simple-rate/pool_list_updater_test.go @@ -1,16 +1,17 @@ package generic_simple_rate import ( - "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/assert" "math/big" "testing" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" + "github.com/stretchr/testify/assert" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) func Test_getNewPool(t *testing.T) { diff --git a/pkg/liquidity-source/generic-simple-rate/pool_simulator.go b/pkg/liquidity-source/generic-simple-rate/pool_simulator.go index f2616c3dc..147ca86fa 100644 --- a/pkg/liquidity-source/generic-simple-rate/pool_simulator.go +++ b/pkg/liquidity-source/generic-simple-rate/pool_simulator.go @@ -1,16 +1,17 @@ package generic_simple_rate import ( - "encoding/json" "errors" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/holiman/uint256" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/holiman/uint256" ) type PoolSimulator struct { diff --git a/pkg/liquidity-source/generic-simple-rate/pool_tracker.go b/pkg/liquidity-source/generic-simple-rate/pool_tracker.go index a14d7745d..fd4515c55 100644 --- a/pkg/liquidity-source/generic-simple-rate/pool_tracker.go +++ b/pkg/liquidity-source/generic-simple-rate/pool_tracker.go @@ -2,17 +2,18 @@ package generic_simple_rate import ( "context" - "encoding/json" + "math/big" + "time" + "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" - "math/big" - "time" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/gyroscope/2clp/pool_simulator.go b/pkg/liquidity-source/gyroscope/2clp/pool_simulator.go index 64beea58f..1b9c28adf 100644 --- a/pkg/liquidity-source/gyroscope/2clp/pool_simulator.go +++ b/pkg/liquidity-source/gyroscope/2clp/pool_simulator.go @@ -1,10 +1,10 @@ package gyro2clp import ( - "encoding/json" "errors" "math/big" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/gyroscope/2clp/pool_simulator_test.go b/pkg/liquidity-source/gyroscope/2clp/pool_simulator_test.go index 72a1906bc..4d39154f8 100644 --- a/pkg/liquidity-source/gyroscope/2clp/pool_simulator_test.go +++ b/pkg/liquidity-source/gyroscope/2clp/pool_simulator_test.go @@ -1,10 +1,10 @@ package gyro2clp import ( - "encoding/json" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/gyroscope/2clp/pool_tracker.go b/pkg/liquidity-source/gyroscope/2clp/pool_tracker.go index 048a6bc57..818f50c0c 100644 --- a/pkg/liquidity-source/gyroscope/2clp/pool_tracker.go +++ b/pkg/liquidity-source/gyroscope/2clp/pool_tracker.go @@ -2,7 +2,6 @@ package gyro2clp import ( "context" - "encoding/json" "errors" "math/big" "strings" @@ -11,12 +10,13 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/gyroscope/shared" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) var ErrReserveNotFound = errors.New("reserve not found") diff --git a/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go b/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go index 584c58cef..2e1bd2059 100644 --- a/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go +++ b/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go @@ -2,7 +2,6 @@ package gyro2clp import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/gyroscope/3clp/pool_simulator.go b/pkg/liquidity-source/gyroscope/3clp/pool_simulator.go index 17bf6085d..a434a4107 100644 --- a/pkg/liquidity-source/gyroscope/3clp/pool_simulator.go +++ b/pkg/liquidity-source/gyroscope/3clp/pool_simulator.go @@ -1,10 +1,10 @@ package gyro3clp import ( - "encoding/json" "errors" "math/big" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/gyroscope/3clp/pool_simulator_test.go b/pkg/liquidity-source/gyroscope/3clp/pool_simulator_test.go index a248bef3b..518f723ab 100644 --- a/pkg/liquidity-source/gyroscope/3clp/pool_simulator_test.go +++ b/pkg/liquidity-source/gyroscope/3clp/pool_simulator_test.go @@ -1,9 +1,9 @@ package gyro3clp import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/gyroscope/3clp/pool_tracker.go b/pkg/liquidity-source/gyroscope/3clp/pool_tracker.go index 34b96f48c..41bdd0253 100644 --- a/pkg/liquidity-source/gyroscope/3clp/pool_tracker.go +++ b/pkg/liquidity-source/gyroscope/3clp/pool_tracker.go @@ -2,7 +2,6 @@ package gyro3clp import ( "context" - "encoding/json" "errors" "math/big" "strings" @@ -11,12 +10,13 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/gyroscope/shared" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) var ErrReserveNotFound = errors.New("reserve not found") diff --git a/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go b/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go index a828cc92e..5eb1a6d30 100644 --- a/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go +++ b/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go @@ -2,7 +2,6 @@ package gyro3clp import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go b/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go index e5e48d3ec..825cc335f 100644 --- a/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go +++ b/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go @@ -2,13 +2,13 @@ package gyroeclp import ( "context" - "encoding/json" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/gyroscope/shared" diff --git a/pkg/liquidity-source/gyroscope/shared/pools_list_updater.go b/pkg/liquidity-source/gyroscope/shared/pools_list_updater.go index 4a754ff14..c75de9126 100644 --- a/pkg/liquidity-source/gyroscope/shared/pools_list_updater.go +++ b/pkg/liquidity-source/gyroscope/shared/pools_list_updater.go @@ -2,11 +2,11 @@ package shared import ( "context" - "encoding/json" "math/big" "net/http" "time" + "github.com/goccy/go-json" "github.com/machinebox/graphql" graphqlpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/graphql" diff --git a/pkg/liquidity-source/hashflow-v3/pool_simulator.go b/pkg/liquidity-source/hashflow-v3/pool_simulator.go index 2f9049359..8d8446751 100644 --- a/pkg/liquidity-source/hashflow-v3/pool_simulator.go +++ b/pkg/liquidity-source/hashflow-v3/pool_simulator.go @@ -1,12 +1,12 @@ package hashflowv3 import ( - "encoding/json" "errors" "math" "math/big" "strings" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/integral/pool_tracker_test.go b/pkg/liquidity-source/integral/pool_tracker_test.go index 54c2c262a..23135a729 100644 --- a/pkg/liquidity-source/integral/pool_tracker_test.go +++ b/pkg/liquidity-source/integral/pool_tracker_test.go @@ -2,16 +2,17 @@ package integral import ( "context" - "encoding/json" "testing" "github.com/KyberNetwork/blockchain-toolkit/number" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolListTrackerTestSuite struct { diff --git a/pkg/liquidity-source/kelp/rseth/pool_list_updater.go b/pkg/liquidity-source/kelp/rseth/pool_list_updater.go index 0e55c4972..62dac4511 100644 --- a/pkg/liquidity-source/kelp/rseth/pool_list_updater.go +++ b/pkg/liquidity-source/kelp/rseth/pool_list_updater.go @@ -2,19 +2,19 @@ package rseth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/kelp/common" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolListUpdater struct { diff --git a/pkg/liquidity-source/kelp/rseth/pool_simulator.go b/pkg/liquidity-source/kelp/rseth/pool_simulator.go index 677a6f9bb..c58a60cd4 100644 --- a/pkg/liquidity-source/kelp/rseth/pool_simulator.go +++ b/pkg/liquidity-source/kelp/rseth/pool_simulator.go @@ -1,10 +1,10 @@ package rseth import ( - "encoding/json" "errors" "math/big" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/kelp/rseth/pool_tracker.go b/pkg/liquidity-source/kelp/rseth/pool_tracker.go index a4d7e3572..132cbe50e 100644 --- a/pkg/liquidity-source/kelp/rseth/pool_tracker.go +++ b/pkg/liquidity-source/kelp/rseth/pool_tracker.go @@ -2,16 +2,17 @@ package rseth import ( "context" - "encoding/json" "strings" "time" "github.com/KyberNetwork/ethrpc" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/kelp/common" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/maker/savingsdai/pool_simulator.go b/pkg/liquidity-source/maker/savingsdai/pool_simulator.go index c141bfded..5f2feaf7a 100644 --- a/pkg/liquidity-source/maker/savingsdai/pool_simulator.go +++ b/pkg/liquidity-source/maker/savingsdai/pool_simulator.go @@ -1,9 +1,9 @@ package savingsdai import ( - "encoding/json" "math/big" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/pkg/errors" "github.com/samber/lo" diff --git a/pkg/liquidity-source/mantle/meth/pool_list_updater.go b/pkg/liquidity-source/mantle/meth/pool_list_updater.go index 42655505a..c70ab723e 100644 --- a/pkg/liquidity-source/mantle/meth/pool_list_updater.go +++ b/pkg/liquidity-source/mantle/meth/pool_list_updater.go @@ -2,17 +2,18 @@ package meth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" - "github.com/holiman/uint256" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" + "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) type ( diff --git a/pkg/liquidity-source/mantle/meth/pool_simulator.go b/pkg/liquidity-source/mantle/meth/pool_simulator.go index 0c125ef3e..60722edce 100644 --- a/pkg/liquidity-source/mantle/meth/pool_simulator.go +++ b/pkg/liquidity-source/mantle/meth/pool_simulator.go @@ -1,17 +1,18 @@ package meth import ( - "encoding/json" "errors" "math/big" "github.com/KyberNetwork/blockchain-toolkit/number" + "github.com/goccy/go-json" + "github.com/holiman/uint256" + "github.com/samber/lo" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/mantle/common" poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/holiman/uint256" - "github.com/samber/lo" ) type ( diff --git a/pkg/liquidity-source/mantle/meth/pool_tracker.go b/pkg/liquidity-source/mantle/meth/pool_tracker.go index 54c386b67..3b1371d8a 100644 --- a/pkg/liquidity-source/mantle/meth/pool_tracker.go +++ b/pkg/liquidity-source/mantle/meth/pool_tracker.go @@ -2,14 +2,15 @@ package meth import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/maverick-v2/pool_list_updater.go b/pkg/liquidity-source/maverick-v2/pool_list_updater.go index 2dead11b1..fd5a8d307 100644 --- a/pkg/liquidity-source/maverick-v2/pool_list_updater.go +++ b/pkg/liquidity-source/maverick-v2/pool_list_updater.go @@ -2,7 +2,6 @@ package maverickv2 import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/liquidity-source/mkr-sky/pool_simulator.go b/pkg/liquidity-source/mkr-sky/pool_simulator.go index 31d1bdf74..6d0b651cc 100644 --- a/pkg/liquidity-source/mkr-sky/pool_simulator.go +++ b/pkg/liquidity-source/mkr-sky/pool_simulator.go @@ -1,15 +1,16 @@ package mkr_sky import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/holiman/uint256" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/holiman/uint256" ) type PoolSimulator struct { diff --git a/pkg/liquidity-source/mkr-sky/pools_list_updater.go b/pkg/liquidity-source/mkr-sky/pools_list_updater.go index 67128d6a8..62e46fce6 100644 --- a/pkg/liquidity-source/mkr-sky/pools_list_updater.go +++ b/pkg/liquidity-source/mkr-sky/pools_list_updater.go @@ -2,7 +2,6 @@ package mkr_sky import ( "context" - "encoding/json" "errors" "math/big" "strings" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/nomiswap/nomiswapstable/pool_simulator.go b/pkg/liquidity-source/nomiswap/nomiswapstable/pool_simulator.go index 274e57a0f..f304b3ab6 100644 --- a/pkg/liquidity-source/nomiswap/nomiswapstable/pool_simulator.go +++ b/pkg/liquidity-source/nomiswap/nomiswapstable/pool_simulator.go @@ -1,16 +1,17 @@ package nomiswapstable import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/holiman/uint256" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/nomiswap" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/holiman/uint256" ) type ( diff --git a/pkg/liquidity-source/nomiswap/pool_tracker.go b/pkg/liquidity-source/nomiswap/pool_tracker.go index ed0e00691..bcfe200a7 100644 --- a/pkg/liquidity-source/nomiswap/pool_tracker.go +++ b/pkg/liquidity-source/nomiswap/pool_tracker.go @@ -2,15 +2,16 @@ package nomiswap import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/nomiswap/pools_list_updater.go b/pkg/liquidity-source/nomiswap/pools_list_updater.go index f930b4148..128804f2f 100644 --- a/pkg/liquidity-source/nomiswap/pools_list_updater.go +++ b/pkg/liquidity-source/nomiswap/pools_list_updater.go @@ -2,16 +2,17 @@ package nomiswap import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" ) type PoolsListUpdater struct { diff --git a/pkg/liquidity-source/ondo-usdy/pool_list_updater.go b/pkg/liquidity-source/ondo-usdy/pool_list_updater.go index d6fec8b62..904a5eea3 100644 --- a/pkg/liquidity-source/ondo-usdy/pool_list_updater.go +++ b/pkg/liquidity-source/ondo-usdy/pool_list_updater.go @@ -2,16 +2,17 @@ package ondo_usdy import ( "context" - "encoding/json" "errors" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) type ( diff --git a/pkg/liquidity-source/ondo-usdy/pool_simulator.go b/pkg/liquidity-source/ondo-usdy/pool_simulator.go index 85a6584b7..6dfda986f 100644 --- a/pkg/liquidity-source/ondo-usdy/pool_simulator.go +++ b/pkg/liquidity-source/ondo-usdy/pool_simulator.go @@ -1,18 +1,19 @@ package ondo_usdy import ( - "encoding/json" "errors" "fmt" "math/big" "github.com/KyberNetwork/blockchain-toolkit/number" + "github.com/goccy/go-json" + "github.com/holiman/uint256" + "github.com/samber/lo" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/ondo-usdy/common" poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/holiman/uint256" - "github.com/samber/lo" ) type ( diff --git a/pkg/liquidity-source/ondo-usdy/pool_tracker.go b/pkg/liquidity-source/ondo-usdy/pool_tracker.go index a4c7a0a8c..4eff33eb5 100644 --- a/pkg/liquidity-source/ondo-usdy/pool_tracker.go +++ b/pkg/liquidity-source/ondo-usdy/pool_tracker.go @@ -2,10 +2,11 @@ package ondo_usdy import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) diff --git a/pkg/liquidity-source/ondo-usdy/pool_tracker_test.go b/pkg/liquidity-source/ondo-usdy/pool_tracker_test.go index 57c2f4bec..1b421ff20 100644 --- a/pkg/liquidity-source/ondo-usdy/pool_tracker_test.go +++ b/pkg/liquidity-source/ondo-usdy/pool_tracker_test.go @@ -2,15 +2,16 @@ package ondo_usdy import ( "context" - "encoding/json" "testing" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolListTrackerTestSuite struct { diff --git a/pkg/liquidity-source/primeeth/pool_list_updater.go b/pkg/liquidity-source/primeeth/pool_list_updater.go index c4f33e3ff..1c721f09d 100644 --- a/pkg/liquidity-source/primeeth/pool_list_updater.go +++ b/pkg/liquidity-source/primeeth/pool_list_updater.go @@ -2,14 +2,16 @@ package primeeth import ( "context" - "encoding/json" + "math/big" + "time" + "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" - "math/big" - "time" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) type ( diff --git a/pkg/liquidity-source/primeeth/pool_simulator.go b/pkg/liquidity-source/primeeth/pool_simulator.go index 5ae269eb9..f9a5ad57f 100644 --- a/pkg/liquidity-source/primeeth/pool_simulator.go +++ b/pkg/liquidity-source/primeeth/pool_simulator.go @@ -1,13 +1,15 @@ package primeeth import ( - "encoding/json" "errors" + "math/big" + + "github.com/goccy/go-json" + "github.com/samber/lo" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/samber/lo" - "math/big" ) type ( diff --git a/pkg/liquidity-source/primeeth/pool_tracker.go b/pkg/liquidity-source/primeeth/pool_tracker.go index 81415ae8a..8db5b72c1 100644 --- a/pkg/liquidity-source/primeeth/pool_tracker.go +++ b/pkg/liquidity-source/primeeth/pool_tracker.go @@ -2,14 +2,15 @@ package primeeth import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/puffer/pufeth/pool_list_updater.go b/pkg/liquidity-source/puffer/pufeth/pool_list_updater.go index 07ed57fde..15a48cadd 100644 --- a/pkg/liquidity-source/puffer/pufeth/pool_list_updater.go +++ b/pkg/liquidity-source/puffer/pufeth/pool_list_updater.go @@ -2,12 +2,12 @@ package pufeth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/liquidity-source/puffer/pufeth/pool_tracker.go b/pkg/liquidity-source/puffer/pufeth/pool_tracker.go index 0bfeb4f21..4c03ca7ba 100644 --- a/pkg/liquidity-source/puffer/pufeth/pool_tracker.go +++ b/pkg/liquidity-source/puffer/pufeth/pool_tracker.go @@ -2,17 +2,17 @@ package pufeth import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/renzo/ezeth/pool_list_updater.go b/pkg/liquidity-source/renzo/ezeth/pool_list_updater.go index 9013e1d68..3d411bcfc 100644 --- a/pkg/liquidity-source/renzo/ezeth/pool_list_updater.go +++ b/pkg/liquidity-source/renzo/ezeth/pool_list_updater.go @@ -2,7 +2,6 @@ package ezeth import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,12 +9,13 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolListUpdater struct { diff --git a/pkg/liquidity-source/renzo/ezeth/pool_simulator.go b/pkg/liquidity-source/renzo/ezeth/pool_simulator.go index e638c969a..2d46b32ee 100644 --- a/pkg/liquidity-source/renzo/ezeth/pool_simulator.go +++ b/pkg/liquidity-source/renzo/ezeth/pool_simulator.go @@ -1,10 +1,10 @@ package ezeth import ( - "encoding/json" "math/big" "time" + "github.com/goccy/go-json" "github.com/pkg/errors" "github.com/samber/lo" diff --git a/pkg/liquidity-source/renzo/ezeth/pool_tracker.go b/pkg/liquidity-source/renzo/ezeth/pool_tracker.go index 328f7d3fe..cec521410 100644 --- a/pkg/liquidity-source/renzo/ezeth/pool_tracker.go +++ b/pkg/liquidity-source/renzo/ezeth/pool_tracker.go @@ -2,15 +2,16 @@ package ezeth import ( "context" - "encoding/json" "strings" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/rocketpool/reth/pool_list_updater.go b/pkg/liquidity-source/rocketpool/reth/pool_list_updater.go index c002133bf..c50f663e5 100644 --- a/pkg/liquidity-source/rocketpool/reth/pool_list_updater.go +++ b/pkg/liquidity-source/rocketpool/reth/pool_list_updater.go @@ -2,17 +2,17 @@ package reth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolListUpdater struct { diff --git a/pkg/liquidity-source/rocketpool/reth/pool_tracker.go b/pkg/liquidity-source/rocketpool/reth/pool_tracker.go index 7a068fa48..8fe0fa320 100644 --- a/pkg/liquidity-source/rocketpool/reth/pool_tracker.go +++ b/pkg/liquidity-source/rocketpool/reth/pool_tracker.go @@ -2,15 +2,15 @@ package reth import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/staderethx/pool_list_updater.go b/pkg/liquidity-source/staderethx/pool_list_updater.go index ead6ba2d8..c7774a0d5 100644 --- a/pkg/liquidity-source/staderethx/pool_list_updater.go +++ b/pkg/liquidity-source/staderethx/pool_list_updater.go @@ -2,15 +2,17 @@ package staderethx import ( "context" - "encoding/json" + "math/big" + "time" + "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/holiman/uint256" - "math/big" - "time" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) type ( diff --git a/pkg/liquidity-source/staderethx/pool_simulator.go b/pkg/liquidity-source/staderethx/pool_simulator.go index 089b29f04..8dd6c646c 100644 --- a/pkg/liquidity-source/staderethx/pool_simulator.go +++ b/pkg/liquidity-source/staderethx/pool_simulator.go @@ -1,14 +1,16 @@ package staderethx import ( - "encoding/json" "errors" + "math/big" + + "github.com/goccy/go-json" + "github.com/holiman/uint256" + "github.com/samber/lo" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/holiman/uint256" - "github.com/samber/lo" - "math/big" ) type ( diff --git a/pkg/liquidity-source/staderethx/pool_tracker.go b/pkg/liquidity-source/staderethx/pool_tracker.go index 6d0bdfb25..31b696597 100644 --- a/pkg/liquidity-source/staderethx/pool_tracker.go +++ b/pkg/liquidity-source/staderethx/pool_tracker.go @@ -2,14 +2,15 @@ package staderethx import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/swell/rsweth/pool_list_updater.go b/pkg/liquidity-source/swell/rsweth/pool_list_updater.go index 2cc8b27f1..ac0860782 100644 --- a/pkg/liquidity-source/swell/rsweth/pool_list_updater.go +++ b/pkg/liquidity-source/swell/rsweth/pool_list_updater.go @@ -2,12 +2,12 @@ package rsweth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/swell/common" diff --git a/pkg/liquidity-source/swell/rsweth/pool_tracker.go b/pkg/liquidity-source/swell/rsweth/pool_tracker.go index c983a64a7..c2aed2423 100644 --- a/pkg/liquidity-source/swell/rsweth/pool_tracker.go +++ b/pkg/liquidity-source/swell/rsweth/pool_tracker.go @@ -2,17 +2,17 @@ package rsweth import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/swell/common" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/swell/sweth/pool_list_updater.go b/pkg/liquidity-source/swell/sweth/pool_list_updater.go index b2683dc8f..dfe37cf6e 100644 --- a/pkg/liquidity-source/swell/sweth/pool_list_updater.go +++ b/pkg/liquidity-source/swell/sweth/pool_list_updater.go @@ -2,12 +2,12 @@ package sweth import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/swell/common" diff --git a/pkg/liquidity-source/swell/sweth/pool_tracker.go b/pkg/liquidity-source/swell/sweth/pool_tracker.go index 7a3cb1cbb..e1b3fdc62 100644 --- a/pkg/liquidity-source/swell/sweth/pool_tracker.go +++ b/pkg/liquidity-source/swell/sweth/pool_tracker.go @@ -2,17 +2,17 @@ package sweth import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/liquidity-source/swell/common" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/uniswap-v2/pool_tracker.go b/pkg/liquidity-source/uniswap-v2/pool_tracker.go index f45123b9f..f55074735 100644 --- a/pkg/liquidity-source/uniswap-v2/pool_tracker.go +++ b/pkg/liquidity-source/uniswap-v2/pool_tracker.go @@ -2,13 +2,13 @@ package uniswapv2 import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/core/types" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/liquidity-source/usd0pp/pool_list_updater.go b/pkg/liquidity-source/usd0pp/pool_list_updater.go index 8140f696a..1565075c5 100644 --- a/pkg/liquidity-source/usd0pp/pool_list_updater.go +++ b/pkg/liquidity-source/usd0pp/pool_list_updater.go @@ -2,13 +2,15 @@ package usd0pp import ( "context" - "encoding/json" - "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/logger" "math/big" "strings" "time" + + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) type ( diff --git a/pkg/liquidity-source/usd0pp/pool_list_updater_test.go b/pkg/liquidity-source/usd0pp/pool_list_updater_test.go index 5aedc7122..f6b832d47 100644 --- a/pkg/liquidity-source/usd0pp/pool_list_updater_test.go +++ b/pkg/liquidity-source/usd0pp/pool_list_updater_test.go @@ -2,13 +2,14 @@ package usd0pp import ( "context" - "encoding/json" + "strings" + "testing" + "github.com/KyberNetwork/ethrpc" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "strings" - "testing" ) type PoolListUpdaterTestSuite struct { diff --git a/pkg/liquidity-source/usd0pp/pool_simulator.go b/pkg/liquidity-source/usd0pp/pool_simulator.go index 267c360d8..199c4ff5e 100644 --- a/pkg/liquidity-source/usd0pp/pool_simulator.go +++ b/pkg/liquidity-source/usd0pp/pool_simulator.go @@ -1,14 +1,16 @@ package usd0pp import ( - "encoding/json" "errors" + "math/big" + "time" + + "github.com/goccy/go-json" + "github.com/samber/lo" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/samber/lo" - "math/big" - "time" ) type ( diff --git a/pkg/liquidity-source/usd0pp/pool_tracker.go b/pkg/liquidity-source/usd0pp/pool_tracker.go index 61bc0e1e2..e7083a398 100644 --- a/pkg/liquidity-source/usd0pp/pool_tracker.go +++ b/pkg/liquidity-source/usd0pp/pool_tracker.go @@ -2,15 +2,17 @@ package usd0pp import ( "context" - "encoding/json" "errors" + "time" + "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" - "time" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) var ( diff --git a/pkg/liquidity-source/usd0pp/pool_tracker_test.go b/pkg/liquidity-source/usd0pp/pool_tracker_test.go index 30924afaa..a66b12514 100644 --- a/pkg/liquidity-source/usd0pp/pool_tracker_test.go +++ b/pkg/liquidity-source/usd0pp/pool_tracker_test.go @@ -2,14 +2,16 @@ package usd0pp import ( "context" - "encoding/json" + "testing" + "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "testing" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolListTrackerTestSuite struct { diff --git a/pkg/liquidity-source/woofi-v2/pool_simulator.go b/pkg/liquidity-source/woofi-v2/pool_simulator.go index eff4bcde8..f8cb2dd6a 100644 --- a/pkg/liquidity-source/woofi-v2/pool_simulator.go +++ b/pkg/liquidity-source/woofi-v2/pool_simulator.go @@ -1,16 +1,17 @@ package woofiv2 import ( - "encoding/json" "errors" "fmt" "time" "github.com/KyberNetwork/blockchain-toolkit/number" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) var ( diff --git a/pkg/liquidity-source/woofi-v2/pool_tracker.go b/pkg/liquidity-source/woofi-v2/pool_tracker.go index ff35ac432..fae8ea578 100644 --- a/pkg/liquidity-source/woofi-v2/pool_tracker.go +++ b/pkg/liquidity-source/woofi-v2/pool_tracker.go @@ -2,19 +2,19 @@ package woofiv2 import ( "context" - "encoding/json" "errors" "math/big" "strings" "time" + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" - "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/KyberNetwork/logger" - "github.com/ethereum/go-ethereum/common" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/woofi-v21/pool_simulator.go b/pkg/liquidity-source/woofi-v21/pool_simulator.go index 73fe39e39..f35489486 100644 --- a/pkg/liquidity-source/woofi-v21/pool_simulator.go +++ b/pkg/liquidity-source/woofi-v21/pool_simulator.go @@ -1,16 +1,17 @@ package woofiv21 import ( - "encoding/json" "errors" "fmt" "time" "github.com/KyberNetwork/blockchain-toolkit/number" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/holiman/uint256" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) var ( diff --git a/pkg/liquidity-source/woofi-v21/pool_tracker.go b/pkg/liquidity-source/woofi-v21/pool_tracker.go index fa8503d53..8e74b3c2e 100644 --- a/pkg/liquidity-source/woofi-v21/pool_tracker.go +++ b/pkg/liquidity-source/woofi-v21/pool_tracker.go @@ -2,19 +2,19 @@ package woofiv21 import ( "context" - "encoding/json" "errors" "math/big" "strings" "time" + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" - "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/KyberNetwork/logger" - "github.com/ethereum/go-ethereum/common" ) type PoolTracker struct { diff --git a/pkg/liquidity-source/woofi-v21/pool_tracker_test.go b/pkg/liquidity-source/woofi-v21/pool_tracker_test.go index cf94a0ccf..4130d4f9c 100644 --- a/pkg/liquidity-source/woofi-v21/pool_tracker_test.go +++ b/pkg/liquidity-source/woofi-v21/pool_tracker_test.go @@ -2,15 +2,16 @@ package woofiv21 import ( "context" - "encoding/json" "testing" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolListTrackerTestSuite struct { diff --git a/pkg/source/algebrav1/pool_list_updater.go b/pkg/source/algebrav1/pool_list_updater.go index 0c5ef0f38..f9d244a7d 100644 --- a/pkg/source/algebrav1/pool_list_updater.go +++ b/pkg/source/algebrav1/pool_list_updater.go @@ -2,7 +2,6 @@ package algebrav1 import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/algebrav1/pool_simulator.go b/pkg/source/algebrav1/pool_simulator.go index 1c1ea5c6d..ed776c461 100644 --- a/pkg/source/algebrav1/pool_simulator.go +++ b/pkg/source/algebrav1/pool_simulator.go @@ -1,16 +1,15 @@ package algebrav1 import ( - "encoding/json" "fmt" "math/big" "strings" - v3Entities "github.com/daoleno/uniswapv3-sdk/entities" - v3Utils "github.com/daoleno/uniswapv3-sdk/utils" - "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + v3Entities "github.com/daoleno/uniswapv3-sdk/entities" + v3Utils "github.com/daoleno/uniswapv3-sdk/utils" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/algebrav1/pool_tracker.go b/pkg/source/algebrav1/pool_tracker.go index 8ab11d699..575ea6dff 100644 --- a/pkg/source/algebrav1/pool_tracker.go +++ b/pkg/source/algebrav1/pool_tracker.go @@ -2,7 +2,6 @@ package algebrav1 import ( "context" - "encoding/json" "math/big" "time" @@ -11,6 +10,7 @@ import ( v3Entities "github.com/daoleno/uniswapv3-sdk/entities" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/sourcegraph/conc/pool" diff --git a/pkg/source/algebrav1/ticklens.go b/pkg/source/algebrav1/ticklens.go index 8dc49c008..e27e14702 100644 --- a/pkg/source/algebrav1/ticklens.go +++ b/pkg/source/algebrav1/ticklens.go @@ -2,22 +2,20 @@ package algebrav1 import ( "context" - "encoding/json" "sort" "strconv" + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/samber/lo" - "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/logger" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/ticklens" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/ticklens" ) const ( diff --git a/pkg/source/balancer-composable-stable/pool_simulator.go b/pkg/source/balancer-composable-stable/pool_simulator.go index 96a039752..f7bcf4127 100644 --- a/pkg/source/balancer-composable-stable/pool_simulator.go +++ b/pkg/source/balancer-composable-stable/pool_simulator.go @@ -1,10 +1,11 @@ package balancercomposablestable import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/balancer-composable-stable/pool_tracker.go b/pkg/source/balancer-composable-stable/pool_tracker.go index 38af95bec..1fda40d4d 100644 --- a/pkg/source/balancer-composable-stable/pool_tracker.go +++ b/pkg/source/balancer-composable-stable/pool_tracker.go @@ -2,7 +2,6 @@ package balancercomposablestable import ( "context" - "encoding/json" "fmt" "math/big" "strings" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/balancer-composable-stable/pools_list_updater.go b/pkg/source/balancer-composable-stable/pools_list_updater.go index 6bc3aa4fd..6f08779d3 100644 --- a/pkg/source/balancer-composable-stable/pools_list_updater.go +++ b/pkg/source/balancer-composable-stable/pools_list_updater.go @@ -2,7 +2,6 @@ package balancercomposablestable import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -12,6 +11,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/balancer/pool_tracker.go b/pkg/source/balancer/pool_tracker.go index 7f968f8fa..d2d563e62 100644 --- a/pkg/source/balancer/pool_tracker.go +++ b/pkg/source/balancer/pool_tracker.go @@ -2,7 +2,6 @@ package balancer import ( "context" - "encoding/json" "fmt" "math/big" "strings" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/balancer/pools_list_updater.go b/pkg/source/balancer/pools_list_updater.go index 7d7a90c49..a671e53c5 100644 --- a/pkg/source/balancer/pools_list_updater.go +++ b/pkg/source/balancer/pools_list_updater.go @@ -2,7 +2,6 @@ package balancer import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -12,6 +11,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/balancer/stable/pool_simulator.go b/pkg/source/balancer/stable/pool_simulator.go index 2b98910f2..fde5ba393 100644 --- a/pkg/source/balancer/stable/pool_simulator.go +++ b/pkg/source/balancer/stable/pool_simulator.go @@ -1,12 +1,12 @@ package balancerstable import ( - "encoding/json" "errors" "fmt" "math/big" "strings" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/balancer/weighted/pool_simulator.go b/pkg/source/balancer/weighted/pool_simulator.go index 879f4c4d0..4f5d04c21 100644 --- a/pkg/source/balancer/weighted/pool_simulator.go +++ b/pkg/source/balancer/weighted/pool_simulator.go @@ -1,17 +1,17 @@ package balancerweighted import ( - "encoding/json" "errors" "fmt" "math/big" "strings" - balancer "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/balancer" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + balancer "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/balancer" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type WeightedPool2Tokens struct { diff --git a/pkg/source/biswap/pools_list_updater.go b/pkg/source/biswap/pools_list_updater.go index b09881d00..90ff6bb52 100644 --- a/pkg/source/biswap/pools_list_updater.go +++ b/pkg/source/biswap/pools_list_updater.go @@ -2,7 +2,6 @@ package biswap import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/camelot/pool_lists_updater.go b/pkg/source/camelot/pool_lists_updater.go index f4dbd6711..fb5ccf969 100644 --- a/pkg/source/camelot/pool_lists_updater.go +++ b/pkg/source/camelot/pool_lists_updater.go @@ -2,13 +2,13 @@ package camelot import ( "context" - "encoding/json" "math/big" "strings" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/camelot/pool_simulator.go b/pkg/source/camelot/pool_simulator.go index 1c0179a67..b6e9db08c 100644 --- a/pkg/source/camelot/pool_simulator.go +++ b/pkg/source/camelot/pool_simulator.go @@ -1,10 +1,11 @@ package camelot import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/camelot/pool_tracker.go b/pkg/source/camelot/pool_tracker.go index 53b24dd25..b2f8da615 100644 --- a/pkg/source/camelot/pool_tracker.go +++ b/pkg/source/camelot/pool_tracker.go @@ -2,13 +2,13 @@ package camelot import ( "context" - "encoding/json" "fmt" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/curve/aave/pool_simulator.go b/pkg/source/curve/aave/pool_simulator.go index 35594905b..89ef85fc7 100644 --- a/pkg/source/curve/aave/pool_simulator.go +++ b/pkg/source/curve/aave/pool_simulator.go @@ -1,11 +1,12 @@ package aave import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/curve/base/pool_simulator.go b/pkg/source/curve/base/pool_simulator.go index aa86469be..b2a3581a6 100644 --- a/pkg/source/curve/base/pool_simulator.go +++ b/pkg/source/curve/base/pool_simulator.go @@ -1,12 +1,13 @@ package base import ( - "encoding/json" "errors" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/curve/base/pool_simulator_test.go b/pkg/source/curve/base/pool_simulator_test.go index 8afefbba9..b56972aeb 100644 --- a/pkg/source/curve/base/pool_simulator_test.go +++ b/pkg/source/curve/base/pool_simulator_test.go @@ -1,12 +1,12 @@ package base import ( - "encoding/json" "fmt" "math/big" "testing" "time" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/curve/compound/pool_simulator.go b/pkg/source/curve/compound/pool_simulator.go index 05d43582a..21e10350b 100644 --- a/pkg/source/curve/compound/pool_simulator.go +++ b/pkg/source/curve/compound/pool_simulator.go @@ -1,11 +1,12 @@ package compound import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/curve/meta/pool_simulator.go b/pkg/source/curve/meta/pool_simulator.go index b1c6a564f..2bec305b0 100644 --- a/pkg/source/curve/meta/pool_simulator.go +++ b/pkg/source/curve/meta/pool_simulator.go @@ -1,11 +1,12 @@ package meta import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/curve/plain-oracle/pool_simulator.go b/pkg/source/curve/plain-oracle/pool_simulator.go index 9c82bc9f8..8c6e026a1 100644 --- a/pkg/source/curve/plain-oracle/pool_simulator.go +++ b/pkg/source/curve/plain-oracle/pool_simulator.go @@ -1,12 +1,13 @@ package plainoracle import ( - "encoding/json" "errors" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/curve/plain-oracle/pool_simulator_test.go b/pkg/source/curve/plain-oracle/pool_simulator_test.go index 6205d2fd5..61ea0d07f 100644 --- a/pkg/source/curve/plain-oracle/pool_simulator_test.go +++ b/pkg/source/curve/plain-oracle/pool_simulator_test.go @@ -1,11 +1,11 @@ package plainoracle import ( - "encoding/json" "fmt" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/curve/pool_aave.go b/pkg/source/curve/pool_aave.go index 4591df69c..4e84aba5e 100644 --- a/pkg/source/curve/pool_aave.go +++ b/pkg/source/curve/pool_aave.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,9 +9,10 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) func (d *PoolsListUpdater) getNewPoolsTypeAave( diff --git a/pkg/source/curve/pool_base.go b/pkg/source/curve/pool_base.go index 696ab445f..0c55512bd 100644 --- a/pkg/source/curve/pool_base.go +++ b/pkg/source/curve/pool_base.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/curve/pool_compound.go b/pkg/source/curve/pool_compound.go index 44bcc6b23..031c9f6a4 100644 --- a/pkg/source/curve/pool_compound.go +++ b/pkg/source/curve/pool_compound.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "errors" "math/big" "strings" @@ -11,9 +10,10 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) func (d *PoolsListUpdater) getNewPoolsTypeCompound( diff --git a/pkg/source/curve/pool_meta.go b/pkg/source/curve/pool_meta.go index cf5606720..3d2626707 100644 --- a/pkg/source/curve/pool_meta.go +++ b/pkg/source/curve/pool_meta.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,9 +9,10 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) func (d *PoolsListUpdater) getNewPoolsTypeMeta( diff --git a/pkg/source/curve/pool_plain_oracle.go b/pkg/source/curve/pool_plain_oracle.go index d9ea98ca5..b4bfbcccb 100644 --- a/pkg/source/curve/pool_plain_oracle.go +++ b/pkg/source/curve/pool_plain_oracle.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,10 +9,11 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) func (d *PoolsListUpdater) getNewPoolsTypePlainOracle( diff --git a/pkg/source/curve/pool_tricrypto.go b/pkg/source/curve/pool_tricrypto.go index 4d0c0dc09..a70d3ec5a 100644 --- a/pkg/source/curve/pool_tricrypto.go +++ b/pkg/source/curve/pool_tricrypto.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,10 +9,11 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) func (d *PoolsListUpdater) getNewPoolsTypeTricrypto( diff --git a/pkg/source/curve/pool_two.go b/pkg/source/curve/pool_two.go index 16d7be1ad..de153ddff 100644 --- a/pkg/source/curve/pool_two.go +++ b/pkg/source/curve/pool_two.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,9 +9,10 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) func (d *PoolsListUpdater) getNewPoolsTypeTwo( diff --git a/pkg/source/curve/pools_list_updater.go b/pkg/source/curve/pools_list_updater.go index 592929ace..ae6366cff 100644 --- a/pkg/source/curve/pools_list_updater.go +++ b/pkg/source/curve/pools_list_updater.go @@ -2,7 +2,6 @@ package curve import ( "context" - "encoding/json" "errors" "math/big" "strings" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/curve/tricrypto/pool_simulator.go b/pkg/source/curve/tricrypto/pool_simulator.go index 9dc777baf..f3f9dec3a 100644 --- a/pkg/source/curve/tricrypto/pool_simulator.go +++ b/pkg/source/curve/tricrypto/pool_simulator.go @@ -1,11 +1,12 @@ package tricrypto import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/curve/two/pool_simulator.go b/pkg/source/curve/two/pool_simulator.go index 94257440a..909d9cb14 100644 --- a/pkg/source/curve/two/pool_simulator.go +++ b/pkg/source/curve/two/pool_simulator.go @@ -1,11 +1,12 @@ package two import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/dmm/pool_simulator.go b/pkg/source/dmm/pool_simulator.go index 13c82cafb..3118fa765 100644 --- a/pkg/source/dmm/pool_simulator.go +++ b/pkg/source/dmm/pool_simulator.go @@ -1,11 +1,12 @@ package dmm import ( - "encoding/json" "fmt" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) diff --git a/pkg/source/dmm/pool_tracker.go b/pkg/source/dmm/pool_tracker.go index dfb59b61b..e8c4ca67d 100644 --- a/pkg/source/dmm/pool_tracker.go +++ b/pkg/source/dmm/pool_tracker.go @@ -2,11 +2,11 @@ package dmm import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/dmm/pools_list_updater.go b/pkg/source/dmm/pools_list_updater.go index 7ec62d1b1..52933f6d4 100644 --- a/pkg/source/dmm/pools_list_updater.go +++ b/pkg/source/dmm/pools_list_updater.go @@ -2,7 +2,6 @@ package dmm import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/dodo/pool_simulator.go b/pkg/source/dodo/pool_simulator.go index 862a42720..6abd631a7 100644 --- a/pkg/source/dodo/pool_simulator.go +++ b/pkg/source/dodo/pool_simulator.go @@ -1,11 +1,12 @@ package dodo import ( - "encoding/json" "errors" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/dodo/pool_simulator_test.go b/pkg/source/dodo/pool_simulator_test.go index 7e941ac97..f5a69e548 100644 --- a/pkg/source/dodo/pool_simulator_test.go +++ b/pkg/source/dodo/pool_simulator_test.go @@ -1,11 +1,11 @@ package dodo import ( - "encoding/json" "fmt" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/dodo/pool_tracker.go b/pkg/source/dodo/pool_tracker.go index 80fe6e31c..486b3c355 100644 --- a/pkg/source/dodo/pool_tracker.go +++ b/pkg/source/dodo/pool_tracker.go @@ -4,7 +4,6 @@ import ( "bufio" "bytes" "context" - "encoding/json" "fmt" "math/big" "time" @@ -12,6 +11,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" cmap "github.com/orcaman/concurrent-map" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/dodo/pools_list_updater.go b/pkg/source/dodo/pools_list_updater.go index e40ec7416..427aad10b 100644 --- a/pkg/source/dodo/pools_list_updater.go +++ b/pkg/source/dodo/pools_list_updater.go @@ -2,12 +2,12 @@ package dodo import ( "context" - "encoding/json" "fmt" "math/big" "strconv" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/dystopia/pools_list_updater.go b/pkg/source/dystopia/pools_list_updater.go index e25182b26..51117bb14 100644 --- a/pkg/source/dystopia/pools_list_updater.go +++ b/pkg/source/dystopia/pools_list_updater.go @@ -2,7 +2,6 @@ package dystopia import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/elastic/pool_simulator.go b/pkg/source/elastic/pool_simulator.go index 0c8db2f97..e6def47e4 100644 --- a/pkg/source/elastic/pool_simulator.go +++ b/pkg/source/elastic/pool_simulator.go @@ -1,7 +1,6 @@ package elastic import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( "github.com/KyberNetwork/logger" coreEntities "github.com/daoleno/uniswap-sdk-core/entities" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/elastic/pool_tracker.go b/pkg/source/elastic/pool_tracker.go index 640e13519..2dad3724b 100644 --- a/pkg/source/elastic/pool_tracker.go +++ b/pkg/source/elastic/pool_tracker.go @@ -2,13 +2,13 @@ package elastic import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/sourcegraph/conc/pool" diff --git a/pkg/source/elastic/pools_list_updater.go b/pkg/source/elastic/pools_list_updater.go index 10697e7b1..da1c19ded 100644 --- a/pkg/source/elastic/pools_list_updater.go +++ b/pkg/source/elastic/pools_list_updater.go @@ -2,7 +2,6 @@ package elastic import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/equalizer/helper.go b/pkg/source/equalizer/helper.go index b7ececd37..4e621ae57 100644 --- a/pkg/source/equalizer/helper.go +++ b/pkg/source/equalizer/helper.go @@ -1,6 +1,6 @@ package equalizer -import "encoding/json" +import "github.com/goccy/go-json" func extractStaticExtra(s string) (staticExtra StaticExtra, err error) { err = json.Unmarshal([]byte(s), &staticExtra) diff --git a/pkg/source/equalizer/pool_simulator_test.go b/pkg/source/equalizer/pool_simulator_test.go index 212a50a7e..981613e74 100644 --- a/pkg/source/equalizer/pool_simulator_test.go +++ b/pkg/source/equalizer/pool_simulator_test.go @@ -1,9 +1,9 @@ package equalizer import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/equalizer/pools_list_updater.go b/pkg/source/equalizer/pools_list_updater.go index 4af53fb2d..60e08abc8 100644 --- a/pkg/source/equalizer/pools_list_updater.go +++ b/pkg/source/equalizer/pools_list_updater.go @@ -2,7 +2,6 @@ package equalizer import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/fraxswap/pool_simulator.go b/pkg/source/fraxswap/pool_simulator.go index 747c4c875..680c65d61 100644 --- a/pkg/source/fraxswap/pool_simulator.go +++ b/pkg/source/fraxswap/pool_simulator.go @@ -1,12 +1,12 @@ package fraxswap import ( - "encoding/json" "errors" "math/big" "strings" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/fraxswap/pool_tracker.go b/pkg/source/fraxswap/pool_tracker.go index 3b174d8e8..5d0a31eea 100644 --- a/pkg/source/fraxswap/pool_tracker.go +++ b/pkg/source/fraxswap/pool_tracker.go @@ -2,12 +2,12 @@ package fraxswap import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/fraxswap/pools_list_updater.go b/pkg/source/fraxswap/pools_list_updater.go index 42c085295..97a8c2d52 100644 --- a/pkg/source/fraxswap/pools_list_updater.go +++ b/pkg/source/fraxswap/pools_list_updater.go @@ -2,7 +2,6 @@ package fraxswap import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/fulcrom/pool_simulator.go b/pkg/source/fulcrom/pool_simulator.go index e7a8af461..278c503d8 100644 --- a/pkg/source/fulcrom/pool_simulator.go +++ b/pkg/source/fulcrom/pool_simulator.go @@ -1,10 +1,11 @@ package fulcrom import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/fulcrom/pool_simulator_test.go b/pkg/source/fulcrom/pool_simulator_test.go index a19fa0473..ecce05ee6 100644 --- a/pkg/source/fulcrom/pool_simulator_test.go +++ b/pkg/source/fulcrom/pool_simulator_test.go @@ -1,9 +1,9 @@ package fulcrom import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/fulcrom/pool_tracker.go b/pkg/source/fulcrom/pool_tracker.go index 43a1eb23e..9c34605fe 100644 --- a/pkg/source/fulcrom/pool_tracker.go +++ b/pkg/source/fulcrom/pool_tracker.go @@ -2,12 +2,12 @@ package fulcrom import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/fulcrom/pools_list_updater.go b/pkg/source/fulcrom/pools_list_updater.go index c9fd49331..86c54d703 100644 --- a/pkg/source/fulcrom/pools_list_updater.go +++ b/pkg/source/fulcrom/pools_list_updater.go @@ -2,11 +2,11 @@ package fulcrom import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/fxdx/pool_simulator.go b/pkg/source/fxdx/pool_simulator.go index aa5175770..c41033113 100644 --- a/pkg/source/fxdx/pool_simulator.go +++ b/pkg/source/fxdx/pool_simulator.go @@ -1,11 +1,11 @@ package fxdx import ( - "encoding/json" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/integer" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/fxdx/pool_simulator_test.go b/pkg/source/fxdx/pool_simulator_test.go index 297c83306..a1d543c26 100644 --- a/pkg/source/fxdx/pool_simulator_test.go +++ b/pkg/source/fxdx/pool_simulator_test.go @@ -1,9 +1,9 @@ package fxdx import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/fxdx/pool_tracker.go b/pkg/source/fxdx/pool_tracker.go index 04306bbae..f35a3cf0d 100644 --- a/pkg/source/fxdx/pool_tracker.go +++ b/pkg/source/fxdx/pool_tracker.go @@ -2,12 +2,12 @@ package fxdx import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/fxdx/pools_list_updater.go b/pkg/source/fxdx/pools_list_updater.go index 0a9718412..295dc2baf 100644 --- a/pkg/source/fxdx/pools_list_updater.go +++ b/pkg/source/fxdx/pools_list_updater.go @@ -2,11 +2,11 @@ package fxdx import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/gmx-glp/pool_simulator.go b/pkg/source/gmx-glp/pool_simulator.go index e0451798a..ea2a1ba4e 100644 --- a/pkg/source/gmx-glp/pool_simulator.go +++ b/pkg/source/gmx-glp/pool_simulator.go @@ -1,12 +1,12 @@ package gmxglp import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/gmx-glp/pool_tracker.go b/pkg/source/gmx-glp/pool_tracker.go index 2ebdffb3a..ac7c8b87e 100644 --- a/pkg/source/gmx-glp/pool_tracker.go +++ b/pkg/source/gmx-glp/pool_tracker.go @@ -2,13 +2,13 @@ package gmxglp import ( "context" - "encoding/json" "fmt" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/gmx-glp/pools_list_updater.go b/pkg/source/gmx-glp/pools_list_updater.go index c1d65ecba..dcb872c4e 100644 --- a/pkg/source/gmx-glp/pools_list_updater.go +++ b/pkg/source/gmx-glp/pools_list_updater.go @@ -2,13 +2,13 @@ package gmxglp import ( "context" - "encoding/json" "fmt" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/gmx-glp/vault_price_feed.go b/pkg/source/gmx-glp/vault_price_feed.go index 9cb09e046..d65297e45 100644 --- a/pkg/source/gmx-glp/vault_price_feed.go +++ b/pkg/source/gmx-glp/vault_price_feed.go @@ -1,11 +1,12 @@ package gmxglp import ( - "encoding/json" "math/big" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type VaultPriceFeed struct { diff --git a/pkg/source/gmx/pool_simulator.go b/pkg/source/gmx/pool_simulator.go index 2acf95782..48a24d15b 100644 --- a/pkg/source/gmx/pool_simulator.go +++ b/pkg/source/gmx/pool_simulator.go @@ -1,10 +1,11 @@ package gmx import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/gmx/pool_tracker.go b/pkg/source/gmx/pool_tracker.go index 226a4dd44..a011fb334 100644 --- a/pkg/source/gmx/pool_tracker.go +++ b/pkg/source/gmx/pool_tracker.go @@ -2,12 +2,12 @@ package gmx import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/gmx/pools_list_updater.go b/pkg/source/gmx/pools_list_updater.go index 1b12f2aa0..dadaa70f2 100644 --- a/pkg/source/gmx/pools_list_updater.go +++ b/pkg/source/gmx/pools_list_updater.go @@ -2,11 +2,11 @@ package gmx import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/gmx/vault_price_feed.go b/pkg/source/gmx/vault_price_feed.go index bb70fa202..755d2d102 100644 --- a/pkg/source/gmx/vault_price_feed.go +++ b/pkg/source/gmx/vault_price_feed.go @@ -1,11 +1,12 @@ package gmx import ( - "encoding/json" "math/big" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type VaultPriceFeed struct { diff --git a/pkg/source/ironstable/pool_tracker.go b/pkg/source/ironstable/pool_tracker.go index f94cd74c6..29e25c240 100644 --- a/pkg/source/ironstable/pool_tracker.go +++ b/pkg/source/ironstable/pool_tracker.go @@ -2,13 +2,13 @@ package ironstable import ( "context" - "encoding/json" "fmt" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/ironstable/pools_list_updater.go b/pkg/source/ironstable/pools_list_updater.go index 5908168c4..c302e1bba 100644 --- a/pkg/source/ironstable/pools_list_updater.go +++ b/pkg/source/ironstable/pools_list_updater.go @@ -2,13 +2,13 @@ package ironstable import ( "context" - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/timer" diff --git a/pkg/source/iziswap/pool_simulator.go b/pkg/source/iziswap/pool_simulator.go index c5946d985..f2002da32 100644 --- a/pkg/source/iziswap/pool_simulator.go +++ b/pkg/source/iziswap/pool_simulator.go @@ -1,13 +1,13 @@ package iziswap import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/iZiSwap-SDK-go/swap" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/pkg/errors" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/iziswap/pool_tracker.go b/pkg/source/iziswap/pool_tracker.go index accb77a97..f56090794 100644 --- a/pkg/source/iziswap/pool_tracker.go +++ b/pkg/source/iziswap/pool_tracker.go @@ -2,16 +2,17 @@ package iziswap import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/iZiSwap-SDK-go/swap" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/sourcegraph/conc/pool" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/source/iziswap/pools_list_updater.go b/pkg/source/iziswap/pools_list_updater.go index 44080a2e7..620e89f3a 100644 --- a/pkg/source/iziswap/pools_list_updater.go +++ b/pkg/source/iziswap/pools_list_updater.go @@ -2,11 +2,12 @@ package iziswap import ( "context" - "encoding/json" "time" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) // This integration is mostly forked from https://github.com/opcc22059/kyberswap-dex-lib/tree/iZiSwap, diff --git a/pkg/source/kokonut-crypto/pool_simulator.go b/pkg/source/kokonut-crypto/pool_simulator.go index 139804255..48b8b5e1f 100644 --- a/pkg/source/kokonut-crypto/pool_simulator.go +++ b/pkg/source/kokonut-crypto/pool_simulator.go @@ -1,14 +1,14 @@ package kokonutcrypto import ( - "encoding/json" "fmt" "math/big" "strings" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/curve" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" constant "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" utils "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/kokonut-crypto/pool_tracker.go b/pkg/source/kokonut-crypto/pool_tracker.go index e66c9dd0e..6f84f350e 100644 --- a/pkg/source/kokonut-crypto/pool_tracker.go +++ b/pkg/source/kokonut-crypto/pool_tracker.go @@ -2,14 +2,16 @@ package kokonutcrypto import ( "context" - "encoding/json" - "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/KyberNetwork/logger" "math/big" "strconv" "time" + + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/source/kokonut-crypto/pools_list_updater.go b/pkg/source/kokonut-crypto/pools_list_updater.go index fee4b7d07..31656b113 100644 --- a/pkg/source/kokonut-crypto/pools_list_updater.go +++ b/pkg/source/kokonut-crypto/pools_list_updater.go @@ -2,15 +2,17 @@ package kokonutcrypto import ( "context" - "encoding/json" - "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" - "github.com/KyberNetwork/logger" - "github.com/ethereum/go-ethereum/common" "math/big" "strings" "time" + + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" ) type PoolsListUpdater struct { diff --git a/pkg/source/kyber-pmm/pool_simulator.go b/pkg/source/kyber-pmm/pool_simulator.go index 42e66c066..0a01c9d1d 100644 --- a/pkg/source/kyber-pmm/pool_simulator.go +++ b/pkg/source/kyber-pmm/pool_simulator.go @@ -1,7 +1,6 @@ package kyberpmm import ( - "encoding/json" "errors" "fmt" "math/big" @@ -9,6 +8,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/float" "github.com/KyberNetwork/blockchain-toolkit/integer" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/kyber-pmm/pool_tracker.go b/pkg/source/kyber-pmm/pool_tracker.go index 1d0ab4ec3..158d8b5bb 100644 --- a/pkg/source/kyber-pmm/pool_tracker.go +++ b/pkg/source/kyber-pmm/pool_tracker.go @@ -2,7 +2,6 @@ package kyberpmm import ( "context" - "encoding/json" "errors" "math/big" "strconv" @@ -10,6 +9,7 @@ import ( "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/kyber-pmm/pools_list_updater.go b/pkg/source/kyber-pmm/pools_list_updater.go index dc2b0a0d0..a4cc5545a 100644 --- a/pkg/source/kyber-pmm/pools_list_updater.go +++ b/pkg/source/kyber-pmm/pools_list_updater.go @@ -2,11 +2,11 @@ package kyberpmm import ( "context" - "encoding/json" "strings" "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/kyber-pmm/rfq.go b/pkg/source/kyber-pmm/rfq.go index bf1fc9504..07ff6e852 100644 --- a/pkg/source/kyber-pmm/rfq.go +++ b/pkg/source/kyber-pmm/rfq.go @@ -2,11 +2,11 @@ package kyberpmm import ( "context" - "encoding/json" "math/big" "github.com/KyberNetwork/blockchain-toolkit/account" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) diff --git a/pkg/source/lido-steth/pools_list_updater.go b/pkg/source/lido-steth/pools_list_updater.go index 7a2a62617..1834cc0f7 100644 --- a/pkg/source/lido-steth/pools_list_updater.go +++ b/pkg/source/lido-steth/pools_list_updater.go @@ -2,12 +2,12 @@ package lido_steth import ( "context" - "encoding/json" "errors" "strings" "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/lido/pool_simulator.go b/pkg/source/lido/pool_simulator.go index 54345d0a1..244ae7f2b 100644 --- a/pkg/source/lido/pool_simulator.go +++ b/pkg/source/lido/pool_simulator.go @@ -1,10 +1,11 @@ package lido import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/lido/pool_tracker.go b/pkg/source/lido/pool_tracker.go index d25c0943b..8493b1a09 100644 --- a/pkg/source/lido/pool_tracker.go +++ b/pkg/source/lido/pool_tracker.go @@ -2,13 +2,13 @@ package lido import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/lido/pools_list_updater.go b/pkg/source/lido/pools_list_updater.go index c162163e4..663b6202a 100644 --- a/pkg/source/lido/pools_list_updater.go +++ b/pkg/source/lido/pools_list_updater.go @@ -2,7 +2,6 @@ package lido import ( "context" - "encoding/json" "errors" "fmt" "math/big" @@ -10,6 +9,7 @@ import ( "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/limitorder/pool_simulator.go b/pkg/source/limitorder/pool_simulator.go index 296f85cbc..ae4ac9d37 100644 --- a/pkg/source/limitorder/pool_simulator.go +++ b/pkg/source/limitorder/pool_simulator.go @@ -1,12 +1,12 @@ package limitorder import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/limitorder/pool_simulator_test.go b/pkg/source/limitorder/pool_simulator_test.go index 500f8c148..96449d1b3 100644 --- a/pkg/source/limitorder/pool_simulator_test.go +++ b/pkg/source/limitorder/pool_simulator_test.go @@ -1,11 +1,11 @@ package limitorder import ( - "encoding/json" "fmt" "math/big" "testing" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/limitorder/pool_tracker.go b/pkg/source/limitorder/pool_tracker.go index af7b15c1a..b8947bb6c 100644 --- a/pkg/source/limitorder/pool_tracker.go +++ b/pkg/source/limitorder/pool_tracker.go @@ -2,12 +2,12 @@ package limitorder import ( "context" - "encoding/json" "errors" "strings" "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "golang.org/x/sync/errgroup" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/limitorder/pools_list_updater.go b/pkg/source/limitorder/pools_list_updater.go index dc83a1f92..91c48bf57 100644 --- a/pkg/source/limitorder/pools_list_updater.go +++ b/pkg/source/limitorder/pools_list_updater.go @@ -2,11 +2,11 @@ package limitorder import ( "context" - "encoding/json" "strings" "github.com/KyberNetwork/logger" mapset "github.com/deckarep/golang-set/v2" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/limitorder/rfq.go b/pkg/source/limitorder/rfq.go index 49d336a2f..4e8513ce3 100644 --- a/pkg/source/limitorder/rfq.go +++ b/pkg/source/limitorder/rfq.go @@ -2,10 +2,10 @@ package limitorder import ( "context" - "encoding/json" "strings" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/liquiditybookv20/pool_simulator.go b/pkg/source/liquiditybookv20/pool_simulator.go index ce57275f1..3d7cf87ce 100644 --- a/pkg/source/liquiditybookv20/pool_simulator.go +++ b/pkg/source/liquiditybookv20/pool_simulator.go @@ -1,13 +1,13 @@ package liquiditybookv20 import ( - "encoding/json" "math/big" "sort" "strings" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/liquiditybookv20/pool_simulator_test.go b/pkg/source/liquiditybookv20/pool_simulator_test.go index 3a4b58285..3d44aa0d0 100644 --- a/pkg/source/liquiditybookv20/pool_simulator_test.go +++ b/pkg/source/liquiditybookv20/pool_simulator_test.go @@ -1,9 +1,9 @@ package liquiditybookv20 import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/liquiditybookv20/pool_tracker.go b/pkg/source/liquiditybookv20/pool_tracker.go index a09ed44e2..4b09b0a6b 100644 --- a/pkg/source/liquiditybookv20/pool_tracker.go +++ b/pkg/source/liquiditybookv20/pool_tracker.go @@ -2,7 +2,6 @@ package liquiditybookv20 import ( "context" - "encoding/json" "math/big" "sort" "strconv" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "golang.org/x/sync/errgroup" diff --git a/pkg/source/liquiditybookv20/pools_list_updater.go b/pkg/source/liquiditybookv20/pools_list_updater.go index 2d9c78576..2e0ae7552 100644 --- a/pkg/source/liquiditybookv20/pools_list_updater.go +++ b/pkg/source/liquiditybookv20/pools_list_updater.go @@ -2,7 +2,6 @@ package liquiditybookv20 import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/liquiditybookv21/pool_simulator.go b/pkg/source/liquiditybookv21/pool_simulator.go index 6bf291612..be8e53176 100644 --- a/pkg/source/liquiditybookv21/pool_simulator.go +++ b/pkg/source/liquiditybookv21/pool_simulator.go @@ -1,13 +1,13 @@ package liquiditybookv21 import ( - "encoding/json" "math/big" "sort" "strings" "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/liquiditybookv21/pool_simulator_test.go b/pkg/source/liquiditybookv21/pool_simulator_test.go index e05e808e9..c5c3f2c5d 100644 --- a/pkg/source/liquiditybookv21/pool_simulator_test.go +++ b/pkg/source/liquiditybookv21/pool_simulator_test.go @@ -1,11 +1,11 @@ package liquiditybookv21 import ( - "encoding/json" "math/big" "testing" "github.com/KyberNetwork/blockchain-toolkit/integer" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/liquiditybookv21/pool_tracker.go b/pkg/source/liquiditybookv21/pool_tracker.go index 8443c43b2..71b3b09e7 100644 --- a/pkg/source/liquiditybookv21/pool_tracker.go +++ b/pkg/source/liquiditybookv21/pool_tracker.go @@ -2,7 +2,6 @@ package liquiditybookv21 import ( "context" - "encoding/json" "math/big" "sort" "strconv" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "golang.org/x/sync/errgroup" diff --git a/pkg/source/liquiditybookv21/pools_list_updater.go b/pkg/source/liquiditybookv21/pools_list_updater.go index ad037aa41..3b8551580 100644 --- a/pkg/source/liquiditybookv21/pools_list_updater.go +++ b/pkg/source/liquiditybookv21/pools_list_updater.go @@ -2,7 +2,6 @@ package liquiditybookv21 import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/madmex/pool_simulator.go b/pkg/source/madmex/pool_simulator.go index de49ec591..fe0c954b0 100644 --- a/pkg/source/madmex/pool_simulator.go +++ b/pkg/source/madmex/pool_simulator.go @@ -1,10 +1,11 @@ package madmex import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" constant "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/madmex/pool_tracker.go b/pkg/source/madmex/pool_tracker.go index 3e9582454..11c2fd6ec 100644 --- a/pkg/source/madmex/pool_tracker.go +++ b/pkg/source/madmex/pool_tracker.go @@ -2,12 +2,12 @@ package madmex import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/madmex/pools_list_updater.go b/pkg/source/madmex/pools_list_updater.go index 2c4278722..8d3d57114 100644 --- a/pkg/source/madmex/pools_list_updater.go +++ b/pkg/source/madmex/pools_list_updater.go @@ -2,12 +2,12 @@ package madmex import ( "context" - "encoding/json" "errors" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/madmex/vault_price_feed.go b/pkg/source/madmex/vault_price_feed.go index d82586557..b800c9391 100644 --- a/pkg/source/madmex/vault_price_feed.go +++ b/pkg/source/madmex/vault_price_feed.go @@ -1,11 +1,12 @@ package madmex import ( - "encoding/json" "math/big" - constant "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + constant "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type VaultPriceFeed struct { diff --git a/pkg/source/makerpsm/pool_simulator.go b/pkg/source/makerpsm/pool_simulator.go index 32a0bc440..2d4cb3e41 100644 --- a/pkg/source/makerpsm/pool_simulator.go +++ b/pkg/source/makerpsm/pool_simulator.go @@ -1,10 +1,11 @@ package makerpsm import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) diff --git a/pkg/source/makerpsm/pool_tracker.go b/pkg/source/makerpsm/pool_tracker.go index a0a34e2fa..d711b6215 100644 --- a/pkg/source/makerpsm/pool_tracker.go +++ b/pkg/source/makerpsm/pool_tracker.go @@ -2,17 +2,17 @@ package makerpsm import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/source/makerpsm/pools_list_updater.go b/pkg/source/makerpsm/pools_list_updater.go index bf058b2ab..400b50e05 100644 --- a/pkg/source/makerpsm/pools_list_updater.go +++ b/pkg/source/makerpsm/pools_list_updater.go @@ -2,12 +2,12 @@ package makerpsm import ( "context" - "encoding/json" "fmt" "strings" "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/mantisswap/pool_simulator.go b/pkg/source/mantisswap/pool_simulator.go index 0a9b41565..c85b8dee3 100644 --- a/pkg/source/mantisswap/pool_simulator.go +++ b/pkg/source/mantisswap/pool_simulator.go @@ -1,10 +1,10 @@ package mantisswap import ( - "encoding/json" "fmt" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/mantisswap/pool_simulator_test.go b/pkg/source/mantisswap/pool_simulator_test.go index 3e3294270..b2c59fb1b 100644 --- a/pkg/source/mantisswap/pool_simulator_test.go +++ b/pkg/source/mantisswap/pool_simulator_test.go @@ -1,9 +1,9 @@ package mantisswap import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/mantisswap/pool_tracker.go b/pkg/source/mantisswap/pool_tracker.go index dbf40ab2a..4268d70a7 100644 --- a/pkg/source/mantisswap/pool_tracker.go +++ b/pkg/source/mantisswap/pool_tracker.go @@ -2,13 +2,14 @@ package mantisswap import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/KyberNetwork/logger" ) type PoolTracker struct { diff --git a/pkg/source/mantisswap/pools_list_updater.go b/pkg/source/mantisswap/pools_list_updater.go index 05955947c..147bad9be 100644 --- a/pkg/source/mantisswap/pools_list_updater.go +++ b/pkg/source/mantisswap/pools_list_updater.go @@ -2,15 +2,17 @@ package mantisswap import ( "context" - "encoding/json" - "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" - "github.com/KyberNetwork/logger" - "github.com/ethereum/go-ethereum/common" "math/big" "strings" "time" + + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" ) type PoolsListUpdater struct { diff --git a/pkg/source/maverickv1/pool_list_updater.go b/pkg/source/maverickv1/pool_list_updater.go index a2fee6587..4e2fa9a81 100644 --- a/pkg/source/maverickv1/pool_list_updater.go +++ b/pkg/source/maverickv1/pool_list_updater.go @@ -2,13 +2,13 @@ package maverickv1 import ( "context" - "encoding/json" "fmt" "strconv" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/maverickv1/pool_simulator.go b/pkg/source/maverickv1/pool_simulator.go index 1bab913c4..417663a54 100644 --- a/pkg/source/maverickv1/pool_simulator.go +++ b/pkg/source/maverickv1/pool_simulator.go @@ -1,12 +1,12 @@ package maverickv1 import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/maverickv1/pool_simulator_test.go b/pkg/source/maverickv1/pool_simulator_test.go index bb121c273..268a01a1d 100644 --- a/pkg/source/maverickv1/pool_simulator_test.go +++ b/pkg/source/maverickv1/pool_simulator_test.go @@ -1,12 +1,12 @@ package maverickv1 import ( - "encoding/json" "errors" "fmt" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/maverickv1/pool_tracker.go b/pkg/source/maverickv1/pool_tracker.go index 37fe541e1..35fc949fb 100644 --- a/pkg/source/maverickv1/pool_tracker.go +++ b/pkg/source/maverickv1/pool_tracker.go @@ -2,18 +2,19 @@ package maverickv1 import ( "context" - "encoding/json" "math/big" "strconv" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/sourcegraph/conc/pool" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/source/metavault/pool_simulator.go b/pkg/source/metavault/pool_simulator.go index e766b370a..734b6bac9 100644 --- a/pkg/source/metavault/pool_simulator.go +++ b/pkg/source/metavault/pool_simulator.go @@ -1,10 +1,11 @@ package metavault import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" constant "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/metavault/pool_tracker.go b/pkg/source/metavault/pool_tracker.go index 29684ddbe..30f4dd0c4 100644 --- a/pkg/source/metavault/pool_tracker.go +++ b/pkg/source/metavault/pool_tracker.go @@ -2,12 +2,12 @@ package metavault import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/metavault/pools_list_updater.go b/pkg/source/metavault/pools_list_updater.go index bb23aab5f..8850b3065 100644 --- a/pkg/source/metavault/pools_list_updater.go +++ b/pkg/source/metavault/pools_list_updater.go @@ -2,12 +2,12 @@ package metavault import ( "context" - "encoding/json" "errors" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/metavault/vault_price_feed.go b/pkg/source/metavault/vault_price_feed.go index c50840703..d2bc7f226 100644 --- a/pkg/source/metavault/vault_price_feed.go +++ b/pkg/source/metavault/vault_price_feed.go @@ -1,11 +1,12 @@ package metavault import ( - "encoding/json" "math/big" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type VaultPriceFeed struct { diff --git a/pkg/source/muteswitch/pools_list_updater.go b/pkg/source/muteswitch/pools_list_updater.go index af671fdce..2ae7faffc 100644 --- a/pkg/source/muteswitch/pools_list_updater.go +++ b/pkg/source/muteswitch/pools_list_updater.go @@ -2,7 +2,6 @@ package muteswitch import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/nerve/pool_tracker.go b/pkg/source/nerve/pool_tracker.go index 4d87fd5df..20e4e7646 100644 --- a/pkg/source/nerve/pool_tracker.go +++ b/pkg/source/nerve/pool_tracker.go @@ -2,13 +2,13 @@ package nerve import ( "context" - "encoding/json" "fmt" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/nerve/pools_list_updater.go b/pkg/source/nerve/pools_list_updater.go index 014388a78..5f6933a6e 100644 --- a/pkg/source/nerve/pools_list_updater.go +++ b/pkg/source/nerve/pools_list_updater.go @@ -2,12 +2,12 @@ package nerve import ( "context" - "encoding/json" "errors" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/nuriv2/pool_simulator.go b/pkg/source/nuriv2/pool_simulator.go index 2f2271c37..137033c4a 100644 --- a/pkg/source/nuriv2/pool_simulator.go +++ b/pkg/source/nuriv2/pool_simulator.go @@ -1,7 +1,6 @@ package nuriv2 import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Entities "github.com/daoleno/uniswapv3-sdk/entities" v3Utils "github.com/daoleno/uniswapv3-sdk/utils" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/nuriv2/pools_list_updater.go b/pkg/source/nuriv2/pools_list_updater.go index e8eaaf387..25228f954 100644 --- a/pkg/source/nuriv2/pools_list_updater.go +++ b/pkg/source/nuriv2/pools_list_updater.go @@ -2,7 +2,6 @@ package nuriv2 import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/samber/lo" diff --git a/pkg/source/oneswap/pool_tracker.go b/pkg/source/oneswap/pool_tracker.go index 8b40ee3e9..7eb519e93 100644 --- a/pkg/source/oneswap/pool_tracker.go +++ b/pkg/source/oneswap/pool_tracker.go @@ -2,13 +2,13 @@ package oneswap import ( "context" - "encoding/json" "fmt" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/oneswap/pools_list_updater.go b/pkg/source/oneswap/pools_list_updater.go index 1c216c3f8..d917e9baa 100644 --- a/pkg/source/oneswap/pools_list_updater.go +++ b/pkg/source/oneswap/pools_list_updater.go @@ -2,7 +2,6 @@ package oneswap import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/pancakev3/pool_simulator.go b/pkg/source/pancakev3/pool_simulator.go index 677e01238..faca4644e 100644 --- a/pkg/source/pancakev3/pool_simulator.go +++ b/pkg/source/pancakev3/pool_simulator.go @@ -1,7 +1,6 @@ package pancakev3 import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Utils "github.com/KyberNetwork/uniswapv3-sdk-uint256/utils" coreEntities "github.com/daoleno/uniswap-sdk-core/entities" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/pancakev3/pool_simulator_bigint.go b/pkg/source/pancakev3/pool_simulator_bigint.go index 847edd1b0..7c567afc3 100644 --- a/pkg/source/pancakev3/pool_simulator_bigint.go +++ b/pkg/source/pancakev3/pool_simulator_bigint.go @@ -1,7 +1,6 @@ package pancakev3 import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Utils "github.com/KyberNetwork/pancake-v3-sdk/utils" coreEntities "github.com/daoleno/uniswap-sdk-core/entities" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/pancakev3/pool_simulator_test.go b/pkg/source/pancakev3/pool_simulator_test.go index df7dc8fae..0a71aa36a 100644 --- a/pkg/source/pancakev3/pool_simulator_test.go +++ b/pkg/source/pancakev3/pool_simulator_test.go @@ -1,11 +1,11 @@ package pancakev3 import ( - "encoding/json" "fmt" "math/rand" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/pancakev3/pool_tracker.go b/pkg/source/pancakev3/pool_tracker.go index 96beccb42..45d0c01b2 100644 --- a/pkg/source/pancakev3/pool_tracker.go +++ b/pkg/source/pancakev3/pool_tracker.go @@ -2,13 +2,13 @@ package pancakev3 import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/sourcegraph/conc/pool" diff --git a/pkg/source/pancakev3/pools_list_updater.go b/pkg/source/pancakev3/pools_list_updater.go index e61cdf5a4..0b84edab3 100644 --- a/pkg/source/pancakev3/pools_list_updater.go +++ b/pkg/source/pancakev3/pools_list_updater.go @@ -2,7 +2,6 @@ package pancakev3 import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/samber/lo" diff --git a/pkg/source/pearl/helper.go b/pkg/source/pearl/helper.go index 12a4fa637..b64287979 100644 --- a/pkg/source/pearl/helper.go +++ b/pkg/source/pearl/helper.go @@ -1,6 +1,6 @@ package pearl -import "encoding/json" +import "github.com/goccy/go-json" func extractStaticExtra(s string) (staticExtra StaticExtra, err error) { err = json.Unmarshal([]byte(s), &staticExtra) diff --git a/pkg/source/pearl/pools_list_updater.go b/pkg/source/pearl/pools_list_updater.go index 69ba795cf..ab63956f6 100644 --- a/pkg/source/pearl/pools_list_updater.go +++ b/pkg/source/pearl/pools_list_updater.go @@ -2,7 +2,6 @@ package pearl import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/platypus/pool_simulator.go b/pkg/source/platypus/pool_simulator.go index af1ae9354..e49ffb486 100644 --- a/pkg/source/platypus/pool_simulator.go +++ b/pkg/source/platypus/pool_simulator.go @@ -1,10 +1,11 @@ package platypus import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/platypus/pool_tracker.go b/pkg/source/platypus/pool_tracker.go index 2e2d1e838..c3ee13a13 100644 --- a/pkg/source/platypus/pool_tracker.go +++ b/pkg/source/platypus/pool_tracker.go @@ -2,7 +2,6 @@ package platypus import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/platypus/pools_list_updater.go b/pkg/source/platypus/pools_list_updater.go index d29069ce8..ddc590436 100644 --- a/pkg/source/platypus/pools_list_updater.go +++ b/pkg/source/platypus/pools_list_updater.go @@ -2,7 +2,6 @@ package platypus import ( "context" - "encoding/json" "fmt" "math/big" "strings" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/samber/lo" diff --git a/pkg/source/pol-matic/pool_list_updater.go b/pkg/source/pol-matic/pool_list_updater.go index b86853106..c6c332b03 100644 --- a/pkg/source/pol-matic/pool_list_updater.go +++ b/pkg/source/pol-matic/pool_list_updater.go @@ -2,7 +2,6 @@ package polmatic import ( "context" - "encoding/json" "errors" "strings" "time" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/pol-matic/pool_simulator_test.go b/pkg/source/pol-matic/pool_simulator_test.go index c8a3cf5b6..f44882055 100644 --- a/pkg/source/pol-matic/pool_simulator_test.go +++ b/pkg/source/pol-matic/pool_simulator_test.go @@ -1,9 +1,9 @@ package polmatic import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/polydex/pools_list_updater.go b/pkg/source/polydex/pools_list_updater.go index 962377afd..cf25ed9bc 100644 --- a/pkg/source/polydex/pools_list_updater.go +++ b/pkg/source/polydex/pools_list_updater.go @@ -2,7 +2,6 @@ package polydex import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/quickperps/pool_simulator.go b/pkg/source/quickperps/pool_simulator.go index af5c0aec4..1b02f18a5 100644 --- a/pkg/source/quickperps/pool_simulator.go +++ b/pkg/source/quickperps/pool_simulator.go @@ -1,10 +1,11 @@ package quickperps import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/quickperps/pool_simulator_test.go b/pkg/source/quickperps/pool_simulator_test.go index 32662872a..8564b5055 100644 --- a/pkg/source/quickperps/pool_simulator_test.go +++ b/pkg/source/quickperps/pool_simulator_test.go @@ -1,11 +1,11 @@ package quickperps import ( - "encoding/json" "math/big" "testing" "time" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/quickperps/pool_tracker.go b/pkg/source/quickperps/pool_tracker.go index 3a3898d49..1b6df85b8 100644 --- a/pkg/source/quickperps/pool_tracker.go +++ b/pkg/source/quickperps/pool_tracker.go @@ -2,12 +2,12 @@ package quickperps import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/quickperps/pools_list_updater.go b/pkg/source/quickperps/pools_list_updater.go index 8b4aa4c7f..36ab15b91 100644 --- a/pkg/source/quickperps/pools_list_updater.go +++ b/pkg/source/quickperps/pools_list_updater.go @@ -2,11 +2,11 @@ package quickperps import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/quickperps/vault_price_feed.go b/pkg/source/quickperps/vault_price_feed.go index be8cff7b0..0aafabddc 100644 --- a/pkg/source/quickperps/vault_price_feed.go +++ b/pkg/source/quickperps/vault_price_feed.go @@ -1,12 +1,13 @@ package quickperps import ( - "encoding/json" "math/big" "time" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type VaultPriceFeed struct { diff --git a/pkg/source/ramses/pool_tracker.go b/pkg/source/ramses/pool_tracker.go index 3e350ef27..f415c7430 100644 --- a/pkg/source/ramses/pool_tracker.go +++ b/pkg/source/ramses/pool_tracker.go @@ -2,14 +2,13 @@ package ramses import ( "context" - "encoding/json" "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/ramses/pools_list_updater.go b/pkg/source/ramses/pools_list_updater.go index 6ac5ccb96..857f680d0 100644 --- a/pkg/source/ramses/pools_list_updater.go +++ b/pkg/source/ramses/pools_list_updater.go @@ -2,7 +2,6 @@ package ramses import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/ramsesv2/pool_simulator.go b/pkg/source/ramsesv2/pool_simulator.go index 6317362e9..405b4815d 100644 --- a/pkg/source/ramsesv2/pool_simulator.go +++ b/pkg/source/ramsesv2/pool_simulator.go @@ -1,7 +1,6 @@ package ramsesv2 import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Entities "github.com/daoleno/uniswapv3-sdk/entities" v3Utils "github.com/daoleno/uniswapv3-sdk/utils" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/ramsesv2/pools_list_updater.go b/pkg/source/ramsesv2/pools_list_updater.go index 73b6261c7..246d03c1f 100644 --- a/pkg/source/ramsesv2/pools_list_updater.go +++ b/pkg/source/ramsesv2/pools_list_updater.go @@ -2,7 +2,6 @@ package ramsesv2 import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/samber/lo" diff --git a/pkg/source/saddle/pool_simulator.go b/pkg/source/saddle/pool_simulator.go index e2078d88a..fd8cbe60c 100644 --- a/pkg/source/saddle/pool_simulator.go +++ b/pkg/source/saddle/pool_simulator.go @@ -1,11 +1,12 @@ package saddle import ( - "encoding/json" "errors" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" constant "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/saddle/pool_tracker.go b/pkg/source/saddle/pool_tracker.go index ab096b51d..35b9437c9 100644 --- a/pkg/source/saddle/pool_tracker.go +++ b/pkg/source/saddle/pool_tracker.go @@ -2,17 +2,17 @@ package saddle import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/source/saddle/pools_list_updater.go b/pkg/source/saddle/pools_list_updater.go index 297266af9..7433b28a5 100644 --- a/pkg/source/saddle/pools_list_updater.go +++ b/pkg/source/saddle/pools_list_updater.go @@ -2,13 +2,13 @@ package saddle import ( "context" - "encoding/json" "errors" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/slipstream/pool_simulator.go b/pkg/source/slipstream/pool_simulator.go index a81131c92..a53ded9df 100644 --- a/pkg/source/slipstream/pool_simulator.go +++ b/pkg/source/slipstream/pool_simulator.go @@ -1,7 +1,6 @@ package slipstream import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Utils "github.com/KyberNetwork/uniswapv3-sdk-uint256/utils" coreEntities "github.com/daoleno/uniswap-sdk-core/entities" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/slipstream/pool_simulator_test.go b/pkg/source/slipstream/pool_simulator_test.go index 278fef5a1..dbe5816b3 100644 --- a/pkg/source/slipstream/pool_simulator_test.go +++ b/pkg/source/slipstream/pool_simulator_test.go @@ -1,10 +1,10 @@ package slipstream import ( - "encoding/json" "fmt" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/slipstream/pools_list_updater.go b/pkg/source/slipstream/pools_list_updater.go index 646be8e8a..23ea3bd0f 100644 --- a/pkg/source/slipstream/pools_list_updater.go +++ b/pkg/source/slipstream/pools_list_updater.go @@ -2,7 +2,6 @@ package slipstream import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/samber/lo" diff --git a/pkg/source/smardex/pool_list_updater.go b/pkg/source/smardex/pool_list_updater.go index 6145bc564..154a4fc80 100644 --- a/pkg/source/smardex/pool_list_updater.go +++ b/pkg/source/smardex/pool_list_updater.go @@ -2,15 +2,16 @@ package smardex import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) type ( diff --git a/pkg/source/smardex/pool_list_updater_test.go b/pkg/source/smardex/pool_list_updater_test.go index 0ba746f54..7d0379ba9 100644 --- a/pkg/source/smardex/pool_list_updater_test.go +++ b/pkg/source/smardex/pool_list_updater_test.go @@ -2,12 +2,12 @@ package smardex import ( "context" - "encoding/json" "math/big" "testing" "github.com/KyberNetwork/ethrpc" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" ) diff --git a/pkg/source/smardex/pool_simulator.go b/pkg/source/smardex/pool_simulator.go index fe12fd19c..c259318b4 100644 --- a/pkg/source/smardex/pool_simulator.go +++ b/pkg/source/smardex/pool_simulator.go @@ -1,11 +1,11 @@ package smardex import ( - "encoding/json" "math/big" "time" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" poolpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/smardex/pool_simulator_test.go b/pkg/source/smardex/pool_simulator_test.go index 97ea1577d..f8f6599fc 100644 --- a/pkg/source/smardex/pool_simulator_test.go +++ b/pkg/source/smardex/pool_simulator_test.go @@ -1,11 +1,11 @@ package smardex import ( - "encoding/json" "math/big" "testing" "time" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/smardex/pool_tracker.go b/pkg/source/smardex/pool_tracker.go index 97dba7382..130ba517d 100644 --- a/pkg/source/smardex/pool_tracker.go +++ b/pkg/source/smardex/pool_tracker.go @@ -2,16 +2,17 @@ package smardex import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/source/smardex/pool_tracker_test.go b/pkg/source/smardex/pool_tracker_test.go index 3e5cc7da2..dc600f3ba 100644 --- a/pkg/source/smardex/pool_tracker_test.go +++ b/pkg/source/smardex/pool_tracker_test.go @@ -2,15 +2,16 @@ package smardex import ( "context" - "encoding/json" "testing" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolListTrackerTestSuite struct { diff --git a/pkg/source/solidly-v3/pool_simulator.go b/pkg/source/solidly-v3/pool_simulator.go index 13338cd4c..78951000b 100644 --- a/pkg/source/solidly-v3/pool_simulator.go +++ b/pkg/source/solidly-v3/pool_simulator.go @@ -1,7 +1,6 @@ package solidlyv3 import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Entities "github.com/daoleno/uniswapv3-sdk/entities" v3Utils "github.com/daoleno/uniswapv3-sdk/utils" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/solidly-v3/pool_simulator_test.go b/pkg/source/solidly-v3/pool_simulator_test.go index fa52fd792..3bd14a49f 100644 --- a/pkg/source/solidly-v3/pool_simulator_test.go +++ b/pkg/source/solidly-v3/pool_simulator_test.go @@ -1,10 +1,10 @@ package solidlyv3 import ( - "encoding/json" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/solidly-v3/pools_list_updater.go b/pkg/source/solidly-v3/pools_list_updater.go index 62d5e933f..eb50b1c13 100644 --- a/pkg/source/solidly-v3/pools_list_updater.go +++ b/pkg/source/solidly-v3/pools_list_updater.go @@ -2,7 +2,6 @@ package solidlyv3 import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/samber/lo" diff --git a/pkg/source/swapbased-perp/pool_simulator.go b/pkg/source/swapbased-perp/pool_simulator.go index cbd2f1879..4f34e550e 100644 --- a/pkg/source/swapbased-perp/pool_simulator.go +++ b/pkg/source/swapbased-perp/pool_simulator.go @@ -1,10 +1,11 @@ package swapbasedperp import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/swapbased-perp/pool_tracker.go b/pkg/source/swapbased-perp/pool_tracker.go index 187cc1275..e79d81320 100644 --- a/pkg/source/swapbased-perp/pool_tracker.go +++ b/pkg/source/swapbased-perp/pool_tracker.go @@ -2,12 +2,12 @@ package swapbasedperp import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/swapbased-perp/pools_list_updater.go b/pkg/source/swapbased-perp/pools_list_updater.go index 8814e146e..4a32382d5 100644 --- a/pkg/source/swapbased-perp/pools_list_updater.go +++ b/pkg/source/swapbased-perp/pools_list_updater.go @@ -2,11 +2,11 @@ package swapbasedperp import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/swapbased-perp/vault_price_feed.go b/pkg/source/swapbased-perp/vault_price_feed.go index 9417e1d06..af4dd6cb5 100644 --- a/pkg/source/swapbased-perp/vault_price_feed.go +++ b/pkg/source/swapbased-perp/vault_price_feed.go @@ -1,11 +1,12 @@ package swapbasedperp import ( - "encoding/json" "math/big" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" ) type VaultPriceFeed struct { diff --git a/pkg/source/syncswap/pool_tracker.go b/pkg/source/syncswap/pool_tracker.go index cc67b99c6..cbc6694f6 100644 --- a/pkg/source/syncswap/pool_tracker.go +++ b/pkg/source/syncswap/pool_tracker.go @@ -2,7 +2,6 @@ package syncswap import ( "context" - "encoding/json" "fmt" "math/big" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/syncswap/pools_list_updater.go b/pkg/source/syncswap/pools_list_updater.go index 72d9333e4..693b58613 100644 --- a/pkg/source/syncswap/pools_list_updater.go +++ b/pkg/source/syncswap/pools_list_updater.go @@ -6,13 +6,13 @@ import ( "strings" "time" - "encoding/json" - "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" ) type PoolsListUpdater struct { diff --git a/pkg/source/syncswap/syncswapclassic/pool_simulator.go b/pkg/source/syncswap/syncswapclassic/pool_simulator.go index 3126371e2..e475c2b5d 100644 --- a/pkg/source/syncswap/syncswapclassic/pool_simulator.go +++ b/pkg/source/syncswap/syncswapclassic/pool_simulator.go @@ -1,12 +1,12 @@ package syncswapclassic import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/integer" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/syncswap/syncswapstable/pool_simulator.go b/pkg/source/syncswap/syncswapstable/pool_simulator.go index d3f27c484..7e4e4d559 100644 --- a/pkg/source/syncswap/syncswapstable/pool_simulator.go +++ b/pkg/source/syncswap/syncswapstable/pool_simulator.go @@ -1,12 +1,12 @@ package syncswapstable import ( - "encoding/json" "fmt" "math/big" "strings" "github.com/KyberNetwork/blockchain-toolkit/integer" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/synthetix/pool_simulator.go b/pkg/source/synthetix/pool_simulator.go index ae50daab3..c2d0f91e6 100644 --- a/pkg/source/synthetix/pool_simulator.go +++ b/pkg/source/synthetix/pool_simulator.go @@ -1,7 +1,6 @@ package synthetix import ( - "encoding/json" "errors" "fmt" "math/big" @@ -9,6 +8,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/synthetix/pool_tracker.go b/pkg/source/synthetix/pool_tracker.go index 31fc9816f..0fe66d527 100644 --- a/pkg/source/synthetix/pool_tracker.go +++ b/pkg/source/synthetix/pool_tracker.go @@ -2,7 +2,6 @@ package synthetix import ( "context" - "encoding/json" "fmt" "math/big" "strings" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/traderjoecommon/pools_list_updater.go b/pkg/source/traderjoecommon/pools_list_updater.go index 89f175250..1b52e581e 100644 --- a/pkg/source/traderjoecommon/pools_list_updater.go +++ b/pkg/source/traderjoecommon/pools_list_updater.go @@ -2,7 +2,6 @@ package traderjoecommon import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/traderjoev20/pool_test.go b/pkg/source/traderjoev20/pool_test.go index 5c5a167a6..6f9b8d1a8 100644 --- a/pkg/source/traderjoev20/pool_test.go +++ b/pkg/source/traderjoev20/pool_test.go @@ -2,15 +2,15 @@ package traderjoev20 import ( "context" - "encoding/json" "fmt" "testing" + "github.com/KyberNetwork/ethrpc" "github.com/davecgh/go-spew/spew" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" - "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/traderjoecommon" diff --git a/pkg/source/traderjoev20/pool_tracker.go b/pkg/source/traderjoev20/pool_tracker.go index 80918ed8b..3763193e9 100644 --- a/pkg/source/traderjoev20/pool_tracker.go +++ b/pkg/source/traderjoev20/pool_tracker.go @@ -2,13 +2,13 @@ package traderjoev20 import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/traderjoev21/pool_test.go b/pkg/source/traderjoev21/pool_test.go index 173f5d97d..6b26610fa 100644 --- a/pkg/source/traderjoev21/pool_test.go +++ b/pkg/source/traderjoev21/pool_test.go @@ -2,15 +2,15 @@ package traderjoev21 import ( "context" - "encoding/json" "fmt" "testing" + "github.com/KyberNetwork/ethrpc" "github.com/davecgh/go-spew/spew" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" - "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" sourcePool "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/traderjoecommon" diff --git a/pkg/source/traderjoev21/pool_tracker.go b/pkg/source/traderjoev21/pool_tracker.go index 9594a97b5..163cac0e4 100644 --- a/pkg/source/traderjoev21/pool_tracker.go +++ b/pkg/source/traderjoev21/pool_tracker.go @@ -2,12 +2,12 @@ package traderjoev21 import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/uniswap/pool_simulator_test.go b/pkg/source/uniswap/pool_simulator_test.go index 80c3e66ca..faeeac338 100644 --- a/pkg/source/uniswap/pool_simulator_test.go +++ b/pkg/source/uniswap/pool_simulator_test.go @@ -1,9 +1,9 @@ package uniswap import ( - "encoding/json" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/uniswap/pools_list_updater.go b/pkg/source/uniswap/pools_list_updater.go index d112e5cb9..38f187159 100644 --- a/pkg/source/uniswap/pools_list_updater.go +++ b/pkg/source/uniswap/pools_list_updater.go @@ -2,7 +2,6 @@ package uniswap import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/uniswapv3/bench_test.go b/pkg/source/uniswapv3/bench_test.go index 6e9e9adcf..a9327ac97 100644 --- a/pkg/source/uniswapv3/bench_test.go +++ b/pkg/source/uniswapv3/bench_test.go @@ -1,11 +1,12 @@ package uniswapv3 import ( - "encoding/json" "fmt" "math/big" "testing" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/uniswapv3/pool_simulator.go b/pkg/source/uniswapv3/pool_simulator.go index e2d825849..c696cc78f 100644 --- a/pkg/source/uniswapv3/pool_simulator.go +++ b/pkg/source/uniswapv3/pool_simulator.go @@ -1,7 +1,6 @@ package uniswapv3 import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Utils "github.com/KyberNetwork/uniswapv3-sdk-uint256/utils" coreEntities "github.com/daoleno/uniswap-sdk-core/entities" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/holiman/uint256" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/uniswapv3/pool_simulator_bigint.go b/pkg/source/uniswapv3/pool_simulator_bigint.go index 03d339c72..948c54e8d 100644 --- a/pkg/source/uniswapv3/pool_simulator_bigint.go +++ b/pkg/source/uniswapv3/pool_simulator_bigint.go @@ -1,7 +1,6 @@ package uniswapv3 import ( - "encoding/json" "errors" "fmt" "math/big" @@ -13,6 +12,7 @@ import ( v3Entities "github.com/daoleno/uniswapv3-sdk/entities" v3Utils "github.com/daoleno/uniswapv3-sdk/utils" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/uniswapv3/pool_simulator_bigint_test.go b/pkg/source/uniswapv3/pool_simulator_bigint_test.go index 04b9bf61e..380f14e5e 100644 --- a/pkg/source/uniswapv3/pool_simulator_bigint_test.go +++ b/pkg/source/uniswapv3/pool_simulator_bigint_test.go @@ -1,10 +1,10 @@ package uniswapv3 import ( - "encoding/json" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/uniswapv3/pool_simulator_test.go b/pkg/source/uniswapv3/pool_simulator_test.go index 3066a43bb..def94cdd6 100644 --- a/pkg/source/uniswapv3/pool_simulator_test.go +++ b/pkg/source/uniswapv3/pool_simulator_test.go @@ -1,11 +1,11 @@ package uniswapv3 import ( - "encoding/json" "fmt" "math/rand" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/uniswapv3/pools_list_updater.go b/pkg/source/uniswapv3/pools_list_updater.go index 4fc4c55db..e84df76c5 100644 --- a/pkg/source/uniswapv3/pools_list_updater.go +++ b/pkg/source/uniswapv3/pools_list_updater.go @@ -2,7 +2,6 @@ package uniswapv3 import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -11,6 +10,7 @@ import ( "github.com/KyberNetwork/blockchain-toolkit/integer" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/samber/lo" diff --git a/pkg/source/usdfi/helper.go b/pkg/source/usdfi/helper.go index 1d89b499e..c839d5865 100644 --- a/pkg/source/usdfi/helper.go +++ b/pkg/source/usdfi/helper.go @@ -1,6 +1,6 @@ package usdfi -import "encoding/json" +import "github.com/goccy/go-json" func extractStaticExtra(s string) (staticExtra StaticExtra, err error) { err = json.Unmarshal([]byte(s), &staticExtra) diff --git a/pkg/source/usdfi/pool_tracker.go b/pkg/source/usdfi/pool_tracker.go index a40835583..546b0039c 100644 --- a/pkg/source/usdfi/pool_tracker.go +++ b/pkg/source/usdfi/pool_tracker.go @@ -2,12 +2,12 @@ package usdfi import ( "context" - "encoding/json" "math/big" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/usdfi/pools_list_updater.go b/pkg/source/usdfi/pools_list_updater.go index b2a233f65..c30bd654f 100644 --- a/pkg/source/usdfi/pools_list_updater.go +++ b/pkg/source/usdfi/pools_list_updater.go @@ -2,7 +2,6 @@ package usdfi import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/velocimeter/helper.go b/pkg/source/velocimeter/helper.go index d5bea12c8..6c1fc0184 100644 --- a/pkg/source/velocimeter/helper.go +++ b/pkg/source/velocimeter/helper.go @@ -1,6 +1,6 @@ package velocimeter -import "encoding/json" +import "github.com/goccy/go-json" func extractStaticExtra(s string) (staticExtra StaticExtra, err error) { err = json.Unmarshal([]byte(s), &staticExtra) diff --git a/pkg/source/velocimeter/pools_list_updater.go b/pkg/source/velocimeter/pools_list_updater.go index 3556a1e65..93365edcf 100644 --- a/pkg/source/velocimeter/pools_list_updater.go +++ b/pkg/source/velocimeter/pools_list_updater.go @@ -2,7 +2,6 @@ package velocimeter import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/velodrome/helper.go b/pkg/source/velodrome/helper.go index ecb051719..70451ffb5 100644 --- a/pkg/source/velodrome/helper.go +++ b/pkg/source/velodrome/helper.go @@ -1,6 +1,6 @@ package velodrome -import "encoding/json" +import "github.com/goccy/go-json" func extractStaticExtra(s string) (staticExtra StaticExtra, err error) { err = json.Unmarshal([]byte(s), &staticExtra) diff --git a/pkg/source/velodrome/pools_list_updater.go b/pkg/source/velodrome/pools_list_updater.go index ab55c9ee0..fd01c64d0 100644 --- a/pkg/source/velodrome/pools_list_updater.go +++ b/pkg/source/velodrome/pools_list_updater.go @@ -2,7 +2,6 @@ package velodrome import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/velodromev2/helper.go b/pkg/source/velodromev2/helper.go index d1b6e76e5..b2cb7b2c3 100644 --- a/pkg/source/velodromev2/helper.go +++ b/pkg/source/velodromev2/helper.go @@ -1,6 +1,6 @@ package velodromev2 -import "encoding/json" +import "github.com/goccy/go-json" func extractStaticExtra(s string) (staticExtra StaticExtra, err error) { err = json.Unmarshal([]byte(s), &staticExtra) diff --git a/pkg/source/velodromev2/pools_list_updater.go b/pkg/source/velodromev2/pools_list_updater.go index af4ab6c8e..ee3896be8 100644 --- a/pkg/source/velodromev2/pools_list_updater.go +++ b/pkg/source/velodromev2/pools_list_updater.go @@ -2,7 +2,6 @@ package velodromev2 import ( "context" - "encoding/json" "math/big" "strings" "time" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util" diff --git a/pkg/source/vooi/pool_list_updater.go b/pkg/source/vooi/pool_list_updater.go index 3e63e5725..5cc68da35 100644 --- a/pkg/source/vooi/pool_list_updater.go +++ b/pkg/source/vooi/pool_list_updater.go @@ -2,7 +2,6 @@ package vooi import ( "context" - "encoding/json" "errors" "math/big" "strings" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/vooi/pool_simulator.go b/pkg/source/vooi/pool_simulator.go index 4795433ea..35ba5f553 100644 --- a/pkg/source/vooi/pool_simulator.go +++ b/pkg/source/vooi/pool_simulator.go @@ -1,14 +1,14 @@ package vooi import ( - "encoding/json" "errors" - "github.com/KyberNetwork/logger" "math/big" "github.com/KyberNetwork/blockchain-toolkit/dsmath" "github.com/KyberNetwork/blockchain-toolkit/integer" + "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/goccy/go-json" "github.com/samber/lo" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/vooi/pool_tracker.go b/pkg/source/vooi/pool_tracker.go index 15b32e2fc..c64237cfe 100644 --- a/pkg/source/vooi/pool_tracker.go +++ b/pkg/source/vooi/pool_tracker.go @@ -2,13 +2,13 @@ package vooi import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/wombat/pool_tracker.go b/pkg/source/wombat/pool_tracker.go index 0aa4cadc2..12229cb1b 100644 --- a/pkg/source/wombat/pool_tracker.go +++ b/pkg/source/wombat/pool_tracker.go @@ -2,7 +2,6 @@ package wombat import ( "context" - "encoding/json" "fmt" "math/big" "strings" @@ -12,6 +11,8 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" @@ -19,7 +20,6 @@ import ( "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/eth" graphqlpkg "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" - "github.com/ethereum/go-ethereum/ethclient/gethclient" ) type PoolTracker struct { diff --git a/pkg/source/wombat/pools_list_updater.go b/pkg/source/wombat/pools_list_updater.go index 5b1ffb21c..5d0533908 100644 --- a/pkg/source/wombat/pools_list_updater.go +++ b/pkg/source/wombat/pools_list_updater.go @@ -2,7 +2,6 @@ package wombat import ( "context" - "encoding/json" "fmt" "math/big" "strconv" @@ -10,6 +9,7 @@ import ( "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/machinebox/graphql" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/wombat/wombatlsd/pool_simulator.go b/pkg/source/wombat/wombatlsd/pool_simulator.go index e49f2bb0f..4e0a4fe88 100644 --- a/pkg/source/wombat/wombatlsd/pool_simulator.go +++ b/pkg/source/wombat/wombatlsd/pool_simulator.go @@ -1,11 +1,12 @@ package wombatlsd import ( - "encoding/json" "fmt" - "github.com/KyberNetwork/logger" "math/big" + "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/wombat" diff --git a/pkg/source/wombat/wombatlsd/pool_simulator_test.go b/pkg/source/wombat/wombatlsd/pool_simulator_test.go index 90b46f73b..4f50446b7 100644 --- a/pkg/source/wombat/wombatlsd/pool_simulator_test.go +++ b/pkg/source/wombat/wombatlsd/pool_simulator_test.go @@ -1,10 +1,10 @@ package wombatlsd import ( - "encoding/json" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/wombat/wombatmain/pool_simulator.go b/pkg/source/wombat/wombatmain/pool_simulator.go index f788e0f81..e1e748fd8 100644 --- a/pkg/source/wombat/wombatmain/pool_simulator.go +++ b/pkg/source/wombat/wombatmain/pool_simulator.go @@ -1,11 +1,12 @@ package wombatmain import ( - "encoding/json" "fmt" - "github.com/KyberNetwork/logger" "math/big" + "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/wombat" diff --git a/pkg/source/wombat/wombatmain/pool_simulator_test.go b/pkg/source/wombat/wombatmain/pool_simulator_test.go index 7d8ac6ca9..a79b87c52 100644 --- a/pkg/source/wombat/wombatmain/pool_simulator_test.go +++ b/pkg/source/wombat/wombatmain/pool_simulator_test.go @@ -1,10 +1,10 @@ package wombatmain import ( - "encoding/json" "math/big" "testing" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/source/woofiv2/pool_simulator.go b/pkg/source/woofiv2/pool_simulator.go index 7949d73c7..5b52136c3 100644 --- a/pkg/source/woofiv2/pool_simulator.go +++ b/pkg/source/woofiv2/pool_simulator.go @@ -1,10 +1,10 @@ package woofiv2 import ( - "encoding/json" "fmt" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/woofiv2/pool_simulator_test.go b/pkg/source/woofiv2/pool_simulator_test.go index 5889698a3..ce933da74 100644 --- a/pkg/source/woofiv2/pool_simulator_test.go +++ b/pkg/source/woofiv2/pool_simulator_test.go @@ -1,11 +1,11 @@ package woofiv2 import ( - "encoding/json" "math/big" "testing" "time" + "github.com/goccy/go-json" "github.com/stretchr/testify/require" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" diff --git a/pkg/source/woofiv2/pool_tracker.go b/pkg/source/woofiv2/pool_tracker.go index 75967dbf2..1544278c4 100644 --- a/pkg/source/woofiv2/pool_tracker.go +++ b/pkg/source/woofiv2/pool_tracker.go @@ -2,16 +2,17 @@ package woofiv2 import ( "context" - "encoding/json" "math/big" "strings" "time" "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/logger" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" + + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" ) type PoolTracker struct { diff --git a/pkg/source/zkera-finance/pool_simulator.go b/pkg/source/zkera-finance/pool_simulator.go index 42e687a10..42b028d68 100644 --- a/pkg/source/zkera-finance/pool_simulator.go +++ b/pkg/source/zkera-finance/pool_simulator.go @@ -1,10 +1,11 @@ package zkerafinance import ( - "encoding/json" "math/big" "strings" + "github.com/goccy/go-json" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" diff --git a/pkg/source/zkera-finance/pool_tracker.go b/pkg/source/zkera-finance/pool_tracker.go index dafb5f7fa..51ab0e32c 100644 --- a/pkg/source/zkera-finance/pool_tracker.go +++ b/pkg/source/zkera-finance/pool_tracker.go @@ -2,12 +2,12 @@ package zkerafinance import ( "context" - "encoding/json" "fmt" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" diff --git a/pkg/source/zkera-finance/pools_list_updater.go b/pkg/source/zkera-finance/pools_list_updater.go index a5f3d3c26..f19573b28 100644 --- a/pkg/source/zkera-finance/pools_list_updater.go +++ b/pkg/source/zkera-finance/pools_list_updater.go @@ -2,11 +2,11 @@ package zkerafinance import ( "context" - "encoding/json" "time" "github.com/KyberNetwork/ethrpc" "github.com/KyberNetwork/logger" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" ) diff --git a/pkg/source/zkera-finance/vault_price_feed.go b/pkg/source/zkera-finance/vault_price_feed.go index 763ecc704..ed48ce5be 100644 --- a/pkg/source/zkera-finance/vault_price_feed.go +++ b/pkg/source/zkera-finance/vault_price_feed.go @@ -1,10 +1,10 @@ package zkerafinance import ( - "encoding/json" "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/goccy/go-json" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/bignumber" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util/eth" diff --git a/pkg/util/ticklens/ticklens.go b/pkg/util/ticklens/ticklens.go index 74dc95a8e..1080234ff 100644 --- a/pkg/util/ticklens/ticklens.go +++ b/pkg/util/ticklens/ticklens.go @@ -2,22 +2,20 @@ package ticklens import ( "context" - "encoding/json" "errors" "math/big" "sort" "strconv" + "github.com/KyberNetwork/ethrpc" + "github.com/KyberNetwork/logger" "github.com/daoleno/uniswapv3-sdk/utils" mapset "github.com/deckarep/golang-set/v2" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "github.com/goccy/go-json" "github.com/samber/lo" - "github.com/KyberNetwork/logger" - - "github.com/KyberNetwork/ethrpc" - "github.com/KyberNetwork/kyberswap-dex-lib/pkg/entity" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/util"