(&self, contracts: &Contracts)
| 100 | |
| 101 | impl LiquidityProvider { |
| 102 | pub fn to_string(&self, contracts: &Contracts) -> String { |
| 103 | match self { |
| 104 | Self::UniswapV2 => format!( |
| 105 | r#" |
| 106 | [[liquidity.uniswap-v2]] |
| 107 | router = "{:?}" |
| 108 | pool-code = "{:?}" |
| 109 | missing-pool-cache-time = "0s" |
| 110 | "#, |
| 111 | contracts.uniswap_v2_router.address(), |
| 112 | contracts.default_pool_code() |
| 113 | ), |
| 114 | Self::ZeroEx { api_port } => format!( |
| 115 | r#" |
| 116 | [liquidity.zeroex] |
| 117 | base-url = {:?} |
| 118 | api-key = {:?} |
| 119 | http-timeout = "10s" |
| 120 | "#, |
| 121 | format!("http://0.0.0.0:{}", api_port), |
| 122 | "no-api-key".to_string() |
| 123 | ), |
| 124 | Self::UniswapV3 { subgraph } => format!( |
| 125 | r#" |
| 126 | [[liquidity.uniswap-v3]] |
| 127 | preset = "uniswap-v3" |
| 128 | indexer-config = {{ subgraph = {{ url = "{subgraph}" }} }} |
| 129 | "# |
| 130 | ), |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | pub fn start_driver( |
no outgoing calls