Commit 68edfec
lukas/isolated positions sdk (#1965)
* program: make lp shares reduce only
* init
* rm more fields
* make tests build
* start sdk changes
* init new margin calc
* deposit and transfer into
* add settle pnl
* program: add withdraw
* add more ix
* add new meets withdraw req fn
* enter/exit liquidation logic
* moar
* start liquidation logic
* other liquidation fns
* make build work
* more updates
* always calc isolated pos
* rm isolated position market index logic
* moar
* program: rm the isolated position market index
* some tweaks
* rm some old margin code
* tweak meets withdraw requirements
* rm liquidation mode changing context
* handle liquidation id and bit flags
* more liquidation changes
* clean
* fix force cancel orders
* update validate liquidation
* moar
* rename is_being_liquidated
* start adding test
* program: add validate for liq borrow for perp pnl
* program: add test for isolated margin calc
* is bankrupt test
* fix cancel orders
* fix set liquidation status
* more tweaks
* clean up naming
* update last active slot for isolated position liq
* another liquidation review
* add test
* cargo fmt --
* tweak naming
* add test to make sure false liquidaiton wont be triggered
* test meets withdraw
* change is bankrupt
* more
* update uses of exit isolated liquidaiton
* moar
* moar
* reduce diff
* moar
* modularize some for tests
* add tests for the pnl for deposit liquidation
* tests for isolated position transfer
* test for update spot balance
* test for settle pnl
* add perp position max margin
* program: test for custom perp position margin ratio
* add test for margin calc for disable hlm
* update test name
* make max margin ratio persist
* add liquidation mode test
* more tests to make sure liqudiations dont bleed over
* change test name
* fix broken cargo tests
* cargo fmt --
* first ts test
* isolatedPositionLiquidatePerp test
* isolatedPositionLiquidatePerpwithFill test
* fix expired position
* cargo fmt --
* feat: initial SDK Changes for iso pos
* feat: margin calc unit tests
* temp
* feat: finally - parity with on-chain cargo test
* fix: PR feedback and cleanup + decoding position flag wrong
* feat: deposit into iso position ixs
* temp: pr feedback nother round
* feat: per perp pos max margin ratio
* feat: additional ixs for transfer into iso + update perp margin ratio
* feat: revamp liquidation checker functions for cross vs iso margin
* fix: adjust health getter for user
* fix: liq statuses add to return signature
* chore: post rebase cleaner upper
* fix: missing params from per market lev
* feat: zero out account withdraw from perp position
* fix: available positions logic update for iso
* feat: iso position txs cleanup + ix ordering
* feat: onchain props for signed msg orders + idl update
* feat: cancels withdraw from iso pos
* fix: only settle if needed iso withdraw + i64 min
* feat: improvements to single grpc test
* feat: buffer on margin deposits to avoid insuff collat err
* feat: helpful scripts for testing/manipulating iso positions
* chore: re organizing some user sdk funcs
* fix: bug with max amount withdrawal for transfer iso perp
* fix: post merge dupe field on swift
* feat: min and max 64 constants
* fix: bug with margin removal
* fix: missing swift iso deposit from idl
* fix: lint and prettify
* feat: increased buffer on isolated deposit opening position
* fix: missing check on order increasing size for depositing margin place + take
* feat: settle pnl when trying to transfer to cross
* fix: incorrect iso bankruptcy flag
* feat: new margin calc logic
* fix: broken test helpers
* feat: buffer adjustments
* fix: add missing swap ix update
* fix: undefined this on isoalted free collateral
* fix: prettier broke
* fix: handle perp buying power on new iso position
* fix: try/catch wrap on user isolated get free collat
* feat: try settle flag for transfer to iso perp
* fix: properly handle perp buying power existing iso position increase
* feat: alpha npm version
* fix: decoding isolated scaled balance incorrectly maybe
* fix: build error rm lp field
* feat: publish isPerpPositionIsolated as public method
* sdk: add ix for token 2022 init account deposits (#2050)
* add ix for token 2022 init account deposits
* only call checkAccountExists if token2022
* update changelog
* sdk: release v2.152.0-beta.3
* program: add bit_flags in preparation for iso pos (#2053)
* program: add bit_flags in preparation for iso pos
* CHANGELOG
* program: base-spread-validate-buffer (#2052)
* program: base-spread-validate-buffer
* CHANGELOG
---------
Co-authored-by: Chris Heaney <chrisheaney30@gmail.com>
* v2.152.0
* ui: save titan tx when quoted and reuse on swap (#2055)
* fix titan quoting for dsol
* fix dsol instant unstake
* feat: minified with esbuild (#2056)
* feat: minified with esbuild
* fix: rm webpack
* fix: prettier titanClient
* ui: fix falsely failing quotes from titan (#2058)
* ui: fix falsely failing quotes from titan
* prettify
* check feed id after pyth pull atomic update
* fix: many null checks fixed (#2059)
* fix: many null checks fixed
* fix: prettier
* feat: get active markets helpers
* fix: prettier
* fix: README on margin calc was incorrect
* fix: prettier and lint
* fix: rm weird program diff
* fix: rm weird program diff 2
* fix: rm weird empty file =
* fix: rm useless diffs
* refactor: remove unused fields a bunch on margin calc
* fix: rebuild idl
* fix: prevent unnecessary excpetion on liq price if free collat delta not computed
* program: delete sereum/ob configs ix (#2066)
* hot wallet update config stats
* add delete for serum
* delete ob config
* CHANGELOG
* sdk: release v2.153.0-beta.2
* Nick/external init account support (#2067)
* wip: add external signer support for init account, stats account, swift account
* updates
* fix prettify
* sdk: release v2.153.0-beta.3
* fix: user fastDecode check iso deposit and pos flag
* fix: broken tests and PR cleanup
* fix: final anchor tests fix?
---------
Co-authored-by: Chris Heaney <chrisheaney30@gmail.com>
Co-authored-by: lowkeynicc <85139158+lowkeynicc@users.noreply.github.com>
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bigz_Pubkey <83473873+0xbigz@users.noreply.github.com>
Co-authored-by: wphan <6348407+wphan@users.noreply.github.com>
Co-authored-by: chakos <chrishakos@lunoho.company>1 parent 904a87e commit 68edfec
File tree
19 files changed
+1106
-153
lines changed- sdk
- scripts
- src
- decode
- margin
- math
- tests
- dlob
- user
- tests
19 files changed
+1106
-153
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
0 commit comments