Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
zhanghandong avatar

Domain Fintech

  • 594 installs
  • 1.4k repo stars
  • Updated May 24, 2026
  • zhanghandong/rust-skills

domain-fintech is a Rust domain skill that enforces regulatory precision, auditability, and immutability patterns for developers building fintech ledgers, payments, and trading systems in Rust.

About

domain-fintech is a Layer 3 domain-constraints skill in zhanghandong/rust-skills for fintech backends covering trading, currency, transactions, ledgers, payments, and exchange-rate logic. The skill maps domain rules to Rust design: immutable audit trails via Arc<T> without mutation, rust_decimal instead of f64, clear ownership for transaction boundaries, and structured tracing for compliance logging. Developers reach for domain-fintech when implementing money-handling crates where rounding, reproducibility, and complete audit logs are non-negotiable. Keywords span 金融, 交易系统, 货币, and 支付 for multilingual retrieval alongside English fintech terms.

  • Enforces rust_decimal::Decimal for all monetary values instead of f64
  • Mandates immutable records with Arc<T> and event-sourcing patterns for audit trails
  • Implements double-entry accounting validation to prevent money appearing or disappearing
  • Maps 7 core financial domain rules directly to Rust ownership, tracing and type-driven design
  • Provides traceable constraint-to-implementation decision tree for compliance-heavy code

Domain Fintech by the numbers

  • 594 all-time installs (skills.sh)
  • +6 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #669 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/zhanghandong/rust-skills --skill domain-fintech

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs594
repo stars1.4k
Security audit3 / 3 scanners passed
Last updatedMay 24, 2026
Repositoryzhanghandong/rust-skills

How do you handle money safely in Rust fintech?

When creating fintech features that must satisfy regulatory precision, auditability and immutability requirements in Rust.

Who is it for?

Rust backend engineers building payments, ledgers, or trading services who must avoid floating-point money and enforce immutable audit trails.

Skip if: Frontend-only apps, Python pandas prototypes, or teams without regulatory precision, audit logging, or immutability requirements.

When should I use this skill?

A developer builds Rust fintech features involving decimals, currency, transactions, ledgers, payments, or exchange-rate precision.

What you get

Rust fintech modules using rust_decimal, immutable audit structs, transaction-boundary ownership, and compliance-grade tracing.

  • fintech Rust modules
  • audit-trail structs

Files

SKILL.mdMarkdownGitHub ↗

FinTech Domain

Layer 3: Domain Constraints

Domain Constraints → Design Implications

Domain RuleDesign ConstraintRust Implication
Audit trailImmutable recordsArc<T>, no mutation
PrecisionNo floating pointrust_decimal
ConsistencyTransaction boundariesClear ownership
ComplianceComplete loggingStructured tracing
ReproducibilityDeterministic executionNo race conditions

---

Critical Constraints

Financial Precision

RULE: Never use f64 for money
WHY: Floating point loses precision
RUST: Use rust_decimal::Decimal

Audit Requirements

RULE: All transactions must be immutable and traceable
WHY: Regulatory compliance, dispute resolution
RUST: Arc<T> for sharing, event sourcing pattern

Consistency

RULE: Money can't disappear or appear
WHY: Double-entry accounting principles
RUST: Transaction types with validated totals

---

Trace Down ↓

From constraints to design (Layer 2):

"Need immutable transaction records"
    ↓ m09-domain: Model as Value Objects
    ↓ m01-ownership: Use Arc for shared immutable data

"Need precise decimal math"
    ↓ m05-type-driven: Newtype for Currency/Amount
    ↓ rust_decimal: Use Decimal type

"Need transaction boundaries"
    ↓ m12-lifecycle: RAII for transaction scope
    ↓ m09-domain: Aggregate boundaries

---

Key Crates

PurposeCrate
Decimal mathrust_decimal
Date/timechrono, time
UUIDuuid
Serializationserde
Validationvalidator

Design Patterns

PatternPurposeImplementation
Currency newtypeType safetystruct Amount(Decimal);
TransactionAtomic operationsEvent sourcing
Audit logTraceabilityStructured logging with trace IDs
LedgerDouble-entryDebit/credit balance

Code Pattern: Currency Type

use rust_decimal::Decimal;

#[derive(Clone, Debug, PartialEq)]
pub struct Amount {
    value: Decimal,
    currency: Currency,
}

impl Amount {
    pub fn new(value: Decimal, currency: Currency) -> Self {
        Self { value, currency }
    }

    pub fn add(&self, other: &Amount) -> Result<Amount, CurrencyMismatch> {
        if self.currency != other.currency {
            return Err(CurrencyMismatch);
        }
        Ok(Amount::new(self.value + other.value, self.currency))
    }
}

---

Common Mistakes

MistakeDomain ViolationFix
Using f64Precision lossrust_decimal
Mutable transactionAudit trail brokenImmutable + events
String for amountNo validationValidated newtype
Silent overflowMoney disappearsChecked arithmetic

---

Trace to Layer 1

ConstraintLayer 2 PatternLayer 1 Implementation
Immutable recordsEvent sourcingArc<T>, Clone
Transaction scopeAggregateOwned children
PrecisionValue Objectrust_decimal newtype
Thread-safe sharingShared immutableArc (not Rc)

---

Related Skills

WhenSee
Value Object designm09-domain
Ownership for immutablem01-ownership
Arc for sharingm02-resource
Error handlingm13-domain-error

Related skills

How it compares

Use domain-fintech for Rust money-domain rules; pair with general Rust API skills for HTTP routing and serialization layers.

FAQ

Why does domain-fintech ban floating-point money types?

domain-fintech requires rust_decimal because fintech domains demand exact precision, reproducible rounding, and auditability. Floating-point types introduce rounding errors unacceptable in ledgers and payment systems.

What Rust patterns does domain-fintech recommend for audit trails?

domain-fintech recommends immutable records using Arc<T> without mutation, clear ownership at transaction boundaries, and structured tracing so every financial operation leaves a complete compliance log.

Is Domain Fintech safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Backend & APIsagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.