Skip to content

Commit

Permalink
fix: new swap limit func
Browse files Browse the repository at this point in the history
  • Loading branch information
datluongductuan committed Nov 21, 2024
1 parent 5e51020 commit 5e9a929
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/poolsimulators/poolsimulators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 5e9a929

Please sign in to comment.