Skip to main content

Layer 9 — Execution, Settlement & Audit Trail

Quote Expiry Enforcement

Every execution attempt validates current_time <= quote_expiry_timestamp before proceeding. Expired quotes are rejected and require re-requesting at current rates.

Atomic On-Chain Settlement

Approved executions settle atomically on the Kaia blockchain using BFT consensus with sub-second finality. Both the source pool debit and destination pool credit occur in the same transaction — either both commit or neither does. This eliminates settlement risk (Herstatt risk) present in traditional FX systems.

Fee Distribution (50/30/20)

RecipientShareDescription
Protocol Treasury Wallet50%Protocol revenue; not distributed to LPs
Vault Contract (LP Reward)30%LP Reward. Split pro-rata by TVL across Class A (kXXX-fx) and Class B (kXXX-full) LPs. Class A receives at a custom fee tier multiplier (set per partner during Partner Onboarding); Class B receives at standard rate. Each class updates its own Liquidity Index via updateIndex(). See Liquidity Onboarding — kToken Architecture for the full distribution formula.
Fee Contract (Global Swap Fee Pool)20%Accumulated across all pools. Periodically harvested and distributed to all LP kToken holders (both Class A and Class B) proportional to kToken holdings. Distributed via periodic harvest events that call updateIndex() on each class Vault.
Volume-Tiered Fees

The platform fee (fixed + variable) that generates the swap profit varies by transaction size. Each corridor has a tiered fee schedule where larger transactions receive lower rates. The fee tier is resolved in Layer 1 and the resolved values flow through to execution. See Volume-Tiered Fee Schedule for the full tier tables.

Class A vs. Class B Fee Accrual

Class A LPs (kXXX-fx holders) earn only from FX swap fees at their negotiated fee tier multiplier (e.g., 0.3× for strategic issuers). Class B LPs (kXXX-full holders) earn from FX swap fees at the standard 1.0× rate plus yield profits from the Yield Pool. See Liquidity Onboarding — Intent Classes for the full comparison.

WAOP Batch Recording

Every executed swap is assigned to the currently open Rebalancing Batch for its corridor pair. The batch maintains a running WAOP (Weighted Average Oracle Price) — the break-even rebalancing price for the batch.

WAOP = Σ(Volume_i × OracleRate_i) / Σ(Volume_i)

On-Chain Events

EventData CapturedPurpose
NewSwaporacle_rate, fee_bps, volume, pair, batch_id, timestampBuilds WAOP cost basis per batch; used for PnL calculation at rebalancing
RebalanceSettledbatch_id, amount_in, amount_out, waop, executed_rateLinks Reserve Pool inventory back to user trades; calculates realised PnL

Pool State Feedback Loop

After execution, the pool inventory state is updated in real-time. This updated state feeds back into the Inventory Check (Layer 7), ensuring that the next quote reflects the cumulative effect of all prior trades in the current batch.