• SPREADS
  • GROSS
  • NET
  • HUMAN

How to calculate crack spreads and margins with your agent

Connect your agent to your refinery data once. From there, you can run profitability math for any crude or product mix through a simple chat.

Ask AI about this page

Our technology reaches across leading technology and enterprise teams.

  • Amazon
  • NVIDIA
  • Red Hat
  • Fidelity Investments
  • Intuit
  • OLX Brasil
  • Writesonic
  • Artium
  • Trolley
Bunny World Voxel Workspace

Short answer

How can I use AI to calculate crack spreads and margins?

You provide your crude grades and expected product yields to your agent, which then uses the Refinery Margin Calculator to run the math. You get immediate gross and net profitability breakdowns for your specific refinery configuration.

The results you get

Profitability analysis outcomes

Running these calculations gives you three distinct views of your refinery's performance.

SPREADS

Crack spread analysis

Your agent calculates the difference between crude costs and product values. You see the raw spread for specific product combinations.

GROSS

Gross margin totals

Your agent determines the total profit before operating costs. This shows the baseline profitability of your current feedstock.

NET

Net profitability

Your agent subtracts operating expenses from your gross figures. You get the final bottom-line number for a specific run.

HUMAN

Strategic decisions

Your agent provides the numbers, but you decide which crude grades to purchase or which yields to target based on the results.

The workflow

What your agent does when the data arrives.

Your agent handles the heavy lifting of the math so you can focus on the market trends.

  1. Identify the spread

    Your agent looks at the price difference between your crude input and the finished products. This establishes your baseline spread.

    calculate_crack_spread
  2. Calculate gross profit

    Your agent applies your yield percentages to the product prices to find the total gross margin.

    calculate_gross_margin
  3. Determine net profit

    Your agent factors in your operating costs to move from gross to net profitability.

    calculate_net_margin
  4. Compare scenarios

    You can ask your agent to rerun the math using different crude grades or different yield assumptions to see how they change your margins.

    calculate_gross_margincalculate_net_margin

Vinkius Agentic Execution Platform

State the outcome. Agents take it from there.

You don't have to drive this run by hand. Inside the Vinkius Agentic Execution Platform, agents pick up the task above and carry it to the end: you set the limits, you watch the steps, you keep all decisions.

Run it in Vinkius

Agents carry the task to the end

Agents execute Refinery Economics tasks from end to end inside the Vinkius Agentic Execution Platform: set the outcome, and the steps run.

Take it to any compatible AI

One connection, any client

Same connection follows you to ChatGPT, Claude, Gemini and any other client you love. Switch whenever you want: your connection, your permissions and your record move with you.

Spaces

One Space per activity

A Space gathers the context, tools and tasks of one activity, so you coordinate several agents at once and follow each execution as it happens.

Limits

Autonomy inside limits you set

Permissions and spending limits are yours to define. Agents halt for your approval on anything sensitive, and you choose how far autonomy goes, step by step or end to end.

Record

All steps, on the record

Each action your agents take lands in a signed audit trail. Results are verified, mistakes are learned from, and an emergency stop is one click away.

Models

Included in your plan

A curated selection of AI models is included in your plan, and you can add your own through BYOK whenever you prefer.

Try it

Copy these to start.

Use these prompts to trigger the calculations immediately.

Starting points

Swap out the crude types and product yields in these prompts to match your actual refinery setup.

Refinery Economics Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_kcMkhyqnOApI7Pww2eCvIcKnRsq0pMK3FitczMzr/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat, Refinery Economics capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "refinery-margin-calculator-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_kcMkhyqnOApI7Pww2eCvIcKnRsq0pMK3FitczMzr/mcp"
    }
  }
}
Copy into chat04
  • 01

    Calculate the crack spread for WTI versus ULSD using my current yield data.

  • 02

    What is the gross margin if I switch to Brent crude with a 40% gasoline yield?

  • 03

    Run a net margin calculation for my current configuration including all operating costs.

  • 04

    Compare the net profitability of running Light Sweet versus Heavy Sour crude.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Refinery Margin Calculator once, then ask.

You only need to link the MCP to your client once. Your credentials stay encrypted and secure, and you can start asking for margin math immediately.

Connect Refinery Margin Calculator to your agent

FAQ

How the calculator behaves

  • 01

    Can your agent change my actual refinery settings?

    No. Your agent only performs calculations based on the data you provide or the data it reads. It cannot modify your operational systems.

  • 02

    Does your agent decide which crude to buy?

    No. Your agent provides the margin calculations, but you are responsible for making the final purchasing and operational decisions.

  • 03

    Can I use this with Claude or Cursor?

    Yes, as long as you are using an MCP-compatible client, you can use this Connector.

  • 04

    Do I need to manually enter each price?

    Your agent can pull data if it has access to your pricing sheets, or you can paste the current prices into the chat.

  • 05

    Can it calculate net margins without operating costs?

    No. To use the net margin tool, you must provide the operating cost data.

  • More questions about Refinery Margin Calculator? The Connector page answers them. See everything the Refinery Margin Calculator Connector can do

Building with AI? Ship this whole workflow in your product.

Vinkius Connect is the connectivity layer for AI builders. All the capabilities used on this page, from Refinery Economics to thousands more, arrive through one SDK, already maintained for you. One Application, unlimited seats, each with their own connectors and credentials, isolated and never exposed to Vinkius. No OAuth flows to write, no tokens to store, no APIs to chase.

Explore Vinkius Connect

TypeScript · Python · Java · Go · C# · PHP · Rust

  • 01

    Your customers bring their own keys.

    Each user connects their own apps and keeps their own credentials. Vinkius only sees the identifier your backend sends.

  • 02

    Whole catalog, kept current.

    Refinery Economics plus thousands more, maintained and growing daily. No integrations to write, no token storage, no OAuth plumbing.

  • 03

    Any agent, any model.

    Capabilities land as framework-neutral objects, with adapters for OpenAI, Anthropic, Gemini, the Vercel AI SDK, LangChain and more.

Connect Refinery Economics to Claude, Cursor, ChatGPT & more

From idea to done

See what gets done when the agents take over the busywork

Each workflow on this page runs on the same platform. Connect your tools once, and your agents keep working in any AI you trust.