DCA
Automated Dollar-Cost Averaging (DCA) strategy to invest steadily over time, minimizing the impact of market volatility and building positions across multiple assets or pools with ease.
A system for automating regular, periodic investments to reduce the impact of volatility.
Initialization
const afSdk = new Aftermath("MAINNET");
await afSdk.init(); // initialize provider
const dca = afSdk.Dca();Constants
DCA.constants = {
gasAmount: BigInt(50_000_000),
};Order Management
Fetch Orders
// Get all DCA orders - deprecated
const allOrders = await dca.getAllDcaOrders({
walletAddress: "0x...",
});
// Get only active orders
const activeOrders = await dca.getActiveDcaOrders({
walletAddress: "0x...",
});
// Get past orders
const pastOrders = await dca.getPastDcaOrders({
walletAddress: "0x...",
});Create DCA Order
Cancel DCA Order
User Management - Deprecated
Types
Order Types
Example Usage
Last updated