Skip to content

Commit

Permalink
update idl / types for state account
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbigz committed Dec 5, 2023
1 parent dfe2b00 commit e4a6fd0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
2 changes: 1 addition & 1 deletion protocol-v2
Submodule protocol-v2 updated 49 files
+46 −1 CHANGELOG.md
+1 −1 Cargo.lock
+1 −1 programs/drift/Cargo.toml
+124 −76 programs/drift/src/controller/orders.rs
+306 −6 programs/drift/src/controller/orders/tests.rs
+1 −1 programs/drift/src/error.rs
+10 −1 programs/drift/src/instructions/admin.rs
+2 −2 programs/drift/src/instructions/keeper.rs
+1 −1 programs/drift/src/instructions/user.rs
+7 −0 programs/drift/src/lib.rs
+25 −0 programs/drift/src/math/auction.rs
+118 −0 programs/drift/src/math/auction/tests.rs
+2 −2 programs/drift/src/math/cp_curve.rs
+40 −0 programs/drift/src/math/margin/tests.rs
+23 −0 programs/drift/src/math/orders.rs
+108 −0 programs/drift/src/math/orders/tests.rs
+4 −1 programs/drift/src/state/spot_market.rs
+8 −1 programs/drift/src/state/state.rs
+17 −1 programs/drift/src/state/user.rs
+124 −0 programs/drift/src/state/user/tests.rs
+1 −1 sdk/README.md
+1 −1 sdk/VERSION
+1 −1 sdk/package.json
+4 −0 sdk/src/accounts/bulkAccountLoader.ts
+7 −3 sdk/src/accounts/webSocketAccountSubscriber.ts
+7 −3 sdk/src/accounts/webSocketUserAccountSubscriber.ts
+7 −3 sdk/src/accounts/webSocketUserStatsAccountSubsriber.ts
+14 −0 sdk/src/adminClient.ts
+22 −2 sdk/src/constants/perpMarkets.ts
+13 −0 sdk/src/constants/spotMarkets.ts
+3 −3 sdk/src/dlob/orderBookLevels.ts
+25 −23 sdk/src/driftClient.ts
+2 −0 sdk/src/driftClientConfig.ts
+29 −4 sdk/src/idl/drift.json
+7 −0 sdk/src/jupiter/jupiterClient.ts
+4 −2 sdk/src/math/auction.ts
+21 −3 sdk/src/math/orders.ts
+11 −5 sdk/src/math/spotBalance.ts
+1 −1 sdk/src/tx/priorityFeeCalculator.ts
+1 −0 sdk/src/types.ts
+5 −3 sdk/src/user.ts
+3 −1 sdk/src/userConfig.ts
+8 −6 sdk/src/userStats.ts
+3 −1 sdk/src/userStatsConfig.ts
+1 −0 sdk/tests/dlob/helpers.ts
+47 −0 sdk/tests/dlob/test.ts
+51 −0 sdk/tests/spot/test.ts
+2 −1 test-scripts/run-anchor-tests.sh
+4 −2 tests/modifyOrder.ts
52 changes: 49 additions & 3 deletions src/driftpy/idl/drift.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.42.0",
"version": "2.47.0",
"name": "drift",
"instructions": [
{
Expand Down Expand Up @@ -4098,6 +4098,27 @@
}
]
},
{
"name": "updateLiquidationMarginBufferRatio",
"accounts": [
{
"name": "admin",
"isMut": false,
"isSigner": true
},
{
"name": "state",
"isMut": true,
"isSigner": false
}
],
"args": [
{
"name": "liquidationMarginBufferRatio",
"type": "u32"
}
]
},
{
"name": "updateOracleGuardRails",
"accounts": [
Expand Down Expand Up @@ -4142,6 +4163,27 @@
}
]
},
{
"name": "updateStateMaxNumberOfSubAccounts",
"accounts": [
{
"name": "admin",
"isMut": false,
"isSigner": true
},
{
"name": "state",
"isMut": true,
"isSigner": false
}
],
"args": [
{
"name": "maxNumberOfSubAccounts",
"type": "u16"
}
]
},
{
"name": "updatePerpMarketOracle",
"accounts": [
Expand Down Expand Up @@ -5701,12 +5743,16 @@
"name": "initialPctToLiquidate",
"type": "u16"
},
{
"name": "maxNumberOfSubAccounts",
"type": "u16"
},
{
"name": "padding",
"type": {
"array": [
"u8",
14
12
]
}
}
Expand Down Expand Up @@ -10877,7 +10923,7 @@
{
"code": 6221,
"name": "SpotFulfillmentConfigDisabled",
"msg": "Spot Fulfullment Config Disabled"
"msg": "Spot Fulfillment Config Disabled"
},
{
"code": 6222,
Expand Down
1 change: 1 addition & 0 deletions src/driftpy/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ class StateAccount:
exchange_status: int
liquidation_duration: int
initial_pct_to_liquidate: int
max_number_of_sub_accounts: int
padding: list[int]


Expand Down

0 comments on commit e4a6fd0

Please sign in to comment.