helper function to fetch protocol states