> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aultblockchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lending Positions & Risk

> [!NOTE]
>
> **Testnet-Only.** Use `https://test-dex-api.cloud.aultblockchain.xyz` for these endpoints and the matching Testnet chain for signed actions. This product is not available on Mainnet.

Read supplied shares, collateral, debt, health and liquidation history. Lending supply and collateral are separate balances. For the health formula and liquidation rules, see [Lending](https://docs.aultblockchain.com/ault-dex/lending.md).

## Routes

All routes use `GET` under `/api/v1/lending`.

| Suffix | Query | Body |
| - | - | - |
| `/accounts/{address}/positions` | Optional `pool_id` | `Position[]` |
| `/pools/{pool_id}/positions/{address}` | None | `Position` |
| `/pools/{pool_id}/positions/{address}/history` | Required `from`, `to`, `interval=1h` or `1d` | `PositionHistoryPoint[]` |
| `/liquidations` | Optional `pool_id`, `borrower`, `since`, `limit`, `cursor` | `Liquidation[]` |
| `/deficits` | Optional `pool_id`, `denom` | `Deficit[]` |
| `/funds/insurance` | Required `denom` | `FundBalance` |

Use bech32 or EVM hex for wallet addresses and the returned bech32 account address for derived borrowers. Pool IDs are positive decimal integers. Position history uses positive millisecond bounds **`[from, to)`**: include `from`, exclude `to`.
It has no cursor. Hourly points are returned oldest first. With `interval=1d`, each point keeps the
last available hourly snapshot from that UTC day and labels it at 00:00 UTC, rather than averaging
the day. A day whose midnight is before `from` is excluded even when later hourly data falls
inside the requested window; align bounds to UTC midnights for whole-day results. The liquidation feed also accepts paired `before_height` and `before_index`. See [Pagination](https://docs.aultblockchain.com/dex-api/getting-started/pagination.md) for limits and continuation.

Invalid parameters return 400. A missing single pool/position resource returns 404; empty collections return empty arrays.

## Position amounts and health

`supplies` and `borrows` contain `{denom, shares, assets}`; `collaterals` contains `{denom, amount}`. Asset amounts are raw denom base units, debt includes accrued interest, and shares are not token balances. Health valuation totals use the implementation's raw-amount times oracle-price scale. Do not display them as unscaled human USD or mix them with normalized Perp equity. Ratios such as `healthFactor` are dimensionless. For an 18-decimal Core asset, raw
`1000000000000000000` is one token. At oracle price `"2"`, its raw-scale valuation is
`"2000000000000000000"`; convert that scale before displaying two USD.

`asOf`, `indexedHeight` and `oracleUpdatedAt` describe the view. If any required asset cannot be priced, `healthError` is set and derived health/value fields become null. Do not treat unavailable health as a safe account or a liquidatable account. `liquidatable` is nullable for this reason.

## Position and liquidation history

```bash theme={null}
curl -fsS "$API_URL/api/v1/lending/accounts/$OWNER/positions"
curl -fsS --get "$API_URL/api/v1/lending/liquidations" \
  --data-urlencode "borrower=$OWNER" --data-urlencode 'limit=100'
```

Liquidation rows record repaid and seized `{denom, amount}` values in raw units, plus the block/event position. Deficits and insurance balances help assess pool risk; they do not guarantee available loss coverage.

## Response field reference

Types below describe JSON, not numeric units. See the unit notes above. Nullable values must not be replaced with zero.

> [accordion] PositionAmount
>
> | Field | JSON type |
> | - | - |
> | `denom` | string |
> | `shares` | string |
> | `assets` | string |

> [accordion] CollateralAmount
>
> | Field | JSON type |
> | - | - |
> | `denom` | string |
> | `amount` | string |

> [accordion] Coin
>
> | Field | JSON type |
> | - | - |
> | `denom` | string |
> | `amount` | string |

> [accordion] LiquidationInfo
>
> | Field | JSON type |
> | - | - |
> | `block_height` | string |
> | `event_index` | number |

> [accordion] Position
>
> | Field | JSON type |
> | - | - |
> | `poolId` | string |
> | `owner` | string |
> | `supplies` | array of PositionAmount |
> | `borrows` | array of PositionAmount |
> | `collaterals` | array of CollateralAmount |
> | `healthFactor` | string or null |
> | `collateralValue` | string or null |
> | `borrowedValue` | string or null |
> | `borrowLimitValue` | string or null |
> | `liquidationCollateralValue` | string or null |
> | `liquidatable` | boolean or null |
> | `oracleUpdatedAt` | number or null |
> | `asOf` | number |
> | `indexedHeight` | number |
> | `healthError` | string or null |

> [accordion] PositionHistoryPoint
>
> | Field | JSON type |
> | - | - |
> | `timestamp` | number |
> | `suppliedValue` | string |
> | `borrowedValue` | string |
> | `collateralValue` | string |
> | `healthFactor` | string or null |

> [accordion] Liquidation
>
> | Field | JSON type |
> | - | - |
> | `liquidator` | string |
> | `borrower` | string |
> | `poolId` | string |
> | `repaid` | Coin |
> | `seized` | Coin |
> | `timestamp` | number |
> | `info` | LiquidationInfo |

> [accordion] Deficit
>
> | Field | JSON type |
> | - | - |
> | `poolId` | string |
> | `denom` | string |
> | `amount` | string |

> [accordion] FundBalance
>
> | Field | JSON type |
> | - | - |
> | `denom` | string |
> | `balance` | string |
> | `asOf` | number |
> | `indexedHeight` | number |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.