Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

aHYPESeat Events Reference

Complete event reference for the SeatMarket contract.

Fee Accrual Events

Accrued

Emitted when fees are accrued to the cumulative index.

event Accrued(
    uint256 dt,
    uint256 feePerSecond,
    uint256 totalFeeAccrued,
    uint256 newCumulativeFee
);
ParameterTypeIndexedDescription
dtuint256NoTime elapsed since last accrual (seconds)
feePerSeconduint256NoFee rate during this period (WAD)
totalFeeAccrueduint256NoTotal fees accrued this period
newCumulativeFeeuint256NoNew cumulative fee index

Seat Lifecycle Events

SeatPurchased

Emitted when a user purchases a seat.

event SeatPurchased(address indexed user, uint256 deposit);
ParameterTypeIndexedDescription
useraddressYesAddress that purchased the seat
deposituint256NoAmount of aHYPE deposited

SeatKicked

Emitted when an unhealthy position is liquidated.

event SeatKicked(
    address indexed user,
    address indexed kicker,
    uint256 collateralSeized,
    uint256 debtValue
);
ParameterTypeIndexedDescription
useraddressYesAddress that was liquidated
kickeraddressYesAddress that performed liquidation
collateralSeizeduint256NoAmount of collateral seized
debtValueuint256NoDebt value at liquidation

Collateral Events

CollateralAdded

Emitted when a user adds collateral to their position.

event CollateralAdded(address indexed user, uint256 amount);
ParameterTypeIndexedDescription
useraddressYesAddress adding collateral
amountuint256NoAmount of aHYPE added

CollateralWithdrawn

Emitted when a user withdraws excess collateral.

event CollateralWithdrawn(address indexed user, uint256 amount);
ParameterTypeIndexedDescription
useraddressYesAddress withdrawing collateral
amountuint256NoAmount of aHYPE withdrawn

Fee Events

FeesRepaid

Emitted when a user repays accrued fees.

event FeesRepaid(address indexed user, uint256 amount);
ParameterTypeIndexedDescription
useraddressYesAddress repaying fees
amountuint256NoAmount of fees repaid

FeeDistributed

Emitted when fees are distributed (to recipient and burn).

event FeeDistributed(uint256 toRecipient, uint256 burned);
ParameterTypeIndexedDescription
toRecipientuint256NoAmount sent to fee recipient
burneduint256NoAmount burned

Admin Events

ParamsUpdated

Emitted when market parameters are updated.

event ParamsUpdated(
    uint256 maxSeats,
    uint256 minFeePerSecond,
    uint256 maxFeePerSecond,
    address feeRecipient,
    uint256 burnBps
);
ParameterTypeIndexedDescription
maxSeatsuint256NoNew maximum seats
minFeePerSeconduint256NoNew minimum fee rate
maxFeePerSeconduint256NoNew maximum fee rate
feeRecipientaddressNoNew fee recipient address
burnBpsuint256NoNew burn rate in basis points

Event Flow Examples

Complete Seat Purchase Flow

1. User calls purchaseSeat(1000e8)
   └── SeatPurchased(user, 1000e8)
 
2. Time passes, fees accrue
   └── Accrued(86400, feeRate, totalFee, newIndex)  // on next interaction

Fee Repayment Flow

1. User checks debt
   └── debtValueOf(user) returns 50e8
 
2. User calls repayFees(50e8)
   └── FeesRepaid(user, 50e8)
   └── FeeDistributed(45e8, 5e8)  // assuming 10% burn

Liquidation Flow

1. Position becomes unhealthy (debt > collateral)
 
2. Liquidator calls kick(user)
   └── SeatKicked(user, liquidator, collateral, debt)
   └── FeeDistributed(collateral * 0.9, collateral * 0.1)

Voluntary Exit Flow

1. User calls exit()
   └── FeeDistributed(debt * 0.9, debt * 0.1)
   └── User receives (collateral - debt) aHYPE

Monitoring Recommendations

Key Events for Integrators

Use CaseEvents to Monitor
Track seat changesSeatPurchased, SeatKicked, exit (no event)
Monitor feesAccrued, FeesRepaid, FeeDistributed
Track collateralCollateralAdded, CollateralWithdrawn
Liquidation botsSeatKicked (for confirmation)
Parameter changesParamsUpdated

Liquidation Bot Integration

To build a liquidation bot:

  1. Monitor SeatPurchased to track new positions
  2. Periodically call isHealthy(user) for all seat holders
  3. When unhealthy found, call kick(user)
  4. Listen for SeatKicked to confirm liquidation

Event Indexing

All address parameters with indexed modifier can be filtered efficiently:

  • user in seat and collateral events
  • kicker in liquidation events

Fee Tracking

To calculate total fees collected:

  1. Sum all FeeDistributed.toRecipient events
  2. Sum all FeeDistributed.burned events for burn statistics

Utilization Tracking

Monitor SeatPurchased and SeatKicked events to track:

  • occupiedSeats changes
  • Utilization rate changes
  • Fee rate implications