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
SpecialOrders
classes and methods that enable stop loss and take profit trigger orders.
- BREAKING: Margin's
withdraw
methods now take and additionalheimdall
account. 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
stateLimit
andcacheLimit
to limit the update frequency, add optionalwithBackup
parameter - 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
liqPrice
method
- Config: Updated
ZO_SQUARE_TAKER_FEE
from 0.0015 to 0.002
- State: Added
loadZoMarkets
method - Margin: Fixed
toString
method
- Margin: Added
toString
method
- Margin: New
makeCancelPerpOrderIx
- Margin: Added
maxTs
toplacePerpOrder
(#159) - BREAKING - cacheOracle: Updated instruction accounts (#159)
- General: Optimized loading times
- State: Add
getFundingInfo
, which returns aFundingInfo
object. (#127) - Cache:
MarkTwap
'sTwapInfo
is reworked: ohlc is now deprecated, andcumulAvg
represents the cumulative sum of the funding TWAP. (#127)
- Margin: Fix RealizedPnl decimals
- General: Add
createProvider
function
- 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
lastSampleStartTime
decoding
- Events: Added
marginKey
toSwapLog
event
- Mainnet: Mainnet keys added
- Program:
createProgram
now takes aCluster
argument
- Margin: Added optional
owner
param toMargin.load()
- Fix: changed
cancelPerpOrder
null operator
- Fix: Update IDL
- Margin: Removed
cancelPerpOrderByClientId
and merged it intocancelPerpOrder
(#52) - BREAKING - Program: The old Zo devnet program
DuSPvazsfthvWRuJ8TUs984VXCeUfJ1qbzd8NwkRLEpd
, and Zo Dex devnet programCX8xiCu9uBrLX5v3DSeHX5SEvGT36PSExES2LmzVcyJd
is 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