Skip to main content

Monaco Protocol SDK v1.0.3

This release adds closed position execution history, conditional cross liquidation prices across positions and risk simulations, and fixes vault withdrawal early-return and fee-tier volume unit reporting.

Added

Closed position execution history

positions.listPositionHistory now accepts an optional reductionOnly parameter. When set to true, the response includes only reductions, closes, and liquidations — filtering out opens, partial fills, funding, and margin-change events. Each reduction row now carries immutable per-execution close facts computed by the backend: Use executionPrice (the fill price at close) rather than markPrice when calculating realized returns. The backend computes netRealizedPnl and realizedRoe for you — no mark-price approximation needed.

Changed

Conditional cross liquidation prices

Positions and risk simulations now expose liquidation price estimates for cross-margin positions. Positions — listPositions, getPosition, and getPositionRisk return liquidationPrice for all positions including cross. For cross positions the value is conditional: only the target position’s mark moves while all other marks in the same cross risk bucket are held fixed. Other position marks, funding, realized PnL, fees/reserves, and collateral can all change the actual liquidation threshold. An absent or blank value means unavailable — never zero. Risk simulations — simulateOrderRisk, simulateParentMarginOrderRisk, and simulateRiskBucketOrderRisk now return:
  • freeCollateralAfter: string — projected free collateral after the simulated fill
  • estimatedLiquidationPrice?: string — conditional per-position estimate for the target position; same conditional semantics as above
Cross simulations with marginMode: "CROSS" require selectedTradingPairIds. All three simulation endpoints accept an optional reduceOnly boolean that restricts the simulation to shrinking an existing exposure.

Fixed

vault.withdraw with autoWait: false returned too late

vault.withdraw(assetId, amount, false) previously blocked for up to 5 minutes polling for the merkle proof before returning. The proof is never ready at initiation time — so the wallet signing prompt was never shown and the balance appeared stuck. vault.withdraw(..., false) now returns immediately after the withdrawal is registered:
Use retryWithdrawal(withdrawalIndex) to complete the on-chain submission once the merkle proof is available. The withdrawalIndex is stable across retries.

fees.getMyFeeTier volume fields now in whole USD

getMyFeeTier previously returned weightedVolume14d, spotVolume14d, and perpVolume14d in raw on-chain micro-USDC units (10⁶× too large), which caused every user to resolve to a higher fee tier than their actual 14-day volume warranted. All three fields now return whole-USD values — e.g. "5000000" means 5M,not5 M, not 5. Fee tier resolution is now correct.

Upgrade

All changes are additive or fixes — no existing field names, endpoint paths, or authentication requirements changed.