From 5e9a929aa5152b53103a07ce33ab61ab9d824011 Mon Sep 17 00:00:00 2001 From: Dat Luong Date: Thu, 21 Nov 2024 11:15:42 +0700 Subject: [PATCH] fix: new swap limit func --- pkg/poolsimulators/poolsimulators.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/poolsimulators/poolsimulators.go b/pkg/poolsimulators/poolsimulators.go index 98e5630..c7122cd 100644 --- a/pkg/poolsimulators/poolsimulators.go +++ b/pkg/poolsimulators/poolsimulators.go @@ -124,6 +124,7 @@ import ( "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/wombat/wombatmain" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/woofiv2" zkera "github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/zkera-finance" + "github.com/KyberNetwork/kyberswap-dex-lib/pkg/swaplimit" "github.com/KyberNetwork/kyberswap-dex-lib/pkg/valueobject" ) @@ -377,14 +378,14 @@ func PoolSimulatorFromPool(pool ksent.Pool, chainID uint) (pkgpool.IPoolSimulato func newSwapLimit(dex string, limit map[string]*big.Int) pkgpool.SwapLimit { switch dex { - case pooltypes.PoolTypes.KyberPMM, - pooltypes.PoolTypes.NativeV1: - return kyberpmm.NewInventory(limit) - case pooltypes.PoolTypes.Synthetix: - return synthetix.NewLimits(limit) - case pooltypes.PoolTypes.LimitOrder: - return limitorder.NewInventory(limit) + case pooltypes.PoolTypes.Synthetix, + pooltypes.PoolTypes.LimitOrder, + pooltypes.PoolTypes.KyberPMM, + pooltypes.PoolTypes.NativeV1, + pooltypes.PoolTypes.Dexalot: + return swaplimit.NewInventory(dex, limit) } + return nil }