We investigate a class of infinite-dimensional modular Lie algebras, graded over the positive integers, in which every homogeneous component has dimension one or two. We identify these Lie algebras with loop algebras of certain simple Lie algebras of Hamiltonian type. These Lie algebras are not finitely presented, but certain central extensions of them are, and we give an explicit construction for the latter