I am trying to use an auction model to simulate bids in a uniform price carbon emissions auction. That means it would be an auction with multiple bidders and one seller selling multiple units, or shares. In such an auction, one bids for blocks of allowances, submitting a bid schedule--the prices at which you want to buy certain amounts of allowances. Each bidder receives the amount of allowances that have a bid price over the market clearing price, $p_c$, which is where the aggregate demand intersects the total supply.
Let the auction have $N$ total bidders. The auction has reserve price r. Each bidder wants up to $y_i^{max} < \infty$ allowances with a nonincreasing marginal valuation schedule $v_{it}(q) = (v_{it}(1),...,v_{it}(y_i^{max})) \in V$. A bid is a nonincreasing price schedule $p_{it}() = (p_{it}(1),...,p_{it}(y_i^{max}))$ or a nonincreasing bid schedule $y_{it} \equiv max(0 \leq y \leq y_i^{max}: p_{it} \leq p)$. Set $p_it(0) = \infty$ and $\forall y > y_i^{max}, p_{it}(y) = 0$. Each bidder faces residual supply $RS_{-i} = Q_t - \sum_{k=1, k \neq i}^{N}y_{kt}(p)$.
Each bidder wants to solve the problem $\int_{r}^{\infty}[\int_{0}^{y_i(p_c)}v_i(u)du - p_c*y_i(p_c)]dG(p_c|y_i(p))$, where $G(p_c|y_i(p))$ is the distribution of market clearing prices. We can also use $H$ instead, where $H = Pr[y_i(p) \leq RS_{-i}(p)]$.
Let $\pi(p_c) = \int_{0}^{y_i(p_c)}v_i(u)du - p_c*y_i(p_c)$, or the profit made at the market clearing price. Then, $\frac{\partial \pi}{\partial p_c} = y_i'(p)*v_i(y(p)) - y_i(p) - py_i'(p)$. $\pi(\infty) = 0$ because nobody would be willing to buy allowances at that price.
If we use integration by parts (and H) to rewrite the problem that each bidder is solving, I believe we would get: $$ -\pi(r)H(r, y_i(r)) - \int_{r}^{\infty}(y_i'(p_c)*v_i(y(p_c)) - y_i(p_c) - py_i'(p_c))H(p_c, y(p_c))dp_c $$ At this point I am a little confused. Given that $y_i$ is bidder i's bid strategy, that is the only thing the bidder can change to maximize their profit. Thus, in order to maximize with respect to it, the first order condition would be taken with respect to y. My confusion is that y is a function, so I am not sure if that functions the same way as a partial with a real-valued variable. I have been told that it has to do with Kamien and Schwartz's 1993 book on the calculus of variations, but I am not familiar with this (I have just taken through multi-variable calculus). Am I looking in the wrong place, or is this much simpler than I believe it to be? Any help or guidance would be appreciated.