
Spark
A Smarter Way To Manage Your Social Marketing Campaigns
Demo
About
The problem it solves # Running a Marketing Campaign on Farcaster with Spark Anyone can run a marketing campaign on Farcaster and use Spark to organize and manage it in a decentralized and transparent way. ## Setting Up Your Campaign Campaign owners have control over their budget, tagline, and the URL embed for registered influencers to use. They also determine how various actions on Farcaster are scored when performed by registered influencers. For example: - **7 points** for recasting or using the campaign frame embed URL ## Influencer Registration and Participation Influencers register once with the Spark protocol. After registration, they can join any active or upcoming campaign. Influencers earn points by performing specific actions such as: - Following - Liking - Recasting - Replying - Mentioning - Casting with the campaign tagline - Casting with the campaign URL The points for each action are set by the campaign owner and multiplied by the number of followers the influencer has. ## Preventing System Abuse Each influencer starts with a **Spammer Factor of 1**. If an influencer tries to game the system (e.g., by unliking and reliking the same post), the number of points deducted is calculated as: ```Action Score x Influencer Followers x Spammer Factor``` The Spammer Factor doubles each time an influencer negates a previously awarded action, quickly reducing his/her total score to zero. ## Campaign Completion and Rewards At the end of the campaign, the Spark protocol takes **10% of the initial budget**. The remaining budget is distributed proportionally among the influencers based on their points relative to the total accumulated campaign points. All scoring and payments are handled automatically via Base-deployed smart contracts, ensuring transparency and security.
How it's made
Challenges we ran into ### First Half of the Month - Learning and Overcoming Challenges During the first half of the month, I delved into several technologies including **Base Smart Wallet**, **Farcaster**, **Neynar**, **Webhooks**, **Frog frames**, and **Onchain Kit and Apps**. Despite my experience, I faced challenges: - **Incomplete Documentation**: Some repositories lacked crucial information. - **Implementation Issues**: Certain functionalities did not match the documentation. - **New Architectures**: Transitioning to Smart Wallet pass keys posed integration challenges for managing multiple accounts and devices. Teams behind Base, Neynar, Farcaster, and Frog were responsive on Discord and Telegram, helping with issue identification, providing missing documentation, and fixing bugs promptly. ### Design and Architecture Challenges The project's complexity necessitated robust design decisions. Initially, I planned to use **Chainlink Functions on Base** to poll Farcaster via Neynar Rest API. However, frequent polling was impractical due to the volume of actions, active campaigns, and influencers, leading to excessive costs. ### Solution with Neynar Webhooks The solution emerged with **Neynar's Webhooks**: 1. **Campaign Registration**: During registration, we set up monitoring. 2. **Webhook Integration**: Neynar Webhooks notify our server instantly. 3. **Smart Contract Interaction**: Our server updates contracts based on webhook notifications. This design eliminated polling needs and enhanced real-time monitoring. **Note**: Once Farcaster moves certain functionalities on-chain (e.g., emitting an on-chain event when an influencer interacts with the protocol), we could enhance the existing approach by incorporating Chainlink Automations.