Stress one market with a price shock
/v1/chains/{chain}/perpl/markets/{market}/stressCall this to see what a sudden move of the mark would do to a market. shock is the move as a fraction: -0.1 is a fall of 10% and 0.05 a rise of 5%. It lies from -0.5 to 0.5, is not 0, and is -0.1 when absent. p0 is the mark and p1 the shocked price.
liquidatingholds the notional atp1, the number of positions and the number of accounts that the shock liquidates.gap_bad_debt_usdis the loss beyond the traders' margin if every liquidation fills atp1. It is a floor, ascoveragesays.insurance_fund_usdis the fund of the market.scris the Shock Cover Ratio, the fund divided by the gap bad debt: 2.5 means that the fund covers the loss 2.5 times. It isnullandno_bad_debtistruewhen the shock causes no bad debt.uncovered_usdis the bad debt that the fund cannot pay, which would fall on the rest of the system. It is 0 whenscris 1 or more.top_positionslists up to 10 liquidating positions, the largest notional at the mark first, with their size, notional at the mark, liquidation price, bankruptcy price and bad debt.
Path parameters
| Name | Type | Description |
|---|---|---|
chainRequired | string | The chain, as a CAIP-2 chain ID. Only Monad, |
marketRequired | string | A market, as its symbol in any case ( |
Query parameters
| Name | Type | Description |
|---|---|---|
shock | numberDefault -0.1 | The price move as a fraction of the mark: |
Response
The answer, wrapped in the {data, meta, links} envelope. data.kind is perpl_market_stress. meta.as_of names the snapshot block.
| Field | Type | Description |
|---|---|---|
| chain | string | The CAIP-2 id of the chain. |
| coverage | array of strings | The codes of the limits that apply to this answer, in a fixed order. It is empty when none applies. The status route explains each code. |
| gap_bad_debt_usd | string | An amount in US dollars as a decimal string with up to 6 decimals and no trailing zeros. It can be negative for a PnL. |
| insurance_fund_usd | string | An amount in US dollars as a decimal string with up to 6 decimals and no trailing zeros. It can be negative for a PnL. |
| kind | string | perpl_market_stress |
| liquidating | object | |
| no_bad_debt | boolean | Whether the shock causes no bad debt. |
| p0 | string | The mark before the shock. |
| p1 | string | The mark after the shock. |
| perp_id | integer | |
| scr | number | null | The insurance fund divided by the gap bad debt, |
| shock | number | The price move as a fraction of the mark. |
| symbol | string | |
| top_positions | array of objects | Up to 10 liquidating positions, the largest notional first, ties by account id. |
| uncovered_usd | string | An amount in US dollars as a decimal string with up to 6 decimals and no trailing zeros. It can be negative for a PnL. |
Cost
1 credit. The time limit is 5 seconds.
Errors
| Status | Code |
|---|---|
| 400 | invalid_query |
| 404 | not_foundunsupported_chain |
| 429 | rate_limitedcredits_exhausted |
| 500 | internal |
| 503 | upstream_unavailable |
| 504 | deadline_exceeded |
400 invalid_query for a bad shock, 404 not_found, 404 unsupported_chain, 503 and 504 as elsewhere.