OpenForex / KNOWLEDGE
Home / Your first TVX integration
Knowledge base
2 min read Available as Markdown

Your first TVX integration

Build a small reproducible calculation before connecting a data provider. The downloadable TVX SDK 0.1.0 supplies the same calculation used in the website's learning lab.

1. Install a known artifact

Download the package and checksums from the developer toolkit. Verify the artifact hash, then install the local tarball in your own project.

npm install ./openforex-tvx-0.1.0.tgz

Use the source archive if you want the test suite and build configuration. Its README describes the supported runtime and build commands.

2. Produce an evidence record

import { calculate } from '@openforex/tvx';

const calculation = calculate({
  amount: '120.00',
  fromValue: '0.50',
  toValue: '6.00',
  decimals: 2,
  rounding: 'half-even'
});
// calculation.result === '10.00'

All three numeric inputs are decimal strings. Preserve the returned inputs, rounding rule, output scale, exact numerator, and exact denominator with the result.

3. Test failure cases early

The amount may be zero. Both reference values must be greater than zero. Decimal inputs reject signs, grouping separators, exponent notation, and malformed strings. Output precision must be an integer from 0 through 18.

Test a zero denominator, malformed input, and a rounding tie. For snapshot-based quotes, also test missing instruments, future observations, and observations older than your chosen policy permits.

4. Define the provider boundary

Before connecting a feed, document its reference unit, valuation method, observation timestamps, and source identifiers. Retain a copy of each snapshot used for a result. Set a freshness policy deliberately; a recent network response can still contain an old observation.

The SDK's createSnapshot and quote functions validate this context. The toolkit reference describes feed adaptation and points to the complete API contracts in the source download.

5. Keep application responsibilities explicit

The calculation library does not fetch prices, hold balances, execute orders, or settle obligations. An application adding those functions needs separately defined behavior for authentication, fees, spreads, accounting, and operational failures.

Read the OpenForex Stack and kernel reference to understand the separation of responsibilities.

A useful first deliverable

Prepare a small example with pinned source, inputs, expected outputs, actual outputs, and instructions another developer can run. Use the contribution brief builder to organize a problem or proposed improvement after you can reproduce it.

Source references

The SDK API contracts define numeric inputs, output precision, rounding, and error behavior. The implementation provenance records the origin and scope of the software. These are project implementation sources; synthetic arithmetic is not independent validation of a valuation methodology.

Sources & citation

Material type
Explanatory guide
Publisher
OpenForex Society

OpenForex Society. “Your first TVX integration.” https://openforex.io/?page=seed-content%2Fguides%2Ffirst-integration. Include your access date when citing.

Download the exact published Markdown
Text fingerprint (SHA-256)db460de26c95d1033f90be47525e415d6705ccd48933d76123c7cb6ce1ad3c84

This identifies the downloadable text, not an independent approval or a permanent archived edition.

Referenced material (6)

Standards, implementation references and worked calculations identify their sources and publication status. Read our sourcing and corrections policy.

YOUR NEXT STEP · Build an implementation

OpenForex TVX developer toolkit

Step 2 of 4 in this reading path.

Continue View the complete path

Accessibility settings

Adjust the display for comfortable reading. Changes apply immediately to every page.

Light and dark modes use high-contrast colors.

Preferences are saved only in this browser. Browser zoom remains available.