Share Dialog

This fourth article dives into a feature of the protocol that in some specific occasions allows keepers to force the closing of some Hedging Agents positions.
Trading is a zero-sum game: losers pay for winners. For a market to exist, there needs to be both buyers and sellers. To maintain this equilibrium, traditional perpetual exchanges introduced a funding rate that depends on the ratio between longs and shorts: the higher the ratio, the more expensive it will be to maintain long positions, and inversely. As a result, this additional fee incentivizes traders to go long or short depending on how high the rate is, pushing the balance back towards equilibrium.
In Angle, agTokens holders can be seen as the short side. After agToken minting, the protocol owns the collateral used for the mint, but doesn’t want to be affected by its price changes: its main job is only to fully back the agTokens issued at all times.
To fulfill this task, Angle lets Hedging Agents open leverage long positions on the available collateral/agTokens pairs. As such, Hedging Agents’ first role is to hedge the protocol against collateral price volatility, making sure it is always fully backing the agTokens that have been issued.
They represent the long-side of the trade, at the opposite of agTokens holders. As such, they need to be balanced with the quantity of stablecoins that has been minted. The force-closing of positions is Angle’s mechanism to maintain this balance.
If you want to learn more about the role of Hedging Agents in Angle you can read our docs at https://docs.angle.money/concepts/hedging-agents.
As said above, HAs are here to hedge the protocol against collateral price variations. As such, they have to hedge a very specific value: the amount of collateral that was used to mint agTokens at the price it was transferred to the protocol. To be constantly hedged, the protocol needs to maintain a balance between the size of these positions and the stablecoins supply in circulation (i.e find a similar but more direct mechanism than the funding rate).
If users mint new stablecoins using collateral A, only the quantity of collateral equal to the value of the minted stablecoins needs to be hedged. To make sure this is respected, HAs will be able to open new long positions on this collateral A/stablecoin pair, only up to the quantity of stablecoins that were minted using collateral A.
If stablecoins are burned for collateral A, collateral A is removed from the protocol and the stablecoin’s circulating supply is reduced. However, Hedging Agents are still hedging the same amount: the protocol is over-hedged, and positions need to be closed. This is where the force-close of positions comes into play.
For example, if 100,000 agEUR are minted using USDC, HAs can only open positions worth 100,000€ in total on the USDC/EUR pair. Then, if 10,000 agEUR are burned for USDC, keepers would need to force-close approximately 10,000€ worth of USDC/EUR positions (depending on the ratios detailed below).
All the following quantities are specific to a collateral/stablecoin pair.
The total hedged amount is the total value of stablecoins hedged by HA positions.
The target hedge ratio is the share of the total value of stablecoins issued that the protocol wants to get hedged (usually slightly under 100%). Above this value, HAs cannot open new positions.
The limit hedge ratio is the maximum proportion of stablecoins issued that can be hedged by HAs. This is above this value that HAs positions can start to be force-closed by keepers.
In practice, keepers can force-close HA positions when the total hedged amount goes above the limit hedge amount (issued stablecoins * limit hedge ratio). In this case, they will be incentivized to force-close positions so that the decrease in total hedged amount puts it back at or close below the target hedge amount of the protocol (usually slightly below the amount of stablecoins in circulation).
The keeper force-closing the position would get rewarded with a share of the closing fees paid by the position holder, depending on how close the hedge ratio now is to the target, and up to a maximum amount set by governance (maxKeeperFee).
Let’s say that 1,000,000 agEUR have been issued using USDC as a single collateral, that the target hedge ratio is 96%, and that the limit hedge ratio is 100%. Hedging Agents can open positions on USDC worth up to 960,000€.
Let’s say HAs open 4 positions worth 200,000€ and one worth 160,000€. A moment later, users burn 100,000 agEUR for USDC. The limit hedge amount is now at 100% x 900,000€ = 900,000€, so a position has to be force closed. In this case, the position worth 160,000€ will be force-closed, as it would put the protocol the closest below the target hedge amount, which is now at 96% * 900,000€ = 864,00€.
If the share of the fee paid to keepers is x, with closing fees at 0.3% and a maxKeeperFee of 500€, the keeper would receive the minimum between 160,000€ 0.003 x = x 480€ and 500€.
*Note that in practice, a keeper can force-close multiple positions at the same time. In this case, the protocol computes the keeper reward by considering that everything is as if only one big perpetual has been closed with a closing fee equal to the sum of all closing fees of the perpetuals closed.
Actually, there is an additional complexity on the way keeper fees are computed. Force closing is an important power available to anyone and the protocol needs to make sure that people do not use it for a different purpose than making sure that there are not too many longs.
In theory, a malicious individual could burn agTokens to reduce the protocol limit hedge amount below the current hedged amount, thus being able to force-close positions and getting the reward. Doing this repeatedly would actually plummet the agToken supply and kill the protocol.
To avoid this situation, the protocol introduces an additional cap on the amount of rewards that can be given to a keeper force closing perpetuals. This cap estimates the cost for burning stablecoins and thus increasing the hedge ratio above the limit hedge amount. A keeper should not be able to get more rewards than what it has costed to do the manipulation.
Let’s look at an example where the current hedge ratio is equal to the target hedge ratio:
Burn Fees = f_burn
Target Hedge Ratio = t
Limit Hedge Ratio = l
Stablecoins Issued with this collateral (stocks user) = s
To increase the hedge ratio from the target to the limit value by burning stablecoins while keeping a fixed hedge amount value, if s stablecoins were issued using this collateral, one needs to burn an amount q of stablecoins such that:
!https://miro.medium.com/max/1178/1*bRQyxDv-8ON6QUYF7-OecA.png
This means that we need q to be:
!https://miro.medium.com/max/1006/1*MXiALc6BKM3RS13_e54jXw.png
The cost for doing this in stablecoin value is:
!https://miro.medium.com/max/996/1*HpdlVh2MtFgMPW1n6IzsgA.png
Expressed in collateral value, the cost becomes:
!https://miro.medium.com/max/948/1*Scx6Dc3OcTzfIIt06IgWtQ.png
On top of the maximum reward settable by governance, in each occurence of force close the protocol estimates this manipulation cost using a very conservative value (with a very low
These caps is what makes manipulations around force close unsustainable.
As we explained in the beginning, the main goal of the protocol is to ensure it is always backing properly the agTokens it has issued. To that end, it needs a balance between stablecoins issued, and HAs total position size. Above, we just explained how the protocol limits the total position size of HAs to what’s necessary.
But how does it do to grow the position size when demand is low? There are multiple answers to this question.
First, as there is no funding rate on open positions, and new positions can’t always be opened, we believe that the positions that will stick will mainly be long-term ones.
Second, ANGLE tokens will be distributed as rewards to HA positions. The protocol can decide to tune how much is distributed to Hedging Agents to incentivize them to open more positions in times of low demand.
Finally, the protocol also involves SLPs, who bring additional liquidity precisely to fill this gap between Hedging Agents and agTokens users. Also, the protocol should accumulate some surplus that will in part serve as a buffer to ensure it has always enough to pay back agToken holders. Thanks to that, being fully hedged 100% of the time won’t be strictly necessary to ensure the redeamability of agTokens.
To put it plainly, the impacts are that:
There is no funding rate on leverage positions in Angle.
Positions can be closed depending solely on the protocol’s equilibrium, without any user action.
In case of a HA position being force closed, P&L is redistributed as expected, and fees are paid normally.
There is no rule dictating which positions get force-closed or not. The only criteria from a protocol’s perspective is how much rewards are distributed to keepers, which is higher when they put the total hedged amount at, or the closest below target. In a future article, we’ll try to explain what is the optimal behavior in this setting.
In this article, we have tried to detail as much as possible the mechanisms put in place to balance the demand of volatility from Hedging Agents in the protocol.
To do so, we introduced the force-closing of perpetual positions when certain conditions are met, while making sure it couldn’t be abused by any one to profit from others or the protocol.
This results in a very different user experience concerning perpetual positions, but we believe it is a better system for the health of the protocol.
No comments yet