Workers Auto Approve
[Positions] Create needed functions around positions from CollateralPool contracts
## 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.
Setup your profile
Tell us a little about you:
No results found for
Type to search skills..
Required [[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email: