i would guess they had a deal for at least 3 to start with. think i read show runners were wanting 5 or so, but also wanted more money and episodes per season. it already went from estimated $10m per in s1 to $12-14m per ep in s4. think it did better than citadel which amazon sunk a ton into, something like $300m for season1.
until recently would thought they would keep it going for 4 or so, just to alternate with rings of power, but amazon got the rights to fourth ring series which is romance with dragons or something