๐Withdrawing Funds
Funds supplied to Fermi DEX are withdraw-able at all times.
Fund withdrawals are not implemented in this beta, but they will be a straightforward addition, as all internal accounting calculations are already being performed.
Specifically, to determine the quantity available to withdraw, one would simply look at the following two variables, for each user - in the OpenOrdersPDA for that user:
native_qty_locked (wSOL)
native_pc_locked
(USDC)
These values are accurately updated with each transaction; the total sum of these values in all users' OpenOrdersPDA combined always equals to the amount of deposits in the respective vaults (i.e. coinVault, or pcVault).
Last updated