Skip to main content

Worked Example — 3 LPs, 3 Days

1. Setup

Oracle Reference Rates: 1 USD = 15,000 IDR | 1 USD = 4.7 MYR

LP Deposits

LPClassCurrencyDepositUSD ValueMultiplierkToken
LP-USDB (Full)USDT2,000 USD2,0001.0×kUSD-full
LP-IDRA (Issuer)IDRX90M IDR6,0000.5×kIDR-fx
LP-MYRB (Full)MYRC4,700 MYR1,0001.0×kMYR-full

Protocol Parameters

ParameterValue
KF_SHARE_PCT50%
TXN_LP_SHARE_PCT30%
GLOBAL_LP_SHARE_PCT20%
LP-IDR (IDRX Issuer) ClassA Multiplier0.5×
OFFRAMP_FEE_BIPS20 bips

Fee Tier Applied (USD-IDR, Day 1 & 3)

Day 1 and Day 3 are USD → IDR swaps. The transaction amounts determine which fee tier applies. See Volume-Tiered Fee Schedule for the full tier table.

For this example, the swaps generate the following gross profits after tier-based fees and spread are applied:

Starting equities: LP-USD = 2,000 | LP-IDR = 6,000 | LP-MYR = 1,000. KF kUSD = 0.


2. Day 1: USD → IDR, Gross Profit = +300 USD

Step 1 — Classify LPs: Transaction LPs (corridor pools): LP-USD, LP-IDR. Global LPs (non-corridor pools): LP-MYR.

Step 2 — Apply Configurable Split:

BucketCalculationkUSD
KF (Treasury)300 × 50%150.00
Transaction LP300 × 30%90.00
Global LP300 × 20%60.00

Step 3 — Distribute Transaction Bucket (90 kUSD):

Effective weight calculation with Class A/B multipliers:

LPEff. WeightCalculationkUSD Received
LP-USD (B, 1.0×)2,00090 × 2000/500036.00
LP-IDR (A, 0.5×)3,00090 × 3000/500054.00

Total effective weight = 5,000.

Step 4 — Distribute Global Bucket (60 kUSD):

Only LP-MYR eligible (sole non-corridor pool) → receives 60.00 kUSD.

Step 5 — WAOP Recording:

Swap recorded to Rebalancing Batch #101 (USDT-IDRX). WAOP = 15,000 IDR/USD.

Day 1 Summary

PartykUSD EarnedCumulativeUpdated Equity
LP-USD36.0036.002,036.00
LP-IDR54.0054.006,054.00
LP-MYR60.0060.001,060.00
KF150.00150.00

3. Day 2: MYR → IDR, Gross Profit = +200 USD

Classification: Transaction LPs: LP-MYR, LP-IDR | Global LPs: LP-USD

Split: KF = 100 kUSD | Transaction = 60 kUSD | Global = 40 kUSD

Transaction Bucket (60 kUSD):

LPEff. WeightCalculationkUSD
LP-MYR (B, 1.0×)1,06060 × 1060/408715.56
LP-IDR (A, 0.5×)3,02760 × 3027/408744.44

Global Bucket (40 kUSD): Only LP-USD eligible → receives 40.00 kUSD.

Day 2 Summary

PartyDay 2 kUSDCumulativeUpdated Equity
LP-USD40.0076.002,076.00
LP-IDR44.4498.446,098.44
LP-MYR15.5675.561,075.56
KF100.00250.00

4. Day 3: USD → IDR, Net Result = −80 USD (LOSS)

No profit distribution. KF absorbs the loss:

KF burn = 80 kUSD → KF balance: 250 − 80 = 170 kUSD.

All LP equities remain unchanged. No LP is affected.


5. Rebalancing Batch Close

Batch #101 (USDT-IDRX) is closed. Reserve Pool executes external sale of accumulated IDRX inventory at 15,050 IDR/USD via OTC partner.

WAOP for the batch = 15,000 (weighted average of Day 1 and Day 3 swaps).

Rebalancing_PnL = Volume × (15,000 − 15,050) = Loss

The rebalancing COGS is absorbed by KF, further reducing the KF balance.

3-Day Cumulative Summary

PartyTotal kUSD EarnedFinal Equity% of LP Pool
LP-USD (B)76.002,076.0022.5%
LP-IDR (A)98.446,098.4466.1%
LP-MYR (B)75.561,075.5611.4%
KF170.00 (net)
Total Distributed420.00100%

6. Fee Tier Worked Example — Single Swap Breakdown

To illustrate how the tiered fee schedule affects a specific transaction:

Scenario: Retail user swaps $5,000 USDT → IDRX via On-Ramp partner. Oracle rate: 15,800 IDR/USD.

Step 1 — Tier Resolution

TierMinMaxMatch?
MICRO$10$1,000No ($5,000 > $1,000)
SMALL$1,000$10,000Yes ($1,000 ≤ $5,000 < $10,000)
MEDIUM$10,000$50,000

Resolved tier: SMALL → Fixed: 10,000 IDR | Variable: 5 bips | Base Spread: 20 bps

Step 2 — Platform Fee

Fixed Fee (IDR → USD)   = 10,000 ÷ 15,800      = $0.633
Variable Fee = $5,000 × 0.0005 = $2.500
Total Platform Fee = $0.633 + $2.500 = $3.133
Amount to Convert = $5,000 − $3.133 = $4,996.867

Step 3 — Spread & Conversion

Base Spread (from SMALL tier)     = 20 bps
Volatility Add-on (real-time) = 2 bps
Liquidity Add-on (pool depth) = 1 bps
Inventory Skew (Active Pool) = 0 bps (balanced pool)
Total Spread = 23 bps

Client Rate = 15,800 × (1 − 0.0023) = 15,763.66 IDR/USD
Amount Out = $4,996.867 × 15,763.66 = 78,769,234 IDR

Step 4 — Profit Calculation

Amount at Oracle Rate   = $4,996.867 × 15,800   = 78,950,499 IDR
Amount at Client Rate = $4,996.867 × 15,763.66 = 78,769,234 IDR
Spread Profit = 78,950,499 − 78,769,234 = 181,265 IDR ≈ $11.47

Total Swap Profit = Platform Fee ($3.133) + Spread Profit ($11.47) = $14.60

Step 5 — Distribution (50/30/20)

RecipientShareAmount
KF Treasury50%$7.30
Transaction LP (USD + IDR)30%$4.38
Global Fee Pool (MYR + SGD)20%$2.92

7. LP Reward Realisation Examples

OffRamp Withdrawal

LP-MYR wants to cash out accumulated 75.56 kUSD rewards:

StepValue
kUSD to withdraw75.56 kUSD
OffRamp fee (20 bips)75.56 × 0.0020 = 0.15 USD
LP receives (USDT)75.41 USDT
Protocol revenue0.15 USD → Protocol Treasury

FX Engine Conversion

LP-USD wants to convert 76.00 kUSD rewards into IDRX via the FX Engine:

StepValue
kUSD to convert76.00 kUSD
Swap: kUSD → IDRX via FX EngineTreated as standard USD→IDR swap
Fee tier resolvedMICRO ($10–$1,000): Fixed 10,000 IDR + 0.10% variable
Total fees~$0.71 (fixed $0.63 + variable $0.08) + spread
Fee split (50/30/20)KF: ~$0.50 | Txn LPs: ~$0.30 | Global: ~$0.20
LP receives~1,197,000 IDRX (at client rate)

This secondary swap generates new revenue that feeds back into the distribution system, creating the flywheel effect. Note that the kUSD conversion uses the same tiered fee schedule — in this case hitting the MICRO tier due to the small amount.