> For the complete documentation index, see [llms.txt](https://docs.marginly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.marginly.com/protocol-architecture/errors.md).

# Errors

A list containing errors that exist in Marginly. Descriptions provide context, user actions mention what sort of activity might trigger said error while display message contains the information that a user sees when encountering the error.&#x20;

<table data-full-width="true"><thead><tr><th width="256">Error</th><th width="210">Description</th><th width="121">User action</th><th width="293">Display message</th></tr></thead><tbody><tr><td>AccessDenied();</td><td>Pool Factory error if someone invokes owner methods</td><td></td><td></td></tr><tr><td>ExceedsLimit();</td><td>As a result of user action token limits will be exceeded</td><td>Deposit Long Short</td><td>Pool asset limit reached. Try again later. Learn more about limits here (TBD).</td></tr><tr><td>EmergencyMode();</td><td>Only withdrawals are allowed. Action is shut down</td><td>Any action except for emergency withdraw</td><td>The Pool is in shutdown mode. Only emergency withdrawals are allowed. Learn more about the shutdown <a href="https://docs.marginly.com/protocol-mechanics/risk-management#shutdown-mode">here</a></td></tr><tr><td>Forbidden();</td><td>Pool Factory error. Generic error e.g. when setting parameters</td><td></td><td></td></tr><tr><td>LongEmergency();</td><td>Withdraw from short position in emergency mode</td><td>Any action except for emergency withdraw</td><td>The Pool is in shutdown mode. Only emergency withdrawals are allowed. Learn more about the shutdown <a href="https://docs.marginly.com/protocol-mechanics/risk-management#shutdown-mode">here</a></td></tr><tr><td>Locked();</td><td>Protection from reentrancy smart contract attack. Prevents smart contract from invoking itself</td><td></td><td></td></tr><tr><td>LessThanMinimalAmount();</td><td>Amount is less than minimum allowed position size</td><td>Deposit Long Short</td><td>Asset quantity has to be greater than &#x3C;<em>%limit%</em>> <em>&#x3C;%token%></em></td></tr><tr><td>BadLeverage();</td><td>Leverage exceeds maximum allowed</td><td>Long Short Withdraw</td><td>Max leverage of <em>&#x3C;%leverage%></em> exceeded. Please adjust trade parameters and try again.</td></tr><tr><td>NotLiquidatable();</td><td>Keeper fails to receiveposition() with normal leverage</td><td></td><td></td></tr><tr><td>NotOwner();</td><td>pool error: non-owner invokes owner methods</td><td></td><td></td></tr><tr><td>NotWETH9();</td><td>When the asset is not from WETH9 contract. Can appear during wrap/unwrap</td><td></td><td></td></tr><tr><td>PoolAlreadyCreated();</td><td>This pool already exists</td><td></td><td></td></tr><tr><td>PositionInitialized();</td><td>Appears only in the receiveposition()</td><td></td><td></td></tr><tr><td>ShortEmergency();</td><td>Withdraw from long position in emergency mode</td><td>Any action except for emergency withdraw</td><td>The Pool is in shutdown mode. Only emergency withdrawals are allowed. Learn more about the shutdown <a href="https://docs.marginly.com/protocol-mechanics/risk-management#shutdown-mode">here</a></td></tr><tr><td>SlippageLimit();</td><td>exchange exceeded the slippage limit. can trigger other router errors: - InsufficientAmount: swapexactinput with bad price - TooMuchRequested: swapexactoutput with bad price</td><td>Long Short Close Liquidate</td><td>Slippage limit of &#x3C;%slippage%> exceeded. Please adjust the trade parameters and try again.</td></tr><tr><td>NotEmergency();</td><td>emergency withdrawal when not in shutdown.</td><td></td><td></td></tr><tr><td>UninitializedPosition();</td><td>when withdrawing from an empty position</td><td></td><td></td></tr><tr><td>UniswapPoolNotFound();</td><td>pool factory error: there is no corresponding uniswap pool</td><td></td><td></td></tr><tr><td>UnknownCall();</td><td>decoding-related error</td><td></td><td></td></tr><tr><td>WrongIndex();</td><td>heap access error</td><td></td><td></td></tr><tr><td>WrongPositionType();</td><td>long/short/withdraw/close using unsupported collateral</td><td>Long Short Withdraw Close</td><td>Can’t <strong>long</strong> &#x3C;base_token> with &#x3C;quote_token as margin> Can’t <strong>short</strong> &#x3C;base_token> with &#x3C;base_token as margin> Can’t <strong>withdraw</strong> debt.</td></tr><tr><td>WrongValue();</td><td>pool factory: wrong parameter value when creating a pool</td><td></td><td></td></tr><tr><td>ZeroAmount();</td><td><p>when depositing/withdrawing 0 amount</p><p>router: when exchange amount is 0</p></td><td></td><td>Can’t deposit/withdraw/exchange 0 tokens.</td></tr><tr><td>STF</td><td>safe transfer if no approval or insufficient balance. router: not enough money in marginly pool</td><td></td><td>Insufficient pool balance to perform the transaction.</td></tr><tr><td>ST</td><td>pool doesn’t have a balance. router: dex is sending wrong amounts</td><td></td><td>Insufficient pool balance to perform the transaction.</td></tr><tr><td>STE</td><td>same as ST but for ETH.</td><td></td><td>Insufficient pool balance to perform the transaction.</td></tr><tr><td>UnknownDex</td><td>router can’t find dex</td><td></td><td></td></tr><tr><td>Forbidden</td><td>generic error when setting router parameters.</td><td></td><td></td></tr><tr><td>UnknownPool</td><td>router error: no Pool on target DEX with specified tokens</td><td></td><td></td></tr><tr><td>WrongAmountOut</td><td>router error: dex amount doesn't match expected amount</td><td></td><td></td></tr></tbody></table>
