Check out the Issue Explorer
Looking to fund some work? You can submit a new Funded Issue here.
## Before you `start work`
Please read our contribution [guidelines](https://docs.marketprotocol.io/#contributing) and if there is a bounty involved please also see [here](https://docs.marketprotocol.io/#gitcoin-and-bounties)
If you have ongoing work from other bounties with us where funding has not been released, please do not pick up a new issue. We would like to involve as many contributors as possible and parallelize the work flow as much as possible.
Please make sure to comment in the issue here immediately after starting work so we know your plans for implementation and a timeline.
Please also note that in order for work to be accepted, all code must be accompanied by test cases as well.
### User Story
As a developer using MARKET.js, I would like to be able to make calls to query a users position in a given contract.
*Summary*: Add new functionality to MARKET.js to handle user's positions
### Definition of Done
- [ ] create `getUserNetPositionAsync()` function in Collateral.ts and expose to Market.ts
- [ ] create 'getUserPositionAsync` function in Collateral.ts and expose to Market.ts
- [ ] create 'getUserPositionsAsync(userAddress)` function in Collateral.ts and expose to Market.ts that iterates over positions for a user (`getUserPositionCount` will return length of array) returning an array of positions. The new function should accept 2 boolean variable that acts as a flag to consolidate any positions from the same price and an ability to sort by price. See below for more info!
- [ ] full test coverage for all new functionality created
- [ ] All code must be well documented and follow the formatting already outlined in the project.
### Additional Information
#### Consolidating positions
Imagine a user has the following open positions that are in the format [price, qty]
If the `consolidate` flag was true, the function call would return
[101, 8] - notice all qty's from the price 101 are summed and returned as a single object!
If the `sort` flag was true, the function call would return
If the `sort` and `consolidate` flag was true, the function call would return
### Bounty hunters - please give a proposed timeline for completion as well as some explanation of your proposed solution and ability to meet the criteria outlined in the issue.