From 99125acd3e4f5e3b37cc87e6f6b1f0e3686e81bb Mon Sep 17 00:00:00 2001 From: Phu Ngo <12547020+NgoKimPhu@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:18:43 +0700 Subject: [PATCH] feat: support subgraph headers for balancer/gyroscope (#554) --- .../balancer-v2/composable-stable/pools_list_updater.go | 9 +++++---- .../balancer-v2/stable/pools_list_updater.go | 9 +++++---- .../balancer-v2/weighted/pools_list_updater.go | 9 +++++---- .../gyroscope/2clp/pools_list_updater.go | 9 +++++---- .../gyroscope/3clp/pools_list_updater.go | 9 +++++---- .../gyroscope/eclp/pools_list_updater.go | 9 +++++---- 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/pkg/liquidity-source/balancer-v2/composable-stable/pools_list_updater.go b/pkg/liquidity-source/balancer-v2/composable-stable/pools_list_updater.go index d6c22df2c..95d5fad21 100644 --- a/pkg/liquidity-source/balancer-v2/composable-stable/pools_list_updater.go +++ b/pkg/liquidity-source/balancer-v2/composable-stable/pools_list_updater.go @@ -25,10 +25,11 @@ type PoolsListUpdater struct { func NewPoolsListUpdater(config *Config, ethrpcClient *ethrpc.Client) *PoolsListUpdater { sharedUpdater := shared.NewPoolsListUpdater(&shared.Config{ - DexID: config.DexID, - SubgraphAPI: config.SubgraphAPI, - NewPoolLimit: config.NewPoolLimit, - PoolTypes: []string{poolTypeComposableStable}, + DexID: config.DexID, + SubgraphAPI: config.SubgraphAPI, + SubgraphHeaders: config.SubgraphHeaders, + NewPoolLimit: config.NewPoolLimit, + PoolTypes: []string{poolTypeComposableStable}, }) return &PoolsListUpdater{ diff --git a/pkg/liquidity-source/balancer-v2/stable/pools_list_updater.go b/pkg/liquidity-source/balancer-v2/stable/pools_list_updater.go index bb4d77081..87d66d24e 100644 --- a/pkg/liquidity-source/balancer-v2/stable/pools_list_updater.go +++ b/pkg/liquidity-source/balancer-v2/stable/pools_list_updater.go @@ -25,10 +25,11 @@ type PoolsListUpdater struct { func NewPoolsListUpdater(config *Config, ethrpcClient *ethrpc.Client) *PoolsListUpdater { sharedUpdater := shared.NewPoolsListUpdater(&shared.Config{ - DexID: config.DexID, - SubgraphAPI: config.SubgraphAPI, - NewPoolLimit: config.NewPoolLimit, - PoolTypes: []string{poolTypeStable, poolTypeMetaStable}, + DexID: config.DexID, + SubgraphAPI: config.SubgraphAPI, + SubgraphHeaders: config.SubgraphHeaders, + NewPoolLimit: config.NewPoolLimit, + PoolTypes: []string{poolTypeStable, poolTypeMetaStable}, }) return &PoolsListUpdater{ diff --git a/pkg/liquidity-source/balancer-v2/weighted/pools_list_updater.go b/pkg/liquidity-source/balancer-v2/weighted/pools_list_updater.go index 32969064b..368d28188 100644 --- a/pkg/liquidity-source/balancer-v2/weighted/pools_list_updater.go +++ b/pkg/liquidity-source/balancer-v2/weighted/pools_list_updater.go @@ -29,10 +29,11 @@ type PoolsListUpdater struct { func NewPoolsListUpdater(config *Config, ethrpcClient *ethrpc.Client) *PoolsListUpdater { sharedUpdater := shared.NewPoolsListUpdater(&shared.Config{ - DexID: config.DexID, - SubgraphAPI: config.SubgraphAPI, - NewPoolLimit: config.NewPoolLimit, - PoolTypes: []string{poolTypeWeighted}, + DexID: config.DexID, + SubgraphAPI: config.SubgraphAPI, + SubgraphHeaders: config.SubgraphHeaders, + NewPoolLimit: config.NewPoolLimit, + PoolTypes: []string{poolTypeWeighted}, }) return &PoolsListUpdater{ diff --git a/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go b/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go index 8f2c80047..584c58cef 100644 --- a/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go +++ b/pkg/liquidity-source/gyroscope/2clp/pools_list_updater.go @@ -25,10 +25,11 @@ type PoolsListUpdater struct { func NewPoolsListUpdater(config *Config, ethrpcClient *ethrpc.Client) *PoolsListUpdater { sharedUpdater := shared.NewPoolsListUpdater(&shared.Config{ - DexID: config.DexID, - SubgraphAPI: config.SubgraphAPI, - NewPoolLimit: config.NewPoolLimit, - PoolTypes: []string{poolType}, + DexID: config.DexID, + SubgraphAPI: config.SubgraphAPI, + SubgraphHeaders: config.SubgraphHeaders, + NewPoolLimit: config.NewPoolLimit, + PoolTypes: []string{poolType}, }) return &PoolsListUpdater{ diff --git a/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go b/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go index 1f048692e..a828cc92e 100644 --- a/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go +++ b/pkg/liquidity-source/gyroscope/3clp/pools_list_updater.go @@ -25,10 +25,11 @@ type PoolsListUpdater struct { func NewPoolsListUpdater(config *Config, ethrpcClient *ethrpc.Client) *PoolsListUpdater { sharedUpdater := shared.NewPoolsListUpdater(&shared.Config{ - DexID: config.DexID, - SubgraphAPI: config.SubgraphAPI, - NewPoolLimit: config.NewPoolLimit, - PoolTypes: []string{poolType}, + DexID: config.DexID, + SubgraphAPI: config.SubgraphAPI, + SubgraphHeaders: config.SubgraphHeaders, + NewPoolLimit: config.NewPoolLimit, + PoolTypes: []string{poolType}, }) return &PoolsListUpdater{ diff --git a/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go b/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go index 22d5c8c43..e5e48d3ec 100644 --- a/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go +++ b/pkg/liquidity-source/gyroscope/eclp/pools_list_updater.go @@ -22,10 +22,11 @@ type PoolsListUpdater struct { func NewPoolsListUpdater(config *Config, ethrpcClient *ethrpc.Client) *PoolsListUpdater { sharedUpdater := shared.NewPoolsListUpdater(&shared.Config{ - DexID: config.DexID, - SubgraphAPI: config.SubgraphAPI, - NewPoolLimit: config.NewPoolLimit, - PoolTypes: []string{poolType}, + DexID: config.DexID, + SubgraphAPI: config.SubgraphAPI, + SubgraphHeaders: config.SubgraphHeaders, + NewPoolLimit: config.NewPoolLimit, + PoolTypes: []string{poolType}, }) return &PoolsListUpdater{