EWMA 가스 가격 페널티
DeepBook은 네트워크 gas price에 따라 taker fee를 동적으로 조정하기 위해 exponentially weighted moving average (EWMA) system을 구현한다. 이 기능은 toxic taker가 높은 gas price를 사용해 자신의 transaction을 우선 처리하고 stale maker order를 먼저 체결하는 것을 방지하는 데 도움이 된다.
개요
이 system은 시간에 따라 gas price를 추적하고 현재 gas price가 최근 이력에 비해 비정상적으로 높을 때 taker에 penalty fee를 적용한다. 이는 toxic taker가 frontrun하거나 stale order를 악용하려 할 수 있는 비정상적인 네트워크 활동 기간 동안 maker의 order가 체결되는 것을 방지한다.
작동 방식
EWMA system은 최근 gas price의 smoothed average와 variance를 계산한 다음 현재 gas price를 이 historical baseline과 비교한다. 현재 gas price가 유의미하게 상승하면(standard deviation으로 측정한 threshold를 초과하면) 추가 taker fee penalty가 적용된다.
- Mean (μ): 최근 gas price의 smoothed average이다.
- Variance (σ²): gas price volatility의 측정치이다.
- Standard Deviation (σ): variance의 제곱근이며 z-score 계산에 사용된다.
- Z-Score: 현재 gas price가 mean에서 몇 standard deviation 떨어져 있는지를 나타낸다.
- Z-Score Threshold: penalty 적용을 트리거하는 지점이다.