Skip to main content

Fee & P&L Calculation Framework

1. Executive Summary

This section defines the Fee & P&L Calculation Framework for Ratio FX — the complete logic for how revenue is generated from FX swaps, how profit is distributed among protocol participants, and how rebalancing costs are accounted for.

Core Design Principles

  • All distribution parameters are admin-configurable via ProtocolConfig contract and database. No hardcoded values.
  • Volume-tiered fee schedule: fixed fee, variable fee, and base spread vary by transaction size per corridor. Larger transactions receive better rates. See Volume-Tiered Fee Schedule for the full tier tables and resolution logic.
  • LP rewards are denominated in kUSD. LPs realise rewards by withdrawing directly (OffRamp) or converting via FX Engine — both paths generate additional protocol revenue.
  • Two LP classes (A: FX-only, B: Full participation) with separate kToken indices and configurable per-partner fee tiers.
  • WAOP-based batch accounting tracks rebalancing costs to determine true protocol profitability.
  • Protocol Treasury (KF) acts as insurance — absorbs all losses. LP equities never decrease.

Dependencies

ComponentDependency
FX EngineSwap execution, spread construction, fee capture, atomic 50/30/20 split
VaR & Emergency RFQRisk monitoring; Emergency RFQ may produce swaps with different fee profiles
Inventory SkewDynamic mid-rate adjustment feeds into spread calculation
Smart RebalancingTriggers external rebalancing; WAOP batch close and COGS calculation
LP WithdrawalskUSD withdrawal paths; OffRamp fee capture
Liquidity OnboardingClass A/B classification, per-partner fee tier multipliers, dual kToken index

2. Revenue Sources

The protocol generates revenue from three distinct sources, each with its own distribution logic.

Source 1: FX Swap Revenue

Every FX swap generates two fee components that together form the Swap Profit:

P_swap = Σ ( Spread_Profit + Platform_Fee_Profit )
P_swap = Σ ( (V_i × (R_oracle - R_quote)) + (V_i × F_platform × R_oracle) )

Platform Fee Structure (Volume-Tiered):

The platform fee varies by transaction size. Each corridor has a set of fee tiers with different fixed and variable rates. The applicable tier is resolved at quote time based on the transaction amount in source currency.

ComponentCalculationExample ($5,000 swap, USD-IDR SMALL tier)
Fixed FeePer-tier amount in destination currency, converted to source at oracle rate10,000 IDR ÷ 15,800 = $0.633
Variable FeeSource Amount × tier's variable_fee_bips$5,000 × 0.05% = $2.50
Total Platform FeeFixed + Variable$3.133
Amount to ConvertSource Amount − Platform Fee$4,996.87

For the complete tier tables and resolution logic, see Volume-Tiered Fee Schedule.

Spread Components:

Total Spread = Base (from tier or corridor default) + Volatility Add-on + Liquidity Add-on + Inventory Skew

The tier's spread_override_bps replaces only the Base component. Volatility, Liquidity, and Inventory Skew are still calculated dynamically based on real-time market conditions. The spread widens progressively across NORMAL → PROTECT → RESTRICT states as defined in the FX Engine.

Source 2: Yield Engine Revenue

Idle liquidity deployed to external strategies (e.g., SuperEarn) generates passive yield. This revenue is exclusive to Class B LPs.

AttributeDetail
Distribution100% to kXXX-full Vault via updateIndex(). Class A (kXXX-fx) index is never updated by yield.
Loss HandlingYield losses are absorbed entirely by Class B kXXX-full index. Class A is firewalled with zero impact.
Revenue SplitDoes NOT enter the 50/30/20 split. Flows directly to Class B LPs.

Source 3: LP Reward Conversion Revenue (kUSD Flywheel)

When LPs realise their kUSD rewards, they generate additional protocol revenue through one of three exit paths:

Exit PathLP ActionRevenue to Ratio
A. OffRamp WithdrawalLP withdraws kUSD as USDT/fiat via OffRamp partnerOffRamp fee charged (OFFRAMP_FEE_BIPS, default 20 bips). Fee goes to Protocol Treasury.
B. FX Engine SwapLP converts kUSD to kIDR/kMYR/kSGD via FX EngineStandard swap fees apply (tiered schedule based on amount). Treated as a regular FX transaction with full 50/30/20 split.
C. Hold & CompoundLP keeps kUSD in wallet. It compounds into equity for future distribution calculations.No immediate revenue. Increases LP's future share of distributions.
Revenue Flywheel (Path B)

LP earns kUSD rewards → LP converts kUSD to IDRX via FX Engine → FX Engine charges tiered platform fee + spread → That fee is split 50/30/20 → Transaction LPs earn new kUSD → Those LPs may convert their kUSD too → cycle repeats. At scale, this organic volume becomes a meaningful percentage of total FX Engine throughput.