DZap Documentation
  • 🌐Introduction to DZap
  • Why DZap
    • Problems in DeFi Today
  • How DZap.io Fits into the DeFi & Cross-Chain Ecosysteme
  • How DZap.io Works
  • Main Components of DZap & How They Work Together
  • How DZap Abstracts Away Complexity for Developers & Users
    • For Users
    • For Developers & Protocols:
  • Products
    • Unified Liquidity in DeFi
    • AI Agents Toolkit
    • Use Cases
    • Key Features
    • Fees
  • Chains, Dex's & Bridges
  • Roadmap
  • Frequently Asked Questions (FAQs)
  • Integration, Fee & Security
    • Troubleshooting & Self Serve Guide
    • Terms
    • Contract Address
    • Audit Reports
    • Privacy
    • Security
  • APIs & Endpoints
  • DZap XP Points System
  • Tutorial
    • Batch Swap via DEX Aggregator
    • Batch swap via Bridge Aggregator
    • Minting LST from Any Chain
  • Socials
    • 🌐Website
    • 🐦Twitter
    • 👾Discord
    • Ⓜ️Medium
  • DZap SDK
    • Dollar Cost Averaging (DCA)
      • Overview
      • Installation
      • Quick Start
      • Usage Guide
      • Methods
      • Data Types
Powered by GitBook
On this page
  • Prerequisites
  • Allowance and Approval
  1. DZap SDK
  2. Dollar Cost Averaging (DCA)

Installation

To install the DZapDcaClient SDK, use either npm or yarn:

npm install dzap-dca-client 
# or
yarn add dzap-dca-client 

Prerequisites

Before using the DCA functionalities, it's essential to grant token allowances to the DZap DCA contract. The DZapDcaClient SDK supports two approval methods:

  • Permit2 Approval: Recommended for most use cases, this standard method enables users to authorize the DZap DCA contract to manage tokens by signing a permit.

  • ERC20 Token Approval: In this method, users directly approve token allowance to the DZap DCA contract.

Developers should choose an appropriate approval method based on user needs and project requirements.

Allowance and Approval

To allow the DZap DCA contract to manage trades on behalf of users, set up token allowances. The default method for allowances is Permit2. If you prefer direct ERC20 approvals, change the default behavior using the setConfig method.

PreviousOverviewNextQuick Start

Last updated 7 months ago