alperp-2
v0.0.1
Published
Detects the closing of a large position or large decrease in an existing position.
Downloads
2
Readme
Closing/Decreasing large size position detection bot
Description
This bot detects the closing of a position or decrease in an existing position in Perp Trade when the sizeDelta
is considered large.
The threshold
largeLimit
of what is considered large for each network can be adjusted inNetworkData
in src/network.ts.
Supported Chains
- Polygon
Alerts
ALPERP-2-1
- Fired when a
DecreasePosition
andClosePosition
event with the samekey
andsizeDelta
is emitted withsizeDelta
that exceed the thresholdLARGE_LIMIT
. - Severity is always set to "Info".
- Type is always set to "Info".
- Metadata contains:
Perp Trade
: The address of Perp Trade contract.Account
: The address of the position owner.Position size
: The size of the closed position.Position key
: The key of the closed position.
- Fired when a
ALPERP-2-2
- Fired when only a
DecreasePosition
event is emitted withsizeDelta
that exceed the thresholdLARGE_LIMIT
. - Severity is always set to "Info".
- Type is always set to "Info".
- Metadata contains:
Perp Trade
: The address of Perp Trade contract.Account
: The address of the position owner.Position decrease
: The decrease in size of the position.Position key
: The key of the position.
- Fired when only a
Test Data
The bot behaviour can be verified with the following transaction:
0xce98d63712a45d3cc5b7369b5548217eff454949ae8b618860d71162b41d921e
LARGE_LIMIT
should be set to <= 50000 for this test transaction.0xa5f7db729f225c5b6099d24cf5f9f29bab81481bd0a64fa46cfbfa7f783fc8b6
LARGE_LIMIT
should be set to <= 7000 for this test transaction.0x5d3510969d786adaed50d4f21fe73916f39cb9465910f6e0cd2571815c599cb0
LARGE_LIMIT
should be set to <= 29000 for this test transaction.