Aggregator Integration
To integrate YuzuSwap with your aggregator, use the following public functions for swap calculations.
Get Amount In
Description
Usage
Parameters
Input Value
Type
Description
Code
public fun get_amount_in<X, Y>(y_out_amount: u64): u64 {
assert!(swap::is_pair_created<X, Y>(), errors::pair_not_created());
let is_x_to_y = swap_utils::sort_token_type<X, Y>();
get_amount_in_internal<X, Y>(is_x_to_y, y_out_amount)
}Get Amount Out
Description
Usage
Parameters
Input Value
Type
Description
Code
Last updated