Controlling a Piston Variable Pump with a Raspberry Pi
You should instead use a PWM output from the Raspberry pie, not the DAC.
Then connect the PWM to a mosfet or just NPN transistor.

And you will need a shunt resistor to have a feedback of the current and control it with a PID.

The problem with PWM is it will control the voltage output, but the solenoid of the Pump can change resistance with temperature and the displacement is according to the current, not the voltage on the solenoid. That's why you need current feedback if you want precision.

The code I used to control a variable pressure relief valve with arduino :

  I1 = analogRead(A3); // Read the current from the shunt resistor

  E0 = I0-I1;  // Compare with I0 the current I want to send to the solenoid

  Integral += Ki*E0;  // Adjust the Ki here

  if(Integral&gt;800){Integral = 800;}  // Anti-Windup

  else if(Integral&lt;-800){Integral = -800;}

  Temp = K_0*I0 + Integral + Kp*E0; // Command sent to the PWM output, 0-1024

  if(Temp&gt;1024){Temp = 1024;}else if(Temp&lt;0){Temp = 0;}

  OCR1A = Temp;   // PWM duty cycle register