|
|
@@ -28,7 +28,7 @@ def main() -> None:
|
|
|
print(' heavy logistics', end='')
|
|
|
if p.high_opex:
|
|
|
print(' high opex', end='')
|
|
|
- print(f'\n\033[30m{p.recipe:30} \033[33m{p.capex: 6,.0f} \033[35m{p.cost_per_day: 6,.0f}\033[0m')
|
|
|
+ print(f'\n\033[30m{p.recipe:30} \033[0m{p.expertise:15} \033[33m{p.capex: 6,.0f} \033[35m{p.cost_per_day: 6,.0f}\033[0m')
|
|
|
|
|
|
def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], materials: typing.Mapping[str, Material],
|
|
|
prices: typing.Mapping[str, Price]) -> Profit | None:
|
|
|
@@ -42,8 +42,9 @@ def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], materi
|
|
|
except KeyError: # skip recipes with thinly traded materials
|
|
|
return
|
|
|
revenue = output_price.vwap * output['Amount']
|
|
|
+ building = buildings[recipe['BuildingTicker']]
|
|
|
capex = sum(bm['Amount'] * prices[bm['CommodityTicker']].vwap
|
|
|
- for bm in buildings[recipe['BuildingTicker']]['BuildingCosts'])
|
|
|
+ for bm in building['BuildingCosts'])
|
|
|
profit_per_run = revenue - cost
|
|
|
runs_per_day = 24 * 60 * 60 * 1000 / recipe['TimeMs']
|
|
|
cost_per_day = cost * runs_per_day
|
|
|
@@ -54,7 +55,9 @@ def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], materi
|
|
|
materials[output['Ticker']]['Weight'] * output['Amount'],
|
|
|
materials[output['Ticker']]['Volume'] * output['Amount'],
|
|
|
) * runs_per_day
|
|
|
- return Profit(output['Ticker'], recipe['RecipeName'], profit=profit_per_run * runs_per_day,
|
|
|
+ return Profit(output['Ticker'], recipe['RecipeName'],
|
|
|
+ expertise=building['Expertise'].replace('_', ' ').lower(),
|
|
|
+ profit=profit_per_run * runs_per_day,
|
|
|
capex=capex,
|
|
|
cost_per_day=cost_per_day,
|
|
|
low_volume=output_price.average_traded < output_per_day * 20,
|
|
|
@@ -72,9 +75,10 @@ class RecipeMat(typing.TypedDict):
|
|
|
Amount: int
|
|
|
|
|
|
class Building(typing.TypedDict):
|
|
|
- Ticker: str
|
|
|
- AreaCost: int
|
|
|
- BuildingCosts: list[BuildingMat]
|
|
|
+ Ticker: str
|
|
|
+ Expertise: str
|
|
|
+ AreaCost: int
|
|
|
+ BuildingCosts: list[BuildingMat]
|
|
|
|
|
|
class BuildingMat(typing.TypedDict):
|
|
|
CommodityTicker: str
|
|
|
@@ -101,6 +105,7 @@ class Price:
|
|
|
class Profit:
|
|
|
output: str
|
|
|
recipe: str
|
|
|
+ expertise: str
|
|
|
profit: float
|
|
|
capex: float
|
|
|
cost_per_day: float
|