[Invariant fix] Streaming Swap Transient Invariant Breaks
Invariants for streaming swaps contain an issue that flags the invariant if the actual streaming swap parameters do not match the exact intent of the user. However, there are instances where THORNode decreases the parameters of the streaming swap in order to meet the target bps.
The invariant breaks when:
- User specifies a specific
streaming_quantity
and THORNode decreases thestreaming_quantity
to a lower value to achieve the target bps of 5 - A swap is constructed as a streaming swap, but the amount is smaller than needed to achieve the target bps of 5, so a single swap is done instead of a streaming swap
Example:
{
"broken": true,
"invariant": "streaming_swaps",
"msg": [
"swap count 4 not equal to stream count 3",
"stream not found for swap: 3B24362746416A8427ECC87E47F436592ACFE3F90DF83831913C03E7AFBF4A68"
]
}
Suggested solution:
- Do not fire an invariant if user specified streaming_quantity > actual streaming_quantity
- Check
max_streaming_quantity
for the given swap and fire the invariant ifactual streaming quantity > max_streaming_quantity
Edited by akrokr