@velocity-exchange/sdk 0.1.0 → 0.2.1
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/CHANGELOG.md +4 -32
- package/lib/browser/accounts/basicUserAccountSubscriber.d.ts +5 -3
- package/lib/browser/accounts/basicUserAccountSubscriber.js +4 -3
- package/lib/browser/accounts/basicUserStatsAccountSubscriber.d.ts +5 -3
- package/lib/browser/accounts/basicUserStatsAccountSubscriber.js +4 -3
- package/lib/browser/accounts/bulkAccountLoader.d.ts +5 -5
- package/lib/browser/accounts/bulkAccountLoader.js +12 -1
- package/lib/browser/accounts/grpcAccountSubscriber.d.ts +2 -1
- package/lib/browser/accounts/grpcAccountSubscriber.js +8 -2
- package/lib/browser/accounts/grpcMultiAccountSubscriber.d.ts +3 -2
- package/lib/browser/accounts/grpcMultiAccountSubscriber.js +13 -5
- package/lib/browser/accounts/grpcMultiUserAccountSubscriber.d.ts +2 -1
- package/lib/browser/accounts/grpcMultiUserAccountSubscriber.js +12 -8
- package/lib/browser/accounts/grpcProgramAccountSubscriber.d.ts +2 -1
- package/lib/browser/accounts/grpcProgramAccountSubscriber.js +8 -2
- package/lib/browser/accounts/grpcVelocityClientAccountSubscriber.js +18 -3
- package/lib/browser/accounts/grpcVelocityClientAccountSubscriberV2.d.ts +1 -1
- package/lib/browser/accounts/grpcVelocityClientAccountSubscriberV2.js +40 -17
- package/lib/browser/accounts/laserProgramAccountSubscriber.js +3 -0
- package/lib/browser/accounts/oneShotUserAccountSubscriber.js +4 -3
- package/lib/browser/accounts/oneShotUserStatsAccountSubscriber.js +7 -3
- package/lib/browser/accounts/pollingInsuranceFundStakeAccountSubscriber.d.ts +4 -2
- package/lib/browser/accounts/pollingInsuranceFundStakeAccountSubscriber.js +3 -3
- package/lib/browser/accounts/pollingOracleAccountSubscriber.d.ts +0 -2
- package/lib/browser/accounts/pollingOracleAccountSubscriber.js +16 -5
- package/lib/browser/accounts/pollingTokenAccountSubscriber.d.ts +0 -2
- package/lib/browser/accounts/pollingTokenAccountSubscriber.js +16 -5
- package/lib/browser/accounts/pollingUserAccountSubscriber.d.ts +8 -4
- package/lib/browser/accounts/pollingUserAccountSubscriber.js +17 -11
- package/lib/browser/accounts/pollingUserStatsAccountSubscriber.d.ts +4 -2
- package/lib/browser/accounts/pollingUserStatsAccountSubscriber.js +6 -6
- package/lib/browser/accounts/pollingVelocityClientAccountSubscriber.d.ts +7 -1
- package/lib/browser/accounts/pollingVelocityClientAccountSubscriber.js +64 -28
- package/lib/browser/accounts/types.d.ts +4 -4
- package/lib/browser/accounts/utils.d.ts +1 -0
- package/lib/browser/accounts/utils.js +8 -1
- package/lib/browser/accounts/webSocketAccountSubscriber.d.ts +4 -2
- package/lib/browser/accounts/webSocketAccountSubscriber.js +17 -5
- package/lib/browser/accounts/webSocketAccountSubscriberV2.d.ts +4 -2
- package/lib/browser/accounts/webSocketAccountSubscriberV2.js +17 -6
- package/lib/browser/accounts/webSocketInsuranceFundStakeAccountSubscriber.d.ts +4 -2
- package/lib/browser/accounts/webSocketInsuranceFundStakeAccountSubscriber.js +9 -0
- package/lib/browser/accounts/webSocketProgramAccountSubscriber.d.ts +3 -1
- package/lib/browser/accounts/webSocketProgramAccountSubscriber.js +14 -3
- package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.d.ts +3 -1
- package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.js +15 -3
- package/lib/browser/accounts/webSocketProgramAccountsSubscriberV2.d.ts +3 -1
- package/lib/browser/accounts/webSocketProgramAccountsSubscriberV2.js +14 -4
- package/lib/browser/accounts/webSocketUserAccountSubscriber.d.ts +4 -2
- package/lib/browser/accounts/webSocketUserAccountSubscriber.js +9 -0
- package/lib/browser/accounts/webSocketUserStatsAccountSubsriber.d.ts +4 -2
- package/lib/browser/accounts/webSocketUserStatsAccountSubsriber.js +9 -0
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriber.d.ts +4 -4
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriber.js +48 -20
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts +7 -3
- package/lib/browser/accounts/webSocketVelocityClientAccountSubscriberV2.js +45 -14
- package/lib/browser/accounts/websocketProgramUserAccountSubscriber.d.ts +1 -1
- package/lib/browser/accounts/websocketProgramUserAccountSubscriber.js +0 -3
- package/lib/browser/addresses/marketAddresses.js +3 -2
- package/lib/browser/addresses/pda.d.ts +0 -2
- package/lib/browser/addresses/pda.js +1 -14
- package/lib/browser/adminClient.d.ts +24 -29
- package/lib/browser/adminClient.js +156 -157
- package/lib/browser/auctionSubscriber/auctionSubscriber.d.ts +1 -1
- package/lib/browser/auctionSubscriber/auctionSubscriber.js +6 -4
- package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.d.ts +1 -1
- package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.js +9 -4
- package/lib/browser/bankrun/bankrunConnection.d.ts +8 -5
- package/lib/browser/bankrun/bankrunConnection.js +92 -32
- package/lib/browser/blockhashSubscriber/BlockhashSubscriber.d.ts +1 -1
- package/lib/browser/blockhashSubscriber/BlockhashSubscriber.js +3 -2
- package/lib/browser/clock/clockSubscriber.d.ts +6 -6
- package/lib/browser/clock/clockSubscriber.js +4 -3
- package/lib/browser/config.d.ts +1 -1
- package/lib/browser/config.js +8 -4
- package/lib/browser/constants/index.d.ts +1 -2
- package/lib/browser/constants/index.js +1 -2
- package/lib/browser/constants/numericConstants.d.ts +1 -2
- package/lib/browser/constants/numericConstants.js +7 -5
- package/lib/browser/constants/spotMarkets.d.ts +0 -1
- package/lib/browser/constituentMap/constituentMap.js +5 -1
- package/lib/browser/constituentMap/pollingConstituentAccountSubscriber.js +3 -2
- package/lib/browser/constituentMap/webSocketConstituentAccountSubscriber.d.ts +2 -3
- package/lib/browser/constituentMap/webSocketConstituentAccountSubscriber.js +10 -3
- package/lib/browser/core/VelocityCore.d.ts +0 -1
- package/lib/browser/core/instructions/deposit.d.ts +0 -1
- package/lib/browser/core/instructions/perpOrders.d.ts +14 -0
- package/lib/browser/core/instructions/perpOrders.js +14 -0
- package/lib/browser/core/instructions/withdraw.d.ts +0 -1
- package/lib/browser/core/remainingAccounts.d.ts +2 -2
- package/lib/browser/core/remainingAccounts.js +2 -2
- package/lib/browser/decode/user.js +9 -1
- package/lib/browser/dlob/DLOB.d.ts +6 -2
- package/lib/browser/dlob/DLOB.js +201 -138
- package/lib/browser/dlob/DLOBNode.d.ts +5 -3
- package/lib/browser/dlob/DLOBNode.js +7 -0
- package/lib/browser/dlob/DLOBSubscriber.d.ts +0 -1
- package/lib/browser/dlob/DLOBSubscriber.js +37 -32
- package/lib/browser/dlob/NodeList.d.ts +0 -1
- package/lib/browser/dlob/NodeList.js +8 -7
- package/lib/browser/dlob/orderBookLevels.d.ts +0 -1
- package/lib/browser/dlob/orderBookLevels.js +19 -12
- package/lib/browser/events/eventList.d.ts +3 -3
- package/lib/browser/events/eventList.js +4 -1
- package/lib/browser/events/eventSubscriber.d.ts +5 -2
- package/lib/browser/events/eventSubscriber.js +75 -26
- package/lib/browser/events/eventsServerLogProvider.d.ts +2 -2
- package/lib/browser/events/eventsServerLogProvider.js +15 -8
- package/lib/browser/events/fetchLogs.d.ts +1 -1
- package/lib/browser/events/fetchLogs.js +4 -2
- package/lib/browser/events/pollingLogProvider.d.ts +2 -2
- package/lib/browser/events/pollingLogProvider.js +1 -0
- package/lib/browser/events/txEventCache.d.ts +3 -3
- package/lib/browser/events/txEventCache.js +6 -2
- package/lib/browser/events/types.d.ts +2 -4
- package/lib/browser/events/types.js +0 -2
- package/lib/browser/events/webSocketLogProvider.d.ts +2 -2
- package/lib/browser/events/webSocketLogProvider.js +5 -2
- package/lib/browser/factory/bigNum.d.ts +0 -1
- package/lib/browser/factory/bigNum.js +1 -1
- package/lib/browser/idl/velocity.d.ts +1243 -1586
- package/lib/browser/idl/velocity.json +1234 -1577
- package/lib/browser/index.d.ts +0 -2
- package/lib/browser/index.js +0 -2
- package/lib/browser/indicative-quotes/indicativeQuotesSender.d.ts +0 -1
- package/lib/browser/jupiter/jupiterClient.d.ts +1 -2
- package/lib/browser/jupiter/jupiterClient.js +18 -8
- package/lib/browser/marginCalculation.d.ts +0 -1
- package/lib/browser/marginCalculation.js +1 -0
- package/lib/browser/marinade/index.d.ts +2 -3
- package/lib/browser/marinade/index.js +5 -0
- package/lib/browser/math/amm.d.ts +31 -14
- package/lib/browser/math/amm.js +77 -22
- package/lib/browser/math/auction.d.ts +0 -1
- package/lib/browser/math/bankruptcy.js +1 -1
- package/lib/browser/math/conversion.d.ts +0 -1
- package/lib/browser/math/funding.d.ts +0 -1
- package/lib/browser/math/funding.js +6 -6
- package/lib/browser/math/insurance.d.ts +1 -2
- package/lib/browser/math/insurance.js +4 -5
- package/lib/browser/math/liquidation.d.ts +0 -1
- package/lib/browser/math/margin.d.ts +1 -10
- package/lib/browser/math/margin.js +3 -62
- package/lib/browser/math/market.d.ts +4 -13
- package/lib/browser/math/market.js +6 -40
- package/lib/browser/math/oracles.d.ts +0 -4
- package/lib/browser/math/oracles.js +1 -14
- package/lib/browser/math/orders.d.ts +0 -6
- package/lib/browser/math/orders.js +2 -74
- package/lib/browser/math/position.d.ts +1 -6
- package/lib/browser/math/position.js +5 -10
- package/lib/browser/math/repeg.d.ts +0 -2
- package/lib/browser/math/repeg.js +1 -23
- package/lib/browser/math/spotBalance.d.ts +4 -5
- package/lib/browser/math/spotBalance.js +6 -6
- package/lib/browser/math/spotMarket.d.ts +0 -7
- package/lib/browser/math/spotMarket.js +1 -16
- package/lib/browser/math/spotPosition.d.ts +4 -5
- package/lib/browser/math/state.d.ts +0 -3
- package/lib/browser/math/state.js +1 -9
- package/lib/browser/math/superStake.d.ts +3 -54
- package/lib/browser/math/superStake.js +16 -13
- package/lib/browser/math/trade.d.ts +2 -3
- package/lib/browser/math/trade.js +6 -6
- package/lib/browser/math/utils.d.ts +0 -1
- package/lib/browser/memcmp.d.ts +0 -1
- package/lib/browser/memcmp.js +1 -10
- package/lib/browser/oracles/oracleClientCache.d.ts +1 -1
- package/lib/browser/oracles/prelaunchOracleClient.js +3 -2
- package/lib/browser/oracles/pythClient.d.ts +0 -1
- package/lib/browser/oracles/pythClient.js +9 -3
- package/lib/browser/oracles/pythLazerClient.d.ts +0 -1
- package/lib/browser/oracles/pythLazerClient.js +3 -2
- package/lib/browser/oracles/strictOraclePrice.d.ts +0 -1
- package/lib/browser/oracles/types.d.ts +0 -1
- package/lib/browser/oracles/utils.d.ts +4 -1
- package/lib/browser/oracles/utils.js +9 -1
- package/lib/browser/orderParams.d.ts +0 -1
- package/lib/browser/orderSubscriber/OrderSubscriber.d.ts +1 -1
- package/lib/browser/orderSubscriber/OrderSubscriber.js +8 -2
- package/lib/browser/priorityFee/heliusPriorityFeeMethod.d.ts +1 -1
- package/lib/browser/priorityFee/priorityFeeSubscriber.d.ts +1 -1
- package/lib/browser/priorityFee/priorityFeeSubscriber.js +32 -8
- package/lib/browser/priorityFee/solanaPriorityFeeMethod.d.ts +1 -1
- package/lib/browser/pyth/types.d.ts +0 -1
- package/lib/browser/slot/SlotSubscriber.d.ts +1 -1
- package/lib/browser/slot/SlotSubscriber.js +2 -1
- package/lib/browser/slot/SlothashSubscriber.d.ts +3 -2
- package/lib/browser/slot/SlothashSubscriber.js +11 -4
- package/lib/browser/swap/UnifiedSwapClient.d.ts +0 -1
- package/lib/browser/swift/grpcSignedMsgUserAccountSubscriber.d.ts +0 -3
- package/lib/browser/swift/grpcSignedMsgUserAccountSubscriber.js +5 -5
- package/lib/browser/swift/signedMsgUserAccountSubscriber.d.ts +3 -2
- package/lib/browser/swift/signedMsgUserAccountSubscriber.js +13 -5
- package/lib/browser/swift/swiftOrderSubscriber.d.ts +1 -1
- package/lib/browser/swift/swiftOrderSubscriber.js +10 -5
- package/lib/browser/testClient.js +3 -2
- package/lib/browser/titan/titanClient.d.ts +0 -1
- package/lib/browser/tokenFaucet.d.ts +0 -1
- package/lib/browser/tokenFaucet.js +16 -2
- package/lib/browser/tx/baseTxSender.d.ts +4 -4
- package/lib/browser/tx/baseTxSender.js +5 -4
- package/lib/browser/tx/fastSingleTxSender.d.ts +3 -3
- package/lib/browser/tx/fastSingleTxSender.js +9 -5
- package/lib/browser/tx/reportTransactionError.d.ts +2 -2
- package/lib/browser/tx/reportTransactionError.js +5 -1
- package/lib/browser/tx/retryTxSender.d.ts +1 -1
- package/lib/browser/tx/retryTxSender.js +4 -2
- package/lib/browser/tx/txHandler.d.ts +9 -3
- package/lib/browser/tx/txHandler.js +54 -40
- package/lib/browser/tx/txParamProcessor.d.ts +4 -1
- package/lib/browser/tx/txParamProcessor.js +6 -0
- package/lib/browser/tx/types.d.ts +1 -1
- package/lib/browser/tx/whileValidTxSender.d.ts +1 -6
- package/lib/browser/tx/whileValidTxSender.js +35 -13
- package/lib/browser/types.d.ts +25 -69
- package/lib/browser/types.js +2 -2
- package/lib/browser/user.d.ts +21 -8
- package/lib/browser/user.js +156 -132
- package/lib/browser/userMap/WebsocketSubscription.d.ts +1 -1
- package/lib/browser/userMap/grpcSubscription.d.ts +1 -1
- package/lib/browser/userMap/referrerMap.js +10 -3
- package/lib/browser/userMap/revenueShareEscrowMap.js +4 -0
- package/lib/browser/userMap/userMap.d.ts +1 -1
- package/lib/browser/userMap/userMap.js +36 -23
- package/lib/browser/userMap/userStatsMap.d.ts +1 -1
- package/lib/browser/userMap/userStatsMap.js +18 -13
- package/lib/browser/userStats.d.ts +7 -2
- package/lib/browser/userStats.js +18 -4
- package/lib/browser/util/TransactionConfirmationManager.js +4 -2
- package/lib/browser/util/chainClock.d.ts +1 -1
- package/lib/browser/util/computeUnits.d.ts +1 -1
- package/lib/browser/util/computeUnits.js +6 -1
- package/lib/browser/velocityClient.d.ts +93 -36
- package/lib/browser/velocityClient.js +414 -280
- package/lib/node/accounts/basicUserAccountSubscriber.d.ts +5 -3
- package/lib/node/accounts/basicUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/basicUserAccountSubscriber.js +4 -3
- package/lib/node/accounts/basicUserStatsAccountSubscriber.d.ts +5 -3
- package/lib/node/accounts/basicUserStatsAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/basicUserStatsAccountSubscriber.js +4 -3
- package/lib/node/accounts/bulkAccountLoader.d.ts +5 -5
- package/lib/node/accounts/bulkAccountLoader.d.ts.map +1 -1
- package/lib/node/accounts/bulkAccountLoader.js +12 -1
- package/lib/node/accounts/grpcAccountSubscriber.d.ts +2 -1
- package/lib/node/accounts/grpcAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcAccountSubscriber.js +8 -2
- package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts +3 -2
- package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcMultiAccountSubscriber.js +13 -5
- package/lib/node/accounts/grpcMultiUserAccountSubscriber.d.ts +2 -1
- package/lib/node/accounts/grpcMultiUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcMultiUserAccountSubscriber.js +12 -8
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts +2 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.js +8 -2
- package/lib/node/accounts/grpcVelocityClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcVelocityClientAccountSubscriber.js +18 -3
- package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.d.ts +1 -1
- package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.d.ts.map +1 -1
- package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.js +40 -17
- package/lib/node/accounts/laserProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/laserProgramAccountSubscriber.js +3 -0
- package/lib/node/accounts/oneShotUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/oneShotUserAccountSubscriber.js +4 -3
- package/lib/node/accounts/oneShotUserStatsAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/oneShotUserStatsAccountSubscriber.js +7 -3
- package/lib/node/accounts/pollingInsuranceFundStakeAccountSubscriber.d.ts +4 -2
- package/lib/node/accounts/pollingInsuranceFundStakeAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/pollingInsuranceFundStakeAccountSubscriber.js +3 -3
- package/lib/node/accounts/pollingOracleAccountSubscriber.d.ts +0 -2
- package/lib/node/accounts/pollingOracleAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/pollingOracleAccountSubscriber.js +16 -5
- package/lib/node/accounts/pollingTokenAccountSubscriber.d.ts +0 -2
- package/lib/node/accounts/pollingTokenAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/pollingTokenAccountSubscriber.js +16 -5
- package/lib/node/accounts/pollingUserAccountSubscriber.d.ts +8 -4
- package/lib/node/accounts/pollingUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/pollingUserAccountSubscriber.js +17 -11
- package/lib/node/accounts/pollingUserStatsAccountSubscriber.d.ts +4 -2
- package/lib/node/accounts/pollingUserStatsAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/pollingUserStatsAccountSubscriber.js +6 -6
- package/lib/node/accounts/pollingVelocityClientAccountSubscriber.d.ts +7 -1
- package/lib/node/accounts/pollingVelocityClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/pollingVelocityClientAccountSubscriber.js +64 -28
- package/lib/node/accounts/types.d.ts +4 -4
- package/lib/node/accounts/types.d.ts.map +1 -1
- package/lib/node/accounts/utils.d.ts +1 -0
- package/lib/node/accounts/utils.d.ts.map +1 -1
- package/lib/node/accounts/utils.js +8 -1
- package/lib/node/accounts/webSocketAccountSubscriber.d.ts +4 -2
- package/lib/node/accounts/webSocketAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketAccountSubscriber.js +17 -5
- package/lib/node/accounts/webSocketAccountSubscriberV2.d.ts +4 -2
- package/lib/node/accounts/webSocketAccountSubscriberV2.d.ts.map +1 -1
- package/lib/node/accounts/webSocketAccountSubscriberV2.js +17 -6
- package/lib/node/accounts/webSocketInsuranceFundStakeAccountSubscriber.d.ts +4 -2
- package/lib/node/accounts/webSocketInsuranceFundStakeAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketInsuranceFundStakeAccountSubscriber.js +9 -0
- package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts +3 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriber.js +14 -3
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts +3 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts.map +1 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.js +15 -3
- package/lib/node/accounts/webSocketProgramAccountsSubscriberV2.d.ts +3 -1
- package/lib/node/accounts/webSocketProgramAccountsSubscriberV2.d.ts.map +1 -1
- package/lib/node/accounts/webSocketProgramAccountsSubscriberV2.js +14 -4
- package/lib/node/accounts/webSocketUserAccountSubscriber.d.ts +4 -2
- package/lib/node/accounts/webSocketUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketUserAccountSubscriber.js +9 -0
- package/lib/node/accounts/webSocketUserStatsAccountSubsriber.d.ts +4 -2
- package/lib/node/accounts/webSocketUserStatsAccountSubsriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketUserStatsAccountSubsriber.js +9 -0
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.d.ts +4 -4
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.js +48 -20
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts +7 -3
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts.map +1 -1
- package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.js +45 -14
- package/lib/node/accounts/websocketProgramUserAccountSubscriber.d.ts +1 -1
- package/lib/node/accounts/websocketProgramUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/websocketProgramUserAccountSubscriber.js +0 -3
- package/lib/node/addresses/marketAddresses.d.ts.map +1 -1
- package/lib/node/addresses/marketAddresses.js +3 -2
- package/lib/node/addresses/pda.d.ts +0 -2
- package/lib/node/addresses/pda.d.ts.map +1 -1
- package/lib/node/addresses/pda.js +1 -14
- package/lib/node/adminClient.d.ts +24 -29
- package/lib/node/adminClient.d.ts.map +1 -1
- package/lib/node/adminClient.js +156 -157
- package/lib/node/auctionSubscriber/auctionSubscriber.d.ts +1 -1
- package/lib/node/auctionSubscriber/auctionSubscriber.d.ts.map +1 -1
- package/lib/node/auctionSubscriber/auctionSubscriber.js +6 -4
- package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts +1 -1
- package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts.map +1 -1
- package/lib/node/auctionSubscriber/auctionSubscriberGrpc.js +9 -4
- package/lib/node/bankrun/bankrunConnection.d.ts +8 -5
- package/lib/node/bankrun/bankrunConnection.d.ts.map +1 -1
- package/lib/node/bankrun/bankrunConnection.js +92 -32
- package/lib/node/blockhashSubscriber/BlockhashSubscriber.d.ts +1 -1
- package/lib/node/blockhashSubscriber/BlockhashSubscriber.d.ts.map +1 -1
- package/lib/node/blockhashSubscriber/BlockhashSubscriber.js +3 -2
- package/lib/node/clock/clockSubscriber.d.ts +6 -6
- package/lib/node/clock/clockSubscriber.d.ts.map +1 -1
- package/lib/node/clock/clockSubscriber.js +4 -3
- package/lib/node/config.d.ts +1 -1
- package/lib/node/config.d.ts.map +1 -1
- package/lib/node/config.js +8 -4
- package/lib/node/constants/index.d.ts +1 -2
- package/lib/node/constants/index.d.ts.map +1 -1
- package/lib/node/constants/index.js +1 -2
- package/lib/node/constants/numericConstants.d.ts +1 -2
- package/lib/node/constants/numericConstants.d.ts.map +1 -1
- package/lib/node/constants/numericConstants.js +7 -5
- package/lib/node/constants/spotMarkets.d.ts +0 -1
- package/lib/node/constants/spotMarkets.d.ts.map +1 -1
- package/lib/node/constituentMap/constituentMap.d.ts.map +1 -1
- package/lib/node/constituentMap/constituentMap.js +5 -1
- package/lib/node/constituentMap/pollingConstituentAccountSubscriber.d.ts.map +1 -1
- package/lib/node/constituentMap/pollingConstituentAccountSubscriber.js +3 -2
- package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.d.ts +2 -3
- package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.d.ts.map +1 -1
- package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.js +10 -3
- package/lib/node/core/VelocityCore.d.ts +0 -1
- package/lib/node/core/VelocityCore.d.ts.map +1 -1
- package/lib/node/core/instructions/deposit.d.ts +0 -1
- package/lib/node/core/instructions/deposit.d.ts.map +1 -1
- package/lib/node/core/instructions/perpOrders.d.ts +14 -0
- package/lib/node/core/instructions/perpOrders.d.ts.map +1 -1
- package/lib/node/core/instructions/perpOrders.js +14 -0
- package/lib/node/core/instructions/withdraw.d.ts +0 -1
- package/lib/node/core/instructions/withdraw.d.ts.map +1 -1
- package/lib/node/core/remainingAccounts.d.ts +2 -2
- package/lib/node/core/remainingAccounts.d.ts.map +1 -1
- package/lib/node/core/remainingAccounts.js +2 -2
- package/lib/node/decode/user.d.ts.map +1 -1
- package/lib/node/decode/user.js +9 -1
- package/lib/node/dlob/DLOB.d.ts +6 -2
- package/lib/node/dlob/DLOB.d.ts.map +1 -1
- package/lib/node/dlob/DLOB.js +201 -138
- package/lib/node/dlob/DLOBNode.d.ts +5 -3
- package/lib/node/dlob/DLOBNode.d.ts.map +1 -1
- package/lib/node/dlob/DLOBNode.js +7 -0
- package/lib/node/dlob/DLOBSubscriber.d.ts +0 -1
- package/lib/node/dlob/DLOBSubscriber.d.ts.map +1 -1
- package/lib/node/dlob/DLOBSubscriber.js +37 -32
- package/lib/node/dlob/NodeList.d.ts +0 -1
- package/lib/node/dlob/NodeList.d.ts.map +1 -1
- package/lib/node/dlob/NodeList.js +8 -7
- package/lib/node/dlob/orderBookLevels.d.ts +0 -1
- package/lib/node/dlob/orderBookLevels.d.ts.map +1 -1
- package/lib/node/dlob/orderBookLevels.js +19 -12
- package/lib/node/events/eventList.d.ts +3 -3
- package/lib/node/events/eventList.d.ts.map +1 -1
- package/lib/node/events/eventList.js +4 -1
- package/lib/node/events/eventSubscriber.d.ts +5 -2
- package/lib/node/events/eventSubscriber.d.ts.map +1 -1
- package/lib/node/events/eventSubscriber.js +75 -26
- package/lib/node/events/eventsServerLogProvider.d.ts +2 -2
- package/lib/node/events/eventsServerLogProvider.d.ts.map +1 -1
- package/lib/node/events/eventsServerLogProvider.js +15 -8
- package/lib/node/events/fetchLogs.d.ts +1 -1
- package/lib/node/events/fetchLogs.d.ts.map +1 -1
- package/lib/node/events/fetchLogs.js +4 -2
- package/lib/node/events/pollingLogProvider.d.ts +2 -2
- package/lib/node/events/pollingLogProvider.d.ts.map +1 -1
- package/lib/node/events/pollingLogProvider.js +1 -0
- package/lib/node/events/txEventCache.d.ts +3 -3
- package/lib/node/events/txEventCache.d.ts.map +1 -1
- package/lib/node/events/txEventCache.js +6 -2
- package/lib/node/events/types.d.ts +2 -4
- package/lib/node/events/types.d.ts.map +1 -1
- package/lib/node/events/types.js +0 -2
- package/lib/node/events/webSocketLogProvider.d.ts +2 -2
- package/lib/node/events/webSocketLogProvider.d.ts.map +1 -1
- package/lib/node/events/webSocketLogProvider.js +5 -2
- package/lib/node/factory/bigNum.d.ts +0 -1
- package/lib/node/factory/bigNum.d.ts.map +1 -1
- package/lib/node/factory/bigNum.js +1 -1
- package/lib/node/idl/velocity.d.ts +1243 -1586
- package/lib/node/idl/velocity.d.ts.map +1 -1
- package/lib/node/idl/velocity.json +1234 -1577
- package/lib/node/index.d.ts +0 -2
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +0 -2
- package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts +0 -1
- package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts.map +1 -1
- package/lib/node/jupiter/jupiterClient.d.ts +1 -2
- package/lib/node/jupiter/jupiterClient.d.ts.map +1 -1
- package/lib/node/jupiter/jupiterClient.js +18 -8
- package/lib/node/marginCalculation.d.ts +0 -1
- package/lib/node/marginCalculation.d.ts.map +1 -1
- package/lib/node/marginCalculation.js +1 -0
- package/lib/node/marinade/index.d.ts +2 -3
- package/lib/node/marinade/index.d.ts.map +1 -1
- package/lib/node/marinade/index.js +5 -0
- package/lib/node/math/amm.d.ts +31 -14
- package/lib/node/math/amm.d.ts.map +1 -1
- package/lib/node/math/amm.js +77 -22
- package/lib/node/math/auction.d.ts +0 -1
- package/lib/node/math/auction.d.ts.map +1 -1
- package/lib/node/math/bankruptcy.js +1 -1
- package/lib/node/math/conversion.d.ts +0 -1
- package/lib/node/math/conversion.d.ts.map +1 -1
- package/lib/node/math/funding.d.ts +0 -1
- package/lib/node/math/funding.d.ts.map +1 -1
- package/lib/node/math/funding.js +6 -6
- package/lib/node/math/insurance.d.ts +1 -2
- package/lib/node/math/insurance.d.ts.map +1 -1
- package/lib/node/math/insurance.js +4 -5
- package/lib/node/math/liquidation.d.ts +0 -1
- package/lib/node/math/liquidation.d.ts.map +1 -1
- package/lib/node/math/margin.d.ts +1 -10
- package/lib/node/math/margin.d.ts.map +1 -1
- package/lib/node/math/margin.js +3 -62
- package/lib/node/math/market.d.ts +4 -13
- package/lib/node/math/market.d.ts.map +1 -1
- package/lib/node/math/market.js +6 -40
- package/lib/node/math/oracles.d.ts +0 -4
- package/lib/node/math/oracles.d.ts.map +1 -1
- package/lib/node/math/oracles.js +1 -14
- package/lib/node/math/orders.d.ts +0 -6
- package/lib/node/math/orders.d.ts.map +1 -1
- package/lib/node/math/orders.js +2 -74
- package/lib/node/math/position.d.ts +1 -6
- package/lib/node/math/position.d.ts.map +1 -1
- package/lib/node/math/position.js +5 -10
- package/lib/node/math/repeg.d.ts +0 -2
- package/lib/node/math/repeg.d.ts.map +1 -1
- package/lib/node/math/repeg.js +1 -23
- package/lib/node/math/spotBalance.d.ts +4 -5
- package/lib/node/math/spotBalance.d.ts.map +1 -1
- package/lib/node/math/spotBalance.js +6 -6
- package/lib/node/math/spotMarket.d.ts +0 -7
- package/lib/node/math/spotMarket.d.ts.map +1 -1
- package/lib/node/math/spotMarket.js +1 -16
- package/lib/node/math/spotPosition.d.ts +4 -5
- package/lib/node/math/spotPosition.d.ts.map +1 -1
- package/lib/node/math/state.d.ts +0 -3
- package/lib/node/math/state.d.ts.map +1 -1
- package/lib/node/math/state.js +1 -9
- package/lib/node/math/superStake.d.ts +3 -54
- package/lib/node/math/superStake.d.ts.map +1 -1
- package/lib/node/math/superStake.js +16 -13
- package/lib/node/math/trade.d.ts +2 -3
- package/lib/node/math/trade.d.ts.map +1 -1
- package/lib/node/math/trade.js +6 -6
- package/lib/node/math/utils.d.ts +0 -1
- package/lib/node/math/utils.d.ts.map +1 -1
- package/lib/node/memcmp.d.ts +0 -1
- package/lib/node/memcmp.d.ts.map +1 -1
- package/lib/node/memcmp.js +1 -10
- package/lib/node/oracles/oracleClientCache.d.ts +1 -1
- package/lib/node/oracles/prelaunchOracleClient.d.ts.map +1 -1
- package/lib/node/oracles/prelaunchOracleClient.js +3 -2
- package/lib/node/oracles/pythClient.d.ts +0 -1
- package/lib/node/oracles/pythClient.d.ts.map +1 -1
- package/lib/node/oracles/pythClient.js +9 -3
- package/lib/node/oracles/pythLazerClient.d.ts +0 -1
- package/lib/node/oracles/pythLazerClient.d.ts.map +1 -1
- package/lib/node/oracles/pythLazerClient.js +3 -2
- package/lib/node/oracles/strictOraclePrice.d.ts +0 -1
- package/lib/node/oracles/strictOraclePrice.d.ts.map +1 -1
- package/lib/node/oracles/types.d.ts +0 -1
- package/lib/node/oracles/types.d.ts.map +1 -1
- package/lib/node/oracles/utils.d.ts +4 -1
- package/lib/node/oracles/utils.d.ts.map +1 -1
- package/lib/node/oracles/utils.js +9 -1
- package/lib/node/orderParams.d.ts +0 -1
- package/lib/node/orderParams.d.ts.map +1 -1
- package/lib/node/orderSubscriber/OrderSubscriber.d.ts +1 -1
- package/lib/node/orderSubscriber/OrderSubscriber.d.ts.map +1 -1
- package/lib/node/orderSubscriber/OrderSubscriber.js +8 -2
- package/lib/node/priorityFee/heliusPriorityFeeMethod.d.ts +1 -1
- package/lib/node/priorityFee/heliusPriorityFeeMethod.d.ts.map +1 -1
- package/lib/node/priorityFee/priorityFeeSubscriber.d.ts +1 -1
- package/lib/node/priorityFee/priorityFeeSubscriber.d.ts.map +1 -1
- package/lib/node/priorityFee/priorityFeeSubscriber.js +32 -8
- package/lib/node/priorityFee/solanaPriorityFeeMethod.d.ts +1 -1
- package/lib/node/priorityFee/solanaPriorityFeeMethod.d.ts.map +1 -1
- package/lib/node/pyth/types.d.ts +0 -1
- package/lib/node/pyth/types.d.ts.map +1 -1
- package/lib/node/slot/SlotSubscriber.d.ts +1 -1
- package/lib/node/slot/SlotSubscriber.d.ts.map +1 -1
- package/lib/node/slot/SlotSubscriber.js +2 -1
- package/lib/node/slot/SlothashSubscriber.d.ts +3 -2
- package/lib/node/slot/SlothashSubscriber.d.ts.map +1 -1
- package/lib/node/slot/SlothashSubscriber.js +11 -4
- package/lib/node/swap/UnifiedSwapClient.d.ts +0 -1
- package/lib/node/swap/UnifiedSwapClient.d.ts.map +1 -1
- package/lib/node/swift/grpcSignedMsgUserAccountSubscriber.d.ts +0 -3
- package/lib/node/swift/grpcSignedMsgUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/swift/grpcSignedMsgUserAccountSubscriber.js +5 -5
- package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts +3 -2
- package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/swift/signedMsgUserAccountSubscriber.js +13 -5
- package/lib/node/swift/swiftOrderSubscriber.d.ts +1 -1
- package/lib/node/swift/swiftOrderSubscriber.d.ts.map +1 -1
- package/lib/node/swift/swiftOrderSubscriber.js +10 -5
- package/lib/node/testClient.js +3 -2
- package/lib/node/titan/titanClient.d.ts +0 -1
- package/lib/node/titan/titanClient.d.ts.map +1 -1
- package/lib/node/tokenFaucet.d.ts +0 -1
- package/lib/node/tokenFaucet.d.ts.map +1 -1
- package/lib/node/tokenFaucet.js +16 -2
- package/lib/node/tx/baseTxSender.d.ts +4 -4
- package/lib/node/tx/baseTxSender.d.ts.map +1 -1
- package/lib/node/tx/baseTxSender.js +5 -4
- package/lib/node/tx/fastSingleTxSender.d.ts +3 -3
- package/lib/node/tx/fastSingleTxSender.d.ts.map +1 -1
- package/lib/node/tx/fastSingleTxSender.js +9 -5
- package/lib/node/tx/reportTransactionError.d.ts +2 -2
- package/lib/node/tx/reportTransactionError.d.ts.map +1 -1
- package/lib/node/tx/reportTransactionError.js +5 -1
- package/lib/node/tx/retryTxSender.d.ts +1 -1
- package/lib/node/tx/retryTxSender.d.ts.map +1 -1
- package/lib/node/tx/retryTxSender.js +4 -2
- package/lib/node/tx/txHandler.d.ts +9 -3
- package/lib/node/tx/txHandler.d.ts.map +1 -1
- package/lib/node/tx/txHandler.js +54 -40
- package/lib/node/tx/txParamProcessor.d.ts +4 -1
- package/lib/node/tx/txParamProcessor.d.ts.map +1 -1
- package/lib/node/tx/txParamProcessor.js +6 -0
- package/lib/node/tx/types.d.ts +1 -1
- package/lib/node/tx/types.d.ts.map +1 -1
- package/lib/node/tx/whileValidTxSender.d.ts +1 -6
- package/lib/node/tx/whileValidTxSender.d.ts.map +1 -1
- package/lib/node/tx/whileValidTxSender.js +35 -13
- package/lib/node/types.d.ts +25 -69
- package/lib/node/types.d.ts.map +1 -1
- package/lib/node/types.js +2 -2
- package/lib/node/user.d.ts +21 -8
- package/lib/node/user.d.ts.map +1 -1
- package/lib/node/user.js +156 -132
- package/lib/node/userMap/WebsocketSubscription.d.ts +1 -1
- package/lib/node/userMap/WebsocketSubscription.d.ts.map +1 -1
- package/lib/node/userMap/grpcSubscription.d.ts +1 -1
- package/lib/node/userMap/grpcSubscription.d.ts.map +1 -1
- package/lib/node/userMap/referrerMap.d.ts.map +1 -1
- package/lib/node/userMap/referrerMap.js +10 -3
- package/lib/node/userMap/revenueShareEscrowMap.d.ts.map +1 -1
- package/lib/node/userMap/revenueShareEscrowMap.js +4 -0
- package/lib/node/userMap/userMap.d.ts +1 -1
- package/lib/node/userMap/userMap.d.ts.map +1 -1
- package/lib/node/userMap/userMap.js +36 -23
- package/lib/node/userMap/userStatsMap.d.ts +1 -1
- package/lib/node/userMap/userStatsMap.d.ts.map +1 -1
- package/lib/node/userMap/userStatsMap.js +18 -13
- package/lib/node/userStats.d.ts +7 -2
- package/lib/node/userStats.d.ts.map +1 -1
- package/lib/node/userStats.js +18 -4
- package/lib/node/util/TransactionConfirmationManager.d.ts.map +1 -1
- package/lib/node/util/TransactionConfirmationManager.js +4 -2
- package/lib/node/util/chainClock.d.ts +1 -1
- package/lib/node/util/chainClock.d.ts.map +1 -1
- package/lib/node/util/computeUnits.d.ts +1 -1
- package/lib/node/util/computeUnits.d.ts.map +1 -1
- package/lib/node/util/computeUnits.js +6 -1
- package/lib/node/velocityClient.d.ts +93 -36
- package/lib/node/velocityClient.d.ts.map +1 -1
- package/lib/node/velocityClient.js +414 -280
- package/package.json +15 -8
- package/src/accounts/basicUserAccountSubscriber.ts +7 -5
- package/src/accounts/basicUserStatsAccountSubscriber.ts +9 -5
- package/src/accounts/bulkAccountLoader.ts +20 -7
- package/src/accounts/grpcAccountSubscriber.ts +11 -3
- package/src/accounts/grpcMultiAccountSubscriber.ts +24 -9
- package/src/accounts/grpcMultiUserAccountSubscriber.ts +16 -12
- package/src/accounts/grpcProgramAccountSubscriber.ts +11 -3
- package/src/accounts/grpcVelocityClientAccountSubscriber.ts +17 -7
- package/src/accounts/grpcVelocityClientAccountSubscriberV2.ts +66 -39
- package/src/accounts/laserProgramAccountSubscriber.ts +3 -0
- package/src/accounts/oneShotUserAccountSubscriber.ts +5 -3
- package/src/accounts/oneShotUserStatsAccountSubscriber.ts +8 -3
- package/src/accounts/pollingInsuranceFundStakeAccountSubscriber.ts +11 -5
- package/src/accounts/pollingOracleAccountSubscriber.ts +17 -10
- package/src/accounts/pollingTokenAccountSubscriber.ts +17 -10
- package/src/accounts/pollingUserAccountSubscriber.ts +26 -20
- package/src/accounts/pollingUserStatsAccountSubscriber.ts +12 -10
- package/src/accounts/pollingVelocityClientAccountSubscriber.ts +76 -30
- package/src/accounts/types.ts +6 -4
- package/src/accounts/utils.ts +10 -0
- package/src/accounts/webSocketAccountSubscriber.ts +23 -10
- package/src/accounts/webSocketAccountSubscriberV2.ts +23 -8
- package/src/accounts/webSocketInsuranceFundStakeAccountSubscriber.ts +17 -2
- package/src/accounts/webSocketProgramAccountSubscriber.ts +29 -4
- package/src/accounts/webSocketProgramAccountSubscriberV2.ts +30 -4
- package/src/accounts/webSocketProgramAccountsSubscriberV2.ts +29 -4
- package/src/accounts/webSocketUserAccountSubscriber.ts +11 -2
- package/src/accounts/webSocketUserStatsAccountSubsriber.ts +15 -2
- package/src/accounts/webSocketVelocityClientAccountSubscriber.ts +76 -48
- package/src/accounts/webSocketVelocityClientAccountSubscriberV2.ts +74 -35
- package/src/accounts/websocketProgramUserAccountSubscriber.ts +1 -6
- package/src/addresses/marketAddresses.ts +3 -2
- package/src/addresses/pda.ts +0 -25
- package/src/adminClient.ts +273 -303
- package/src/auctionSubscriber/auctionSubscriber.ts +7 -5
- package/src/auctionSubscriber/auctionSubscriberGrpc.ts +12 -5
- package/src/bankrun/bankrunConnection.ts +110 -40
- package/src/blockhashSubscriber/BlockhashSubscriber.ts +5 -4
- package/src/clock/clockSubscriber.ts +10 -9
- package/src/config.ts +8 -3
- package/src/constants/index.ts +1 -2
- package/src/constants/numericConstants.ts +8 -4
- package/src/constituentMap/constituentMap.ts +8 -1
- package/src/constituentMap/pollingConstituentAccountSubscriber.ts +4 -2
- package/src/constituentMap/webSocketConstituentAccountSubscriber.ts +13 -4
- package/src/core/instructions/perpOrders.ts +14 -0
- package/src/core/remainingAccounts.ts +4 -4
- package/src/decode/user.ts +8 -1
- package/src/dlob/DLOB.ts +296 -172
- package/src/dlob/DLOBNode.ts +23 -3
- package/src/dlob/DLOBSubscriber.ts +51 -34
- package/src/dlob/NodeList.ts +8 -7
- package/src/dlob/orderBookLevels.ts +45 -25
- package/src/events/eventList.ts +4 -1
- package/src/events/eventSubscriber.ts +107 -49
- package/src/events/eventsServerLogProvider.ts +22 -13
- package/src/events/fetchLogs.ts +3 -3
- package/src/events/pollingLogProvider.ts +2 -2
- package/src/events/txEventCache.ts +8 -2
- package/src/events/types.ts +0 -8
- package/src/events/webSocketLogProvider.ts +5 -3
- package/src/factory/bigNum.ts +2 -2
- package/src/idl/velocity.json +1234 -1577
- package/src/idl/velocity.ts +1234 -1577
- package/src/index.ts +0 -2
- package/src/jupiter/jupiterClient.ts +30 -10
- package/src/marginCalculation.ts +1 -0
- package/src/marinade/index.ts +11 -2
- package/src/math/amm.ts +188 -33
- package/src/math/bankruptcy.ts +1 -1
- package/src/math/funding.ts +7 -6
- package/src/math/insurance.ts +6 -8
- package/src/math/margin.ts +5 -112
- package/src/math/market.ts +6 -96
- package/src/math/oracles.ts +0 -17
- package/src/math/orders.ts +1 -110
- package/src/math/position.ts +4 -16
- package/src/math/repeg.ts +0 -29
- package/src/math/spotBalance.ts +14 -10
- package/src/math/spotMarket.ts +2 -28
- package/src/math/spotPosition.ts +4 -4
- package/src/math/state.ts +0 -8
- package/src/math/superStake.ts +19 -65
- package/src/math/trade.ts +2 -6
- package/src/memcmp.ts +0 -9
- package/src/oracles/prelaunchOracleClient.ts +7 -2
- package/src/oracles/pythClient.ts +12 -3
- package/src/oracles/pythLazerClient.ts +7 -2
- package/src/oracles/utils.ts +15 -0
- package/src/orderSubscriber/OrderSubscriber.ts +10 -4
- package/src/priorityFee/heliusPriorityFeeMethod.ts +1 -1
- package/src/priorityFee/priorityFeeSubscriber.ts +45 -9
- package/src/priorityFee/solanaPriorityFeeMethod.ts +1 -1
- package/src/pyth/types.ts +0 -2
- package/src/slot/SlotSubscriber.ts +3 -3
- package/src/slot/SlothashSubscriber.ts +17 -6
- package/src/swift/grpcSignedMsgUserAccountSubscriber.ts +5 -6
- package/src/swift/signedMsgUserAccountSubscriber.ts +16 -8
- package/src/swift/swiftOrderSubscriber.ts +10 -9
- package/src/testClient.ts +2 -2
- package/src/tokenFaucet.ts +22 -3
- package/src/tx/baseTxSender.ts +10 -10
- package/src/tx/fastSingleTxSender.ts +12 -8
- package/src/tx/reportTransactionError.ts +12 -7
- package/src/tx/retryTxSender.ts +6 -4
- package/src/tx/txHandler.ts +88 -43
- package/src/tx/txParamProcessor.ts +18 -3
- package/src/tx/types.ts +1 -1
- package/src/tx/whileValidTxSender.ts +51 -22
- package/src/types.ts +39 -75
- package/src/user.ts +200 -152
- package/src/userMap/WebsocketSubscription.ts +1 -1
- package/src/userMap/grpcSubscription.ts +1 -1
- package/src/userMap/referrerMap.ts +14 -10
- package/src/userMap/revenueShareEscrowMap.ts +8 -3
- package/src/userMap/userMap.ts +43 -25
- package/src/userMap/userStatsMap.ts +32 -19
- package/src/userStats.ts +21 -8
- package/src/util/TransactionConfirmationManager.ts +10 -2
- package/src/util/chainClock.ts +1 -1
- package/src/util/computeUnits.ts +7 -3
- package/src/velocityClient.ts +536 -383
- package/tests/VelocityCore/remainingAccounts.test.ts +4 -5
- package/tests/accounts/customizedCadenceBulkAccountLoader.test.ts +19 -11
- package/tests/amm/test.ts +300 -95
- package/tests/decode/userAccountBufferStrings.ts +100 -100
- package/tests/dlob/helpers.ts +162 -173
- package/tests/dlob/test.ts +155 -106
- package/tests/tx/TransactionConfirmationManager.test.ts +9 -2
- package/tests/user/getMarginCalculation.ts +1 -1
- package/tests/user/helpers.ts +3 -4
- package/tests/user/marginCalculations.test.ts +2 -2
- package/tests/user/test.ts +3 -3
- package/tsconfig.browser.json +3 -1
- package/tsconfig.json +21 -2
- package/.yarn/install-state.gz +0 -0
- package/VERSION +0 -1
- package/bun.lock +0 -1885
- package/lib/browser/constants/insuranceFund.d.ts +0 -5
- package/lib/browser/constants/insuranceFund.js +0 -9
- package/lib/browser/tx/forwardOnlyTxSender.d.ts +0 -37
- package/lib/browser/tx/forwardOnlyTxSender.js +0 -92
- package/lib/browser/util/tps.d.ts +0 -2
- package/lib/browser/util/tps.js +0 -16
- package/lib/node/constants/insuranceFund.d.ts +0 -6
- package/lib/node/constants/insuranceFund.d.ts.map +0 -1
- package/lib/node/constants/insuranceFund.js +0 -9
- package/lib/node/tx/forwardOnlyTxSender.d.ts +0 -38
- package/lib/node/tx/forwardOnlyTxSender.d.ts.map +0 -1
- package/lib/node/tx/forwardOnlyTxSender.js +0 -92
- package/lib/node/util/tps.d.ts +0 -3
- package/lib/node/util/tps.d.ts.map +0 -1
- package/lib/node/util/tps.js +0 -16
- package/scripts/updateVersion.js +0 -28
- package/src/constants/insuranceFund.ts +0 -8
- package/src/tx/forwardOnlyTxSender.ts +0 -145
- package/src/util/tps.ts +0 -27
- package/tests/decode/phoenix.ts +0 -71
|
@@ -449,250 +449,6 @@ export type Velocity = {
|
|
|
449
449
|
}
|
|
450
450
|
];
|
|
451
451
|
},
|
|
452
|
-
{
|
|
453
|
-
"name": "adminWithdrawFromInsuranceFundVault";
|
|
454
|
-
"discriminator": [
|
|
455
|
-
228,
|
|
456
|
-
208,
|
|
457
|
-
191,
|
|
458
|
-
246,
|
|
459
|
-
169,
|
|
460
|
-
58,
|
|
461
|
-
189,
|
|
462
|
-
213
|
|
463
|
-
];
|
|
464
|
-
"accounts": [
|
|
465
|
-
{
|
|
466
|
-
"name": "state";
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
"name": "authority";
|
|
470
|
-
"writable": true;
|
|
471
|
-
"signer": true;
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
"name": "spotMarket";
|
|
475
|
-
"writable": true;
|
|
476
|
-
"pda": {
|
|
477
|
-
"seeds": [
|
|
478
|
-
{
|
|
479
|
-
"kind": "const";
|
|
480
|
-
"value": [
|
|
481
|
-
115,
|
|
482
|
-
112,
|
|
483
|
-
111,
|
|
484
|
-
116,
|
|
485
|
-
95,
|
|
486
|
-
109,
|
|
487
|
-
97,
|
|
488
|
-
114,
|
|
489
|
-
107,
|
|
490
|
-
101,
|
|
491
|
-
116
|
|
492
|
-
];
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
"kind": "arg";
|
|
496
|
-
"path": "marketIndex";
|
|
497
|
-
}
|
|
498
|
-
];
|
|
499
|
-
};
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
"name": "insuranceFundVault";
|
|
503
|
-
"writable": true;
|
|
504
|
-
"pda": {
|
|
505
|
-
"seeds": [
|
|
506
|
-
{
|
|
507
|
-
"kind": "const";
|
|
508
|
-
"value": [
|
|
509
|
-
105,
|
|
510
|
-
110,
|
|
511
|
-
115,
|
|
512
|
-
117,
|
|
513
|
-
114,
|
|
514
|
-
97,
|
|
515
|
-
110,
|
|
516
|
-
99,
|
|
517
|
-
101,
|
|
518
|
-
95,
|
|
519
|
-
102,
|
|
520
|
-
117,
|
|
521
|
-
110,
|
|
522
|
-
100,
|
|
523
|
-
95,
|
|
524
|
-
118,
|
|
525
|
-
97,
|
|
526
|
-
117,
|
|
527
|
-
108,
|
|
528
|
-
116
|
|
529
|
-
];
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
"kind": "arg";
|
|
533
|
-
"path": "marketIndex";
|
|
534
|
-
}
|
|
535
|
-
];
|
|
536
|
-
};
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
"name": "recipientTokenAccount";
|
|
540
|
-
"writable": true;
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
"name": "tokenProgram";
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
"name": "velocitySigner";
|
|
547
|
-
}
|
|
548
|
-
];
|
|
549
|
-
"args": [
|
|
550
|
-
{
|
|
551
|
-
"name": "marketIndex";
|
|
552
|
-
"type": "u16";
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
"name": "amount";
|
|
556
|
-
"type": "u64";
|
|
557
|
-
}
|
|
558
|
-
];
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
"name": "beginInsuranceFundSwap";
|
|
562
|
-
"discriminator": [
|
|
563
|
-
176,
|
|
564
|
-
69,
|
|
565
|
-
143,
|
|
566
|
-
205,
|
|
567
|
-
32,
|
|
568
|
-
132,
|
|
569
|
-
163,
|
|
570
|
-
0
|
|
571
|
-
];
|
|
572
|
-
"accounts": [
|
|
573
|
-
{
|
|
574
|
-
"name": "state";
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
"name": "authority";
|
|
578
|
-
"writable": true;
|
|
579
|
-
"signer": true;
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
"name": "outInsuranceFundVault";
|
|
583
|
-
"writable": true;
|
|
584
|
-
"pda": {
|
|
585
|
-
"seeds": [
|
|
586
|
-
{
|
|
587
|
-
"kind": "const";
|
|
588
|
-
"value": [
|
|
589
|
-
105,
|
|
590
|
-
110,
|
|
591
|
-
115,
|
|
592
|
-
117,
|
|
593
|
-
114,
|
|
594
|
-
97,
|
|
595
|
-
110,
|
|
596
|
-
99,
|
|
597
|
-
101,
|
|
598
|
-
95,
|
|
599
|
-
102,
|
|
600
|
-
117,
|
|
601
|
-
110,
|
|
602
|
-
100,
|
|
603
|
-
95,
|
|
604
|
-
118,
|
|
605
|
-
97,
|
|
606
|
-
117,
|
|
607
|
-
108,
|
|
608
|
-
116
|
|
609
|
-
];
|
|
610
|
-
},
|
|
611
|
-
{
|
|
612
|
-
"kind": "arg";
|
|
613
|
-
"path": "outMarketIndex";
|
|
614
|
-
}
|
|
615
|
-
];
|
|
616
|
-
};
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
"name": "inInsuranceFundVault";
|
|
620
|
-
"writable": true;
|
|
621
|
-
"pda": {
|
|
622
|
-
"seeds": [
|
|
623
|
-
{
|
|
624
|
-
"kind": "const";
|
|
625
|
-
"value": [
|
|
626
|
-
105,
|
|
627
|
-
110,
|
|
628
|
-
115,
|
|
629
|
-
117,
|
|
630
|
-
114,
|
|
631
|
-
97,
|
|
632
|
-
110,
|
|
633
|
-
99,
|
|
634
|
-
101,
|
|
635
|
-
95,
|
|
636
|
-
102,
|
|
637
|
-
117,
|
|
638
|
-
110,
|
|
639
|
-
100,
|
|
640
|
-
95,
|
|
641
|
-
118,
|
|
642
|
-
97,
|
|
643
|
-
117,
|
|
644
|
-
108,
|
|
645
|
-
116
|
|
646
|
-
];
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
"kind": "arg";
|
|
650
|
-
"path": "inMarketIndex";
|
|
651
|
-
}
|
|
652
|
-
];
|
|
653
|
-
};
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
"name": "outTokenAccount";
|
|
657
|
-
"writable": true;
|
|
658
|
-
},
|
|
659
|
-
{
|
|
660
|
-
"name": "inTokenAccount";
|
|
661
|
-
"writable": true;
|
|
662
|
-
},
|
|
663
|
-
{
|
|
664
|
-
"name": "ifRebalanceConfig";
|
|
665
|
-
"writable": true;
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
"name": "tokenProgram";
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
"name": "velocitySigner";
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
"name": "instructions";
|
|
675
|
-
"docs": [
|
|
676
|
-
"Instructions Sysvar for instruction introspection"
|
|
677
|
-
];
|
|
678
|
-
"address": "Sysvar1nstructions1111111111111111111111111";
|
|
679
|
-
}
|
|
680
|
-
];
|
|
681
|
-
"args": [
|
|
682
|
-
{
|
|
683
|
-
"name": "inMarketIndex";
|
|
684
|
-
"type": "u16";
|
|
685
|
-
},
|
|
686
|
-
{
|
|
687
|
-
"name": "outMarketIndex";
|
|
688
|
-
"type": "u16";
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
"name": "amountIn";
|
|
692
|
-
"type": "u64";
|
|
693
|
-
}
|
|
694
|
-
];
|
|
695
|
-
},
|
|
696
452
|
{
|
|
697
453
|
"name": "beginLpSwap";
|
|
698
454
|
"discriminator": [
|
|
@@ -1792,203 +1548,16 @@ export type Velocity = {
|
|
|
1792
1548
|
];
|
|
1793
1549
|
},
|
|
1794
1550
|
{
|
|
1795
|
-
"name": "
|
|
1551
|
+
"name": "depositIntoIsolatedPerpPosition";
|
|
1796
1552
|
"discriminator": [
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
];
|
|
1806
|
-
"accounts": [
|
|
1807
|
-
{
|
|
1808
|
-
"name": "signer";
|
|
1809
|
-
"signer": true;
|
|
1810
|
-
},
|
|
1811
|
-
{
|
|
1812
|
-
"name": "state";
|
|
1813
|
-
"writable": true;
|
|
1814
|
-
},
|
|
1815
|
-
{
|
|
1816
|
-
"name": "spotMarket";
|
|
1817
|
-
"writable": true;
|
|
1818
|
-
"pda": {
|
|
1819
|
-
"seeds": [
|
|
1820
|
-
{
|
|
1821
|
-
"kind": "const";
|
|
1822
|
-
"value": [
|
|
1823
|
-
115,
|
|
1824
|
-
112,
|
|
1825
|
-
111,
|
|
1826
|
-
116,
|
|
1827
|
-
95,
|
|
1828
|
-
109,
|
|
1829
|
-
97,
|
|
1830
|
-
114,
|
|
1831
|
-
107,
|
|
1832
|
-
101,
|
|
1833
|
-
116
|
|
1834
|
-
];
|
|
1835
|
-
},
|
|
1836
|
-
{
|
|
1837
|
-
"kind": "arg";
|
|
1838
|
-
"path": "marketIndex";
|
|
1839
|
-
}
|
|
1840
|
-
];
|
|
1841
|
-
};
|
|
1842
|
-
},
|
|
1843
|
-
{
|
|
1844
|
-
"name": "insuranceFundStake";
|
|
1845
|
-
"writable": true;
|
|
1846
|
-
"pda": {
|
|
1847
|
-
"seeds": [
|
|
1848
|
-
{
|
|
1849
|
-
"kind": "const";
|
|
1850
|
-
"value": [
|
|
1851
|
-
105,
|
|
1852
|
-
110,
|
|
1853
|
-
115,
|
|
1854
|
-
117,
|
|
1855
|
-
114,
|
|
1856
|
-
97,
|
|
1857
|
-
110,
|
|
1858
|
-
99,
|
|
1859
|
-
101,
|
|
1860
|
-
95,
|
|
1861
|
-
102,
|
|
1862
|
-
117,
|
|
1863
|
-
110,
|
|
1864
|
-
100,
|
|
1865
|
-
95,
|
|
1866
|
-
115,
|
|
1867
|
-
116,
|
|
1868
|
-
97,
|
|
1869
|
-
107,
|
|
1870
|
-
101
|
|
1871
|
-
];
|
|
1872
|
-
},
|
|
1873
|
-
{
|
|
1874
|
-
"kind": "account";
|
|
1875
|
-
"path": "userStats";
|
|
1876
|
-
},
|
|
1877
|
-
{
|
|
1878
|
-
"kind": "arg";
|
|
1879
|
-
"path": "marketIndex";
|
|
1880
|
-
}
|
|
1881
|
-
];
|
|
1882
|
-
};
|
|
1883
|
-
},
|
|
1884
|
-
{
|
|
1885
|
-
"name": "userStats";
|
|
1886
|
-
"writable": true;
|
|
1887
|
-
},
|
|
1888
|
-
{
|
|
1889
|
-
"name": "spotMarketVault";
|
|
1890
|
-
"writable": true;
|
|
1891
|
-
"pda": {
|
|
1892
|
-
"seeds": [
|
|
1893
|
-
{
|
|
1894
|
-
"kind": "const";
|
|
1895
|
-
"value": [
|
|
1896
|
-
115,
|
|
1897
|
-
112,
|
|
1898
|
-
111,
|
|
1899
|
-
116,
|
|
1900
|
-
95,
|
|
1901
|
-
109,
|
|
1902
|
-
97,
|
|
1903
|
-
114,
|
|
1904
|
-
107,
|
|
1905
|
-
101,
|
|
1906
|
-
116,
|
|
1907
|
-
95,
|
|
1908
|
-
118,
|
|
1909
|
-
97,
|
|
1910
|
-
117,
|
|
1911
|
-
108,
|
|
1912
|
-
116
|
|
1913
|
-
];
|
|
1914
|
-
},
|
|
1915
|
-
{
|
|
1916
|
-
"kind": "arg";
|
|
1917
|
-
"path": "marketIndex";
|
|
1918
|
-
}
|
|
1919
|
-
];
|
|
1920
|
-
};
|
|
1921
|
-
},
|
|
1922
|
-
{
|
|
1923
|
-
"name": "insuranceFundVault";
|
|
1924
|
-
"writable": true;
|
|
1925
|
-
"pda": {
|
|
1926
|
-
"seeds": [
|
|
1927
|
-
{
|
|
1928
|
-
"kind": "const";
|
|
1929
|
-
"value": [
|
|
1930
|
-
105,
|
|
1931
|
-
110,
|
|
1932
|
-
115,
|
|
1933
|
-
117,
|
|
1934
|
-
114,
|
|
1935
|
-
97,
|
|
1936
|
-
110,
|
|
1937
|
-
99,
|
|
1938
|
-
101,
|
|
1939
|
-
95,
|
|
1940
|
-
102,
|
|
1941
|
-
117,
|
|
1942
|
-
110,
|
|
1943
|
-
100,
|
|
1944
|
-
95,
|
|
1945
|
-
118,
|
|
1946
|
-
97,
|
|
1947
|
-
117,
|
|
1948
|
-
108,
|
|
1949
|
-
116
|
|
1950
|
-
];
|
|
1951
|
-
},
|
|
1952
|
-
{
|
|
1953
|
-
"kind": "arg";
|
|
1954
|
-
"path": "marketIndex";
|
|
1955
|
-
}
|
|
1956
|
-
];
|
|
1957
|
-
};
|
|
1958
|
-
},
|
|
1959
|
-
{
|
|
1960
|
-
"name": "userTokenAccount";
|
|
1961
|
-
"writable": true;
|
|
1962
|
-
},
|
|
1963
|
-
{
|
|
1964
|
-
"name": "tokenProgram";
|
|
1965
|
-
},
|
|
1966
|
-
{
|
|
1967
|
-
"name": "velocitySigner";
|
|
1968
|
-
}
|
|
1969
|
-
];
|
|
1970
|
-
"args": [
|
|
1971
|
-
{
|
|
1972
|
-
"name": "marketIndex";
|
|
1973
|
-
"type": "u16";
|
|
1974
|
-
},
|
|
1975
|
-
{
|
|
1976
|
-
"name": "amount";
|
|
1977
|
-
"type": "u64";
|
|
1978
|
-
}
|
|
1979
|
-
];
|
|
1980
|
-
},
|
|
1981
|
-
{
|
|
1982
|
-
"name": "depositIntoIsolatedPerpPosition";
|
|
1983
|
-
"discriminator": [
|
|
1984
|
-
101,
|
|
1985
|
-
48,
|
|
1986
|
-
255,
|
|
1987
|
-
153,
|
|
1988
|
-
127,
|
|
1989
|
-
121,
|
|
1990
|
-
170,
|
|
1991
|
-
26
|
|
1553
|
+
101,
|
|
1554
|
+
48,
|
|
1555
|
+
255,
|
|
1556
|
+
153,
|
|
1557
|
+
127,
|
|
1558
|
+
121,
|
|
1559
|
+
170,
|
|
1560
|
+
26
|
|
1992
1561
|
];
|
|
1993
1562
|
"accounts": [
|
|
1994
1563
|
{
|
|
@@ -2346,185 +1915,53 @@ export type Velocity = {
|
|
|
2346
1915
|
];
|
|
2347
1916
|
},
|
|
2348
1917
|
{
|
|
2349
|
-
"name": "
|
|
1918
|
+
"name": "endLpSwap";
|
|
2350
1919
|
"discriminator": [
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
1920
|
+
99,
|
|
1921
|
+
125,
|
|
1922
|
+
214,
|
|
1923
|
+
165,
|
|
1924
|
+
129,
|
|
1925
|
+
175,
|
|
1926
|
+
253,
|
|
1927
|
+
135
|
|
2359
1928
|
];
|
|
2360
1929
|
"accounts": [
|
|
2361
1930
|
{
|
|
2362
1931
|
"name": "state";
|
|
2363
1932
|
},
|
|
2364
1933
|
{
|
|
2365
|
-
"name": "
|
|
1934
|
+
"name": "admin";
|
|
2366
1935
|
"writable": true;
|
|
2367
1936
|
"signer": true;
|
|
2368
1937
|
},
|
|
2369
1938
|
{
|
|
2370
|
-
"name": "
|
|
2371
|
-
"
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
116
|
|
2397
|
-
];
|
|
2398
|
-
},
|
|
2399
|
-
{
|
|
2400
|
-
"kind": "arg";
|
|
2401
|
-
"path": "outMarketIndex";
|
|
2402
|
-
}
|
|
2403
|
-
];
|
|
2404
|
-
};
|
|
2405
|
-
},
|
|
2406
|
-
{
|
|
2407
|
-
"name": "inInsuranceFundVault";
|
|
2408
|
-
"writable": true;
|
|
2409
|
-
"pda": {
|
|
2410
|
-
"seeds": [
|
|
2411
|
-
{
|
|
2412
|
-
"kind": "const";
|
|
2413
|
-
"value": [
|
|
2414
|
-
105,
|
|
2415
|
-
110,
|
|
2416
|
-
115,
|
|
2417
|
-
117,
|
|
2418
|
-
114,
|
|
2419
|
-
97,
|
|
2420
|
-
110,
|
|
2421
|
-
99,
|
|
2422
|
-
101,
|
|
2423
|
-
95,
|
|
2424
|
-
102,
|
|
2425
|
-
117,
|
|
2426
|
-
110,
|
|
2427
|
-
100,
|
|
2428
|
-
95,
|
|
2429
|
-
118,
|
|
2430
|
-
97,
|
|
2431
|
-
117,
|
|
2432
|
-
108,
|
|
2433
|
-
116
|
|
2434
|
-
];
|
|
2435
|
-
},
|
|
2436
|
-
{
|
|
2437
|
-
"kind": "arg";
|
|
2438
|
-
"path": "inMarketIndex";
|
|
2439
|
-
}
|
|
2440
|
-
];
|
|
2441
|
-
};
|
|
2442
|
-
},
|
|
2443
|
-
{
|
|
2444
|
-
"name": "outTokenAccount";
|
|
2445
|
-
"writable": true;
|
|
2446
|
-
},
|
|
2447
|
-
{
|
|
2448
|
-
"name": "inTokenAccount";
|
|
2449
|
-
"writable": true;
|
|
2450
|
-
},
|
|
2451
|
-
{
|
|
2452
|
-
"name": "ifRebalanceConfig";
|
|
2453
|
-
"writable": true;
|
|
2454
|
-
},
|
|
2455
|
-
{
|
|
2456
|
-
"name": "tokenProgram";
|
|
2457
|
-
},
|
|
2458
|
-
{
|
|
2459
|
-
"name": "velocitySigner";
|
|
2460
|
-
},
|
|
2461
|
-
{
|
|
2462
|
-
"name": "instructions";
|
|
2463
|
-
"docs": [
|
|
2464
|
-
"Instructions Sysvar for instruction introspection"
|
|
2465
|
-
];
|
|
2466
|
-
"address": "Sysvar1nstructions1111111111111111111111111";
|
|
2467
|
-
}
|
|
2468
|
-
];
|
|
2469
|
-
"args": [
|
|
2470
|
-
{
|
|
2471
|
-
"name": "inMarketIndex";
|
|
2472
|
-
"type": "u16";
|
|
2473
|
-
},
|
|
2474
|
-
{
|
|
2475
|
-
"name": "outMarketIndex";
|
|
2476
|
-
"type": "u16";
|
|
2477
|
-
}
|
|
2478
|
-
];
|
|
2479
|
-
},
|
|
2480
|
-
{
|
|
2481
|
-
"name": "endLpSwap";
|
|
2482
|
-
"discriminator": [
|
|
2483
|
-
99,
|
|
2484
|
-
125,
|
|
2485
|
-
214,
|
|
2486
|
-
165,
|
|
2487
|
-
129,
|
|
2488
|
-
175,
|
|
2489
|
-
253,
|
|
2490
|
-
135
|
|
2491
|
-
];
|
|
2492
|
-
"accounts": [
|
|
2493
|
-
{
|
|
2494
|
-
"name": "state";
|
|
2495
|
-
},
|
|
2496
|
-
{
|
|
2497
|
-
"name": "admin";
|
|
2498
|
-
"writable": true;
|
|
2499
|
-
"signer": true;
|
|
2500
|
-
},
|
|
2501
|
-
{
|
|
2502
|
-
"name": "signerOutTokenAccount";
|
|
2503
|
-
"docs": [
|
|
2504
|
-
"Signer token accounts"
|
|
2505
|
-
];
|
|
2506
|
-
"writable": true;
|
|
2507
|
-
},
|
|
2508
|
-
{
|
|
2509
|
-
"name": "signerInTokenAccount";
|
|
2510
|
-
"writable": true;
|
|
2511
|
-
},
|
|
2512
|
-
{
|
|
2513
|
-
"name": "constituentOutTokenAccount";
|
|
2514
|
-
"docs": [
|
|
2515
|
-
"Constituent token accounts"
|
|
2516
|
-
];
|
|
2517
|
-
"writable": true;
|
|
2518
|
-
},
|
|
2519
|
-
{
|
|
2520
|
-
"name": "constituentInTokenAccount";
|
|
2521
|
-
"writable": true;
|
|
2522
|
-
},
|
|
2523
|
-
{
|
|
2524
|
-
"name": "outConstituent";
|
|
2525
|
-
"docs": [
|
|
2526
|
-
"Constituents"
|
|
2527
|
-
];
|
|
1939
|
+
"name": "signerOutTokenAccount";
|
|
1940
|
+
"docs": [
|
|
1941
|
+
"Signer token accounts"
|
|
1942
|
+
];
|
|
1943
|
+
"writable": true;
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
"name": "signerInTokenAccount";
|
|
1947
|
+
"writable": true;
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
"name": "constituentOutTokenAccount";
|
|
1951
|
+
"docs": [
|
|
1952
|
+
"Constituent token accounts"
|
|
1953
|
+
];
|
|
1954
|
+
"writable": true;
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
"name": "constituentInTokenAccount";
|
|
1958
|
+
"writable": true;
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
"name": "outConstituent";
|
|
1962
|
+
"docs": [
|
|
1963
|
+
"Constituents"
|
|
1964
|
+
];
|
|
2528
1965
|
"writable": true;
|
|
2529
1966
|
"pda": {
|
|
2530
1967
|
"seeds": [
|
|
@@ -3355,87 +2792,6 @@ export type Velocity = {
|
|
|
3355
2792
|
}
|
|
3356
2793
|
];
|
|
3357
2794
|
},
|
|
3358
|
-
{
|
|
3359
|
-
"name": "initializeIfRebalanceConfig";
|
|
3360
|
-
"discriminator": [
|
|
3361
|
-
8,
|
|
3362
|
-
85,
|
|
3363
|
-
184,
|
|
3364
|
-
167,
|
|
3365
|
-
176,
|
|
3366
|
-
61,
|
|
3367
|
-
173,
|
|
3368
|
-
226
|
|
3369
|
-
];
|
|
3370
|
-
"accounts": [
|
|
3371
|
-
{
|
|
3372
|
-
"name": "admin";
|
|
3373
|
-
"writable": true;
|
|
3374
|
-
"signer": true;
|
|
3375
|
-
},
|
|
3376
|
-
{
|
|
3377
|
-
"name": "ifRebalanceConfig";
|
|
3378
|
-
"writable": true;
|
|
3379
|
-
"pda": {
|
|
3380
|
-
"seeds": [
|
|
3381
|
-
{
|
|
3382
|
-
"kind": "const";
|
|
3383
|
-
"value": [
|
|
3384
|
-
105,
|
|
3385
|
-
102,
|
|
3386
|
-
95,
|
|
3387
|
-
114,
|
|
3388
|
-
101,
|
|
3389
|
-
98,
|
|
3390
|
-
97,
|
|
3391
|
-
108,
|
|
3392
|
-
97,
|
|
3393
|
-
110,
|
|
3394
|
-
99,
|
|
3395
|
-
101,
|
|
3396
|
-
95,
|
|
3397
|
-
99,
|
|
3398
|
-
111,
|
|
3399
|
-
110,
|
|
3400
|
-
102,
|
|
3401
|
-
105,
|
|
3402
|
-
103
|
|
3403
|
-
];
|
|
3404
|
-
},
|
|
3405
|
-
{
|
|
3406
|
-
"kind": "arg";
|
|
3407
|
-
"path": "params.in_market_index";
|
|
3408
|
-
},
|
|
3409
|
-
{
|
|
3410
|
-
"kind": "arg";
|
|
3411
|
-
"path": "params.out_market_index";
|
|
3412
|
-
}
|
|
3413
|
-
];
|
|
3414
|
-
};
|
|
3415
|
-
},
|
|
3416
|
-
{
|
|
3417
|
-
"name": "state";
|
|
3418
|
-
},
|
|
3419
|
-
{
|
|
3420
|
-
"name": "rent";
|
|
3421
|
-
"address": "SysvarRent111111111111111111111111111111111";
|
|
3422
|
-
},
|
|
3423
|
-
{
|
|
3424
|
-
"name": "systemProgram";
|
|
3425
|
-
"address": "11111111111111111111111111111111";
|
|
3426
|
-
}
|
|
3427
|
-
];
|
|
3428
|
-
"args": [
|
|
3429
|
-
{
|
|
3430
|
-
"name": "params";
|
|
3431
|
-
"type": {
|
|
3432
|
-
"defined": {
|
|
3433
|
-
"name": "ifRebalanceConfigParams";
|
|
3434
|
-
};
|
|
3435
|
-
};
|
|
3436
|
-
}
|
|
3437
|
-
];
|
|
3438
|
-
},
|
|
3439
2795
|
{
|
|
3440
2796
|
"name": "initializeInsuranceFundStake";
|
|
3441
2797
|
"discriminator": [
|
|
@@ -8129,75 +7485,164 @@ export type Velocity = {
|
|
|
8129
7485
|
];
|
|
8130
7486
|
},
|
|
8131
7487
|
{
|
|
8132
|
-
"name": "
|
|
7488
|
+
"name": "sweepPerpMarketFees";
|
|
8133
7489
|
"discriminator": [
|
|
8134
|
-
|
|
8135
|
-
20,
|
|
7490
|
+
194,
|
|
8136
7491
|
147,
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
7492
|
+
181,
|
|
7493
|
+
230,
|
|
7494
|
+
193,
|
|
7495
|
+
155,
|
|
7496
|
+
241,
|
|
7497
|
+
225
|
|
8142
7498
|
];
|
|
8143
7499
|
"accounts": [
|
|
8144
|
-
{
|
|
8145
|
-
"name": "fromUser";
|
|
8146
|
-
"writable": true;
|
|
8147
|
-
},
|
|
8148
|
-
{
|
|
8149
|
-
"name": "toUser";
|
|
8150
|
-
"writable": true;
|
|
8151
|
-
},
|
|
8152
|
-
{
|
|
8153
|
-
"name": "userStats";
|
|
8154
|
-
"writable": true;
|
|
8155
|
-
},
|
|
8156
|
-
{
|
|
8157
|
-
"name": "authority";
|
|
8158
|
-
"signer": true;
|
|
8159
|
-
"relations": [
|
|
8160
|
-
"fromUser",
|
|
8161
|
-
"toUser",
|
|
8162
|
-
"userStats"
|
|
8163
|
-
];
|
|
8164
|
-
},
|
|
8165
7500
|
{
|
|
8166
7501
|
"name": "state";
|
|
8167
7502
|
},
|
|
8168
7503
|
{
|
|
8169
|
-
"name": "
|
|
7504
|
+
"name": "perpMarket";
|
|
7505
|
+
"writable": true;
|
|
8170
7506
|
"pda": {
|
|
8171
7507
|
"seeds": [
|
|
8172
7508
|
{
|
|
8173
7509
|
"kind": "const";
|
|
8174
7510
|
"value": [
|
|
8175
|
-
115,
|
|
8176
7511
|
112,
|
|
8177
|
-
|
|
8178
|
-
|
|
7512
|
+
101,
|
|
7513
|
+
114,
|
|
7514
|
+
112,
|
|
8179
7515
|
95,
|
|
8180
7516
|
109,
|
|
8181
7517
|
97,
|
|
8182
7518
|
114,
|
|
8183
7519
|
107,
|
|
8184
7520
|
101,
|
|
8185
|
-
116,
|
|
8186
|
-
95,
|
|
8187
|
-
118,
|
|
8188
|
-
97,
|
|
8189
|
-
117,
|
|
8190
|
-
108,
|
|
8191
7521
|
116
|
|
8192
7522
|
];
|
|
8193
7523
|
},
|
|
8194
7524
|
{
|
|
8195
7525
|
"kind": "arg";
|
|
8196
|
-
"path": "
|
|
7526
|
+
"path": "perpMarketIndex";
|
|
8197
7527
|
}
|
|
8198
7528
|
];
|
|
8199
7529
|
};
|
|
8200
|
-
}
|
|
7530
|
+
},
|
|
7531
|
+
{
|
|
7532
|
+
"name": "spotMarket";
|
|
7533
|
+
"docs": [
|
|
7534
|
+
"The perp market's quote spot market (enforced by the PDA derivation)"
|
|
7535
|
+
];
|
|
7536
|
+
"writable": true;
|
|
7537
|
+
"pda": {
|
|
7538
|
+
"seeds": [
|
|
7539
|
+
{
|
|
7540
|
+
"kind": "const";
|
|
7541
|
+
"value": [
|
|
7542
|
+
115,
|
|
7543
|
+
112,
|
|
7544
|
+
111,
|
|
7545
|
+
116,
|
|
7546
|
+
95,
|
|
7547
|
+
109,
|
|
7548
|
+
97,
|
|
7549
|
+
114,
|
|
7550
|
+
107,
|
|
7551
|
+
101,
|
|
7552
|
+
116
|
|
7553
|
+
];
|
|
7554
|
+
},
|
|
7555
|
+
{
|
|
7556
|
+
"kind": "account";
|
|
7557
|
+
"path": "perpMarket";
|
|
7558
|
+
}
|
|
7559
|
+
];
|
|
7560
|
+
};
|
|
7561
|
+
},
|
|
7562
|
+
{
|
|
7563
|
+
"name": "oracle";
|
|
7564
|
+
"relations": [
|
|
7565
|
+
"perpMarket"
|
|
7566
|
+
];
|
|
7567
|
+
}
|
|
7568
|
+
];
|
|
7569
|
+
"args": [
|
|
7570
|
+
{
|
|
7571
|
+
"name": "perpMarketIndex";
|
|
7572
|
+
"type": "u16";
|
|
7573
|
+
}
|
|
7574
|
+
];
|
|
7575
|
+
},
|
|
7576
|
+
{
|
|
7577
|
+
"name": "transferDeposit";
|
|
7578
|
+
"discriminator": [
|
|
7579
|
+
20,
|
|
7580
|
+
20,
|
|
7581
|
+
147,
|
|
7582
|
+
223,
|
|
7583
|
+
41,
|
|
7584
|
+
63,
|
|
7585
|
+
204,
|
|
7586
|
+
111
|
|
7587
|
+
];
|
|
7588
|
+
"accounts": [
|
|
7589
|
+
{
|
|
7590
|
+
"name": "fromUser";
|
|
7591
|
+
"writable": true;
|
|
7592
|
+
},
|
|
7593
|
+
{
|
|
7594
|
+
"name": "toUser";
|
|
7595
|
+
"writable": true;
|
|
7596
|
+
},
|
|
7597
|
+
{
|
|
7598
|
+
"name": "userStats";
|
|
7599
|
+
"writable": true;
|
|
7600
|
+
},
|
|
7601
|
+
{
|
|
7602
|
+
"name": "authority";
|
|
7603
|
+
"signer": true;
|
|
7604
|
+
"relations": [
|
|
7605
|
+
"fromUser",
|
|
7606
|
+
"toUser",
|
|
7607
|
+
"userStats"
|
|
7608
|
+
];
|
|
7609
|
+
},
|
|
7610
|
+
{
|
|
7611
|
+
"name": "state";
|
|
7612
|
+
},
|
|
7613
|
+
{
|
|
7614
|
+
"name": "spotMarketVault";
|
|
7615
|
+
"pda": {
|
|
7616
|
+
"seeds": [
|
|
7617
|
+
{
|
|
7618
|
+
"kind": "const";
|
|
7619
|
+
"value": [
|
|
7620
|
+
115,
|
|
7621
|
+
112,
|
|
7622
|
+
111,
|
|
7623
|
+
116,
|
|
7624
|
+
95,
|
|
7625
|
+
109,
|
|
7626
|
+
97,
|
|
7627
|
+
114,
|
|
7628
|
+
107,
|
|
7629
|
+
101,
|
|
7630
|
+
116,
|
|
7631
|
+
95,
|
|
7632
|
+
118,
|
|
7633
|
+
97,
|
|
7634
|
+
117,
|
|
7635
|
+
108,
|
|
7636
|
+
116
|
|
7637
|
+
];
|
|
7638
|
+
},
|
|
7639
|
+
{
|
|
7640
|
+
"kind": "arg";
|
|
7641
|
+
"path": "marketIndex";
|
|
7642
|
+
}
|
|
7643
|
+
];
|
|
7644
|
+
};
|
|
7645
|
+
}
|
|
8201
7646
|
];
|
|
8202
7647
|
"args": [
|
|
8203
7648
|
{
|
|
@@ -8733,120 +8178,6 @@ export type Velocity = {
|
|
|
8733
8178
|
}
|
|
8734
8179
|
];
|
|
8735
8180
|
},
|
|
8736
|
-
{
|
|
8737
|
-
"name": "transferProtocolIfSharesToRevenuePool";
|
|
8738
|
-
"discriminator": [
|
|
8739
|
-
236,
|
|
8740
|
-
136,
|
|
8741
|
-
147,
|
|
8742
|
-
153,
|
|
8743
|
-
146,
|
|
8744
|
-
205,
|
|
8745
|
-
104,
|
|
8746
|
-
29
|
|
8747
|
-
];
|
|
8748
|
-
"accounts": [
|
|
8749
|
-
{
|
|
8750
|
-
"name": "state";
|
|
8751
|
-
},
|
|
8752
|
-
{
|
|
8753
|
-
"name": "authority";
|
|
8754
|
-
"writable": true;
|
|
8755
|
-
"signer": true;
|
|
8756
|
-
},
|
|
8757
|
-
{
|
|
8758
|
-
"name": "insuranceFundVault";
|
|
8759
|
-
"writable": true;
|
|
8760
|
-
"pda": {
|
|
8761
|
-
"seeds": [
|
|
8762
|
-
{
|
|
8763
|
-
"kind": "const";
|
|
8764
|
-
"value": [
|
|
8765
|
-
105,
|
|
8766
|
-
110,
|
|
8767
|
-
115,
|
|
8768
|
-
117,
|
|
8769
|
-
114,
|
|
8770
|
-
97,
|
|
8771
|
-
110,
|
|
8772
|
-
99,
|
|
8773
|
-
101,
|
|
8774
|
-
95,
|
|
8775
|
-
102,
|
|
8776
|
-
117,
|
|
8777
|
-
110,
|
|
8778
|
-
100,
|
|
8779
|
-
95,
|
|
8780
|
-
118,
|
|
8781
|
-
97,
|
|
8782
|
-
117,
|
|
8783
|
-
108,
|
|
8784
|
-
116
|
|
8785
|
-
];
|
|
8786
|
-
},
|
|
8787
|
-
{
|
|
8788
|
-
"kind": "arg";
|
|
8789
|
-
"path": "marketIndex";
|
|
8790
|
-
}
|
|
8791
|
-
];
|
|
8792
|
-
};
|
|
8793
|
-
},
|
|
8794
|
-
{
|
|
8795
|
-
"name": "spotMarketVault";
|
|
8796
|
-
"writable": true;
|
|
8797
|
-
"pda": {
|
|
8798
|
-
"seeds": [
|
|
8799
|
-
{
|
|
8800
|
-
"kind": "const";
|
|
8801
|
-
"value": [
|
|
8802
|
-
115,
|
|
8803
|
-
112,
|
|
8804
|
-
111,
|
|
8805
|
-
116,
|
|
8806
|
-
95,
|
|
8807
|
-
109,
|
|
8808
|
-
97,
|
|
8809
|
-
114,
|
|
8810
|
-
107,
|
|
8811
|
-
101,
|
|
8812
|
-
116,
|
|
8813
|
-
95,
|
|
8814
|
-
118,
|
|
8815
|
-
97,
|
|
8816
|
-
117,
|
|
8817
|
-
108,
|
|
8818
|
-
116
|
|
8819
|
-
];
|
|
8820
|
-
},
|
|
8821
|
-
{
|
|
8822
|
-
"kind": "arg";
|
|
8823
|
-
"path": "marketIndex";
|
|
8824
|
-
}
|
|
8825
|
-
];
|
|
8826
|
-
};
|
|
8827
|
-
},
|
|
8828
|
-
{
|
|
8829
|
-
"name": "ifRebalanceConfig";
|
|
8830
|
-
"writable": true;
|
|
8831
|
-
},
|
|
8832
|
-
{
|
|
8833
|
-
"name": "tokenProgram";
|
|
8834
|
-
},
|
|
8835
|
-
{
|
|
8836
|
-
"name": "velocitySigner";
|
|
8837
|
-
}
|
|
8838
|
-
];
|
|
8839
|
-
"args": [
|
|
8840
|
-
{
|
|
8841
|
-
"name": "marketIndex";
|
|
8842
|
-
"type": "u16";
|
|
8843
|
-
},
|
|
8844
|
-
{
|
|
8845
|
-
"name": "amount";
|
|
8846
|
-
"type": "u64";
|
|
8847
|
-
}
|
|
8848
|
-
];
|
|
8849
|
-
},
|
|
8850
8181
|
{
|
|
8851
8182
|
"name": "triggerOrder";
|
|
8852
8183
|
"discriminator": [
|
|
@@ -9365,125 +8696,24 @@ export type Velocity = {
|
|
|
9365
8696
|
];
|
|
9366
8697
|
},
|
|
9367
8698
|
{
|
|
9368
|
-
"name": "
|
|
8699
|
+
"name": "updateDiscountMint";
|
|
9369
8700
|
"discriminator": [
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
8701
|
+
32,
|
|
8702
|
+
252,
|
|
8703
|
+
122,
|
|
8704
|
+
211,
|
|
8705
|
+
66,
|
|
8706
|
+
31,
|
|
8707
|
+
47,
|
|
8708
|
+
241
|
|
9378
8709
|
];
|
|
9379
8710
|
"accounts": [
|
|
9380
8711
|
{
|
|
9381
|
-
"name": "
|
|
9382
|
-
"
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
"kind": "const";
|
|
9387
|
-
"value": [
|
|
9388
|
-
115,
|
|
9389
|
-
112,
|
|
9390
|
-
111,
|
|
9391
|
-
116,
|
|
9392
|
-
95,
|
|
9393
|
-
109,
|
|
9394
|
-
97,
|
|
9395
|
-
114,
|
|
9396
|
-
107,
|
|
9397
|
-
101,
|
|
9398
|
-
116
|
|
9399
|
-
];
|
|
9400
|
-
},
|
|
9401
|
-
{
|
|
9402
|
-
"kind": "const";
|
|
9403
|
-
"value": [
|
|
9404
|
-
15,
|
|
9405
|
-
0
|
|
9406
|
-
];
|
|
9407
|
-
}
|
|
9408
|
-
];
|
|
9409
|
-
};
|
|
9410
|
-
},
|
|
9411
|
-
{
|
|
9412
|
-
"name": "insuranceFundStake";
|
|
9413
|
-
},
|
|
9414
|
-
{
|
|
9415
|
-
"name": "userStats";
|
|
9416
|
-
"writable": true;
|
|
9417
|
-
},
|
|
9418
|
-
{
|
|
9419
|
-
"name": "admin";
|
|
9420
|
-
"signer": true;
|
|
9421
|
-
},
|
|
9422
|
-
{
|
|
9423
|
-
"name": "insuranceFundVault";
|
|
9424
|
-
"writable": true;
|
|
9425
|
-
"pda": {
|
|
9426
|
-
"seeds": [
|
|
9427
|
-
{
|
|
9428
|
-
"kind": "const";
|
|
9429
|
-
"value": [
|
|
9430
|
-
105,
|
|
9431
|
-
110,
|
|
9432
|
-
115,
|
|
9433
|
-
117,
|
|
9434
|
-
114,
|
|
9435
|
-
97,
|
|
9436
|
-
110,
|
|
9437
|
-
99,
|
|
9438
|
-
101,
|
|
9439
|
-
95,
|
|
9440
|
-
102,
|
|
9441
|
-
117,
|
|
9442
|
-
110,
|
|
9443
|
-
100,
|
|
9444
|
-
95,
|
|
9445
|
-
118,
|
|
9446
|
-
97,
|
|
9447
|
-
117,
|
|
9448
|
-
108,
|
|
9449
|
-
116
|
|
9450
|
-
];
|
|
9451
|
-
},
|
|
9452
|
-
{
|
|
9453
|
-
"kind": "const";
|
|
9454
|
-
"value": [
|
|
9455
|
-
15,
|
|
9456
|
-
0
|
|
9457
|
-
];
|
|
9458
|
-
}
|
|
9459
|
-
];
|
|
9460
|
-
};
|
|
9461
|
-
},
|
|
9462
|
-
{
|
|
9463
|
-
"name": "state";
|
|
9464
|
-
}
|
|
9465
|
-
];
|
|
9466
|
-
"args": [];
|
|
9467
|
-
},
|
|
9468
|
-
{
|
|
9469
|
-
"name": "updateDiscountMint";
|
|
9470
|
-
"discriminator": [
|
|
9471
|
-
32,
|
|
9472
|
-
252,
|
|
9473
|
-
122,
|
|
9474
|
-
211,
|
|
9475
|
-
66,
|
|
9476
|
-
31,
|
|
9477
|
-
47,
|
|
9478
|
-
241
|
|
9479
|
-
];
|
|
9480
|
-
"accounts": [
|
|
9481
|
-
{
|
|
9482
|
-
"name": "admin";
|
|
9483
|
-
"signer": true;
|
|
9484
|
-
},
|
|
9485
|
-
{
|
|
9486
|
-
"name": "state";
|
|
8712
|
+
"name": "admin";
|
|
8713
|
+
"signer": true;
|
|
8714
|
+
},
|
|
8715
|
+
{
|
|
8716
|
+
"name": "state";
|
|
9487
8717
|
"writable": true;
|
|
9488
8718
|
}
|
|
9489
8719
|
];
|
|
@@ -9765,43 +8995,6 @@ export type Velocity = {
|
|
|
9765
8995
|
}
|
|
9766
8996
|
];
|
|
9767
8997
|
},
|
|
9768
|
-
{
|
|
9769
|
-
"name": "updateIfRebalanceConfig";
|
|
9770
|
-
"discriminator": [
|
|
9771
|
-
142,
|
|
9772
|
-
245,
|
|
9773
|
-
249,
|
|
9774
|
-
66,
|
|
9775
|
-
249,
|
|
9776
|
-
181,
|
|
9777
|
-
22,
|
|
9778
|
-
83
|
|
9779
|
-
];
|
|
9780
|
-
"accounts": [
|
|
9781
|
-
{
|
|
9782
|
-
"name": "admin";
|
|
9783
|
-
"writable": true;
|
|
9784
|
-
"signer": true;
|
|
9785
|
-
},
|
|
9786
|
-
{
|
|
9787
|
-
"name": "ifRebalanceConfig";
|
|
9788
|
-
"writable": true;
|
|
9789
|
-
},
|
|
9790
|
-
{
|
|
9791
|
-
"name": "state";
|
|
9792
|
-
}
|
|
9793
|
-
];
|
|
9794
|
-
"args": [
|
|
9795
|
-
{
|
|
9796
|
-
"name": "params";
|
|
9797
|
-
"type": {
|
|
9798
|
-
"defined": {
|
|
9799
|
-
"name": "ifRebalanceConfigParams";
|
|
9800
|
-
};
|
|
9801
|
-
};
|
|
9802
|
-
}
|
|
9803
|
-
];
|
|
9804
|
-
},
|
|
9805
8998
|
{
|
|
9806
8999
|
"name": "updateInitialAmmCacheInfo";
|
|
9807
9000
|
"discriminator": [
|
|
@@ -10638,6 +9831,70 @@ export type Velocity = {
|
|
|
10638
9831
|
}
|
|
10639
9832
|
];
|
|
10640
9833
|
},
|
|
9834
|
+
{
|
|
9835
|
+
"name": "updatePerpMarketFeePoolBufferTarget";
|
|
9836
|
+
"discriminator": [
|
|
9837
|
+
125,
|
|
9838
|
+
234,
|
|
9839
|
+
40,
|
|
9840
|
+
44,
|
|
9841
|
+
91,
|
|
9842
|
+
26,
|
|
9843
|
+
231,
|
|
9844
|
+
177
|
|
9845
|
+
];
|
|
9846
|
+
"accounts": [
|
|
9847
|
+
{
|
|
9848
|
+
"name": "admin";
|
|
9849
|
+
"signer": true;
|
|
9850
|
+
},
|
|
9851
|
+
{
|
|
9852
|
+
"name": "state";
|
|
9853
|
+
},
|
|
9854
|
+
{
|
|
9855
|
+
"name": "perpMarket";
|
|
9856
|
+
"writable": true;
|
|
9857
|
+
}
|
|
9858
|
+
];
|
|
9859
|
+
"args": [
|
|
9860
|
+
{
|
|
9861
|
+
"name": "feePoolBufferTarget";
|
|
9862
|
+
"type": "u64";
|
|
9863
|
+
}
|
|
9864
|
+
];
|
|
9865
|
+
},
|
|
9866
|
+
{
|
|
9867
|
+
"name": "updatePerpMarketFundingBiasSensitivity";
|
|
9868
|
+
"discriminator": [
|
|
9869
|
+
143,
|
|
9870
|
+
62,
|
|
9871
|
+
234,
|
|
9872
|
+
145,
|
|
9873
|
+
184,
|
|
9874
|
+
237,
|
|
9875
|
+
110,
|
|
9876
|
+
116
|
|
9877
|
+
];
|
|
9878
|
+
"accounts": [
|
|
9879
|
+
{
|
|
9880
|
+
"name": "admin";
|
|
9881
|
+
"signer": true;
|
|
9882
|
+
},
|
|
9883
|
+
{
|
|
9884
|
+
"name": "state";
|
|
9885
|
+
},
|
|
9886
|
+
{
|
|
9887
|
+
"name": "perpMarket";
|
|
9888
|
+
"writable": true;
|
|
9889
|
+
}
|
|
9890
|
+
];
|
|
9891
|
+
"args": [
|
|
9892
|
+
{
|
|
9893
|
+
"name": "fundingBiasSensitivity";
|
|
9894
|
+
"type": "u8";
|
|
9895
|
+
}
|
|
9896
|
+
];
|
|
9897
|
+
},
|
|
10641
9898
|
{
|
|
10642
9899
|
"name": "updatePerpMarketFundingPeriod";
|
|
10643
9900
|
"discriminator": [
|
|
@@ -10739,6 +9996,10 @@ export type Velocity = {
|
|
|
10739
9996
|
{
|
|
10740
9997
|
"name": "ifLiquidationFee";
|
|
10741
9998
|
"type": "u32";
|
|
9999
|
+
},
|
|
10000
|
+
{
|
|
10001
|
+
"name": "protocolLiquidationFee";
|
|
10002
|
+
"type": "u32";
|
|
10742
10003
|
}
|
|
10743
10004
|
];
|
|
10744
10005
|
},
|
|
@@ -11727,6 +10988,48 @@ export type Velocity = {
|
|
|
11727
10988
|
}
|
|
11728
10989
|
];
|
|
11729
10990
|
},
|
|
10991
|
+
{
|
|
10992
|
+
"name": "updateProtocolFeeRecipient";
|
|
10993
|
+
"docs": [
|
|
10994
|
+
"Cold-only: set the treasury protocol fees may be withdrawn to.",
|
|
10995
|
+
"Perp (quote) and spot (per-market token) recipients are configured",
|
|
10996
|
+
"independently via `market_type`."
|
|
10997
|
+
];
|
|
10998
|
+
"discriminator": [
|
|
10999
|
+
213,
|
|
11000
|
+
60,
|
|
11001
|
+
21,
|
|
11002
|
+
106,
|
|
11003
|
+
42,
|
|
11004
|
+
67,
|
|
11005
|
+
60,
|
|
11006
|
+
162
|
|
11007
|
+
];
|
|
11008
|
+
"accounts": [
|
|
11009
|
+
{
|
|
11010
|
+
"name": "state";
|
|
11011
|
+
"writable": true;
|
|
11012
|
+
},
|
|
11013
|
+
{
|
|
11014
|
+
"name": "admin";
|
|
11015
|
+
"signer": true;
|
|
11016
|
+
}
|
|
11017
|
+
];
|
|
11018
|
+
"args": [
|
|
11019
|
+
{
|
|
11020
|
+
"name": "protocolFeeRecipient";
|
|
11021
|
+
"type": "pubkey";
|
|
11022
|
+
},
|
|
11023
|
+
{
|
|
11024
|
+
"name": "marketType";
|
|
11025
|
+
"type": {
|
|
11026
|
+
"defined": {
|
|
11027
|
+
"name": "marketType";
|
|
11028
|
+
};
|
|
11029
|
+
};
|
|
11030
|
+
}
|
|
11031
|
+
];
|
|
11032
|
+
},
|
|
11730
11033
|
{
|
|
11731
11034
|
"name": "updateSpecialUserStatus";
|
|
11732
11035
|
"discriminator": [
|
|
@@ -12057,11 +11360,11 @@ export type Velocity = {
|
|
|
12057
11360
|
"type": "u16";
|
|
12058
11361
|
},
|
|
12059
11362
|
{
|
|
12060
|
-
"name": "
|
|
11363
|
+
"name": "ifFeeFactor";
|
|
12061
11364
|
"type": "u32";
|
|
12062
11365
|
},
|
|
12063
11366
|
{
|
|
12064
|
-
"name": "
|
|
11367
|
+
"name": "protocolFeeFactor";
|
|
12065
11368
|
"type": "u32";
|
|
12066
11369
|
}
|
|
12067
11370
|
];
|
|
@@ -12131,6 +11434,10 @@ export type Velocity = {
|
|
|
12131
11434
|
{
|
|
12132
11435
|
"name": "ifLiquidationFee";
|
|
12133
11436
|
"type": "u32";
|
|
11437
|
+
},
|
|
11438
|
+
{
|
|
11439
|
+
"name": "protocolLiquidationFee";
|
|
11440
|
+
"type": "u32";
|
|
12134
11441
|
}
|
|
12135
11442
|
];
|
|
12136
11443
|
},
|
|
@@ -12848,129 +12155,27 @@ export type Velocity = {
|
|
|
12848
12155
|
];
|
|
12849
12156
|
},
|
|
12850
12157
|
{
|
|
12851
|
-
"name": "
|
|
12158
|
+
"name": "updateUserIdle";
|
|
12852
12159
|
"discriminator": [
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12160
|
+
253,
|
|
12161
|
+
133,
|
|
12162
|
+
67,
|
|
12163
|
+
22,
|
|
12164
|
+
103,
|
|
12165
|
+
161,
|
|
12857
12166
|
20,
|
|
12858
|
-
|
|
12859
|
-
184,
|
|
12860
|
-
84
|
|
12167
|
+
100
|
|
12861
12168
|
];
|
|
12862
12169
|
"accounts": [
|
|
12863
12170
|
{
|
|
12864
12171
|
"name": "state";
|
|
12865
12172
|
},
|
|
12866
12173
|
{
|
|
12867
|
-
"name": "
|
|
12868
|
-
"
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
"kind": "const";
|
|
12873
|
-
"value": [
|
|
12874
|
-
115,
|
|
12875
|
-
112,
|
|
12876
|
-
111,
|
|
12877
|
-
116,
|
|
12878
|
-
95,
|
|
12879
|
-
109,
|
|
12880
|
-
97,
|
|
12881
|
-
114,
|
|
12882
|
-
107,
|
|
12883
|
-
101,
|
|
12884
|
-
116
|
|
12885
|
-
];
|
|
12886
|
-
},
|
|
12887
|
-
{
|
|
12888
|
-
"kind": "const";
|
|
12889
|
-
"value": [
|
|
12890
|
-
15,
|
|
12891
|
-
0
|
|
12892
|
-
];
|
|
12893
|
-
}
|
|
12894
|
-
];
|
|
12895
|
-
};
|
|
12896
|
-
},
|
|
12897
|
-
{
|
|
12898
|
-
"name": "insuranceFundStake";
|
|
12899
|
-
"writable": true;
|
|
12900
|
-
},
|
|
12901
|
-
{
|
|
12902
|
-
"name": "userStats";
|
|
12903
|
-
"writable": true;
|
|
12904
|
-
},
|
|
12905
|
-
{
|
|
12906
|
-
"name": "signer";
|
|
12907
|
-
"signer": true;
|
|
12908
|
-
},
|
|
12909
|
-
{
|
|
12910
|
-
"name": "insuranceFundVault";
|
|
12911
|
-
"writable": true;
|
|
12912
|
-
"pda": {
|
|
12913
|
-
"seeds": [
|
|
12914
|
-
{
|
|
12915
|
-
"kind": "const";
|
|
12916
|
-
"value": [
|
|
12917
|
-
105,
|
|
12918
|
-
110,
|
|
12919
|
-
115,
|
|
12920
|
-
117,
|
|
12921
|
-
114,
|
|
12922
|
-
97,
|
|
12923
|
-
110,
|
|
12924
|
-
99,
|
|
12925
|
-
101,
|
|
12926
|
-
95,
|
|
12927
|
-
102,
|
|
12928
|
-
117,
|
|
12929
|
-
110,
|
|
12930
|
-
100,
|
|
12931
|
-
95,
|
|
12932
|
-
118,
|
|
12933
|
-
97,
|
|
12934
|
-
117,
|
|
12935
|
-
108,
|
|
12936
|
-
116
|
|
12937
|
-
];
|
|
12938
|
-
},
|
|
12939
|
-
{
|
|
12940
|
-
"kind": "const";
|
|
12941
|
-
"value": [
|
|
12942
|
-
15,
|
|
12943
|
-
0
|
|
12944
|
-
];
|
|
12945
|
-
}
|
|
12946
|
-
];
|
|
12947
|
-
};
|
|
12948
|
-
}
|
|
12949
|
-
];
|
|
12950
|
-
"args": [];
|
|
12951
|
-
},
|
|
12952
|
-
{
|
|
12953
|
-
"name": "updateUserIdle";
|
|
12954
|
-
"discriminator": [
|
|
12955
|
-
253,
|
|
12956
|
-
133,
|
|
12957
|
-
67,
|
|
12958
|
-
22,
|
|
12959
|
-
103,
|
|
12960
|
-
161,
|
|
12961
|
-
20,
|
|
12962
|
-
100
|
|
12963
|
-
];
|
|
12964
|
-
"accounts": [
|
|
12965
|
-
{
|
|
12966
|
-
"name": "state";
|
|
12967
|
-
},
|
|
12968
|
-
{
|
|
12969
|
-
"name": "authority";
|
|
12970
|
-
"signer": true;
|
|
12971
|
-
},
|
|
12972
|
-
{
|
|
12973
|
-
"name": "filler";
|
|
12174
|
+
"name": "authority";
|
|
12175
|
+
"signer": true;
|
|
12176
|
+
},
|
|
12177
|
+
{
|
|
12178
|
+
"name": "filler";
|
|
12974
12179
|
"writable": true;
|
|
12975
12180
|
},
|
|
12976
12181
|
{
|
|
@@ -13419,6 +12624,12 @@ export type Velocity = {
|
|
|
13419
12624
|
{
|
|
13420
12625
|
"name": "spotMarket";
|
|
13421
12626
|
"writable": true;
|
|
12627
|
+
},
|
|
12628
|
+
{
|
|
12629
|
+
"name": "oracle";
|
|
12630
|
+
"relations": [
|
|
12631
|
+
"spotMarket"
|
|
12632
|
+
];
|
|
13422
12633
|
}
|
|
13423
12634
|
];
|
|
13424
12635
|
"args": [
|
|
@@ -13918,32 +13129,426 @@ export type Velocity = {
|
|
|
13918
13129
|
"name": "velocitySigner";
|
|
13919
13130
|
},
|
|
13920
13131
|
{
|
|
13921
|
-
"name": "constituent";
|
|
13922
|
-
"writable": true;
|
|
13132
|
+
"name": "constituent";
|
|
13133
|
+
"writable": true;
|
|
13134
|
+
},
|
|
13135
|
+
{
|
|
13136
|
+
"name": "constituentTokenAccount";
|
|
13137
|
+
"writable": true;
|
|
13138
|
+
},
|
|
13139
|
+
{
|
|
13140
|
+
"name": "spotMarket";
|
|
13141
|
+
"writable": true;
|
|
13142
|
+
},
|
|
13143
|
+
{
|
|
13144
|
+
"name": "spotMarketVault";
|
|
13145
|
+
"writable": true;
|
|
13146
|
+
},
|
|
13147
|
+
{
|
|
13148
|
+
"name": "tokenProgram";
|
|
13149
|
+
},
|
|
13150
|
+
{
|
|
13151
|
+
"name": "mint";
|
|
13152
|
+
},
|
|
13153
|
+
{
|
|
13154
|
+
"name": "oracle";
|
|
13155
|
+
}
|
|
13156
|
+
];
|
|
13157
|
+
"args": [
|
|
13158
|
+
{
|
|
13159
|
+
"name": "amount";
|
|
13160
|
+
"type": "u64";
|
|
13161
|
+
}
|
|
13162
|
+
];
|
|
13163
|
+
},
|
|
13164
|
+
{
|
|
13165
|
+
"name": "withdrawProtocolFeesPerp";
|
|
13166
|
+
"docs": [
|
|
13167
|
+
"Withdraw a perp market's accrued protocol fees (from the quote spot vault)",
|
|
13168
|
+
"to `protocol_fee_recipient_perp` (auth: `FeeWithdraw` hot key)."
|
|
13169
|
+
];
|
|
13170
|
+
"discriminator": [
|
|
13171
|
+
227,
|
|
13172
|
+
99,
|
|
13173
|
+
23,
|
|
13174
|
+
227,
|
|
13175
|
+
168,
|
|
13176
|
+
217,
|
|
13177
|
+
136,
|
|
13178
|
+
181
|
|
13179
|
+
];
|
|
13180
|
+
"accounts": [
|
|
13181
|
+
{
|
|
13182
|
+
"name": "state";
|
|
13183
|
+
},
|
|
13184
|
+
{
|
|
13185
|
+
"name": "payer";
|
|
13186
|
+
"writable": true;
|
|
13187
|
+
"signer": true;
|
|
13188
|
+
},
|
|
13189
|
+
{
|
|
13190
|
+
"name": "authority";
|
|
13191
|
+
"signer": true;
|
|
13192
|
+
},
|
|
13193
|
+
{
|
|
13194
|
+
"name": "perpMarket";
|
|
13195
|
+
"writable": true;
|
|
13196
|
+
"pda": {
|
|
13197
|
+
"seeds": [
|
|
13198
|
+
{
|
|
13199
|
+
"kind": "const";
|
|
13200
|
+
"value": [
|
|
13201
|
+
112,
|
|
13202
|
+
101,
|
|
13203
|
+
114,
|
|
13204
|
+
112,
|
|
13205
|
+
95,
|
|
13206
|
+
109,
|
|
13207
|
+
97,
|
|
13208
|
+
114,
|
|
13209
|
+
107,
|
|
13210
|
+
101,
|
|
13211
|
+
116
|
|
13212
|
+
];
|
|
13213
|
+
},
|
|
13214
|
+
{
|
|
13215
|
+
"kind": "arg";
|
|
13216
|
+
"path": "marketIndex";
|
|
13217
|
+
}
|
|
13218
|
+
];
|
|
13219
|
+
};
|
|
13220
|
+
},
|
|
13221
|
+
{
|
|
13222
|
+
"name": "quoteSpotMarket";
|
|
13223
|
+
"writable": true;
|
|
13224
|
+
"pda": {
|
|
13225
|
+
"seeds": [
|
|
13226
|
+
{
|
|
13227
|
+
"kind": "const";
|
|
13228
|
+
"value": [
|
|
13229
|
+
115,
|
|
13230
|
+
112,
|
|
13231
|
+
111,
|
|
13232
|
+
116,
|
|
13233
|
+
95,
|
|
13234
|
+
109,
|
|
13235
|
+
97,
|
|
13236
|
+
114,
|
|
13237
|
+
107,
|
|
13238
|
+
101,
|
|
13239
|
+
116
|
|
13240
|
+
];
|
|
13241
|
+
},
|
|
13242
|
+
{
|
|
13243
|
+
"kind": "account";
|
|
13244
|
+
"path": "perpMarket";
|
|
13245
|
+
}
|
|
13246
|
+
];
|
|
13247
|
+
};
|
|
13248
|
+
},
|
|
13249
|
+
{
|
|
13250
|
+
"name": "spotMarketVault";
|
|
13251
|
+
"writable": true;
|
|
13252
|
+
"pda": {
|
|
13253
|
+
"seeds": [
|
|
13254
|
+
{
|
|
13255
|
+
"kind": "const";
|
|
13256
|
+
"value": [
|
|
13257
|
+
115,
|
|
13258
|
+
112,
|
|
13259
|
+
111,
|
|
13260
|
+
116,
|
|
13261
|
+
95,
|
|
13262
|
+
109,
|
|
13263
|
+
97,
|
|
13264
|
+
114,
|
|
13265
|
+
107,
|
|
13266
|
+
101,
|
|
13267
|
+
116,
|
|
13268
|
+
95,
|
|
13269
|
+
118,
|
|
13270
|
+
97,
|
|
13271
|
+
117,
|
|
13272
|
+
108,
|
|
13273
|
+
116
|
|
13274
|
+
];
|
|
13275
|
+
},
|
|
13276
|
+
{
|
|
13277
|
+
"kind": "account";
|
|
13278
|
+
"path": "perpMarket";
|
|
13279
|
+
}
|
|
13280
|
+
];
|
|
13281
|
+
};
|
|
13282
|
+
},
|
|
13283
|
+
{
|
|
13284
|
+
"name": "mint";
|
|
13285
|
+
"relations": [
|
|
13286
|
+
"spotMarketVault"
|
|
13287
|
+
];
|
|
13288
|
+
},
|
|
13289
|
+
{
|
|
13290
|
+
"name": "recipient";
|
|
13291
|
+
},
|
|
13292
|
+
{
|
|
13293
|
+
"name": "recipientTokenAccount";
|
|
13294
|
+
"writable": true;
|
|
13295
|
+
"pda": {
|
|
13296
|
+
"seeds": [
|
|
13297
|
+
{
|
|
13298
|
+
"kind": "account";
|
|
13299
|
+
"path": "recipient";
|
|
13300
|
+
},
|
|
13301
|
+
{
|
|
13302
|
+
"kind": "account";
|
|
13303
|
+
"path": "tokenProgram";
|
|
13304
|
+
},
|
|
13305
|
+
{
|
|
13306
|
+
"kind": "account";
|
|
13307
|
+
"path": "mint";
|
|
13308
|
+
}
|
|
13309
|
+
];
|
|
13310
|
+
"program": {
|
|
13311
|
+
"kind": "const";
|
|
13312
|
+
"value": [
|
|
13313
|
+
140,
|
|
13314
|
+
151,
|
|
13315
|
+
37,
|
|
13316
|
+
143,
|
|
13317
|
+
78,
|
|
13318
|
+
36,
|
|
13319
|
+
137,
|
|
13320
|
+
241,
|
|
13321
|
+
187,
|
|
13322
|
+
61,
|
|
13323
|
+
16,
|
|
13324
|
+
41,
|
|
13325
|
+
20,
|
|
13326
|
+
142,
|
|
13327
|
+
13,
|
|
13328
|
+
131,
|
|
13329
|
+
11,
|
|
13330
|
+
90,
|
|
13331
|
+
19,
|
|
13332
|
+
153,
|
|
13333
|
+
218,
|
|
13334
|
+
255,
|
|
13335
|
+
16,
|
|
13336
|
+
132,
|
|
13337
|
+
4,
|
|
13338
|
+
142,
|
|
13339
|
+
123,
|
|
13340
|
+
216,
|
|
13341
|
+
219,
|
|
13342
|
+
233,
|
|
13343
|
+
248,
|
|
13344
|
+
89
|
|
13345
|
+
];
|
|
13346
|
+
};
|
|
13347
|
+
};
|
|
13348
|
+
},
|
|
13349
|
+
{
|
|
13350
|
+
"name": "tokenProgram";
|
|
13351
|
+
},
|
|
13352
|
+
{
|
|
13353
|
+
"name": "velocitySigner";
|
|
13354
|
+
},
|
|
13355
|
+
{
|
|
13356
|
+
"name": "systemProgram";
|
|
13357
|
+
"address": "11111111111111111111111111111111";
|
|
13358
|
+
},
|
|
13359
|
+
{
|
|
13360
|
+
"name": "associatedTokenProgram";
|
|
13361
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
13362
|
+
}
|
|
13363
|
+
];
|
|
13364
|
+
"args": [
|
|
13365
|
+
{
|
|
13366
|
+
"name": "marketIndex";
|
|
13367
|
+
"type": "u16";
|
|
13368
|
+
},
|
|
13369
|
+
{
|
|
13370
|
+
"name": "amount";
|
|
13371
|
+
"type": "u64";
|
|
13372
|
+
}
|
|
13373
|
+
];
|
|
13374
|
+
},
|
|
13375
|
+
{
|
|
13376
|
+
"name": "withdrawProtocolFeesSpot";
|
|
13377
|
+
"docs": [
|
|
13378
|
+
"Withdraw a spot market's accrued protocol fees to `protocol_fee_recipient_spot`",
|
|
13379
|
+
"(auth: `FeeWithdraw` hot key)."
|
|
13380
|
+
];
|
|
13381
|
+
"discriminator": [
|
|
13382
|
+
177,
|
|
13383
|
+
216,
|
|
13384
|
+
30,
|
|
13385
|
+
239,
|
|
13386
|
+
253,
|
|
13387
|
+
177,
|
|
13388
|
+
123,
|
|
13389
|
+
155
|
|
13390
|
+
];
|
|
13391
|
+
"accounts": [
|
|
13392
|
+
{
|
|
13393
|
+
"name": "state";
|
|
13394
|
+
},
|
|
13395
|
+
{
|
|
13396
|
+
"name": "payer";
|
|
13397
|
+
"writable": true;
|
|
13398
|
+
"signer": true;
|
|
13399
|
+
},
|
|
13400
|
+
{
|
|
13401
|
+
"name": "authority";
|
|
13402
|
+
"signer": true;
|
|
13403
|
+
},
|
|
13404
|
+
{
|
|
13405
|
+
"name": "spotMarket";
|
|
13406
|
+
"writable": true;
|
|
13407
|
+
"pda": {
|
|
13408
|
+
"seeds": [
|
|
13409
|
+
{
|
|
13410
|
+
"kind": "const";
|
|
13411
|
+
"value": [
|
|
13412
|
+
115,
|
|
13413
|
+
112,
|
|
13414
|
+
111,
|
|
13415
|
+
116,
|
|
13416
|
+
95,
|
|
13417
|
+
109,
|
|
13418
|
+
97,
|
|
13419
|
+
114,
|
|
13420
|
+
107,
|
|
13421
|
+
101,
|
|
13422
|
+
116
|
|
13423
|
+
];
|
|
13424
|
+
},
|
|
13425
|
+
{
|
|
13426
|
+
"kind": "arg";
|
|
13427
|
+
"path": "marketIndex";
|
|
13428
|
+
}
|
|
13429
|
+
];
|
|
13430
|
+
};
|
|
13431
|
+
},
|
|
13432
|
+
{
|
|
13433
|
+
"name": "spotMarketVault";
|
|
13434
|
+
"writable": true;
|
|
13435
|
+
"pda": {
|
|
13436
|
+
"seeds": [
|
|
13437
|
+
{
|
|
13438
|
+
"kind": "const";
|
|
13439
|
+
"value": [
|
|
13440
|
+
115,
|
|
13441
|
+
112,
|
|
13442
|
+
111,
|
|
13443
|
+
116,
|
|
13444
|
+
95,
|
|
13445
|
+
109,
|
|
13446
|
+
97,
|
|
13447
|
+
114,
|
|
13448
|
+
107,
|
|
13449
|
+
101,
|
|
13450
|
+
116,
|
|
13451
|
+
95,
|
|
13452
|
+
118,
|
|
13453
|
+
97,
|
|
13454
|
+
117,
|
|
13455
|
+
108,
|
|
13456
|
+
116
|
|
13457
|
+
];
|
|
13458
|
+
},
|
|
13459
|
+
{
|
|
13460
|
+
"kind": "arg";
|
|
13461
|
+
"path": "marketIndex";
|
|
13462
|
+
}
|
|
13463
|
+
];
|
|
13464
|
+
};
|
|
13465
|
+
},
|
|
13466
|
+
{
|
|
13467
|
+
"name": "mint";
|
|
13468
|
+
"relations": [
|
|
13469
|
+
"spotMarketVault"
|
|
13470
|
+
];
|
|
13923
13471
|
},
|
|
13924
13472
|
{
|
|
13925
|
-
"name": "
|
|
13926
|
-
"writable": true;
|
|
13473
|
+
"name": "recipient";
|
|
13927
13474
|
},
|
|
13928
13475
|
{
|
|
13929
|
-
"name": "
|
|
13476
|
+
"name": "recipientTokenAccount";
|
|
13930
13477
|
"writable": true;
|
|
13478
|
+
"pda": {
|
|
13479
|
+
"seeds": [
|
|
13480
|
+
{
|
|
13481
|
+
"kind": "account";
|
|
13482
|
+
"path": "recipient";
|
|
13483
|
+
},
|
|
13484
|
+
{
|
|
13485
|
+
"kind": "account";
|
|
13486
|
+
"path": "tokenProgram";
|
|
13487
|
+
},
|
|
13488
|
+
{
|
|
13489
|
+
"kind": "account";
|
|
13490
|
+
"path": "mint";
|
|
13491
|
+
}
|
|
13492
|
+
];
|
|
13493
|
+
"program": {
|
|
13494
|
+
"kind": "const";
|
|
13495
|
+
"value": [
|
|
13496
|
+
140,
|
|
13497
|
+
151,
|
|
13498
|
+
37,
|
|
13499
|
+
143,
|
|
13500
|
+
78,
|
|
13501
|
+
36,
|
|
13502
|
+
137,
|
|
13503
|
+
241,
|
|
13504
|
+
187,
|
|
13505
|
+
61,
|
|
13506
|
+
16,
|
|
13507
|
+
41,
|
|
13508
|
+
20,
|
|
13509
|
+
142,
|
|
13510
|
+
13,
|
|
13511
|
+
131,
|
|
13512
|
+
11,
|
|
13513
|
+
90,
|
|
13514
|
+
19,
|
|
13515
|
+
153,
|
|
13516
|
+
218,
|
|
13517
|
+
255,
|
|
13518
|
+
16,
|
|
13519
|
+
132,
|
|
13520
|
+
4,
|
|
13521
|
+
142,
|
|
13522
|
+
123,
|
|
13523
|
+
216,
|
|
13524
|
+
219,
|
|
13525
|
+
233,
|
|
13526
|
+
248,
|
|
13527
|
+
89
|
|
13528
|
+
];
|
|
13529
|
+
};
|
|
13530
|
+
};
|
|
13931
13531
|
},
|
|
13932
13532
|
{
|
|
13933
|
-
"name": "
|
|
13934
|
-
"writable": true;
|
|
13533
|
+
"name": "tokenProgram";
|
|
13935
13534
|
},
|
|
13936
13535
|
{
|
|
13937
|
-
"name": "
|
|
13536
|
+
"name": "velocitySigner";
|
|
13938
13537
|
},
|
|
13939
13538
|
{
|
|
13940
|
-
"name": "
|
|
13539
|
+
"name": "systemProgram";
|
|
13540
|
+
"address": "11111111111111111111111111111111";
|
|
13941
13541
|
},
|
|
13942
13542
|
{
|
|
13943
|
-
"name": "
|
|
13543
|
+
"name": "associatedTokenProgram";
|
|
13544
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
13944
13545
|
}
|
|
13945
13546
|
];
|
|
13946
13547
|
"args": [
|
|
13548
|
+
{
|
|
13549
|
+
"name": "marketIndex";
|
|
13550
|
+
"type": "u16";
|
|
13551
|
+
},
|
|
13947
13552
|
{
|
|
13948
13553
|
"name": "amount";
|
|
13949
13554
|
"type": "u64";
|
|
@@ -14044,19 +13649,6 @@ export type Velocity = {
|
|
|
14044
13649
|
99
|
|
14045
13650
|
];
|
|
14046
13651
|
},
|
|
14047
|
-
{
|
|
14048
|
-
"name": "ifRebalanceConfig";
|
|
14049
|
-
"discriminator": [
|
|
14050
|
-
214,
|
|
14051
|
-
84,
|
|
14052
|
-
40,
|
|
14053
|
-
251,
|
|
14054
|
-
107,
|
|
14055
|
-
144,
|
|
14056
|
-
173,
|
|
14057
|
-
239
|
|
14058
|
-
];
|
|
14059
|
-
},
|
|
14060
13652
|
{
|
|
14061
13653
|
"name": "insuranceFundStake";
|
|
14062
13654
|
"discriminator": [
|
|
@@ -14241,19 +13833,6 @@ export type Velocity = {
|
|
|
14241
13833
|
}
|
|
14242
13834
|
];
|
|
14243
13835
|
"events": [
|
|
14244
|
-
{
|
|
14245
|
-
"name": "adminWithdrawFromInsuranceFundRecord";
|
|
14246
|
-
"discriminator": [
|
|
14247
|
-
230,
|
|
14248
|
-
236,
|
|
14249
|
-
10,
|
|
14250
|
-
0,
|
|
14251
|
-
196,
|
|
14252
|
-
41,
|
|
14253
|
-
147,
|
|
14254
|
-
45
|
|
14255
|
-
];
|
|
14256
|
-
},
|
|
14257
13836
|
{
|
|
14258
13837
|
"name": "ammCurveChanged";
|
|
14259
13838
|
"discriminator": [
|
|
@@ -14345,19 +13924,6 @@ export type Velocity = {
|
|
|
14345
13924
|
114
|
|
14346
13925
|
];
|
|
14347
13926
|
},
|
|
14348
|
-
{
|
|
14349
|
-
"name": "insuranceFundSwapRecord";
|
|
14350
|
-
"discriminator": [
|
|
14351
|
-
85,
|
|
14352
|
-
190,
|
|
14353
|
-
99,
|
|
14354
|
-
203,
|
|
14355
|
-
237,
|
|
14356
|
-
33,
|
|
14357
|
-
227,
|
|
14358
|
-
100
|
|
14359
|
-
];
|
|
14360
|
-
},
|
|
14361
13927
|
{
|
|
14362
13928
|
"name": "lpBorrowLendDepositRecord";
|
|
14363
13929
|
"discriminator": [
|
|
@@ -14462,6 +14028,32 @@ export type Velocity = {
|
|
|
14462
14028
|
90
|
|
14463
14029
|
];
|
|
14464
14030
|
},
|
|
14031
|
+
{
|
|
14032
|
+
"name": "perpMarketFeeSweepRecord";
|
|
14033
|
+
"discriminator": [
|
|
14034
|
+
55,
|
|
14035
|
+
107,
|
|
14036
|
+
227,
|
|
14037
|
+
104,
|
|
14038
|
+
179,
|
|
14039
|
+
8,
|
|
14040
|
+
121,
|
|
14041
|
+
33
|
|
14042
|
+
];
|
|
14043
|
+
},
|
|
14044
|
+
{
|
|
14045
|
+
"name": "protocolFeeWithdrawRecord";
|
|
14046
|
+
"discriminator": [
|
|
14047
|
+
249,
|
|
14048
|
+
158,
|
|
14049
|
+
52,
|
|
14050
|
+
81,
|
|
14051
|
+
30,
|
|
14052
|
+
11,
|
|
14053
|
+
45,
|
|
14054
|
+
149
|
|
14055
|
+
];
|
|
14056
|
+
},
|
|
14465
14057
|
{
|
|
14466
14058
|
"name": "revenueShareSettleRecord";
|
|
14467
14059
|
"discriminator": [
|
|
@@ -14553,19 +14145,6 @@ export type Velocity = {
|
|
|
14553
14145
|
12
|
|
14554
14146
|
];
|
|
14555
14147
|
},
|
|
14556
|
-
{
|
|
14557
|
-
"name": "transferProtocolIfSharesToRevenuePoolRecord";
|
|
14558
|
-
"discriminator": [
|
|
14559
|
-
209,
|
|
14560
|
-
118,
|
|
14561
|
-
142,
|
|
14562
|
-
167,
|
|
14563
|
-
130,
|
|
14564
|
-
46,
|
|
14565
|
-
164,
|
|
14566
|
-
151
|
|
14567
|
-
];
|
|
14568
|
-
},
|
|
14569
14148
|
{
|
|
14570
14149
|
"name": "signedMsgOrderParamsExport";
|
|
14571
14150
|
"discriminator": [
|
|
@@ -16340,6 +15919,21 @@ export type Velocity = {
|
|
|
16340
15919
|
"code": 6351;
|
|
16341
15920
|
"name": "invalidAdminTier";
|
|
16342
15921
|
"msg": "Signer is not authorized for this admin tier";
|
|
15922
|
+
},
|
|
15923
|
+
{
|
|
15924
|
+
"code": 6352;
|
|
15925
|
+
"name": "withdrawGuardThresholdNotionalTooLarge";
|
|
15926
|
+
"msg": "Withdraw guard threshold notional exceeds max";
|
|
15927
|
+
},
|
|
15928
|
+
{
|
|
15929
|
+
"code": 6353;
|
|
15930
|
+
"name": "invalidProtocolFeeRecipient";
|
|
15931
|
+
"msg": "Recipient must be the configured protocol fee recipient";
|
|
15932
|
+
},
|
|
15933
|
+
{
|
|
15934
|
+
"code": 6354;
|
|
15935
|
+
"name": "insufficientProtocolFees";
|
|
15936
|
+
"msg": "Insufficient protocol fees available to withdraw";
|
|
16343
15937
|
}
|
|
16344
15938
|
];
|
|
16345
15939
|
"types": [
|
|
@@ -16439,7 +16033,11 @@ export type Velocity = {
|
|
|
16439
16033
|
{
|
|
16440
16034
|
"name": "totalFee";
|
|
16441
16035
|
"docs": [
|
|
16442
|
-
"
|
|
16036
|
+
"Lifetime fee-derived income booked to the AMM ITSELF (analytics):",
|
|
16037
|
+
"its fee provision (the `amm_fee` cut of trade-fee remainders) plus",
|
|
16038
|
+
"spread surplus. NOT the market's gross fees — those live in",
|
|
16039
|
+
"`PerpMarket.fee_ledger.total_exchange_fee`. Adjusted in lockstep with",
|
|
16040
|
+
"`total_fee_minus_distributions` by admin summary-stats corrections.",
|
|
16443
16041
|
"precision: QUOTE_PRECISION"
|
|
16444
16042
|
];
|
|
16445
16043
|
"type": "i128";
|
|
@@ -16447,7 +16045,9 @@ export type Velocity = {
|
|
|
16447
16045
|
{
|
|
16448
16046
|
"name": "totalMmFee";
|
|
16449
16047
|
"docs": [
|
|
16450
|
-
"
|
|
16048
|
+
"Spread-capture component of `total_fee` (analytics): the gap between",
|
|
16049
|
+
"the curve price and the execution price on AMM fills. Trading profit,",
|
|
16050
|
+
"not a fee anyone explicitly pays.",
|
|
16451
16051
|
"precision: QUOTE_PRECISION"
|
|
16452
16052
|
];
|
|
16453
16053
|
"type": "i128";
|
|
@@ -16455,7 +16055,14 @@ export type Velocity = {
|
|
|
16455
16055
|
{
|
|
16456
16056
|
"name": "totalFeeMinusDistributions";
|
|
16457
16057
|
"docs": [
|
|
16458
|
-
"
|
|
16058
|
+
"The AMM's equity ledger (retained earnings) — broader than the name",
|
|
16059
|
+
"suggests: fee income (`apply_fill_fees`) + funding and other P&L",
|
|
16060
|
+
"(`record_amm_pnl`) + external credits (`record_credit`), minus",
|
|
16061
|
+
"curve-adjustment costs (`apply_cost`) and bankruptcy clawbacks.",
|
|
16062
|
+
"Contains ONLY the AMM's own money (protocol/IF carveouts never enter",
|
|
16063
|
+
"it). Drives `is_underwater`, the drawdown breaker, and curve-cost",
|
|
16064
|
+
"budgets; reconciled against pool balances by",
|
|
16065
|
+
"`calculate_perp_market_amm_summary_stats`.",
|
|
16459
16066
|
"precision: QUOTE_PRECISION"
|
|
16460
16067
|
];
|
|
16461
16068
|
"type": "i128";
|
|
@@ -16463,7 +16070,9 @@ export type Velocity = {
|
|
|
16463
16070
|
{
|
|
16464
16071
|
"name": "totalFeeWithdrawn";
|
|
16465
16072
|
"docs": [
|
|
16466
|
-
"
|
|
16073
|
+
"@deprecated frozen analytics counter from the pre-isolation design",
|
|
16074
|
+
"(sum of fees withdrawn from the fee pool to the revenue pool). The",
|
|
16075
|
+
"sweep no longer touches the AMM's pools, so nothing writes this.",
|
|
16467
16076
|
"precision: QUOTE_PRECISION"
|
|
16468
16077
|
];
|
|
16469
16078
|
"type": "u128";
|
|
@@ -16641,12 +16250,25 @@ export type Velocity = {
|
|
|
16641
16250
|
"name": "referencePriceOffsetDeadbandPct";
|
|
16642
16251
|
"type": "u8";
|
|
16643
16252
|
},
|
|
16253
|
+
{
|
|
16254
|
+
"name": "fundingBiasSensitivity";
|
|
16255
|
+
"docs": [
|
|
16256
|
+
"s in the funding bias β(f) = 1 + s * ρ(f): how much the paying-side",
|
|
16257
|
+
"spread widens while the vAMM pays funding on its inventory.",
|
|
16258
|
+
"",
|
|
16259
|
+
"s is stored in hundredths (s = value / 100), so at full ramp (ρ = 1)",
|
|
16260
|
+
"the multiplier is 1 + value/100: 50 => 1.5x, 100 => 2x, u8 caps s at",
|
|
16261
|
+
"2.55. Same convention as `amm_spread_adjustment` (100 = double).",
|
|
16262
|
+
"0 disables the bias."
|
|
16263
|
+
];
|
|
16264
|
+
"type": "u8";
|
|
16265
|
+
},
|
|
16644
16266
|
{
|
|
16645
16267
|
"name": "paddingPostAmm";
|
|
16646
16268
|
"type": {
|
|
16647
16269
|
"array": [
|
|
16648
16270
|
"u8",
|
|
16649
|
-
|
|
16271
|
+
2
|
|
16650
16272
|
];
|
|
16651
16273
|
};
|
|
16652
16274
|
}
|
|
@@ -16673,50 +16295,6 @@ export type Velocity = {
|
|
|
16673
16295
|
];
|
|
16674
16296
|
};
|
|
16675
16297
|
},
|
|
16676
|
-
{
|
|
16677
|
-
"name": "adminWithdrawFromInsuranceFundRecord";
|
|
16678
|
-
"type": {
|
|
16679
|
-
"kind": "struct";
|
|
16680
|
-
"fields": [
|
|
16681
|
-
{
|
|
16682
|
-
"name": "ts";
|
|
16683
|
-
"type": "i64";
|
|
16684
|
-
},
|
|
16685
|
-
{
|
|
16686
|
-
"name": "marketIndex";
|
|
16687
|
-
"type": "u16";
|
|
16688
|
-
},
|
|
16689
|
-
{
|
|
16690
|
-
"name": "admin";
|
|
16691
|
-
"type": "pubkey";
|
|
16692
|
-
},
|
|
16693
|
-
{
|
|
16694
|
-
"name": "amount";
|
|
16695
|
-
"type": "u64";
|
|
16696
|
-
},
|
|
16697
|
-
{
|
|
16698
|
-
"name": "sharesBurned";
|
|
16699
|
-
"type": "u128";
|
|
16700
|
-
},
|
|
16701
|
-
{
|
|
16702
|
-
"name": "insuranceFundVaultAmountBefore";
|
|
16703
|
-
"type": "u64";
|
|
16704
|
-
},
|
|
16705
|
-
{
|
|
16706
|
-
"name": "protocolSharesBefore";
|
|
16707
|
-
"type": "u128";
|
|
16708
|
-
},
|
|
16709
|
-
{
|
|
16710
|
-
"name": "protocolSharesAfter";
|
|
16711
|
-
"type": "u128";
|
|
16712
|
-
},
|
|
16713
|
-
{
|
|
16714
|
-
"name": "recipientTokenAccount";
|
|
16715
|
-
"type": "pubkey";
|
|
16716
|
-
}
|
|
16717
|
-
];
|
|
16718
|
-
};
|
|
16719
|
-
},
|
|
16720
16298
|
{
|
|
16721
16299
|
"name": "ammCache";
|
|
16722
16300
|
"type": {
|
|
@@ -17646,52 +17224,126 @@ export type Velocity = {
|
|
|
17646
17224
|
"type": "u128";
|
|
17647
17225
|
},
|
|
17648
17226
|
{
|
|
17649
|
-
"name": "marketCumulativeBorrowInterest";
|
|
17227
|
+
"name": "marketCumulativeBorrowInterest";
|
|
17228
|
+
"docs": [
|
|
17229
|
+
"precision: SPOT_CUMULATIVE_INTEREST_PRECISION"
|
|
17230
|
+
];
|
|
17231
|
+
"type": "u128";
|
|
17232
|
+
},
|
|
17233
|
+
{
|
|
17234
|
+
"name": "totalDepositsAfter";
|
|
17235
|
+
"docs": [
|
|
17236
|
+
"precision: QUOTE_PRECISION"
|
|
17237
|
+
];
|
|
17238
|
+
"type": "u64";
|
|
17239
|
+
},
|
|
17240
|
+
{
|
|
17241
|
+
"name": "totalWithdrawsAfter";
|
|
17242
|
+
"docs": [
|
|
17243
|
+
"precision: QUOTE_PRECISION"
|
|
17244
|
+
];
|
|
17245
|
+
"type": "u64";
|
|
17246
|
+
},
|
|
17247
|
+
{
|
|
17248
|
+
"name": "explanation";
|
|
17249
|
+
"type": {
|
|
17250
|
+
"defined": {
|
|
17251
|
+
"name": "depositExplanation";
|
|
17252
|
+
};
|
|
17253
|
+
};
|
|
17254
|
+
},
|
|
17255
|
+
{
|
|
17256
|
+
"name": "transferUser";
|
|
17257
|
+
"type": {
|
|
17258
|
+
"option": "pubkey";
|
|
17259
|
+
};
|
|
17260
|
+
},
|
|
17261
|
+
{
|
|
17262
|
+
"name": "signer";
|
|
17263
|
+
"type": {
|
|
17264
|
+
"option": "pubkey";
|
|
17265
|
+
};
|
|
17266
|
+
},
|
|
17267
|
+
{
|
|
17268
|
+
"name": "userTokenAmountAfter";
|
|
17269
|
+
"docs": [
|
|
17270
|
+
"precision: token mint precision"
|
|
17271
|
+
];
|
|
17272
|
+
"type": "i128";
|
|
17273
|
+
}
|
|
17274
|
+
];
|
|
17275
|
+
};
|
|
17276
|
+
},
|
|
17277
|
+
{
|
|
17278
|
+
"name": "feeLedger";
|
|
17279
|
+
"docs": [
|
|
17280
|
+
"All of a perp market's fee-split accounting in one ledger.",
|
|
17281
|
+
"Pure counters — token claims live in the pools",
|
|
17282
|
+
"(`protocol_fee_pool`, the quote `revenue_pool`, `AMM.fee_pool`).",
|
|
17283
|
+
"Convention: gross-fee counters record what the taker actually paid",
|
|
17284
|
+
"(post referee discount, pre carve-outs) on BOTH the AMM and DLOB-match",
|
|
17285
|
+
"paths."
|
|
17286
|
+
];
|
|
17287
|
+
"serialization": "bytemuckunsafe";
|
|
17288
|
+
"repr": {
|
|
17289
|
+
"kind": "c";
|
|
17290
|
+
};
|
|
17291
|
+
"type": {
|
|
17292
|
+
"kind": "struct";
|
|
17293
|
+
"fields": [
|
|
17294
|
+
{
|
|
17295
|
+
"name": "totalExchangeFee";
|
|
17296
|
+
"docs": [
|
|
17297
|
+
"lifetime gross taker fees collected (analytics; not a routing driver)",
|
|
17298
|
+
"precision: QUOTE_PRECISION"
|
|
17299
|
+
];
|
|
17300
|
+
"type": "u128";
|
|
17301
|
+
},
|
|
17302
|
+
{
|
|
17303
|
+
"name": "totalLiquidationFee";
|
|
17304
|
+
"docs": [
|
|
17305
|
+
"lifetime liquidation fees charged to liquidatees (IF + protocol cuts;",
|
|
17306
|
+
"pure analytics — routing happens via the pending counters).",
|
|
17307
|
+
"precision: QUOTE_PRECISION"
|
|
17308
|
+
];
|
|
17309
|
+
"type": "u128";
|
|
17310
|
+
},
|
|
17311
|
+
{
|
|
17312
|
+
"name": "pendingProtocolFee";
|
|
17650
17313
|
"docs": [
|
|
17651
|
-
"
|
|
17314
|
+
"protocol (residual) carveouts accrued but not yet materialized into",
|
|
17315
|
+
"`protocol_fee_pool`. precision: QUOTE_PRECISION"
|
|
17652
17316
|
];
|
|
17653
17317
|
"type": "u128";
|
|
17654
17318
|
},
|
|
17655
17319
|
{
|
|
17656
|
-
"name": "
|
|
17320
|
+
"name": "pendingIfFee";
|
|
17657
17321
|
"docs": [
|
|
17322
|
+
"insurance-fund carveouts accrued but not yet materialized into the",
|
|
17323
|
+
"quote `revenue_pool`; also the first bankruptcy tranche.",
|
|
17658
17324
|
"precision: QUOTE_PRECISION"
|
|
17659
17325
|
];
|
|
17660
|
-
"type": "
|
|
17326
|
+
"type": "u128";
|
|
17661
17327
|
},
|
|
17662
17328
|
{
|
|
17663
|
-
"name": "
|
|
17329
|
+
"name": "ammProtocolFeesReceived";
|
|
17664
17330
|
"docs": [
|
|
17665
|
-
"
|
|
17331
|
+
"cumulative fee provision granted to the AMM via `amm_fee_numerator` —",
|
|
17332
|
+
"its backstop-of-last-resort tranche, drawable (and decremented) only in",
|
|
17333
|
+
"bankruptcy. The AMM's own spread/trading capital beyond this provision",
|
|
17334
|
+
"is never tapped. precision: QUOTE_PRECISION"
|
|
17666
17335
|
];
|
|
17667
|
-
"type": "
|
|
17668
|
-
},
|
|
17669
|
-
{
|
|
17670
|
-
"name": "explanation";
|
|
17671
|
-
"type": {
|
|
17672
|
-
"defined": {
|
|
17673
|
-
"name": "depositExplanation";
|
|
17674
|
-
};
|
|
17675
|
-
};
|
|
17676
|
-
},
|
|
17677
|
-
{
|
|
17678
|
-
"name": "transferUser";
|
|
17679
|
-
"type": {
|
|
17680
|
-
"option": "pubkey";
|
|
17681
|
-
};
|
|
17682
|
-
},
|
|
17683
|
-
{
|
|
17684
|
-
"name": "signer";
|
|
17685
|
-
"type": {
|
|
17686
|
-
"option": "pubkey";
|
|
17687
|
-
};
|
|
17336
|
+
"type": "u128";
|
|
17688
17337
|
},
|
|
17689
17338
|
{
|
|
17690
|
-
"name": "
|
|
17339
|
+
"name": "pendingAmmProvision";
|
|
17691
17340
|
"docs": [
|
|
17692
|
-
"
|
|
17341
|
+
"AMM fee provision accrued at fill (already booked into the AMM's",
|
|
17342
|
+
"`total_fee_minus_distributions`) but not yet tokenized into",
|
|
17343
|
+
"`amm.fee_pool` by the sweep. Invariant: `<= amm_protocol_fees_received`.",
|
|
17344
|
+
"precision: QUOTE_PRECISION"
|
|
17693
17345
|
];
|
|
17694
|
-
"type": "
|
|
17346
|
+
"type": "u128";
|
|
17695
17347
|
}
|
|
17696
17348
|
];
|
|
17697
17349
|
};
|
|
@@ -17730,13 +17382,26 @@ export type Velocity = {
|
|
|
17730
17382
|
"type": "u64";
|
|
17731
17383
|
},
|
|
17732
17384
|
{
|
|
17733
|
-
"name": "
|
|
17385
|
+
"name": "ammFeeNumerator";
|
|
17734
17386
|
"docs": [
|
|
17735
|
-
"
|
|
17736
|
-
"
|
|
17737
|
-
"
|
|
17387
|
+
"Share of the trade-fee *remainder* (taker fee after maker rebate, referral,",
|
|
17388
|
+
"referee discount, and filler reward are taken off the top) provisioned to",
|
|
17389
|
+
"the AMM as liquidity (its backstop-of-last-resort tranche, tracked in",
|
|
17390
|
+
"`PerpMarket.fee_ledger.amm_protocol_fees_received`). precision:",
|
|
17391
|
+
"FEE_PERCENTAGE_DENOMINATOR. `amm_fee_numerator + if_fee_numerator` must",
|
|
17392
|
+
"be <= FEE_PERCENTAGE_DENOMINATOR; the protocol receives the residual",
|
|
17393
|
+
"(`remainder − amm − if`) into its withdrawable `protocol_fee_pool`.",
|
|
17394
|
+
"(Was the reserved `padding: u64`, repartitioned into two u32s —",
|
|
17395
|
+
"size/alignment unchanged.)"
|
|
17738
17396
|
];
|
|
17739
|
-
"type": "
|
|
17397
|
+
"type": "u32";
|
|
17398
|
+
},
|
|
17399
|
+
{
|
|
17400
|
+
"name": "ifFeeNumerator";
|
|
17401
|
+
"docs": [
|
|
17402
|
+
"Share of the trade-fee remainder routed to the insurance fund (`revenue_pool`)."
|
|
17403
|
+
];
|
|
17404
|
+
"type": "u32";
|
|
17740
17405
|
}
|
|
17741
17406
|
];
|
|
17742
17407
|
};
|
|
@@ -18096,9 +17761,6 @@ export type Velocity = {
|
|
|
18096
17761
|
{
|
|
18097
17762
|
"name": "lpSettle";
|
|
18098
17763
|
},
|
|
18099
|
-
{
|
|
18100
|
-
"name": "ifRebalance";
|
|
18101
|
-
},
|
|
18102
17764
|
{
|
|
18103
17765
|
"name": "featureFlag";
|
|
18104
17766
|
},
|
|
@@ -18116,160 +17778,9 @@ export type Velocity = {
|
|
|
18116
17778
|
},
|
|
18117
17779
|
{
|
|
18118
17780
|
"name": "ammSpreadAdjust";
|
|
18119
|
-
}
|
|
18120
|
-
];
|
|
18121
|
-
};
|
|
18122
|
-
},
|
|
18123
|
-
{
|
|
18124
|
-
"name": "ifRebalanceConfig";
|
|
18125
|
-
"serialization": "bytemuckunsafe";
|
|
18126
|
-
"repr": {
|
|
18127
|
-
"kind": "c";
|
|
18128
|
-
};
|
|
18129
|
-
"type": {
|
|
18130
|
-
"kind": "struct";
|
|
18131
|
-
"fields": [
|
|
18132
|
-
{
|
|
18133
|
-
"name": "pubkey";
|
|
18134
|
-
"type": "pubkey";
|
|
18135
|
-
},
|
|
18136
|
-
{
|
|
18137
|
-
"name": "totalInAmount";
|
|
18138
|
-
"docs": [
|
|
18139
|
-
"total amount to be sold"
|
|
18140
|
-
];
|
|
18141
|
-
"type": "u64";
|
|
18142
|
-
},
|
|
18143
|
-
{
|
|
18144
|
-
"name": "currentInAmount";
|
|
18145
|
-
"docs": [
|
|
18146
|
-
"amount already sold"
|
|
18147
|
-
];
|
|
18148
|
-
"type": "u64";
|
|
18149
|
-
},
|
|
18150
|
-
{
|
|
18151
|
-
"name": "currentOutAmount";
|
|
18152
|
-
"docs": [
|
|
18153
|
-
"amount already bought"
|
|
18154
|
-
];
|
|
18155
|
-
"type": "u64";
|
|
18156
|
-
},
|
|
18157
|
-
{
|
|
18158
|
-
"name": "currentOutAmountTransferred";
|
|
18159
|
-
"docs": [
|
|
18160
|
-
"amount already transferred to revenue pool"
|
|
18161
|
-
];
|
|
18162
|
-
"type": "u64";
|
|
18163
|
-
},
|
|
18164
|
-
{
|
|
18165
|
-
"name": "currentInAmountSinceLastTransfer";
|
|
18166
|
-
"docs": [
|
|
18167
|
-
"amount already bought in epoch"
|
|
18168
|
-
];
|
|
18169
|
-
"type": "u64";
|
|
18170
|
-
},
|
|
18171
|
-
{
|
|
18172
|
-
"name": "epochStartTs";
|
|
18173
|
-
"docs": [
|
|
18174
|
-
"start time of epoch"
|
|
18175
|
-
];
|
|
18176
|
-
"type": "i64";
|
|
18177
|
-
},
|
|
18178
|
-
{
|
|
18179
|
-
"name": "epochInAmount";
|
|
18180
|
-
"docs": [
|
|
18181
|
-
"amount already bought in epoch"
|
|
18182
|
-
];
|
|
18183
|
-
"type": "u64";
|
|
18184
|
-
},
|
|
18185
|
-
{
|
|
18186
|
-
"name": "epochMaxInAmount";
|
|
18187
|
-
"docs": [
|
|
18188
|
-
"max amount to swap in epoch"
|
|
18189
|
-
];
|
|
18190
|
-
"type": "u64";
|
|
18191
|
-
},
|
|
18192
|
-
{
|
|
18193
|
-
"name": "epochDuration";
|
|
18194
|
-
"docs": [
|
|
18195
|
-
"duration of epoch"
|
|
18196
|
-
];
|
|
18197
|
-
"type": "i64";
|
|
18198
|
-
},
|
|
18199
|
-
{
|
|
18200
|
-
"name": "outMarketIndex";
|
|
18201
|
-
"docs": [
|
|
18202
|
-
"market index to sell"
|
|
18203
|
-
];
|
|
18204
|
-
"type": "u16";
|
|
18205
|
-
},
|
|
18206
|
-
{
|
|
18207
|
-
"name": "inMarketIndex";
|
|
18208
|
-
"docs": [
|
|
18209
|
-
"market index to buy"
|
|
18210
|
-
];
|
|
18211
|
-
"type": "u16";
|
|
18212
|
-
},
|
|
18213
|
-
{
|
|
18214
|
-
"name": "maxSlippageBps";
|
|
18215
|
-
"type": "u16";
|
|
18216
|
-
},
|
|
18217
|
-
{
|
|
18218
|
-
"name": "swapMode";
|
|
18219
|
-
"type": "u8";
|
|
18220
|
-
},
|
|
18221
|
-
{
|
|
18222
|
-
"name": "status";
|
|
18223
|
-
"type": "u8";
|
|
18224
|
-
},
|
|
18225
|
-
{
|
|
18226
|
-
"name": "padding2";
|
|
18227
|
-
"type": {
|
|
18228
|
-
"array": [
|
|
18229
|
-
"u8",
|
|
18230
|
-
32
|
|
18231
|
-
];
|
|
18232
|
-
};
|
|
18233
|
-
}
|
|
18234
|
-
];
|
|
18235
|
-
};
|
|
18236
|
-
},
|
|
18237
|
-
{
|
|
18238
|
-
"name": "ifRebalanceConfigParams";
|
|
18239
|
-
"type": {
|
|
18240
|
-
"kind": "struct";
|
|
18241
|
-
"fields": [
|
|
18242
|
-
{
|
|
18243
|
-
"name": "totalInAmount";
|
|
18244
|
-
"type": "u64";
|
|
18245
|
-
},
|
|
18246
|
-
{
|
|
18247
|
-
"name": "epochMaxInAmount";
|
|
18248
|
-
"type": "u64";
|
|
18249
|
-
},
|
|
18250
|
-
{
|
|
18251
|
-
"name": "epochDuration";
|
|
18252
|
-
"type": "i64";
|
|
18253
|
-
},
|
|
18254
|
-
{
|
|
18255
|
-
"name": "outMarketIndex";
|
|
18256
|
-
"type": "u16";
|
|
18257
|
-
},
|
|
18258
|
-
{
|
|
18259
|
-
"name": "inMarketIndex";
|
|
18260
|
-
"type": "u16";
|
|
18261
|
-
},
|
|
18262
|
-
{
|
|
18263
|
-
"name": "maxSlippageBps";
|
|
18264
|
-
"type": "u16";
|
|
18265
|
-
},
|
|
18266
|
-
{
|
|
18267
|
-
"name": "swapMode";
|
|
18268
|
-
"type": "u8";
|
|
18269
17781
|
},
|
|
18270
17782
|
{
|
|
18271
|
-
"name": "
|
|
18272
|
-
"type": "u8";
|
|
17783
|
+
"name": "feeWithdraw";
|
|
18273
17784
|
}
|
|
18274
17785
|
];
|
|
18275
17786
|
};
|
|
@@ -18362,15 +17873,33 @@ export type Velocity = {
|
|
|
18362
17873
|
},
|
|
18363
17874
|
{
|
|
18364
17875
|
"name": "revenueSettlePeriod";
|
|
17876
|
+
"docs": [
|
|
17877
|
+
"How often `revenue_pool` may settle into the IF vault (seconds)."
|
|
17878
|
+
];
|
|
18365
17879
|
"type": "i64";
|
|
18366
17880
|
},
|
|
18367
17881
|
{
|
|
18368
|
-
"name": "
|
|
17882
|
+
"name": "ifFeeFactor";
|
|
17883
|
+
"docs": [
|
|
17884
|
+
"Fraction of spot deposit-interest gains carved out to the insurance fund",
|
|
17885
|
+
"(staker-owned). precision: IF_FACTOR_PRECISION. (Was `total_factor`; the",
|
|
17886
|
+
"protocol-vs-staker split was removed — the IF is now 100% staker-owned,",
|
|
17887
|
+
"so this is purely the staker IF carveout.)"
|
|
17888
|
+
];
|
|
18369
17889
|
"type": "u32";
|
|
18370
17890
|
},
|
|
18371
17891
|
{
|
|
18372
|
-
"name": "
|
|
18373
|
-
"
|
|
17892
|
+
"name": "paddingIf";
|
|
17893
|
+
"docs": [
|
|
17894
|
+
"Was `user_factor` (the old protocol/staker split knob). The IF is now",
|
|
17895
|
+
"100% staker-owned, so the split is gone; slot kept as padding."
|
|
17896
|
+
];
|
|
17897
|
+
"type": {
|
|
17898
|
+
"array": [
|
|
17899
|
+
"u8",
|
|
17900
|
+
4
|
|
17901
|
+
];
|
|
17902
|
+
};
|
|
18374
17903
|
}
|
|
18375
17904
|
];
|
|
18376
17905
|
};
|
|
@@ -18539,112 +18068,24 @@ export type Velocity = {
|
|
|
18539
18068
|
"type": "u128";
|
|
18540
18069
|
},
|
|
18541
18070
|
{
|
|
18542
|
-
"name": "userIfSharesBefore";
|
|
18543
|
-
"type": "u128";
|
|
18544
|
-
},
|
|
18545
|
-
{
|
|
18546
|
-
"name": "totalIfSharesBefore";
|
|
18547
|
-
"type": "u128";
|
|
18548
|
-
},
|
|
18549
|
-
{
|
|
18550
|
-
"name": "ifSharesAfter";
|
|
18551
|
-
"type": "u128";
|
|
18552
|
-
},
|
|
18553
|
-
{
|
|
18554
|
-
"name": "userIfSharesAfter";
|
|
18555
|
-
"type": "u128";
|
|
18556
|
-
},
|
|
18557
|
-
{
|
|
18558
|
-
"name": "totalIfSharesAfter";
|
|
18559
|
-
"type": "u128";
|
|
18560
|
-
}
|
|
18561
|
-
];
|
|
18562
|
-
};
|
|
18563
|
-
},
|
|
18564
|
-
{
|
|
18565
|
-
"name": "insuranceFundSwapRecord";
|
|
18566
|
-
"type": {
|
|
18567
|
-
"kind": "struct";
|
|
18568
|
-
"fields": [
|
|
18569
|
-
{
|
|
18570
|
-
"name": "rebalanceConfig";
|
|
18571
|
-
"type": "pubkey";
|
|
18572
|
-
},
|
|
18573
|
-
{
|
|
18574
|
-
"name": "inIfTotalSharesBefore";
|
|
18575
|
-
"type": "u128";
|
|
18576
|
-
},
|
|
18577
|
-
{
|
|
18578
|
-
"name": "outIfTotalSharesBefore";
|
|
18579
|
-
"type": "u128";
|
|
18580
|
-
},
|
|
18581
|
-
{
|
|
18582
|
-
"name": "inIfUserSharesBefore";
|
|
18583
|
-
"type": "u128";
|
|
18584
|
-
},
|
|
18585
|
-
{
|
|
18586
|
-
"name": "outIfUserSharesBefore";
|
|
18587
|
-
"type": "u128";
|
|
18588
|
-
},
|
|
18589
|
-
{
|
|
18590
|
-
"name": "inIfTotalSharesAfter";
|
|
18591
|
-
"type": "u128";
|
|
18592
|
-
},
|
|
18593
|
-
{
|
|
18594
|
-
"name": "outIfTotalSharesAfter";
|
|
18595
|
-
"type": "u128";
|
|
18596
|
-
},
|
|
18597
|
-
{
|
|
18598
|
-
"name": "inIfUserSharesAfter";
|
|
18599
|
-
"type": "u128";
|
|
18600
|
-
},
|
|
18601
|
-
{
|
|
18602
|
-
"name": "outIfUserSharesAfter";
|
|
18603
|
-
"type": "u128";
|
|
18604
|
-
},
|
|
18605
|
-
{
|
|
18606
|
-
"name": "ts";
|
|
18607
|
-
"type": "i64";
|
|
18608
|
-
},
|
|
18609
|
-
{
|
|
18610
|
-
"name": "inAmount";
|
|
18611
|
-
"type": "u64";
|
|
18612
|
-
},
|
|
18613
|
-
{
|
|
18614
|
-
"name": "outAmount";
|
|
18615
|
-
"type": "u64";
|
|
18616
|
-
},
|
|
18617
|
-
{
|
|
18618
|
-
"name": "outOraclePrice";
|
|
18619
|
-
"type": "u64";
|
|
18620
|
-
},
|
|
18621
|
-
{
|
|
18622
|
-
"name": "outOraclePriceTwap";
|
|
18623
|
-
"type": "i64";
|
|
18624
|
-
},
|
|
18625
|
-
{
|
|
18626
|
-
"name": "inVaultAmountBefore";
|
|
18627
|
-
"type": "u64";
|
|
18628
|
-
},
|
|
18629
|
-
{
|
|
18630
|
-
"name": "outVaultAmountBefore";
|
|
18631
|
-
"type": "u64";
|
|
18071
|
+
"name": "userIfSharesBefore";
|
|
18072
|
+
"type": "u128";
|
|
18632
18073
|
},
|
|
18633
18074
|
{
|
|
18634
|
-
"name": "
|
|
18635
|
-
"type": "
|
|
18075
|
+
"name": "totalIfSharesBefore";
|
|
18076
|
+
"type": "u128";
|
|
18636
18077
|
},
|
|
18637
18078
|
{
|
|
18638
|
-
"name": "
|
|
18639
|
-
"type": "
|
|
18079
|
+
"name": "ifSharesAfter";
|
|
18080
|
+
"type": "u128";
|
|
18640
18081
|
},
|
|
18641
18082
|
{
|
|
18642
|
-
"name": "
|
|
18643
|
-
"type": "
|
|
18083
|
+
"name": "userIfSharesAfter";
|
|
18084
|
+
"type": "u128";
|
|
18644
18085
|
},
|
|
18645
18086
|
{
|
|
18646
|
-
"name": "
|
|
18647
|
-
"type": "
|
|
18087
|
+
"name": "totalIfSharesAfter";
|
|
18088
|
+
"type": "u128";
|
|
18648
18089
|
}
|
|
18649
18090
|
];
|
|
18650
18091
|
};
|
|
@@ -19262,6 +18703,14 @@ export type Velocity = {
|
|
|
19262
18703
|
"precision: QUOTE_PRECISION"
|
|
19263
18704
|
];
|
|
19264
18705
|
"type": "u64";
|
|
18706
|
+
},
|
|
18707
|
+
{
|
|
18708
|
+
"name": "protocolFee";
|
|
18709
|
+
"docs": [
|
|
18710
|
+
"protocol's cut, routed to the perp market's `protocol_fee_pool`",
|
|
18711
|
+
"precision: QUOTE_PRECISION"
|
|
18712
|
+
];
|
|
18713
|
+
"type": "u64";
|
|
19265
18714
|
}
|
|
19266
18715
|
];
|
|
19267
18716
|
};
|
|
@@ -19304,6 +18753,14 @@ export type Velocity = {
|
|
|
19304
18753
|
"precision: token mint precision"
|
|
19305
18754
|
];
|
|
19306
18755
|
"type": "u64";
|
|
18756
|
+
},
|
|
18757
|
+
{
|
|
18758
|
+
"name": "protocolFee";
|
|
18759
|
+
"docs": [
|
|
18760
|
+
"protocol's cut, routed to the liability market's `protocol_fee_pool`",
|
|
18761
|
+
"precision: token mint precision"
|
|
18762
|
+
];
|
|
18763
|
+
"type": "u64";
|
|
19307
18764
|
}
|
|
19308
18765
|
];
|
|
19309
18766
|
};
|
|
@@ -19680,15 +19137,26 @@ export type Velocity = {
|
|
|
19680
19137
|
{
|
|
19681
19138
|
"name": "padding";
|
|
19682
19139
|
"docs": [
|
|
19683
|
-
"Padding so
|
|
19140
|
+
"Padding so last_funding_oracle_twap is 8-aligned."
|
|
19684
19141
|
];
|
|
19685
19142
|
"type": {
|
|
19686
19143
|
"array": [
|
|
19687
19144
|
"u8",
|
|
19688
|
-
|
|
19145
|
+
3
|
|
19689
19146
|
];
|
|
19690
19147
|
};
|
|
19691
19148
|
},
|
|
19149
|
+
{
|
|
19150
|
+
"name": "lastFundingOracleTwap";
|
|
19151
|
+
"docs": [
|
|
19152
|
+
"Oracle TWAP captured at last funding update, the normalizer",
|
|
19153
|
+
"`last_24h_avg_funding_rate` accrued against. Read by the AMM's",
|
|
19154
|
+
"funding bias spread and `get_last_funding_basis`. Migrated from",
|
|
19155
|
+
"`PerpMarket` so the AMM reads only from `MarketStats`.",
|
|
19156
|
+
"precision: PRICE_PRECISION"
|
|
19157
|
+
];
|
|
19158
|
+
"type": "i64";
|
|
19159
|
+
},
|
|
19692
19160
|
{
|
|
19693
19161
|
"name": "historicalOracleData";
|
|
19694
19162
|
"docs": [
|
|
@@ -21034,20 +20502,17 @@ export type Velocity = {
|
|
|
21034
20502
|
"type": "i128";
|
|
21035
20503
|
},
|
|
21036
20504
|
{
|
|
21037
|
-
"name": "
|
|
21038
|
-
"docs": [
|
|
21039
|
-
"total fees collected by exchange fee schedule",
|
|
21040
|
-
"precision: QUOTE_PRECISION"
|
|
21041
|
-
];
|
|
21042
|
-
"type": "u128";
|
|
21043
|
-
},
|
|
21044
|
-
{
|
|
21045
|
-
"name": "totalLiquidationFee";
|
|
20505
|
+
"name": "feeLedger";
|
|
21046
20506
|
"docs": [
|
|
21047
|
-
"
|
|
21048
|
-
"
|
|
20507
|
+
"The market's fee ledger: every fee-split counter in one place (gross",
|
|
20508
|
+
"analytics, pending protocol/IF carveouts, and the AMM's backstop",
|
|
20509
|
+
"tranche). Mutate through its accessor methods, not raw field writes."
|
|
21049
20510
|
];
|
|
21050
|
-
"type":
|
|
20511
|
+
"type": {
|
|
20512
|
+
"defined": {
|
|
20513
|
+
"name": "feeLedger";
|
|
20514
|
+
};
|
|
20515
|
+
};
|
|
21051
20516
|
},
|
|
21052
20517
|
{
|
|
21053
20518
|
"name": "oracle";
|
|
@@ -21068,6 +20533,67 @@ export type Velocity = {
|
|
|
21068
20533
|
};
|
|
21069
20534
|
};
|
|
21070
20535
|
},
|
|
20536
|
+
{
|
|
20537
|
+
"name": "protocolFeePool";
|
|
20538
|
+
"docs": [
|
|
20539
|
+
"Protocol fees collected on this perp market, quote/USDC-denominated — a",
|
|
20540
|
+
"protocol-owned Deposit-type claim against the quote spot market vault",
|
|
20541
|
+
"(like `pnl_pool`; counted in the quote market's `deposit_balance`).",
|
|
20542
|
+
"Owned by the protocol, not users, and never part of the insurance",
|
|
20543
|
+
"backstop. `market_index` is set to `quote_spot_market_index`. Withdrawn",
|
|
20544
|
+
"directly to `State.protocol_fee_recipient_perp`."
|
|
20545
|
+
];
|
|
20546
|
+
"type": {
|
|
20547
|
+
"defined": {
|
|
20548
|
+
"name": "poolBalance";
|
|
20549
|
+
};
|
|
20550
|
+
};
|
|
20551
|
+
},
|
|
20552
|
+
{
|
|
20553
|
+
"name": "protocolLiquidationFee";
|
|
20554
|
+
"docs": [
|
|
20555
|
+
"Protocol's cut of a perp liquidation, taken from the liquidatee.",
|
|
20556
|
+
"precision: LIQUIDATOR_FEE_PRECISION"
|
|
20557
|
+
];
|
|
20558
|
+
"type": "u32";
|
|
20559
|
+
},
|
|
20560
|
+
{
|
|
20561
|
+
"name": "paddingBuffer";
|
|
20562
|
+
"type": {
|
|
20563
|
+
"array": [
|
|
20564
|
+
"u8",
|
|
20565
|
+
4
|
|
20566
|
+
];
|
|
20567
|
+
};
|
|
20568
|
+
},
|
|
20569
|
+
{
|
|
20570
|
+
"name": "feePoolBufferTarget";
|
|
20571
|
+
"docs": [
|
|
20572
|
+
"The pnl-pool retention buffer the streaming sweep's IF and",
|
|
20573
|
+
"AMM-provision drains leave untouched: `sweep_market_fees` drains",
|
|
20574
|
+
"those pendings only from what the pnl pool holds above",
|
|
20575
|
+
"`max(net_user_pnl, 0) + fee_pool_buffer_target`. The protocol drain",
|
|
20576
|
+
"is EXEMPT — it reserves only `max(net_user_pnl, 0)` and runs first;",
|
|
20577
|
+
"it sweeps every settle, so each drain stays small, and its pending is",
|
|
20578
|
+
"no bankruptcy tranche so retaining it buys nothing.",
|
|
20579
|
+
"",
|
|
20580
|
+
"Why a buffer on top of the user-claims reservation: `net_user_pnl`",
|
|
20581
|
+
"is a mark-to-market snapshot, so a pool swept to the exact mark is",
|
|
20582
|
+
"short on the next adverse oracle tick — and the sweep is a one-way",
|
|
20583
|
+
"valve, so the slack can't be cheaply recalled (IF value returns only",
|
|
20584
|
+
"through capped gated paths, the AMM provision only via bankruptcy",
|
|
20585
|
+
"clawback). The buffer throttles those outflows per sweep; pool tokens",
|
|
20586
|
+
"are fungible (pendings are counters, not segregated tokens), so",
|
|
20587
|
+
"whichever cut lingers keeps settling winners in the meantime. This",
|
|
20588
|
+
"delays materialization, it does not divert anyone's cut. Side",
|
|
20589
|
+
"benefits: an unswept IF cut gives THIS market uncapped market-local",
|
|
20590
|
+
"bankruptcy coverage (tranche 1) instead of capped shared-vault",
|
|
20591
|
+
"coverage, and the buffer damps the IF settle ratchet (value settled",
|
|
20592
|
+
"into the IF accrues to stakers permanently).",
|
|
20593
|
+
"precision: QUOTE_PRECISION"
|
|
20594
|
+
];
|
|
20595
|
+
"type": "u64";
|
|
20596
|
+
},
|
|
21071
20597
|
{
|
|
21072
20598
|
"name": "name";
|
|
21073
20599
|
"docs": [
|
|
@@ -21130,11 +20656,17 @@ export type Velocity = {
|
|
|
21130
20656
|
"type": "i64";
|
|
21131
20657
|
},
|
|
21132
20658
|
{
|
|
21133
|
-
"name": "
|
|
20659
|
+
"name": "paddingFundingTwap";
|
|
21134
20660
|
"docs": [
|
|
21135
|
-
"
|
|
20661
|
+
"Explicit padding where `last_funding_oracle_twap` used to live",
|
|
20662
|
+
"(moved to `MarketStats`); keeps every later field at its old offset."
|
|
21136
20663
|
];
|
|
21137
|
-
"type":
|
|
20664
|
+
"type": {
|
|
20665
|
+
"array": [
|
|
20666
|
+
"u8",
|
|
20667
|
+
8
|
|
20668
|
+
];
|
|
20669
|
+
};
|
|
21138
20670
|
},
|
|
21139
20671
|
{
|
|
21140
20672
|
"name": "orderStepSize";
|
|
@@ -21413,13 +20945,14 @@ export type Velocity = {
|
|
|
21413
20945
|
"docs": [
|
|
21414
20946
|
"Trailing padding so `market_stats` lands at the offset Rust naturally",
|
|
21415
20947
|
"computes via `repr(C)` alignment and the `(SIZE - 8) % 16 == 0`",
|
|
21416
|
-
"invariant holds.
|
|
21417
|
-
"
|
|
20948
|
+
"invariant holds. (32 bytes moved into `fee_ledger` as",
|
|
20949
|
+
"`amm_protocol_fees_received` and then `pending_amm_provision` joined",
|
|
20950
|
+
"it, keeping `market_stats` fixed.)"
|
|
21418
20951
|
];
|
|
21419
20952
|
"type": {
|
|
21420
20953
|
"array": [
|
|
21421
20954
|
"u8",
|
|
21422
|
-
|
|
20955
|
+
4
|
|
21423
20956
|
];
|
|
21424
20957
|
};
|
|
21425
20958
|
},
|
|
@@ -21484,6 +21017,50 @@ export type Velocity = {
|
|
|
21484
21017
|
];
|
|
21485
21018
|
};
|
|
21486
21019
|
},
|
|
21020
|
+
{
|
|
21021
|
+
"name": "perpMarketFeeSweepRecord";
|
|
21022
|
+
"docs": [
|
|
21023
|
+
"Emitted by the streaming fee sweep (`sweep_market_fees`) when it",
|
|
21024
|
+
"materializes pending fee carveouts out of a perp market's pnl pool."
|
|
21025
|
+
];
|
|
21026
|
+
"type": {
|
|
21027
|
+
"kind": "struct";
|
|
21028
|
+
"fields": [
|
|
21029
|
+
{
|
|
21030
|
+
"name": "ts";
|
|
21031
|
+
"docs": [
|
|
21032
|
+
"unix_timestamp of action"
|
|
21033
|
+
];
|
|
21034
|
+
"type": "i64";
|
|
21035
|
+
},
|
|
21036
|
+
{
|
|
21037
|
+
"name": "marketIndex";
|
|
21038
|
+
"type": "u16";
|
|
21039
|
+
},
|
|
21040
|
+
{
|
|
21041
|
+
"name": "ifSwept";
|
|
21042
|
+
"docs": [
|
|
21043
|
+
"pending insurance cut moved to the quote spot market's revenue_pool"
|
|
21044
|
+
];
|
|
21045
|
+
"type": "u64";
|
|
21046
|
+
},
|
|
21047
|
+
{
|
|
21048
|
+
"name": "protocolSwept";
|
|
21049
|
+
"docs": [
|
|
21050
|
+
"pending protocol cut moved to the market's protocol_fee_pool"
|
|
21051
|
+
];
|
|
21052
|
+
"type": "u64";
|
|
21053
|
+
},
|
|
21054
|
+
{
|
|
21055
|
+
"name": "ammProvisionTokenized";
|
|
21056
|
+
"docs": [
|
|
21057
|
+
"AMM fee provision tokenized into amm.fee_pool (booked at fill)"
|
|
21058
|
+
];
|
|
21059
|
+
"type": "u64";
|
|
21060
|
+
}
|
|
21061
|
+
];
|
|
21062
|
+
};
|
|
21063
|
+
},
|
|
21487
21064
|
{
|
|
21488
21065
|
"name": "perpPosition";
|
|
21489
21066
|
"serialization": "bytemuckunsafe";
|
|
@@ -21761,6 +21338,51 @@ export type Velocity = {
|
|
|
21761
21338
|
];
|
|
21762
21339
|
};
|
|
21763
21340
|
},
|
|
21341
|
+
{
|
|
21342
|
+
"name": "protocolFeeWithdrawRecord";
|
|
21343
|
+
"type": {
|
|
21344
|
+
"kind": "struct";
|
|
21345
|
+
"fields": [
|
|
21346
|
+
{
|
|
21347
|
+
"name": "ts";
|
|
21348
|
+
"docs": [
|
|
21349
|
+
"unix_timestamp of action"
|
|
21350
|
+
];
|
|
21351
|
+
"type": "i64";
|
|
21352
|
+
},
|
|
21353
|
+
{
|
|
21354
|
+
"name": "marketIndex";
|
|
21355
|
+
"docs": [
|
|
21356
|
+
"perp market index for a perp-fee withdrawal, else the spot market index"
|
|
21357
|
+
];
|
|
21358
|
+
"type": "u16";
|
|
21359
|
+
},
|
|
21360
|
+
{
|
|
21361
|
+
"name": "isPerp";
|
|
21362
|
+
"docs": [
|
|
21363
|
+
"true if this withdrawal drained a perp market's protocol_fee_pool",
|
|
21364
|
+
"(sourced from the quote spot vault), false for a spot market withdrawal"
|
|
21365
|
+
];
|
|
21366
|
+
"type": "bool";
|
|
21367
|
+
},
|
|
21368
|
+
{
|
|
21369
|
+
"name": "spotMarketIndex";
|
|
21370
|
+
"docs": [
|
|
21371
|
+
"the spot market the tokens were drawn from"
|
|
21372
|
+
];
|
|
21373
|
+
"type": "u16";
|
|
21374
|
+
},
|
|
21375
|
+
{
|
|
21376
|
+
"name": "amount";
|
|
21377
|
+
"type": "u64";
|
|
21378
|
+
},
|
|
21379
|
+
{
|
|
21380
|
+
"name": "recipientTokenAccount";
|
|
21381
|
+
"type": "pubkey";
|
|
21382
|
+
}
|
|
21383
|
+
];
|
|
21384
|
+
};
|
|
21385
|
+
},
|
|
21764
21386
|
{
|
|
21765
21387
|
"name": "pythLazerOracle";
|
|
21766
21388
|
"serialization": "bytemuckunsafe";
|
|
@@ -23141,12 +22763,58 @@ export type Velocity = {
|
|
|
23141
22763
|
"name": "poolId";
|
|
23142
22764
|
"type": "u8";
|
|
23143
22765
|
},
|
|
22766
|
+
{
|
|
22767
|
+
"name": "paddingAlignPfp";
|
|
22768
|
+
"docs": [
|
|
22769
|
+
"Aligns `protocol_fee_pool`'s leading u128 to a 16-byte struct offset so",
|
|
22770
|
+
"host (x86_64, align 16) and SBF (align 8) layouts agree. Do not reorder."
|
|
22771
|
+
];
|
|
22772
|
+
"type": {
|
|
22773
|
+
"array": [
|
|
22774
|
+
"u8",
|
|
22775
|
+
8
|
|
22776
|
+
];
|
|
22777
|
+
};
|
|
22778
|
+
},
|
|
22779
|
+
{
|
|
22780
|
+
"name": "protocolFeePool";
|
|
22781
|
+
"docs": [
|
|
22782
|
+
"Protocol fees collected in this market's token (lending protocol carveout",
|
|
22783
|
+
"+ spot-liquidation protocol fee). A protocol-owned Deposit-type claim",
|
|
22784
|
+
"inside the spot vault (counted in `deposit_balance`, like `revenue_pool`)",
|
|
22785
|
+
"— owned by the protocol, not users, and never part of the insurance",
|
|
22786
|
+
"backstop. Withdrawn directly to `State.protocol_fee_recipient_spot`; the",
|
|
22787
|
+
"withdrawal decrements this claim and re-validates the vault still covers",
|
|
22788
|
+
"all remaining claims, so it can never tap user deposits."
|
|
22789
|
+
];
|
|
22790
|
+
"type": {
|
|
22791
|
+
"defined": {
|
|
22792
|
+
"name": "poolBalance";
|
|
22793
|
+
};
|
|
22794
|
+
};
|
|
22795
|
+
},
|
|
22796
|
+
{
|
|
22797
|
+
"name": "protocolLiquidationFee";
|
|
22798
|
+
"docs": [
|
|
22799
|
+
"Protocol's cut of a spot liquidation, taken from the liquidatee.",
|
|
22800
|
+
"precision: LIQUIDATOR_FEE_PRECISION"
|
|
22801
|
+
];
|
|
22802
|
+
"type": "u32";
|
|
22803
|
+
},
|
|
22804
|
+
{
|
|
22805
|
+
"name": "protocolFeeFactor";
|
|
22806
|
+
"docs": [
|
|
22807
|
+
"Protocol's carveout of lending deposit-interest gains, routed to",
|
|
22808
|
+
"`protocol_fee_pool`. precision: IF_FACTOR_PRECISION"
|
|
22809
|
+
];
|
|
22810
|
+
"type": "u32";
|
|
22811
|
+
},
|
|
23144
22812
|
{
|
|
23145
22813
|
"name": "padding";
|
|
23146
22814
|
"type": {
|
|
23147
22815
|
"array": [
|
|
23148
22816
|
"u8",
|
|
23149
|
-
|
|
22817
|
+
8
|
|
23150
22818
|
];
|
|
23151
22819
|
};
|
|
23152
22820
|
}
|
|
@@ -23326,7 +22994,7 @@ export type Velocity = {
|
|
|
23326
22994
|
{
|
|
23327
22995
|
"name": "warmAdmin";
|
|
23328
22996
|
"docs": [
|
|
23329
|
-
"Operational authority (e.g. multisig+timelock). Can rotate the
|
|
22997
|
+
"Operational authority (e.g. multisig+timelock). Can rotate the 10 hot keys",
|
|
23330
22998
|
"below. `Pubkey::default()` means unset — only `cold_admin` can act in that case."
|
|
23331
22999
|
];
|
|
23332
23000
|
"type": "pubkey";
|
|
@@ -23361,10 +23029,6 @@ export type Velocity = {
|
|
|
23361
23029
|
"name": "hotLpSettle";
|
|
23362
23030
|
"type": "pubkey";
|
|
23363
23031
|
},
|
|
23364
|
-
{
|
|
23365
|
-
"name": "hotIfRebalance";
|
|
23366
|
-
"type": "pubkey";
|
|
23367
|
-
},
|
|
23368
23032
|
{
|
|
23369
23033
|
"name": "hotFeatureFlag";
|
|
23370
23034
|
"type": "pubkey";
|
|
@@ -23497,6 +23161,35 @@ export type Velocity = {
|
|
|
23497
23161
|
"name": "lpPoolFeatureBitFlags";
|
|
23498
23162
|
"type": "u8";
|
|
23499
23163
|
},
|
|
23164
|
+
{
|
|
23165
|
+
"name": "protocolFeeRecipientPerp";
|
|
23166
|
+
"docs": [
|
|
23167
|
+
"Treasury that PERP protocol fees (quote-denominated) may be withdrawn",
|
|
23168
|
+
"to. Settable only by `cold_admin`. `withdraw_protocol_fees_perp` pays",
|
|
23169
|
+
"this key's associated token account (recipient-locked).",
|
|
23170
|
+
"`Pubkey::default()` (unset) makes perp withdrawals inert."
|
|
23171
|
+
];
|
|
23172
|
+
"type": "pubkey";
|
|
23173
|
+
},
|
|
23174
|
+
{
|
|
23175
|
+
"name": "protocolFeeRecipientSpot";
|
|
23176
|
+
"docs": [
|
|
23177
|
+
"Treasury that SPOT protocol fees (each market's own token: lending",
|
|
23178
|
+
"carveouts + spot-liquidation cuts) may be withdrawn to. Settable only",
|
|
23179
|
+
"by `cold_admin`. `withdraw_protocol_fees_spot` pays this key's",
|
|
23180
|
+
"associated token account for the market's mint (recipient-locked).",
|
|
23181
|
+
"`Pubkey::default()` (unset) makes spot withdrawals inert."
|
|
23182
|
+
];
|
|
23183
|
+
"type": "pubkey";
|
|
23184
|
+
},
|
|
23185
|
+
{
|
|
23186
|
+
"name": "hotFeeWithdraw";
|
|
23187
|
+
"docs": [
|
|
23188
|
+
"Hot key authorized for the `FeeWithdraw` role (triggers protocol-fee",
|
|
23189
|
+
"withdrawals to the configured recipients)."
|
|
23190
|
+
];
|
|
23191
|
+
"type": "pubkey";
|
|
23192
|
+
},
|
|
23500
23193
|
{
|
|
23501
23194
|
"name": "padding";
|
|
23502
23195
|
"type": {
|
|
@@ -23666,42 +23359,6 @@ export type Velocity = {
|
|
|
23666
23359
|
];
|
|
23667
23360
|
};
|
|
23668
23361
|
},
|
|
23669
|
-
{
|
|
23670
|
-
"name": "transferProtocolIfSharesToRevenuePoolRecord";
|
|
23671
|
-
"type": {
|
|
23672
|
-
"kind": "struct";
|
|
23673
|
-
"fields": [
|
|
23674
|
-
{
|
|
23675
|
-
"name": "ts";
|
|
23676
|
-
"type": "i64";
|
|
23677
|
-
},
|
|
23678
|
-
{
|
|
23679
|
-
"name": "marketIndex";
|
|
23680
|
-
"type": "u16";
|
|
23681
|
-
},
|
|
23682
|
-
{
|
|
23683
|
-
"name": "amount";
|
|
23684
|
-
"type": "u64";
|
|
23685
|
-
},
|
|
23686
|
-
{
|
|
23687
|
-
"name": "shares";
|
|
23688
|
-
"type": "u128";
|
|
23689
|
-
},
|
|
23690
|
-
{
|
|
23691
|
-
"name": "ifVaultAmountBefore";
|
|
23692
|
-
"type": "u64";
|
|
23693
|
-
},
|
|
23694
|
-
{
|
|
23695
|
-
"name": "protocolSharesBefore";
|
|
23696
|
-
"type": "u128";
|
|
23697
|
-
},
|
|
23698
|
-
{
|
|
23699
|
-
"name": "transferAmount";
|
|
23700
|
-
"type": "u64";
|
|
23701
|
-
}
|
|
23702
|
-
];
|
|
23703
|
-
};
|
|
23704
|
-
},
|
|
23705
23362
|
{
|
|
23706
23363
|
"name": "updatePerpMarketSummaryStatsParams";
|
|
23707
23364
|
"type": {
|
|
@@ -23718,12 +23375,6 @@ export type Velocity = {
|
|
|
23718
23375
|
"type": {
|
|
23719
23376
|
"option": "bool";
|
|
23720
23377
|
};
|
|
23721
|
-
},
|
|
23722
|
-
{
|
|
23723
|
-
"name": "excludeTotalLiqFee";
|
|
23724
|
-
"type": {
|
|
23725
|
-
"option": "bool";
|
|
23726
|
-
};
|
|
23727
23378
|
}
|
|
23728
23379
|
];
|
|
23729
23380
|
};
|
|
@@ -24139,11 +23790,17 @@ export type Velocity = {
|
|
|
24139
23790
|
"type": "u8";
|
|
24140
23791
|
},
|
|
24141
23792
|
{
|
|
24142
|
-
"name": "
|
|
23793
|
+
"name": "padding1";
|
|
24143
23794
|
"docs": [
|
|
24144
|
-
"
|
|
23795
|
+
"9 bytes: 1 byte of former repr(C) alignment padding + the removed",
|
|
23796
|
+
"8-byte `if_staked_gov_token_amount` field (gov-token stake fee discount)"
|
|
24145
23797
|
];
|
|
24146
|
-
"type":
|
|
23798
|
+
"type": {
|
|
23799
|
+
"array": [
|
|
23800
|
+
"u8",
|
|
23801
|
+
9
|
|
23802
|
+
];
|
|
23803
|
+
};
|
|
24147
23804
|
},
|
|
24148
23805
|
{
|
|
24149
23806
|
"name": "delegatePermissions";
|