Commit fc505ac
Nour/mm oracle 2 (#1767)
* 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
* mm oracle improvements (#1771)
* v1 safety improvements
* isolate funding from MM oracle
* add cargo tests for amm availability
* change oracle validity log bool to enum
* address comment
---------
Co-authored-by: moosecat <[email protected]>
Co-authored-by: jordy25519 <[email protected]>1 parent f4a71fa commit fc505ac
File tree
45 files changed
+1667
-273
lines changed- deploy-scripts
- programs/drift
- src
- controller
- orders
- position
- repeg
- instructions
- math
- amm
- funding
- oracle
- repeg
- state
- oracle
- sdk/src
- idl
- math
- oracles
- tx
- test-scripts
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
45 files changed
+1667
-273
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
195 | | - | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
206 | 211 | | |
207 | 212 | | |
208 | 213 | | |
209 | | - | |
| 214 | + | |
210 | 215 | | |
211 | 216 | | |
212 | 217 | | |
| |||
848 | 853 | | |
849 | 854 | | |
850 | 855 | | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
851 | 861 | | |
852 | 862 | | |
853 | 863 | | |
854 | | - | |
| 864 | + | |
855 | 865 | | |
856 | 866 | | |
857 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
1048 | 1050 | | |
1049 | 1051 | | |
1050 | 1052 | | |
1051 | | - | |
| 1053 | + | |
1052 | 1054 | | |
1053 | 1055 | | |
1054 | 1056 | | |
| |||
1068 | 1070 | | |
1069 | 1071 | | |
1070 | 1072 | | |
1071 | | - | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1072 | 1081 | | |
1073 | 1082 | | |
1074 | | - | |
1075 | 1083 | | |
| 1084 | + | |
| 1085 | + | |
1076 | 1086 | | |
| 1087 | + | |
| 1088 | + | |
1077 | 1089 | | |
1078 | 1090 | | |
1079 | 1091 | | |
1080 | 1092 | | |
1081 | | - | |
| 1093 | + | |
1082 | 1094 | | |
1083 | | - | |
| 1095 | + | |
1084 | 1096 | | |
1085 | 1097 | | |
1086 | 1098 | | |
| |||
1090 | 1102 | | |
1091 | 1103 | | |
1092 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1093 | 1116 | | |
1094 | 1117 | | |
1095 | 1118 | | |
| |||
1100 | 1123 | | |
1101 | 1124 | | |
1102 | 1125 | | |
1103 | | - | |
| 1126 | + | |
1104 | 1127 | | |
1105 | 1128 | | |
1106 | 1129 | | |
1107 | 1130 | | |
1108 | | - | |
1109 | 1131 | | |
1110 | 1132 | | |
1111 | 1133 | | |
| |||
1114 | 1136 | | |
1115 | 1137 | | |
1116 | 1138 | | |
1117 | | - | |
| 1139 | + | |
1118 | 1140 | | |
1119 | 1141 | | |
1120 | 1142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2973 | 2973 | | |
2974 | 2974 | | |
2975 | 2975 | | |
2976 | | - | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
2977 | 2979 | | |
2978 | 2980 | | |
2979 | 2981 | | |
| |||
4845 | 4847 | | |
4846 | 4848 | | |
4847 | 4849 | | |
| 4850 | + | |
| 4851 | + | |
| 4852 | + | |
| 4853 | + | |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
| 4859 | + | |
| 4860 | + | |
| 4861 | + | |
| 4862 | + | |
| 4863 | + | |
| 4864 | + | |
| 4865 | + | |
| 4866 | + | |
| 4867 | + | |
| 4868 | + | |
| 4869 | + | |
| 4870 | + | |
| 4871 | + | |
| 4872 | + | |
| 4873 | + | |
| 4874 | + | |
| 4875 | + | |
| 4876 | + | |
| 4877 | + | |
| 4878 | + | |
| 4879 | + | |
| 4880 | + | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
| 4889 | + | |
| 4890 | + | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
| 4903 | + | |
| 4904 | + | |
| 4905 | + | |
| 4906 | + | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
| 4910 | + | |
| 4911 | + | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
| 4915 | + | |
| 4916 | + | |
| 4917 | + | |
| 4918 | + | |
| 4919 | + | |
| 4920 | + | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
| 4933 | + | |
| 4934 | + | |
| 4935 | + | |
| 4936 | + | |
| 4937 | + | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
| 4964 | + | |
| 4965 | + | |
| 4966 | + | |
| 4967 | + | |
| 4968 | + | |
| 4969 | + | |
| 4970 | + | |
| 4971 | + | |
| 4972 | + | |
| 4973 | + | |
| 4974 | + | |
| 4975 | + | |
| 4976 | + | |
| 4977 | + | |
| 4978 | + | |
| 4979 | + | |
| 4980 | + | |
| 4981 | + | |
| 4982 | + | |
| 4983 | + | |
| 4984 | + | |
| 4985 | + | |
| 4986 | + | |
| 4987 | + | |
| 4988 | + | |
| 4989 | + | |
| 4990 | + | |
| 4991 | + | |
| 4992 | + | |
| 4993 | + | |
| 4994 | + | |
| 4995 | + | |
| 4996 | + | |
| 4997 | + | |
| 4998 | + | |
| 4999 | + | |
| 5000 | + | |
| 5001 | + | |
| 5002 | + | |
| 5003 | + | |
| 5004 | + | |
| 5005 | + | |
| 5006 | + | |
| 5007 | + | |
| 5008 | + | |
| 5009 | + | |
| 5010 | + | |
| 5011 | + | |
| 5012 | + | |
| 5013 | + | |
| 5014 | + | |
| 5015 | + | |
| 5016 | + | |
| 5017 | + | |
| 5018 | + | |
| 5019 | + | |
| 5020 | + | |
| 5021 | + | |
| 5022 | + | |
| 5023 | + | |
| 5024 | + | |
| 5025 | + | |
4848 | 5026 | | |
4849 | 5027 | | |
4850 | 5028 | | |
| |||
0 commit comments