All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- New
SpecialOrdersclasses and methods that enable stop loss and take profit trigger orders.
- BREAKING: Margin's
withdrawmethods now take and additionalheimdallaccount. Previous build's withdraw methods will fail.
- General: updated anchor to 0.25.0
- MarginWeb3: Added support for simulation (not working due to some anchor bug)
- OrderTypeInfo: Add
StopMarket,StopLimit,TakeProfitMarket,TakeProfitLimit
- Improved subscriptions by adding
stateLimitandcacheLimitto limit the update frequency, add optionalwithBackupparameter - Added change log to emitted events to help build a websocket
- Zamm: created zamm class which allows to arb zamm and listen to its changes
- EventEmitters: improved EventEmitters and started to clean up old listeners
- ZoUser: made more methods directly accessible through zoUser removing the complexity of calling state or margin, and added ZoUser.load
- Linting: added universal linting config for 01 repositories
- ZoUser: added a user class which allows interacting with 01 database, and provides a convenient wrapper
- Margin, Control, State, Cache: Added subscriptions to changes
- Margin: Fixed
liqPricemethod
- Config: Updated
ZO_SQUARE_TAKER_FEEfrom 0.0015 to 0.002
- State: Added
loadZoMarketsmethod - Margin: Fixed
toStringmethod
- Margin: Added
toStringmethod
- Margin: New
makeCancelPerpOrderIx
- Margin: Added
maxTstoplacePerpOrder(#159) - BREAKING - cacheOracle: Updated instruction accounts (#159)
- General: Optimized loading times
- State: Add
getFundingInfo, which returns aFundingInfoobject. (#127) - Cache:
MarkTwap'sTwapInfois reworked: ohlc is now deprecated, andcumulAvgrepresents the cumulative sum of the funding TWAP. (#127)
- Margin: Fix RealizedPnl decimals
- General: Add
createProviderfunction
- State: fixed supply/borrow apy zero divisor check
- Margin: Added method to create ix for
placePerpOrder, will do so for more instructions (#75)
- Margin: Replaced mark price with index price in liquidations related calculations (#70)
- Margin: Added Power Perps Support
- Margin: Removed cache as param for MarginWeb3 Functions
- Margin: Added liquidation calculations to MarginWeb3
- Margin: Added margin exists function to check if margin exists
- Margin: Added state & cache subscriptions
- Program: Add FillOrKill order type. Acts as an IoC which fails if not completely filled (#67)
- Margin: Margin now inherits MarginWeb3 which contains all the web3 logic related to fetching and loading
- Margin: now also contains math related logic for margin fractions calculation and other helper methods which can be use in liquidators & trading bots
- Margin: now also loads open orders for the account, and positions information
- State: now loads more detailed information about the markets & collaterals
- Cache: Fix mark cache's
lastSampleStartTimedecoding
- Events: Added
marginKeytoSwapLogevent
- Mainnet: Mainnet keys added
- Program:
createProgramnow takes aClusterargument
- Margin: Added optional
ownerparam toMargin.load()
- Fix: changed
cancelPerpOrdernull operator
- Fix: Update IDL
- Margin: Removed
cancelPerpOrderByClientIdand merged it intocancelPerpOrder(#52) - BREAKING - Program: The old Zo devnet program
DuSPvazsfthvWRuJ8TUs984VXCeUfJ1qbzd8NwkRLEpd, and Zo Dex devnet programCX8xiCu9uBrLX5v3DSeHX5SEvGT36PSExES2LmzVcyJdis being decommissioned.
- Spot: Added and enabled swapping for SOL-USDC spot market
- BREAKING - Margin: Added payer to createMargin and createPerpOpenOrders so that PDA's can be authorities of margin accounts during CPIs (#51)
- Margin: Added reduceOnlyIoc and reduceOnlyLimit order types (#49)
- General: updated anchor to newer version and enabled commitment passing (#42)
- Fix: fixed decimal errors on some decoding (#42)
- Events: Added anchor events and decoder (#31)
- Changed serum-ts to lite-serum to remove unnecessary files (#29)
- Deposit/Withdraw: Now accepts a mint pubkey and deposits/withdraws directly to/from an associated token account
- Deposit/Withdraw: Old implementations of deposit/withdraw are repurposed as depositRaw/withdrawRaw in case users want to deposit/withdraw to/from a specific account
- Withdraw: Associated token account is created before withdrawal if such account does not exist
- Margin: Add an optional limit arg to placePerpOrder used when compute limit is reached
- Margin: ClientId can now be passed as an input to placePerpOrder to tag specific orders with a unique id, that can be used to cancel the order using the clientId
- Margin: New instruction cancelPerpOrderByClientId that cancels using the pre-assigned unique client id
- Margin: Swap method is now simplified. Takes in big units (like SOL and BTC) instead of smol units (like satoshis and lamports).
- Margin: Swap method now accepts a slippage parameter.
- Margin: PlacePerpOrder is now simplified. Takes in big units. No longer takes in maxQuoteQty.
- Life to this repo