-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: improve the README, and add some more typescript
- Loading branch information
1 parent
ff01c5a
commit 57e8f50
Showing
4 changed files
with
214 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
packages/zoe/src/contracts/constantProduct/internal-types.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// @ts-check | ||
|
||
/** | ||
* @typedef {Object} ImprovedNoFeeSwapResult | ||
* @property {Amount} amountIn | ||
* @property {Amount} amountOut | ||
* @property {Amount} improvement | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} FeePair | ||
* | ||
* @property {Amount} poolFee | ||
* @property {Amount} protocolFee | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} PoolAllocation | ||
* | ||
* @property {Amount} Central | ||
* @property {Amount} Secondary | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} NoFeeSwapFnInput | ||
* @property {Amount} amountGiven | ||
* @property {Amount} amountWanted | ||
* @property {Brand=} brand | ||
* @property {PoolAllocation} poolAllocation | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} SwapResult | ||
* | ||
* @property {Amount} xIncrement | ||
* @property {Amount} swapperGives | ||
* @property {Amount} yDecrement | ||
* @property {Amount} swapperGets | ||
* @property {Amount} improvement | ||
* @property {Amount} protocolFee | ||
* @property {Amount} poolFee | ||
* @property {Amount} newY | ||
* @property {Amount} newX | ||
*/ | ||
|
||
/** | ||
* @callback NoFeeSwapFn | ||
* @param {NoFeeSwapFnInput} input | ||
* @returns {ImprovedNoFeeSwapResult} | ||
*/ | ||
|
||
/** | ||
* @callback InternalSwap | ||
* @param {Amount} amountGiven | ||
* @param {PoolAllocation} poolAllocation | ||
* @param {Amount} amountWanted | ||
* @param {Ratio} protocolFeeRatio | ||
* @param {Ratio} poolFeeRatio | ||
* @param {NoFeeSwapFn} swapFn | ||
* @returns {SwapResult} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters