GH GambleHub

Financial flows between chains

(Section: Ecosystem and Network)

1) Why manage inter-chain money

Cross-chain value flows are the movement of funds and liabilities between networks, bridges, payment providers and operators. Objectives:
  • Safety and finalization: take into account only irreversible facts.
  • Liquidity and cost: minimize the cost of corridors with sufficient reserves.
  • Reporting and auditing: full traceability with double entry and proofs.
  • Compliance: AML/sanctions, residency, limits by jurisdiction.

2) Typology of financial flows

1. Deposits: on-ramp → wallet/user account (online/offchain).
2. Payments: off-ramp/crypto payments → external address/PSP.
3. Bridge: lock/mint, burn/release, message-based.
4. Swaps/conversion (FX): cross-asset/chain swap with oracle prices.
5. Clearing and royalties: periodic settlements operator↔studii↔agregatory.
6. Fees and withholdings: network fee, bridge fee, take rate, rebates.
7. Treasury operations (treasury): liquidity rebalance and hedge.

3) Roles and contours

Bridge/rail: provides transfer of states/assets and proofs.
Treasury: chain/currency reserves, limits, hedging.
PSP/It-off-ramps: cards/local AWP/banks/crypto-exchange.
Oracles/quotes: asset prices, FX and fees.
Risk/Compliance: AML/KYC/KYB, sanctions, velocity limits.
Accounting/BI: double entry, final reporting, reconciliations.

4) Flow architecture (reference)

Ingest (bridge/PSP/node) → Raw/Bronze (movement facts) → Clean/Silver (normalization, dedup, proof) → Core/Gold (double entry, positions, obligations) → Marts (finance, risk, royalties) → Serve/API (reports, clearing, limits).
Key properties: idempotency, schema versioning, replay/backfill, late data.

5) Finalization, reorgs and dispute windows

Statuses: 'observed → confirmed (K) → finalized → invalid (reorg)' (+ 'challenged' for optimistic bridges).

Politicians:
  • K-confirmations per chain/asset/amount ('K↑' for large transfers).
  • Delayed Finalization for high-risk amounts and new bridges.
  • Reorg handling: automatic disability + recalculation of aggregates.
  • Proof coverage: the target percentage of records with valid proof ≥ 99%.

6) Pricing, commissions and FX

Pricing: 'effective _ amount = amount − (network_fee + bridge_fee + fx_spread)'

Oracles: median quotes, outlier protection, time-weighted prices.
Sliding window for the course with long corridors; fixing the course to 'observed _ at' or 'event _ at' - by the report policy.
Fee buckets: commission roadmaps per corridor/asset.

7) Liquidity and limits

Reserves: target balances by chain/asset, buffers for peaks.
Corridors: daily limits, Treasury call thresholds.
Rebalance: Rebridging/market swaps, cost-aware (including latency and fee).
Stress plan: fallback assets/chains, temporary increase in K/dispute window.

Limit Policy (YAML):
yaml treasury:
corridors:
"eth->polygon:USDC": { daily_usd: 1_000_000, k: 20, alert_at_pct: 80 }
"polygon->eth:USDC": { daily_usd: 800_000, k: 24, alert_at_pct: 75 }
reserves:
eth:   { usdc_min: 300_000, native_gas_min_usd: 25_000 }
polygon: { usdc_min: 250_000, native_gas_min_usd: 10_000 }

8) Event contracts and idempotence

Translation Event (Async-style, YAML):
yaml event:
id: uuid type: bridge. lock    bridge. mint    payout. requested    payout. finalized    deposit. settled ts: 2025-10-31T19:00:00Z chain_id: "eth-mainnet"
asset: "USDC"
amount: "123. 45"
src: "0x..." # address/organization dst: "0x..."    iban    wallet_id status: observed    confirmed    finalized    invalidated proof_ref: "merkle:..."
idempotency_key: "${chain}    ${block}    ${tx}    ${log}    ${type}"
fx: { base: "USD", rate: "1. 00", source: "oracle:v2" }
fees: { network: "1. 23", bridge: "0. 50" }

The deduplication rule is upsert by'idempotency _ key'in the window ≥ 72 hours.

9) Double entry and accounting (Core Ledger)

Schema (SQL):
sql
CREATE TABLE ledger_entries (
id UUID PRIMARY KEY,
ts TIMESTAMPTZ,
account_dr TEXT, -- debit account_cr TEXT, -- credit amount NUMERIC (38.9),
currency TEXT, -- canonical accounting currency (for example, USD)
ref_event_id UUID,
meta JSONB
);

CREATE TABLE positions (
account TEXT PRIMARY KEY,
balance NUMERIC(38,9),
currency TEXT
);

Example Posting - USDC Chain Transfer (lock→mint)

`Dr Bridge Receivable (dst_chain:USDC)` / `Cr Cash (src_chain:USDC)` — при lock.
`Dr Cash (dst_chain:USDC)` / `Cr Bridge Receivable (dst_chain:USDC)` — при mint(finalized).
Commissions are reflected in separate lines ('Bridge Fee Revenue', 'Network Fee Expense').

10) Reconciliation and Clearing

T-reconciliation: by chains, assets, providers/bridges, day.
Proof match: receipts of both sides of the corridor (src/dst) and amounts (with tolerance).
Dispute flow: anomaly quarantine (asset/decimals/amount mismatch).
Royalty clearing: only on 'finalized', FX on 'event _ at' or 'observed _ at' - according to policy.

Queries (SQL):
sql
-- Lock/mint bundle
SELECT l. tx_hash AS src_tx, m. tx_hash AS dst_tx, l. amount, m. amount
FROM core_events l
JOIN core_events m ON m. type='bridge. mint' AND m. proof_ref = l. proof_ref
WHERE l. type='bridge. lock' AND l. status='finalized' AND m. status='finalized';

-- Daily reconciliation by asset/chain
SELECT chain_id, asset,
SUM(CASE WHEN direction='in' THEN amount ELSE 0 END) AS inflow,
SUM(CASE WHEN direction='out' THEN amount ELSE 0 END) AS outflow
FROM flows
WHERE ts::date = CURRENT_DATE - INTERVAL '1 day'
GROUP BY chain_id, asset;

11) Compliance and Residency

AML/KYC/KYB: scoring, sanctions lists, sources of funds.
Residence/localization: PII tokenization, regional encryption keys, whitelisting export.
Velocity limits: per user/org/corridor/day.
Audit trail: immutable access logs, event signatures.

12) Observability: SLI/SLO and metrics

SLI (core):
  • Finality p95 per corridor/asset,
  • Success Rate translations,
  • Proof Coverage%,
  • Queue-Lag p95 (bus/bridge),
  • FX Drift
  • Liquidity Utilization% (reserve load),
  • Reorg/Challenge Rate,
  • Dispute/Quarantine Rate.
SLO (landmarks):
  • Finality p95: ≤ 3-10 min (along the corridor), Success ≥ 99. 5%,
  • Proof Coverage ≥ 99. 0%, Queue-Lag P0 p95 ≤ 2 с,
  • Dispute Rate ≤ 0. 2%, FX Drift ≤ 0. 3% of median.

Дашборды: Flows Core, Finality & Proofs, Treasury & Liquidity, FX & Fees, Compliance.

13) Change Management

Timelock to change К/limits/corridors; decision log.
Asset directory versions/decimals (compatibility "append" only).
A/B-inclusion of new bridges: canary flow, limits, increased K.
Emergency kill-switch corridor in case of anomalies.

14) Configurations (YAML)

Finalization/Risk Policy

yaml finality_policy:
eth-mainnet: { k: 12, delayed_for_usd_gt: 100000 }
polygon:   { k: 256 }
optimistic: { k: 0, challenge_minutes: 20, delayed_for_usd_gt: 50000 }
risk:
large_transfer_alert_usd: 25000 sanction_check: true

Rules of corridors and commissions

yaml corridors:
- id: "eth->polygon:USDC"
fee_bps: 25 fx_source: "oracle:v2"
daily_limit_usd: 1_000_000 slo:
finality_p95_min: 6 success_pct: 99. 6

Webhook/Clearing Signatures

yaml webhooks:
clearing:
signature: { alg: "HMAC-SHA256", header: "X-Signature", ts_header: "X-Timestamp" }
retry: { attempts: 5, backoff_ms: [200,800,1600,3200,6400], jitter: true }

15) Playbook incidents

A. Spike reorg/invalidated

1. Temporarily raise 'K', enable 'finalized-only'; 2) stop high-risk flights;

2. recalculation of aggregates; 4) post-mortem and policy adjustment.

B. The fall of Proof Coverage

1. Restart of Merclization/Provers; 2) quarantine of dubious transfers;

2. manual sampling of cases; 4) Report to Treasury/Compliance.

C. Lack of liquidity in the corridor

1. Include rebalance/swap; 2) raise fee/introduce quotas;

2. Prioritize P0 payments 4) notification of participants.

D. FX Drift/price anomalies

1. Switch the source of quotations; 2) limit large transactions;

2. execute hedge; 4) recalculate reports for the window.

E. Sanctions/AML Trigger

1. Immediate operation block; 2) escalation in Compliance;

2. preservation of artifacts/proofs; 4) report and legal actions.

16) Implementation checklist

1. Capture stream sources, corridors, and finalization windows.
2. Enter the canonical events and the idempotency key.
3. Implement double entry and positions, FX normalization and commission accounting.
4. Set up limits/reserves and automatic rebalancing.
5. Raise the SLI/SLO dashboards: Finality, Proofs, Liquidity, FX, Compliance.
6. Include AML/sanctions, residency and audit trails.
7. Conduct chaos/DR tests (reorg, oracle-drift, liquidity).
8. Start governance procedures for any changes in corridors/C/limits.

17) Glossary

Finality - irreversibility of the transaction/state.
Reorg - reassembly of a part of the chain with cancellation of blocks.
Corridor is a manageable bundle of chains/assets for value transfer.
Proof Coverage - the share of records with valid crypto evidence.
FX Drift - deviation of applied heading from reference.
Double-Entry - double entry (debit/credit) for accounting.
Delayed Finalization - deferred acceptance in reports for high-risk amounts.

Bottom line: managing financial flows between chains is not just "bridging assets," but the discipline of finalization, liquidity, accounting and compliance. Canonical events, double entry, limits and corridor SLOs give a verifiable, cost-effective and sustainable system ready for scale and audit in any jurisdiction.

Contact

Get in Touch

Reach out with any questions or support needs.We are always ready to help!

Telegram
@Gamble_GC
Start Integration

Email is required. Telegram or WhatsApp — optional.

Your Name optional
Email optional
Subject optional
Message optional
Telegram optional
@
If you include Telegram — we will reply there as well, in addition to Email.
WhatsApp optional
Format: +country code and number (e.g., +380XXXXXXXXX).

By clicking this button, you agree to data processing.