def METHOD_NAME(directory, latest_block=5000):
    path = AnyPath(directory) / "rewards"
    path.mkdir(exist_ok=True)
    latest_location = path / "latest.yaml"
    with latest_location.open("w") as f:
        f.write(
            f"""