@@ -356,46 +356,48 @@ pub fn new(
356356 )
357357 }
358358 liquidity:: Kind :: BalancerV2GyroE ( pool) => {
359- solvers_dto:: auction:: Liquidity :: GyroE ( solvers_dto:: auction:: GyroEPool {
360- id : liquidity. id . 0 . to_string ( ) ,
361- address : pool. id . address ( ) . into ( ) ,
362- balancer_pool_id : pool. id . into ( ) ,
363- gas_estimate : liquidity. gas . into ( ) ,
364- tokens : pool
365- . reserves
366- . iter ( )
367- . map ( |r| {
368- (
369- r. asset . token . into ( ) ,
370- solvers_dto:: auction:: GyroEReserve {
371- balance : r. asset . amount . into ( ) ,
372- scaling_factor : scaling_factor_to_decimal ( r. scale ) ,
373- } ,
374- )
375- } )
376- . collect ( ) ,
377- fee : fee_to_decimal ( pool. fee ) ,
378- version : match pool. version {
379- liquidity:: balancer:: v2:: gyro_e:: Version :: V1 => {
380- solvers_dto:: auction:: GyroEVersion :: V1
381- }
359+ solvers_dto:: auction:: Liquidity :: GyroE ( Box :: new (
360+ solvers_dto:: auction:: GyroEPool {
361+ id : liquidity. id . 0 . to_string ( ) ,
362+ address : pool. id . address ( ) . into ( ) ,
363+ balancer_pool_id : pool. id . into ( ) ,
364+ gas_estimate : liquidity. gas . into ( ) ,
365+ tokens : pool
366+ . reserves
367+ . iter ( )
368+ . map ( |r| {
369+ (
370+ r. asset . token . into ( ) ,
371+ solvers_dto:: auction:: GyroEReserve {
372+ balance : r. asset . amount . into ( ) ,
373+ scaling_factor : scaling_factor_to_decimal ( r. scale ) ,
374+ } ,
375+ )
376+ } )
377+ . collect ( ) ,
378+ fee : fee_to_decimal ( pool. fee ) ,
379+ version : match pool. version {
380+ liquidity:: balancer:: v2:: gyro_e:: Version :: V1 => {
381+ solvers_dto:: auction:: GyroEVersion :: V1
382+ }
383+ } ,
384+ // Convert all Gyro E-CLP static parameters to BigDecimal
385+ params_alpha : signed_fixed_point_to_decimal ( pool. params_alpha ) ,
386+ params_beta : signed_fixed_point_to_decimal ( pool. params_beta ) ,
387+ params_c : signed_fixed_point_to_decimal ( pool. params_c ) ,
388+ params_s : signed_fixed_point_to_decimal ( pool. params_s ) ,
389+ params_lambda : signed_fixed_point_to_decimal ( pool. params_lambda ) ,
390+ tau_alpha_x : signed_fixed_point_to_decimal ( pool. tau_alpha_x ) ,
391+ tau_alpha_y : signed_fixed_point_to_decimal ( pool. tau_alpha_y ) ,
392+ tau_beta_x : signed_fixed_point_to_decimal ( pool. tau_beta_x ) ,
393+ tau_beta_y : signed_fixed_point_to_decimal ( pool. tau_beta_y ) ,
394+ u : signed_fixed_point_to_decimal ( pool. u ) ,
395+ v : signed_fixed_point_to_decimal ( pool. v ) ,
396+ w : signed_fixed_point_to_decimal ( pool. w ) ,
397+ z : signed_fixed_point_to_decimal ( pool. z ) ,
398+ d_sq : signed_fixed_point_to_decimal ( pool. d_sq ) ,
382399 } ,
383- // Convert all Gyro E-CLP static parameters to BigDecimal
384- params_alpha : signed_fixed_point_to_decimal ( pool. params_alpha ) ,
385- params_beta : signed_fixed_point_to_decimal ( pool. params_beta ) ,
386- params_c : signed_fixed_point_to_decimal ( pool. params_c ) ,
387- params_s : signed_fixed_point_to_decimal ( pool. params_s ) ,
388- params_lambda : signed_fixed_point_to_decimal ( pool. params_lambda ) ,
389- tau_alpha_x : signed_fixed_point_to_decimal ( pool. tau_alpha_x ) ,
390- tau_alpha_y : signed_fixed_point_to_decimal ( pool. tau_alpha_y ) ,
391- tau_beta_x : signed_fixed_point_to_decimal ( pool. tau_beta_x ) ,
392- tau_beta_y : signed_fixed_point_to_decimal ( pool. tau_beta_y ) ,
393- u : signed_fixed_point_to_decimal ( pool. u ) ,
394- v : signed_fixed_point_to_decimal ( pool. v ) ,
395- w : signed_fixed_point_to_decimal ( pool. w ) ,
396- z : signed_fixed_point_to_decimal ( pool. z ) ,
397- d_sq : signed_fixed_point_to_decimal ( pool. d_sq ) ,
398- } )
400+ ) )
399401 }
400402 liquidity:: Kind :: BalancerV2Gyro2CLP ( pool) => {
401403 solvers_dto:: auction:: Liquidity :: Gyro2CLP (
@@ -463,49 +465,53 @@ pub fn new(
463465 )
464466 }
465467 liquidity:: Kind :: BalancerV3GyroE ( pool) => {
466- solvers_dto:: auction:: Liquidity :: GyroE ( solvers_dto:: auction:: GyroEPool {
467- id : liquidity. id . 0 . to_string ( ) ,
468- address : pool. id . address ( ) . into ( ) ,
469- balancer_pool_id : {
470- let pool_id_h160: eth:: H160 = pool. id . into ( ) ;
471- pool_id_h160. into ( )
472- } ,
473- gas_estimate : liquidity. gas . into ( ) ,
474- tokens : pool
475- . reserves
476- . iter ( )
477- . map ( |r| {
478- (
479- r. asset . token . into ( ) ,
480- solvers_dto:: auction:: GyroEReserve {
481- balance : r. asset . amount . into ( ) ,
482- scaling_factor : scaling_factor_to_decimal_v3 ( r. scale ) ,
483- } ,
484- )
485- } )
486- . collect ( ) ,
487- fee : fee_to_decimal_v3 ( pool. fee ) ,
488- version : match pool. version {
489- liquidity:: balancer:: v3:: gyro_e:: Version :: V1 => {
490- solvers_dto:: auction:: GyroEVersion :: V1
491- }
468+ solvers_dto:: auction:: Liquidity :: GyroE ( Box :: new (
469+ solvers_dto:: auction:: GyroEPool {
470+ id : liquidity. id . 0 . to_string ( ) ,
471+ address : pool. id . address ( ) . into ( ) ,
472+ balancer_pool_id : {
473+ let pool_id_h160: eth:: H160 = pool. id . into ( ) ;
474+ pool_id_h160. into ( )
475+ } ,
476+ gas_estimate : liquidity. gas . into ( ) ,
477+ tokens : pool
478+ . reserves
479+ . iter ( )
480+ . map ( |r| {
481+ (
482+ r. asset . token . into ( ) ,
483+ solvers_dto:: auction:: GyroEReserve {
484+ balance : r. asset . amount . into ( ) ,
485+ scaling_factor : scaling_factor_to_decimal_v3 (
486+ r. scale ,
487+ ) ,
488+ } ,
489+ )
490+ } )
491+ . collect ( ) ,
492+ fee : fee_to_decimal_v3 ( pool. fee ) ,
493+ version : match pool. version {
494+ liquidity:: balancer:: v3:: gyro_e:: Version :: V1 => {
495+ solvers_dto:: auction:: GyroEVersion :: V1
496+ }
497+ } ,
498+ // Convert all Gyro E-CLP static parameters to BigDecimal
499+ params_alpha : signed_fixed_point_to_decimal_v3 ( pool. params_alpha ) ,
500+ params_beta : signed_fixed_point_to_decimal_v3 ( pool. params_beta ) ,
501+ params_c : signed_fixed_point_to_decimal_v3 ( pool. params_c ) ,
502+ params_s : signed_fixed_point_to_decimal_v3 ( pool. params_s ) ,
503+ params_lambda : signed_fixed_point_to_decimal_v3 ( pool. params_lambda ) ,
504+ tau_alpha_x : signed_fixed_point_to_decimal_v3 ( pool. tau_alpha_x ) ,
505+ tau_alpha_y : signed_fixed_point_to_decimal_v3 ( pool. tau_alpha_y ) ,
506+ tau_beta_x : signed_fixed_point_to_decimal_v3 ( pool. tau_beta_x ) ,
507+ tau_beta_y : signed_fixed_point_to_decimal_v3 ( pool. tau_beta_y ) ,
508+ u : signed_fixed_point_to_decimal_v3 ( pool. u ) ,
509+ v : signed_fixed_point_to_decimal_v3 ( pool. v ) ,
510+ w : signed_fixed_point_to_decimal_v3 ( pool. w ) ,
511+ z : signed_fixed_point_to_decimal_v3 ( pool. z ) ,
512+ d_sq : signed_fixed_point_to_decimal_v3 ( pool. d_sq ) ,
492513 } ,
493- // Convert all Gyro E-CLP static parameters to BigDecimal
494- params_alpha : signed_fixed_point_to_decimal_v3 ( pool. params_alpha ) ,
495- params_beta : signed_fixed_point_to_decimal_v3 ( pool. params_beta ) ,
496- params_c : signed_fixed_point_to_decimal_v3 ( pool. params_c ) ,
497- params_s : signed_fixed_point_to_decimal_v3 ( pool. params_s ) ,
498- params_lambda : signed_fixed_point_to_decimal_v3 ( pool. params_lambda ) ,
499- tau_alpha_x : signed_fixed_point_to_decimal_v3 ( pool. tau_alpha_x ) ,
500- tau_alpha_y : signed_fixed_point_to_decimal_v3 ( pool. tau_alpha_y ) ,
501- tau_beta_x : signed_fixed_point_to_decimal_v3 ( pool. tau_beta_x ) ,
502- tau_beta_y : signed_fixed_point_to_decimal_v3 ( pool. tau_beta_y ) ,
503- u : signed_fixed_point_to_decimal_v3 ( pool. u ) ,
504- v : signed_fixed_point_to_decimal_v3 ( pool. v ) ,
505- w : signed_fixed_point_to_decimal_v3 ( pool. w ) ,
506- z : signed_fixed_point_to_decimal_v3 ( pool. z ) ,
507- d_sq : signed_fixed_point_to_decimal_v3 ( pool. d_sq ) ,
508- } )
514+ ) )
509515 }
510516 liquidity:: Kind :: BalancerV3Gyro2CLP ( pool) => {
511517 solvers_dto:: auction:: Liquidity :: Gyro2CLP (
0 commit comments