SUSHISWAP - Polygon
Decentralized Exchange. Sushiswap-v1 connector on polygon triggers methods like deposit, withdraw, buy, sell. You can view details like source code, ABIs on Polygonscan.
- Use
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
to indicate MATIC. - use -1 or
dsa.maxValue
for the maximum amount in function. - If not sure about the arguments
getId
andsetId
, pass 0.
Deposit
Deposit Liquidity to a SushiSwap pool.
spells.add({ connector: "SUSHISWAP-A", method: "deposit", args: [tokenA, tokenB, amtA, unitAmt, slippage, getId, setId]});
Parameter | Type | Description |
---|---|---|
tokenA | address | The address of token A.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
tokenB | address | The address of token B.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
amtA | uint256 | The amount of A tokens to deposit. |
unitAmt | uint256 | The unit amount of of amtB/amtA with slippage. |
slippage | uint256 | Slippage amount. |
getId | uint256 | ID to retrieve amtA. |
setId | uint256 | ID stores the amount of pools tokens received. |
Withdraw
Withdraw Liquidity from a SushiSwap pool.
spells.add({ connector: "SUSHISWAP-A", method: "withdraw", args: [tokenA, tokenB, uniAmt, unitAmtA, unitAmtB, getId, setIds]});
Parameter | Type | Description |
---|---|---|
tokenA | address | The address of token A.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
tokenB | address | The address of token B.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
uniAmt | uint256 | The amount of pool tokens to withdraw. |
unitAmtA | uint256 | The unit amount of amtA/uniAmt with slippage. |
unitAmtB | uint256 | The unit amount of amtB/uniAmt with slippage. |
getId | uint256 | ID to retrieve uniAmt. |
setIds | uint256[] | Array of IDs to store the amount tokens received. |
Buy
Buy a token using a SushiSwap
spells.add({ connector: "SUSHISWAP-A", method: "buy", args: [buyAddr, sellAddr, buyAmt, unitAmt, getId, setId]});
Parameter | Type | Description |
---|---|---|
buyAddr | address | The address of the token to buy.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
sellAddr | address | The address of the token to sell.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
buyAmt | uint256 | The amount of tokens to buy. |
unitAmt | uint256 | The unit amount of sellAmt/buyAmt with slippage. |
getId | uint256 | ID to retrieve buyAmt. |
setId | uint256 | ID to store the amount of tokens sold. |
Sell
Sell a token using a SushiSwap
spells.add({ connector: "SUSHISWAP-A", method: "sell", args: [buyAddr, sellAddr, sellAmt, unitAmt, getId, setId]});
Parameter | Type | Description |
---|---|---|
buyAddr | address | The address of the token to buy.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
sellAddr | address | The address of the token to sell.(For Matic: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
sellAmt | uint256 | The amount of the token to sell. |
unitAmt | uint256 | The unit amount of buyAmt/sellAmt with slippage. |
getId | uint256 | ID to retrieve sellAmt. |
setId | uint256 | ID stores the amount of token brought. |
If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.
Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.