Filler guide
Getting Started as a Filler
Learn how to become a filler and execute DCA orders for profit
Becoming a Filler
Anyone can execute DCA orders and earn profits. No registration or permission required. Fillers can use our Order Fill API to quote orders before execution.
Understanding Fill Opportunities
How Filling Works
- Monitor Orders: Track orders approaching execution time
- Quote Fill: Use API to calculate profitability
- Execute: Fill profitable orders
- Profit: Receive input tokens plus profit margin
The Dutch Auction Mechanism
DCA.fun uses a Dutch auction system that starts expensive for users and becomes cheaper over time:
*assume: 100bp (1%) slippage with a 2 minute scaling interval
Time Since Executable → User Price (Filler Opportunity)
0 seconds → Market + 1% (worst for order creator)
1 minute → Market (fair price, minimal filler profit)
2 minutes → Market - 1% (best for order filler)Quick Start Guide
Step 1: Set Up Monitoring
// Monitor new orders
dcaDotFun.on("CreateOrder", async (orderId, creator, params) => {
console.log(`New order ${orderId} created`);
// Add to tracking system
await trackOrder(orderId);
});Step 2: Quote Orders
// Quote order profitability
const quote = await fetch(
`https://api.dca.fun/quote?orderId=${orderId}&chainId=${chainId}`
).then((r) => r.json());
console.log(`Fillable amount: ${quote.fillableAmount}`);
console.log(`Expected output: ${quote.amountOfTokenOut}`);Step 3: Execute Fills
// Calculate profit
const profit = calculateProfit(quote);
// Execute if profitable
if (profit > minProfit) {
await dcaDotFun.fillOrder(quote.encodedData, myAddress);
}Finding Profitable Orders
Strategy 1: Event Monitoring
// Track all active orders
const activeOrders = new Map();
// Add new orders
dcaDotFun.on("CreateOrder", (orderId, creator, params) => {
activeOrders.set(orderId, {
nextExecution: Date.now() + params.freqInterval * 1000,
...params,
});
});
// Remove cancelled/completed orders
dcaDotFun.on("CancelOrder", (orderId) => {
activeOrders.delete(orderId);
});Strategy 2: Periodic Scanning
async function scanForOpportunities() {
const currentTime = Date.now() / 1000;
for (const [orderId, order] of activeOrders) {
// Check if executable
if (currentTime >= order.nextExecution) {
const quote = await getQuote(orderId);
if (isProfitable(quote)) {
await fillOrder(quote);
}
}
}
}
// Run every minute
setInterval(scanForOpportunities, 60000);Strategy 3: Targeted Monitoring
Focus on specific characteristics:
- High-value orders (larger profits)
- Frequent executions (more opportunities)
- Specific token pairs you specialize in
- Orders with higher slippage tolerance
Capital Requirements
Direct Fills
For direct fills, you need:
- Output Tokens: Full amount to provide to the user
- Permit2 Approval: Must approve Permit2 contract for token transfers
- Gas: Transaction fees (ETH or native token)
- Buffer: Extra for price movements and slippage
Example:
- Order wants 1 WETH
- You need: 1 WETH balance + Permit2 approval + gas fees
Permit2 Setup
Before filling orders, approve the Permit2 contract:
// One-time approval for Permit2
const permit2Address = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
const outputToken = new Contract(tokenAddress, ERC20_ABI, signer);
// Approve Permit2 to spend your tokens
await outputToken.approve(permit2Address, ethers.constants.MaxUint256);Callback Fills
With callbacks, you can:
- Use flash loans for capital efficiency
- Execute atomic arbitrage within the transaction
- Require no upfront capital (only gas)
- Implement complex routing strategies
Risk Management
Price Risk
- Monitor quote prices closely
- Set maximum slippage tolerance
- Use MEV protection
Gas Risk
- Set gas price limits
- Monitor network congestion
- Batch orders when possible
Smart Contract Risk
- Audit your contracts
- Test thoroughly on testnet
- Use battle-tested libraries
Common Pitfalls
- Gas Costs: Always factor in transaction fees
- Price Volatility: Market can move during execution
- Competition: Other fillers may front-run
- Failed Transactions: Orders may be filled by others
Best Practices
- Start Small: Test with small amounts first
- Monitor Performance: Track success rates
- Optimize Gas: Batch operations when possible
- Stay Updated: Follow protocol updates
- Diversify: Fill orders across multiple tokens