aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/utils.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-29 17:34:38 +0800
committerFabio Berger <me@fabioberger.com>2018-06-29 17:34:38 +0800
commitaa2616b307d3384791f1dbafc76999e7c4cf801f (patch)
tree0d8f11f66dcd595fefb184dd0dabc2d69183b782 /packages/order-utils/src/utils.ts
parent3062c18ebda8e55831038f140313000fd6d2cf71 (diff)
parent518a2da0275632a5dd61f99a105163ff5a074927 (diff)
downloaddexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.gz
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.bz2
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.lz
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.xz
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.zst
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.zip
Merge v2-prototype
Diffstat (limited to 'packages/order-utils/src/utils.ts')
-rw-r--r--packages/order-utils/src/utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts
index 6149316f6..7aaaf0609 100644
--- a/packages/order-utils/src/utils.ts
+++ b/packages/order-utils/src/utils.ts
@@ -12,4 +12,11 @@ export const utils = {
const milisecondsInSecond = 1000;
return new BigNumber(Date.now() / milisecondsInSecond).round();
},
+ getPartialAmount(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber {
+ const fillMakerTokenAmount = numerator
+ .mul(target)
+ .div(denominator)
+ .round(0);
+ return fillMakerTokenAmount;
+ },
};