-
Notifications
You must be signed in to change notification settings - Fork 194
DLP #1885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
moosecat2
wants to merge
41
commits into
master
Choose a base branch
from
dlp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* program: init lp pool * cargo fmt -- * add total fee fields * add update_target_weights math * program: use sparse matrix for constituent map and update tests * zero copy accounts, init ix (#1578) * update accounts (#1580) * zero copy + permissionless crank ixs (#1581) * program: support negative target weights for borrow-lend * fix tests to work with zero copy * few comment changes * remove discriminator from impl macro * add get_swap_amount, get_swap_fees, get_weight (#1579) * add get_swap_amount, get_swap_fees, get_weight * update accounts * add back ts * rebase * add constituent swap fees * fix swap fee calc (#1582) * add init amm mapping to lp context (#1583) * init constituent * add initializeLpPool test (#1585) * add initializeLpPool test * add check for constituent target weights * add add datum ix * add init tests and invariant checks * rename data to more useful names * dlp use spl token program (#1588) * add crank ix * update total_weight for validation_flags check * push test so far * overriding perp position works * remove message * fix dup total_weight add * constituent map remaining accounts * compiles * bankrun tests pass * compiles but casting failure in overflow protection test * address comment and change token arguments from u64 to u128 * bankrun tests pass * init constituent token account (#1596) * update aum calc * add update /remove mapping ixs * fix test - init constituent spot market * add crank improvements * passes tests * precision fix crank aum * precision fixes and constituent map check for account owner * add passthrough account logic (#1602) * add passthrough account logic * cant read yet * fix all zc alignment issues * make oracle source a u8 on zc struct * Wphan/dlp-swap-ixs (#1592) * add lp_swap ix * rebase * test helpers * swap works * fix swaps, add more cargo tests for fees n swap amt * remove console.logs * address PR comments * merge upstream * post-merge fixes * store bumps on accounts (#1604) * store bumps on accounts * do pda check in constituent map * address comments * Wphan/add liquidity (#1607) * add add remove liquidity fees calc * add liquidity ix * fix init mint and lppool token account, refactor test fees * add removeLiquidity bankrun test * merge upstream * add LPPool.next_mint_redeem_id * program: lp-pool-to-use-target-base-vector (#1615) * init lp pool target-base matrix * working target-base logic * add todos for add/remove liquidity aum * add renames + fix test * add beta and cost to trade in bps to target datum * add more tests * add fields to LP events, fix tests (#1620) * add fields to LP events, fix tests * revert target weight calc * add constituent.next_swap_id, fix cost_to_trade math * dlp jup swap (#1636) * dlp jup swap * add admin client ixs * almost fixed * test working? * update begin and end swap * tweaks * fix math on how much was swapped * remove unnecessary lp pool args * extra account validation * added token account pda checks in other ixs * stablecoin targets (#1638) * is stablecoin * address comments --------- Co-authored-by: Chris Heaney <[email protected]> * cleanup * transfer oracle data ix to constituent (#1643) * transfer oracle data ix to constituent * add lib entrypoint * simplify more * add spot market constraint * big cargo test (#1644) * derivative constituents + better testing + bug fixes (#1657) * all tests technically pass * update tests + prettify * bug fixes and tests pass * fix many bugs and finalize logic * deposit/borrow working and changing positions (#1652) * sdk: allow custom coder * program: dlp add upnl for settles to amm cache (#1659) * program: dlp add-upnl-for-settles-to-amm-cache * finish up lp pool transfer from perp market * add amount_to_transfer using diff * merge * add pnl and fee pool accounting + transfer from dlp to perp market --------- Co-authored-by: Nour Alharithi <[email protected]> * remove unused accounts coder * move customCoder into sdk, lint * testing: ix: settle perp to dlp, insufficient balance edge case and improvements (#1688) * finish edge case test * aum check also passes * prettify * added more settle test coverage and squash bugs (#1689) * dlp: add constituentMap (#1699) * Nour/gauntlet fee impl (#1698) * added correlation matrix infra * refactor builds * mint redeem handled for usdc * remove liquidity also should work * all tests pass * bankrun tests pass too * update aum considers amm cache (#1701) * prettify (#1702) * Wphan/merge master dlp (#1703) * feat: init swift user orders on user account creation if needed * fix: wrong pushing of swift user orders ixs * fix: broken swift tests * fix: swift -> signed msg * refactor(sdk): update jupiter's api url * fix(sdk): remove error thrown * indicative qutoes server changes * sdk: release v2.121.0-beta.7 * sdK: update market index 33 oracle rr (#1606) * sdk: add to spot constants market index 34 * revert adminClient.ts change * sdk: update spot market constants oracle index 33 * sdk: release v2.121.0-beta.8 * sdk: high leverage mode updates (#1605) * sdk: high leverage mode updates * add optional param for fee calc * update changelog * sdk: release v2.121.0-beta.9 * getPlaceSignedMsgTakerPerpOrderIxs infer HLM mode from bitflags (#1608) * sdk: release v2.121.0-beta.10 * fix: dehexify in getPlaceSignedMsgTakerPerpOrderIxs (#1610) * fix: dehexify in getPlaceSignedMsgTakerPerpOrderIxs * bankrun test * sdk: release v2.121.0-beta.11 * sdk: round tick/step size for getVammL2Generateor (#1612) * sdk: round tick/step size for etVammL2Generateor * use standard functions, include in all fcns * fix const declare, rm whitespace * fix posdir sign * sdk: release v2.121.0-beta.12 * sdk: release v2.121.0-beta.13 * sdk: constants market-index-45-46 (#1618) * sdk: release v2.121.0-beta.14 * robustness check for indicative quotes sender (#1621) * robustness check for indicative quotes sender * delete quote from market index of bad quote * sdk: release v2.121.0-beta.15 * Added launchTs for ZEUS, zBTC * sdk: release v2.121.0-beta.16 * sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign (#1622) * sdk: release v2.121.0-beta.17 * sdk: fix vamm l2 generator base swapped (#1623) * sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign * fix ask book else baseSwapped calc * sdk: release v2.121.0-beta.18 * sdk: revert vamm l2 gen (#1624) * Revert "sdk: fix vamm l2 generator base swapped (#1623)" This reverts commit 56bc78d. * Revert "sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign (#1622)" This reverts commit e49cfd5. * Revert "sdk: round tick/step size for getVammL2Generateor (#1612)" This reverts commit f932a4e. * sdk: release v2.121.0-beta.19 * sdk: show protected-asset have zero-borrow-limit (#1603) * sdk: show protected-asset have zero-borrow-limit * rm unused AssetTier import * sdk: release v2.121.0-beta.20 * sdk: market-constants-index-74 (#1629) * sdk: release v2.121.0-beta.21 * program: use saturating_sub for number_of_users (#1616) * program: use saturating_sub for number_of_users * update CHANGELOG.md * program: allow fixing hlm num users (#1630) * sdk: release v2.121.0-beta.22 * sdk: fix switchboard on demand client to use landed at * sdk: release v2.121.0-beta.23 * sdk: spot-market-poolid-4 constants (#1631) * sdk: release v2.121.0-beta.24 * fix high lev mode liq price (#1632) * sdk: release v2.121.0-beta.25 * replace deprecated solana install scripts (#1634) * sdk: release v2.121.0-beta.26 * refactor(sdk): use ReturnType for Timeout types (#1637) * sdk: release v2.121.0-beta.27 * auction price sdk fix * sdk: release v2.121.0-beta.28 * program: multi piecewise interest rate curve (#1560) * program: multi-piecewise-interest-rate-curve * update tests * widen out borrow limits/healthy util check * add break, use array of array for borrow slope segments * program: fix cargo test * sdk: add segmented IR curve to interest rate calc * clean up unusded var, make interest rate segment logic a const * incorp efficiency feedback points * test: add sol realistic market example * cargo fmt -- * CHANGELOG --------- Co-authored-by: Chris Heaney <[email protected]> * sdk: release v2.121.0-beta.29 * program: allow hot admin to update market fuel params (#1640) * v2.121.0 * sdk: release v2.122.0-beta.0 * sdk: fix nullish coalescing * sdk: release v2.122.0-beta.1 * program: add logging for wrong perp market mutability * sdk: check free collateral change in maxTradeSizeUsdcForPerp (#1645) * sdk: check free collateral change in maxTradeSizeUsdcForPerp * update changelog * sdk: release v2.122.0-beta.2 * refactor(sdk): emit newSlot event on initial subscribe call (#1646) * sdk: release v2.122.0-beta.3 * sdk: spot-market-constants-pool-id-2 (#1647) * sdk: release v2.122.0-beta.4 * sdk: add-spot-market-index-52-constants (#1649) * sdk: release v2.122.0-beta.5 * program: add existing position fields to order records (#1614) * program: add quote entry amount to order records * fix cargo fmt and test * more reusable code * more reusable code * add another comment * fix math * account for pos flip * fix typo * missed commit * more fixes * align naming * fix typo * CHANGELOG * program: check limit price after applying buffer in trigger limit ord… (#1648) * program: check limit price after applying buffer in trigger limit order auction * program: reduce duplicate code * fix tests * CHANGELOG --------- Co-authored-by: 0xbigz <[email protected]> * program: fix cargo tests * program: check limit price when setting auction for limit order (#1650) * program: check limit price after applying buffer in trigger limit order auction * program: reduce duplicate code * program: check limit price when setting limit auction params * cargo fmt -- * fix CHANGELOG * tests: updates switchboardTxCus.ts * program: try to fix iteration for max order size (#1651) * Revert "program: try to fix iteration for max order size (#1651)" This reverts commit 3f0eab3. * disable debug logging in bankrun tests * v2.122.0 * sdk: release v2.123.0-beta.0 * sdk: constants-spot-market-index-53 (#1655) * sdk: release v2.123.0-beta.1 * sdk: idl for new existing position order action records * fix: protocol test prettier fix * make ci lut checks not shit * sdk: release v2.123.0-beta.2 * sdk: fix vamm l2 generator base swapped and add new top of book (#1626) * sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign * fix ask book else baseSwapped calc * use proper quoteAmount with baseSwap for top of book orders * clean up console.log * sdk: getVammL2Generator reduce loc (#1628) * sdk: getVammL2Generator-reduce-loc * add MAJORS_TOP_OF_BOOK_QUOTE_AMOUNTS * add marketindex check topOfBookAmounts * yarn lint/prettier * sdk: release v2.123.0-beta.3 * program: allow all limit orders to go through swift (#1661) * program: allow all limit orders to go through swift * add anchor test * CHANGELOG * sdk: add optional initSwiftAccount on existing account deposits (#1660) * sdk: release v2.123.0-beta.4 * program: add taker_speed_bump_override and amm_spread_adjustment * Revert "program: add taker_speed_bump_override and amm_spread_adjustment" This reverts commit 1e19b7e. * program: tests-fee-adjustment-neg-100 (#1656) * program: tests-fee-adjustment-neg-100 * add HLM field to test * cargo fmt -- --------- Co-authored-by: Chris Heaney <[email protected]> * program: simplify user can skip duration (#1668) * program: simplify user can skip duration * update context * CHANGELOG * fix test * fix pmm tests --------- Co-authored-by: Chris Heaney <[email protected]> * program: add taker_speed_bump_override and amm_spread_adjustment (#1665) * program: add taker_speed_bump_override and amm_spread_adjustment * add admin client * cargo test * add impl for amm_spread_adjustment * ensure no overflows * CHANGELOG * cargo fmt -- * sdk types * prettify --------- Co-authored-by: 0xbigz <[email protected]> * program: update-amm-spread-and-availability-constraints (#1663) * program: update-amm-spread-and-availability-constraints * fix cargo tests * program: use saturating mul for amm spread adj * nour/indic-quotes-sender-v2 (#1667) * nour/indic-quotes-sender-v2 * prettify * pass margin category into calculateEntriesEffectOnFreeCollateral (#1669) * fix cargo test * tests: fix oracle guardrail test * sdk: update idl * yarn prettify:fix * tests: fix a few more place and make tests * prettify fix * whitespace readme change * sdk: release v2.123.0-beta.5 * v2.123.0 * sdk: release v2.124.0-beta.0 * v2.123.0-1 * sdk: calculateVolSpreadBN-sync (#1671) * sdk: release v2.124.0-beta.1 * sdk: calculate-spread-bn-add-amm-spread-adjustment (#1672) * sdk: calculate-spread-bn-add-amm-spread-adjustment * corect sign * add math max 1 * prettify * sdk: release v2.124.0-beta.2 * sdk: correct calculateVolSpreadBN reversion * sdk: release v2.124.0-beta.3 * sdk: add getTriggerAuctionStartPrice (#1654) * sdk: add getTriggerAuctionStartPrice * updates * precisions * remove startBuffer param --------- Co-authored-by: Chris Heaney <[email protected]> * sdk: release v2.124.0-beta.4 * feat: customized cadence account loader (#1666) * feat: customized cadence account loader bby * feat: method to read account cadence on custom cadence account loader * feat: PR feedback on customized loader cleaup code and better naming * fix: lint and prettify * feat: more efficient rpc polling on custom polling intervals * feat: custom cadence acct loader override load * chore: prettify * sdk: release v2.124.0-beta.5 * sdk: sync-user-trade-tier-calcs (#1673) * sdk: sync-user-trade-tier-calcs * prettify --------- Co-authored-by: Nick Caradonna <[email protected]> * sdk: release v2.124.0-beta.6 * sdk: add new admin client fn * Revert "sdk: add new admin client fn" This reverts commit c7a4f0b. * sdk: release v2.124.0-beta.7 * refactor(ui): add callback logic, fix polling frequency update * sdk: release v2.124.0-beta.8 * program: less order param sanitization for long tail perps (#1680) * program: allow-auction-start-buffer-on-tail-mkt * fix test * cargo fmt -- * CHANGELOG --------- Co-authored-by: 0xbigz <[email protected]> * Wphan/custom coder (#1682) * sdk: allow custom coder * remove unused accounts coder * linter * move customCoder into sdk, lint * update test helpers * update testhelpers.ts * sdk: release v2.124.0-beta.9 * update sdk exports * sdk: release v2.124.0-beta.10 * sdk: safer-calculate-spread-reserve-math (#1681) * sdk: release v2.124.0-beta.11 * update getMaxLeverageForPerp to use usdc logic (#1678) * sdk: release v2.124.0-beta.12 * program: override for oracle delay (#1679) * programy: override for oracle delay * update impl * switch to i8 * CHANGELOG * program: programmatic rebalance between protocol owned if holdings (#1653) * program: if swap * program: add initial config * add update * more * moar * moar * moar * program: update how swap epoch works * add test * add an invariant * cargo fmt -- * add transfer to rev pool * add mint validation * cargo fmt -- * track in amount between tranfsers * add to ci tests * separate key * program: always transfer max amount to rev pool * CHANGELOG * sdk: release v2.124.0-beta.13 * sdk: improve-aclient-accounts-logic (#1684) * sdk: release v2.124.0-beta.14 * program: improve-amm-spread-validates (#1685) * program: let hot wallet update amm jit intensity * sdk: hot wallet can update amm jit intensity * program: hot wallet can update curve intensity * program: fix build * sdk: update idl * sdk: release v2.124.0-beta.15 * v2.124.0 * sdk: release v2.125.0-beta.0 * program: three-point-std-estimator (#1686) * program: three-point-std-estimator * update tests and add sdk * update changelog * sdk: add-updatePerpMarketOracleSlotDelayOverride (#1691) * sdk: release v2.125.0-beta.1 * program: add-amm-inventory-spread-adjustment-param (#1690) * program: add-amm-inventory-spread-adjustment-param * cargo fmt -- * update sdk * prettier * fix syntax { --------- Co-authored-by: Chris Heaney <[email protected]> * program: max-apr-rev-settle-by-spot-market (#1692) * program: max-apr-rev-settle-by-spot-market * update max * default to u128 to avoid casts * changelog * sdk: release v2.125.0-beta.2 * program: better account for imf in calculate_max_perp_order_size (#1693) * program: better account for imf in calculate_max_perp_order_size * CHANGELOG * v2.125.0 * sdk: release v2.126.0-beta.0 * sdk: only count taker fee in calculateEntriesEffectOnFreeCollateral for maintenance (#1694) * sdk: release v2.126.0-beta.1 * Separate getAddInsuranceFundStakeIxs (#1695) * sdk: release v2.126.0-beta.2 * idl: amm-inv-adj-latest-idl (#1697) * sdk: release v2.126.0-beta.3 * sdk: spot-market-index-54 constants (#1696) * sdk: release v2.126.0-beta.4 * sdk: update spot market index 54 pythlazer id * sdk: release v2.126.0-beta.5 * Update spotMarkets.ts * sdk: release v2.126.0-beta.6 * prettify --------- Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: Chester Sim <[email protected]> Co-authored-by: Nour Alharithi <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: bigz_Pubkey <[email protected]> Co-authored-by: lowkeynicc <[email protected]> Co-authored-by: jordy25519 <[email protected]> Co-authored-by: Luke Steyn <[email protected]> Co-authored-by: lil perp <[email protected]> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: Nick Caradonna <[email protected]> Co-authored-by: Jesse Cha <[email protected]> * slot staleness checks (#1705) * slot staleness checks * update aum ix to use constituent oracles * Nour/derivative constituent testing (#1708) * slot staleness checks * update aum ix to use constituent oracles * constituent test works when adjusting derivative index * constituent depeg kill switch works * works with multiple derivatives on the same parent * remove incorrect usage of nav * fix adminClient and tests * Nour/fee grid search testing (#1714) * grid search * grid search swap test * Nour/address comments (#1715) * low hanging fruit comments * remove pda checks and store lp pool on zero copy accounts * parameterize depeg threshold * make description in lp pool event * update idl for event change * add swap fee unit tests (#1713) * add swap fee unit tests * remove linear inventory fee component * Nour/settle accounting (#1723) * fixing the main settle test and settle function * all current tests pass * update msg occurrences * dont update lp quote owed unless collateralized * Nour/settle testing (#1725) * refactor settle pnl to modularize and add tests * more cargo tests * prettify * Nour/address more comments (#1726) * use oracle staleness threshold for staleness * add spot market vault invariant * refactor update_aum, add unit tests (#1727) * refactor update_aum, add unit tests * add constituent target base tests * update doc * Nour/parameterize dlp (#1731) * add validates and test for withdraw limit * settlement max * update idl * merge conflicts * fixes * update idl * bug fixes * mostly sdk fixes * bug fixes * bug fix and deploy script * program: new amm oracle (#1738) * zero unused amm fields * cargo fmt * bare bones ix * minimal anchor mm oracle impl * update test file * only do admin validate when not anchor test * updates * generalize native entry * fix weird function name chop off * make it compile for --feature cpi (#1748) Co-authored-by: jordy25519 <[email protected]> * more efficeint clock and state bit flags check * vamm uses mm oracle (#1747) * add offset * working tests * refactor to use MM oracle as its own type * remove weird preface * sdk updates * bankrun tests all pass * fix test * changes and fixes * widen confidence if mm oracle too diff * sdk side for confidence adjust * changelog * fix lint * fix cargo tests * address comments * add conf check * remove anchor ix and cache oracle confidence * only state admin can reenable mm oracle kill switch * cargo fmt --------- Co-authored-by: jordy25519 <[email protected]> * fix tests (#1764) * Nour/move ixs around (#1766) * move around ixs * remove message * add devnet oracle crank wallet * refactored mm oracle * sdk changes + cargo fmt * fix tests * validate price bands with fill fix * normalize fill within price bands * add sdk warning * updated type * undefined guard so anchor tests pass * accept vec for update amm and view amm * adjust test to work with new price bands * Revert "adjust test to work with new price bands" This reverts commit ee40ac8. * remove price bands logic * add zero ix for mm oracle for reset * add new drift client ix grouping * v1 safety improvements * isolate funding from MM oracle * add cargo tests for amm availability * change oracle validity log bool to enum * address comment * make validate fill direction agnostic * fix liquidate borrow for perp pnl test * fix tests and address comments * commit constituent map to barrel file * add lp fields to perp market account * rearrange perp market struct for lp fields * bug fix for notional position tracking * view function * fee view functions * max aum + whitelist check and removing get_mint_redeem_fee for now * add wsol support for add liquidity * fix sdk and typing bugs * update lp pool params ix * admin override cache and disable settle functions * devnet swap working * dlp taker discovered bug fixes and sdk changes * refactor last settle ts to last settle slot * Nour/settle pnl fix (#1817) * settle perp to lp pool bug fixes * update bankrun test to not use admin fee pool deposit * fix tests using update spot market balances too * add log msgs for withdraw and fix casting bug * check in for z (#1823) * feat: option for custom oracle ws subscriber * fix: pass custom oracle ws sub option in dc constructor * sdk: add spot-market-index-57 to constants (#1815) * sdk: release v2.134.0-beta.2 * lazer oracle migration (#1813) * lazer oracle migration * spot markets too * sdk: release v2.134.0-beta.3 * sdk: release v2.134.0-beta.4 * program: settle pnl invariants (#1812) * program: settle pnl invariants * add test * fix lint * lints * add msg * CHANGELOG * cargo fmt -- * program: add_update_perp_pnl_pool (#1810) * program: add_update_perp_pnl_pool * test * CHANGELOG * sdk: release v2.134.0-beta.5 * program: update-mark-twap-integer-bias (#1783) * program: update-mark-twap-integer-bias * changelog update * program: update-fee-tier-determine-fix5 (#1800) * program: update-fee-tier-determine-fix5 * update changelog * program: update-mark-twap-crank-use-5min-basis (#1769) * program: update-mark-twap-crank-use-5min-basis * changelog * program: update-min-margin-const-limit (#1802) * program: update-min-margin-const-limit * add CHANGELOG.md * sdk: release v2.134.0-beta.6 * program: rm-burn-lp-shares-invariant (#1816) * program: rm-burn-lp-shares-invariant * update changelog * fix test and cargo fmt * fix anchor tests * yarn prettify:fix * reenable settle_pnl mode test * v2.134.0 * sdk: release v2.135.0-beta.0 * Merge pull request #1820 from drift-labs/chester/fix-zod * sdk: release v2.135.0-beta.1 * mm oracle sdk change (#1806) * mm oracle sdk change * better conditional typing * DLOB bug fix * updated idl * rm getAmmBidAskPrice * sdk: release v2.135.0-beta.2 * sdk: fix isHighLeverageMode * sdk: release v2.135.0-beta.3 * refactor(sdk): add update delegate ix method, ovrride authority for settle multiple pnl (#1822) * check in for z * more logging changes * mm oracle sdk additions (#1824) * strict typing for more MM oracle contact points * add comments to auction.ts * prettify * sdk: release v2.135.0-beta.4 * init constituent bug fix and type change * add in invariant to be within 1 bp of balance before after * add strict typing for getPrice and new auction trigger function (#1826) * add strict typing for getPrice and new auction trigger function * refactor getTriggerAuctionStartAndExecutionPrice * sdk: release v2.135.0-beta.5 * update tests and enforce atomic settles for withdraw * add failing withdraw test * withdraw fix * bring diff in validate back to 1 * make lp pool test fail * better failed test * only check after < before, do to spot precision limits * add balance check to be < 1 cent --------- Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: bigz_Pubkey <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: lil perp <[email protected]> Co-authored-by: wphan <[email protected]> Co-authored-by: Chester Sim <[email protected]> * add price for lp validates (#1833) * add missing token account reloads and syncs * add disabled lp pool swaps by default * more extensive aum logging * Wphan/merge-builder-codes (#1842) * add RevenueShare and RevenueShareEscrow accounts an init ixs * fix multiple array zc account, and handling different message types in place_signed_msg_taker_order * decoding error * recording orders in RevenueShareEscrow workin * cancel and fill orders * idl * fix sdk build * fix math * update RevenueShareOrder bitflags, store builder_idx instead of pubkey * merge RevenueShareOrders on add * remove builder accounts from cancel ixs, wip settle impl * dont fail settlpnl if no builder users provided * finish settle, rename RevenueShare->Builder, RevenueShareEscrow->BuilderEscrow * feat: option for custom oracle ws subscriber * fix: pass custom oracle ws sub option in dc constructor * sdk: add spot-market-index-57 to constants (#1815) * sdk: release v2.134.0-beta.2 * lazer oracle migration (#1813) * lazer oracle migration * spot markets too * sdk: release v2.134.0-beta.3 * sdk: release v2.134.0-beta.4 * program: settle pnl invariants (#1812) * program: settle pnl invariants * add test * fix lint * lints * add msg * CHANGELOG * cargo fmt -- * program: add_update_perp_pnl_pool (#1810) * program: add_update_perp_pnl_pool * test * CHANGELOG * sdk: release v2.134.0-beta.5 * program: update-mark-twap-integer-bias (#1783) * program: update-mark-twap-integer-bias * changelog update * program: update-fee-tier-determine-fix5 (#1800) * program: update-fee-tier-determine-fix5 * update changelog * program: update-mark-twap-crank-use-5min-basis (#1769) * program: update-mark-twap-crank-use-5min-basis * changelog * program: update-min-margin-const-limit (#1802) * program: update-min-margin-const-limit * add CHANGELOG.md * sdk: release v2.134.0-beta.6 * program: rm-burn-lp-shares-invariant (#1816) * program: rm-burn-lp-shares-invariant * update changelog * fix test and cargo fmt * fix anchor tests * yarn prettify:fix * reenable settle_pnl mode test * v2.134.0 * sdk: release v2.135.0-beta.0 * add more bankrun tests, clean up * clean up, fix tests * why test fail * add subaccountid to BuilderOrder * reduce diff * add referrals * add test can fill settle user with no builderescrow * add referral builder feature flag and referral migration method * fix cargo tests, try fix bankrun test timing issue * Merge pull request #1820 from drift-labs/chester/fix-zod * sdk: release v2.135.0-beta.1 * mm oracle sdk change (#1806) * mm oracle sdk change * better conditional typing * DLOB bug fix * updated idl * rm getAmmBidAskPrice * sdk: release v2.135.0-beta.2 * sdk: fix isHighLeverageMode * sdk: release v2.135.0-beta.3 * refactor(sdk): add update delegate ix method, ovrride authority for settle multiple pnl (#1822) * mm oracle sdk additions (#1824) * strict typing for more MM oracle contact points * add comments to auction.ts * prettify * sdk: release v2.135.0-beta.4 * add strict typing for getPrice and new auction trigger function (#1826) * add strict typing for getPrice and new auction trigger function * refactor getTriggerAuctionStartAndExecutionPrice * sdk: release v2.135.0-beta.5 * sdk: handle unfillable reduce only orders (#1790) * sdk: handle unfillable reduce only orders * fix dlob tests build errors * fix some test build errors * sdk: release v2.135.0-beta.6 * ref price offset amm math fix (#1828) * ref price offset amm math fix * add latest slot optional var to callers of update amm spread * sdk: release v2.135.0-beta.7 * latest slot as argument to getL2 (#1829) * latest slot as argument to getL2 * add comment * update BN import * sdk: release v2.135.0-beta.8 * add SignedMsgOrderParamsMessageV2 * program: trigger price use 5min mark price (#1830) * program: trigger price use 5min mark price * cargo fmt -- --------- Co-authored-by: 0xbigz <[email protected]> * v2.135.0 * sdk: release v2.136.0-beta.0 * zero pad swift messages to make backwards compatible * PR feedback * update tests/placeAndMakeSignedMsgBankrun.ts to handle client side errors * lukas/websocket improvements (#1807) * feat: initial implementation for users and markets WS improvements * lukas/gill websocket sub (#1781) * websockets gill temp * feat: feature parity between gill version ws acct sub and reg one + optional passing into driftClient * fix: post rebase bugs and cleanup * chore: websocket account subscriber export * feat: logging string update on ws acct v2 * rm: useless logging * chore: cleanup ws subscriber v2 docs * chore: specific name on custom ws acct sub param * fix: post rebase again cleanup * fix: prettier fixed * feat: initial implementation for users and markets WS improvements * feat: polling check on websocket acct subscriber v2 + naming * fix: lint * fix: non-hanging WS subscription async loop handling * fix: bugs with program ws subs hanging on asynciter * fix: goofy self imports * feat: initial batch fetching temp * temp: sub second WS subscribe time * fix: ws program account subscriber v2 bugs and optimizations * feat: chunk stuff account requests * feat: more subscribe optimizations ws driftclient sub v2 * chore: cleanup ws sub v2 logs * feat: conditional check on using ws account subscriber + unused * fix: bad import * chore: add export of WebSocketProgramAccountSubscriberV2 * fix: unneeded drift idl export messing up common build * fix: consolidate rpc ws subscriptions for oracles * feat: docs for ws v2 and cleanup * chore: more docs on ws acct susbcriber v2 * feat: PR feedback round 2 * fix: default timeout for ws v2 susbcribers * feat: PR feedback on resubOpts and simplify logic * fix: prettier * sdk: release v2.136.0-beta.1 * refactor(sdk): add decimal override for bignum prettyPrint * sdk: release v2.136.0-beta.2 * sdk: while valid tx sender memory leak fix * sdk: release v2.136.0-beta.3 * refactor account logic for borrows * remove double fee count, update tests to check filled position and quote amounts fda * rename Builder -> RevenueShare * add test check accumulated builder/ref fees * fix settle multiple pnl accounts, test ref rewards in multiple markets * [ FIX ] `posaune0423/fix tx fee payer` (#1837) * sdk: release v2.136.0-beta.4 * sdk: add constant for spot market index 58 (#1840) * sdk: add spot market constant 58 * revert .sh * sdk: release v2.136.0-beta.5 * Revert "[ FIX ] `posaune0423/fix tx fee payer` (#1837)" (#1841) This reverts commit 8cc07e0. * sdk: release v2.136.0-beta.6 * express builder fees in tenth of bps * update referral migration params * PR feedback * add builder code feature gate * fix tests * add referral fields * run all tests * kickoff build * disable extra instructions, fix builder code feature flag selection --------- Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: bigz_Pubkey <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: moosecat <[email protected]> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: lil perp <[email protected]> Co-authored-by: Chester Sim <[email protected]> Co-authored-by: asuma <[email protected]> * calc aum bug fix for borrows * idl changes and drift client working * Wphan/dlp revert builder codes (#1854) * Revert "Wphan/merge-builder-codes (#1842)" This reverts commit c999f83. * fix conflicts * fix incorrect merges * address some perp comments * respond to more comments * pda efficiency changes * Revert "pda efficiency changes" This reverts commit 578b957. * Revert "respond to more comments" This reverts commit 27600a1. * better wsol handling * subtract exchange fees from amount settled (#1849) * subtract exchange fees from amount settled * add exchange fee scalar to settling * use percents isntead of scalars * re-introduce breaking bchanges * pda efficiency changes * more pda changes * fix tests * merge in crisp token authority changes * address more comments * amm cache rework (#1863) * Crispheaney/lp whitelist mint (#1866) * lp whitelist mint * test * prettify * Crispheaney/zero copy oracle validity (#1865) * amm cache zero copy validity * remove unnecessary fields from amm cache * update pda --------- Co-authored-by: Nour Alharithi <[email protected]> * address renaming comments * Nour/cu profiling (#1870) * add CU profiling test * reduce CUs for target base * cache robustness and limit testing CUs * pass through trade ratio in fee calcs * Crispheaney/withdraw in rm liquidity (#1871) * init * fail transfer_from_program_vault if withdraw too big * test * Nour/expand lp status (#1867) * constituent status and paused operations * add admin functions and tests * add lp status checks * testing expanded to lp pool paushed operations on perp markets * make new wallet for lp taker swaps rather than hot wallet * idl changes and bug fixes * improve CUs for target base * more CU opts * more CU reduction in target crank * lp/init lp-settle-records (#1872) * init lp-settle-records * update pr to emit event * add in last settle ts --------- Co-authored-by: Nour Alharithi <[email protected]> * remove more unused lp pool params * update idl * update constituent target params vals * update idl * Crispheaney/rm mint (#1875) * rm unnecessary mints * sdk updates --------- Co-authored-by: Nour Alharithi <[email protected]> * add constituent map memcmp and lp status on cache * update tests and amm cache iteration method * change target base ix ordering * update admin client whitelistdlp token ix and other things --------- Co-authored-by: 0xbigz <[email protected]> Co-authored-by: wphan <[email protected]> Co-authored-by: Chris Heaney <[email protected]> Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: Chester Sim <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: lowkeynicc <[email protected]> Co-authored-by: jordy25519 <[email protected]> Co-authored-by: Luke Steyn <[email protected]> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: Nick Caradonna <[email protected]> Co-authored-by: Jesse Cha <[email protected]> Co-authored-by: asuma <[email protected]>
add vamm cache percent scalar (default is 100)
* aum cant go below zero * keep it signed
* fix comments (#1844) * chore: update laser 0.1.8 * chore: remove logging * program: tweak ResizeSignedMsgUserOrders (#1898) * fix linter and cargo test * fix cargo build errors * v2.138.0 * sdk: release v2.139.0-beta.0 * program: init-delegated-if-stake (#1859) * program: init-delegated-if-stake * add sdk * CHANGELOG --------- Co-authored-by: Chris Heaney <[email protected]> * program: auction-order-params-on-slow-fast-twap-divergence (#1882) * program: auction-order-params-on-slow-fast-twap-divergence * change tests * rm dlog * CHANGELOG * cargo fmt -- --------- Co-authored-by: Chris Heaney <[email protected]> * program: add invariant for max in amount for if swap (#1825) * sdk: release v2.139.0-beta.1 * chore: add grpc client to order subscriber * sdk: release v2.139.0-beta.2 * sdk: add market index 76 to constant (#1901) * sdk: release v2.139.0-beta.3 * fix ui build (#1902) * sdk: release v2.139.0-beta.4 * sdk: update aster config (#1903) * update aster config * add pythLazerId * sdk: release v2.139.0-beta.5 * Revert "Revert "Crispeaney/revert swift max margin ratio" (#1877)" (#1907) This reverts commit 0a8e153. * sdk: release v2.139.0-beta.6 * Revert "Revert "Revert "Crispeaney/revert swift max margin ratio" (#1877)" (#…" (#1910) * sdk: release v2.139.0-beta.7 * more robust isDelegateSigner for swift orders * sdk: release v2.139.0-beta.8 * program: allow resolve perp pnl deficit if pnl pool isnt 0 but at deficit (#1909) * program: update-resolve-perp-pnl-pool-validate * CHANGELOG --------- Co-authored-by: Chris Heaney <[email protected]> * program: add immutable owner support for token 22 vaults (#1904) * program: add immutable owner support for token 22 vaults * cargo fmt -- * CHANGELOG * sdk: tweak math for filling triggers (#1880) * sdk: tweak math for filling triggers * add back line * sdk: release v2.139.0-beta.9 * program: allow delegate to update user position max margin ratio (#1913) * Revert "more robust isDelegateSigner for swift orders" This reverts commit 2d4e30b. * sdk: release v2.139.0-beta.10 * update SwiftOrderMessage type for missing fields (#1908) * sdk: release v2.139.0-beta.11 * sdk: add getUpdateFeatureBitFlagsMedianTriggerPriceIx * sdk: release v2.139.0-beta.12 * update devnet market constants (#1914) * sdk: release v2.139.0-beta.13 * program: deposit into if stake from admin (#1899) * program: deposit into if stake from admin * add test * change action * cargo fmt -- * move depositIntoInsuranceFundStake to adminClient --------- Co-authored-by: wphan <[email protected]> * sdk: release v2.139.0-beta.14 * program: comment out unused ix (#1911) * program: raise MAX_BASE_ASSET_AMOUNT_WITH_AMM numerical invariant * v2.139.0 * sdk: release v2.140.0-beta.0 --------- Co-authored-by: jordy25519 <[email protected]> Co-authored-by: Jack Waller <[email protected]> Co-authored-by: lil perp <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: bigz_Pubkey <[email protected]> Co-authored-by: lowkeynicc <[email protected]> Co-authored-by: Nour Alharithi <[email protected]>
* fix comments (#1844) * chore: update laser 0.1.8 * chore: remove logging * program: tweak ResizeSignedMsgUserOrders (#1898) * fix linter and cargo test * fix cargo build errors * v2.138.0 * sdk: release v2.139.0-beta.0 * program: init-delegated-if-stake (#1859) * program: init-delegated-if-stake * add sdk * CHANGELOG --------- Co-authored-by: Chris Heaney <[email protected]> * program: auction-order-params-on-slow-fast-twap-divergence (#1882) * program: auction-order-params-on-slow-fast-twap-divergence * change tests * rm dlog * CHANGELOG * cargo fmt -- --------- Co-authored-by: Chris Heaney <[email protected]> * program: add invariant for max in amount for if swap (#1825) * sdk: release v2.139.0-beta.1 * chore: add grpc client to order subscriber * sdk: release v2.139.0-beta.2 * sdk: add market index 76 to constant (#1901) * sdk: release v2.139.0-beta.3 * fix ui build (#1902) * sdk: release v2.139.0-beta.4 * sdk: update aster config (#1903) * update aster config * add pythLazerId * sdk: release v2.139.0-beta.5 * Revert "Revert "Crispeaney/revert swift max margin ratio" (#1877)" (#1907) This reverts commit 0a8e153. * sdk: release v2.139.0-beta.6 * Revert "Revert "Revert "Crispeaney/revert swift max margin ratio" (#1877)" (#…" (#1910) * sdk: release v2.139.0-beta.7 * more robust isDelegateSigner for swift orders * sdk: release v2.139.0-beta.8 * program: allow resolve perp pnl deficit if pnl pool isnt 0 but at deficit (#1909) * program: update-resolve-perp-pnl-pool-validate * CHANGELOG --------- Co-authored-by: Chris Heaney <[email protected]> * program: add immutable owner support for token 22 vaults (#1904) * program: add immutable owner support for token 22 vaults * cargo fmt -- * CHANGELOG * sdk: tweak math for filling triggers (#1880) * sdk: tweak math for filling triggers * add back line * sdk: release v2.139.0-beta.9 * program: allow delegate to update user position max margin ratio (#1913) * Revert "more robust isDelegateSigner for swift orders" This reverts commit 2d4e30b. * sdk: release v2.139.0-beta.10 * update SwiftOrderMessage type for missing fields (#1908) * sdk: release v2.139.0-beta.11 * sdk: add getUpdateFeatureBitFlagsMedianTriggerPriceIx * sdk: release v2.139.0-beta.12 * update devnet market constants (#1914) * sdk: release v2.139.0-beta.13 * program: deposit into if stake from admin (#1899) * program: deposit into if stake from admin * add test * change action * cargo fmt -- * move depositIntoInsuranceFundStake to adminClient --------- Co-authored-by: wphan <[email protected]> * sdk: release v2.139.0-beta.14 * program: comment out unused ix (#1911) * program: raise MAX_BASE_ASSET_AMOUNT_WITH_AMM numerical invariant * v2.139.0 * sdk: release v2.140.0-beta.0 * sdk: update constants market index 77 (#1916) * sdk: release v2.140.0-beta.1 * Wphan/builder codes (#1805) * program: init lp pool * cargo fmt -- * add total fee fields * add update_target_weights math * program: use sparse matrix for constituent map and update tests * zero copy accounts, init ix (#1578) * update accounts (#1580) * zero copy + permissionless crank ixs (#1581) * program: support negative target weights for borrow-lend * fix tests to work with zero copy * few comment changes * remove discriminator from impl macro * add get_swap_amount, get_swap_fees, get_weight (#1579) * add get_swap_amount, get_swap_fees, get_weight * update accounts * add back ts * rebase * add constituent swap fees * fix swap fee calc (#1582) * add init amm mapping to lp context (#1583) * init constituent * add initializeLpPool test (#1585) * add initializeLpPool test * add check for constituent target weights * add add datum ix * add init tests and invariant checks * rename data to more useful names * dlp use spl token program (#1588) * add crank ix * update total_weight for validation_flags check * push test so far * overriding perp position works * remove message * fix dup total_weight add * constituent map remaining accounts * compiles * bankrun tests pass * compiles but casting failure in overflow protection test * address comment and change token arguments from u64 to u128 * bankrun tests pass * init constituent token account (#1596) * update aum calc * add update /remove mapping ixs * fix test - init constituent spot market * add crank improvements * passes tests * precision fix crank aum * precision fixes and constituent map check for account owner * add passthrough account logic (#1602) * add passthrough account logic * cant read yet * fix all zc alignment issues * make oracle source a u8 on zc struct * Wphan/dlp-swap-ixs (#1592) * add lp_swap ix * rebase * test helpers * swap works * fix swaps, add more cargo tests for fees n swap amt * remove console.logs * address PR comments * merge upstream * post-merge fixes * store bumps on accounts (#1604) * store bumps on accounts * do pda check in constituent map * address comments * Wphan/add liquidity (#1607) * add add remove liquidity fees calc * add liquidity ix * fix init mint and lppool token account, refactor test fees * add removeLiquidity bankrun test * merge upstream * add LPPool.next_mint_redeem_id * program: lp-pool-to-use-target-base-vector (#1615) * init lp pool target-base matrix * working target-base logic * add todos for add/remove liquidity aum * add renames + fix test * add beta and cost to trade in bps to target datum * add more tests * add fields to LP events, fix tests (#1620) * add fields to LP events, fix tests * revert target weight calc * add constituent.next_swap_id, fix cost_to_trade math * dlp jup swap (#1636) * dlp jup swap * add admin client ixs * almost fixed * test working? * update begin and end swap * tweaks * fix math on how much was swapped * remove unnecessary lp pool args * extra account validation * added token account pda checks in other ixs * stablecoin targets (#1638) * is stablecoin * address comments --------- Co-authored-by: Chris Heaney <[email protected]> * cleanup * transfer oracle data ix to constituent (#1643) * transfer oracle data ix to constituent * add lib entrypoint * simplify more * add spot market constraint * big cargo test (#1644) * derivative constituents + better testing + bug fixes (#1657) * all tests technically pass * update tests + prettify * bug fixes and tests pass * fix many bugs and finalize logic * deposit/borrow working and changing positions (#1652) * sdk: allow custom coder * program: dlp add upnl for settles to amm cache (#1659) * program: dlp add-upnl-for-settles-to-amm-cache * finish up lp pool transfer from perp market * add amount_to_transfer using diff * merge * add pnl and fee pool accounting + transfer from dlp to perp market --------- Co-authored-by: Nour Alharithi <[email protected]> * remove unused accounts coder * move customCoder into sdk, lint * testing: ix: settle perp to dlp, insufficient balance edge case and improvements (#1688) * finish edge case test * aum check also passes * prettify * added more settle test coverage and squash bugs (#1689) * dlp: add constituentMap (#1699) * Nour/gauntlet fee impl (#1698) * added correlation matrix infra * refactor builds * mint redeem handled for usdc * remove liquidity also should work * all tests pass * bankrun tests pass too * update aum considers amm cache (#1701) * prettify (#1702) * Wphan/merge master dlp (#1703) * feat: init swift user orders on user account creation if needed * fix: wrong pushing of swift user orders ixs * fix: broken swift tests * fix: swift -> signed msg * refactor(sdk): update jupiter's api url * fix(sdk): remove error thrown * indicative qutoes server changes * sdk: release v2.121.0-beta.7 * sdK: update market index 33 oracle rr (#1606) * sdk: add to spot constants market index 34 * revert adminClient.ts change * sdk: update spot market constants oracle index 33 * sdk: release v2.121.0-beta.8 * sdk: high leverage mode updates (#1605) * sdk: high leverage mode updates * add optional param for fee calc * update changelog * sdk: release v2.121.0-beta.9 * getPlaceSignedMsgTakerPerpOrderIxs infer HLM mode from bitflags (#1608) * sdk: release v2.121.0-beta.10 * fix: dehexify in getPlaceSignedMsgTakerPerpOrderIxs (#1610) * fix: dehexify in getPlaceSignedMsgTakerPerpOrderIxs * bankrun test * sdk: release v2.121.0-beta.11 * sdk: round tick/step size for getVammL2Generateor (#1612) * sdk: round tick/step size for etVammL2Generateor * use standard functions, include in all fcns * fix const declare, rm whitespace * fix posdir sign * sdk: release v2.121.0-beta.12 * sdk: release v2.121.0-beta.13 * sdk: constants market-index-45-46 (#1618) * sdk: release v2.121.0-beta.14 * robustness check for indicative quotes sender (#1621) * robustness check for indicative quotes sender * delete quote from market index of bad quote * sdk: release v2.121.0-beta.15 * Added launchTs for ZEUS, zBTC * sdk: release v2.121.0-beta.16 * sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign (#1622) * sdk: release v2.121.0-beta.17 * sdk: fix vamm l2 generator base swapped (#1623) * sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign * fix ask book else baseSwapped calc * sdk: release v2.121.0-beta.18 * sdk: revert vamm l2 gen (#1624) * Revert "sdk: fix vamm l2 generator base swapped (#1623)" This reverts commit 56bc78d. * Revert "sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign (#1622)" This reverts commit e49cfd5. * Revert "sdk: round tick/step size for getVammL2Generateor (#1612)" This reverts commit f932a4e. * sdk: release v2.121.0-beta.19 * sdk: show protected-asset have zero-borrow-limit (#1603) * sdk: show protected-asset have zero-borrow-limit * rm unused AssetTier import * sdk: release v2.121.0-beta.20 * sdk: market-constants-index-74 (#1629) * sdk: release v2.121.0-beta.21 * program: use saturating_sub for number_of_users (#1616) * program: use saturating_sub for number_of_users * update CHANGELOG.md * program: allow fixing hlm num users (#1630) * sdk: release v2.121.0-beta.22 * sdk: fix switchboard on demand client to use landed at * sdk: release v2.121.0-beta.23 * sdk: spot-market-poolid-4 constants (#1631) * sdk: release v2.121.0-beta.24 * fix high lev mode liq price (#1632) * sdk: release v2.121.0-beta.25 * replace deprecated solana install scripts (#1634) * sdk: release v2.121.0-beta.26 * refactor(sdk): use ReturnType for Timeout types (#1637) * sdk: release v2.121.0-beta.27 * auction price sdk fix * sdk: release v2.121.0-beta.28 * program: multi piecewise interest rate curve (#1560) * program: multi-piecewise-interest-rate-curve * update tests * widen out borrow limits/healthy util check * add break, use array of array for borrow slope segments * program: fix cargo test * sdk: add segmented IR curve to interest rate calc * clean up unusded var, make interest rate segment logic a const * incorp efficiency feedback points * test: add sol realistic market example * cargo fmt -- * CHANGELOG --------- Co-authored-by: Chris Heaney <[email protected]> * sdk: release v2.121.0-beta.29 * program: allow hot admin to update market fuel params (#1640) * v2.121.0 * sdk: release v2.122.0-beta.0 * sdk: fix nullish coalescing * sdk: release v2.122.0-beta.1 * program: add logging for wrong perp market mutability * sdk: check free collateral change in maxTradeSizeUsdcForPerp (#1645) * sdk: check free collateral change in maxTradeSizeUsdcForPerp * update changelog * sdk: release v2.122.0-beta.2 * refactor(sdk): emit newSlot event on initial subscribe call (#1646) * sdk: release v2.122.0-beta.3 * sdk: spot-market-constants-pool-id-2 (#1647) * sdk: release v2.122.0-beta.4 * sdk: add-spot-market-index-52-constants (#1649) * sdk: release v2.122.0-beta.5 * program: add existing position fields to order records (#1614) * program: add quote entry amount to order records * fix cargo fmt and test * more reusable code * more reusable code * add another comment * fix math * account for pos flip * fix typo * missed commit * more fixes * align naming * fix typo * CHANGELOG * program: check limit price after applying buffer in trigger limit ord… (#1648) * program: check limit price after applying buffer in trigger limit order auction * program: reduce duplicate code * fix tests * CHANGELOG --------- Co-authored-by: 0xbigz <[email protected]> * program: fix cargo tests * program: check limit price when setting auction for limit order (#1650) * program: check limit price after applying buffer in trigger limit order auction * program: reduce duplicate code * program: check limit price when setting limit auction params * cargo fmt -- * fix CHANGELOG * tests: updates switchboardTxCus.ts * program: try to fix iteration for max order size (#1651) * Revert "program: try to fix iteration for max order size (#1651)" This reverts commit 3f0eab3. * disable debug logging in bankrun tests * v2.122.0 * sdk: release v2.123.0-beta.0 * sdk: constants-spot-market-index-53 (#1655) * sdk: release v2.123.0-beta.1 * sdk: idl for new existing position order action records * fix: protocol test prettier fix * make ci lut checks not shit * sdk: release v2.123.0-beta.2 * sdk: fix vamm l2 generator base swapped and add new top of book (#1626) * sdk: bigz/fix-vamm-l2-generator-baseSwapped var assign * fix ask book else baseSwapped calc * use proper quoteAmount with baseSwap for top of book orders * clean up console.log * sdk: getVammL2Generator reduce loc (#1628) * sdk: getVammL2Generator-reduce-loc * add MAJORS_TOP_OF_BOOK_QUOTE_AMOUNTS * add marketindex check topOfBookAmounts * yarn lint/prettier * sdk: release v2.123.0-beta.3 * program: allow all limit orders to go through swift (#1661) * program: allow all limit orders to go through swift * add anchor test * CHANGELOG * sdk: add optional initSwiftAccount on existing account deposits (#1660) * sdk: release v2.123.0-beta.4 * program: add taker_speed_bump_override and amm_spread_adjustment * Revert "program: add taker_speed_bump_override and amm_spread_adjustment" This reverts commit 1e19b7e. * program: tests-fee-adjustment-neg-100 (#1656) * program: tests-fee-adjustment-neg-100 * add HLM field to test * cargo fmt -- --------- Co-authored-by: Chris Heaney <[email protected]> * program: simplify user can skip duration (#1668) * program: simplify user can skip duration * update context * CHANGELOG * fix test * fix pmm tests --------- Co-authored-by: Chris Heaney <[email protected]> * program: add taker_speed_bump_override and amm_spread_adjustment (#1665) * program: add taker_speed_bump_override and amm_spread_adjustment * add admin client * cargo test * add impl for amm_spread_adjustment * ensure no overflows * CHANGELOG * cargo fmt -- * sdk types * prettify --------- Co-authored-by: 0xbigz <[email protected]> * program: update-amm-spread-and-availability-constraints (#1663) * program: update-amm-spread-and-availability-constraints * fix cargo tests * program: use saturating mul for amm spread adj * nour/indic-quotes-sender-v2 (#1667) * nour/indic-quotes-sender-v2 * prettify * pass margin category into calculateEntriesEffectOnFreeCollateral (#1669) * fix cargo test * tests: fix oracle guardrail test * sdk: update idl * yarn prettify:fix * tests: fix a few more place and make tests * prettify fix * whitespace readme change * sdk: release v2.123.0-beta.5 * v2.123.0 * sdk: release v2.124.0-beta.0 * v2.123.0-1 * sdk: calculateVolSpreadBN-sync (#1671) * sdk: release v2.124.0-beta.1 * sdk: calculate-spread-bn-add-amm-spread-adjustment (#1672) * sdk: calculate-spread-bn-add-amm-spread-adjustment * corect sign * add math max 1 * prettify * sdk: release v2.124.0-beta.2 * sdk: correct calculateVolSpreadBN reversion * sdk: release v2.124.0-beta.3 * sdk: add getTriggerAuctionStartPrice (#1654) * sdk: add getTriggerAuctionStartPrice * updates * precisions * remove startBuffer param --------- Co-authored-by: Chris Heaney <[email protected]> * sdk: release v2.124.0-beta.4 * feat: customized cadence account loader (#1666) * feat: customized cadence account loader bby * feat: method to read account cadence on custom cadence account loader * feat: PR feedback on customized loader cleaup code and better naming * fix: lint and prettify * feat: more efficient rpc polling on custom polling intervals * feat: custom cadence acct loader override load * chore: prettify * sdk: release v2.124.0-beta.5 * sdk: sync-user-trade-tier-calcs (#1673) * sdk: sync-user-trade-tier-calcs * prettify --------- Co-authored-by: Nick Caradonna <[email protected]> * sdk: release v2.124.0-beta.6 * sdk: add new admin client fn * Revert "sdk: add new admin client fn" This reverts commit c7a4f0b. * sdk: release v2.124.0-beta.7 * refactor(ui): add callback logic, fix polling frequency update * sdk: release v2.124.0-beta.8 * program: less order param sanitization for long tail perps (#1680) * program: allow-auction-start-buffer-on-tail-mkt * fix test * cargo fmt -- * CHANGELOG --------- Co-authored-by: 0xbigz <[email protected]> * Wphan/custom coder (#1682) * sdk: allow custom coder * remove unused accounts coder * linter * move customCoder into sdk, lint * update test helpers * update testhelpers.ts * sdk: release v2.124.0-beta.9 * update sdk exports * sdk: release v2.124.0-beta.10 * sdk: safer-calculate-spread-reserve-math (#1681) * sdk: release v2.124.0-beta.11 * update getMaxLeverageForPerp to use usdc logic (#1678) * sdk: release v2.124.0-beta.12 * program: override for oracle delay (#1679) * programy: override for oracle delay * update impl * switch to i8 * CHANGELOG * program: programmatic rebalance between protocol owned if holdings (#1653) * program: if swap * program: add initial config * add update * more * moar * moar * moar * program: update how swap epoch works * add test * add an invariant * cargo fmt -- * add transfer to rev pool * add mint validation * cargo fmt -- * track in amount between tranfsers * add to ci tests * separate key * program: always transfer max amount to rev pool * CHANGELOG * sdk: release v2.124.0-beta.13 * sdk: improve-aclient-accounts-logic (#1684) * sdk: release v2.124.0-beta.14 * program: improve-amm-spread-validates (#1685) * program: let hot wallet update amm jit intensity * sdk: hot wallet can update amm jit intensity * program: hot wallet can update curve intensity * program: fix build * sdk: update idl * sdk: release v2.124.0-beta.15 * v2.124.0 * sdk: release v2.125.0-beta.0 * program: three-point-std-estimator (#1686) * program: three-point-std-estimator * update tests and add sdk * update changelog * sdk: add-updatePerpMarketOracleSlotDelayOverride (#1691) * sdk: release v2.125.0-beta.1 * program: add-amm-inventory-spread-adjustment-param (#1690) * program: add-amm-inventory-spread-adjustment-param * cargo fmt -- * update sdk * prettier * fix syntax { --------- Co-authored-by: Chris Heaney <[email protected]> * program: max-apr-rev-settle-by-spot-market (#1692) * program: max-apr-rev-settle-by-spot-market * update max * default to u128 to avoid casts * changelog * sdk: release v2.125.0-beta.2 * program: better account for imf in calculate_max_perp_order_size (#1693) * program: better account for imf in calculate_max_perp_order_size * CHANGELOG * v2.125.0 * sdk: release v2.126.0-beta.0 * sdk: only count taker fee in calculateEntriesEffectOnFreeCollateral for maintenance (#1694) * sdk: release v2.126.0-beta.1 * Separate getAddInsuranceFundStakeIxs (#1695) * sdk: release v2.126.0-beta.2 * idl: amm-inv-adj-latest-idl (#1697) * sdk: release v2.126.0-beta.3 * sdk: spot-market-index-54 constants (#1696) * sdk: release v2.126.0-beta.4 * sdk: update spot market index 54 pythlazer id * sdk: release v2.126.0-beta.5 * Update spotMarkets.ts * sdk: release v2.126.0-beta.6 * prettify --------- Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: Chester Sim <[email protected]> Co-authored-by: Nour Alharithi <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: bigz_Pubkey <[email protected]> Co-authored-by: lowkeynicc <[email protected]> Co-authored-by: jordy25519 <[email protected]> Co-authored-by: Luke Steyn <[email protected]> Co-authored-by: lil perp <[email protected]> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: Nick Caradonna <[email protected]> Co-authored-by: Jesse Cha <[email protected]> * slot staleness checks (#1705) * slot staleness checks * update aum ix to use constituent oracles * Nour/derivative constituent testing (#1708) * slot staleness checks * update aum ix to use constituent oracles * constituent test works when adjusting derivative index * constituent depeg kill switch works * works with multiple derivatives on the same parent * remove incorrect usage of nav * fix adminClient and tests * Nour/fee grid search testing (#1714) * grid search * grid search swap test * Nour/address comments (#1715) * low hanging fruit comments * remove pda checks and store lp pool on zero copy accounts * parameterize depeg threshold * make description in lp pool event * update idl for event change * add swap fee unit tests (#1713) * add swap fee unit tests * remove linear inventory fee component * Nour/settle accounting (#1723) * fixing the main settle test and settle function * all current tests pass * update msg occurrences * dont update lp quote owed unless collateralized * Nour/settle testing (#1725) * refactor settle pnl to modularize and add tests * more cargo tests * prettify * Nour/address more comments (#1726) * use oracle staleness threshold for staleness * add spot market vault invariant * refactor update_aum, add unit tests (#1727) * refactor update_aum, add unit tests * add constituent target base tests * update doc * Nour/parameterize dlp (#1731) * add validates and test for withdraw limit * settlement max * update idl * merge conflicts * fixes * update idl * bug fixes * mostly sdk fixes * bug fixes * bug fix and deploy script * program: new amm oracle (#1738) * zero unused amm fields * cargo fmt * bare bones ix * minimal anchor mm oracle impl * update test file * only do admin validate when not anchor test * updates * generalize native entry * fix weird function name chop off * make it compile for --feature cpi (#1748) Co-authored-by: jordy25519 <[email protected]> * more efficeint clock and state bit flags check * vamm uses mm oracle (#1747) * add offset * working tests * refactor to use MM oracle as its own type * remove weird preface * sdk updates * bankrun tests all pass * fix test * changes and fixes * widen confidence if mm oracle too diff * sdk side for confidence adjust * changelog * fix lint * fix cargo tests * address comments * add conf check * remove anchor ix and cache oracle confidence * only state admin can reenable mm oracle kill switch * cargo fmt --------- Co-authored-by: jordy25519 <[email protected]> * fix tests (#1764) * Nour/move ixs around (#1766) * move around ixs * remove message * add devnet oracle crank wallet * refactored mm oracle * sdk changes + cargo fmt * fix tests * validate price bands with fill fix * normalize fill within price bands * add sdk warning * updated type * undefined guard so anchor tests pass * accept vec for update amm and view amm * adjust test to work with new price bands * Revert "adjust test to work with new price bands" This reverts commit ee40ac8. * remove price bands logic * add zero ix for mm oracle for reset * add new drift client ix grouping * v1 safety improvements * isolate funding from MM oracle * add cargo tests for amm availability * change oracle validity log bool to enum * address comment * make validate fill direction agnostic * fix liquidate borrow for perp pnl test * fix tests and address comments * add RevenueShare and RevenueShareEscrow accounts an init ixs * fix multiple array zc account, and handling different message types in place_signed_msg_taker_order * decoding error * commit constituent map to barrel file * add lp fields to perp market account * recording orders in RevenueShareEscrow workin * rearrange perp market struct for lp fields * cancel and fill orders * idl * fix sdk build * fix math * bug fix for notional position tracking * update RevenueShareOrder bitflags, store builder_idx instead of pubkey * view function * merge RevenueShareOrders on add * fee view functions * max aum + whitelist check and removing get_mint_redeem_fee for now * add wsol support for add liquidity * fix sdk and typing bugs * update lp pool params ix * admin override cache and disable settle functions * remove builder accounts from cancel ixs, wip settle impl * dont fail settlpnl if no builder users provided * devnet swap working * finish settle, rename RevenueShare->Builder, RevenueShareEscrow->BuilderEscrow * add more bankrun tests, clean up * clean up, fix tests * why test fail * dlp taker discovered bug fixes and sdk changes * add subaccountid to BuilderOrder * reduce diff * refactor last settle ts to last settle slot * add referrals * add test can fill settle user with no builderescrow * add referral builder feature flag and referral migration method * fix cargo tests, try fix bankrun test timing issue * Nour/settle pnl fix (#1817) * settle perp to lp pool bug fixes * update bankrun test to not use admin fee pool deposit * fix tests using update spot market balances too * add log msgs for withdraw and fix casting bug * add SignedMsgOrderParamsMessageV2 * check in for z (#1823) * feat: option for custom oracle ws subscriber * fix: pass custom oracle ws sub option in dc constructor * sdk: add spot-market-index-57 to constants (#1815) * sdk: release v2.134.0-beta.2 * lazer oracle migration (#1813) * lazer oracle migration * spot markets too * sdk: release v2.134.0-beta.3 * sdk: release v2.134.0-beta.4 * program: settle pnl invariants (#1812) * program: settle pnl invariants * add test * fix lint * lints * add msg * CHANGELOG * cargo fmt -- * program: add_update_perp_pnl_pool (#1810) * program: add_update_perp_pnl_pool * test * CHANGELOG * sdk: release v2.134.0-beta.5 * program: update-mark-twap-integer-bias (#1783) * program: update-mark-twap-integer-bias * changelog update * program: update-fee-tier-determine-fix5 (#1800) * program: update-fee-tier-determine-fix5 * update changelog * program: update-mark-twap-crank-use-5min-basis (#1769) * program: update-mark-twap-crank-use-5min-basis * changelog * program: update-min-margin-const-limit (#1802) * program: update-min-margin-const-limit * add CHANGELOG.md * sdk: release v2.134.0-beta.6 * program: rm-burn-lp-shares-invariant (#1816) * program: rm-burn-lp-shares-invariant * update changelog * fix test and cargo fmt * fix anchor tests * yarn prettify:fix * reenable settle_pnl mode test * v2.134.0 * sdk: release v2.135.0-beta.0 * Merge pull request #1820 from drift-labs/chester/fix-zod * sdk: release v2.135.0-beta.1 * mm oracle sdk change (#1806) * mm oracle sdk change * better conditional typing * DLOB bug fix * updated idl * rm getAmmBidAskPrice * sdk: release v2.135.0-beta.2 * sdk: fix isHighLeverageMode * sdk: release v2.135.0-beta.3 * refactor(sdk): add update delegate ix method, ovrride authority for settle multiple pnl (#1822) * check in for z * more logging changes * mm oracle sdk additions (#1824) * strict typing for more MM oracle contact points * add comments to auction.ts * prettify * sdk: release v2.135.0-beta.4 * init constituent bug fix and type change * add in invariant to be within 1 bp of balance before after * add strict typing for getPrice and new auction trigger function (#1826) * add strict typing for getPrice and new auction trigger function * refactor getTriggerAuctionStartAndExecutionPrice * sdk: release v2.135.0-beta.5 * update tests and enforce atomic settles for withdraw * add failing withdraw test * withdraw fix * bring diff in validate back to 1 * make lp pool test fail * better failed test * only check after < before, do to spot precision limits * add balance check to be < 1 cent --------- Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: bigz_Pubkey <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: lil perp <[email protected]> Co-authored-by: wphan <[email protected]> Co-authored-by: Chester Sim <[email protected]> * zero pad swift messages to make backwards compatible * PR feedback * add price for lp validates (#1833) * update tests/placeAndMakeSignedMsgBankrun.ts to handle client side errors * add missing token account reloads and syncs * add disabled lp pool swaps by default * refactor account logic for borrows * remove double fee count, update tests to check filled position and quote amounts fda * more extensive aum logging * rename Builder -> RevenueShare * add test check accumulated builder/ref fees * fix settle multiple pnl accounts, test ref rewards in multiple markets * express builder fees in tenth of bps * update referral migration params * PR feedback * add builder code feature gate * fix tests * add referral fields * run all tests * kickoff build * disable extra instructions, fix builder code feature flag selection * update driftclient * Revert recent builder codes chain and merge (#1848) * Revert recent builder codes chain and merge * update driftclient * disable extra instructions, fix builder code feature flag selection * clean up account inclusion rules in settle pnl for builder codes * cargo fmt * PR comments, featureflag clean up * move authority check into get_revenue_share_escrow_account * clean up referrer eligibility check, support placeAndTake/Make referral fees * skip builder fee accrual on full escrow account, dont throw * add feature flag sdk fn * program: builder codes dont throw tx on missing acc * placeAndMake respect builder codes * ensure update userstats referrerstatus on migration * hold back OrderActionRecord idl changes * update CHANGELOG.md --------- Co-authored-by: 0xbigz <[email protected]> Co-authored-by: moosecat <[email protected]> Co-authored-by: Chris Heaney <[email protected]> Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: Chester Sim <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: lowkeynicc <[email protected]> Co-authored-by: jordy25519 <[email protected]> Co-authored-by: Luke Steyn <[email protected]> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: Nick Caradonna <[email protected]> Co-authored-by: Jesse Cha <[email protected]> * sdk: release v2.140.0-beta.2 * v2.140.0 * sdk: release v2.141.0-beta.0 * feat: add margin ratio ix to open orders + swift prop (#1864) * feat: add margin ratio ix to open orders + swift prop * fix: bug with max lev available calculation * fix: bug with swift msg encoding + margin ratio * feat: re-add types for swift non-optional * rm: unneeded undefined check on swift maxMarginRation * allow enter HLM on position margin ratio update * fix margin ratio calc * updates * rm logs --------- Co-authored-by: Nick Caradonna <[email protected]> * sdk: release v2.141.0-beta.1 --------- Co-authored-by: jordy25519 <[email protected]> Co-authored-by: Jack Waller <[email protected]> Co-authored-by: lil perp <[email protected]> Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: bigz_Pubkey <[email protected]> Co-authored-by: lowkeynicc <[email protected]> Co-authored-by: Nour Alharithi <[email protected]> Co-authored-by: moosecat <[email protected]> Co-authored-by: Lukas deConantsesznak <[email protected]> Co-authored-by: Chester Sim <[email protected]> Co-authored-by: Luke Steyn <[email protected]> Co-authored-by: LukasDeco <[email protected]> Co-authored-by: Nick Caradonna <[email protected]> Co-authored-by: Jesse Cha <[email protected]>
* add in event * emit new event type * event subscriber * reformat event * fix constituent map index * bump consittunet index * cargo tests work
* only update the last slot if the oracles and perp positions pass the check per constituent * add in uncertainty fee * add simple test for target delays * change target base seed * prettify
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.