write.account.deleverage
Sell account collateral to repay debt in one atomic transaction while keeping positions active. Use this tool for standalone repayment without closing positions.
Instructions
Multi-step flash-action: sells account collateral to the debt token and repays in one atomic transaction — no wallet tokens needed. To repay from wallet tokens instead, use write.account.repay. NOTE: If you are closing a position (remove LP + swap + repay + withdraw), prefer write.account.close which batches everything atomically. Only use this tool for standalone repayment while keeping the position active. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation — if tenderly_sim_status is 'false', do NOT broadcast the transaction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_address | Yes | Arcadia account address | |
| amount_in | Yes | Collateral amount to sell (raw units) | |
| asset_from | Yes | Collateral token to sell | |
| numeraire | Yes | Debt token address | |
| creditor | Yes | Lending pool address | |
| slippage | No | Basis points, 100 = 1% | |
| chain_id | No | Chain ID: 8453 (Base) or 130 (Unichain) |