Gravar-mail: Linking agent-based models and stochastic models of financial markets