[OLD] Instadapp Docs
  • Introduction
  • DeFi Smart Account (DSA)
  • DSA SDK
    • Running Instadapp SDK
  • 💻Instadapp GUI
    • Integrated Protocols
      • Aave
      • Compound Finance
      • MakerDAO
    • Strategies
    • Multi-Protocol Refinancing
    • Authorities
    • Debt Collateral Ratio
  • 👩‍💻 DSA SDK
    • Casting Spells
    • Build a Connector
    • Connectors
      • Basic
      • Authority
      • Instapool
      • MakerDAO
      • Compound
      • Comp
      • Aave
      • dYdX
      • 1Inch
      • Uniswap
      • OasisDEX
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • Resolvers
      • Accounts
      • Balances
      • Instapool
      • MakerDAO
      • Compound
      • Aave
      • dYdX
      • 1inch
      • Uniswap
      • OasisDex
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • getId/setId
    • Example Use Cases
      • Long ETH
      • Short DAI
      • Debt Swap
      • Lending Bridge
      • Lending Swap
      • Debt Bridge
  • 👩‍🏫 Tutorials
    • Getting Started
    • Moving Assets into DSA
    • In-App Swaps
  • Additional Info
    • Contract Infomation
    • FAQs
    • Security Audits
    • Release History
  • 🌏Links
    • Homepage
    • DApp
    • Discord
    • Contact Us
Powered by GitBook
On this page
  • Deposit
  • Withdraw
  1. 👩‍💻 DSA SDK
  2. Connectors

Basic

Deposit & Withdraw from DSA

Instadapp SDK contains several connectors that are used for basic functions; such as depositing and withdrawing tokens DSA. Those connectors are described below:

Deposit

This is the basic connector for deposit

spells.add({
  connector: "basic",
  method: "deposit",
  args: [token, amount, getId, setId]
});

Parameter

Type

Description

token

address

The token address to deposit

amount

number

The amount of tokens to deposit. (use -1 or 'dsa.maxValue' to deposit entire available balance)

getId

number

ID fetches the amount of token to deposit

setId

number

ID stores the amount of token deposit

You can always also deposit by sending tokens directly to the DSA address. The DSA will accept ERC-20 tokens directly into its address.

The Instadapp GUI only displays DeFi related assets. Please also note that some exchanges do not allow withdrawals to smart contracts.

Withdraw

This is the basic connector for withdrawals

spells.add({
  connector: "basic",
  method: "withdraw",
  args: [token, amount, to, getId, setId]
});

Parameter

Type

Description

token

address

The token address to withdraw

amount

number

The amount of tokens to withdraw (use -1 or 'dsa.maxValue' to withdraw the entire available balance)

to

address

getId

number

ID fetches the amount of token to withdraw

setId

number

ID stores the amount of token withdraw

Withdrawals from the DSA can only be completed from and to authorities of the DSA; if you would like to withdraw to an second account you can make the second account an additional authority to the DSA.

PreviousConnectorsNextAuthority

Last updated 4 years ago

The 'to' address to withdraw. (DSA can only withdraw tokens to )

Authorities