
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-fintechAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 594 |
|---|---|
| repo stars | ★ 1.4k |
| Security audit | 3 / 3 scanners passed |
| Last updated | May 24, 2026 |
| Repository | zhanghandong/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
FinTech Domain
Layer 3: Domain Constraints
Domain Constraints → Design Implications
| Domain Rule | Design Constraint | Rust Implication |
|---|---|---|
| Audit trail | Immutable records | Arc<T>, no mutation |
| Precision | No floating point | rust_decimal |
| Consistency | Transaction boundaries | Clear ownership |
| Compliance | Complete logging | Structured tracing |
| Reproducibility | Deterministic execution | No race conditions |
---
Critical Constraints
Financial Precision
RULE: Never use f64 for money
WHY: Floating point loses precision
RUST: Use rust_decimal::DecimalAudit Requirements
RULE: All transactions must be immutable and traceable
WHY: Regulatory compliance, dispute resolution
RUST: Arc<T> for sharing, event sourcing patternConsistency
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
| Purpose | Crate |
|---|---|
| Decimal math | rust_decimal |
| Date/time | chrono, time |
| UUID | uuid |
| Serialization | serde |
| Validation | validator |
Design Patterns
| Pattern | Purpose | Implementation |
|---|---|---|
| Currency newtype | Type safety | struct Amount(Decimal); |
| Transaction | Atomic operations | Event sourcing |
| Audit log | Traceability | Structured logging with trace IDs |
| Ledger | Double-entry | Debit/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
| Mistake | Domain Violation | Fix |
|---|---|---|
| Using f64 | Precision loss | rust_decimal |
| Mutable transaction | Audit trail broken | Immutable + events |
| String for amount | No validation | Validated newtype |
| Silent overflow | Money disappears | Checked arithmetic |
---
Trace to Layer 1
| Constraint | Layer 2 Pattern | Layer 1 Implementation |
|---|---|---|
| Immutable records | Event sourcing | Arc<T>, Clone |
| Transaction scope | Aggregate | Owned children |
| Precision | Value Object | rust_decimal newtype |
| Thread-safe sharing | Shared immutable | Arc (not Rc) |
---
Related Skills
| When | See |
|---|---|
| Value Object design | m09-domain |
| Ownership for immutable | m01-ownership |
| Arc for sharing | m02-resource |
| Error handling | m13-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.