pub trait Pool: Sync + Send {
Show 13 methods
// Required methods
fn get_address(&self) -> Address;
fn calculate_out_amount(
&self,
state: &dyn DatabaseRef<Error = ErrReport>,
env: Env,
token_address_from: &Address,
token_address_to: &Address,
in_amount: U256,
) -> Result<(U256, u64), ErrReport>;
fn calculate_in_amount(
&self,
state: &dyn DatabaseRef<Error = ErrReport>,
env: Env,
token_address_from: &Address,
token_address_to: &Address,
out_amount: U256,
) -> Result<(U256, u64), ErrReport>;
fn can_flash_swap(&self) -> bool;
fn get_encoder(&self) -> &dyn AbiSwapEncoder;
fn get_state_required(&self) -> Result<RequiredState>;
// Provided methods
fn get_class(&self) -> PoolClass { ... }
fn get_protocol(&self) -> PoolProtocol { ... }
fn get_fee(&self) -> U256 { ... }
fn get_tokens(&self) -> Vec<Address> { ... }
fn get_swap_directions(&self) -> Vec<(Address, Address)> { ... }
fn can_calculate_in_amount(&self) -> bool { ... }
fn get_read_only_cell_vec(&self) -> Vec<U256> { ... }
}