File tree Expand file tree Collapse file tree 12 files changed +46
-41
lines changed
boundary/liquidity/balancer/v3
domain/liquidity/balancer/v3 Expand file tree Collapse file tree 12 files changed +46
-41
lines changed Original file line number Diff line number Diff line change @@ -1324,7 +1324,6 @@ fn main() {
13241324 )
13251325 } ) ;
13261326
1327-
13281327 generate_contract ( "BalancerV3WeightedPool" ) ;
13291328 generate_contract ( "BalancerV3StablePool" ) ;
13301329 generate_contract ( "BalancerV3GyroECLPPool" ) ;
Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ use {
1111 chain:: Chain ,
1212 contracts:: {
1313 BalancerV3BatchRouter ,
14+ BalancerV3GyroECLPPoolFactory ,
1415 BalancerV3StablePoolFactory ,
1516 BalancerV3StablePoolFactoryV2 ,
1617 BalancerV3Vault ,
1718 BalancerV3WeightedPoolFactory ,
18- BalancerV3GyroECLPPoolFactory ,
1919 GPv2Settlement ,
2020 } ,
2121 ethrpc:: block_stream:: { BlockRetrieving , CurrentBlockWatcher } ,
3737 std:: sync:: Arc ,
3838} ;
3939
40+ pub mod gyro_e;
4041pub mod stable;
4142pub mod weighted;
42- pub mod gyro_e;
4343
4444/// Maps a Chain to the corresponding GqlChain for Balancer V3 API.
4545fn chain_to_gql_chain ( chain : & Chain ) -> GqlChain {
@@ -172,7 +172,9 @@ async fn init_liquidity(
172172 . gyro_e
173173 . iter ( )
174174 . map ( |& factory| {
175- ( BalancerFactoryKind :: GyroE , BalancerV3GyroECLPPoolFactory :: at ( & web3, factory. into ( ) )
175+ (
176+ BalancerFactoryKind :: GyroE ,
177+ BalancerV3GyroECLPPoolFactory :: at ( & web3, factory. into ( ) )
176178 . raw_instance ( )
177179 . clone ( ) ,
178180 )
Original file line number Diff line number Diff line change 33 derive_more:: { From , Into } ,
44} ;
55
6+ pub mod gyro_e;
67pub mod stable;
78pub mod weighted;
8- pub mod gyro_e;
99
1010/// A Balancer V3 pool ID.
1111///
Original file line number Diff line number Diff line change @@ -331,9 +331,7 @@ impl BalancerV3 {
331331 stable_v2 : factory_addresses ( & [
332332 contracts:: BalancerV3StablePoolFactoryV2 :: raw_contract ( ) ,
333333 ] ) ,
334- gyro_e : factory_addresses ( & [
335- contracts:: BalancerV3GyroECLPPoolFactory :: raw_contract ( ) ,
336- ] ) ,
334+ gyro_e : factory_addresses ( & [ contracts:: BalancerV3GyroECLPPoolFactory :: raw_contract ( ) ] ) ,
337335 pool_deny_list : Vec :: new ( ) ,
338336 graph_url : graph_url. clone ( ) ,
339337 reinit_interval : None ,
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ pub fn new(
393393 . reserves
394394 . iter ( )
395395 . map ( |r| {
396- (
396+ (
397397 r. asset . token . into ( ) ,
398398 solvers_dto:: auction:: GyroEReserve {
399399 balance : r. asset . amount . into ( ) ,
Original file line number Diff line number Diff line change @@ -165,8 +165,10 @@ impl<Factory> PoolInfoFetcher<Factory> {
165165
166166 let ( token_addresses, balances, _) = balances;
167167 {
168- let graph_set: std:: collections:: BTreeSet < _ > = pool. tokens . iter ( ) . copied ( ) . collect ( ) ;
169- let vault_set: std:: collections:: BTreeSet < _ > = token_addresses. iter ( ) . copied ( ) . collect ( ) ;
168+ let graph_set: std:: collections:: BTreeSet < _ > =
169+ pool. tokens . iter ( ) . copied ( ) . collect ( ) ;
170+ let vault_set: std:: collections:: BTreeSet < _ > =
171+ token_addresses. iter ( ) . copied ( ) . collect ( ) ;
170172 ensure ! ( graph_set == vault_set, "pool token mismatch" ) ;
171173 }
172174
@@ -183,7 +185,9 @@ impl<Factory> PoolInfoFetcher<Factory> {
183185
184186 let tokens = itertools:: izip!( & token_addresses, balances)
185187 . map ( |( & address, balance) | {
186- let scaling_factor = * scaling_by_addr. get ( & address) . expect ( "missing scaling factor" ) ;
188+ let scaling_factor = * scaling_by_addr
189+ . get ( & address)
190+ . expect ( "missing scaling factor" ) ;
187191 let rate = * rate_by_addr. get ( & address) . expect ( "missing rate" ) ;
188192 (
189193 address,
Original file line number Diff line number Diff line change 3535 clap:: ValueEnum ,
3636 contracts:: {
3737 BalancerV3BatchRouter ,
38+ BalancerV3GyroECLPPoolFactory ,
3839 BalancerV3StablePoolFactory ,
3940 BalancerV3StablePoolFactoryV2 ,
40- BalancerV3GyroECLPPoolFactory ,
4141 BalancerV3Vault ,
4242 BalancerV3WeightedPoolFactory ,
4343 } ,
@@ -52,12 +52,12 @@ use {
5252} ;
5353pub use {
5454 common:: TokenState ,
55+ gyro_e:: Version as GyroEPoolVersion ,
5556 stable:: {
5657 AmplificationParameter ,
5758 TokenState as StableTokenState ,
5859 Version as StablePoolVersion ,
5960 } ,
60- gyro_e:: Version as GyroEPoolVersion ,
6161 weighted:: { TokenState as WeightedTokenState , Version as WeightedPoolVersion } ,
6262} ;
6363
Original file line number Diff line number Diff line change @@ -175,21 +175,21 @@ impl<Factory> PoolInfoFetcher<Factory> {
175175 . map ( |( & addr, & sf) | ( addr, sf) )
176176 . collect ( ) ;
177177
178- let tokens = itertools:: izip!( & tokens, balances, token_rates)
179- . map ( |( & address, balance, rate) | {
180- let scaling_factor = * scaling_by_addr
181- . get ( & address)
182- . expect ( "missing scaling factor for address" ) ;
183- (
184- address,
185- TokenState {
186- balance,
187- scaling_factor,
188- rate,
189- } ,
190- )
191- } )
192- . collect ( ) ;
178+ let tokens = itertools:: izip!( & tokens, balances, token_rates)
179+ . map ( |( & address, balance, rate) | {
180+ let scaling_factor = * scaling_by_addr
181+ . get ( & address)
182+ . expect ( "missing scaling factor for address" ) ;
183+ (
184+ address,
185+ TokenState {
186+ balance,
187+ scaling_factor,
188+ rate,
189+ } ,
190+ )
191+ } )
192+ . collect ( ) ;
193193
194194 Ok ( PoolState {
195195 paused,
Original file line number Diff line number Diff line change 88//! pool types by just implementing the required `BalancerV3Factory` trait.
99
1010pub mod common;
11+ pub mod gyro_e;
1112pub mod stable;
1213pub mod weighted;
13- pub mod gyro_e;
1414
1515use {
1616 super :: graph_api:: PoolData ,
Original file line number Diff line number Diff line change 66 conversions:: U256Ext ,
77 sources:: balancer_v3:: pool_fetching:: {
88 AmplificationParameter ,
9+ GyroEPool ,
10+ GyroEPoolVersion ,
911 StablePool ,
1012 TokenState ,
1113 WeightedPool ,
1214 WeightedPoolVersion ,
1315 WeightedTokenState ,
14- GyroEPool ,
15- GyroEPoolVersion
1616 } ,
1717 } ,
1818 error:: Error ,
1919 ethcontract:: { H160 , U256 } ,
20- num:: BigInt ,
2120 fixed_point:: Bfp ,
21+ num:: BigInt ,
2222 std:: collections:: BTreeMap ,
2323} ;
2424
2525mod error;
2626pub mod fixed_point;
2727pub mod gyro_e_math;
28- pub mod signed_fixed_point;
2928mod math;
29+ pub mod signed_fixed_point;
3030mod stable_math;
3131mod weighted_math;
3232
You can’t perform that action at this time.
0 commit comments