3.3.3 Follower Execution

• On detecting a new trade by the lead:

1. The system checks which users follow that trader.

2. For each follower, the system places a replica trade. This could be:

• On-Chain: If the user’s wallet is linked and they’ve approved a contract to trade on their behalf.

• Centralized Exchange: If the user has an API key for Binance/Coinbase, the system triggers an order.

async function replicateTrade(leadTradeData) {
  const followers = await getFollowers(leadTradeData.leadTraderId);
  for (const follower of followers) {
    // Check user’s risk settings (max % of portfolio, etc.)
    // placeTradeOnExchange(follower.exchangeApiKey, leadTradeData);
    // or on-chain execution
  }
}

Last updated