Skip to content

Commit

Permalink
spearbit L-04 (#840)
Browse files Browse the repository at this point in the history
* spearbit L-04

* add more comments for clarity

* fix comment
  • Loading branch information
dianakocsis authored Aug 26, 2024
1 parent dc6a1ee commit 314102b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libraries/Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ library Pool {
state.liquidity = liquidityStart;

// if the beforeSwap hook returned a valid fee override, use that as the LP fee, otherwise load from storage
// lpFee, swapFee, and protocolFee are all in pips
{
uint24 lpFee = params.lpFeeOverride.isOverride()
? params.lpFeeOverride.removeOverrideFlagAndValidate()
Expand All @@ -315,6 +316,8 @@ library Pool {
}
}

// 0 is the fee amount that should be paid to the protocol
// swapFee is the pool's fee in pips (LP fee + protocol fee)
if (params.amountSpecified == 0) return (BalanceDeltaLibrary.ZERO_DELTA, 0, swapFee, state);

if (zeroForOne) {
Expand Down

0 comments on commit 314102b

Please sign in to comment.