Skip to content

Commit

Permalink
syncswap: integrate classic and stable pool (#5)
Browse files Browse the repository at this point in the history
* syncswap: pools list updater classic pool

* feat: integrate syncswap stable

* update currentOffset
  • Loading branch information
guiltylotus authored Jun 13, 2023
1 parent 0f74499 commit 1d3f8c8
Show file tree
Hide file tree
Showing 12 changed files with 2,943 additions and 4 deletions.
25 changes: 21 additions & 4 deletions pkg/source/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ package source

import (
"fmt"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/muteswitch"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/ramses"

"github.com/KyberNetwork/ethrpc"

"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/balancer"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/biswap"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/camelot"
Expand All @@ -23,12 +19,15 @@ import (
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/madmex"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/makerpsm"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/metavault"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/muteswitch"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/nerve"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/oneswap"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/platypus"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/polydex"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/ramses"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/saddle"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/syncswap"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/synthetix"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/uniswap"
"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/uniswapv3"
Expand Down Expand Up @@ -283,6 +282,15 @@ func NewPoolsListUpdaterHandler(
cfg.DexID = scanDexCfg.Id

return limitorder.NewPoolsListUpdater(&cfg)
case syncswap.DexTypeSyncSwap:
var cfg syncswap.Config
err := PropertiesToStruct(scanDexCfg.Properties, &cfg)
if err != nil {
return nil, err
}
cfg.DexID = scanDexCfg.Id

return syncswap.NewPoolsListUpdater(&cfg, ethrpcClient), nil
}

return nil, fmt.Errorf("can not find pools list updater handler: %s", scanDexCfg.Handler)
Expand Down Expand Up @@ -459,6 +467,15 @@ func NewPoolTrackerHandler(
cfg.DexID = scanDexCfg.Id

return limitorder.NewPoolTracker(&cfg), nil
case syncswap.DexTypeSyncSwap:
var cfg syncswap.Config
err := PropertiesToStruct(scanDexCfg.Properties, &cfg)
if err != nil {
return nil, err
}
cfg.DexID = scanDexCfg.Id

return syncswap.NewPoolTracker(&cfg, ethrpcClient), nil
}

return nil, fmt.Errorf("can not find pool tracker handler: %s", scanDexCfg.Handler)
Expand Down
Loading

0 comments on commit 1d3f8c8

Please sign in to comment.