Router
Movemement testnet is unstable by the time of writing and using the contracts below are for testing and development purposes only
Contract Info
Contract Name:
yuzu::router
Contract Address: [tba]
Admin Multi Sig: [tba]
Public Functions
Create Pair
Creates a new liquidity pair for tokens X and Y. Reverts if the pair already exists.
public entry fun create_pair<X, Y>(sender: &signer)
sender
signer
The sender's signer.
Register Fee On Transfer in Pair
Adds fee-on-transfer functionality to a token pair (only callable by token owners).
public entry fun register_fee_on_transfer_in_a_pair<CoinType, X, Y>(sender: &signer)
sender
signer
The sender's signer.
Stake Tokens in Pool
Deposit tokens into the staking pool for a liquidity pair.
public entry fun stake_tokens_in_pool<X, Y>(sender: &signer, amount: u64)
sender
signer
The sender's signer.
amount
u64
The amount of tokens to stake.
Unstake Tokens from Pool
Withdraw tokens from the staking pool for a liquidity pair.
public entry fun unstake_tokens_from_pool<X, Y>(sender: &signer, amount: u64)
sender
signer
The sender's signer.
amount
u64
The amount of tokens to withdraw.
Claim Rewards from Pool
Claim staking rewards from the rewards pool.
public entry fun claim_rewards_from_pool<X, Y>(sender: &signer)
sender
signer
The sender's signer.
Add Liquidity
Add liquidity to a pair or create the pair if it doesn't exist.
public entry fun add_liquidity<X, Y>(sender: &signer, amount_x_desired: u64, amount_y_desired: u64, amount_x_min: u64, amount_y_min: u64)
sender
signer
The sender's signer.
amount_x_desired
u64
The amount of token X desired.
amount_y_desired
u64
The amount of token Y desired.
amount_x_min
u64
The minimum amount of token X to add.
amount_y_min
u64
The minimum amount of token Y to add.
Remove Liquidity
Remove liquidity from a pair.
public entry fun remove_liquidity<X, Y>(sender: &signer, liquidity: u64, amount_x_min: u64, amount_y_min: u64)
sender
signer
The sender's signer.
liquidity
u64
The amount of liquidity to remove.
amount_x_min
u64
The minimum amount of token X to receive.
amount_y_min
u64
The minimum amount of token Y to receive.
Swap Exact Input
Swap an exact input amount of token X for the maximum possible amount of token Y.
public entry fun swap_exact_input<X, Y>(sender: &signer, x_in: u64, y_min_out: u64)
sender
signer
The sender's signer.
x_in
u64
The exact amount of token X to swap.
y_min_out
u64
The minimum amount of token Y to receive.
Swap Exact Output
Swap the minimum possible amount of token X to receive an exact output amount of token Y.
public entry fun swap_exact_output<X, Y>(sender: &signer, y_out: u64, x_max_in: u64)
sender
signer
The sender's signer.
y_out
u64
The exact amount of token Y to receive.
x_max_in
u64
The maximum amount of token X to swap.
Multi-Hop Exact Input
Swap token X for token Y through an intermediate token Z.
public entry fun swap_exact_input_with_one_intermediate_coin<X, Y, Z>(sender: &signer, x_in: u64, y_min_out: u64)
sender
signer
The sender's signer.
x_in
u64
The exact amount of token X to swap.
y_min_out
u64
The minimum amount of token Y to receive.
Register LP
Register the LP token for a pair to the sender's account.
public entry fun register_lp<X, Y>(sender: &signer)
sender
signer
The sender's signer.
Update Fee Tier
Update the fee tier for a liquidity pair.
public entry fun update_fee_tier<Tier, X, Y>(signer_ref: &signer)
signer_ref
signer
The sender's signer.
Last updated