mschneider / solcpp

A fast Solana and Mango Markets C++ SDK
Other
40 stars 13 forks source link

Mango v3: settlePnl #36

Open mschneider opened 2 years ago

mschneider commented 2 years ago

Settling Pnl moves the profit or loss from the Perp market into the USDC token balance.

The typescript reference implementation implements two possible ways:

  1. slow but very reliable way of settling (>60s) that works for all networks
  2. faster but dependent on a specialized indexer only available on for mainnet

Both methods should be available, so that the SDK always works, but always uses the best possible method.