Skip to content

Commit

Permalink
feat : Integrate swap-x-v2 (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunspirit99 authored Jan 6, 2025
1 parent 8e86a36 commit c62b941
Show file tree
Hide file tree
Showing 11 changed files with 2,253 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/liquidity-source/solidly-v2/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
factoryMethodIsPaused = "isPaused"
factoryMethodAllPairs = "allPairs"
factoryMethodAllPairsLength = "allPairsLength"
factoryMethodStableFee = "stableFees"
factoryMethodStableFees = "stableFees"
factoryMethodVolatileFees = "volatileFees"

poolMethodMetadata = "metadata"
Expand Down
2 changes: 1 addition & 1 deletion pkg/liquidity-source/solidly-v2/pool_list_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (u *PoolsListUpdater) listPoolData(
listPoolMetadataRequest.AddCall(&ethrpc.Call{
ABI: factoryABI,
Target: u.config.FactoryAddress,
Method: factoryMethodStableFee,
Method: factoryMethodStableFees,
Params: []interface{}{},
}, []interface{}{&stableFee})
listPoolMetadataRequest.AddCall(&ethrpc.Call{
Expand Down
34 changes: 34 additions & 0 deletions pkg/liquidity-source/swap-x-v2/abis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package swapxv2

import (
"bytes"

"github.com/ethereum/go-ethereum/accounts/abi"
)

var (
poolABI abi.ABI
factoryABI abi.ABI
)

func init() {
builder := []struct {
ABI *abi.ABI
data []byte
}{
{
&poolABI, poolABIJson,
},
{
&factoryABI, factoryABIJson,
},
}

for _, b := range builder {
var err error
*b.ABI, err = abi.JSON(bytes.NewReader(b.data))
if err != nil {
panic(err)
}
}
}
Loading

0 comments on commit c62b941

Please sign in to comment.