triangulated-fx-rates
Agent skill frombenchflow-ai/skillsbench
Reference for multi-hop / triangulated currency conversion on batch rate tapes. When a rate row carries an explicit "via" currency, the row's rate is only one leg of the conversion, and the via currency may ITSELF be quoted through another via — so the effective rate is the product of every leg, resolved by walking the chain until a direct quote is reached. Useful when an FX feed lists some pairs directly to the reporting currency and others as triangulated (or doubly-triangulated) quotes through vehicle currencies.
How to install triangulated-fx-rates
npx skills add benchflow-ai/skillsbench# or add only this skill to Claude Code: copy the folder
tasks-extra/cobol-gl-batch-reconcile/environment/skills/triangulated-fx-rates/
# into
~/.claude/skills/triangulated-fx-rates/ (all projects)
.claude/skills/triangulated-fx-rates/ (one project)
tasks-extra/cobol-gl-batch-reconcile/environment/skills/triangulated-fx-rates/SKILL.md
Apache-2.0Full file1# Triangulated FX rates23Most rate feeds list a direct rate to the reporting currency (typically4USD). Less liquid currencies are often quoted *through* a more liquid5vehicle currency (commonly EUR or USD itself). On a batch rate tape this is6encoded as a second "via" column on the same row:78```9CCY RATE VIA10USD 1.000011EUR 1.085012GBP 1.275013CHF 0.9200 EUR <-- CHF -> EUR is the first hop14ZAR 0.0650 EUR <-- ZAR -> EUR is the first hop15BRL 0.3000 ZAR <-- BRL -> ZAR -> EUR -> USD : TWO via hops16JPY 0.006417```1819A blank `VIA` column means the row is already a direct quote against the20reporting currency. A non-blank `VIA` column means the row gives the rate21from CCY to VIA — and you still need to convert from VIA to the reporting22currency.2324## The via chain can be longer than one hop2526This is the part that is easy to get wrong. The via currency named on a row27is **not guaranteed to be a direct quote** — it may have its own non-blank28via column, which in turn may have another, and so on. A single via lookup29is therefore only correct when the via happens to be direct. To get a30correct effective rate you must **follow the chain**: keep multiplying in the31next leg's primary rate, moving to that leg's via, until you reach a row32whose via is blank (a true direct quote against the reporting currency).3334```35effective_rate(CCY) = primary(CCY) × primary(via(CCY)) × primary(via(via(CCY))) × …36…
Excerpt shown under the repository's Apache-2.0 license.
