https://github.com/dineshpinto/trading-units-rs
A (very) basic unit system for trading in Rust
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (2.2%) to scientific vocabulary
Keywords
Repository
A (very) basic unit system for trading in Rust
Basic Info
Statistics
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
trading-units-rs
A (very) basic unit system for trading in Rust 🦀.
Usage
rust
use units::{Asset, Price, Size, Unit};
Creating Price and Size
rust
// Creating a Price
let p = Price { value: 2000.0, unit: Unit { asset: Asset::ETH, quote: Asset::USDT } };
// Two equivalent ways of creating a Size
let s1 = Size { value: 2.0, unit: Unit { asset: Asset::ETH, quote: Asset::None } };
let s2 = Size { value: 3.0, unit: Unit { asset: Asset::ETH, ..Unit::default() } };
Performing basic operations ```rust // Addition of sizes let sizesum = s1 + s2; println!("Total {:?}", sizesum); // Total Size { value: 5.0, unit: Unit { asset: ETH, quote: None } }
// Multiplication of price and size let pricesizemul = p * sizesum; println!("Notional {:?}", pricesize_mul); // Notional Price { value: 10000.0, unit: Unit { asset: USDT, quote: None } } ```
Owner
- Name: Dinesh Pinto
- Login: dineshpinto
- Kind: user
- Location: Switzerland/Germany
- Website: dineshpinto.github.io
- Twitter: dineshkpinto
- Repositories: 6
- Profile: https://github.com/dineshpinto
quantum info PhD student @ EPFL, pythonista & rustacean
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0