I'm having some trouble getting started...

A boy has a box that can hold 20,000 jellybeans. In day 1, there are 6,000 jellybeans initially. Each day, the boy can buy or sell jellybeans at given prices.

Day 1: Selling Price $3, Purchase Price $8
2: 6,8
3: 7,2
4: 1,3
5: 4,4
6: 5,3
7: 5,3
8: 1,2
9: 3,5
10: 2,5

- The boy can sell any amount of jellybeans up to his initial stock at the current day's selling price
- He can buy as many jellybeans (at the current day's purchase price) from other kids as he wants, but this is subject to the capacity of the box

What buying/selling plan should the boy pursue to maximize profits?
I was thinking that for the decision variables, there would be 2 for each day. The amount of jellybeans purchased, and the amount sold.

The objective function I was thinking would be the selling price for each day multiplied by the number of jellybeans sold in that day. Then subtract the purchase price for each day multiplied by the jellybeans sold in that day.

I am stuck at what the constraints for the problem would be and I'm also unsure if my decision variables and objective function are correct.

Any help?