Structure-based optimization to improve the affinity of a lead compound is an established approach in drug discovery. Knowledge-based databases holding molecular replacements can be supportive in the optimization process. We introduce a strategy to relate the substitution effect within matched molecular pairs (MMPs) to the atom environment within the cocrystallized protein-ligand complex. Virtually Aligned Matched Molecular Pairs Including Receptor Environment (VAMMPIRE) database and the supplementary web interface ( http://vammpire.pharmchem.uni-frankfurt.de ) provide valuable information for structure-based lead optimization.