Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
v1.0.10 Small order size for ETH perp (#244)
Browse files Browse the repository at this point in the history
* Small order size for ETH perp

* v1.0.10
  • Loading branch information
Kenadia authored Jul 31, 2020
1 parent 592c462 commit 8691b73
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dydxprotocol/perpetual",
"version": "1.0.9",
"version": "1.0.10",
"description": "Ethereum Smart Contracts and TypeScript library used for the dYdX Perpetual Contracts",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
17 changes: 17 additions & 0 deletions src/modules/InverseOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,21 @@ export class InverseOrders extends Orders {
positionDelta: isBuy ? positionAmount.negated() : positionAmount,
};
}

public getFeeForOrder(
amount: BigNumber,
isTaker: boolean = true,
): Fee {
if (!isTaker) {
return Fee.fromBips('-2.5');
}

// WETH-PUSD: Small order size is 1000 USD.
//
// TODO: Address fees more generally on a per-market basis.
const isSmall = amount.lt('1000e6');
return isSmall
? Fee.fromBips('50.0')
: Fee.fromBips('7.5');
}
}
3 changes: 3 additions & 0 deletions src/modules/Orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ export class Orders {
return Fee.fromBips('-2.5');
}

// PBTC-USDC: Small order size is 0.5 BTC.
//
// TODO: Address fees more generally on a per-market basis.
const isSmall = amount.lt('0.5e8');
return isSmall
? Fee.fromBips('50.0')
Expand Down

0 comments on commit 8691b73

Please sign in to comment.