
ReferFi
ReferFi is the first on-chain referral protocol. It can let decentralized exchanges share a part of fees with promoters. Anyone can create a referral link of a DEX and earn commission.
Demo
About
The problem it solves To DEX: DEX(Decentralized Exchanges) always needs more users. Actually 40% of CEX(Centralized Exchanges like Binance) users come from referral programs, but most DEX do not have this ability. Therefore, with 0 code, DEX can use referFi to grow its user base, by sharing a percentage of its trading fee. To Promoters: Every user has some crypto friends and is willing to make more revenue. By generating a personal referral link from referFi in 10 seconds, user can earn thousands of USDT per month from the tradings made by their invitees. To Invitees: Invitees can also get a discount on DEX’s service fees when they use the referral link. So we can help them to save some money in on-chain transactions.
How it's made
Challenges we ran into 1. When dealing with token price fetching, the fluctuations of token prices was a challenge. By monitoring some large and stable pools, we are able to build our offline service of token price query. 2. Cashback claiming might cause duplicated executions. We use a design pattern of asynchronous tasks where users only submit claiming requests and the system handles them using a task queue periodically. 3. The end-to-end latency from transaction completion to cashback arrival. We leverage the goroutine for requesting GraphQL data. Normalizing data structure to speed up queries is useful as well.