Setup Account

DeFi Smart Account Setup

Every user needs to create Smart Account to interact with DeFi Protocols seamlessly; this allows developers to build extensible use-cases with maximum security and composability. You can also create multiple account for a single address.

  • Create Smart Account - build()
  • Fetch Smart Accounts - getAccounts()
  • Set Smart Account - setInstance()


Create a DSA Account. If the account is already created, you can use the setInstance method to activate a paricular DSA account and start casting spells.

// in async functions

// or

The build method also accepts an optional parameters as shown below:{
  gasPrice: gasPrice // estimated gas price
  origin: origin,
  authority: authority,

View this Gist for estimation of gas price

gasPricestring/numberThe gas price in gwei. Mostly used in Node implementation to configure the transaction confirmation speed.
originaddressThe address to track the origin of transaction. Used for analytics and affiliates.
authorityaddressThe DSA authority. The address to be added as authority.
fromaddressThe account with which you want to create your DSA. This is helpful to create DSA for other addresses.
noncestring/numberNonce of your sender account. Mostly used in Node implementation to send transaction with a particular nonce either to override unconfirmed transaction or some other purpose.

The method returns the transaction hash.

This creates a uniquely numbered Smart Account which acts as a proxy to interact with verified DeFi protocols and each DSA has a unique ethereum address.


Fetch all the accounts owned by an ethereum address by calling getAccounts().

// in async functions
await dsa.getAccounts(address)

// or
addressaddressAn ethereum address.

The method returns an array of objects with all the DSA accounts where address is authorised:

      id: 52, // DSA ID
      address: "0x...", // DSA Address
      version: 1 // DSA version


Be sure to configure global values by calling setInstance(). You can get the id by calling getAccounts(). The configured account will be used for all subsequent calls.

dsa.setInstance(dsaId); // DSA ID
dsaIdNumberDSA ID to be used for casting.

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.