Curve Y

Swapping and On-chain Liquidity from Y Pool

Curve connector triggers methods like buy, sell and withdraw. You can view details like source code, ABIs on Etherscan.

  • use -1 or dsa.maxValue for the maximum amount in functions.
  • If not sure about the arguments getId and setId, pass 0.

Sell

Sell Stable ERC20 Token.

spells.add({
  connector: "curve-y",
  method: "sell",
  args: [buyAddr, sellAddr, sellAmt, unitAmt, getId, setId]
});
ParameterTypeDescription
buyAddraddressThe address of the token to buy.
sellAddraddressThe address of the token to sell.
sellAmtnumberThe amount of token to sell.
unitAmtnumberThe amount of buyAmt/sellAmt with slippage.
getIdnumberID stores the amount of token deposited.
setIdnumberID stores the amount of token deposited.

Deposit

Deposit Token into the Curve Pool.

spells.add({
  connector: "curve-y",
  method: "deposit",
  args: [token, amt, unitAmt, getId, setId]
});
ParameterTypeDescription
tokenaddressThe token address to deposit.
amtnumberThe amount of tokens to deposit. use -1 or `dsa.maxValue` to deposit 100%.
unitAmtnumberThe amount of curve_amt/token_amt with slippage.
getIdnumberID fetches the amount of token to deposit.
setIdnumberID stores the amount of token deposited.

Withdraw

Withdraw Token from the Curve Pool.

spells.add({
  connector: "curve-y",
  method: "withdraw",
  args: [token, amt, unitAmt, getId, setId]
});
ParameterTypeDescription
tokenaddressThe token address to deposit.
amtnumberThe amount of tokens to deposit. use -1 or `dsa.maxValue` to withdraw 100%.
unitAmtnumberThe amount of curve_amt/token_amt with slippage.
getIdnumberID fetches the amount of token to deposit.
setIdnumberID stores the amount of token deposited.


If you still can't find something you're looking for or have any questions, ask them at our developers community on Telegram, 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.