We are using Linear Programming

Instructions

pip install numpy
pip install scipy
python3 code.py

Mathematical Equations

Equalities

borrow

  • usdc : x1 + x2 + x3 + x4 + x5 ≥ 2m
  • usdt : y1 + y2 + y3 + y4 + y5 ≥ 3m
  • eth : z1 + z2 + z3 ≥ 10m

supply

  • usdt : a1 + a2 + a3 ≤ 1m
  • dai : b1 + b2 + b3 ≤ 2.5m
  • eth : c1 + c2 + c3 + c4 + c5 + c6 ≤ 9m
  • weth : d1 + d2 + d3 ≤ 15m

Inequalities

  • aave : 0.8*(1.75m + a2 + b3 + c4 + d3) ≥ x1 + y1 + z3

  • spark : (a1 + b1 + c5)*0.8 ≥ x2 + y3 + z1

  • morpho : (a3 + b2 + c6)*0.8 ≥ x3 + y2 + z2

  • f eth usdt : c1*0.8 ≥ y4

  • f eth usdc : c2*0.8 ≥ x4

  • f weth usdc : d1*0.8 ≥ x5

  • f weth usdt : d2*0.8 ≥ y5

  • all variables ≥ 0

Objective equation

Z = 0.0776a1 + 0.0437a2 + 0.0392a3 + 0.0998b1 + 0.0675b2 + 0.0612b3 + 0.0866c1 + 0.0856c2 + 0.0732c3 + 0.0163c4 + 0.0109c5 + 0.0033c6 + 0.0338d1 + 0.0338d2 + 0.0242d3 - 0.0813x1 - 0.0828x2 - 0.0915x3 - 0.1505x4 - 0.1505x5 - 0.0437y1 - 0.0768y2 - 0.0908* y3 - 0.1493y4 - 0.1493y5 - 0.019z1 - 0.0169z2 - 0.0246*z3