Workspace /Position monitoring
SDK
Monitor collateral positions from your own app.
Everything the playground below does — opening a position, reading its health, simulating a price move — is one SDK call each. Install it and wire the same three calls into your own UI.
npm install @brix/pool-sdkOpen a position
import { BrixPool } from '@brix/pool-sdk'
const pool = new BrixPool({ chain: 'mainnet' })
// quantity and borrowUsd are yours to set — the SDK
// reads the live oracle price for the asset itself.
const position = await pool.openPosition({
asset: 'xTSLA',
quantity,
borrowUsd,
})Check health
// Health is derived from the position's current
// collateral value vs. its liquidation threshold.
const health = await pool.getHealth(position.id)
health.ltv // current loan-to-value, %
health.threshold // liquidation threshold, %
health.headroom // LTV points before liquidation
health.atRisk // boolean
health.liquidatable // booleanSimulate a price shock
// Re-runs the same collateral math against a
// hypothetical oracle price — the real position
// is untouched until you actually call openPosition.
const outcome = await pool.simulatePriceMove(position.id, {
price: hypotheticalPrice,
})
outcome.ltv
outcome.liquidatablePOSITION MONITORING
Track collateral positions in real time
Connect a wallet to open a simulated position and watch its health factor update as the oracle price moves.
No wallet connected
Positions are scoped to your connected address so you can come back and pick up where you left off.