Decentralized Exchange
Uniswap connector triggers the methods like buy, sell, deposit, withdraw tokens You can view details like source code, ABIs on Etherscan.
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
to indicate ETH.2 * 10 ** 16
to denote 2%.getId
and setId
, pass 0.Buy tokens.
spells.add({
connector: "uniswap",
method: "buy",
args: [buyAddr, sellAddr, buyAmt, unitAmt, getId, setId]
});
Parameter | Type | Description |
---|---|---|
buyAddr | address | The token address to buy. |
sellAddr | address | The token address to sell. |
buyAmt | number | The amount of tokens to buy. |
unitAmt | number | The unit amount of sellAmt/buyAmt with slippage. |
getId | number | ID fetches the buy amount of buy token. |
setId | number | ID stores the sold amount of sell token. |
Sell ETH/ERC20 tokens.
spells.add({
connector: "uniswap",
method: "sell",
mad args: [buyAddr, sellAddr, sellAmt, unitAmt, getId, setId]
});
Parameter | Type | Description |
---|---|---|
buyAddr | address | The token address to buy. |
sellAddr | address | The token address to sell. |
sellAmt | number | The amount of tokens to sell. |
unitAmt | number | The unit amount of sellAmt/buyAmt with slippage. |
getId | number | ID fetches the sell amount of sell token. |
setId | number | ID stores the bought amount of buy token. |
Deposit Liquidity.
spells.add({
connector: "uniswap",
method: "deposit",
args: [tokenA, tokenB, amtA, unitAmt, slippage, getId, setId]
});
Parameter | Type | Description |
---|---|---|
tokenA | address | The token A address. |
tokenB | address | The token B address. |
amtA | number | The amount of token A. |
unitAmt | number | The unit amount of amtB/amtA with slippage. |
slippage | number | The slippage amount. |
getId | number | ID fetches the amount of token to deposit. |
setId | number | ID stores the amount of token deposited. |
Withdraw Liquidity.
spells.add({
connector: "uniswap",
method: "withdraw",
args: [tokenA, tokenB, uniAmt, unitAmtA, unitAmtB, getId, setIds]
});
Parameter | Type | Description |
---|---|---|
tokenA | address | The token A address. |
tokenB | address | The token B address. |
uniAmt | number | The uni token amount. |
unitAmtA | number | The unit amount of amtA/uniAmt with slippage. |
unitAmtB | number | unit amount of amtB/uniAmt with slippage. |
getId | number | ID fetches the uni token amount to withdraw. |
setIds | number array | ID stores the amount of tokenA and tokenB withdrawn. If not sure, pass `["0", "0"]` |
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.
Best way to stay connected with our progress.