@velocity-exchange/sdk 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierignore +1 -1
- package/CHANGELOG.md +20 -0
- package/README.md +30 -30
- package/bun.lock +1 -1
- package/lib/browser/accounts/grpcProgramAccountSubscriber.js +1 -1
- package/lib/browser/accounts/grpcVelocityClientAccountSubscriber.d.ts +0 -4
- package/lib/browser/accounts/grpcVelocityClientAccountSubscriber.js +1 -3
- package/lib/browser/accounts/grpcVelocityClientAccountSubscriberV2.d.ts +0 -4
- package/lib/browser/accounts/grpcVelocityClientAccountSubscriberV2.js +5 -7
- package/lib/browser/accounts/laserProgramAccountSubscriber.js +1 -1
- package/lib/browser/accounts/pollingVelocityClientAccountSubscriber.d.ts +0 -4
- package/lib/browser/accounts/pollingVelocityClientAccountSubscriber.js +5 -7
- package/lib/browser/accounts/types.d.ts +2 -8
- package/lib/browser/accounts/utils.js +2 -2
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriber.d.ts +0 -4
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriber.js +5 -7
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts +0 -4
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriberV2.js +5 -7
- package/lib/browser/addresses/pda.d.ts +1 -7
- package/lib/browser/addresses/pda.js +4 -10
- package/lib/browser/adminClient.d.ts +1 -1
- package/lib/browser/adminClient.js +21 -21
- package/lib/browser/auctionSubscriber/auctionSubscriber.d.ts +1 -3
- package/lib/browser/auctionSubscriber/auctionSubscriber.js +2 -6
- package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.d.ts +1 -3
- package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.js +2 -6
- package/lib/browser/auctionSubscriber/types.d.ts +3 -2
- package/lib/browser/config.d.ts +10 -19
- package/lib/browser/config.js +6 -33
- package/lib/browser/constants/insuranceFund.d.ts +1 -1
- package/lib/browser/constants/insuranceFund.js +1 -1
- package/lib/browser/constituentMap/constituentMap.d.ts +0 -2
- package/lib/browser/constituentMap/constituentMap.js +5 -5
- package/lib/browser/core/VelocityCore.d.ts +9 -15
- package/lib/browser/core/VelocityCore.js +5 -7
- package/lib/browser/core/instructions/withdraw.d.ts +1 -1
- package/lib/browser/core/instructions/withdraw.js +1 -1
- package/lib/browser/core/remainingAccounts.js +3 -3
- package/lib/browser/dlob/DLOB.d.ts +1 -1
- package/lib/browser/dlob/DLOB.js +6 -6
- package/lib/browser/dlob/DLOBSubscriber.d.ts +0 -2
- package/lib/browser/dlob/DLOBSubscriber.js +2 -7
- package/lib/browser/dlob/orderBookLevels.js +7 -7
- package/lib/browser/dlob/types.d.ts +0 -2
- package/lib/browser/events/eventSubscriber.d.ts +1 -1
- package/lib/browser/events/eventsServerLogProvider.js +2 -2
- package/lib/browser/events/parse.js +14 -14
- package/lib/browser/events/types.d.ts +3 -5
- package/lib/browser/events/types.js +1 -1
- package/lib/browser/idl/{drift.d.ts → velocity.d.ts} +1042 -767
- package/lib/browser/idl/{drift.json → velocity.json} +1033 -758
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.js +1 -2
- package/lib/browser/math/amm.d.ts +10 -10
- package/lib/browser/math/amm.js +29 -28
- package/lib/browser/math/auction.js +16 -12
- package/lib/browser/math/builder.d.ts +18 -1
- package/lib/browser/math/builder.js +32 -1
- package/lib/browser/math/funding.js +26 -26
- package/lib/browser/math/margin.d.ts +4 -4
- package/lib/browser/math/margin.js +15 -15
- package/lib/browser/math/market.js +13 -13
- package/lib/browser/math/oracles.d.ts +4 -4
- package/lib/browser/math/oracles.js +23 -23
- package/lib/browser/math/orders.d.ts +2 -2
- package/lib/browser/math/orders.js +9 -9
- package/lib/browser/math/position.js +4 -4
- package/lib/browser/math/superStake.d.ts +8 -10
- package/lib/browser/math/superStake.js +18 -20
- package/lib/browser/math/trade.js +5 -5
- package/lib/browser/math/utils.d.ts +1 -1
- package/lib/browser/math/utils.js +1 -1
- package/lib/browser/oracles/pythLazerClient.js +2 -2
- package/lib/browser/orderSubscriber/OrderSubscriber.d.ts +0 -2
- package/lib/browser/orderSubscriber/OrderSubscriber.js +8 -12
- package/lib/browser/orderSubscriber/WebsocketSubscription.js +1 -1
- package/lib/browser/orderSubscriber/grpcSubscription.js +2 -2
- package/lib/browser/orderSubscriber/types.d.ts +0 -2
- package/lib/browser/priorityFee/priorityFeeSubscriber.d.ts +1 -5
- package/lib/browser/priorityFee/priorityFeeSubscriber.js +7 -15
- package/lib/browser/priorityFee/priorityFeeSubscriberMap.d.ts +0 -4
- package/lib/browser/priorityFee/priorityFeeSubscriberMap.js +3 -11
- package/lib/browser/priorityFee/types.d.ts +3 -8
- package/lib/browser/priorityFee/velocityPriorityFeeMethod.d.ts +0 -8
- package/lib/browser/priorityFee/velocityPriorityFeeMethod.js +1 -3
- package/lib/browser/pyth/pythLazerSubscriber.d.ts +1 -1
- package/lib/browser/pyth/pythLazerSubscriber.js +1 -1
- package/lib/browser/swap/UnifiedSwapClient.js +1 -1
- package/lib/browser/swift/signedMsgUserAccountSubscriber.d.ts +4 -5
- package/lib/browser/swift/signedMsgUserAccountSubscriber.js +2 -6
- package/lib/browser/swift/swiftOrderSubscriber.d.ts +6 -5
- package/lib/browser/swift/swiftOrderSubscriber.js +5 -11
- package/lib/browser/types.d.ts +79 -91
- package/lib/browser/types.js +4 -0
- package/lib/browser/user.d.ts +1 -3
- package/lib/browser/user.js +19 -23
- package/lib/browser/userConfig.d.ts +3 -2
- package/lib/browser/userMap/WebsocketSubscription.js +1 -1
- package/lib/browser/userMap/grpcSubscription.js +1 -1
- package/lib/browser/userMap/referrerMap.d.ts +0 -2
- package/lib/browser/userMap/referrerMap.js +0 -4
- package/lib/browser/userMap/revenueShareEscrowMap.d.ts +0 -2
- package/lib/browser/userMap/revenueShareEscrowMap.js +0 -4
- package/lib/browser/userMap/userMap.d.ts +2 -4
- package/lib/browser/userMap/userMap.js +10 -14
- package/lib/browser/userMap/userMapConfig.d.ts +3 -2
- package/lib/browser/userMap/userStatsMap.d.ts +0 -2
- package/lib/browser/userMap/userStatsMap.js +0 -4
- package/lib/browser/userStats.d.ts +0 -2
- package/lib/browser/userStats.js +10 -14
- package/lib/browser/userStatsConfig.d.ts +3 -2
- package/lib/browser/util/ed25519Utils.d.ts +1 -1
- package/lib/browser/util/ed25519Utils.js +1 -1
- package/lib/browser/velocityClient.d.ts +53 -38
- package/lib/browser/velocityClient.js +258 -196
- package/lib/browser/velocityClientConfig.d.ts +0 -8
- package/lib/node/accounts/grpcProgramAccountSubscriber.js +1 -1
- package/lib/node/accounts/grpcVelocityClientAccountSubscriber.d.ts +0 -4
- package/lib/node/accounts/grpcVelocityClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcVelocityClientAccountSubscriber.js +1 -3
- package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.d.ts +0 -4
- package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.d.ts.map +1 -1
- package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.js +5 -7
- package/lib/node/accounts/laserProgramAccountSubscriber.js +1 -1
- package/lib/node/accounts/pollingVelocityClientAccountSubscriber.d.ts +0 -4
- package/lib/node/accounts/pollingVelocityClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/pollingVelocityClientAccountSubscriber.js +5 -7
- package/lib/node/accounts/types.d.ts +2 -8
- package/lib/node/accounts/types.d.ts.map +1 -1
- package/lib/node/accounts/utils.js +2 -2
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.d.ts +0 -4
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.js +5 -7
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts +0 -4
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts.map +1 -1
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.js +5 -7
- package/lib/node/addresses/pda.d.ts +1 -7
- package/lib/node/addresses/pda.d.ts.map +1 -1
- package/lib/node/addresses/pda.js +4 -10
- package/lib/node/adminClient.d.ts +1 -1
- package/lib/node/adminClient.js +21 -21
- package/lib/node/auctionSubscriber/auctionSubscriber.d.ts +1 -3
- package/lib/node/auctionSubscriber/auctionSubscriber.d.ts.map +1 -1
- package/lib/node/auctionSubscriber/auctionSubscriber.js +2 -6
- package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts +1 -3
- package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts.map +1 -1
- package/lib/node/auctionSubscriber/auctionSubscriberGrpc.js +2 -6
- package/lib/node/auctionSubscriber/types.d.ts +3 -2
- package/lib/node/auctionSubscriber/types.d.ts.map +1 -1
- package/lib/node/config.d.ts +10 -19
- package/lib/node/config.d.ts.map +1 -1
- package/lib/node/config.js +6 -33
- package/lib/node/constants/insuranceFund.d.ts +1 -1
- package/lib/node/constants/insuranceFund.js +1 -1
- package/lib/node/constituentMap/constituentMap.d.ts +0 -2
- package/lib/node/constituentMap/constituentMap.d.ts.map +1 -1
- package/lib/node/constituentMap/constituentMap.js +5 -5
- package/lib/node/core/VelocityCore.d.ts +9 -15
- package/lib/node/core/VelocityCore.d.ts.map +1 -1
- package/lib/node/core/VelocityCore.js +5 -7
- package/lib/node/core/instructions/withdraw.d.ts +1 -1
- package/lib/node/core/instructions/withdraw.d.ts.map +1 -1
- package/lib/node/core/instructions/withdraw.js +1 -1
- package/lib/node/core/remainingAccounts.js +3 -3
- package/lib/node/dlob/DLOB.d.ts +1 -1
- package/lib/node/dlob/DLOB.d.ts.map +1 -1
- package/lib/node/dlob/DLOB.js +6 -6
- package/lib/node/dlob/DLOBSubscriber.d.ts +0 -2
- package/lib/node/dlob/DLOBSubscriber.d.ts.map +1 -1
- package/lib/node/dlob/DLOBSubscriber.js +2 -7
- package/lib/node/dlob/orderBookLevels.d.ts.map +1 -1
- package/lib/node/dlob/orderBookLevels.js +7 -7
- package/lib/node/dlob/types.d.ts +0 -2
- package/lib/node/dlob/types.d.ts.map +1 -1
- package/lib/node/events/eventSubscriber.d.ts +1 -1
- package/lib/node/events/eventsServerLogProvider.js +2 -2
- package/lib/node/events/parse.d.ts.map +1 -1
- package/lib/node/events/parse.js +14 -14
- package/lib/node/events/types.d.ts +3 -5
- package/lib/node/events/types.d.ts.map +1 -1
- package/lib/node/events/types.js +1 -1
- package/lib/node/idl/{drift.d.ts → velocity.d.ts} +1043 -768
- package/lib/node/idl/velocity.d.ts.map +1 -0
- package/lib/node/idl/{drift.json → velocity.json} +1033 -758
- package/lib/node/index.d.ts +1 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +1 -2
- package/lib/node/math/amm.d.ts +10 -10
- package/lib/node/math/amm.d.ts.map +1 -1
- package/lib/node/math/amm.js +29 -28
- package/lib/node/math/auction.d.ts.map +1 -1
- package/lib/node/math/auction.js +16 -12
- package/lib/node/math/builder.d.ts +18 -1
- package/lib/node/math/builder.d.ts.map +1 -1
- package/lib/node/math/builder.js +32 -1
- package/lib/node/math/funding.d.ts.map +1 -1
- package/lib/node/math/funding.js +26 -26
- package/lib/node/math/margin.d.ts +4 -4
- package/lib/node/math/margin.d.ts.map +1 -1
- package/lib/node/math/margin.js +15 -15
- package/lib/node/math/market.d.ts.map +1 -1
- package/lib/node/math/market.js +13 -13
- package/lib/node/math/oracles.d.ts +4 -4
- package/lib/node/math/oracles.d.ts.map +1 -1
- package/lib/node/math/oracles.js +23 -23
- package/lib/node/math/orders.d.ts +2 -2
- package/lib/node/math/orders.d.ts.map +1 -1
- package/lib/node/math/orders.js +9 -9
- package/lib/node/math/position.d.ts.map +1 -1
- package/lib/node/math/position.js +4 -4
- package/lib/node/math/superStake.d.ts +8 -10
- package/lib/node/math/superStake.d.ts.map +1 -1
- package/lib/node/math/superStake.js +18 -20
- package/lib/node/math/trade.d.ts.map +1 -1
- package/lib/node/math/trade.js +5 -5
- package/lib/node/math/utils.d.ts +1 -1
- package/lib/node/math/utils.js +1 -1
- package/lib/node/oracles/pythLazerClient.js +2 -2
- package/lib/node/orderSubscriber/OrderSubscriber.d.ts +0 -2
- package/lib/node/orderSubscriber/OrderSubscriber.d.ts.map +1 -1
- package/lib/node/orderSubscriber/OrderSubscriber.js +8 -12
- package/lib/node/orderSubscriber/WebsocketSubscription.js +1 -1
- package/lib/node/orderSubscriber/grpcSubscription.js +2 -2
- package/lib/node/orderSubscriber/types.d.ts +0 -2
- package/lib/node/orderSubscriber/types.d.ts.map +1 -1
- package/lib/node/priorityFee/priorityFeeSubscriber.d.ts +1 -5
- package/lib/node/priorityFee/priorityFeeSubscriber.d.ts.map +1 -1
- package/lib/node/priorityFee/priorityFeeSubscriber.js +7 -15
- package/lib/node/priorityFee/priorityFeeSubscriberMap.d.ts +0 -4
- package/lib/node/priorityFee/priorityFeeSubscriberMap.d.ts.map +1 -1
- package/lib/node/priorityFee/priorityFeeSubscriberMap.js +3 -11
- package/lib/node/priorityFee/types.d.ts +3 -8
- package/lib/node/priorityFee/types.d.ts.map +1 -1
- package/lib/node/priorityFee/velocityPriorityFeeMethod.d.ts +0 -8
- package/lib/node/priorityFee/velocityPriorityFeeMethod.d.ts.map +1 -1
- package/lib/node/priorityFee/velocityPriorityFeeMethod.js +1 -3
- package/lib/node/pyth/pythLazerSubscriber.d.ts +1 -1
- package/lib/node/pyth/pythLazerSubscriber.js +1 -1
- package/lib/node/swap/UnifiedSwapClient.js +1 -1
- package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts +4 -5
- package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/swift/signedMsgUserAccountSubscriber.js +2 -6
- package/lib/node/swift/swiftOrderSubscriber.d.ts +6 -5
- package/lib/node/swift/swiftOrderSubscriber.d.ts.map +1 -1
- package/lib/node/swift/swiftOrderSubscriber.js +5 -11
- package/lib/node/types.d.ts +79 -91
- package/lib/node/types.d.ts.map +1 -1
- package/lib/node/types.js +4 -0
- package/lib/node/user.d.ts +1 -3
- package/lib/node/user.d.ts.map +1 -1
- package/lib/node/user.js +19 -23
- package/lib/node/userConfig.d.ts +3 -2
- package/lib/node/userConfig.d.ts.map +1 -1
- package/lib/node/userMap/WebsocketSubscription.js +1 -1
- package/lib/node/userMap/grpcSubscription.js +1 -1
- package/lib/node/userMap/referrerMap.d.ts +0 -2
- package/lib/node/userMap/referrerMap.d.ts.map +1 -1
- package/lib/node/userMap/referrerMap.js +0 -4
- package/lib/node/userMap/revenueShareEscrowMap.d.ts +0 -2
- package/lib/node/userMap/revenueShareEscrowMap.d.ts.map +1 -1
- package/lib/node/userMap/revenueShareEscrowMap.js +0 -4
- package/lib/node/userMap/userMap.d.ts +2 -4
- package/lib/node/userMap/userMap.d.ts.map +1 -1
- package/lib/node/userMap/userMap.js +10 -14
- package/lib/node/userMap/userMapConfig.d.ts +3 -2
- package/lib/node/userMap/userMapConfig.d.ts.map +1 -1
- package/lib/node/userMap/userStatsMap.d.ts +0 -2
- package/lib/node/userMap/userStatsMap.d.ts.map +1 -1
- package/lib/node/userMap/userStatsMap.js +0 -4
- package/lib/node/userStats.d.ts +0 -2
- package/lib/node/userStats.d.ts.map +1 -1
- package/lib/node/userStats.js +10 -14
- package/lib/node/userStatsConfig.d.ts +3 -2
- package/lib/node/userStatsConfig.d.ts.map +1 -1
- package/lib/node/util/ed25519Utils.d.ts +1 -1
- package/lib/node/util/ed25519Utils.js +1 -1
- package/lib/node/velocityClient.d.ts +53 -38
- package/lib/node/velocityClient.d.ts.map +1 -1
- package/lib/node/velocityClient.js +258 -196
- package/lib/node/velocityClientConfig.d.ts +0 -8
- package/lib/node/velocityClientConfig.d.ts.map +1 -1
- package/package.json +6 -7
- package/scripts/deposit-isolated-positions.ts +2 -2
- package/scripts/find-flagged-users.ts +1 -1
- package/scripts/grpc-client-test-comparison.ts +4 -4
- package/scripts/grpc-multiuser-client-test-comparison.ts +2 -2
- package/scripts/single-grpc-client-test.ts +3 -3
- package/scripts/updateVersion.js +4 -4
- package/scripts/withdraw-isolated-positions.ts +2 -2
- package/src/accounts/grpcProgramAccountSubscriber.ts +1 -1
- package/src/accounts/grpcVelocityClientAccountSubscriber.ts +0 -7
- package/src/accounts/grpcVelocityClientAccountSubscriberV2.ts +4 -11
- package/src/accounts/laserProgramAccountSubscriber.ts +1 -1
- package/src/accounts/pollingVelocityClientAccountSubscriber.ts +4 -11
- package/src/accounts/types.ts +2 -9
- package/src/accounts/utils.ts +2 -2
- package/src/accounts/webSocketVelocityClientAccountSubscriber.ts +4 -11
- package/src/accounts/webSocketVelocityClientAccountSubscriberV2.ts +4 -11
- package/src/addresses/pda.ts +3 -13
- package/src/adminClient.ts +21 -21
- package/src/auctionSubscriber/auctionSubscriber.ts +1 -6
- package/src/auctionSubscriber/auctionSubscriberGrpc.ts +1 -6
- package/src/auctionSubscriber/types.ts +3 -3
- package/src/config.ts +8 -67
- package/src/constants/insuranceFund.ts +1 -1
- package/src/constituentMap/constituentMap.ts +2 -6
- package/src/core/VelocityCore.ts +11 -20
- package/src/core/instructions/withdraw.ts +2 -2
- package/src/core/remainingAccounts.ts +3 -3
- package/src/dlob/DLOB.ts +6 -6
- package/src/dlob/DLOBSubscriber.ts +2 -8
- package/src/dlob/orderBookLevels.ts +12 -6
- package/src/dlob/types.ts +0 -2
- package/src/events/eventSubscriber.ts +1 -1
- package/src/events/eventsServerLogProvider.ts +2 -2
- package/src/events/parse.ts +14 -14
- package/src/events/types.ts +4 -7
- package/src/idl/{drift.json → velocity.json} +1033 -758
- package/src/idl/{drift.ts → velocity.ts} +1035 -760
- package/src/index.ts +1 -4
- package/src/margin/README.md +2 -2
- package/src/math/amm.ts +43 -21
- package/src/math/auction.ts +16 -12
- package/src/math/builder.ts +45 -1
- package/src/math/funding.ts +46 -43
- package/src/math/margin.ts +15 -15
- package/src/math/market.ts +21 -13
- package/src/math/oracles.ts +29 -26
- package/src/math/orders.ts +18 -5
- package/src/math/position.ts +9 -3
- package/src/math/superStake.ts +21 -24
- package/src/math/trade.ts +9 -1
- package/src/math/utils.ts +1 -1
- package/src/oracles/pythLazerClient.ts +3 -3
- package/src/orderSubscriber/OrderSubscriber.ts +2 -8
- package/src/orderSubscriber/WebsocketSubscription.ts +1 -1
- package/src/orderSubscriber/grpcSubscription.ts +2 -2
- package/src/orderSubscriber/types.ts +0 -2
- package/src/priorityFee/priorityFeeSubscriber.ts +5 -12
- package/src/priorityFee/priorityFeeSubscriberMap.ts +2 -10
- package/src/priorityFee/types.ts +3 -13
- package/src/priorityFee/velocityPriorityFeeMethod.ts +0 -12
- package/src/pyth/pythLazerSubscriber.ts +1 -1
- package/src/swap/UnifiedSwapClient.ts +1 -1
- package/src/swift/signedMsgUserAccountSubscriber.ts +2 -8
- package/src/swift/swiftOrderSubscriber.ts +7 -12
- package/src/types.ts +84 -102
- package/src/user.ts +9 -14
- package/src/userConfig.ts +1 -3
- package/src/userMap/WebsocketSubscription.ts +1 -1
- package/src/userMap/grpcSubscription.ts +1 -1
- package/src/userMap/referrerMap.ts +0 -4
- package/src/userMap/revenueShareEscrowMap.ts +0 -4
- package/src/userMap/userMap.ts +3 -7
- package/src/userMap/userMapConfig.ts +3 -3
- package/src/userMap/userStatsMap.ts +0 -4
- package/src/userStats.ts +1 -5
- package/src/userStatsConfig.ts +3 -3
- package/src/util/ed25519Utils.ts +1 -1
- package/src/velocityClient.ts +339 -225
- package/src/velocityClientConfig.ts +0 -10
- package/tests/{DriftCore → VelocityCore}/decode.test.ts +1 -1
- package/tests/{DriftCore → VelocityCore}/fill_trigger.test.ts +1 -1
- package/tests/{DriftCore → VelocityCore}/instructions.test.ts +1 -1
- package/tests/{DriftCore → VelocityCore}/pdas.test.ts +4 -2
- package/tests/ci/verifyConstants.ts +24 -27
- package/tests/decode/test.ts +2 -2
- package/tests/dlob/helpers.ts +5 -9
- package/tests/events/parseLogsForCuUsage.ts +15 -15
- package/tests/user/helpers.ts +9 -9
- package/tests/user/test.ts +13 -10
- package/lib/browser/util/deprecatedAlias.d.ts +0 -26
- package/lib/browser/util/deprecatedAlias.js +0 -10
- package/lib/node/idl/drift.d.ts.map +0 -1
- package/lib/node/util/deprecatedAlias.d.ts +0 -27
- package/lib/node/util/deprecatedAlias.d.ts.map +0 -1
- package/lib/node/util/deprecatedAlias.js +0 -10
- package/src/util/deprecatedAlias.ts +0 -21
- /package/lib/browser/idl/{drift.js → velocity.js} +0 -0
- /package/lib/node/idl/{drift.js → velocity.js} +0 -0
- /package/tests/{DriftCore → VelocityCore}/perp_orders.test.ts +0 -0
- /package/tests/{DriftCore → VelocityCore}/remainingAccounts.test.ts +0 -0
- /package/tests/{DriftCore → VelocityCore}/settlement_liquidation.test.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"address": "vELoC1audYbSYVRXn1vPaV8Axoa9oU6BYmNGZZBDZ1P",
|
|
3
3
|
"metadata": {
|
|
4
|
-
"name": "
|
|
4
|
+
"name": "velocity",
|
|
5
5
|
"version": "2.162.0",
|
|
6
6
|
"spec": "0.1.0",
|
|
7
7
|
"description": "Created with Anchor"
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
}
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
|
-
"name": "
|
|
253
|
+
"name": "velocity_signer"
|
|
254
254
|
},
|
|
255
255
|
{
|
|
256
256
|
"name": "user_token_account",
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
"name": "token_program"
|
|
538
538
|
},
|
|
539
539
|
{
|
|
540
|
-
"name": "
|
|
540
|
+
"name": "velocity_signer"
|
|
541
541
|
}
|
|
542
542
|
],
|
|
543
543
|
"args": [
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
"name": "token_program"
|
|
663
663
|
},
|
|
664
664
|
{
|
|
665
|
-
"name": "
|
|
665
|
+
"name": "velocity_signer"
|
|
666
666
|
},
|
|
667
667
|
{
|
|
668
668
|
"name": "instructions",
|
|
@@ -934,7 +934,7 @@
|
|
|
934
934
|
"name": "token_program"
|
|
935
935
|
},
|
|
936
936
|
{
|
|
937
|
-
"name": "
|
|
937
|
+
"name": "velocity_signer"
|
|
938
938
|
},
|
|
939
939
|
{
|
|
940
940
|
"name": "instructions",
|
|
@@ -1534,7 +1534,7 @@
|
|
|
1534
1534
|
}
|
|
1535
1535
|
},
|
|
1536
1536
|
{
|
|
1537
|
-
"name": "
|
|
1537
|
+
"name": "velocity_signer"
|
|
1538
1538
|
},
|
|
1539
1539
|
{
|
|
1540
1540
|
"name": "token_program"
|
|
@@ -1958,7 +1958,7 @@
|
|
|
1958
1958
|
"name": "token_program"
|
|
1959
1959
|
},
|
|
1960
1960
|
{
|
|
1961
|
-
"name": "
|
|
1961
|
+
"name": "velocity_signer"
|
|
1962
1962
|
}
|
|
1963
1963
|
],
|
|
1964
1964
|
"args": [
|
|
@@ -2087,7 +2087,7 @@
|
|
|
2087
2087
|
"writable": true
|
|
2088
2088
|
},
|
|
2089
2089
|
{
|
|
2090
|
-
"name": "
|
|
2090
|
+
"name": "velocity_signer"
|
|
2091
2091
|
},
|
|
2092
2092
|
{
|
|
2093
2093
|
"name": "quote_spot_market",
|
|
@@ -2450,7 +2450,7 @@
|
|
|
2450
2450
|
"name": "token_program"
|
|
2451
2451
|
},
|
|
2452
2452
|
{
|
|
2453
|
-
"name": "
|
|
2453
|
+
"name": "velocity_signer"
|
|
2454
2454
|
},
|
|
2455
2455
|
{
|
|
2456
2456
|
"name": "instructions",
|
|
@@ -2714,7 +2714,7 @@
|
|
|
2714
2714
|
"name": "token_program"
|
|
2715
2715
|
},
|
|
2716
2716
|
{
|
|
2717
|
-
"name": "
|
|
2717
|
+
"name": "velocity_signer"
|
|
2718
2718
|
},
|
|
2719
2719
|
{
|
|
2720
2720
|
"name": "instructions",
|
|
@@ -2873,7 +2873,7 @@
|
|
|
2873
2873
|
"signer": true
|
|
2874
2874
|
},
|
|
2875
2875
|
{
|
|
2876
|
-
"name": "
|
|
2876
|
+
"name": "velocity_signer"
|
|
2877
2877
|
}
|
|
2878
2878
|
],
|
|
2879
2879
|
"args": []
|
|
@@ -2884,11 +2884,11 @@
|
|
|
2884
2884
|
"Devnet-only escape hatch: cleans up accounts stranded by a layout-breaking",
|
|
2885
2885
|
"program upgrade (or by a partial re-init). For each account passed via",
|
|
2886
2886
|
"`remaining_accounts`:",
|
|
2887
|
-
"-
|
|
2888
|
-
"- token-program owned vault (
|
|
2887
|
+
"- velocity-owned PDA → drain lamports (runtime GCs at end of tx)",
|
|
2888
|
+
"- token-program owned vault (velocity_signer close-authority) → CPI",
|
|
2889
2889
|
"`close_account`, rent refunded to admin",
|
|
2890
2890
|
"Admin gate reads State's first pubkey field at raw offset 8..40 so it",
|
|
2891
|
-
"works regardless of the State layout currently on chain. `
|
|
2891
|
+
"works regardless of the State layout currently on chain. `velocity_signer_nonce`",
|
|
2892
2892
|
"must match `State.signer_nonce`; mismatch fails the token CPI signature.",
|
|
2893
2893
|
"Stripped from mainnet builds via `mainnet-beta`."
|
|
2894
2894
|
],
|
|
@@ -2915,7 +2915,7 @@
|
|
|
2915
2915
|
]
|
|
2916
2916
|
},
|
|
2917
2917
|
{
|
|
2918
|
-
"name": "
|
|
2918
|
+
"name": "velocity_signer",
|
|
2919
2919
|
"docs": [
|
|
2920
2920
|
"at CPI time when closing token vaults; ignored otherwise."
|
|
2921
2921
|
]
|
|
@@ -2926,7 +2926,7 @@
|
|
|
2926
2926
|
],
|
|
2927
2927
|
"args": [
|
|
2928
2928
|
{
|
|
2929
|
-
"name": "
|
|
2929
|
+
"name": "velocity_signer_nonce",
|
|
2930
2930
|
"type": "u8"
|
|
2931
2931
|
}
|
|
2932
2932
|
]
|
|
@@ -2957,11 +2957,14 @@
|
|
|
2957
2957
|
{
|
|
2958
2958
|
"kind": "const",
|
|
2959
2959
|
"value": [
|
|
2960
|
-
|
|
2961
|
-
|
|
2960
|
+
118,
|
|
2961
|
+
101,
|
|
2962
|
+
108,
|
|
2963
|
+
111,
|
|
2964
|
+
99,
|
|
2962
2965
|
105,
|
|
2963
|
-
102,
|
|
2964
2966
|
116,
|
|
2967
|
+
121,
|
|
2965
2968
|
95,
|
|
2966
2969
|
115,
|
|
2967
2970
|
116,
|
|
@@ -2977,7 +2980,7 @@
|
|
|
2977
2980
|
"name": "quote_asset_mint"
|
|
2978
2981
|
},
|
|
2979
2982
|
{
|
|
2980
|
-
"name": "
|
|
2983
|
+
"name": "velocity_signer"
|
|
2981
2984
|
},
|
|
2982
2985
|
{
|
|
2983
2986
|
"name": "rent",
|
|
@@ -4552,7 +4555,7 @@
|
|
|
4552
4555
|
}
|
|
4553
4556
|
},
|
|
4554
4557
|
{
|
|
4555
|
-
"name": "
|
|
4558
|
+
"name": "velocity_signer"
|
|
4556
4559
|
},
|
|
4557
4560
|
{
|
|
4558
4561
|
"name": "state",
|
|
@@ -5053,17 +5056,9 @@
|
|
|
5053
5056
|
"name": "liquidator",
|
|
5054
5057
|
"writable": true
|
|
5055
5058
|
},
|
|
5056
|
-
{
|
|
5057
|
-
"name": "liquidator_stats",
|
|
5058
|
-
"writable": true
|
|
5059
|
-
},
|
|
5060
5059
|
{
|
|
5061
5060
|
"name": "user",
|
|
5062
5061
|
"writable": true
|
|
5063
|
-
},
|
|
5064
|
-
{
|
|
5065
|
-
"name": "user_stats",
|
|
5066
|
-
"writable": true
|
|
5067
5062
|
}
|
|
5068
5063
|
],
|
|
5069
5064
|
"args": [
|
|
@@ -5111,18 +5106,10 @@
|
|
|
5111
5106
|
"name": "liquidator",
|
|
5112
5107
|
"writable": true
|
|
5113
5108
|
},
|
|
5114
|
-
{
|
|
5115
|
-
"name": "liquidator_stats",
|
|
5116
|
-
"writable": true
|
|
5117
|
-
},
|
|
5118
5109
|
{
|
|
5119
5110
|
"name": "user",
|
|
5120
5111
|
"writable": true
|
|
5121
5112
|
},
|
|
5122
|
-
{
|
|
5123
|
-
"name": "user_stats",
|
|
5124
|
-
"writable": true
|
|
5125
|
-
},
|
|
5126
5113
|
{
|
|
5127
5114
|
"name": "liability_spot_market_vault",
|
|
5128
5115
|
"writable": true,
|
|
@@ -5203,7 +5190,7 @@
|
|
|
5203
5190
|
"name": "token_program"
|
|
5204
5191
|
},
|
|
5205
5192
|
{
|
|
5206
|
-
"name": "
|
|
5193
|
+
"name": "velocity_signer"
|
|
5207
5194
|
},
|
|
5208
5195
|
{
|
|
5209
5196
|
"name": "instructions",
|
|
@@ -5252,18 +5239,10 @@
|
|
|
5252
5239
|
"name": "liquidator",
|
|
5253
5240
|
"writable": true
|
|
5254
5241
|
},
|
|
5255
|
-
{
|
|
5256
|
-
"name": "liquidator_stats",
|
|
5257
|
-
"writable": true
|
|
5258
|
-
},
|
|
5259
5242
|
{
|
|
5260
5243
|
"name": "user",
|
|
5261
5244
|
"writable": true
|
|
5262
5245
|
},
|
|
5263
|
-
{
|
|
5264
|
-
"name": "user_stats",
|
|
5265
|
-
"writable": true
|
|
5266
|
-
},
|
|
5267
5246
|
{
|
|
5268
5247
|
"name": "liability_spot_market_vault",
|
|
5269
5248
|
"writable": true,
|
|
@@ -5344,7 +5323,7 @@
|
|
|
5344
5323
|
"name": "token_program"
|
|
5345
5324
|
},
|
|
5346
5325
|
{
|
|
5347
|
-
"name": "
|
|
5326
|
+
"name": "velocity_signer"
|
|
5348
5327
|
},
|
|
5349
5328
|
{
|
|
5350
5329
|
"name": "instructions",
|
|
@@ -5576,7 +5555,7 @@
|
|
|
5576
5555
|
"name": "state"
|
|
5577
5556
|
},
|
|
5578
5557
|
{
|
|
5579
|
-
"name": "
|
|
5558
|
+
"name": "velocity_signer"
|
|
5580
5559
|
},
|
|
5581
5560
|
{
|
|
5582
5561
|
"name": "lp_pool",
|
|
@@ -6875,7 +6854,7 @@
|
|
|
6875
6854
|
}
|
|
6876
6855
|
},
|
|
6877
6856
|
{
|
|
6878
|
-
"name": "
|
|
6857
|
+
"name": "velocity_signer"
|
|
6879
6858
|
},
|
|
6880
6859
|
{
|
|
6881
6860
|
"name": "user_token_account",
|
|
@@ -7300,7 +7279,7 @@
|
|
|
7300
7279
|
}
|
|
7301
7280
|
},
|
|
7302
7281
|
{
|
|
7303
|
-
"name": "
|
|
7282
|
+
"name": "velocity_signer"
|
|
7304
7283
|
},
|
|
7305
7284
|
{
|
|
7306
7285
|
"name": "token_program"
|
|
@@ -7409,7 +7388,7 @@
|
|
|
7409
7388
|
}
|
|
7410
7389
|
},
|
|
7411
7390
|
{
|
|
7412
|
-
"name": "
|
|
7391
|
+
"name": "velocity_signer"
|
|
7413
7392
|
},
|
|
7414
7393
|
{
|
|
7415
7394
|
"name": "token_program"
|
|
@@ -7534,7 +7513,7 @@
|
|
|
7534
7513
|
}
|
|
7535
7514
|
},
|
|
7536
7515
|
{
|
|
7537
|
-
"name": "
|
|
7516
|
+
"name": "velocity_signer"
|
|
7538
7517
|
},
|
|
7539
7518
|
{
|
|
7540
7519
|
"name": "token_program"
|
|
@@ -7903,7 +7882,7 @@
|
|
|
7903
7882
|
"name": "token_program"
|
|
7904
7883
|
},
|
|
7905
7884
|
{
|
|
7906
|
-
"name": "
|
|
7885
|
+
"name": "velocity_signer"
|
|
7907
7886
|
}
|
|
7908
7887
|
],
|
|
7909
7888
|
"args": []
|
|
@@ -8055,7 +8034,7 @@
|
|
|
8055
8034
|
}
|
|
8056
8035
|
},
|
|
8057
8036
|
{
|
|
8058
|
-
"name": "
|
|
8037
|
+
"name": "velocity_signer"
|
|
8059
8038
|
},
|
|
8060
8039
|
{
|
|
8061
8040
|
"name": "insurance_fund_vault",
|
|
@@ -8225,6 +8204,86 @@
|
|
|
8225
8204
|
}
|
|
8226
8205
|
]
|
|
8227
8206
|
},
|
|
8207
|
+
{
|
|
8208
|
+
"name": "transfer_deposit_by_delegate",
|
|
8209
|
+
"discriminator": [
|
|
8210
|
+
141,
|
|
8211
|
+
171,
|
|
8212
|
+
241,
|
|
8213
|
+
161,
|
|
8214
|
+
17,
|
|
8215
|
+
31,
|
|
8216
|
+
135,
|
|
8217
|
+
29
|
|
8218
|
+
],
|
|
8219
|
+
"accounts": [
|
|
8220
|
+
{
|
|
8221
|
+
"name": "from_user",
|
|
8222
|
+
"writable": true
|
|
8223
|
+
},
|
|
8224
|
+
{
|
|
8225
|
+
"name": "to_user",
|
|
8226
|
+
"writable": true
|
|
8227
|
+
},
|
|
8228
|
+
{
|
|
8229
|
+
"name": "user_stats"
|
|
8230
|
+
},
|
|
8231
|
+
{
|
|
8232
|
+
"name": "delegate",
|
|
8233
|
+
"signer": true,
|
|
8234
|
+
"relations": [
|
|
8235
|
+
"from_user",
|
|
8236
|
+
"to_user"
|
|
8237
|
+
]
|
|
8238
|
+
},
|
|
8239
|
+
{
|
|
8240
|
+
"name": "state"
|
|
8241
|
+
},
|
|
8242
|
+
{
|
|
8243
|
+
"name": "spot_market_vault",
|
|
8244
|
+
"pda": {
|
|
8245
|
+
"seeds": [
|
|
8246
|
+
{
|
|
8247
|
+
"kind": "const",
|
|
8248
|
+
"value": [
|
|
8249
|
+
115,
|
|
8250
|
+
112,
|
|
8251
|
+
111,
|
|
8252
|
+
116,
|
|
8253
|
+
95,
|
|
8254
|
+
109,
|
|
8255
|
+
97,
|
|
8256
|
+
114,
|
|
8257
|
+
107,
|
|
8258
|
+
101,
|
|
8259
|
+
116,
|
|
8260
|
+
95,
|
|
8261
|
+
118,
|
|
8262
|
+
97,
|
|
8263
|
+
117,
|
|
8264
|
+
108,
|
|
8265
|
+
116
|
|
8266
|
+
]
|
|
8267
|
+
},
|
|
8268
|
+
{
|
|
8269
|
+
"kind": "arg",
|
|
8270
|
+
"path": "market_index"
|
|
8271
|
+
}
|
|
8272
|
+
]
|
|
8273
|
+
}
|
|
8274
|
+
}
|
|
8275
|
+
],
|
|
8276
|
+
"args": [
|
|
8277
|
+
{
|
|
8278
|
+
"name": "market_index",
|
|
8279
|
+
"type": "u16"
|
|
8280
|
+
},
|
|
8281
|
+
{
|
|
8282
|
+
"name": "amount",
|
|
8283
|
+
"type": "u64"
|
|
8284
|
+
}
|
|
8285
|
+
]
|
|
8286
|
+
},
|
|
8228
8287
|
{
|
|
8229
8288
|
"name": "transfer_fee_and_pnl_pool",
|
|
8230
8289
|
"discriminator": [
|
|
@@ -8634,7 +8693,7 @@
|
|
|
8634
8693
|
}
|
|
8635
8694
|
},
|
|
8636
8695
|
{
|
|
8637
|
-
"name": "
|
|
8696
|
+
"name": "velocity_signer"
|
|
8638
8697
|
}
|
|
8639
8698
|
],
|
|
8640
8699
|
"args": [
|
|
@@ -8768,7 +8827,7 @@
|
|
|
8768
8827
|
"name": "token_program"
|
|
8769
8828
|
},
|
|
8770
8829
|
{
|
|
8771
|
-
"name": "
|
|
8830
|
+
"name": "velocity_signer"
|
|
8772
8831
|
}
|
|
8773
8832
|
],
|
|
8774
8833
|
"args": [
|
|
@@ -12619,6 +12678,61 @@
|
|
|
12619
12678
|
}
|
|
12620
12679
|
]
|
|
12621
12680
|
},
|
|
12681
|
+
{
|
|
12682
|
+
"name": "update_user_allow_delegate_transfer",
|
|
12683
|
+
"discriminator": [
|
|
12684
|
+
235,
|
|
12685
|
+
106,
|
|
12686
|
+
172,
|
|
12687
|
+
39,
|
|
12688
|
+
223,
|
|
12689
|
+
238,
|
|
12690
|
+
167,
|
|
12691
|
+
204
|
|
12692
|
+
],
|
|
12693
|
+
"accounts": [
|
|
12694
|
+
{
|
|
12695
|
+
"name": "user_stats",
|
|
12696
|
+
"writable": true,
|
|
12697
|
+
"pda": {
|
|
12698
|
+
"seeds": [
|
|
12699
|
+
{
|
|
12700
|
+
"kind": "const",
|
|
12701
|
+
"value": [
|
|
12702
|
+
117,
|
|
12703
|
+
115,
|
|
12704
|
+
101,
|
|
12705
|
+
114,
|
|
12706
|
+
95,
|
|
12707
|
+
115,
|
|
12708
|
+
116,
|
|
12709
|
+
97,
|
|
12710
|
+
116,
|
|
12711
|
+
115
|
|
12712
|
+
]
|
|
12713
|
+
},
|
|
12714
|
+
{
|
|
12715
|
+
"kind": "account",
|
|
12716
|
+
"path": "authority"
|
|
12717
|
+
}
|
|
12718
|
+
]
|
|
12719
|
+
}
|
|
12720
|
+
},
|
|
12721
|
+
{
|
|
12722
|
+
"name": "authority",
|
|
12723
|
+
"signer": true,
|
|
12724
|
+
"relations": [
|
|
12725
|
+
"user_stats"
|
|
12726
|
+
]
|
|
12727
|
+
}
|
|
12728
|
+
],
|
|
12729
|
+
"args": [
|
|
12730
|
+
{
|
|
12731
|
+
"name": "allow_delegate_transfer",
|
|
12732
|
+
"type": "bool"
|
|
12733
|
+
}
|
|
12734
|
+
]
|
|
12735
|
+
},
|
|
12622
12736
|
{
|
|
12623
12737
|
"name": "update_user_custom_margin_ratio",
|
|
12624
12738
|
"discriminator": [
|
|
@@ -13472,7 +13586,7 @@
|
|
|
13472
13586
|
],
|
|
13473
13587
|
"accounts": [
|
|
13474
13588
|
{
|
|
13475
|
-
"name": "
|
|
13589
|
+
"name": "velocity_signer"
|
|
13476
13590
|
},
|
|
13477
13591
|
{
|
|
13478
13592
|
"name": "state"
|
|
@@ -13656,7 +13770,7 @@
|
|
|
13656
13770
|
}
|
|
13657
13771
|
},
|
|
13658
13772
|
{
|
|
13659
|
-
"name": "
|
|
13773
|
+
"name": "velocity_signer"
|
|
13660
13774
|
},
|
|
13661
13775
|
{
|
|
13662
13776
|
"name": "user_token_account",
|
|
@@ -13748,7 +13862,7 @@
|
|
|
13748
13862
|
}
|
|
13749
13863
|
},
|
|
13750
13864
|
{
|
|
13751
|
-
"name": "
|
|
13865
|
+
"name": "velocity_signer"
|
|
13752
13866
|
},
|
|
13753
13867
|
{
|
|
13754
13868
|
"name": "user_token_account",
|
|
@@ -13795,7 +13909,7 @@
|
|
|
13795
13909
|
"signer": true
|
|
13796
13910
|
},
|
|
13797
13911
|
{
|
|
13798
|
-
"name": "
|
|
13912
|
+
"name": "velocity_signer"
|
|
13799
13913
|
},
|
|
13800
13914
|
{
|
|
13801
13915
|
"name": "constituent",
|
|
@@ -14135,16 +14249,16 @@
|
|
|
14135
14249
|
]
|
|
14136
14250
|
},
|
|
14137
14251
|
{
|
|
14138
|
-
"name": "
|
|
14252
|
+
"name": "AmmCurveChanged",
|
|
14139
14253
|
"discriminator": [
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14254
|
+
116,
|
|
14255
|
+
12,
|
|
14256
|
+
114,
|
|
14257
|
+
18,
|
|
14258
|
+
175,
|
|
14259
|
+
31,
|
|
14260
|
+
153,
|
|
14261
|
+
5
|
|
14148
14262
|
]
|
|
14149
14263
|
},
|
|
14150
14264
|
{
|
|
@@ -15834,7 +15948,7 @@
|
|
|
15834
15948
|
{
|
|
15835
15949
|
"code": 6274,
|
|
15836
15950
|
"name": "OracleWrongWriteAuthority",
|
|
15837
|
-
"msg": "Oracle post update atomic price feed account must be
|
|
15951
|
+
"msg": "Oracle post update atomic price feed account must be velocity program"
|
|
15838
15952
|
},
|
|
15839
15953
|
{
|
|
15840
15954
|
"code": 6275,
|
|
@@ -16232,24 +16346,6 @@
|
|
|
16232
16346
|
"type": {
|
|
16233
16347
|
"kind": "struct",
|
|
16234
16348
|
"fields": [
|
|
16235
|
-
{
|
|
16236
|
-
"name": "oracle",
|
|
16237
|
-
"docs": [
|
|
16238
|
-
"oracle price data public key"
|
|
16239
|
-
],
|
|
16240
|
-
"type": "pubkey"
|
|
16241
|
-
},
|
|
16242
|
-
{
|
|
16243
|
-
"name": "historical_oracle_data",
|
|
16244
|
-
"docs": [
|
|
16245
|
-
"stores historically witnessed oracle data"
|
|
16246
|
-
],
|
|
16247
|
-
"type": {
|
|
16248
|
-
"defined": {
|
|
16249
|
-
"name": "HistoricalOracleData"
|
|
16250
|
-
}
|
|
16251
|
-
}
|
|
16252
|
-
},
|
|
16253
16349
|
{
|
|
16254
16350
|
"name": "fee_pool",
|
|
16255
16351
|
"docs": [
|
|
@@ -16305,7 +16401,7 @@
|
|
|
16305
16401
|
{
|
|
16306
16402
|
"name": "sqrt_k",
|
|
16307
16403
|
"docs": [
|
|
16308
|
-
"`sqrt(k)` in constant product mm formula (x * y = k). stored to avoid
|
|
16404
|
+
"`sqrt(k)` in constant product mm formula (x * y = k). stored to avoid velocity caused by integer math issues",
|
|
16309
16405
|
"precision: AMM_RESERVE_PRECISION"
|
|
16310
16406
|
],
|
|
16311
16407
|
"type": "u128"
|
|
@@ -16326,22 +16422,6 @@
|
|
|
16326
16422
|
],
|
|
16327
16423
|
"type": "u128"
|
|
16328
16424
|
},
|
|
16329
|
-
{
|
|
16330
|
-
"name": "base_asset_amount_long",
|
|
16331
|
-
"docs": [
|
|
16332
|
-
"always non-negative. tracks number of total longs in market (regardless of counterparty)",
|
|
16333
|
-
"precision: BASE_PRECISION"
|
|
16334
|
-
],
|
|
16335
|
-
"type": "i128"
|
|
16336
|
-
},
|
|
16337
|
-
{
|
|
16338
|
-
"name": "base_asset_amount_short",
|
|
16339
|
-
"docs": [
|
|
16340
|
-
"always non-positive. tracks number of total shorts in market (regardless of counterparty)",
|
|
16341
|
-
"precision: BASE_PRECISION"
|
|
16342
|
-
],
|
|
16343
|
-
"type": "i128"
|
|
16344
|
-
},
|
|
16345
16425
|
{
|
|
16346
16426
|
"name": "base_asset_amount_with_amm",
|
|
16347
16427
|
"docs": [
|
|
@@ -16351,232 +16431,71 @@
|
|
|
16351
16431
|
"type": "i128"
|
|
16352
16432
|
},
|
|
16353
16433
|
{
|
|
16354
|
-
"name": "
|
|
16434
|
+
"name": "total_fee",
|
|
16355
16435
|
"docs": [
|
|
16356
|
-
"
|
|
16357
|
-
"precision:
|
|
16436
|
+
"total fees collected by this perp market",
|
|
16437
|
+
"precision: QUOTE_PRECISION"
|
|
16358
16438
|
],
|
|
16359
|
-
"type": "
|
|
16439
|
+
"type": "i128"
|
|
16360
16440
|
},
|
|
16361
16441
|
{
|
|
16362
|
-
"name": "
|
|
16442
|
+
"name": "total_mm_fee",
|
|
16363
16443
|
"docs": [
|
|
16364
|
-
"
|
|
16444
|
+
"total fees collected by the vAMM's bid/ask spread",
|
|
16365
16445
|
"precision: QUOTE_PRECISION"
|
|
16366
16446
|
],
|
|
16367
16447
|
"type": "i128"
|
|
16368
16448
|
},
|
|
16369
16449
|
{
|
|
16370
|
-
"name": "
|
|
16450
|
+
"name": "total_fee_minus_distributions",
|
|
16371
16451
|
"docs": [
|
|
16372
|
-
"
|
|
16452
|
+
"total fees minus any recognized upnl and pool withdraws",
|
|
16373
16453
|
"precision: QUOTE_PRECISION"
|
|
16374
16454
|
],
|
|
16375
16455
|
"type": "i128"
|
|
16376
16456
|
},
|
|
16377
16457
|
{
|
|
16378
|
-
"name": "
|
|
16458
|
+
"name": "total_fee_withdrawn",
|
|
16379
16459
|
"docs": [
|
|
16380
|
-
"sum of all
|
|
16460
|
+
"sum of all fees from fee pool withdrawn to revenue pool",
|
|
16381
16461
|
"precision: QUOTE_PRECISION"
|
|
16382
16462
|
],
|
|
16383
|
-
"type": "
|
|
16463
|
+
"type": "u128"
|
|
16384
16464
|
},
|
|
16385
16465
|
{
|
|
16386
|
-
"name": "
|
|
16466
|
+
"name": "ask_base_asset_reserve",
|
|
16387
16467
|
"docs": [
|
|
16388
|
-
"
|
|
16389
|
-
"
|
|
16468
|
+
"Cached spread-adjusted reserves for the ask (long-take) side, derived",
|
|
16469
|
+
"from `long_spread` + `reference_price_offset`. Refreshed by",
|
|
16470
|
+
"[`crate::vlp::amm::math::spread::update_amm_quote_state`] on every AMM crank",
|
|
16471
|
+
"/ fill `setup`; quote/fill paths read these directly instead of",
|
|
16472
|
+
"recomputing per quote. Also surfaced to dashboards/tracking.",
|
|
16473
|
+
"precision: AMM_RESERVE_PRECISION"
|
|
16390
16474
|
],
|
|
16391
|
-
"type": "
|
|
16475
|
+
"type": "u128"
|
|
16392
16476
|
},
|
|
16393
16477
|
{
|
|
16394
|
-
"name": "
|
|
16478
|
+
"name": "ask_quote_asset_reserve",
|
|
16395
16479
|
"docs": [
|
|
16396
|
-
"
|
|
16397
|
-
"precision: QUOTE_PRECISION"
|
|
16480
|
+
"precision: AMM_RESERVE_PRECISION"
|
|
16398
16481
|
],
|
|
16399
|
-
"type": "
|
|
16482
|
+
"type": "u128"
|
|
16400
16483
|
},
|
|
16401
16484
|
{
|
|
16402
|
-
"name": "
|
|
16485
|
+
"name": "bid_base_asset_reserve",
|
|
16403
16486
|
"docs": [
|
|
16404
|
-
"
|
|
16405
|
-
"precision:
|
|
16487
|
+
"Cached spread-adjusted reserves for the bid (short-take) side.",
|
|
16488
|
+
"precision: AMM_RESERVE_PRECISION"
|
|
16406
16489
|
],
|
|
16407
|
-
"type": "
|
|
16490
|
+
"type": "u128"
|
|
16408
16491
|
},
|
|
16409
16492
|
{
|
|
16410
|
-
"name": "
|
|
16493
|
+
"name": "bid_quote_asset_reserve",
|
|
16411
16494
|
"docs": [
|
|
16412
|
-
"last funding rate for longs in this perp market (unit is quote per base)",
|
|
16413
|
-
"precision: FUNDING_RATE_PRECISION"
|
|
16414
|
-
],
|
|
16415
|
-
"type": "i64"
|
|
16416
|
-
},
|
|
16417
|
-
{
|
|
16418
|
-
"name": "last_funding_rate_short",
|
|
16419
|
-
"docs": [
|
|
16420
|
-
"last funding rate for shorts in this perp market (unit is quote per base)",
|
|
16421
|
-
"precision: QUOTE_PRECISION"
|
|
16422
|
-
],
|
|
16423
|
-
"type": "i64"
|
|
16424
|
-
},
|
|
16425
|
-
{
|
|
16426
|
-
"name": "last_24h_avg_funding_rate",
|
|
16427
|
-
"docs": [
|
|
16428
|
-
"estimate of last 24h of funding rate perp market (unit is quote per base)",
|
|
16429
|
-
"precision: QUOTE_PRECISION"
|
|
16430
|
-
],
|
|
16431
|
-
"type": "i64"
|
|
16432
|
-
},
|
|
16433
|
-
{
|
|
16434
|
-
"name": "total_fee",
|
|
16435
|
-
"docs": [
|
|
16436
|
-
"total fees collected by this perp market",
|
|
16437
|
-
"precision: QUOTE_PRECISION"
|
|
16438
|
-
],
|
|
16439
|
-
"type": "i128"
|
|
16440
|
-
},
|
|
16441
|
-
{
|
|
16442
|
-
"name": "total_mm_fee",
|
|
16443
|
-
"docs": [
|
|
16444
|
-
"total fees collected by the vAMM's bid/ask spread",
|
|
16445
|
-
"precision: QUOTE_PRECISION"
|
|
16446
|
-
],
|
|
16447
|
-
"type": "i128"
|
|
16448
|
-
},
|
|
16449
|
-
{
|
|
16450
|
-
"name": "total_exchange_fee",
|
|
16451
|
-
"docs": [
|
|
16452
|
-
"total fees collected by exchange fee schedule",
|
|
16453
|
-
"precision: QUOTE_PRECISION"
|
|
16454
|
-
],
|
|
16455
|
-
"type": "u128"
|
|
16456
|
-
},
|
|
16457
|
-
{
|
|
16458
|
-
"name": "total_fee_minus_distributions",
|
|
16459
|
-
"docs": [
|
|
16460
|
-
"total fees minus any recognized upnl and pool withdraws",
|
|
16461
|
-
"precision: QUOTE_PRECISION"
|
|
16462
|
-
],
|
|
16463
|
-
"type": "i128"
|
|
16464
|
-
},
|
|
16465
|
-
{
|
|
16466
|
-
"name": "total_fee_withdrawn",
|
|
16467
|
-
"docs": [
|
|
16468
|
-
"sum of all fees from fee pool withdrawn to revenue pool",
|
|
16469
|
-
"precision: QUOTE_PRECISION"
|
|
16470
|
-
],
|
|
16471
|
-
"type": "u128"
|
|
16472
|
-
},
|
|
16473
|
-
{
|
|
16474
|
-
"name": "total_liquidation_fee",
|
|
16475
|
-
"docs": [
|
|
16476
|
-
"all fees collected by market for liquidations",
|
|
16477
|
-
"precision: QUOTE_PRECISION"
|
|
16478
|
-
],
|
|
16479
|
-
"type": "u128"
|
|
16480
|
-
},
|
|
16481
|
-
{
|
|
16482
|
-
"name": "cumulative_funding_rate_long",
|
|
16483
|
-
"docs": [
|
|
16484
|
-
"accumulated funding rate for longs since inception in market"
|
|
16485
|
-
],
|
|
16486
|
-
"type": "i128"
|
|
16487
|
-
},
|
|
16488
|
-
{
|
|
16489
|
-
"name": "cumulative_funding_rate_short",
|
|
16490
|
-
"docs": [
|
|
16491
|
-
"accumulated funding rate for shorts since inception in market"
|
|
16492
|
-
],
|
|
16493
|
-
"type": "i128"
|
|
16494
|
-
},
|
|
16495
|
-
{
|
|
16496
|
-
"name": "total_social_loss",
|
|
16497
|
-
"docs": [
|
|
16498
|
-
"accumulated social loss paid by users since inception in market"
|
|
16499
|
-
],
|
|
16500
|
-
"type": "u128"
|
|
16501
|
-
},
|
|
16502
|
-
{
|
|
16503
|
-
"name": "ask_base_asset_reserve",
|
|
16504
|
-
"docs": [
|
|
16505
|
-
"transformed base_asset_reserve for users going long",
|
|
16506
16495
|
"precision: AMM_RESERVE_PRECISION"
|
|
16507
16496
|
],
|
|
16508
16497
|
"type": "u128"
|
|
16509
16498
|
},
|
|
16510
|
-
{
|
|
16511
|
-
"name": "ask_quote_asset_reserve",
|
|
16512
|
-
"docs": [
|
|
16513
|
-
"transformed quote_asset_reserve for users going long",
|
|
16514
|
-
"precision: AMM_RESERVE_PRECISION"
|
|
16515
|
-
],
|
|
16516
|
-
"type": "u128"
|
|
16517
|
-
},
|
|
16518
|
-
{
|
|
16519
|
-
"name": "bid_base_asset_reserve",
|
|
16520
|
-
"docs": [
|
|
16521
|
-
"transformed base_asset_reserve for users going short",
|
|
16522
|
-
"precision: AMM_RESERVE_PRECISION"
|
|
16523
|
-
],
|
|
16524
|
-
"type": "u128"
|
|
16525
|
-
},
|
|
16526
|
-
{
|
|
16527
|
-
"name": "bid_quote_asset_reserve",
|
|
16528
|
-
"docs": [
|
|
16529
|
-
"transformed quote_asset_reserve for users going short",
|
|
16530
|
-
"precision: AMM_RESERVE_PRECISION"
|
|
16531
|
-
],
|
|
16532
|
-
"type": "u128"
|
|
16533
|
-
},
|
|
16534
|
-
{
|
|
16535
|
-
"name": "last_oracle_normalised_price",
|
|
16536
|
-
"docs": [
|
|
16537
|
-
"the last seen oracle price partially shrunk toward the amm reserve price",
|
|
16538
|
-
"precision: PRICE_PRECISION"
|
|
16539
|
-
],
|
|
16540
|
-
"type": "i64"
|
|
16541
|
-
},
|
|
16542
|
-
{
|
|
16543
|
-
"name": "last_oracle_reserve_price_spread_pct",
|
|
16544
|
-
"docs": [
|
|
16545
|
-
"the gap between the oracle price and the reserve price = y * peg_multiplier / x"
|
|
16546
|
-
],
|
|
16547
|
-
"type": "i64"
|
|
16548
|
-
},
|
|
16549
|
-
{
|
|
16550
|
-
"name": "last_bid_price_twap",
|
|
16551
|
-
"docs": [
|
|
16552
|
-
"average estimate of bid price over funding_period",
|
|
16553
|
-
"precision: PRICE_PRECISION"
|
|
16554
|
-
],
|
|
16555
|
-
"type": "u64"
|
|
16556
|
-
},
|
|
16557
|
-
{
|
|
16558
|
-
"name": "last_ask_price_twap",
|
|
16559
|
-
"docs": [
|
|
16560
|
-
"average estimate of ask price over funding_period",
|
|
16561
|
-
"precision: PRICE_PRECISION"
|
|
16562
|
-
],
|
|
16563
|
-
"type": "u64"
|
|
16564
|
-
},
|
|
16565
|
-
{
|
|
16566
|
-
"name": "last_mark_price_twap",
|
|
16567
|
-
"docs": [
|
|
16568
|
-
"average estimate of (bid+ask)/2 price over funding_period",
|
|
16569
|
-
"precision: PRICE_PRECISION"
|
|
16570
|
-
],
|
|
16571
|
-
"type": "u64"
|
|
16572
|
-
},
|
|
16573
|
-
{
|
|
16574
|
-
"name": "last_mark_price_twap_5min",
|
|
16575
|
-
"docs": [
|
|
16576
|
-
"average estimate of (bid+ask)/2 price over FIVE_MINUTES"
|
|
16577
|
-
],
|
|
16578
|
-
"type": "u64"
|
|
16579
|
-
},
|
|
16580
16499
|
{
|
|
16581
16500
|
"name": "last_update_slot",
|
|
16582
16501
|
"docs": [
|
|
@@ -16584,14 +16503,6 @@
|
|
|
16584
16503
|
],
|
|
16585
16504
|
"type": "u64"
|
|
16586
16505
|
},
|
|
16587
|
-
{
|
|
16588
|
-
"name": "last_oracle_conf_pct",
|
|
16589
|
-
"docs": [
|
|
16590
|
-
"the pct size of the oracle confidence interval",
|
|
16591
|
-
"precision: PERCENTAGE_PRECISION"
|
|
16592
|
-
],
|
|
16593
|
-
"type": "u64"
|
|
16594
|
-
},
|
|
16595
16506
|
{
|
|
16596
16507
|
"name": "net_revenue_since_last_funding",
|
|
16597
16508
|
"docs": [
|
|
@@ -16601,103 +16512,44 @@
|
|
|
16601
16512
|
"type": "i64"
|
|
16602
16513
|
},
|
|
16603
16514
|
{
|
|
16604
|
-
"name": "
|
|
16515
|
+
"name": "last_cumulative_funding_rate_long",
|
|
16605
16516
|
"docs": [
|
|
16606
|
-
"
|
|
16517
|
+
"AMM's last-seen cumulative funding rates. Mirrors",
|
|
16518
|
+
"`PerpPosition::last_cumulative_funding_rate` on user positions —",
|
|
16519
|
+
"the AMM settles its own funding payment from",
|
|
16520
|
+
"`(market.cumulative_funding_rate_* − own_last) ×",
|
|
16521
|
+
"counterparty_position`, same math shape user positions use. The",
|
|
16522
|
+
"AMM is the counterparty for the net imbalance, so the relevant",
|
|
16523
|
+
"cum rate is the LONG one when the AMM is net long",
|
|
16524
|
+
"(base_asset_amount_with_amm < 0, i.e. users net short) and the",
|
|
16525
|
+
"SHORT one when the AMM is net short."
|
|
16607
16526
|
],
|
|
16608
16527
|
"type": "i64"
|
|
16609
16528
|
},
|
|
16610
16529
|
{
|
|
16611
|
-
"name": "
|
|
16612
|
-
"docs": [
|
|
16613
|
-
"the peridocity of the funding rate updates"
|
|
16614
|
-
],
|
|
16530
|
+
"name": "last_cumulative_funding_rate_short",
|
|
16615
16531
|
"type": "i64"
|
|
16616
16532
|
},
|
|
16617
16533
|
{
|
|
16618
|
-
"name": "
|
|
16619
|
-
"docs": [
|
|
16620
|
-
"the base step size (increment) of orders",
|
|
16621
|
-
"precision: BASE_PRECISION"
|
|
16622
|
-
],
|
|
16623
|
-
"type": "u64"
|
|
16624
|
-
},
|
|
16625
|
-
{
|
|
16626
|
-
"name": "order_tick_size",
|
|
16627
|
-
"docs": [
|
|
16628
|
-
"the price tick size of orders",
|
|
16629
|
-
"precision: PRICE_PRECISION"
|
|
16630
|
-
],
|
|
16631
|
-
"type": "u64"
|
|
16632
|
-
},
|
|
16633
|
-
{
|
|
16634
|
-
"name": "min_order_size",
|
|
16635
|
-
"docs": [
|
|
16636
|
-
"the minimum base size of an order",
|
|
16637
|
-
"precision: BASE_PRECISION"
|
|
16638
|
-
],
|
|
16639
|
-
"type": "u64"
|
|
16640
|
-
},
|
|
16641
|
-
{
|
|
16642
|
-
"name": "mm_oracle_slot",
|
|
16643
|
-
"docs": [
|
|
16644
|
-
"the max base size a single user can have",
|
|
16645
|
-
"precision: BASE_PRECISION"
|
|
16646
|
-
],
|
|
16647
|
-
"type": "u64"
|
|
16648
|
-
},
|
|
16649
|
-
{
|
|
16650
|
-
"name": "volume_24h",
|
|
16651
|
-
"docs": [
|
|
16652
|
-
"estimated total of volume in market",
|
|
16653
|
-
"QUOTE_PRECISION"
|
|
16654
|
-
],
|
|
16655
|
-
"type": "u64"
|
|
16656
|
-
},
|
|
16657
|
-
{
|
|
16658
|
-
"name": "long_intensity_volume",
|
|
16659
|
-
"docs": [
|
|
16660
|
-
"the volume intensity of long fills against AMM"
|
|
16661
|
-
],
|
|
16662
|
-
"type": "u64"
|
|
16663
|
-
},
|
|
16664
|
-
{
|
|
16665
|
-
"name": "short_intensity_volume",
|
|
16666
|
-
"docs": [
|
|
16667
|
-
"the volume intensity of short fills against AMM"
|
|
16668
|
-
],
|
|
16669
|
-
"type": "u64"
|
|
16670
|
-
},
|
|
16671
|
-
{
|
|
16672
|
-
"name": "last_trade_ts",
|
|
16534
|
+
"name": "last_oracle_reserve_price_spread_pct",
|
|
16673
16535
|
"docs": [
|
|
16674
|
-
"
|
|
16536
|
+
"Cached oracle-vs-reserve price spread (signed, BID_ASK_SPREAD_PRECISION),",
|
|
16537
|
+
"the spread input that seeds `calculate_spread`. Refreshed alongside the",
|
|
16538
|
+
"other cached spread fields by `update_amm_quote_state`."
|
|
16675
16539
|
],
|
|
16676
16540
|
"type": "i64"
|
|
16677
16541
|
},
|
|
16678
16542
|
{
|
|
16679
|
-
"name": "
|
|
16543
|
+
"name": "last_spread_update_slot",
|
|
16680
16544
|
"docs": [
|
|
16681
|
-
"
|
|
16682
|
-
"
|
|
16545
|
+
"Blockchain slot at which the cached spread state (`long_spread`,",
|
|
16546
|
+
"`short_spread`, `reference_price_offset`, the ask/bid reserves, and",
|
|
16547
|
+
"`last_oracle_reserve_price_spread_pct`) was last refreshed. Lets",
|
|
16548
|
+
"quote paths skip recompute within a slot and lets dashboards reason",
|
|
16549
|
+
"about cache staleness independently of `last_update_slot`."
|
|
16683
16550
|
],
|
|
16684
16551
|
"type": "u64"
|
|
16685
16552
|
},
|
|
16686
|
-
{
|
|
16687
|
-
"name": "oracle_std",
|
|
16688
|
-
"docs": [
|
|
16689
|
-
"estimate of standard deviation of the oracle price at each update",
|
|
16690
|
-
"precision: PRICE_PRECISION"
|
|
16691
|
-
],
|
|
16692
|
-
"type": "u64"
|
|
16693
|
-
},
|
|
16694
|
-
{
|
|
16695
|
-
"name": "last_mark_price_twap_ts",
|
|
16696
|
-
"docs": [
|
|
16697
|
-
"the last unix_timestamp the mark twap was updated"
|
|
16698
|
-
],
|
|
16699
|
-
"type": "i64"
|
|
16700
|
-
},
|
|
16701
16553
|
{
|
|
16702
16554
|
"name": "base_spread",
|
|
16703
16555
|
"docs": [
|
|
@@ -16715,23 +16567,26 @@
|
|
|
16715
16567
|
{
|
|
16716
16568
|
"name": "long_spread",
|
|
16717
16569
|
"docs": [
|
|
16718
|
-
"
|
|
16570
|
+
"Cached spread applied to the ask (long-take) side, in",
|
|
16571
|
+
"BID_ASK_SPREAD_PRECISION. Refreshed by `update_amm_quote_state`."
|
|
16719
16572
|
],
|
|
16720
16573
|
"type": "u32"
|
|
16721
16574
|
},
|
|
16722
16575
|
{
|
|
16723
16576
|
"name": "short_spread",
|
|
16724
16577
|
"docs": [
|
|
16725
|
-
"
|
|
16578
|
+
"Cached spread applied to the bid (short-take) side, in",
|
|
16579
|
+
"BID_ASK_SPREAD_PRECISION. Refreshed by `update_amm_quote_state`."
|
|
16726
16580
|
],
|
|
16727
16581
|
"type": "u32"
|
|
16728
16582
|
},
|
|
16729
16583
|
{
|
|
16730
|
-
"name": "
|
|
16584
|
+
"name": "reference_price_offset",
|
|
16731
16585
|
"docs": [
|
|
16732
|
-
"
|
|
16586
|
+
"Cached reference-price offset (signed, PRICE_PRECISION) applied to both",
|
|
16587
|
+
"sides' quotes. Refreshed by `update_amm_quote_state`."
|
|
16733
16588
|
],
|
|
16734
|
-
"type": "
|
|
16589
|
+
"type": "i32"
|
|
16735
16590
|
},
|
|
16736
16591
|
{
|
|
16737
16592
|
"name": "max_fill_reserve_fraction",
|
|
@@ -16762,32 +16617,6 @@
|
|
|
16762
16617
|
],
|
|
16763
16618
|
"type": "u8"
|
|
16764
16619
|
},
|
|
16765
|
-
{
|
|
16766
|
-
"name": "oracle_source",
|
|
16767
|
-
"docs": [
|
|
16768
|
-
"the oracle provider information. used to decode/scale the oracle public key"
|
|
16769
|
-
],
|
|
16770
|
-
"type": {
|
|
16771
|
-
"defined": {
|
|
16772
|
-
"name": "OracleSource"
|
|
16773
|
-
}
|
|
16774
|
-
}
|
|
16775
|
-
},
|
|
16776
|
-
{
|
|
16777
|
-
"name": "last_oracle_valid",
|
|
16778
|
-
"docs": [
|
|
16779
|
-
"tracks whether the oracle was considered valid at the last AMM update"
|
|
16780
|
-
],
|
|
16781
|
-
"type": "bool"
|
|
16782
|
-
},
|
|
16783
|
-
{
|
|
16784
|
-
"name": "oracle_low_risk_slot_delay_override",
|
|
16785
|
-
"docs": [
|
|
16786
|
-
"the override for the state.min_perp_auction_duration",
|
|
16787
|
-
"0 is no override, -1 is disable speed bump, 1-100 is literal speed bump"
|
|
16788
|
-
],
|
|
16789
|
-
"type": "i8"
|
|
16790
|
-
},
|
|
16791
16620
|
{
|
|
16792
16621
|
"name": "amm_spread_adjustment",
|
|
16793
16622
|
"docs": [
|
|
@@ -16795,34 +16624,6 @@
|
|
|
16795
16624
|
],
|
|
16796
16625
|
"type": "i8"
|
|
16797
16626
|
},
|
|
16798
|
-
{
|
|
16799
|
-
"name": "oracle_slot_delay_override",
|
|
16800
|
-
"type": "i8"
|
|
16801
|
-
},
|
|
16802
|
-
{
|
|
16803
|
-
"name": "padding_pre_mm_oracle_sequence",
|
|
16804
|
-
"docs": [
|
|
16805
|
-
"alignment padding for the following u64 (Rust would otherwise insert 5 implicit bytes here)"
|
|
16806
|
-
],
|
|
16807
|
-
"type": {
|
|
16808
|
-
"array": [
|
|
16809
|
-
"u8",
|
|
16810
|
-
5
|
|
16811
|
-
]
|
|
16812
|
-
}
|
|
16813
|
-
},
|
|
16814
|
-
{
|
|
16815
|
-
"name": "mm_oracle_sequence_id",
|
|
16816
|
-
"type": "u64"
|
|
16817
|
-
},
|
|
16818
|
-
{
|
|
16819
|
-
"name": "net_unsettled_funding_pnl",
|
|
16820
|
-
"type": "i64"
|
|
16821
|
-
},
|
|
16822
|
-
{
|
|
16823
|
-
"name": "reference_price_offset",
|
|
16824
|
-
"type": "i32"
|
|
16825
|
-
},
|
|
16826
16627
|
{
|
|
16827
16628
|
"name": "amm_inventory_spread_adjustment",
|
|
16828
16629
|
"docs": [
|
|
@@ -16835,27 +16636,11 @@
|
|
|
16835
16636
|
"type": "u8"
|
|
16836
16637
|
},
|
|
16837
16638
|
{
|
|
16838
|
-
"name": "
|
|
16839
|
-
"type": {
|
|
16840
|
-
"array": [
|
|
16841
|
-
"u8",
|
|
16842
|
-
2
|
|
16843
|
-
]
|
|
16844
|
-
}
|
|
16845
|
-
},
|
|
16846
|
-
{
|
|
16847
|
-
"name": "last_funding_oracle_twap",
|
|
16848
|
-
"type": "i64"
|
|
16849
|
-
},
|
|
16850
|
-
{
|
|
16851
|
-
"name": "padding_trailing",
|
|
16852
|
-
"docs": [
|
|
16853
|
-
"trailing alignment padding (struct alignment is 16 due to u128 fields)"
|
|
16854
|
-
],
|
|
16639
|
+
"name": "padding_post_amm",
|
|
16855
16640
|
"type": {
|
|
16856
16641
|
"array": [
|
|
16857
16642
|
"u8",
|
|
16858
|
-
|
|
16643
|
+
3
|
|
16859
16644
|
]
|
|
16860
16645
|
}
|
|
16861
16646
|
}
|
|
@@ -17032,6 +16817,84 @@
|
|
|
17032
16817
|
]
|
|
17033
16818
|
}
|
|
17034
16819
|
},
|
|
16820
|
+
{
|
|
16821
|
+
"name": "AmmCurveChanged",
|
|
16822
|
+
"docs": [
|
|
16823
|
+
"AMM-side curve change: peg / reserves / sqrt_k moved, and the AMM",
|
|
16824
|
+
"debited the adjustment cost from its books. Emitted by the AMM itself",
|
|
16825
|
+
"(from `on_market_event(FundingUpdated)`'s k-update branch, from",
|
|
16826
|
+
"`snap_to_oracle`, and from the admin `repeg` ix). PerpMarket-side",
|
|
16827
|
+
"state at the time of the change (`base_asset_amount_long/short`,",
|
|
16828
|
+
"`number_of_users`) lives on a separate `FundingRateRecord` or can be",
|
|
16829
|
+
"queried by consumers correlating on `(ts, market_index)`."
|
|
16830
|
+
],
|
|
16831
|
+
"type": {
|
|
16832
|
+
"kind": "struct",
|
|
16833
|
+
"fields": [
|
|
16834
|
+
{
|
|
16835
|
+
"name": "ts",
|
|
16836
|
+
"type": "i64"
|
|
16837
|
+
},
|
|
16838
|
+
{
|
|
16839
|
+
"name": "market_index",
|
|
16840
|
+
"type": "u16"
|
|
16841
|
+
},
|
|
16842
|
+
{
|
|
16843
|
+
"name": "peg_multiplier_before",
|
|
16844
|
+
"type": "u128"
|
|
16845
|
+
},
|
|
16846
|
+
{
|
|
16847
|
+
"name": "base_asset_reserve_before",
|
|
16848
|
+
"type": "u128"
|
|
16849
|
+
},
|
|
16850
|
+
{
|
|
16851
|
+
"name": "quote_asset_reserve_before",
|
|
16852
|
+
"type": "u128"
|
|
16853
|
+
},
|
|
16854
|
+
{
|
|
16855
|
+
"name": "sqrt_k_before",
|
|
16856
|
+
"type": "u128"
|
|
16857
|
+
},
|
|
16858
|
+
{
|
|
16859
|
+
"name": "peg_multiplier_after",
|
|
16860
|
+
"type": "u128"
|
|
16861
|
+
},
|
|
16862
|
+
{
|
|
16863
|
+
"name": "base_asset_reserve_after",
|
|
16864
|
+
"type": "u128"
|
|
16865
|
+
},
|
|
16866
|
+
{
|
|
16867
|
+
"name": "quote_asset_reserve_after",
|
|
16868
|
+
"type": "u128"
|
|
16869
|
+
},
|
|
16870
|
+
{
|
|
16871
|
+
"name": "sqrt_k_after",
|
|
16872
|
+
"type": "u128"
|
|
16873
|
+
},
|
|
16874
|
+
{
|
|
16875
|
+
"name": "adjustment_cost",
|
|
16876
|
+
"docs": [
|
|
16877
|
+
"precision: QUOTE_PRECISION"
|
|
16878
|
+
],
|
|
16879
|
+
"type": "i128"
|
|
16880
|
+
},
|
|
16881
|
+
{
|
|
16882
|
+
"name": "total_fee_minus_distributions_after",
|
|
16883
|
+
"docs": [
|
|
16884
|
+
"precision: QUOTE_PRECISION — AMM's TFMD after the change."
|
|
16885
|
+
],
|
|
16886
|
+
"type": "i128"
|
|
16887
|
+
},
|
|
16888
|
+
{
|
|
16889
|
+
"name": "oracle_price",
|
|
16890
|
+
"docs": [
|
|
16891
|
+
"precision: PRICE_PRECISION"
|
|
16892
|
+
],
|
|
16893
|
+
"type": "i64"
|
|
16894
|
+
}
|
|
16895
|
+
]
|
|
16896
|
+
}
|
|
16897
|
+
},
|
|
17035
16898
|
{
|
|
17036
16899
|
"name": "AssetTier",
|
|
17037
16900
|
"type": {
|
|
@@ -17601,139 +17464,30 @@
|
|
|
17601
17464
|
"name": "C"
|
|
17602
17465
|
},
|
|
17603
17466
|
{
|
|
17604
|
-
"name": "Speculative"
|
|
17605
|
-
},
|
|
17606
|
-
{
|
|
17607
|
-
"name": "HighlySpeculative"
|
|
17608
|
-
},
|
|
17609
|
-
{
|
|
17610
|
-
"name": "Isolated"
|
|
17611
|
-
}
|
|
17612
|
-
]
|
|
17613
|
-
}
|
|
17614
|
-
},
|
|
17615
|
-
{
|
|
17616
|
-
"name": "ContractType",
|
|
17617
|
-
"type": {
|
|
17618
|
-
"kind": "enum",
|
|
17619
|
-
"variants": [
|
|
17620
|
-
{
|
|
17621
|
-
"name": "Perpetual"
|
|
17622
|
-
},
|
|
17623
|
-
{
|
|
17624
|
-
"name": "DeprecatedFuture"
|
|
17625
|
-
},
|
|
17626
|
-
{
|
|
17627
|
-
"name": "DeprecatedPrediction"
|
|
17628
|
-
}
|
|
17629
|
-
]
|
|
17630
|
-
}
|
|
17631
|
-
},
|
|
17632
|
-
{
|
|
17633
|
-
"name": "CurveRecord",
|
|
17634
|
-
"type": {
|
|
17635
|
-
"kind": "struct",
|
|
17636
|
-
"fields": [
|
|
17637
|
-
{
|
|
17638
|
-
"name": "ts",
|
|
17639
|
-
"type": "i64"
|
|
17640
|
-
},
|
|
17641
|
-
{
|
|
17642
|
-
"name": "record_id",
|
|
17643
|
-
"type": "u64"
|
|
17644
|
-
},
|
|
17645
|
-
{
|
|
17646
|
-
"name": "peg_multiplier_before",
|
|
17647
|
-
"type": "u128"
|
|
17648
|
-
},
|
|
17649
|
-
{
|
|
17650
|
-
"name": "base_asset_reserve_before",
|
|
17651
|
-
"type": "u128"
|
|
17652
|
-
},
|
|
17653
|
-
{
|
|
17654
|
-
"name": "quote_asset_reserve_before",
|
|
17655
|
-
"type": "u128"
|
|
17656
|
-
},
|
|
17657
|
-
{
|
|
17658
|
-
"name": "sqrt_k_before",
|
|
17659
|
-
"type": "u128"
|
|
17660
|
-
},
|
|
17661
|
-
{
|
|
17662
|
-
"name": "peg_multiplier_after",
|
|
17663
|
-
"type": "u128"
|
|
17664
|
-
},
|
|
17665
|
-
{
|
|
17666
|
-
"name": "base_asset_reserve_after",
|
|
17667
|
-
"type": "u128"
|
|
17668
|
-
},
|
|
17669
|
-
{
|
|
17670
|
-
"name": "quote_asset_reserve_after",
|
|
17671
|
-
"type": "u128"
|
|
17672
|
-
},
|
|
17673
|
-
{
|
|
17674
|
-
"name": "sqrt_k_after",
|
|
17675
|
-
"type": "u128"
|
|
17676
|
-
},
|
|
17677
|
-
{
|
|
17678
|
-
"name": "base_asset_amount_long",
|
|
17679
|
-
"docs": [
|
|
17680
|
-
"precision: BASE_PRECISION"
|
|
17681
|
-
],
|
|
17682
|
-
"type": "u128"
|
|
17683
|
-
},
|
|
17684
|
-
{
|
|
17685
|
-
"name": "base_asset_amount_short",
|
|
17686
|
-
"docs": [
|
|
17687
|
-
"precision: BASE_PRECISION"
|
|
17688
|
-
],
|
|
17689
|
-
"type": "u128"
|
|
17690
|
-
},
|
|
17691
|
-
{
|
|
17692
|
-
"name": "base_asset_amount_with_amm",
|
|
17693
|
-
"docs": [
|
|
17694
|
-
"precision: BASE_PRECISION"
|
|
17695
|
-
],
|
|
17696
|
-
"type": "i128"
|
|
17697
|
-
},
|
|
17698
|
-
{
|
|
17699
|
-
"name": "total_fee",
|
|
17700
|
-
"docs": [
|
|
17701
|
-
"precision: QUOTE_PRECISION"
|
|
17702
|
-
],
|
|
17703
|
-
"type": "i128"
|
|
17704
|
-
},
|
|
17705
|
-
{
|
|
17706
|
-
"name": "total_fee_minus_distributions",
|
|
17707
|
-
"docs": [
|
|
17708
|
-
"precision: QUOTE_PRECISION"
|
|
17709
|
-
],
|
|
17710
|
-
"type": "i128"
|
|
17467
|
+
"name": "Speculative"
|
|
17711
17468
|
},
|
|
17712
17469
|
{
|
|
17713
|
-
"name": "
|
|
17714
|
-
"docs": [
|
|
17715
|
-
"precision: QUOTE_PRECISION"
|
|
17716
|
-
],
|
|
17717
|
-
"type": "i128"
|
|
17470
|
+
"name": "HighlySpeculative"
|
|
17718
17471
|
},
|
|
17719
17472
|
{
|
|
17720
|
-
"name": "
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
|
|
17473
|
+
"name": "Isolated"
|
|
17474
|
+
}
|
|
17475
|
+
]
|
|
17476
|
+
}
|
|
17477
|
+
},
|
|
17478
|
+
{
|
|
17479
|
+
"name": "ContractType",
|
|
17480
|
+
"type": {
|
|
17481
|
+
"kind": "enum",
|
|
17482
|
+
"variants": [
|
|
17726
17483
|
{
|
|
17727
|
-
"name": "
|
|
17728
|
-
"type": "u128"
|
|
17484
|
+
"name": "Perpetual"
|
|
17729
17485
|
},
|
|
17730
17486
|
{
|
|
17731
|
-
"name": "
|
|
17732
|
-
"type": "u32"
|
|
17487
|
+
"name": "DeprecatedFuture"
|
|
17733
17488
|
},
|
|
17734
17489
|
{
|
|
17735
|
-
"name": "
|
|
17736
|
-
"type": "u16"
|
|
17490
|
+
"name": "DeprecatedPrediction"
|
|
17737
17491
|
}
|
|
17738
17492
|
]
|
|
17739
17493
|
}
|
|
@@ -17966,11 +17720,16 @@
|
|
|
17966
17720
|
}
|
|
17967
17721
|
},
|
|
17968
17722
|
{
|
|
17969
|
-
"name": "
|
|
17723
|
+
"name": "flat_filler_fee",
|
|
17970
17724
|
"type": "u64"
|
|
17971
17725
|
},
|
|
17972
17726
|
{
|
|
17973
|
-
"name": "
|
|
17727
|
+
"name": "padding",
|
|
17728
|
+
"docs": [
|
|
17729
|
+
"Reserved padding. Kept so `size_of::<FeeStructure>()` stays a multiple of 16",
|
|
17730
|
+
"(OrderFillerRewardStructure's u128 forces 16-byte alignment on host x86_64);",
|
|
17731
|
+
"removing it would diverge host vs. SBF layout."
|
|
17732
|
+
],
|
|
17974
17733
|
"type": "u64"
|
|
17975
17734
|
}
|
|
17976
17735
|
]
|
|
@@ -18145,18 +17904,74 @@
|
|
|
18145
17904
|
"type": "u64"
|
|
18146
17905
|
},
|
|
18147
17906
|
{
|
|
18148
|
-
"name": "
|
|
17907
|
+
"name": "base_asset_amount_with_amm",
|
|
18149
17908
|
"docs": [
|
|
18150
|
-
"precision:
|
|
17909
|
+
"precision: BASE_PRECISION"
|
|
18151
17910
|
],
|
|
18152
|
-
"type": "
|
|
17911
|
+
"type": "i128"
|
|
17912
|
+
}
|
|
17913
|
+
]
|
|
17914
|
+
}
|
|
17915
|
+
},
|
|
17916
|
+
{
|
|
17917
|
+
"name": "HedgeConfig",
|
|
17918
|
+
"docs": [
|
|
17919
|
+
"Per-market configuration of a perp market's relationship to its hedge (LP)",
|
|
17920
|
+
"pool: which pool it routes to, whether hedging is enabled, which hedge",
|
|
17921
|
+
"operations are paused, and the fee-routing scalars. Admin-set; never mutated",
|
|
17922
|
+
"per fill. Embedded at the tail of `PerpMarket` next to `amm` so the whole VLP",
|
|
17923
|
+
"region is contiguous."
|
|
17924
|
+
],
|
|
17925
|
+
"serialization": "bytemuckunsafe",
|
|
17926
|
+
"repr": {
|
|
17927
|
+
"kind": "c"
|
|
17928
|
+
},
|
|
17929
|
+
"type": {
|
|
17930
|
+
"kind": "struct",
|
|
17931
|
+
"fields": [
|
|
17932
|
+
{
|
|
17933
|
+
"name": "pool_id",
|
|
17934
|
+
"docs": [
|
|
17935
|
+
"The LP pool this market hedges into (`LPPool.pool_id`)."
|
|
17936
|
+
],
|
|
17937
|
+
"type": "u8"
|
|
18153
17938
|
},
|
|
18154
17939
|
{
|
|
18155
|
-
"name": "
|
|
17940
|
+
"name": "status",
|
|
18156
17941
|
"docs": [
|
|
18157
|
-
"
|
|
17942
|
+
"Hedging enabled for this market; 0 disables it."
|
|
18158
17943
|
],
|
|
18159
|
-
"type": "
|
|
17944
|
+
"type": "u8"
|
|
17945
|
+
},
|
|
17946
|
+
{
|
|
17947
|
+
"name": "paused_operations",
|
|
17948
|
+
"docs": [
|
|
17949
|
+
"Bitflags of paused `ConstituentLpOperation`s."
|
|
17950
|
+
],
|
|
17951
|
+
"type": "u8"
|
|
17952
|
+
},
|
|
17953
|
+
{
|
|
17954
|
+
"name": "exchange_fee_exclusion_scalar",
|
|
17955
|
+
"docs": [
|
|
17956
|
+
"Scalar excluding a share of exchange fees from hedge routing."
|
|
17957
|
+
],
|
|
17958
|
+
"type": "u8"
|
|
17959
|
+
},
|
|
17960
|
+
{
|
|
17961
|
+
"name": "fee_transfer_scalar",
|
|
17962
|
+
"docs": [
|
|
17963
|
+
"Scalar for the share of fees transferred to the hedge pool."
|
|
17964
|
+
],
|
|
17965
|
+
"type": "u8"
|
|
17966
|
+
},
|
|
17967
|
+
{
|
|
17968
|
+
"name": "padding",
|
|
17969
|
+
"type": {
|
|
17970
|
+
"array": [
|
|
17971
|
+
"u8",
|
|
17972
|
+
11
|
|
17973
|
+
]
|
|
17974
|
+
}
|
|
18160
17975
|
}
|
|
18161
17976
|
]
|
|
18162
17977
|
}
|
|
@@ -19555,109 +19370,330 @@
|
|
|
19555
19370
|
}
|
|
19556
19371
|
},
|
|
19557
19372
|
{
|
|
19558
|
-
"name": "liquidate_borrow_for_perp_pnl",
|
|
19559
|
-
"type": {
|
|
19560
|
-
"defined": {
|
|
19561
|
-
"name": "LiquidateBorrowForPerpPnlRecord"
|
|
19562
|
-
}
|
|
19563
|
-
}
|
|
19373
|
+
"name": "liquidate_borrow_for_perp_pnl",
|
|
19374
|
+
"type": {
|
|
19375
|
+
"defined": {
|
|
19376
|
+
"name": "LiquidateBorrowForPerpPnlRecord"
|
|
19377
|
+
}
|
|
19378
|
+
}
|
|
19379
|
+
},
|
|
19380
|
+
{
|
|
19381
|
+
"name": "liquidate_perp_pnl_for_deposit",
|
|
19382
|
+
"type": {
|
|
19383
|
+
"defined": {
|
|
19384
|
+
"name": "LiquidatePerpPnlForDepositRecord"
|
|
19385
|
+
}
|
|
19386
|
+
}
|
|
19387
|
+
},
|
|
19388
|
+
{
|
|
19389
|
+
"name": "perp_bankruptcy",
|
|
19390
|
+
"type": {
|
|
19391
|
+
"defined": {
|
|
19392
|
+
"name": "PerpBankruptcyRecord"
|
|
19393
|
+
}
|
|
19394
|
+
}
|
|
19395
|
+
},
|
|
19396
|
+
{
|
|
19397
|
+
"name": "spot_bankruptcy",
|
|
19398
|
+
"type": {
|
|
19399
|
+
"defined": {
|
|
19400
|
+
"name": "SpotBankruptcyRecord"
|
|
19401
|
+
}
|
|
19402
|
+
}
|
|
19403
|
+
},
|
|
19404
|
+
{
|
|
19405
|
+
"name": "bit_flags",
|
|
19406
|
+
"type": "u8"
|
|
19407
|
+
}
|
|
19408
|
+
]
|
|
19409
|
+
}
|
|
19410
|
+
},
|
|
19411
|
+
{
|
|
19412
|
+
"name": "LiquidationType",
|
|
19413
|
+
"type": {
|
|
19414
|
+
"kind": "enum",
|
|
19415
|
+
"variants": [
|
|
19416
|
+
{
|
|
19417
|
+
"name": "LiquidatePerp"
|
|
19418
|
+
},
|
|
19419
|
+
{
|
|
19420
|
+
"name": "LiquidateSpot"
|
|
19421
|
+
},
|
|
19422
|
+
{
|
|
19423
|
+
"name": "LiquidateBorrowForPerpPnl"
|
|
19424
|
+
},
|
|
19425
|
+
{
|
|
19426
|
+
"name": "LiquidatePerpPnlForDeposit"
|
|
19427
|
+
},
|
|
19428
|
+
{
|
|
19429
|
+
"name": "PerpBankruptcy"
|
|
19430
|
+
},
|
|
19431
|
+
{
|
|
19432
|
+
"name": "SpotBankruptcy"
|
|
19433
|
+
}
|
|
19434
|
+
]
|
|
19435
|
+
}
|
|
19436
|
+
},
|
|
19437
|
+
{
|
|
19438
|
+
"name": "LpPoolParams",
|
|
19439
|
+
"type": {
|
|
19440
|
+
"kind": "struct",
|
|
19441
|
+
"fields": [
|
|
19442
|
+
{
|
|
19443
|
+
"name": "max_settle_quote_amount",
|
|
19444
|
+
"type": {
|
|
19445
|
+
"option": "u64"
|
|
19446
|
+
}
|
|
19447
|
+
},
|
|
19448
|
+
{
|
|
19449
|
+
"name": "volatility",
|
|
19450
|
+
"type": {
|
|
19451
|
+
"option": "u64"
|
|
19452
|
+
}
|
|
19453
|
+
},
|
|
19454
|
+
{
|
|
19455
|
+
"name": "gamma_execution",
|
|
19456
|
+
"type": {
|
|
19457
|
+
"option": "u8"
|
|
19458
|
+
}
|
|
19459
|
+
},
|
|
19460
|
+
{
|
|
19461
|
+
"name": "xi",
|
|
19462
|
+
"type": {
|
|
19463
|
+
"option": "u8"
|
|
19464
|
+
}
|
|
19465
|
+
},
|
|
19466
|
+
{
|
|
19467
|
+
"name": "max_aum",
|
|
19468
|
+
"type": {
|
|
19469
|
+
"option": "u128"
|
|
19470
|
+
}
|
|
19471
|
+
},
|
|
19472
|
+
{
|
|
19473
|
+
"name": "whitelist_mint",
|
|
19474
|
+
"type": {
|
|
19475
|
+
"option": "pubkey"
|
|
19476
|
+
}
|
|
19477
|
+
}
|
|
19478
|
+
]
|
|
19479
|
+
}
|
|
19480
|
+
},
|
|
19481
|
+
{
|
|
19482
|
+
"name": "MarketStats",
|
|
19483
|
+
"docs": [
|
|
19484
|
+
"Historic market data shared across all makers, updated on every fill",
|
|
19485
|
+
"regardless of which maker filled (vAMM, DLOB resting order, JIT participant,",
|
|
19486
|
+
"future quoter types). Holds mark/oracle TWAPs, rolling std, volume,",
|
|
19487
|
+
"intensity, mm-oracle snapshot, `historical_oracle_data`,",
|
|
19488
|
+
"`last_oracle_normalised_price`, `last_oracle_valid`.",
|
|
19489
|
+
"",
|
|
19490
|
+
"Update-cadence rule: anything that needs to refresh on every market event",
|
|
19491
|
+
"lives here. Anything AMM-private (reserves, peg, spreads — only matters",
|
|
19492
|
+
"when the AMM specifically is the counterparty) lives on `AMM`. See",
|
|
19493
|
+
"`docs/amm-decoupling-and-maker-interface.md`."
|
|
19494
|
+
],
|
|
19495
|
+
"serialization": "bytemuckunsafe",
|
|
19496
|
+
"repr": {
|
|
19497
|
+
"kind": "c"
|
|
19498
|
+
},
|
|
19499
|
+
"type": {
|
|
19500
|
+
"kind": "struct",
|
|
19501
|
+
"fields": [
|
|
19502
|
+
{
|
|
19503
|
+
"name": "last_mark_price_twap",
|
|
19504
|
+
"docs": [
|
|
19505
|
+
"Average estimate of (bid+ask)/2 price over funding_period.",
|
|
19506
|
+
"precision: PRICE_PRECISION"
|
|
19507
|
+
],
|
|
19508
|
+
"type": "u64"
|
|
19509
|
+
},
|
|
19510
|
+
{
|
|
19511
|
+
"name": "last_mark_price_twap_5min",
|
|
19512
|
+
"docs": [
|
|
19513
|
+
"Average estimate of (bid+ask)/2 price over FIVE_MINUTES."
|
|
19514
|
+
],
|
|
19515
|
+
"type": "u64"
|
|
19516
|
+
},
|
|
19517
|
+
{
|
|
19518
|
+
"name": "last_mark_price_twap_ts",
|
|
19519
|
+
"docs": [
|
|
19520
|
+
"The last unix_timestamp the mark twap was updated."
|
|
19521
|
+
],
|
|
19522
|
+
"type": "i64"
|
|
19523
|
+
},
|
|
19524
|
+
{
|
|
19525
|
+
"name": "last_bid_price_twap",
|
|
19526
|
+
"docs": [
|
|
19527
|
+
"Average estimate of bid price over funding_period.",
|
|
19528
|
+
"precision: PRICE_PRECISION"
|
|
19529
|
+
],
|
|
19530
|
+
"type": "u64"
|
|
19531
|
+
},
|
|
19532
|
+
{
|
|
19533
|
+
"name": "last_ask_price_twap",
|
|
19534
|
+
"docs": [
|
|
19535
|
+
"Average estimate of ask price over funding_period.",
|
|
19536
|
+
"precision: PRICE_PRECISION"
|
|
19537
|
+
],
|
|
19538
|
+
"type": "u64"
|
|
19539
|
+
},
|
|
19540
|
+
{
|
|
19541
|
+
"name": "mark_std",
|
|
19542
|
+
"docs": [
|
|
19543
|
+
"Estimate of standard deviation of fill (mark) prices.",
|
|
19544
|
+
"precision: PRICE_PRECISION"
|
|
19545
|
+
],
|
|
19546
|
+
"type": "u64"
|
|
19547
|
+
},
|
|
19548
|
+
{
|
|
19549
|
+
"name": "oracle_std",
|
|
19550
|
+
"docs": [
|
|
19551
|
+
"Estimate of standard deviation of the oracle price at each update.",
|
|
19552
|
+
"precision: PRICE_PRECISION"
|
|
19553
|
+
],
|
|
19554
|
+
"type": "u64"
|
|
19555
|
+
},
|
|
19556
|
+
{
|
|
19557
|
+
"name": "last_oracle_conf_pct",
|
|
19558
|
+
"docs": [
|
|
19559
|
+
"The pct size of the oracle confidence interval.",
|
|
19560
|
+
"precision: PERCENTAGE_PRECISION"
|
|
19561
|
+
],
|
|
19562
|
+
"type": "u64"
|
|
19564
19563
|
},
|
|
19565
19564
|
{
|
|
19566
|
-
"name": "
|
|
19567
|
-
"
|
|
19568
|
-
"
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19565
|
+
"name": "volume_24h",
|
|
19566
|
+
"docs": [
|
|
19567
|
+
"Estimated total of volume in market.",
|
|
19568
|
+
"QUOTE_PRECISION"
|
|
19569
|
+
],
|
|
19570
|
+
"type": "u64"
|
|
19572
19571
|
},
|
|
19573
19572
|
{
|
|
19574
|
-
"name": "
|
|
19575
|
-
"
|
|
19576
|
-
"
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
}
|
|
19573
|
+
"name": "long_intensity_volume",
|
|
19574
|
+
"docs": [
|
|
19575
|
+
"The volume intensity of long fills (across all makers)."
|
|
19576
|
+
],
|
|
19577
|
+
"type": "u64"
|
|
19580
19578
|
},
|
|
19581
19579
|
{
|
|
19582
|
-
"name": "
|
|
19583
|
-
"
|
|
19584
|
-
"
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
}
|
|
19580
|
+
"name": "short_intensity_volume",
|
|
19581
|
+
"docs": [
|
|
19582
|
+
"The volume intensity of short fills (across all makers)."
|
|
19583
|
+
],
|
|
19584
|
+
"type": "u64"
|
|
19588
19585
|
},
|
|
19589
19586
|
{
|
|
19590
|
-
"name": "
|
|
19591
|
-
"
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
},
|
|
19596
|
-
{
|
|
19597
|
-
"name": "LiquidationType",
|
|
19598
|
-
"type": {
|
|
19599
|
-
"kind": "enum",
|
|
19600
|
-
"variants": [
|
|
19601
|
-
{
|
|
19602
|
-
"name": "LiquidatePerp"
|
|
19587
|
+
"name": "last_trade_ts",
|
|
19588
|
+
"docs": [
|
|
19589
|
+
"The blockchain unix_timestamp at the time of the last trade."
|
|
19590
|
+
],
|
|
19591
|
+
"type": "i64"
|
|
19603
19592
|
},
|
|
19604
19593
|
{
|
|
19605
|
-
"name": "
|
|
19594
|
+
"name": "last_24h_avg_funding_rate",
|
|
19595
|
+
"docs": [
|
|
19596
|
+
"estimate of last 24h of funding rate perp market (unit is quote per base)",
|
|
19597
|
+
"Market-wide config / rolling stat — read by the AMM when computing",
|
|
19598
|
+
"`reference_price_offset` and by funding-rate updates. Migrated from",
|
|
19599
|
+
"`PerpMarket` so the AMM reads only from `MarketStats`.",
|
|
19600
|
+
"precision: QUOTE_PRECISION"
|
|
19601
|
+
],
|
|
19602
|
+
"type": "i64"
|
|
19606
19603
|
},
|
|
19607
19604
|
{
|
|
19608
|
-
"name": "
|
|
19605
|
+
"name": "funding_period",
|
|
19606
|
+
"docs": [
|
|
19607
|
+
"the periodicity of the funding rate updates. Market-wide config used",
|
|
19608
|
+
"across the funding path. Migrated from `PerpMarket`."
|
|
19609
|
+
],
|
|
19610
|
+
"type": "i64"
|
|
19609
19611
|
},
|
|
19610
19612
|
{
|
|
19611
|
-
"name": "
|
|
19613
|
+
"name": "min_order_size",
|
|
19614
|
+
"docs": [
|
|
19615
|
+
"the minimum base size of an order. Market-wide config read by the AMM",
|
|
19616
|
+
"when computing fallback prices / spread reserves. Migrated from",
|
|
19617
|
+
"`PerpMarket`.",
|
|
19618
|
+
"precision: BASE_PRECISION"
|
|
19619
|
+
],
|
|
19620
|
+
"type": "u64"
|
|
19612
19621
|
},
|
|
19613
19622
|
{
|
|
19614
|
-
"name": "
|
|
19623
|
+
"name": "mm_oracle_price",
|
|
19624
|
+
"docs": [
|
|
19625
|
+
"MM oracle price snapshot (set by the native handler)."
|
|
19626
|
+
],
|
|
19627
|
+
"type": "i64"
|
|
19615
19628
|
},
|
|
19616
19629
|
{
|
|
19617
|
-
"name": "
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
"name": "LpPoolParams",
|
|
19624
|
-
"type": {
|
|
19625
|
-
"kind": "struct",
|
|
19626
|
-
"fields": [
|
|
19630
|
+
"name": "mm_oracle_slot",
|
|
19631
|
+
"docs": [
|
|
19632
|
+
"Slot at which the mm_oracle_* fields were last updated."
|
|
19633
|
+
],
|
|
19634
|
+
"type": "u64"
|
|
19635
|
+
},
|
|
19627
19636
|
{
|
|
19628
|
-
"name": "
|
|
19629
|
-
"
|
|
19630
|
-
"
|
|
19631
|
-
|
|
19637
|
+
"name": "mm_oracle_sequence_id",
|
|
19638
|
+
"docs": [
|
|
19639
|
+
"Monotonically increasing sequence id for mm_oracle updates."
|
|
19640
|
+
],
|
|
19641
|
+
"type": "u64"
|
|
19632
19642
|
},
|
|
19633
19643
|
{
|
|
19634
|
-
"name": "
|
|
19635
|
-
"
|
|
19636
|
-
"
|
|
19637
|
-
|
|
19644
|
+
"name": "last_oracle_normalised_price",
|
|
19645
|
+
"docs": [
|
|
19646
|
+
"Canonical sanitised/clamped oracle price — the latest oracle reading",
|
|
19647
|
+
"after normalisation (any quoter's view, not AMM-specific)."
|
|
19648
|
+
],
|
|
19649
|
+
"type": "i64"
|
|
19638
19650
|
},
|
|
19639
19651
|
{
|
|
19640
|
-
"name": "
|
|
19641
|
-
"
|
|
19642
|
-
"
|
|
19643
|
-
|
|
19652
|
+
"name": "last_reference_price_offset",
|
|
19653
|
+
"docs": [
|
|
19654
|
+
"Previous reference price offset, written by `_update_amm` after a",
|
|
19655
|
+
"successful repeg/k_update. Read by `update_amm_quote_state` to",
|
|
19656
|
+
"implement the legacy time-decayed reference-price-offset smoothing",
|
|
19657
|
+
"transition — when the freshly computed offset's sign flips relative",
|
|
19658
|
+
"to this cached value AND `curve_update_intensity > 100`, the",
|
|
19659
|
+
"transition is clamped per-slot rather than snapping. Migrated from",
|
|
19660
|
+
"`AMM.reference_price_offset` (which was deleted in the AMM-decoupling",
|
|
19661
|
+
"refactor) so the smoothing behaviour is preserved across cranks.",
|
|
19662
|
+
"precision: PRICE_PRECISION"
|
|
19663
|
+
],
|
|
19664
|
+
"type": "i32"
|
|
19644
19665
|
},
|
|
19645
19666
|
{
|
|
19646
|
-
"name": "
|
|
19647
|
-
"
|
|
19648
|
-
"
|
|
19649
|
-
|
|
19667
|
+
"name": "last_oracle_valid",
|
|
19668
|
+
"docs": [
|
|
19669
|
+
"Whether the oracle was valid at the most recent `_update_amm`.",
|
|
19670
|
+
"Read by settlement and fill paths to gate operations."
|
|
19671
|
+
],
|
|
19672
|
+
"type": "bool"
|
|
19650
19673
|
},
|
|
19651
19674
|
{
|
|
19652
|
-
"name": "
|
|
19675
|
+
"name": "padding",
|
|
19676
|
+
"docs": [
|
|
19677
|
+
"Padding so historical_oracle_data is 8-aligned."
|
|
19678
|
+
],
|
|
19653
19679
|
"type": {
|
|
19654
|
-
"
|
|
19680
|
+
"array": [
|
|
19681
|
+
"u8",
|
|
19682
|
+
11
|
|
19683
|
+
]
|
|
19655
19684
|
}
|
|
19656
19685
|
},
|
|
19657
19686
|
{
|
|
19658
|
-
"name": "
|
|
19687
|
+
"name": "historical_oracle_data",
|
|
19688
|
+
"docs": [
|
|
19689
|
+
"Historical oracle readings — TWAPs, last raw price, confidence, delay,",
|
|
19690
|
+
"timestamp. Market-wide data (any quoter would want it), updated by",
|
|
19691
|
+
"`_update_amm` / funding paths. Migrated from AMM."
|
|
19692
|
+
],
|
|
19659
19693
|
"type": {
|
|
19660
|
-
"
|
|
19694
|
+
"defined": {
|
|
19695
|
+
"name": "HistoricalOracleData"
|
|
19696
|
+
}
|
|
19661
19697
|
}
|
|
19662
19698
|
}
|
|
19663
19699
|
]
|
|
@@ -20698,6 +20734,26 @@
|
|
|
20698
20734
|
"type": {
|
|
20699
20735
|
"option": "i64"
|
|
20700
20736
|
}
|
|
20737
|
+
},
|
|
20738
|
+
{
|
|
20739
|
+
"name": "builder_idx",
|
|
20740
|
+
"docs": [
|
|
20741
|
+
"the index into the placing user's RevenueShareEscrow.approved_builders list, if this order",
|
|
20742
|
+
"carries a builder code. Only honored for non-swift orders; swift orders carry the builder",
|
|
20743
|
+
"info in the signed message envelope instead."
|
|
20744
|
+
],
|
|
20745
|
+
"type": {
|
|
20746
|
+
"option": "u8"
|
|
20747
|
+
}
|
|
20748
|
+
},
|
|
20749
|
+
{
|
|
20750
|
+
"name": "builder_fee_tenth_bps",
|
|
20751
|
+
"docs": [
|
|
20752
|
+
"the builder fee on this order, in tenths of a bps, e.g. 100 = 0.01%"
|
|
20753
|
+
],
|
|
20754
|
+
"type": {
|
|
20755
|
+
"option": "u16"
|
|
20756
|
+
}
|
|
20701
20757
|
}
|
|
20702
20758
|
]
|
|
20703
20759
|
}
|
|
@@ -20843,58 +20899,156 @@
|
|
|
20843
20899
|
"type": "u16"
|
|
20844
20900
|
},
|
|
20845
20901
|
{
|
|
20846
|
-
"name": "pnl",
|
|
20902
|
+
"name": "pnl",
|
|
20903
|
+
"type": "i128"
|
|
20904
|
+
},
|
|
20905
|
+
{
|
|
20906
|
+
"name": "if_payment",
|
|
20907
|
+
"type": "u128"
|
|
20908
|
+
},
|
|
20909
|
+
{
|
|
20910
|
+
"name": "clawback_user",
|
|
20911
|
+
"type": {
|
|
20912
|
+
"option": "pubkey"
|
|
20913
|
+
}
|
|
20914
|
+
},
|
|
20915
|
+
{
|
|
20916
|
+
"name": "clawback_user_payment",
|
|
20917
|
+
"type": {
|
|
20918
|
+
"option": "u128"
|
|
20919
|
+
}
|
|
20920
|
+
},
|
|
20921
|
+
{
|
|
20922
|
+
"name": "cumulative_funding_rate_delta",
|
|
20923
|
+
"type": "i128"
|
|
20924
|
+
}
|
|
20925
|
+
]
|
|
20926
|
+
}
|
|
20927
|
+
},
|
|
20928
|
+
{
|
|
20929
|
+
"name": "PerpMarket",
|
|
20930
|
+
"serialization": "bytemuckunsafe",
|
|
20931
|
+
"repr": {
|
|
20932
|
+
"kind": "c"
|
|
20933
|
+
},
|
|
20934
|
+
"type": {
|
|
20935
|
+
"kind": "struct",
|
|
20936
|
+
"fields": [
|
|
20937
|
+
{
|
|
20938
|
+
"name": "pubkey",
|
|
20939
|
+
"docs": [
|
|
20940
|
+
"The perp market's address. It is a pda of the market index"
|
|
20941
|
+
],
|
|
20942
|
+
"type": "pubkey"
|
|
20943
|
+
},
|
|
20944
|
+
{
|
|
20945
|
+
"name": "base_asset_amount_long",
|
|
20946
|
+
"docs": [
|
|
20947
|
+
"always non-negative. tracks number of total longs in market (regardless of counterparty)",
|
|
20948
|
+
"precision: BASE_PRECISION"
|
|
20949
|
+
],
|
|
20950
|
+
"type": "i128"
|
|
20951
|
+
},
|
|
20952
|
+
{
|
|
20953
|
+
"name": "base_asset_amount_short",
|
|
20954
|
+
"docs": [
|
|
20955
|
+
"always non-positive. tracks number of total shorts in market (regardless of counterparty)",
|
|
20956
|
+
"precision: BASE_PRECISION"
|
|
20957
|
+
],
|
|
20958
|
+
"type": "i128"
|
|
20959
|
+
},
|
|
20960
|
+
{
|
|
20961
|
+
"name": "quote_asset_amount",
|
|
20962
|
+
"docs": [
|
|
20963
|
+
"sum of all user's perp quote_asset_amount in market",
|
|
20964
|
+
"precision: QUOTE_PRECISION"
|
|
20965
|
+
],
|
|
20966
|
+
"type": "i128"
|
|
20967
|
+
},
|
|
20968
|
+
{
|
|
20969
|
+
"name": "quote_entry_amount_long",
|
|
20970
|
+
"docs": [
|
|
20971
|
+
"sum of all long user's quote_entry_amount in market",
|
|
20972
|
+
"precision: QUOTE_PRECISION"
|
|
20973
|
+
],
|
|
20974
|
+
"type": "i128"
|
|
20975
|
+
},
|
|
20976
|
+
{
|
|
20977
|
+
"name": "quote_entry_amount_short",
|
|
20978
|
+
"docs": [
|
|
20979
|
+
"sum of all short user's quote_entry_amount in market",
|
|
20980
|
+
"precision: QUOTE_PRECISION"
|
|
20981
|
+
],
|
|
20982
|
+
"type": "i128"
|
|
20983
|
+
},
|
|
20984
|
+
{
|
|
20985
|
+
"name": "quote_break_even_amount_long",
|
|
20986
|
+
"docs": [
|
|
20987
|
+
"sum of all long user's quote_break_even_amount in market",
|
|
20988
|
+
"precision: QUOTE_PRECISION"
|
|
20989
|
+
],
|
|
20990
|
+
"type": "i128"
|
|
20991
|
+
},
|
|
20992
|
+
{
|
|
20993
|
+
"name": "quote_break_even_amount_short",
|
|
20994
|
+
"docs": [
|
|
20995
|
+
"sum of all short user's quote_break_even_amount in market",
|
|
20996
|
+
"precision: QUOTE_PRECISION"
|
|
20997
|
+
],
|
|
20847
20998
|
"type": "i128"
|
|
20848
20999
|
},
|
|
20849
21000
|
{
|
|
20850
|
-
"name": "
|
|
21001
|
+
"name": "max_open_interest",
|
|
21002
|
+
"docs": [
|
|
21003
|
+
"max allowed open interest, blocks trades that breach this value",
|
|
21004
|
+
"precision: BASE_PRECISION"
|
|
21005
|
+
],
|
|
20851
21006
|
"type": "u128"
|
|
20852
21007
|
},
|
|
20853
21008
|
{
|
|
20854
|
-
"name": "
|
|
20855
|
-
"
|
|
20856
|
-
"
|
|
20857
|
-
|
|
21009
|
+
"name": "total_social_loss",
|
|
21010
|
+
"docs": [
|
|
21011
|
+
"accumulated social loss paid by users since inception in market",
|
|
21012
|
+
"precision: QUOTE_PRECISION"
|
|
21013
|
+
],
|
|
21014
|
+
"type": "u128"
|
|
20858
21015
|
},
|
|
20859
21016
|
{
|
|
20860
|
-
"name": "
|
|
20861
|
-
"
|
|
20862
|
-
"
|
|
20863
|
-
|
|
21017
|
+
"name": "cumulative_funding_rate_long",
|
|
21018
|
+
"docs": [
|
|
21019
|
+
"accumulated funding rate for longs since inception in market"
|
|
21020
|
+
],
|
|
21021
|
+
"type": "i128"
|
|
20864
21022
|
},
|
|
20865
21023
|
{
|
|
20866
|
-
"name": "
|
|
21024
|
+
"name": "cumulative_funding_rate_short",
|
|
21025
|
+
"docs": [
|
|
21026
|
+
"accumulated funding rate for shorts since inception in market"
|
|
21027
|
+
],
|
|
20867
21028
|
"type": "i128"
|
|
20868
|
-
}
|
|
20869
|
-
]
|
|
20870
|
-
}
|
|
20871
|
-
},
|
|
20872
|
-
{
|
|
20873
|
-
"name": "PerpMarket",
|
|
20874
|
-
"serialization": "bytemuckunsafe",
|
|
20875
|
-
"repr": {
|
|
20876
|
-
"kind": "c"
|
|
20877
|
-
},
|
|
20878
|
-
"type": {
|
|
20879
|
-
"kind": "struct",
|
|
20880
|
-
"fields": [
|
|
21029
|
+
},
|
|
20881
21030
|
{
|
|
20882
|
-
"name": "
|
|
21031
|
+
"name": "total_exchange_fee",
|
|
20883
21032
|
"docs": [
|
|
20884
|
-
"
|
|
21033
|
+
"total fees collected by exchange fee schedule",
|
|
21034
|
+
"precision: QUOTE_PRECISION"
|
|
20885
21035
|
],
|
|
20886
|
-
"type": "
|
|
21036
|
+
"type": "u128"
|
|
20887
21037
|
},
|
|
20888
21038
|
{
|
|
20889
|
-
"name": "
|
|
21039
|
+
"name": "total_liquidation_fee",
|
|
20890
21040
|
"docs": [
|
|
20891
|
-
"
|
|
21041
|
+
"all fees collected by market for liquidations",
|
|
21042
|
+
"precision: QUOTE_PRECISION"
|
|
20892
21043
|
],
|
|
20893
|
-
"type":
|
|
20894
|
-
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
21044
|
+
"type": "u128"
|
|
21045
|
+
},
|
|
21046
|
+
{
|
|
21047
|
+
"name": "oracle",
|
|
21048
|
+
"docs": [
|
|
21049
|
+
"oracle price data public key"
|
|
21050
|
+
],
|
|
21051
|
+
"type": "pubkey"
|
|
20898
21052
|
},
|
|
20899
21053
|
{
|
|
20900
21054
|
"name": "pnl_pool",
|
|
@@ -20931,6 +21085,67 @@
|
|
|
20931
21085
|
}
|
|
20932
21086
|
}
|
|
20933
21087
|
},
|
|
21088
|
+
{
|
|
21089
|
+
"name": "last_funding_rate",
|
|
21090
|
+
"docs": [
|
|
21091
|
+
"last funding rate in this perp market (unit is quote per base)",
|
|
21092
|
+
"precision: FUNDING_RATE_PRECISION"
|
|
21093
|
+
],
|
|
21094
|
+
"type": "i64"
|
|
21095
|
+
},
|
|
21096
|
+
{
|
|
21097
|
+
"name": "last_funding_rate_long",
|
|
21098
|
+
"docs": [
|
|
21099
|
+
"last funding rate for longs in this perp market (unit is quote per base)",
|
|
21100
|
+
"precision: FUNDING_RATE_PRECISION"
|
|
21101
|
+
],
|
|
21102
|
+
"type": "i64"
|
|
21103
|
+
},
|
|
21104
|
+
{
|
|
21105
|
+
"name": "last_funding_rate_short",
|
|
21106
|
+
"docs": [
|
|
21107
|
+
"last funding rate for shorts in this perp market (unit is quote per base)",
|
|
21108
|
+
"precision: QUOTE_PRECISION"
|
|
21109
|
+
],
|
|
21110
|
+
"type": "i64"
|
|
21111
|
+
},
|
|
21112
|
+
{
|
|
21113
|
+
"name": "last_funding_rate_ts",
|
|
21114
|
+
"docs": [
|
|
21115
|
+
"the last funding rate update unix_timestamp"
|
|
21116
|
+
],
|
|
21117
|
+
"type": "i64"
|
|
21118
|
+
},
|
|
21119
|
+
{
|
|
21120
|
+
"name": "net_unsettled_funding_pnl",
|
|
21121
|
+
"docs": [
|
|
21122
|
+
"unsettled funding pnl across the market (protocol-wide)"
|
|
21123
|
+
],
|
|
21124
|
+
"type": "i64"
|
|
21125
|
+
},
|
|
21126
|
+
{
|
|
21127
|
+
"name": "last_funding_oracle_twap",
|
|
21128
|
+
"docs": [
|
|
21129
|
+
"oracle TWAP captured at last funding update"
|
|
21130
|
+
],
|
|
21131
|
+
"type": "i64"
|
|
21132
|
+
},
|
|
21133
|
+
{
|
|
21134
|
+
"name": "order_step_size",
|
|
21135
|
+
"docs": [
|
|
21136
|
+
"the base step size (increment) of orders",
|
|
21137
|
+
"precision: BASE_PRECISION"
|
|
21138
|
+
],
|
|
21139
|
+
"type": "u64"
|
|
21140
|
+
},
|
|
21141
|
+
{
|
|
21142
|
+
"name": "order_tick_size",
|
|
21143
|
+
"docs": [
|
|
21144
|
+
"the price tick size of orders",
|
|
21145
|
+
"precision: PRICE_PRECISION"
|
|
21146
|
+
],
|
|
21147
|
+
"type": "u64"
|
|
21148
|
+
},
|
|
20934
21149
|
{
|
|
20935
21150
|
"name": "unrealized_pnl_max_imbalance",
|
|
20936
21151
|
"docs": [
|
|
@@ -20970,13 +21185,6 @@
|
|
|
20970
21185
|
],
|
|
20971
21186
|
"type": "u64"
|
|
20972
21187
|
},
|
|
20973
|
-
{
|
|
20974
|
-
"name": "next_curve_record_id",
|
|
20975
|
-
"docs": [
|
|
20976
|
-
"Every amm k updated has a record id. This is the next id to be used"
|
|
20977
|
-
],
|
|
20978
|
-
"type": "u64"
|
|
20979
|
-
},
|
|
20980
21188
|
{
|
|
20981
21189
|
"name": "imf_factor",
|
|
20982
21190
|
"docs": [
|
|
@@ -21117,6 +21325,21 @@
|
|
|
21117
21325
|
],
|
|
21118
21326
|
"type": "i16"
|
|
21119
21327
|
},
|
|
21328
|
+
{
|
|
21329
|
+
"name": "_padding_align_lfp",
|
|
21330
|
+
"docs": [
|
|
21331
|
+
"Explicit padding so the IDL records the 6 bytes the Rust compiler",
|
|
21332
|
+
"inserts to 8-align `last_fill_price`. Without this the JS borsh",
|
|
21333
|
+
"decoder (which reads sequentially after the variable-span enum",
|
|
21334
|
+
"`status`) reads every field past `fee_adjustment` 6 bytes early."
|
|
21335
|
+
],
|
|
21336
|
+
"type": {
|
|
21337
|
+
"array": [
|
|
21338
|
+
"u8",
|
|
21339
|
+
6
|
|
21340
|
+
]
|
|
21341
|
+
}
|
|
21342
|
+
},
|
|
21120
21343
|
{
|
|
21121
21344
|
"name": "last_fill_price",
|
|
21122
21345
|
"type": "u64"
|
|
@@ -21135,37 +21358,122 @@
|
|
|
21135
21358
|
}
|
|
21136
21359
|
},
|
|
21137
21360
|
{
|
|
21138
|
-
"name": "
|
|
21139
|
-
"
|
|
21361
|
+
"name": "_padding_hedge",
|
|
21362
|
+
"docs": [
|
|
21363
|
+
"Was `lp_fee_transfer_scalar`, `lp_status`, `lp_paused_operations`,",
|
|
21364
|
+
"`lp_exchange_fee_excluscion_scalar`, `lp_pool_id` (5×u8). Relocated into",
|
|
21365
|
+
"`hedge_config` at the tail; kept as reserved bytes so existing account",
|
|
21366
|
+
"byte offsets (and snapshots) are undisturbed."
|
|
21367
|
+
],
|
|
21368
|
+
"type": {
|
|
21369
|
+
"array": [
|
|
21370
|
+
"u8",
|
|
21371
|
+
5
|
|
21372
|
+
]
|
|
21373
|
+
}
|
|
21140
21374
|
},
|
|
21141
21375
|
{
|
|
21142
|
-
"name": "
|
|
21376
|
+
"name": "market_config",
|
|
21143
21377
|
"type": "u8"
|
|
21144
21378
|
},
|
|
21145
21379
|
{
|
|
21146
|
-
"name": "
|
|
21147
|
-
"
|
|
21380
|
+
"name": "oracle_source",
|
|
21381
|
+
"docs": [
|
|
21382
|
+
"the oracle provider information. used to decode/scale the oracle public key"
|
|
21383
|
+
],
|
|
21384
|
+
"type": {
|
|
21385
|
+
"defined": {
|
|
21386
|
+
"name": "OracleSource"
|
|
21387
|
+
}
|
|
21388
|
+
}
|
|
21148
21389
|
},
|
|
21149
21390
|
{
|
|
21150
|
-
"name": "
|
|
21151
|
-
"
|
|
21391
|
+
"name": "oracle_slot_delay_override",
|
|
21392
|
+
"docs": [
|
|
21393
|
+
"override for the per-fill slot delay required from the oracle (default -1 = use state default)"
|
|
21394
|
+
],
|
|
21395
|
+
"type": "i8"
|
|
21152
21396
|
},
|
|
21153
21397
|
{
|
|
21154
|
-
"name": "
|
|
21155
|
-
"
|
|
21398
|
+
"name": "oracle_low_risk_slot_delay_override",
|
|
21399
|
+
"docs": [
|
|
21400
|
+
"the override for the state.min_perp_auction_duration",
|
|
21401
|
+
"0 is no override, -1 is disable speed bump, 1-100 is literal speed bump"
|
|
21402
|
+
],
|
|
21403
|
+
"type": "i8"
|
|
21156
21404
|
},
|
|
21157
21405
|
{
|
|
21158
|
-
"name": "
|
|
21159
|
-
"
|
|
21406
|
+
"name": "padding",
|
|
21407
|
+
"docs": [
|
|
21408
|
+
"Trailing padding so `market_stats` lands at the offset Rust naturally",
|
|
21409
|
+
"computes via `repr(C)` alignment and the `(SIZE - 8) % 16 == 0`",
|
|
21410
|
+
"invariant holds. Bumped to 36 bytes (was 28) when `next_curve_record_id`",
|
|
21411
|
+
"was removed."
|
|
21412
|
+
],
|
|
21413
|
+
"type": {
|
|
21414
|
+
"array": [
|
|
21415
|
+
"u8",
|
|
21416
|
+
36
|
|
21417
|
+
]
|
|
21418
|
+
}
|
|
21160
21419
|
},
|
|
21161
21420
|
{
|
|
21162
|
-
"name": "
|
|
21421
|
+
"name": "market_stats",
|
|
21422
|
+
"docs": [
|
|
21423
|
+
"Market-wide stats shared across all makers: mark/oracle TWAPs, std,",
|
|
21424
|
+
"volume, intensity, mm-oracle snapshot, `historical_oracle_data`,",
|
|
21425
|
+
"`last_oracle_normalised_price`, `last_oracle_valid`. Writers (e.g.",
|
|
21426
|
+
"`MarketStats::update_mark_std`, `update_volume_24h`, native",
|
|
21427
|
+
"`handle_update_mm_oracle_native`) update this directly."
|
|
21428
|
+
],
|
|
21429
|
+
"type": {
|
|
21430
|
+
"defined": {
|
|
21431
|
+
"name": "MarketStats"
|
|
21432
|
+
}
|
|
21433
|
+
}
|
|
21434
|
+
},
|
|
21435
|
+
{
|
|
21436
|
+
"name": "_padding_align_amm",
|
|
21437
|
+
"docs": [
|
|
21438
|
+
"8 bytes of explicit padding so MarketStats (216 bytes) plus this",
|
|
21439
|
+
"padding equals 224 bytes — the offset Rust naturally inserts to",
|
|
21440
|
+
"16-align AMM's leading u128. Making it explicit keeps the IDL byte",
|
|
21441
|
+
"layout aligned with `repr(C)`."
|
|
21442
|
+
],
|
|
21163
21443
|
"type": {
|
|
21164
21444
|
"array": [
|
|
21165
21445
|
"u8",
|
|
21166
|
-
|
|
21446
|
+
8
|
|
21167
21447
|
]
|
|
21168
21448
|
}
|
|
21449
|
+
},
|
|
21450
|
+
{
|
|
21451
|
+
"name": "amm",
|
|
21452
|
+
"docs": [
|
|
21453
|
+
"The automated market maker. Last field so future quoter modules can",
|
|
21454
|
+
"land in the trailing region without disturbing earlier byte offsets",
|
|
21455
|
+
"— in the target architecture this account holds back-to-back",
|
|
21456
|
+
"per-quoter state slices (AMM, DLOB-maker state, future propAMM-style",
|
|
21457
|
+
"participants, …) and each module owns a contiguous span starting at",
|
|
21458
|
+
"a known offset."
|
|
21459
|
+
],
|
|
21460
|
+
"type": {
|
|
21461
|
+
"defined": {
|
|
21462
|
+
"name": "AMM"
|
|
21463
|
+
}
|
|
21464
|
+
}
|
|
21465
|
+
},
|
|
21466
|
+
{
|
|
21467
|
+
"name": "hedge_config",
|
|
21468
|
+
"docs": [
|
|
21469
|
+
"This market's hedge (LP pool) configuration. Sits immediately after `amm`",
|
|
21470
|
+
"so the trailing `[amm, hedge_config]` span is the contiguous VLP region."
|
|
21471
|
+
],
|
|
21472
|
+
"type": {
|
|
21473
|
+
"defined": {
|
|
21474
|
+
"name": "HedgeConfig"
|
|
21475
|
+
}
|
|
21476
|
+
}
|
|
21169
21477
|
}
|
|
21170
21478
|
]
|
|
21171
21479
|
}
|
|
@@ -21573,28 +21881,12 @@
|
|
|
21573
21881
|
"name": "referrer",
|
|
21574
21882
|
"type": "pubkey"
|
|
21575
21883
|
},
|
|
21576
|
-
{
|
|
21577
|
-
"name": "referrer_boost_expire_ts",
|
|
21578
|
-
"type": "u32"
|
|
21579
|
-
},
|
|
21580
|
-
{
|
|
21581
|
-
"name": "referrer_reward_offset",
|
|
21582
|
-
"type": "i8"
|
|
21583
|
-
},
|
|
21584
|
-
{
|
|
21585
|
-
"name": "referee_fee_numerator_offset",
|
|
21586
|
-
"type": "i8"
|
|
21587
|
-
},
|
|
21588
|
-
{
|
|
21589
|
-
"name": "referrer_boost_numerator",
|
|
21590
|
-
"type": "i8"
|
|
21591
|
-
},
|
|
21592
21884
|
{
|
|
21593
21885
|
"name": "reserved_fixed",
|
|
21594
21886
|
"type": {
|
|
21595
21887
|
"array": [
|
|
21596
21888
|
"u8",
|
|
21597
|
-
|
|
21889
|
+
24
|
|
21598
21890
|
]
|
|
21599
21891
|
}
|
|
21600
21892
|
},
|
|
@@ -23718,22 +24010,6 @@
|
|
|
23718
24010
|
"precision: QUOTE_PRECISION"
|
|
23719
24011
|
],
|
|
23720
24012
|
"type": "u64"
|
|
23721
|
-
},
|
|
23722
|
-
{
|
|
23723
|
-
"name": "total_referrer_reward",
|
|
23724
|
-
"docs": [
|
|
23725
|
-
"Total reward to referrer",
|
|
23726
|
-
"precision: QUOTE_PRECISION"
|
|
23727
|
-
],
|
|
23728
|
-
"type": "u64"
|
|
23729
|
-
},
|
|
23730
|
-
{
|
|
23731
|
-
"name": "current_epoch_referrer_reward",
|
|
23732
|
-
"docs": [
|
|
23733
|
-
"Total reward to referrer this epoch",
|
|
23734
|
-
"precision: QUOTE_PRECISION"
|
|
23735
|
-
],
|
|
23736
|
-
"type": "u64"
|
|
23737
24013
|
}
|
|
23738
24014
|
]
|
|
23739
24015
|
}
|
|
@@ -23772,14 +24048,6 @@
|
|
|
23772
24048
|
}
|
|
23773
24049
|
}
|
|
23774
24050
|
},
|
|
23775
|
-
{
|
|
23776
|
-
"name": "next_epoch_ts",
|
|
23777
|
-
"docs": [
|
|
23778
|
-
"The timestamp of the next epoch",
|
|
23779
|
-
"Epoch is used to limit referrer rewards earned in single epoch"
|
|
23780
|
-
],
|
|
23781
|
-
"type": "i64"
|
|
23782
|
-
},
|
|
23783
24051
|
{
|
|
23784
24052
|
"name": "maker_volume_30d",
|
|
23785
24053
|
"docs": [
|
|
@@ -23871,12 +24139,19 @@
|
|
|
23871
24139
|
],
|
|
23872
24140
|
"type": "u64"
|
|
23873
24141
|
},
|
|
24142
|
+
{
|
|
24143
|
+
"name": "delegate_permissions",
|
|
24144
|
+
"docs": [
|
|
24145
|
+
"Delegate permissions across all sub accounts"
|
|
24146
|
+
],
|
|
24147
|
+
"type": "u8"
|
|
24148
|
+
},
|
|
23874
24149
|
{
|
|
23875
24150
|
"name": "padding",
|
|
23876
24151
|
"type": {
|
|
23877
24152
|
"array": [
|
|
23878
24153
|
"u8",
|
|
23879
|
-
|
|
24154
|
+
63
|
|
23880
24155
|
]
|
|
23881
24156
|
}
|
|
23882
24157
|
}
|
|
@@ -23913,7 +24188,7 @@
|
|
|
23913
24188
|
{
|
|
23914
24189
|
"name": "_SignedMsgOrderParamsExport",
|
|
23915
24190
|
"docs": [
|
|
23916
|
-
"unusued placeholder event to force include signed msg types into
|
|
24191
|
+
"unusued placeholder event to force include signed msg types into velocity IDL"
|
|
23917
24192
|
],
|
|
23918
24193
|
"type": {
|
|
23919
24194
|
"kind": "struct",
|