Skip to content

Commit deffee7

Browse files
99adarshavkr003amityadav0
authored
Perpetual events and fixes (#1356)
* add PerpetualFees proto types * add perpetualFees helper fucntions * collect perp fees from different part and emit in the end of tx * update tests * update open consolidate event to add new mtp liabilities and custody * cleanup * remove proto message and use go struct * update perp fees event with new design * review changes * Track via amm (#1358) changes --------- Co-authored-by: Abhinav Kumar <57705190+avkr003@users.noreply.github.com> Co-authored-by: Amit Yadav <amy29981@gmail.com>
1 parent a913e69 commit deffee7

22 files changed

+282
-156
lines changed

x/perpetual/keeper/amm.go

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, t
9393
return tokenIn.Amount, slippage, slippageAmount, getWeightBreakingFee(weightBalanceBonus), oracleIn, perpetualFees.Dec(), takersFee.Dec(), nil
9494
}
9595

96-
func (k Keeper) CalculateAndEmitPerpetualFeesEvent(
96+
// CalculatePerpetualFees calculates the perpetual fees, slippage fees, weight breaking fees, and taker fees for a swap.
97+
// Pass calculatePerpAndTakerFees as false to exclude perp and taker fees for the swap
98+
func (k Keeper) CalculatePerpetualFees(
9799
ctx sdk.Context,
98100
poolIsOracle bool,
99101
tokenIn sdk.Coin,
@@ -104,56 +106,57 @@ func (k Keeper) CalculateAndEmitPerpetualFeesEvent(
104106
takersFee math.LegacyDec,
105107
oracleInAmount osmomath.BigDec,
106108
isSwapGivenIn bool,
107-
) {
109+
calculatePerpAndTakerFees bool,
110+
) (perpFees types.PerpetualFees) {
108111

109-
// Determine the source of fees based on isSwapGivenIn
110-
takeFeesFrom := sdk.Coins{tokenIn}
111-
if !isSwapGivenIn && poolIsOracle {
112-
takeFeesFrom = sdk.NewCoins(sdk.NewCoin(tokenIn.Denom, oracleInAmount.Dec().TruncateInt()))
113-
}
112+
perpFeesCoins := sdk.Coins{}
113+
takerFeesCoins := sdk.Coins{}
114114

115-
// Calculate perpetual fees in USD
116-
perpFeesValueInUSD := math.LegacyZeroDec()
117-
if perpetualFees.IsPositive() {
118-
perpetualFeesCoins := ammkeeper.PortionCoins(takeFeesFrom, osmomath.BigDecFromDec(perpetualFees))
119-
perpFeesValueInUSD = k.amm.CalculateCoinsUSDValue(ctx, perpetualFeesCoins).Dec()
120-
}
115+
if calculatePerpAndTakerFees {
121116

122-
// Calculate taker fees in USD
123-
takerFeesAmountInUSD := math.LegacyZeroDec()
124-
if takersFee.IsPositive() {
125-
takerFeesInCoins := ammkeeper.PortionCoins(takeFeesFrom, osmomath.BigDecFromDec(takersFee))
126-
takerFeesAmountInUSD = k.amm.CalculateCoinsUSDValue(ctx, takerFeesInCoins).Dec()
117+
// Determine the source of fees based on isSwapGivenIn
118+
takeFeesFrom := sdk.Coins{tokenIn}
119+
if !isSwapGivenIn && poolIsOracle {
120+
takeFeesFrom = sdk.NewCoins(sdk.NewCoin(tokenIn.Denom, oracleInAmount.Dec().TruncateInt()))
121+
}
122+
123+
// Calculate perpetual fees in USD
124+
if perpetualFees.IsPositive() {
125+
perpFeesCoins = ammkeeper.PortionCoins(takeFeesFrom, osmomath.BigDecFromDec(perpetualFees))
126+
}
127+
128+
// Calculate taker fees in USD
129+
if takersFee.IsPositive() {
130+
takerFeesCoins = ammkeeper.PortionCoins(takeFeesFrom, osmomath.BigDecFromDec(takersFee))
131+
}
127132
}
128133

129134
// Calculate slippage amount in USD
130-
slippageAmountInUSD := math.LegacyZeroDec()
135+
slippageCoins := sdk.Coins{}
131136
if isSwapGivenIn {
132-
slippageAmountInUSD = k.amm.CalculateUSDValue(ctx, tokenOut.Denom, slippageAmount.Dec().TruncateInt()).Dec()
137+
slippageCoins = append(slippageCoins, sdk.NewCoin(tokenOut.Denom, slippageAmount.Dec().RoundInt()))
133138
} else {
134-
slippageAmountInUSD = k.amm.CalculateUSDValue(ctx, tokenIn.Denom, slippageAmount.Dec().TruncateInt()).Dec()
139+
slippageCoins = append(slippageCoins, sdk.NewCoin(tokenIn.Denom, slippageAmount.Dec().RoundInt()))
135140
}
136141

137142
// Calculate weight breaking fees in USD
138-
weightBreakingFeesAmountInUSD := math.LegacyZeroDec()
143+
weightBreakingFeesCoins := sdk.Coins{}
139144
if !weightBreakingFee.IsZero() {
140145
var weightBreakingFeeAmount math.Int
141146
if isSwapGivenIn {
142147
weightBreakingFeeAmount = osmomath.BigDecFromSDKInt(tokenIn.Amount).Mul(weightBreakingFee).Dec().RoundInt()
143148
} else {
144149
weightBreakingFeeAmount = oracleInAmount.Mul(weightBreakingFee).Dec().RoundInt()
145150
}
146-
weightBreakingFeesAmountInUSD = k.amm.CalculateUSDValue(ctx, tokenIn.Denom, weightBreakingFeeAmount).Dec()
151+
weightBreakingFeesCoins = append(weightBreakingFeesCoins, sdk.NewCoin(tokenIn.Denom, weightBreakingFeeAmount))
147152
}
148153

149-
// Emit the event if any fees are non-zero
150-
if !(perpFeesValueInUSD.IsZero() && slippageAmountInUSD.IsZero() && weightBreakingFeesAmountInUSD.IsZero() && takerFeesAmountInUSD.IsZero()) {
151-
types.EmitPerpetualFeesEvent(
152-
ctx,
153-
perpFeesValueInUSD.String(),
154-
slippageAmountInUSD.String(),
155-
weightBreakingFeesAmountInUSD.String(),
156-
takerFeesAmountInUSD.String(),
157-
)
158-
}
154+
perpFees = types.NewPerpetualFees(
155+
perpFeesCoins,
156+
slippageCoins,
157+
weightBreakingFeesCoins,
158+
takerFeesCoins,
159+
)
160+
161+
return perpFees
159162
}

x/perpetual/keeper/close.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func (k Keeper) Close(ctx sdk.Context, msg *types.MsgClose) (*types.MsgCloseResponse, error) {
11-
closedMtp, repayAmount, closingRatio, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, err := k.ClosePosition(ctx, msg)
11+
closedMtp, repayAmount, closingRatio, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, totalPerpetualFeesCoins, err := k.ClosePosition(ctx, msg)
1212
if err != nil {
1313
return nil, err
1414
}
@@ -18,6 +18,8 @@ func (k Keeper) Close(ctx sdk.Context, msg *types.MsgClose) (*types.MsgCloseResp
1818
return nil, err
1919
}
2020

21+
perpFeesInUsd, slippageFeesInUsd, weightBreakingFeesInUsd, takerFeesInUsd := k.GetPerpFeesInUSD(ctx, totalPerpetualFeesCoins)
22+
2123
ctx.EventManager().EmitEvent(
2224
sdk.NewEvent(types.EventClose,
2325
sdk.NewAttribute("mtp_id", strconv.FormatInt(int64(closedMtp.Id), 10)),
@@ -38,6 +40,10 @@ func (k Keeper) Close(ctx sdk.Context, msg *types.MsgClose) (*types.MsgCloseResp
3840
sdk.NewAttribute("trading_asset_price", tradingAssetPrice.String()),
3941
sdk.NewAttribute("all_interests_paid", strconv.FormatBool(allInterestsPaid)), // Funding Fee is fully paid but interest amount is only partially paid then this will be false
4042
sdk.NewAttribute("force_closed", strconv.FormatBool(forceClosed)),
43+
sdk.NewAttribute(types.AttributeKeyPerpFee, perpFeesInUsd.String()),
44+
sdk.NewAttribute(types.AttributeKeySlippage, slippageFeesInUsd.String()),
45+
sdk.NewAttribute(types.AttributeKeyWeightBreakingFee, weightBreakingFeesInUsd.String()),
46+
sdk.NewAttribute(types.AttributeTakerFees, takerFeesInUsd.String()),
4147
))
4248

4349
return &types.MsgCloseResponse{

x/perpetual/keeper/close_position.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,34 @@ import (
99
"github.com/elys-network/elys/v6/x/perpetual/types"
1010
)
1111

12-
func (k Keeper) ClosePosition(ctx sdk.Context, msg *types.MsgClose) (types.MTP, math.Int, math.LegacyDec, math.Int, math.Int, math.Int, math.Int, math.Int, bool, bool, error) {
12+
func (k Keeper) ClosePosition(ctx sdk.Context, msg *types.MsgClose) (types.MTP, math.Int, math.LegacyDec, math.Int, math.Int, math.Int, math.Int, math.Int, bool, bool, types.PerpetualFees, error) {
1313
// Retrieve MTP
1414
creator := sdk.MustAccAddressFromBech32(msg.Creator)
15+
zeroPerpFees := types.NewPerpetualFeesWithEmptyCoins()
1516
mtp, err := k.GetMTP(ctx, msg.PoolId, creator, msg.Id)
1617
if err != nil {
17-
return types.MTP{}, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, err
18+
return types.MTP{}, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, zeroPerpFees, err
1819
}
1920

2021
pool, found := k.GetPool(ctx, mtp.AmmPoolId)
2122
if !found {
22-
return mtp, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, errorsmod.Wrap(types.ErrPoolDoesNotExist, fmt.Sprintf("poolId: %d", mtp.AmmPoolId))
23+
return mtp, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, zeroPerpFees, errorsmod.Wrap(types.ErrPoolDoesNotExist, fmt.Sprintf("poolId: %d", mtp.AmmPoolId))
2324
}
2425

2526
// Retrieve AmmPool
2627
ammPool, err := k.GetAmmPool(ctx, mtp.AmmPoolId)
2728
if err != nil {
28-
return mtp, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, err
29+
return mtp, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, zeroPerpFees, err
2930
}
3031

3132
// this also handles edge case where bot is unable to close position in time.
32-
repayAmt, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, err := k.MTPTriggerChecksAndUpdates(ctx, &mtp, &pool, &ammPool)
33+
repayAmt, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, perpetualFeesCoins, err := k.MTPTriggerChecksAndUpdates(ctx, &mtp, &pool, &ammPool)
3334
if err != nil {
34-
return types.MTP{}, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, err
35+
return types.MTP{}, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), false, false, zeroPerpFees, err
3536
}
3637

3738
if forceClosed {
38-
return mtp, repayAmt, math.LegacyOneDec(), returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, nil
39+
return mtp, repayAmt, math.LegacyOneDec(), returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, perpetualFeesCoins, nil
3940
}
4041

4142
// Should be declared after SettleMTPBorrowInterestUnpaidLiability and settling funding
@@ -48,18 +49,19 @@ func (k Keeper) ClosePosition(ctx sdk.Context, msg *types.MsgClose) (types.MTP,
4849
}
4950

5051
// Estimate swap and repay
51-
repayAmt, returnAmt, err = k.EstimateAndRepay(ctx, &mtp, &pool, &ammPool, closingRatio)
52+
repayAmt, returnAmt, perpFees, err := k.EstimateAndRepay(ctx, &mtp, &pool, &ammPool, closingRatio)
5253
if err != nil {
53-
return mtp, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), allInterestsPaid, forceClosed, err
54+
return mtp, math.ZeroInt(), math.LegacyZeroDec(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), allInterestsPaid, forceClosed, perpetualFeesCoins, err
5455
}
56+
perpetualFeesCoins = perpetualFeesCoins.Add(perpFees)
5557

5658
// EpochHooks after perpetual position closed
5759
if k.hooks != nil {
5860
err = k.hooks.AfterPerpetualPositionClosed(ctx, ammPool, pool, creator, closingRatio, mtp.Id)
5961
if err != nil {
60-
return mtp, math.Int{}, math.LegacyDec{}, math.Int{}, math.Int{}, math.Int{}, math.Int{}, math.Int{}, allInterestsPaid, forceClosed, err
62+
return mtp, math.Int{}, math.LegacyDec{}, math.Int{}, math.Int{}, math.Int{}, math.Int{}, math.Int{}, allInterestsPaid, forceClosed, zeroPerpFees, err
6163
}
6264
}
6365

64-
return mtp, repayAmt, closingRatio, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, nil
66+
return mtp, repayAmt, closingRatio, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt, allInterestsPaid, forceClosed, perpetualFeesCoins, nil
6567
}

x/perpetual/keeper/estimate_and_repay.go

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,44 @@ import (
1515

1616
// EstimateAndRepay ammPool has to be pointer because RemoveFromPoolBalance (in Repay) updates pool assets
1717
// Important to send pointer mtp and pool
18-
func (k Keeper) EstimateAndRepay(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool *ammtypes.Pool, closingRatio math.LegacyDec) (math.Int, math.Int, error) {
18+
func (k Keeper) EstimateAndRepay(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool *ammtypes.Pool, closingRatio math.LegacyDec) (math.Int, math.Int, types.PerpetualFees, error) {
1919

2020
if closingRatio.LTE(math.LegacyZeroDec()) || closingRatio.GT(math.LegacyOneDec()) {
21-
return math.Int{}, math.Int{}, fmt.Errorf("invalid closing ratio (%s)", closingRatio.String())
21+
return math.Int{}, math.Int{}, types.PerpetualFees{}, fmt.Errorf("invalid closing ratio (%s)", closingRatio.String())
2222
}
23-
23+
zeroPerpFees := types.NewPerpetualFeesWithEmptyCoins()
2424
repayAmount, payingLiabilities, _, slippageAmount, weightBreakingFee, repayOracleAmount, perpetualFees, takerFees, err := k.CalcRepayAmount(ctx, mtp, ammPool, closingRatio)
2525
if err != nil {
26-
return math.ZeroInt(), math.ZeroInt(), err
26+
return math.ZeroInt(), math.ZeroInt(), zeroPerpFees, err
27+
}
28+
perpFees := k.CalculatePerpetualFees(ctx, ammPool.PoolParams.UseOracle, sdk.NewCoin(mtp.CustodyAsset, repayAmount), sdk.NewCoin(mtp.LiabilitiesAsset, payingLiabilities), slippageAmount, weightBreakingFee, perpetualFees, takerFees, repayOracleAmount, false, false)
29+
// Track slippage and weight breaking fee slippage in amm via perpetual
30+
for _, coin := range perpFees.SlippageFees {
31+
k.amm.TrackSlippage(ctx, ammPool.PoolId, coin)
32+
}
33+
for _, coin := range perpFees.WeightBreakingFees {
34+
if coin.Amount.IsPositive() {
35+
k.amm.TrackWeightBreakingSlippage(ctx, ammPool.PoolId, coin)
36+
}
2737
}
28-
k.CalculateAndEmitPerpetualFeesEvent(ctx, ammPool.PoolParams.UseOracle, sdk.NewCoin(mtp.CustodyAsset, repayAmount), sdk.NewCoin(mtp.LiabilitiesAsset, payingLiabilities), slippageAmount, weightBreakingFee, perpetualFees, takerFees, repayOracleAmount, false)
2938

3039
returnAmount, err := k.CalcReturnAmount(*mtp, repayAmount, closingRatio)
3140
if err != nil {
32-
return math.ZeroInt(), math.ZeroInt(), err
41+
return math.ZeroInt(), math.ZeroInt(), zeroPerpFees, err
3342
}
3443

3544
entry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency)
3645
if !found {
37-
return math.Int{}, math.Int{}, errorsmod.Wrapf(assetprofiletypes.ErrAssetProfileNotFound, "asset %s not found", ptypes.BaseCurrency)
46+
return math.Int{}, math.Int{}, types.PerpetualFees{}, errorsmod.Wrapf(assetprofiletypes.ErrAssetProfileNotFound, "asset %s not found", ptypes.BaseCurrency)
3847
}
3948
baseCurrency := entry.Denom
4049

4150
// Note: Long settlement is done in trading asset. And short settlement in usdc in Repay function
42-
if err = k.Repay(ctx, mtp, pool, ammPool, returnAmount, payingLiabilities, closingRatio, baseCurrency); err != nil {
43-
return math.ZeroInt(), math.ZeroInt(), err
51+
if err = k.Repay(ctx, mtp, pool, ammPool, returnAmount, payingLiabilities, closingRatio, baseCurrency, &perpFees); err != nil {
52+
return math.ZeroInt(), math.ZeroInt(), zeroPerpFees, err
4453
}
4554

46-
return repayAmount, returnAmount, nil
55+
return repayAmount, returnAmount, perpFees, nil
4756
}
4857

4958
// CalcRepayAmount repay amount is in custody asset for liabilities with closing ratio

x/perpetual/keeper/events.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import (
88
"github.com/elys-network/elys/v6/x/perpetual/types"
99
)
1010

11-
func (k Keeper) EmitForceClose(ctx sdk.Context, trigger string, mtp types.MTP, repayAmount, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt math.Int, closer string, allInterestsPaid bool, tradingAssetPrice math.LegacyDec) {
11+
func (k Keeper) EmitForceClose(ctx sdk.Context, trigger string, mtp types.MTP, repayAmount, returnAmt, fundingFeeAmt, fundingAmtDistributed, interestAmt, insuranceAmt math.Int, closer string, allInterestsPaid bool, tradingAssetPrice math.LegacyDec, totalPerpetualFeesCoins types.PerpetualFees) {
12+
13+
perpFeesInUsd, slippageFeesInUsd, weightBreakingFeesInUsd, takerFeesInUsd := k.GetPerpFeesInUSD(ctx, totalPerpetualFeesCoins)
14+
1215
ctx.EventManager().EmitEvent(sdk.NewEvent(types.EventForceClosed,
1316
sdk.NewAttribute("mtp_id", strconv.FormatInt(int64(mtp.Id), 10)),
1417
sdk.NewAttribute("owner", mtp.Address),
@@ -27,5 +30,9 @@ func (k Keeper) EmitForceClose(ctx sdk.Context, trigger string, mtp types.MTP, r
2730
sdk.NewAttribute("trading_asset_price", tradingAssetPrice.String()),
2831
sdk.NewAttribute("all_interests_paid", strconv.FormatBool(allInterestsPaid)), // Funding Fee is fully paid but interest amount is only partially paid then this will be false
2932
sdk.NewAttribute("trigger", trigger),
33+
sdk.NewAttribute(types.AttributeKeyPerpFee, perpFeesInUsd.String()),
34+
sdk.NewAttribute(types.AttributeKeySlippage, slippageFeesInUsd.String()),
35+
sdk.NewAttribute(types.AttributeKeyWeightBreakingFee, weightBreakingFeesInUsd.String()),
36+
sdk.NewAttribute(types.AttributeTakerFees, takerFeesInUsd.String()),
3037
))
3138
}

x/perpetual/keeper/force_close.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ import (
77
"github.com/elys-network/elys/v6/x/perpetual/types"
88
)
99

10-
func (k Keeper) ForceClose(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool *ammtypes.Pool) (math.Int, math.Int, error) {
10+
func (k Keeper) ForceClose(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool *ammtypes.Pool) (math.Int, math.Int, types.PerpetualFees, error) {
1111
// Estimate swap and repay
12-
repayAmt, returnAmount, err := k.EstimateAndRepay(ctx, mtp, pool, ammPool, math.LegacyOneDec())
12+
repayAmt, returnAmount, perpetualFeesCoins, err := k.EstimateAndRepay(ctx, mtp, pool, ammPool, math.LegacyOneDec())
1313
if err != nil {
14-
return math.ZeroInt(), math.ZeroInt(), err
14+
return math.ZeroInt(), math.ZeroInt(), types.NewPerpetualFeesWithEmptyCoins(), err
1515
}
1616

1717
address := sdk.MustAccAddressFromBech32(mtp.Address)
1818
// EpochHooks after perpetual position closed
1919
if k.hooks != nil {
2020
err = k.hooks.AfterPerpetualPositionClosed(ctx, *ammPool, *pool, address, math.LegacyOneDec(), mtp.Id)
2121
if err != nil {
22-
return math.Int{}, math.Int{}, err
22+
return math.Int{}, math.Int{}, types.PerpetualFees{}, err
2323
}
2424
}
2525

26-
return repayAmt, returnAmount, nil
26+
return repayAmt, returnAmount, perpetualFeesCoins, nil
2727
}

x/perpetual/keeper/force_close_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (suite *PerpetualKeeperTestSuite) TestForceCloseShort_Successful() {
5858

5959
suite.Require().Nil(err)
6060

61-
_, _, err = k.ForceClose(ctx, &mtp, &pool, &ammPool)
61+
_, _, _, err = k.ForceClose(ctx, &mtp, &pool, &ammPool)
6262

6363
suite.Require().Nil(err)
6464
}

0 commit comments

Comments
 (0)