Interact: Swapping
This page consists of a guide pertaining to getting set up at Laika
Market order swap will be executed immediately without the need to create order.
Step 1: Search for the request called “swap”
Step 2: Input the following parameters:
- `tokenIn` = The token address of the token to be swapped from
- `tokenOut` = The token address of the token to be swapped to
- `amountIn` = The amount of `tokenIn` in that token decimals
- `minAmountOut` = The minimum amount of the `tokenOut` to be expected. If the returned amount from the swap is less than this value, the transaction will revert.
- `receiver` = The wallet address to receive the token from the swap
Step 3: Click “Send” button
Step 1: Search for the request called “createSwapOrder”
Step 2: Input the following parameters:
- `_path` = The path of token address to be swapped. Maximum is two token path.
- `_amountIn` = The amount of first token address in `_path` in that token decimals
- `_minOut` = The minimum amount of the last token address in `_path` to be expected. If the returned amount from the swap is less than this value, the transaction will revert.
- `_triggerRatio` = The trigger price which is calculated as `tokenOutUSDPrice / tokenInUSDPrice` in 30 decimal places.
- `_triggerAboveThreshold` = This parameter specifies if you want the price to be greater than the `_triggerPrice` to execute. If that’s the case, `true` will be the input and vice versa.
- `_executionFee` = The amount of the execution fee of this order. Currently, the execution fee is 0.2 MATIC. The parameter input should be `200000000000000000`.
- `_shouldWrap` = If token in is MATIC, this should be `true`.
- `_shouldUnwrap` = If token out is MATIC, this should be `true`.
Step 3: Input the “Transfer Value (MATIC)” with the execution fee here which is `200000000000000000`
Step 4: Click “Send” button
Last modified 5mo ago