diff --git a/DriftStakeVoterPlugin/idl/drift.ts b/DriftStakeVoterPlugin/idl/drift.ts index f7140a47d0..541e857a0c 100644 --- a/DriftStakeVoterPlugin/idl/drift.ts +++ b/DriftStakeVoterPlugin/idl/drift.ts @@ -1,6667 +1,8139 @@ export type Drift = { - version: '2.66.0' - name: 'drift' - instructions: [ + "version": "2.92.0", + "name": "drift", + "instructions": [ { - name: 'initializeUser' - accounts: [ + "name": "initializeUser", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'payer' - isMut: true - isSigner: true + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: 'rent' - isMut: false - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'subAccountId' - type: 'u16' + "name": "subAccountId", + "type": "u16" }, { - name: 'name' - type: { - array: ['u8', 32] + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] } } ] }, { - name: 'initializeUserStats' - accounts: [ + "name": "initializeUserStats", + "accounts": [ { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'payer' - isMut: true - isSigner: true + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: 'rent' - isMut: false - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'initializeReferrerName' - accounts: [ + "name": "initializeReferrerName", + "accounts": [ { - name: 'referrerName' - isMut: true - isSigner: false + "name": "referrerName", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'payer' - isMut: true - isSigner: true + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: 'rent' - isMut: false - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'name' - type: { - array: ['u8', 32] + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] } } ] }, { - name: 'deposit' - accounts: [ + "name": "deposit", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'userTokenAccount' - isMut: true - isSigner: false + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'amount' - type: 'u64' + "name": "amount", + "type": "u64" }, { - name: 'reduceOnly' - type: 'bool' + "name": "reduceOnly", + "type": "bool" } ] }, { - name: 'withdraw' - accounts: [ + "name": "withdraw", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'userTokenAccount' - isMut: true - isSigner: false + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'amount' - type: 'u64' + "name": "amount", + "type": "u64" }, { - name: 'reduceOnly' - type: 'bool' + "name": "reduceOnly", + "type": "bool" } ] }, { - name: 'transferDeposit' - accounts: [ + "name": "transferDeposit", + "accounts": [ { - name: 'fromUser' - isMut: true - isSigner: false + "name": "fromUser", + "isMut": true, + "isSigner": false }, { - name: 'toUser' - isMut: true - isSigner: false + "name": "toUser", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarketVault' - isMut: false - isSigner: false + "name": "spotMarketVault", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'amount' - type: 'u64' + "name": "amount", + "type": "u64" } ] }, { - name: 'placePerpOrder' - accounts: [ + "name": "placePerpOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'params' - type: { - defined: 'OrderParams' + "name": "params", + "type": { + "defined": "OrderParams" } } ] }, { - name: 'cancelOrder' - accounts: [ + "name": "cancelOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'orderId' - type: { - option: 'u32' + "name": "orderId", + "type": { + "option": "u32" } } ] }, { - name: 'cancelOrderByUserId' - accounts: [ + "name": "cancelOrderByUserId", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'userOrderId' - type: 'u8' + "name": "userOrderId", + "type": "u8" } ] }, { - name: 'cancelOrders' - accounts: [ + "name": "cancelOrders", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'marketType' - type: { - option: { - defined: 'MarketType' + "name": "marketType", + "type": { + "option": { + "defined": "MarketType" } } }, { - name: 'marketIndex' - type: { - option: 'u16' + "name": "marketIndex", + "type": { + "option": "u16" } }, { - name: 'direction' - type: { - option: { - defined: 'PositionDirection' + "name": "direction", + "type": { + "option": { + "defined": "PositionDirection" } } } ] }, { - name: 'cancelOrdersByIds' - accounts: [ + "name": "cancelOrdersByIds", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'orderIds' - type: { - vec: 'u32' + "name": "orderIds", + "type": { + "vec": "u32" } } ] }, { - name: 'modifyOrder' - accounts: [ + "name": "modifyOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'orderId' - type: { - option: 'u32' + "name": "orderId", + "type": { + "option": "u32" } }, { - name: 'modifyOrderParams' - type: { - defined: 'ModifyOrderParams' + "name": "modifyOrderParams", + "type": { + "defined": "ModifyOrderParams" } } ] }, { - name: 'modifyOrderByUserId' - accounts: [ + "name": "modifyOrderByUserId", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'userOrderId' - type: 'u8' + "name": "userOrderId", + "type": "u8" }, { - name: 'modifyOrderParams' - type: { - defined: 'ModifyOrderParams' + "name": "modifyOrderParams", + "type": { + "defined": "ModifyOrderParams" } } ] }, { - name: 'placeAndTakePerpOrder' - accounts: [ + "name": "placeAndTakePerpOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'params' - type: { - defined: 'OrderParams' + "name": "params", + "type": { + "defined": "OrderParams" } }, { - name: 'makerOrderId' - type: { - option: 'u32' + "name": "makerOrderId", + "type": { + "option": "u32" } } ] }, { - name: 'placeAndMakePerpOrder' - accounts: [ + "name": "placeAndMakePerpOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'taker' - isMut: true - isSigner: false + "name": "taker", + "isMut": true, + "isSigner": false }, { - name: 'takerStats' - isMut: true - isSigner: false + "name": "takerStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'params' - type: { - defined: 'OrderParams' + "name": "params", + "type": { + "defined": "OrderParams" } }, { - name: 'takerOrderId' - type: 'u32' + "name": "takerOrderId", + "type": "u32" } ] }, { - name: 'placeSpotOrder' - accounts: [ + "name": "placeSpotOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'params' - type: { - defined: 'OrderParams' + "name": "params", + "type": { + "defined": "OrderParams" } } ] }, { - name: 'placeAndTakeSpotOrder' - accounts: [ + "name": "placeAndTakeSpotOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'params' - type: { - defined: 'OrderParams' + "name": "params", + "type": { + "defined": "OrderParams" } }, { - name: 'fulfillmentType' - type: { - option: { - defined: 'SpotFulfillmentType' + "name": "fulfillmentType", + "type": { + "option": { + "defined": "SpotFulfillmentType" } } }, { - name: 'makerOrderId' - type: { - option: 'u32' + "name": "makerOrderId", + "type": { + "option": "u32" } } ] }, { - name: 'placeAndMakeSpotOrder' - accounts: [ + "name": "placeAndMakeSpotOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'taker' - isMut: true - isSigner: false + "name": "taker", + "isMut": true, + "isSigner": false }, { - name: 'takerStats' - isMut: true - isSigner: false + "name": "takerStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'params' - type: { - defined: 'OrderParams' + "name": "params", + "type": { + "defined": "OrderParams" } }, { - name: 'takerOrderId' - type: 'u32' + "name": "takerOrderId", + "type": "u32" }, { - name: 'fulfillmentType' - type: { - option: { - defined: 'SpotFulfillmentType' + "name": "fulfillmentType", + "type": { + "option": { + "defined": "SpotFulfillmentType" } } } ] }, { - name: 'placeOrders' - accounts: [ + "name": "placeOrders", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'params' - type: { - vec: { - defined: 'OrderParams' + "name": "params", + "type": { + "vec": { + "defined": "OrderParams" } } } ] }, { - name: 'beginSwap' - accounts: [ + "name": "beginSwap", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'outSpotMarketVault' - isMut: true - isSigner: false + "name": "outSpotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'inSpotMarketVault' - isMut: true - isSigner: false + "name": "inSpotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'outTokenAccount' - isMut: true - isSigner: false + "name": "outTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'inTokenAccount' - isMut: true - isSigner: false + "name": "inTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'instructions' - isMut: false - isSigner: false - docs: ['Instructions Sysvar for instruction introspection'] + "name": "instructions", + "isMut": false, + "isSigner": false, + "docs": [ + "Instructions Sysvar for instruction introspection" + ] } - ] - args: [ + ], + "args": [ { - name: 'inMarketIndex' - type: 'u16' + "name": "inMarketIndex", + "type": "u16" }, { - name: 'outMarketIndex' - type: 'u16' + "name": "outMarketIndex", + "type": "u16" }, { - name: 'amountIn' - type: 'u64' + "name": "amountIn", + "type": "u64" } ] }, { - name: 'endSwap' - accounts: [ + "name": "endSwap", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'outSpotMarketVault' - isMut: true - isSigner: false + "name": "outSpotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'inSpotMarketVault' - isMut: true - isSigner: false + "name": "inSpotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'outTokenAccount' - isMut: true - isSigner: false + "name": "outTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'inTokenAccount' - isMut: true - isSigner: false + "name": "inTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'instructions' - isMut: false - isSigner: false - docs: ['Instructions Sysvar for instruction introspection'] + "name": "instructions", + "isMut": false, + "isSigner": false, + "docs": [ + "Instructions Sysvar for instruction introspection" + ] } - ] - args: [ + ], + "args": [ { - name: 'inMarketIndex' - type: 'u16' + "name": "inMarketIndex", + "type": "u16" }, { - name: 'outMarketIndex' - type: 'u16' + "name": "outMarketIndex", + "type": "u16" }, { - name: 'limitPrice' - type: { - option: 'u64' + "name": "limitPrice", + "type": { + "option": "u64" } }, { - name: 'reduceOnly' - type: { - option: { - defined: 'SwapReduceOnly' + "name": "reduceOnly", + "type": { + "option": { + "defined": "SwapReduceOnly" } } } ] }, { - name: 'addPerpLpShares' - accounts: [ + "name": "addPerpLpShares", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'nShares' - type: 'u64' + "name": "nShares", + "type": "u64" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'removePerpLpShares' - accounts: [ + "name": "removePerpLpShares", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'sharesToBurn' - type: 'u64' + "name": "sharesToBurn", + "type": "u64" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'removePerpLpSharesInExpiringMarket' - accounts: [ + "name": "removePerpLpSharesInExpiringMarket", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'sharesToBurn' - type: 'u64' + "name": "sharesToBurn", + "type": "u64" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'updateUserName' - accounts: [ + "name": "updateUserName", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'subAccountId' - type: 'u16' + "name": "subAccountId", + "type": "u16" }, { - name: 'name' - type: { - array: ['u8', 32] + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] } } ] }, { - name: 'updateUserCustomMarginRatio' - accounts: [ + "name": "updateUserCustomMarginRatio", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'subAccountId' - type: 'u16' + "name": "subAccountId", + "type": "u16" }, { - name: 'marginRatio' - type: 'u32' + "name": "marginRatio", + "type": "u32" } ] }, { - name: 'updateUserMarginTradingEnabled' - accounts: [ + "name": "updateUserMarginTradingEnabled", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'subAccountId' - type: 'u16' + "name": "subAccountId", + "type": "u16" }, { - name: 'marginTradingEnabled' - type: 'bool' + "name": "marginTradingEnabled", + "type": "bool" } ] }, { - name: 'updateUserDelegate' - accounts: [ + "name": "updateUserDelegate", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'subAccountId' - type: 'u16' + "name": "subAccountId", + "type": "u16" }, { - name: 'delegate' - type: 'publicKey' + "name": "delegate", + "type": "publicKey" } ] }, { - name: 'updateUserReduceOnly' - accounts: [ + "name": "updateUserReduceOnly", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'subAccountId' - type: 'u16' + "name": "subAccountId", + "type": "u16" }, { - name: 'reduceOnly' - type: 'bool' + "name": "reduceOnly", + "type": "bool" } ] }, { - name: 'updateUserAdvancedLp' - accounts: [ + "name": "updateUserAdvancedLp", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'subAccountId' - type: 'u16' + "name": "subAccountId", + "type": "u16" }, { - name: 'advancedLp' - type: 'bool' + "name": "advancedLp", + "type": "bool" } ] }, { - name: 'deleteUser' - accounts: [ + "name": "deleteUser", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [] + ], + "args": [] }, { - name: 'reclaimRent' - accounts: [ + "name": "reclaimRent", + "accounts": [ { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'rent' - isMut: false - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'fillPerpOrder' - accounts: [ + "name": "fillPerpOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler' - isMut: true - isSigner: false + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'fillerStats' - isMut: true - isSigner: false + "name": "fillerStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'orderId' - type: { - option: 'u32' + "name": "orderId", + "type": { + "option": "u32" } }, { - name: 'makerOrderId' - type: { - option: 'u32' + "name": "makerOrderId", + "type": { + "option": "u32" } } ] }, { - name: 'revertFill' - accounts: [ + "name": "revertFill", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler' - isMut: true - isSigner: false + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'fillerStats' - isMut: true - isSigner: false + "name": "fillerStats", + "isMut": true, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'fillSpotOrder' - accounts: [ + "name": "fillSpotOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler' - isMut: true - isSigner: false + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'fillerStats' - isMut: true - isSigner: false + "name": "fillerStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'orderId' - type: { - option: 'u32' + "name": "orderId", + "type": { + "option": "u32" } }, { - name: 'fulfillmentType' - type: { - option: { - defined: 'SpotFulfillmentType' + "name": "fulfillmentType", + "type": { + "option": { + "defined": "SpotFulfillmentType" } } }, { - name: 'makerOrderId' - type: { - option: 'u32' + "name": "makerOrderId", + "type": { + "option": "u32" } } ] }, { - name: 'triggerOrder' - accounts: [ + "name": "triggerOrder", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler' - isMut: true - isSigner: false + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'orderId' - type: 'u32' + "name": "orderId", + "type": "u32" } ] }, { - name: 'forceCancelOrders' - accounts: [ + "name": "forceCancelOrders", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler' - isMut: true - isSigner: false + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'updateUserIdle' - accounts: [ + "name": "updateUserIdle", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler' - isMut: true - isSigner: false + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'updateUserOpenOrdersCount' - accounts: [ + "name": "updateUserOpenOrdersCount", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler' - isMut: true - isSigner: false + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'adminDisableUpdatePerpBidAskTwap' - accounts: [ + "name": "adminDisableUpdatePerpBidAskTwap", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'disable' - type: 'bool' + "name": "disable", + "type": "bool" } ] }, { - name: 'settlePnl' - accounts: [ + "name": "settlePnl", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'spotMarketVault' - isMut: false - isSigner: false + "name": "spotMarketVault", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'settleFundingPayment' - accounts: [ + "name": "settleMultiplePnls", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "spotMarketVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'state' - isMut: false - isSigner: false + "name": "marketIndexes", + "type": { + "vec": "u16" + } }, { - name: 'user' - isMut: true - isSigner: false + "name": "mode", + "type": { + "defined": "SettlePnlMode" + } } ] - args: [] }, { - name: 'settleLp' - accounts: [ + "name": "settleFundingPayment", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [] + }, + { + "name": "settleLp", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'settleExpiredMarket' - accounts: [ + "name": "settleExpiredMarket", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'liquidatePerp' - accounts: [ + "name": "liquidatePerp", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'liquidator' - isMut: true - isSigner: false + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats' - isMut: true - isSigner: false + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'liquidatorMaxBaseAssetAmount' - type: 'u64' + "name": "liquidatorMaxBaseAssetAmount", + "type": "u64" }, { - name: 'limitPrice' - type: { - option: 'u64' + "name": "limitPrice", + "type": { + "option": "u64" } } ] }, { - name: 'liquidateSpot' - accounts: [ + "name": "liquidatePerpWithFill", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'liquidator' - isMut: true - isSigner: false + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats' - isMut: true - isSigner: false + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "marketIndex", + "type": "u16" } ] - args: [ + }, + { + "name": "liquidateSpot", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "liquidator", + "isMut": true, + "isSigner": false + }, { - name: 'assetMarketIndex' - type: 'u16' + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'liabilityMarketIndex' - type: 'u16' + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorMaxLiabilityTransfer' - type: 'u128' + "name": "userStats", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "assetMarketIndex", + "type": "u16" + }, + { + "name": "liabilityMarketIndex", + "type": "u16" + }, + { + "name": "liquidatorMaxLiabilityTransfer", + "type": "u128" }, { - name: 'limitPrice' - type: { - option: 'u64' + "name": "limitPrice", + "type": { + "option": "u64" } } ] }, { - name: 'liquidateBorrowForPerpPnl' - accounts: [ + "name": "liquidateBorrowForPerpPnl", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'liquidator' - isMut: true - isSigner: false + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats' - isMut: true - isSigner: false + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'perpMarketIndex' - type: 'u16' + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'spotMarketIndex' - type: 'u16' + "name": "spotMarketIndex", + "type": "u16" }, { - name: 'liquidatorMaxLiabilityTransfer' - type: 'u128' + "name": "liquidatorMaxLiabilityTransfer", + "type": "u128" }, { - name: 'limitPrice' - type: { - option: 'u64' + "name": "limitPrice", + "type": { + "option": "u64" } } ] }, { - name: 'liquidatePerpPnlForDeposit' - accounts: [ + "name": "liquidatePerpPnlForDeposit", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'liquidator' - isMut: true - isSigner: false + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats' - isMut: true - isSigner: false + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'perpMarketIndex' - type: 'u16' + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'spotMarketIndex' - type: 'u16' + "name": "spotMarketIndex", + "type": "u16" }, { - name: 'liquidatorMaxPnlTransfer' - type: 'u128' + "name": "liquidatorMaxPnlTransfer", + "type": "u128" }, { - name: 'limitPrice' - type: { - option: 'u64' + "name": "limitPrice", + "type": { + "option": "u64" } } ] }, { - name: 'resolvePerpPnlDeficit' - accounts: [ + "name": "setUserStatusToBeingLiquidated", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "resolvePerpPnlDeficit", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'spotMarketIndex' - type: 'u16' + "name": "spotMarketIndex", + "type": "u16" }, { - name: 'perpMarketIndex' - type: 'u16' + "name": "perpMarketIndex", + "type": "u16" } ] }, { - name: 'resolvePerpBankruptcy' - accounts: [ + "name": "resolvePerpBankruptcy", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'liquidator' - isMut: true - isSigner: false + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats' - isMut: true - isSigner: false + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'quoteSpotMarketIndex' - type: 'u16' + "name": "quoteSpotMarketIndex", + "type": "u16" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'resolveSpotBankruptcy' - accounts: [ + "name": "resolveSpotBankruptcy", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'liquidator' - isMut: true - isSigner: false + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats' - isMut: true - isSigner: false + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'user' - isMut: true - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'settleRevenueToInsuranceFund' - accounts: [ + "name": "settleRevenueToInsuranceFund", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'spotMarketIndex' - type: 'u16' + "name": "spotMarketIndex", + "type": "u16" } ] }, { - name: 'updateFundingRate' - accounts: [ + "name": "updateFundingRate", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'updatePerpBidAskTwap' - accounts: [ + "name": "updatePrelaunchOracle", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "perpMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updatePerpBidAskTwap", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'keeperStats' - isMut: false - isSigner: false + "name": "keeperStats", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [] + ], + "args": [] }, { - name: 'updateSpotMarketCumulativeInterest' - accounts: [ + "name": "updateSpotMarketCumulativeInterest", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'spotMarketVault' - isMut: false - isSigner: false + "name": "spotMarketVault", + "isMut": false, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'updateAmms' - accounts: [ + "name": "updateAmms", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'marketIndexes' - type: { - array: ['u16', 5] + "name": "marketIndexes", + "type": { + "array": [ + "u16", + 5 + ] } } ] }, { - name: 'updateSpotMarketExpiry' - accounts: [ + "name": "updateSpotMarketExpiry", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'expiryTs' - type: 'i64' + "name": "expiryTs", + "type": "i64" } ] }, { - name: 'updateUserQuoteAssetInsuranceStake' - accounts: [ + "name": "updateUserQuoteAssetInsuranceStake", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundStake' - isMut: true - isSigner: false + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "signer", + "isMut": false, + "isSigner": true }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false } - ] - args: [] + ], + "args": [] + }, + { + "name": "updateUserGovTokenInsuranceStake", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false + }, + { + "name": "signer", + "isMut": false, + "isSigner": true + }, + { + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false + } + ], + "args": [] }, { - name: 'initializeInsuranceFundStake' - accounts: [ + "name": "initializeInsuranceFundStake", + "accounts": [ { - name: 'spotMarket' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundStake' - isMut: true - isSigner: false + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'payer' - isMut: true - isSigner: true + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: 'rent' - isMut: false - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'addInsuranceFundStake' - accounts: [ + "name": "addInsuranceFundStake", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundStake' - isMut: true - isSigner: false + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'userTokenAccount' - isMut: true - isSigner: false + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'amount' - type: 'u64' + "name": "amount", + "type": "u64" } ] }, { - name: 'requestRemoveInsuranceFundStake' - accounts: [ + "name": "requestRemoveInsuranceFundStake", + "accounts": [ { - name: 'spotMarket' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundStake' - isMut: true - isSigner: false + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'amount' - type: 'u64' + "name": "amount", + "type": "u64" } ] }, { - name: 'cancelRequestRemoveInsuranceFundStake' - accounts: [ + "name": "cancelRequestRemoveInsuranceFundStake", + "accounts": [ { - name: 'spotMarket' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundStake' - isMut: true - isSigner: false + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'removeInsuranceFundStake' - accounts: [ + "name": "removeInsuranceFundStake", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundStake' - isMut: true - isSigner: false + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'insuranceFundVault' - isMut: true - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'userTokenAccount' - isMut: true - isSigner: false + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'transferProtocolIfShares' - accounts: [ + "name": "transferProtocolIfShares", + "accounts": [ { - name: 'signer' - isMut: false - isSigner: true + "name": "signer", + "isMut": false, + "isSigner": true }, { - name: 'transferConfig' - isMut: true - isSigner: false + "name": "transferConfig", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundStake' - isMut: true - isSigner: false + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats' - isMut: true - isSigner: false + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority' - isMut: false - isSigner: true + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'insuranceFundVault' - isMut: false - isSigner: false + "name": "insuranceFundVault", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'shares' - type: 'u128' + "name": "shares", + "type": "u128" } ] }, { - name: 'initialize' - accounts: [ + "name": "updatePythPullOracle", + "accounts": [ + { + "name": "keeper", + "isMut": true, + "isSigner": true + }, + { + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: true - isSigner: true + "name": "encodedVaa", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "priceFeed", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "feedId", + "type": { + "array": [ + "u8", + 32 + ] + } }, { - name: 'quoteAssetMint' - isMut: false - isSigner: false + "name": "params", + "type": "bytes" + } + ] + }, + { + "name": "postPythPullOracleUpdateAtomic", + "accounts": [ + { + "name": "keeper", + "isMut": true, + "isSigner": true }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false }, { - name: 'rent' - isMut: false - isSigner: false + "name": "guardianSet", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "priceFeed", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "feedId", + "type": { + "array": [ + "u8", + 32 + ] + } }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "params", + "type": "bytes" } ] - args: [] }, { - name: 'initializeSpotMarket' - accounts: [ + "name": "postMultiPythPullOracleUpdatesAtomic", + "accounts": [ { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "keeper", + "isMut": true, + "isSigner": true }, { - name: 'spotMarketMint' - isMut: false - isSigner: false + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false }, { - name: 'spotMarketVault' - isMut: true - isSigner: false - }, + "name": "guardianSet", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'insuranceFundVault' - isMut: true - isSigner: false - }, + "name": "params", + "type": "bytes" + } + ] + }, + { + "name": "initialize", + "accounts": [ { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "quoteAssetMint", + "isMut": false, + "isSigner": false }, { - name: 'admin' - isMut: true - isSigner: true + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'rent' - isMut: false - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [] + }, + { + "name": "initializeSpotMarket", + "accounts": [ { - name: 'optimalUtilization' - type: 'u32' + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'optimalBorrowRate' - type: 'u32' + "name": "spotMarketMint", + "isMut": false, + "isSigner": false }, { - name: 'maxBorrowRate' - type: 'u32' + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'oracleSource' - type: { - defined: 'OracleSource' - } + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'initialAssetWeight' - type: 'u32' + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'maintenanceAssetWeight' - type: 'u32' + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'initialLiabilityWeight' - type: 'u32' + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'maintenanceLiabilityWeight' - type: 'u32' + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'imfFactor' - type: 'u32' + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'liquidatorFee' - type: 'u32' + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: 'activeStatus' - type: 'bool' + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "optimalUtilization", + "type": "u32" }, { - name: 'name' - type: { - array: ['u8', 32] - } - } - ] - }, - { - name: 'initializeSerumFulfillmentConfig' - accounts: [ + "name": "optimalBorrowRate", + "type": "u32" + }, { - name: 'baseSpotMarket' - isMut: false - isSigner: false + "name": "maxBorrowRate", + "type": "u32" }, { - name: 'quoteSpotMarket' - isMut: false - isSigner: false + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } }, { - name: 'state' - isMut: true - isSigner: false + "name": "initialAssetWeight", + "type": "u32" }, { - name: 'serumProgram' - isMut: false - isSigner: false + "name": "maintenanceAssetWeight", + "type": "u32" }, { - name: 'serumMarket' - isMut: false - isSigner: false + "name": "initialLiabilityWeight", + "type": "u32" }, { - name: 'serumOpenOrders' - isMut: true - isSigner: false + "name": "maintenanceLiabilityWeight", + "type": "u32" }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "imfFactor", + "type": "u32" }, { - name: 'serumFulfillmentConfig' - isMut: true - isSigner: false + "name": "liquidatorFee", + "type": "u32" }, { - name: 'admin' - isMut: true - isSigner: true + "name": "ifLiquidationFee", + "type": "u32" }, { - name: 'rent' - isMut: false - isSigner: false + "name": "activeStatus", + "type": "bool" }, { - name: 'systemProgram' - isMut: false - isSigner: false - } - ] - args: [ + "name": "assetTier", + "type": { + "defined": "AssetTier" + } + }, { - name: 'marketIndex' - type: 'u16' - } - ] - }, - { - name: 'updateSerumFulfillmentConfigStatus' - accounts: [ + "name": "scaleInitialAssetWeightStart", + "type": "u64" + }, { - name: 'state' - isMut: false - isSigner: false + "name": "withdrawGuardThreshold", + "type": "u64" }, { - name: 'serumFulfillmentConfig' - isMut: true - isSigner: false + "name": "orderTickSize", + "type": "u64" }, { - name: 'admin' - isMut: true - isSigner: true - } - ] - args: [ + "name": "orderStepSize", + "type": "u64" + }, + { + "name": "ifTotalFactor", + "type": "u32" + }, { - name: 'status' - type: { - defined: 'SpotFulfillmentConfigStatus' + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] } } ] }, { - name: 'initializePhoenixFulfillmentConfig' - accounts: [ + "name": "deleteInitializedSpotMarket", + "accounts": [ { - name: 'baseSpotMarket' - isMut: false - isSigner: false + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'quoteSpotMarket' - isMut: false - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'phoenixProgram' - isMut: false - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'phoenixMarket' - isMut: false - isSigner: false + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'phoenixFulfillmentConfig' - isMut: true - isSigner: false - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'admin' - isMut: true - isSigner: true - }, - { - name: 'rent' - isMut: false - isSigner: false - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'phoenixFulfillmentConfigStatus' - accounts: [ + "name": "initializeSerumFulfillmentConfig", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "baseSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'phoenixFulfillmentConfig' - isMut: true - isSigner: false + "name": "quoteSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'admin' - isMut: true - isSigner: true - } - ] - args: [ + "name": "state", + "isMut": true, + "isSigner": false + }, { - name: 'status' - type: { - defined: 'SpotFulfillmentConfigStatus' - } - } - ] - }, - { - name: 'updateSerumVault' - accounts: [ + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, { - name: 'state' - isMut: true - isSigner: false + "name": "serumMarket", + "isMut": false, + "isSigner": false }, { - name: 'admin' - isMut: true - isSigner: true + "name": "serumOpenOrders", + "isMut": true, + "isSigner": false }, { - name: 'srmVault' - isMut: false - isSigner: false - } - ] - args: [] - }, - { - name: 'initializePerpMarket' - accounts: [ + "name": "driftSigner", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: true - isSigner: true + "name": "serumFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] + }, + { + "name": "updateSerumFulfillmentConfigStatus", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'rent' - isMut: false - isSigner: false + "name": "serumFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "admin", + "isMut": true, + "isSigner": true + } + ], + "args": [ + { + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } } ] - args: [ + }, + { + "name": "initializeOpenbookV2FulfillmentConfig", + "accounts": [ { - name: 'marketIndex' - type: 'u16' + "name": "baseSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'ammBaseAssetReserve' - type: 'u128' + "name": "quoteSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'ammQuoteAssetReserve' - type: 'u128' + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'ammPeriodicity' - type: 'i64' + "name": "openbookV2Program", + "isMut": false, + "isSigner": false }, { - name: 'ammPegMultiplier' - type: 'u128' + "name": "openbookV2Market", + "isMut": false, + "isSigner": false }, { - name: 'oracleSource' - type: { - defined: 'OracleSource' - } + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'marginRatioInitial' - type: 'u32' + "name": "openbookV2FulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'marginRatioMaintenance' - type: 'u32' + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'liquidatorFee' - type: 'u32' + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'activeStatus' - type: 'bool' - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'name' - type: { - array: ['u8', 32] - } + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'deleteInitializedPerpMarket' - accounts: [ + "name": "openbookV2FulfillmentConfigStatus", + "accounts": [ { - name: 'admin' - isMut: true - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "openbookV2FulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "admin", + "isMut": true, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'marketIndex' - type: 'u16' + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } } ] }, { - name: 'moveAmmPrice' - accounts: [ + "name": "initializePhoenixFulfillmentConfig", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "baseSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "quoteSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false - } - ] - args: [ - { - name: 'baseAssetReserve' - type: 'u128' + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'quoteAssetReserve' - type: 'u128' + "name": "phoenixProgram", + "isMut": false, + "isSigner": false }, { - name: 'sqrtK' - type: 'u128' - } - ] - }, - { - name: 'recenterPerpMarketAmm' - accounts: [ + "name": "phoenixMarket", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "phoenixFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false - } - ] - args: [ + "name": "admin", + "isMut": true, + "isSigner": true + }, { - name: 'pegMultiplier' - type: 'u128' + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'sqrtK' - type: 'u128' + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'updatePerpMarketExpiry' - accounts: [ + "name": "phoenixFulfillmentConfigStatus", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "phoenixFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "admin", + "isMut": true, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'expiryTs' - type: 'i64' + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } } ] }, { - name: 'settleExpiredMarketPoolsToRevenuePool' - accounts: [ - { - name: 'state' - isMut: false - isSigner: false - }, + "name": "updateSerumVault", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "srmVault", + "isMut": false, + "isSigner": false } - ] - args: [] + ], + "args": [] }, { - name: 'depositIntoPerpMarketFeePool' - accounts: [ + "name": "initializePerpMarket", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'admin' - isMut: false - isSigner: true + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'sourceVault' - isMut: true - isSigner: false + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "marketIndex", + "type": "u16" }, { - name: 'quoteSpotMarket' - isMut: true - isSigner: false + "name": "ammBaseAssetReserve", + "type": "u128" }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "ammQuoteAssetReserve", + "type": "u128" }, { - name: 'tokenProgram' - isMut: false - isSigner: false - } - ] - args: [ + "name": "ammPeriodicity", + "type": "i64" + }, { - name: 'amount' - type: 'u64' - } - ] - }, - { - name: 'depositIntoSpotMarketRevenuePool' - accounts: [ + "name": "ammPegMultiplier", + "type": "u128" + }, { - name: 'state' - isMut: false - isSigner: false + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "contractTier", + "type": { + "defined": "ContractTier" + } }, { - name: 'authority' - isMut: true - isSigner: true + "name": "marginRatioInitial", + "type": "u32" }, { - name: 'spotMarketVault' - isMut: true - isSigner: false + "name": "marginRatioMaintenance", + "type": "u32" }, { - name: 'userTokenAccount' - isMut: true - isSigner: false + "name": "liquidatorFee", + "type": "u32" }, { - name: 'tokenProgram' - isMut: false - isSigner: false - } - ] - args: [ + "name": "ifLiquidationFee", + "type": "u32" + }, { - name: 'amount' - type: 'u64' - } - ] - }, - { - name: 'repegAmmCurve' - accounts: [ + "name": "imfFactor", + "type": "u32" + }, { - name: 'state' - isMut: false - isSigner: false + "name": "activeStatus", + "type": "bool" }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "baseSpread", + "type": "u32" }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "maxSpread", + "type": "u32" }, { - name: 'admin' - isMut: false - isSigner: true - } - ] - args: [ + "name": "maxOpenInterest", + "type": "u128" + }, { - name: 'newPegCandidate' - type: 'u128' - } - ] - }, - { - name: 'updatePerpMarketAmmOracleTwap' - accounts: [ + "name": "maxRevenueWithdrawPerPeriod", + "type": "u64" + }, { - name: 'state' - isMut: false - isSigner: false + "name": "quoteMaxInsurance", + "type": "u64" }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "orderStepSize", + "type": "u64" }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "orderTickSize", + "type": "u64" }, { - name: 'admin' - isMut: false - isSigner: true - } - ] - args: [] - }, - { - name: 'resetPerpMarketAmmOracleTwap' - accounts: [ + "name": "minOrderSize", + "type": "u64" + }, { - name: 'state' - isMut: false - isSigner: false + "name": "concentrationCoefScale", + "type": "u128" }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "curveUpdateIntensity", + "type": "u8" }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "ammJitIntensity", + "type": "u8" }, { - name: 'admin' - isMut: false - isSigner: true + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } } ] - args: [] }, { - name: 'updateK' - accounts: [ - { - name: 'admin' - isMut: false - isSigner: true - }, + "name": "initializePredictionMarket", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'oracle' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'sqrtK' - type: 'u128' + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] + ], + "args": [] }, { - name: 'updatePerpMarketMarginRatio' - accounts: [ + "name": "deleteInitializedPerpMarket", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ - { - name: 'marginRatioInitial' - type: 'u32' - }, + ], + "args": [ { - name: 'marginRatioMaintenance' - type: 'u32' + "name": "marketIndex", + "type": "u16" } ] }, { - name: 'updatePerpMarketMaxImbalances' - accounts: [ + "name": "moveAmmPrice", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'unrealizedMaxImbalance' - type: 'u64' + "name": "baseAssetReserve", + "type": "u128" }, { - name: 'maxRevenueWithdrawPerPeriod' - type: 'u64' + "name": "quoteAssetReserve", + "type": "u128" }, { - name: 'quoteMaxInsurance' - type: 'u64' + "name": "sqrtK", + "type": "u128" } ] }, { - name: 'updatePerpMarketLiquidationFee' - accounts: [ + "name": "recenterPerpMarketAmm", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'liquidatorFee' - type: 'u32' + "name": "pegMultiplier", + "type": "u128" }, { - name: 'ifLiquidationFee' - type: 'u32' + "name": "sqrtK", + "type": "u128" } ] }, { - name: 'updateInsuranceFundUnstakingPeriod' - accounts: [ + "name": "updatePerpMarketAmmSummaryStats", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'insuranceFundUnstakingPeriod' - type: 'i64' + "name": "params", + "type": { + "defined": "UpdatePerpMarketSummaryStatsParams" + } } ] }, { - name: 'updateSpotMarketLiquidationFee' - accounts: [ + "name": "updatePerpMarketExpiry", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ - { - name: 'liquidatorFee' - type: 'u32' - }, + ], + "args": [ { - name: 'ifLiquidationFee' - type: 'u32' + "name": "expiryTs", + "type": "i64" } ] }, { - name: 'updateWithdrawGuardThreshold' - accounts: [ + "name": "settleExpiredMarketPoolsToRevenuePool", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'spotMarket' - isMut: true - isSigner: false - } - ] - args: [ + "name": "spotMarket", + "isMut": true, + "isSigner": false + }, { - name: 'withdrawGuardThreshold' - type: 'u64' + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] + ], + "args": [] }, { - name: 'updateSpotMarketIfFactor' - accounts: [ + "name": "depositIntoPerpMarketFeePool", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false - } - ] - args: [ + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "sourceVault", + "isMut": true, + "isSigner": false + }, + { + "name": "driftSigner", + "isMut": false, + "isSigner": false + }, { - name: 'spotMarketIndex' - type: 'u16' + "name": "quoteSpotMarket", + "isMut": true, + "isSigner": false }, { - name: 'userIfFactor' - type: 'u32' + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'totalIfFactor' - type: 'u32' + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" } ] }, { - name: 'updateSpotMarketRevenueSettlePeriod' - accounts: [ + "name": "depositIntoSpotMarketVault", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "sourceVault", + "isMut": true, + "isSigner": false + }, + { + "name": "spotMarketVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'revenueSettlePeriod' - type: 'i64' + "name": "amount", + "type": "u64" } ] }, { - name: 'updateSpotMarketStatus' - accounts: [ + "name": "depositIntoSpotMarketRevenuePool", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "authority", + "isMut": true, + "isSigner": true }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarketVault", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'status' - type: { - defined: 'MarketStatus' - } + "name": "amount", + "type": "u64" } ] }, { - name: 'updateSpotMarketPausedOperations' - accounts: [ + "name": "repegAmmCurve", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ { - name: 'pausedOperations' - type: 'u8' + "name": "newPegCandidate", + "type": "u128" } ] }, { - name: 'updateSpotMarketAssetTier' - accounts: [ + "name": "updatePerpMarketAmmOracleTwap", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false - } - ] - args: [ + "name": "oracle", + "isMut": false, + "isSigner": false + }, { - name: 'assetTier' - type: { - defined: 'AssetTier' - } + "name": "admin", + "isMut": false, + "isSigner": true } - ] + ], + "args": [] }, { - name: 'updateSpotMarketMarginWeights' - accounts: [ + "name": "resetPerpMarketAmmOracleTwap", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [] + }, + { + "name": "updateK", + "accounts": [ { - name: 'initialAssetWeight' - type: 'u32' + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'maintenanceAssetWeight' - type: 'u32' + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'initialLiabilityWeight' - type: 'u32' + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'maintenanceLiabilityWeight' - type: 'u32' - }, + "name": "oracle", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'imfFactor' - type: 'u32' + "name": "sqrtK", + "type": "u128" } ] }, { - name: 'updateSpotMarketBorrowRate' - accounts: [ + "name": "updatePerpMarketMarginRatio", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ - { - name: 'optimalUtilization' - type: 'u32' - }, + ], + "args": [ { - name: 'optimalBorrowRate' - type: 'u32' + "name": "marginRatioInitial", + "type": "u32" }, { - name: 'maxBorrowRate' - type: 'u32' + "name": "marginRatioMaintenance", + "type": "u32" } ] }, { - name: 'updateSpotMarketMaxTokenDeposits' - accounts: [ + "name": "updatePerpMarketFundingPeriod", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'maxTokenDeposits' - type: 'u64' + "name": "fundingPeriod", + "type": "i64" } ] }, { - name: 'updateSpotMarketScaleInitialAssetWeightStart' - accounts: [ + "name": "updatePerpMarketMaxImbalances", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "unrealizedMaxImbalance", + "type": "u64" + }, { - name: 'scaleInitialAssetWeightStart' - type: 'u64' + "name": "maxRevenueWithdrawPerPeriod", + "type": "u64" + }, + { + "name": "quoteMaxInsurance", + "type": "u64" } ] }, { - name: 'updateSpotMarketOracle' - accounts: [ + "name": "updatePerpMarketLiquidationFee", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidatorFee", + "type": "u32" }, { - name: 'oracle' - isMut: false - isSigner: false + "name": "ifLiquidationFee", + "type": "u32" } ] - args: [ + }, + { + "name": "updateInsuranceFundUnstakingPeriod", + "accounts": [ { - name: 'oracle' - type: 'publicKey' + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'oracleSource' - type: { - defined: 'OracleSource' - } + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "insuranceFundUnstakingPeriod", + "type": "i64" } ] }, { - name: 'updateSpotMarketStepSizeAndTickSize' - accounts: [ + "name": "updateSpotMarketLiquidationFee", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'stepSize' - type: 'u64' + "name": "liquidatorFee", + "type": "u32" }, { - name: 'tickSize' - type: 'u64' + "name": "ifLiquidationFee", + "type": "u32" } ] }, { - name: 'updateSpotMarketMinOrderSize' - accounts: [ + "name": "updateWithdrawGuardThreshold", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'orderSize' - type: 'u64' + "name": "withdrawGuardThreshold", + "type": "u64" } ] }, { - name: 'updateSpotMarketOrdersEnabled' - accounts: [ + "name": "updateSpotMarketIfFactor", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "spotMarketIndex", + "type": "u16" + }, + { + "name": "userIfFactor", + "type": "u32" + }, { - name: 'ordersEnabled' - type: 'bool' + "name": "totalIfFactor", + "type": "u32" } ] }, { - name: 'updateSpotMarketName' - accounts: [ + "name": "updateSpotMarketRevenueSettlePeriod", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'name' - type: { - array: ['u8', 32] - } + "name": "revenueSettlePeriod", + "type": "i64" } ] }, { - name: 'updatePerpMarketStatus' - accounts: [ + "name": "updateSpotMarketStatus", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'status' - type: { - defined: 'MarketStatus' + "name": "status", + "type": { + "defined": "MarketStatus" } } ] }, { - name: 'updatePerpMarketPausedOperations' - accounts: [ + "name": "updateSpotMarketPausedOperations", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'pausedOperations' - type: 'u8' + "name": "pausedOperations", + "type": "u8" } ] }, { - name: 'updatePerpMarketContractTier' - accounts: [ + "name": "updateSpotMarketAssetTier", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'contractTier' - type: { - defined: 'ContractTier' + "name": "assetTier", + "type": { + "defined": "AssetTier" } } ] }, { - name: 'updatePerpMarketImfFactor' - accounts: [ + "name": "updateSpotMarketMarginWeights", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "initialAssetWeight", + "type": "u32" + }, { - name: 'imfFactor' - type: 'u32' + "name": "maintenanceAssetWeight", + "type": "u32" }, { - name: 'unrealizedPnlImfFactor' - type: 'u32' + "name": "initialLiabilityWeight", + "type": "u32" + }, + { + "name": "maintenanceLiabilityWeight", + "type": "u32" + }, + { + "name": "imfFactor", + "type": "u32" } ] }, { - name: 'updatePerpMarketUnrealizedAssetWeight' - accounts: [ + "name": "updateSpotMarketBorrowRate", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "optimalUtilization", + "type": "u32" + }, { - name: 'unrealizedInitialAssetWeight' - type: 'u32' + "name": "optimalBorrowRate", + "type": "u32" }, { - name: 'unrealizedMaintenanceAssetWeight' - type: 'u32' + "name": "maxBorrowRate", + "type": "u32" + }, + { + "name": "minBorrowRate", + "type": { + "option": "u8" + } } ] }, { - name: 'updatePerpMarketConcentrationCoef' - accounts: [ + "name": "updateSpotMarketMaxTokenDeposits", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'concentrationScale' - type: 'u128' + "name": "maxTokenDeposits", + "type": "u64" } ] }, { - name: 'updatePerpMarketCurveUpdateIntensity' - accounts: [ + "name": "updateSpotMarketMaxTokenBorrows", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'curveUpdateIntensity' - type: 'u8' + "name": "maxTokenBorrowsFraction", + "type": "u16" } ] }, { - name: 'updatePerpMarketTargetBaseAssetAmountPerLp' - accounts: [ + "name": "updateSpotMarketScaleInitialAssetWeightStart", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'targetBaseAssetAmountPerLp' - type: 'i32' + "name": "scaleInitialAssetWeightStart", + "type": "u64" } ] }, { - name: 'updatePerpMarketPerLpBase' - accounts: [ + "name": "updateSpotMarketOracle", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "oracle", + "type": "publicKey" + }, { - name: 'perLpBase' - type: 'i8' + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } } ] }, { - name: 'updateLpCooldownTime' - accounts: [ + "name": "updateSpotMarketStepSizeAndTickSize", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'lpCooldownTime' - type: 'u64' + "name": "stepSize", + "type": "u64" + }, + { + "name": "tickSize", + "type": "u64" } ] }, { - name: 'updatePerpFeeStructure' - accounts: [ + "name": "updateSpotMarketMinOrderSize", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'feeStructure' - type: { - defined: 'FeeStructure' - } + "name": "orderSize", + "type": "u64" } ] }, { - name: 'updateSpotFeeStructure' - accounts: [ + "name": "updateSpotMarketOrdersEnabled", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'feeStructure' - type: { - defined: 'FeeStructure' - } + "name": "ordersEnabled", + "type": "bool" } ] }, { - name: 'updateInitialPctToLiquidate' - accounts: [ + "name": "updateSpotMarketIfPausedOperations", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'initialPctToLiquidate' - type: 'u16' + "name": "pausedOperations", + "type": "u8" } ] }, { - name: 'updateLiquidationDuration' - accounts: [ + "name": "updateSpotMarketName", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'liquidationDuration' - type: 'u8' + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } } ] }, { - name: 'updateLiquidationMarginBufferRatio' - accounts: [ + "name": "updatePerpMarketStatus", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'liquidationMarginBufferRatio' - type: 'u32' + "name": "status", + "type": { + "defined": "MarketStatus" + } } ] }, { - name: 'updateOracleGuardRails' - accounts: [ + "name": "updatePerpMarketPausedOperations", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "pausedOperations", + "type": "u8" } ] - args: [ + }, + { + "name": "updatePerpMarketContractTier", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'oracleGuardRails' - type: { - defined: 'OracleGuardRails' + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "contractTier", + "type": { + "defined": "ContractTier" } } ] }, { - name: 'updateStateSettlementDuration' - accounts: [ + "name": "updatePerpMarketImfFactor", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "imfFactor", + "type": "u32" + }, { - name: 'settlementDuration' - type: 'u16' + "name": "unrealizedPnlImfFactor", + "type": "u32" } ] }, { - name: 'updateStateMaxNumberOfSubAccounts' - accounts: [ + "name": "updatePerpMarketUnrealizedAssetWeight", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "unrealizedInitialAssetWeight", + "type": "u32" + }, { - name: 'maxNumberOfSubAccounts' - type: 'u16' + "name": "unrealizedMaintenanceAssetWeight", + "type": "u32" } ] }, { - name: 'updateStateMaxInitializeUserFee' - accounts: [ + "name": "updatePerpMarketConcentrationCoef", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'maxInitializeUserFee' - type: 'u16' + "name": "concentrationScale", + "type": "u128" } ] }, { - name: 'updatePerpMarketOracle' - accounts: [ + "name": "updatePerpMarketCurveUpdateIntensity", + "accounts": [ { - name: 'state' - isMut: false - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'oracle' - isMut: false - isSigner: false - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "curveUpdateIntensity", + "type": "u8" } ] - args: [ + }, + { + "name": "updatePerpMarketTargetBaseAssetAmountPerLp", + "accounts": [ { - name: 'oracle' - type: 'publicKey' + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'oracleSource' - type: { - defined: 'OracleSource' - } + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "targetBaseAssetAmountPerLp", + "type": "i32" } ] }, { - name: 'updatePerpMarketBaseSpread' - accounts: [ + "name": "updatePerpMarketPerLpBase", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "perLpBase", + "type": "i8" } ] - args: [ + }, + { + "name": "updateLpCooldownTime", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'baseSpread' - type: 'u32' + "name": "lpCooldownTime", + "type": "u64" } ] }, { - name: 'updateAmmJitIntensity' - accounts: [ + "name": "updatePerpFeeStructure", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "feeStructure", + "type": { + "defined": "FeeStructure" + } + } + ] + }, + { + "name": "updateSpotFeeStructure", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "feeStructure", + "type": { + "defined": "FeeStructure" + } } ] - args: [ + }, + { + "name": "updateInitialPctToLiquidate", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'ammJitIntensity' - type: 'u8' + "name": "initialPctToLiquidate", + "type": "u16" } ] }, { - name: 'updatePerpMarketMaxSpread' - accounts: [ + "name": "updateLiquidationDuration", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidationDuration", + "type": "u8" + } + ] + }, + { + "name": "updateLiquidationMarginBufferRatio", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidationMarginBufferRatio", + "type": "u32" } ] - args: [ + }, + { + "name": "updateOracleGuardRails", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'maxSpread' - type: 'u32' + "name": "oracleGuardRails", + "type": { + "defined": "OracleGuardRails" + } } ] }, { - name: 'updatePerpMarketStepSizeAndTickSize' - accounts: [ + "name": "updateStateSettlementDuration", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "settlementDuration", + "type": "u16" + } + ] + }, + { + "name": "updateStateMaxNumberOfSubAccounts", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "maxNumberOfSubAccounts", + "type": "u16" } ] - args: [ + }, + { + "name": "updateStateMaxInitializeUserFee", + "accounts": [ { - name: 'stepSize' - type: 'u64' + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'tickSize' - type: 'u64' + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "maxInitializeUserFee", + "type": "u16" } ] }, { - name: 'updatePerpMarketName' - accounts: [ + "name": "updatePerpMarketOracle", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true } - ] - args: [ + ], + "args": [ + { + "name": "oracle", + "type": "publicKey" + }, { - name: 'name' - type: { - array: ['u8', 32] + "name": "oracleSource", + "type": { + "defined": "OracleSource" } } ] }, { - name: 'updatePerpMarketMinOrderSize' - accounts: [ + "name": "updatePerpMarketBaseSpread", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'orderSize' - type: 'u64' + "name": "baseSpread", + "type": "u32" } ] }, { - name: 'updatePerpMarketMaxSlippageRatio' - accounts: [ + "name": "updateAmmJitIntensity", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'maxSlippageRatio' - type: 'u16' + "name": "ammJitIntensity", + "type": "u8" } ] }, { - name: 'updatePerpMarketMaxFillReserveFraction' - accounts: [ + "name": "updatePerpMarketMaxSpread", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'maxFillReserveFraction' - type: 'u16' + "name": "maxSpread", + "type": "u32" } ] }, { - name: 'updatePerpMarketMaxOpenInterest' - accounts: [ + "name": "updatePerpMarketStepSizeAndTickSize", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "stepSize", + "type": "u64" + }, { - name: 'maxOpenInterest' - type: 'u128' + "name": "tickSize", + "type": "u64" } ] }, { - name: 'updatePerpMarketFeeAdjustment' - accounts: [ + "name": "updatePerpMarketName", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'feeAdjustment' - type: 'i16' + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } } ] }, { - name: 'updateAdmin' - accounts: [ + "name": "updatePerpMarketMinOrderSize", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'admin' - type: 'publicKey' + "name": "orderSize", + "type": "u64" } ] }, { - name: 'updateWhitelistMint' - accounts: [ + "name": "updatePerpMarketMaxSlippageRatio", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'whitelistMint' - type: 'publicKey' + "name": "maxSlippageRatio", + "type": "u16" } ] }, { - name: 'updateDiscountMint' - accounts: [ + "name": "updatePerpMarketMaxFillReserveFraction", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'discountMint' - type: 'publicKey' + "name": "maxFillReserveFraction", + "type": "u16" } ] }, { - name: 'updateExchangeStatus' - accounts: [ + "name": "updatePerpMarketMaxOpenInterest", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'exchangeStatus' - type: 'u8' + "name": "maxOpenInterest", + "type": "u128" } ] }, { - name: 'updatePerpAuctionDuration' - accounts: [ + "name": "updatePerpMarketNumberOfUsers", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "numberOfUsers", + "type": { + "option": "u32" + } + }, { - name: 'minPerpAuctionDuration' - type: 'u8' + "name": "numberOfUsersWithBase", + "type": { + "option": "u32" + } } ] }, { - name: 'updateSpotAuctionDuration' - accounts: [ + "name": "updatePerpMarketFeeAdjustment", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, { - name: 'admin' - isMut: false - isSigner: true + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: true - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'defaultSpotAuctionDuration' - type: 'u8' + "name": "feeAdjustment", + "type": "i16" } ] }, { - name: 'adminRemoveInsuranceFundStake' - accounts: [ + "name": "updateSpotMarketFeeAdjustment", + "accounts": [ { - name: 'admin' - isMut: false - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state' - isMut: false - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket' - isMut: false - isSigner: false - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'insuranceFundVault' - isMut: true - isSigner: false - }, + "name": "feeAdjustment", + "type": "i16" + } + ] + }, + { + "name": "updatePerpMarketFuel", + "accounts": [ { - name: 'driftSigner' - isMut: false - isSigner: false + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'adminTokenAccount' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram' - isMut: false - isSigner: false + "name": "perpMarket", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ + { + "name": "fuelBoostTaker", + "type": { + "option": "u8" + } + }, { - name: 'marketIndex' - type: 'u16' + "name": "fuelBoostMaker", + "type": { + "option": "u8" + } }, { - name: 'amount' - type: 'u64' + "name": "fuelBoostPosition", + "type": { + "option": "u8" + } } ] }, { - name: 'initializeProtocolIfSharesTransferConfig' - accounts: [ + "name": "updateSpotMarketFuel", + "accounts": [ { - name: 'admin' - isMut: true - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'protocolIfSharesTransferConfig' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "spotMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "fuelBoostDeposits", + "type": { + "option": "u8" + } + }, + { + "name": "fuelBoostBorrows", + "type": { + "option": "u8" + } + }, + { + "name": "fuelBoostTaker", + "type": { + "option": "u8" + } }, { - name: 'rent' - isMut: false - isSigner: false + "name": "fuelBoostMaker", + "type": { + "option": "u8" + } }, { - name: 'systemProgram' - isMut: false - isSigner: false + "name": "fuelBoostInsurance", + "type": { + "option": "u8" + } } ] - args: [] }, { - name: 'updateProtocolIfSharesTransferConfig' - accounts: [ + "name": "initUserFuel", + "accounts": [ { - name: 'admin' - isMut: true - isSigner: true + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'protocolIfSharesTransferConfig' - isMut: true - isSigner: false + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state' - isMut: false - isSigner: false + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false } - ] - args: [ + ], + "args": [ { - name: 'whitelistedSigners' - type: { - option: { - array: ['publicKey', 4] - } + "name": "fuelBoostDeposits", + "type": { + "option": "u32" + } + }, + { + "name": "fuelBoostBorrows", + "type": { + "option": "u32" + } + }, + { + "name": "fuelBoostTaker", + "type": { + "option": "u32" + } + }, + { + "name": "fuelBoostMaker", + "type": { + "option": "u32" } }, { - name: 'maxTransferPerEpoch' - type: { - option: 'u128' + "name": "fuelBoostInsurance", + "type": { + "option": "u32" } } ] - } - ] - accounts: [ + }, { - name: 'phoenixV1FulfillmentConfig' - type: { - kind: 'struct' - fields: [ - { - name: 'pubkey' - type: 'publicKey' - }, - { - name: 'phoenixProgramId' - type: 'publicKey' - }, - { - name: 'phoenixLogAuthority' - type: 'publicKey' - }, - { - name: 'phoenixMarket' - type: 'publicKey' - }, - { - name: 'phoenixBaseVault' - type: 'publicKey' - }, - { - name: 'phoenixQuoteVault' - type: 'publicKey' - }, - { - name: 'marketIndex' - type: 'u16' - }, - { - name: 'fulfillmentType' - type: { - defined: 'SpotFulfillmentType' - } - }, - { - name: 'status' - type: { - defined: 'SpotFulfillmentConfigStatus' - } - }, - { - name: 'padding' - type: { - array: ['u8', 4] - } - } - ] - } + "name": "updateAdmin", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "admin", + "type": "publicKey" + } + ] }, { - name: 'serumV3FulfillmentConfig' - type: { - kind: 'struct' - fields: [ - { - name: 'pubkey' - type: 'publicKey' - }, + "name": "updateWhitelistMint", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "whitelistMint", + "type": "publicKey" + } + ] + }, + { + "name": "updateDiscountMint", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "discountMint", + "type": "publicKey" + } + ] + }, + { + "name": "updateExchangeStatus", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "exchangeStatus", + "type": "u8" + } + ] + }, + { + "name": "updatePerpAuctionDuration", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "minPerpAuctionDuration", + "type": "u8" + } + ] + }, + { + "name": "updateSpotAuctionDuration", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "defaultSpotAuctionDuration", + "type": "u8" + } + ] + }, + { + "name": "initializeProtocolIfSharesTransferConfig", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "protocolIfSharesTransferConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateProtocolIfSharesTransferConfig", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "protocolIfSharesTransferConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "whitelistedSigners", + "type": { + "option": { + "array": [ + "publicKey", + 4 + ] + } + } + }, + { + "name": "maxTransferPerEpoch", + "type": { + "option": "u128" + } + } + ] + }, + { + "name": "initializePrelaunchOracle", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "prelaunchOracle", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "PrelaunchOracleParams" + } + } + ] + }, + { + "name": "updatePrelaunchOracleParams", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "prelaunchOracle", + "isMut": true, + "isSigner": false + }, + { + "name": "perpMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "PrelaunchOracleParams" + } + } + ] + }, + { + "name": "deletePrelaunchOracle", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "prelaunchOracle", + "isMut": true, + "isSigner": false + }, + { + "name": "perpMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "perpMarketIndex", + "type": "u16" + } + ] + }, + { + "name": "initializePythPullOracle", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false + }, + { + "name": "priceFeed", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feedId", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + ], + "accounts": [ + { + "name": "OpenbookV2FulfillmentConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pubkey", + "type": "publicKey" + }, + { + "name": "openbookV2ProgramId", + "type": "publicKey" + }, + { + "name": "openbookV2Market", + "type": "publicKey" + }, + { + "name": "openbookV2MarketAuthority", + "type": "publicKey" + }, + { + "name": "openbookV2EventHeap", + "type": "publicKey" + }, + { + "name": "openbookV2Bids", + "type": "publicKey" + }, + { + "name": "openbookV2Asks", + "type": "publicKey" + }, + { + "name": "openbookV2BaseVault", + "type": "publicKey" + }, + { + "name": "openbookV2QuoteVault", + "type": "publicKey" + }, + { + "name": "marketIndex", + "type": "u16" + }, + { + "name": "fulfillmentType", + "type": { + "defined": "SpotFulfillmentType" + } + }, + { + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, + { + "name": "PhoenixV1FulfillmentConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pubkey", + "type": "publicKey" + }, + { + "name": "phoenixProgramId", + "type": "publicKey" + }, + { + "name": "phoenixLogAuthority", + "type": "publicKey" + }, + { + "name": "phoenixMarket", + "type": "publicKey" + }, + { + "name": "phoenixBaseVault", + "type": "publicKey" + }, + { + "name": "phoenixQuoteVault", + "type": "publicKey" + }, { - name: 'serumProgramId' - type: 'publicKey' + "name": "marketIndex", + "type": "u16" }, { - name: 'serumMarket' - type: 'publicKey' + "name": "fulfillmentType", + "type": { + "defined": "SpotFulfillmentType" + } }, { - name: 'serumRequestQueue' - type: 'publicKey' + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } }, { - name: 'serumEventQueue' - type: 'publicKey' + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, + { + "name": "SerumV3FulfillmentConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pubkey", + "type": "publicKey" }, { - name: 'serumBids' - type: 'publicKey' + "name": "serumProgramId", + "type": "publicKey" }, { - name: 'serumAsks' - type: 'publicKey' + "name": "serumMarket", + "type": "publicKey" }, { - name: 'serumBaseVault' - type: 'publicKey' + "name": "serumRequestQueue", + "type": "publicKey" }, { - name: 'serumQuoteVault' - type: 'publicKey' + "name": "serumEventQueue", + "type": "publicKey" }, { - name: 'serumOpenOrders' - type: 'publicKey' + "name": "serumBids", + "type": "publicKey" }, { - name: 'serumSignerNonce' - type: 'u64' + "name": "serumAsks", + "type": "publicKey" }, { - name: 'marketIndex' - type: 'u16' + "name": "serumBaseVault", + "type": "publicKey" }, { - name: 'fulfillmentType' - type: { - defined: 'SpotFulfillmentType' + "name": "serumQuoteVault", + "type": "publicKey" + }, + { + "name": "serumOpenOrders", + "type": "publicKey" + }, + { + "name": "serumSignerNonce", + "type": "u64" + }, + { + "name": "marketIndex", + "type": "u16" + }, + { + "name": "fulfillmentType", + "type": { + "defined": "SpotFulfillmentType" } }, { - name: 'status' - type: { - defined: 'SpotFulfillmentConfigStatus' + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" } }, { - name: 'padding' - type: { - array: ['u8', 4] + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] } } ] } }, { - name: 'insuranceFundStake' - type: { - kind: 'struct' - fields: [ + "name": "insuranceFundStake", + "type": { + "kind": "struct", + "fields": [ { - name: 'authority' - type: 'publicKey' + "name": "authority", + "type": "publicKey" }, { - name: 'ifShares' - type: 'u128' + "name": "ifShares", + "type": "u128" }, { - name: 'lastWithdrawRequestShares' - type: 'u128' + "name": "lastWithdrawRequestShares", + "type": "u128" }, { - name: 'ifBase' - type: 'u128' + "name": "ifBase", + "type": "u128" }, { - name: 'lastValidTs' - type: 'i64' + "name": "lastValidTs", + "type": "i64" }, { - name: 'lastWithdrawRequestValue' - type: 'u64' + "name": "lastWithdrawRequestValue", + "type": "u64" }, { - name: 'lastWithdrawRequestTs' - type: 'i64' + "name": "lastWithdrawRequestTs", + "type": "i64" }, { - name: 'costBasis' - type: 'i64' + "name": "costBasis", + "type": "i64" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'padding' - type: { - array: ['u8', 14] + "name": "padding", + "type": { + "array": [ + "u8", + 14 + ] } } ] } }, { - name: 'protocolIfSharesTransferConfig' - type: { - kind: 'struct' - fields: [ + "name": "ProtocolIfSharesTransferConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whitelistedSigners", + "type": { + "array": [ + "publicKey", + 4 + ] + } + }, + { + "name": "maxTransferPerEpoch", + "type": "u128" + }, { - name: 'whitelistedSigners' - type: { - array: ['publicKey', 4] + "name": "currentEpochTransfer", + "type": "u128" + }, + { + "name": "nextEpochTs", + "type": "i64" + }, + { + "name": "padding", + "type": { + "array": [ + "u128", + 8 + ] } + } + ] + } + }, + { + "name": "PrelaunchOracle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "price", + "type": "i64" + }, + { + "name": "maxPrice", + "type": "i64" + }, + { + "name": "confidence", + "type": "u64" }, { - name: 'maxTransferPerEpoch' - type: 'u128' + "name": "lastUpdateSlot", + "type": "u64" }, { - name: 'currentEpochTransfer' - type: 'u128' + "name": "ammLastUpdateSlot", + "type": "u64" }, { - name: 'nextEpochTs' - type: 'i64' + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'padding' - type: { - array: ['u128', 8] + "name": "padding", + "type": { + "array": [ + "u8", + 70 + ] } } ] } }, { - name: 'perpMarket' - type: { - kind: 'struct' - fields: [ + "name": "PerpMarket", + "type": { + "kind": "struct", + "fields": [ { - name: 'pubkey' - docs: ["The perp market's address. It is a pda of the market index"] - type: 'publicKey' + "name": "pubkey", + "docs": [ + "The perp market's address. It is a pda of the market index" + ], + "type": "publicKey" }, { - name: 'amm' - docs: ['The automated market maker'] - type: { - defined: 'AMM' + "name": "amm", + "docs": [ + "The automated market maker" + ], + "type": { + "defined": "AMM" } }, { - name: 'pnlPool' - docs: [ + "name": "pnlPool", + "docs": [ "The market's pnl pool. When users settle negative pnl, the balance increases.", - 'When users settle positive pnl, the balance decreases. Can not go negative.' - ] - type: { - defined: 'PoolBalance' + "When users settle positive pnl, the balance decreases. Can not go negative." + ], + "type": { + "defined": "PoolBalance" } }, { - name: 'name' - docs: ['Encoded display name for the perp market e.g. SOL-PERP'] - type: { - array: ['u8', 32] + "name": "name", + "docs": [ + "Encoded display name for the perp market e.g. SOL-PERP" + ], + "type": { + "array": [ + "u8", + 32 + ] } }, { - name: 'insuranceClaim' - docs: ["The perp market's claim on the insurance fund"] - type: { - defined: 'InsuranceClaim' + "name": "insuranceClaim", + "docs": [ + "The perp market's claim on the insurance fund" + ], + "type": { + "defined": "InsuranceClaim" } }, { - name: 'unrealizedPnlMaxImbalance' - docs: [ - 'The max pnl imbalance before positive pnl asset weight is discounted', + "name": "unrealizedPnlMaxImbalance", + "docs": [ + "The max pnl imbalance before positive pnl asset weight is discounted", "pnl imbalance is the difference between long and short pnl. When it's greater than 0,", - 'the amm has negative pnl and the initial asset weight for positive pnl is discounted', - 'precision = QUOTE_PRECISION' - ] - type: 'u64' + "the amm has negative pnl and the initial asset weight for positive pnl is discounted", + "precision = QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'expiryTs' - docs: [ - 'The ts when the market will be expired. Only set if market is in reduce only mode' - ] - type: 'i64' + "name": "expiryTs", + "docs": [ + "The ts when the market will be expired. Only set if market is in reduce only mode" + ], + "type": "i64" }, { - name: 'expiryPrice' - docs: [ - 'The price at which positions will be settled. Only set if market is expired', - 'precision = PRICE_PRECISION' - ] - type: 'i64' + "name": "expiryPrice", + "docs": [ + "The price at which positions will be settled. Only set if market is expired", + "precision = PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'nextFillRecordId' - docs: [ - 'Every trade has a fill record id. This is the next id to be used' - ] - type: 'u64' + "name": "nextFillRecordId", + "docs": [ + "Every trade has a fill record id. This is the next id to be used" + ], + "type": "u64" }, { - name: 'nextFundingRateRecordId' - docs: [ - 'Every funding rate update has a record id. This is the next id to be used' - ] - type: 'u64' + "name": "nextFundingRateRecordId", + "docs": [ + "Every funding rate update has a record id. This is the next id to be used" + ], + "type": "u64" }, { - name: 'nextCurveRecordId' - docs: [ - 'Every amm k updated has a record id. This is the next id to be used' - ] - type: 'u64' + "name": "nextCurveRecordId", + "docs": [ + "Every amm k updated has a record id. This is the next id to be used" + ], + "type": "u64" }, { - name: 'imfFactor' - docs: [ - 'The initial margin fraction factor. Used to increase margin ratio for large positions', - 'precision: MARGIN_PRECISION' - ] - type: 'u32' + "name": "imfFactor", + "docs": [ + "The initial margin fraction factor. Used to increase margin ratio for large positions", + "precision: MARGIN_PRECISION" + ], + "type": "u32" }, { - name: 'unrealizedPnlImfFactor' - docs: [ - 'The imf factor for unrealized pnl. Used to discount asset weight for large positive pnl', - 'precision: MARGIN_PRECISION' - ] - type: 'u32' + "name": "unrealizedPnlImfFactor", + "docs": [ + "The imf factor for unrealized pnl. Used to discount asset weight for large positive pnl", + "precision: MARGIN_PRECISION" + ], + "type": "u32" }, { - name: 'liquidatorFee' - docs: [ - 'The fee the liquidator is paid for taking over perp position', - 'precision: LIQUIDATOR_FEE_PRECISION' - ] - type: 'u32' + "name": "liquidatorFee", + "docs": [ + "The fee the liquidator is paid for taking over perp position", + "precision: LIQUIDATOR_FEE_PRECISION" + ], + "type": "u32" }, { - name: 'ifLiquidationFee' - docs: [ - 'The fee the insurance fund receives from liquidation', - 'precision: LIQUIDATOR_FEE_PRECISION' - ] - type: 'u32' + "name": "ifLiquidationFee", + "docs": [ + "The fee the insurance fund receives from liquidation", + "precision: LIQUIDATOR_FEE_PRECISION" + ], + "type": "u32" }, { - name: 'marginRatioInitial' - docs: [ - 'The margin ratio which determines how much collateral is required to open a position', - 'e.g. margin ratio of .1 means a user must have $100 of total collateral to open a $1000 position', - 'precision: MARGIN_PRECISION' - ] - type: 'u32' + "name": "marginRatioInitial", + "docs": [ + "The margin ratio which determines how much collateral is required to open a position", + "e.g. margin ratio of .1 means a user must have $100 of total collateral to open a $1000 position", + "precision: MARGIN_PRECISION" + ], + "type": "u32" }, { - name: 'marginRatioMaintenance' - docs: [ - 'The margin ratio which determines when a user will be liquidated', - 'e.g. margin ratio of .05 means a user must have $50 of total collateral to maintain a $1000 position', - 'else they will be liquidated', - 'precision: MARGIN_PRECISION' - ] - type: 'u32' + "name": "marginRatioMaintenance", + "docs": [ + "The margin ratio which determines when a user will be liquidated", + "e.g. margin ratio of .05 means a user must have $50 of total collateral to maintain a $1000 position", + "else they will be liquidated", + "precision: MARGIN_PRECISION" + ], + "type": "u32" }, { - name: 'unrealizedPnlInitialAssetWeight' - docs: [ - 'The initial asset weight for positive pnl. Negative pnl always has an asset weight of 1', - 'precision: SPOT_WEIGHT_PRECISION' - ] - type: 'u32' + "name": "unrealizedPnlInitialAssetWeight", + "docs": [ + "The initial asset weight for positive pnl. Negative pnl always has an asset weight of 1", + "precision: SPOT_WEIGHT_PRECISION" + ], + "type": "u32" }, { - name: 'unrealizedPnlMaintenanceAssetWeight' - docs: [ - 'The maintenance asset weight for positive pnl. Negative pnl always has an asset weight of 1', - 'precision: SPOT_WEIGHT_PRECISION' - ] - type: 'u32' + "name": "unrealizedPnlMaintenanceAssetWeight", + "docs": [ + "The maintenance asset weight for positive pnl. Negative pnl always has an asset weight of 1", + "precision: SPOT_WEIGHT_PRECISION" + ], + "type": "u32" }, { - name: 'numberOfUsersWithBase' - docs: ['number of users in a position (base)'] - type: 'u32' + "name": "numberOfUsersWithBase", + "docs": [ + "number of users in a position (base)" + ], + "type": "u32" }, { - name: 'numberOfUsers' - docs: ['number of users in a position (pnl) or pnl (quote)'] - type: 'u32' + "name": "numberOfUsers", + "docs": [ + "number of users in a position (pnl) or pnl (quote)" + ], + "type": "u32" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'status' - docs: [ - 'Whether a market is active, reduce only, expired, etc', - 'Affects whether users can open/close positions' - ] - type: { - defined: 'MarketStatus' + "name": "status", + "docs": [ + "Whether a market is active, reduce only, expired, etc", + "Affects whether users can open/close positions" + ], + "type": { + "defined": "MarketStatus" } }, { - name: 'contractType' - docs: ['Currently only Perpetual markets are supported'] - type: { - defined: 'ContractType' + "name": "contractType", + "docs": [ + "Currently only Perpetual markets are supported" + ], + "type": { + "defined": "ContractType" } }, { - name: 'contractTier' - docs: [ - 'The contract tier determines how much insurance a market can receive, with more speculative markets receiving less insurance', - 'It also influences the order perp markets can be liquidated, with less speculative markets being liquidated first' - ] - type: { - defined: 'ContractTier' + "name": "contractTier", + "docs": [ + "The contract tier determines how much insurance a market can receive, with more speculative markets receiving less insurance", + "It also influences the order perp markets can be liquidated, with less speculative markets being liquidated first" + ], + "type": { + "defined": "ContractTier" } }, { - name: 'pausedOperations' - type: 'u8' + "name": "pausedOperations", + "type": "u8" }, { - name: 'quoteSpotMarketIndex' - docs: ['The spot market that pnl is settled in'] - type: 'u16' + "name": "quoteSpotMarketIndex", + "docs": [ + "The spot market that pnl is settled in" + ], + "type": "u16" }, { - name: 'feeAdjustment' - docs: [ - 'Between -100 and 100, represents what % to increase/decrease the fee by', - 'E.g. if this is -50 and the fee is 5bps, the new fee will be 2.5bps', - 'if this is 50 and the fee is 5bps, the new fee will be 7.5bps' - ] - type: 'i16' + "name": "feeAdjustment", + "docs": [ + "Between -100 and 100, represents what % to increase/decrease the fee by", + "E.g. if this is -50 and the fee is 5bps, the new fee will be 2.5bps", + "if this is 50 and the fee is 5bps, the new fee will be 7.5bps" + ], + "type": "i16" }, { - name: 'padding' - type: { - array: ['u8', 46] + "name": "fuelBoostPosition", + "docs": [ + "fuel multiplier for perp funding", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "fuelBoostTaker", + "docs": [ + "fuel multiplier for perp taker", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "fuelBoostMaker", + "docs": [ + "fuel multiplier for perp maker", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 43 + ] } } ] } }, { - name: 'spotMarket' - type: { - kind: 'struct' - fields: [ + "name": "spotMarket", + "type": { + "kind": "struct", + "fields": [ { - name: 'pubkey' - docs: [ - 'The address of the spot market. It is a pda of the market index' - ] - type: 'publicKey' + "name": "pubkey", + "docs": [ + "The address of the spot market. It is a pda of the market index" + ], + "type": "publicKey" }, { - name: 'oracle' - docs: ['The oracle used to price the markets deposits/borrows'] - type: 'publicKey' + "name": "oracle", + "docs": [ + "The oracle used to price the markets deposits/borrows" + ], + "type": "publicKey" }, { - name: 'mint' - docs: ['The token mint of the market'] - type: 'publicKey' + "name": "mint", + "docs": [ + "The token mint of the market" + ], + "type": "publicKey" }, { - name: 'vault' - docs: [ + "name": "vault", + "docs": [ "The vault used to store the market's deposits", - 'The amount in the vault should be equal to or greater than deposits - borrows' - ] - type: 'publicKey' + "The amount in the vault should be equal to or greater than deposits - borrows" + ], + "type": "publicKey" }, { - name: 'name' - docs: ['The encoded display name for the market e.g. SOL'] - type: { - array: ['u8', 32] + "name": "name", + "docs": [ + "The encoded display name for the market e.g. SOL" + ], + "type": { + "array": [ + "u8", + 32 + ] } }, { - name: 'historicalOracleData' - type: { - defined: 'HistoricalOracleData' + "name": "historicalOracleData", + "type": { + "defined": "HistoricalOracleData" } }, { - name: 'historicalIndexData' - type: { - defined: 'HistoricalIndexData' + "name": "historicalIndexData", + "type": { + "defined": "HistoricalIndexData" } }, { - name: 'revenuePool' - docs: [ - 'Revenue the protocol has collected in this markets token', - 'e.g. for SOL-PERP, funds can be settled in usdc and will flow into the USDC revenue pool' - ] - type: { - defined: 'PoolBalance' + "name": "revenuePool", + "docs": [ + "Revenue the protocol has collected in this markets token", + "e.g. for SOL-PERP, funds can be settled in usdc and will flow into the USDC revenue pool" + ], + "type": { + "defined": "PoolBalance" } }, { - name: 'spotFeePool' - docs: [ - 'The fees collected from swaps between this market and the quote market', - 'Is settled to the quote markets revenue pool' - ] - type: { - defined: 'PoolBalance' + "name": "spotFeePool", + "docs": [ + "The fees collected from swaps between this market and the quote market", + "Is settled to the quote markets revenue pool" + ], + "type": { + "defined": "PoolBalance" } }, { - name: 'insuranceFund' - docs: [ - 'Details on the insurance fund covering bankruptcies in this markets token', - 'Covers bankruptcies for borrows with this markets token and perps settling in this markets token' - ] - type: { - defined: 'InsuranceFund' + "name": "insuranceFund", + "docs": [ + "Details on the insurance fund covering bankruptcies in this markets token", + "Covers bankruptcies for borrows with this markets token and perps settling in this markets token" + ], + "type": { + "defined": "InsuranceFund" } }, { - name: 'totalSpotFee' - docs: [ - 'The total spot fees collected for this market', - 'precision: QUOTE_PRECISION' - ] - type: 'u128' + "name": "totalSpotFee", + "docs": [ + "The total spot fees collected for this market", + "precision: QUOTE_PRECISION" + ], + "type": "u128" }, { - name: 'depositBalance' - docs: [ - 'The sum of the scaled balances for deposits across users and pool balances', - 'To convert to the deposit token amount, multiply by the cumulative deposit interest', - 'precision: SPOT_BALANCE_PRECISION' - ] - type: 'u128' + "name": "depositBalance", + "docs": [ + "The sum of the scaled balances for deposits across users and pool balances", + "To convert to the deposit token amount, multiply by the cumulative deposit interest", + "precision: SPOT_BALANCE_PRECISION" + ], + "type": "u128" }, { - name: 'borrowBalance' - docs: [ - 'The sum of the scaled balances for borrows across users and pool balances', - 'To convert to the borrow token amount, multiply by the cumulative borrow interest', - 'precision: SPOT_BALANCE_PRECISION' - ] - type: 'u128' + "name": "borrowBalance", + "docs": [ + "The sum of the scaled balances for borrows across users and pool balances", + "To convert to the borrow token amount, multiply by the cumulative borrow interest", + "precision: SPOT_BALANCE_PRECISION" + ], + "type": "u128" }, { - name: 'cumulativeDepositInterest' - docs: [ - 'The cumulative interest earned by depositors', - 'Used to calculate the deposit token amount from the deposit balance', - 'precision: SPOT_CUMULATIVE_INTEREST_PRECISION' - ] - type: 'u128' + "name": "cumulativeDepositInterest", + "docs": [ + "The cumulative interest earned by depositors", + "Used to calculate the deposit token amount from the deposit balance", + "precision: SPOT_CUMULATIVE_INTEREST_PRECISION" + ], + "type": "u128" }, { - name: 'cumulativeBorrowInterest' - docs: [ - 'The cumulative interest earned by borrowers', - 'Used to calculate the borrow token amount from the borrow balance', - 'precision: SPOT_CUMULATIVE_INTEREST_PRECISION' - ] - type: 'u128' + "name": "cumulativeBorrowInterest", + "docs": [ + "The cumulative interest earned by borrowers", + "Used to calculate the borrow token amount from the borrow balance", + "precision: SPOT_CUMULATIVE_INTEREST_PRECISION" + ], + "type": "u128" }, { - name: 'totalSocialLoss' - docs: [ + "name": "totalSocialLoss", + "docs": [ "The total socialized loss from borrows, in the mint's token", - 'precision: token mint precision' - ] - type: 'u128' + "precision: token mint precision" + ], + "type": "u128" }, { - name: 'totalQuoteSocialLoss' - docs: [ + "name": "totalQuoteSocialLoss", + "docs": [ "The total socialized loss from borrows, in the quote market's token", - 'preicision: QUOTE_PRECISION' - ] - type: 'u128' + "preicision: QUOTE_PRECISION" + ], + "type": "u128" }, { - name: 'withdrawGuardThreshold' - docs: [ - 'no withdraw limits/guards when deposits below this threshold', - 'precision: token mint precision' - ] - type: 'u64' + "name": "withdrawGuardThreshold", + "docs": [ + "no withdraw limits/guards when deposits below this threshold", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'maxTokenDeposits' - docs: [ - 'The max amount of token deposits in this market', - '0 if there is no limit', - 'precision: token mint precision' - ] - type: 'u64' + "name": "maxTokenDeposits", + "docs": [ + "The max amount of token deposits in this market", + "0 if there is no limit", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'depositTokenTwap' - docs: [ - '24hr average of deposit token amount', - 'precision: token mint precision' - ] - type: 'u64' + "name": "depositTokenTwap", + "docs": [ + "24hr average of deposit token amount", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'borrowTokenTwap' - docs: [ - '24hr average of borrow token amount', - 'precision: token mint precision' - ] - type: 'u64' + "name": "borrowTokenTwap", + "docs": [ + "24hr average of borrow token amount", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'utilizationTwap' - docs: [ - '24hr average of utilization', - 'which is borrow amount over token amount', - 'precision: SPOT_UTILIZATION_PRECISION' - ] - type: 'u64' + "name": "utilizationTwap", + "docs": [ + "24hr average of utilization", + "which is borrow amount over token amount", + "precision: SPOT_UTILIZATION_PRECISION" + ], + "type": "u64" }, { - name: 'lastInterestTs' - docs: [ - 'Last time the cumulative deposit and borrow interest was updated' - ] - type: 'u64' + "name": "lastInterestTs", + "docs": [ + "Last time the cumulative deposit and borrow interest was updated" + ], + "type": "u64" }, { - name: 'lastTwapTs' - docs: [ - 'Last time the deposit/borrow/utilization averages were updated' - ] - type: 'u64' + "name": "lastTwapTs", + "docs": [ + "Last time the deposit/borrow/utilization averages were updated" + ], + "type": "u64" }, { - name: 'expiryTs' - docs: [ - 'The time the market is set to expire. Only set if market is in reduce only mode' - ] - type: 'i64' + "name": "expiryTs", + "docs": [ + "The time the market is set to expire. Only set if market is in reduce only mode" + ], + "type": "i64" }, { - name: 'orderStepSize' - docs: [ - 'Spot orders must be a multiple of the step size', - 'precision: token mint precision' - ] - type: 'u64' + "name": "orderStepSize", + "docs": [ + "Spot orders must be a multiple of the step size", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'orderTickSize' - docs: [ - 'Spot orders must be a multiple of the tick size', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "orderTickSize", + "docs": [ + "Spot orders must be a multiple of the tick size", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'minOrderSize' - docs: ['The minimum order size', 'precision: token mint precision'] - type: 'u64' + "name": "minOrderSize", + "docs": [ + "The minimum order size", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'maxPositionSize' - docs: [ - 'The maximum spot position size', - 'if the limit is 0, there is no limit', - 'precision: token mint precision' - ] - type: 'u64' + "name": "maxPositionSize", + "docs": [ + "The maximum spot position size", + "if the limit is 0, there is no limit", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'nextFillRecordId' - docs: [ - 'Every spot trade has a fill record id. This is the next id to use' - ] - type: 'u64' + "name": "nextFillRecordId", + "docs": [ + "Every spot trade has a fill record id. This is the next id to use" + ], + "type": "u64" }, { - name: 'nextDepositRecordId' - docs: [ - 'Every deposit has a deposit record id. This is the next id to use' - ] - type: 'u64' + "name": "nextDepositRecordId", + "docs": [ + "Every deposit has a deposit record id. This is the next id to use" + ], + "type": "u64" }, { - name: 'initialAssetWeight' - docs: [ - 'The initial asset weight used to calculate a deposits contribution to a users initial total collateral', - 'e.g. if the asset weight is .8, $100 of deposits contributes $80 to the users initial total collateral', - 'precision: SPOT_WEIGHT_PRECISION' - ] - type: 'u32' + "name": "initialAssetWeight", + "docs": [ + "The initial asset weight used to calculate a deposits contribution to a users initial total collateral", + "e.g. if the asset weight is .8, $100 of deposits contributes $80 to the users initial total collateral", + "precision: SPOT_WEIGHT_PRECISION" + ], + "type": "u32" }, { - name: 'maintenanceAssetWeight' - docs: [ - 'The maintenance asset weight used to calculate a deposits contribution to a users maintenance total collateral', - 'e.g. if the asset weight is .9, $100 of deposits contributes $90 to the users maintenance total collateral', - 'precision: SPOT_WEIGHT_PRECISION' - ] - type: 'u32' + "name": "maintenanceAssetWeight", + "docs": [ + "The maintenance asset weight used to calculate a deposits contribution to a users maintenance total collateral", + "e.g. if the asset weight is .9, $100 of deposits contributes $90 to the users maintenance total collateral", + "precision: SPOT_WEIGHT_PRECISION" + ], + "type": "u32" }, { - name: 'initialLiabilityWeight' - docs: [ - 'The initial liability weight used to calculate a borrows contribution to a users initial margin requirement', - 'e.g. if the liability weight is .9, $100 of borrows contributes $90 to the users initial margin requirement', - 'precision: SPOT_WEIGHT_PRECISION' - ] - type: 'u32' + "name": "initialLiabilityWeight", + "docs": [ + "The initial liability weight used to calculate a borrows contribution to a users initial margin requirement", + "e.g. if the liability weight is .9, $100 of borrows contributes $90 to the users initial margin requirement", + "precision: SPOT_WEIGHT_PRECISION" + ], + "type": "u32" }, { - name: 'maintenanceLiabilityWeight' - docs: [ - 'The maintenance liability weight used to calculate a borrows contribution to a users maintenance margin requirement', - 'e.g. if the liability weight is .8, $100 of borrows contributes $80 to the users maintenance margin requirement', - 'precision: SPOT_WEIGHT_PRECISION' - ] - type: 'u32' + "name": "maintenanceLiabilityWeight", + "docs": [ + "The maintenance liability weight used to calculate a borrows contribution to a users maintenance margin requirement", + "e.g. if the liability weight is .8, $100 of borrows contributes $80 to the users maintenance margin requirement", + "precision: SPOT_WEIGHT_PRECISION" + ], + "type": "u32" }, { - name: 'imfFactor' - docs: [ - 'The initial margin fraction factor. Used to increase liability weight/decrease asset weight for large positions', - 'precision: MARGIN_PRECISION' - ] - type: 'u32' + "name": "imfFactor", + "docs": [ + "The initial margin fraction factor. Used to increase liability weight/decrease asset weight for large positions", + "precision: MARGIN_PRECISION" + ], + "type": "u32" }, { - name: 'liquidatorFee' - docs: [ - 'The fee the liquidator is paid for taking over borrow/deposit', - 'precision: LIQUIDATOR_FEE_PRECISION' - ] - type: 'u32' + "name": "liquidatorFee", + "docs": [ + "The fee the liquidator is paid for taking over borrow/deposit", + "precision: LIQUIDATOR_FEE_PRECISION" + ], + "type": "u32" }, { - name: 'ifLiquidationFee' - docs: [ - 'The fee the insurance fund receives from liquidation', - 'precision: LIQUIDATOR_FEE_PRECISION' - ] - type: 'u32' + "name": "ifLiquidationFee", + "docs": [ + "The fee the insurance fund receives from liquidation", + "precision: LIQUIDATOR_FEE_PRECISION" + ], + "type": "u32" }, { - name: 'optimalUtilization' - docs: [ - 'The optimal utilization rate for this market.', - 'Used to determine the markets borrow rate', - 'precision: SPOT_UTILIZATION_PRECISION' - ] - type: 'u32' + "name": "optimalUtilization", + "docs": [ + "The optimal utilization rate for this market.", + "Used to determine the markets borrow rate", + "precision: SPOT_UTILIZATION_PRECISION" + ], + "type": "u32" }, { - name: 'optimalBorrowRate' - docs: [ - 'The borrow rate for this market when the market has optimal utilization', - 'precision: SPOT_RATE_PRECISION' - ] - type: 'u32' + "name": "optimalBorrowRate", + "docs": [ + "The borrow rate for this market when the market has optimal utilization", + "precision: SPOT_RATE_PRECISION" + ], + "type": "u32" }, { - name: 'maxBorrowRate' - docs: [ - 'The borrow rate for this market when the market has 1000 utilization', - 'precision: SPOT_RATE_PRECISION' - ] - type: 'u32' + "name": "maxBorrowRate", + "docs": [ + "The borrow rate for this market when the market has 1000 utilization", + "precision: SPOT_RATE_PRECISION" + ], + "type": "u32" }, { - name: 'decimals' - docs: [ + "name": "decimals", + "docs": [ "The market's token mint's decimals. To from decimals to a precision, 10^decimals" - ] - type: 'u32' + ], + "type": "u32" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'ordersEnabled' - docs: ['Whether or not spot trading is enabled'] - type: 'bool' + "name": "ordersEnabled", + "docs": [ + "Whether or not spot trading is enabled" + ], + "type": "bool" }, { - name: 'oracleSource' - type: { - defined: 'OracleSource' + "name": "oracleSource", + "type": { + "defined": "OracleSource" } }, { - name: 'status' - type: { - defined: 'MarketStatus' + "name": "status", + "type": { + "defined": "MarketStatus" } }, { - name: 'assetTier' - docs: [ - 'The asset tier affects how a deposit can be used as collateral and the priority for a borrow being liquidated' - ] - type: { - defined: 'AssetTier' + "name": "assetTier", + "docs": [ + "The asset tier affects how a deposit can be used as collateral and the priority for a borrow being liquidated" + ], + "type": { + "defined": "AssetTier" } }, { - name: 'pausedOperations' - type: 'u8' + "name": "pausedOperations", + "type": "u8" }, { - name: 'padding1' - type: { - array: ['u8', 5] - } + "name": "ifPausedOperations", + "type": "u8" }, { - name: 'flashLoanAmount' - docs: [ - 'For swaps, the amount of token loaned out in the begin_swap ix', - 'precision: token mint precision' - ] - type: 'u64' + "name": "feeAdjustment", + "type": "i16" }, { - name: 'flashLoanInitialTokenAmount' - docs: [ - 'For swaps, the amount in the users token account in the begin_swap ix', - 'Used to calculate how much of the token left the system in end_swap ix', - 'precision: token mint precision' - ] - type: 'u64' + "name": "maxTokenBorrowsFraction", + "docs": [ + "What fraction of max_token_deposits", + "disabled when 0, 1 => 1/10000 => .01% of max_token_deposits", + "precision: X/10000" + ], + "type": "u16" }, { - name: 'totalSwapFee' - docs: [ - 'The total fees received from swaps', - 'precision: token mint precision' - ] - type: 'u64' + "name": "flashLoanAmount", + "docs": [ + "For swaps, the amount of token loaned out in the begin_swap ix", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'scaleInitialAssetWeightStart' - docs: [ - 'When to begin scaling down the initial asset weight', - 'disabled when 0', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "flashLoanInitialTokenAmount", + "docs": [ + "For swaps, the amount in the users token account in the begin_swap ix", + "Used to calculate how much of the token left the system in end_swap ix", + "precision: token mint precision" + ], + "type": "u64" + }, + { + "name": "totalSwapFee", + "docs": [ + "The total fees received from swaps", + "precision: token mint precision" + ], + "type": "u64" + }, + { + "name": "scaleInitialAssetWeightStart", + "docs": [ + "When to begin scaling down the initial asset weight", + "disabled when 0", + "precision: QUOTE_PRECISION" + ], + "type": "u64" + }, + { + "name": "minBorrowRate", + "docs": [ + "The min borrow rate for this market when the market regardless of utilization", + "1 => 1/200 => .5%", + "precision: X/200" + ], + "type": "u8" + }, + { + "name": "fuelBoostDeposits", + "docs": [ + "fuel multiplier for spot deposits", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "fuelBoostBorrows", + "docs": [ + "fuel multiplier for spot borrows", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "fuelBoostTaker", + "docs": [ + "fuel multiplier for spot taker", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "fuelBoostMaker", + "docs": [ + "fuel multiplier for spot maker", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "fuelBoostInsurance", + "docs": [ + "fuel multiplier for spot insurance stake", + "precision: 10" + ], + "type": "u8" + }, + { + "name": "tokenProgram", + "type": "u8" }, { - name: 'padding' - type: { - array: ['u8', 48] + "name": "padding", + "type": { + "array": [ + "u8", + 41 + ] } } ] } }, { - name: 'state' - type: { - kind: 'struct' - fields: [ + "name": "State", + "type": { + "kind": "struct", + "fields": [ { - name: 'admin' - type: 'publicKey' + "name": "admin", + "type": "publicKey" }, { - name: 'whitelistMint' - type: 'publicKey' + "name": "whitelistMint", + "type": "publicKey" }, { - name: 'discountMint' - type: 'publicKey' + "name": "discountMint", + "type": "publicKey" }, { - name: 'signer' - type: 'publicKey' + "name": "signer", + "type": "publicKey" }, { - name: 'srmVault' - type: 'publicKey' + "name": "srmVault", + "type": "publicKey" }, { - name: 'perpFeeStructure' - type: { - defined: 'FeeStructure' + "name": "perpFeeStructure", + "type": { + "defined": "FeeStructure" } }, { - name: 'spotFeeStructure' - type: { - defined: 'FeeStructure' + "name": "spotFeeStructure", + "type": { + "defined": "FeeStructure" } }, { - name: 'oracleGuardRails' - type: { - defined: 'OracleGuardRails' + "name": "oracleGuardRails", + "type": { + "defined": "OracleGuardRails" } }, { - name: 'numberOfAuthorities' - type: 'u64' + "name": "numberOfAuthorities", + "type": "u64" }, { - name: 'numberOfSubAccounts' - type: 'u64' + "name": "numberOfSubAccounts", + "type": "u64" }, { - name: 'lpCooldownTime' - type: 'u64' + "name": "lpCooldownTime", + "type": "u64" }, { - name: 'liquidationMarginBufferRatio' - type: 'u32' + "name": "liquidationMarginBufferRatio", + "type": "u32" }, { - name: 'settlementDuration' - type: 'u16' + "name": "settlementDuration", + "type": "u16" }, { - name: 'numberOfMarkets' - type: 'u16' + "name": "numberOfMarkets", + "type": "u16" }, { - name: 'numberOfSpotMarkets' - type: 'u16' + "name": "numberOfSpotMarkets", + "type": "u16" }, { - name: 'signerNonce' - type: 'u8' + "name": "signerNonce", + "type": "u8" }, { - name: 'minPerpAuctionDuration' - type: 'u8' + "name": "minPerpAuctionDuration", + "type": "u8" }, { - name: 'defaultMarketOrderTimeInForce' - type: 'u8' + "name": "defaultMarketOrderTimeInForce", + "type": "u8" }, { - name: 'defaultSpotAuctionDuration' - type: 'u8' + "name": "defaultSpotAuctionDuration", + "type": "u8" }, { - name: 'exchangeStatus' - type: 'u8' + "name": "exchangeStatus", + "type": "u8" }, { - name: 'liquidationDuration' - type: 'u8' + "name": "liquidationDuration", + "type": "u8" }, { - name: 'initialPctToLiquidate' - type: 'u16' + "name": "initialPctToLiquidate", + "type": "u16" }, { - name: 'maxNumberOfSubAccounts' - type: 'u16' + "name": "maxNumberOfSubAccounts", + "type": "u16" }, { - name: 'maxInitializeUserFee' - type: 'u16' + "name": "maxInitializeUserFee", + "type": "u16" }, { - name: 'padding' - type: { - array: ['u8', 10] + "name": "padding", + "type": { + "array": [ + "u8", + 10 + ] } } ] } }, { - name: 'user' - type: { - kind: 'struct' - fields: [ + "name": "User", + "type": { + "kind": "struct", + "fields": [ { - name: 'authority' - docs: ['The owner/authority of the account'] - type: 'publicKey' + "name": "authority", + "docs": [ + "The owner/authority of the account" + ], + "type": "publicKey" }, { - name: 'delegate' - docs: [ + "name": "delegate", + "docs": [ "An addresses that can control the account on the authority's behalf. Has limited power, cant withdraw" - ] - type: 'publicKey' + ], + "type": "publicKey" }, { - name: 'name' - docs: ['Encoded display name e.g. "toly"'] - type: { - array: ['u8', 32] + "name": "name", + "docs": [ + "Encoded display name e.g. \"toly\"" + ], + "type": { + "array": [ + "u8", + 32 + ] } }, { - name: 'spotPositions' - docs: ["The user's spot positions"] - type: { - array: [ + "name": "spotPositions", + "docs": [ + "The user's spot positions" + ], + "type": { + "array": [ { - defined: 'SpotPosition' + "defined": "SpotPosition" }, 8 ] } }, { - name: 'perpPositions' - docs: ["The user's perp positions"] - type: { - array: [ + "name": "perpPositions", + "docs": [ + "The user's perp positions" + ], + "type": { + "array": [ { - defined: 'PerpPosition' + "defined": "PerpPosition" }, 8 ] } }, { - name: 'orders' - docs: ["The user's orders"] - type: { - array: [ + "name": "orders", + "docs": [ + "The user's orders" + ], + "type": { + "array": [ { - defined: 'Order' + "defined": "Order" }, 32 ] } }, { - name: 'lastAddPerpLpSharesTs' - docs: ['The last time the user added perp lp positions'] - type: 'i64' + "name": "lastAddPerpLpSharesTs", + "docs": [ + "The last time the user added perp lp positions" + ], + "type": "i64" }, { - name: 'totalDeposits' - docs: [ - 'The total values of deposits the user has made', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "totalDeposits", + "docs": [ + "The total values of deposits the user has made", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalWithdraws' - docs: [ - 'The total values of withdrawals the user has made', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "totalWithdraws", + "docs": [ + "The total values of withdrawals the user has made", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalSocialLoss' - docs: [ - 'The total socialized loss the users has incurred upon the protocol', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "totalSocialLoss", + "docs": [ + "The total socialized loss the users has incurred upon the protocol", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'settledPerpPnl' - docs: [ - 'Fees (taker fees, maker rebate, referrer reward, filler reward) and pnl for perps', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "settledPerpPnl", + "docs": [ + "Fees (taker fees, maker rebate, referrer reward, filler reward) and pnl for perps", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'cumulativeSpotFees' - docs: [ - 'Fees (taker fees, maker rebate, filler reward) for spot', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "cumulativeSpotFees", + "docs": [ + "Fees (taker fees, maker rebate, filler reward) for spot", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'cumulativePerpFunding' - docs: [ - 'Cumulative funding paid/received for perps', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "cumulativePerpFunding", + "docs": [ + "Cumulative funding paid/received for perps", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'liquidationMarginFreed' - docs: [ - 'The amount of margin freed during liquidation. Used to force the liquidation to occur over a period of time', - 'Defaults to zero when not being liquidated', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "liquidationMarginFreed", + "docs": [ + "The amount of margin freed during liquidation. Used to force the liquidation to occur over a period of time", + "Defaults to zero when not being liquidated", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'lastActiveSlot' - docs: [ - 'The last slot a user was active. Used to determine if a user is idle' - ] - type: 'u64' + "name": "lastActiveSlot", + "docs": [ + "The last slot a user was active. Used to determine if a user is idle" + ], + "type": "u64" }, { - name: 'nextOrderId' - docs: [ - 'Every user order has an order id. This is the next order id to be used' - ] - type: 'u32' + "name": "nextOrderId", + "docs": [ + "Every user order has an order id. This is the next order id to be used" + ], + "type": "u32" }, { - name: 'maxMarginRatio' - docs: ['Custom max initial margin ratio for the user'] - type: 'u32' + "name": "maxMarginRatio", + "docs": [ + "Custom max initial margin ratio for the user" + ], + "type": "u32" }, { - name: 'nextLiquidationId' - docs: ['The next liquidation id to be used for user'] - type: 'u16' + "name": "nextLiquidationId", + "docs": [ + "The next liquidation id to be used for user" + ], + "type": "u16" }, { - name: 'subAccountId' - docs: ['The sub account id for this user'] - type: 'u16' + "name": "subAccountId", + "docs": [ + "The sub account id for this user" + ], + "type": "u16" }, { - name: 'status' - docs: ['Whether the user is active, being liquidated or bankrupt'] - type: 'u8' + "name": "status", + "docs": [ + "Whether the user is active, being liquidated or bankrupt" + ], + "type": "u8" }, { - name: 'isMarginTradingEnabled' - docs: ['Whether the user has enabled margin trading'] - type: 'bool' + "name": "isMarginTradingEnabled", + "docs": [ + "Whether the user has enabled margin trading" + ], + "type": "bool" }, { - name: 'idle' - docs: [ + "name": "idle", + "docs": [ "User is idle if they haven't interacted with the protocol in 1 week and they have no orders, perp positions or borrows", - 'Off-chain keeper bots can ignore users that are idle' - ] - type: 'bool' + "Off-chain keeper bots can ignore users that are idle" + ], + "type": "bool" + }, + { + "name": "openOrders", + "docs": [ + "number of open orders" + ], + "type": "u8" + }, + { + "name": "hasOpenOrder", + "docs": [ + "Whether or not user has open order" + ], + "type": "bool" + }, + { + "name": "openAuctions", + "docs": [ + "number of open orders with auction" + ], + "type": "u8" + }, + { + "name": "hasOpenAuction", + "docs": [ + "Whether or not user has open order with auction" + ], + "type": "bool" + }, + { + "name": "padding1", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "lastFuelBonusUpdateTs", + "type": "u32" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 12 + ] + } + } + ] + } + }, + { + "name": "UserStats", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "docs": [ + "The authority for all of a users sub accounts" + ], + "type": "publicKey" + }, + { + "name": "referrer", + "docs": [ + "The address that referred this user" + ], + "type": "publicKey" + }, + { + "name": "fees", + "docs": [ + "Stats on the fees paid by the user" + ], + "type": { + "defined": "UserFees" + } + }, + { + "name": "nextEpochTs", + "docs": [ + "The timestamp of the next epoch", + "Epoch is used to limit referrer rewards earned in single epoch" + ], + "type": "i64" + }, + { + "name": "makerVolume30d", + "docs": [ + "Rolling 30day maker volume for user", + "precision: QUOTE_PRECISION" + ], + "type": "u64" + }, + { + "name": "takerVolume30d", + "docs": [ + "Rolling 30day taker volume for user", + "precision: QUOTE_PRECISION" + ], + "type": "u64" + }, + { + "name": "fillerVolume30d", + "docs": [ + "Rolling 30day filler volume for user", + "precision: QUOTE_PRECISION" + ], + "type": "u64" + }, + { + "name": "lastMakerVolume30dTs", + "docs": [ + "last time the maker volume was updated" + ], + "type": "i64" + }, + { + "name": "lastTakerVolume30dTs", + "docs": [ + "last time the taker volume was updated" + ], + "type": "i64" }, { - name: 'openOrders' - docs: ['number of open orders'] - type: 'u8' + "name": "lastFillerVolume30dTs", + "docs": [ + "last time the filler volume was updated" + ], + "type": "i64" }, { - name: 'hasOpenOrder' - docs: ['Whether or not user has open order'] - type: 'bool' + "name": "ifStakedQuoteAssetAmount", + "docs": [ + "The amount of tokens staked in the quote spot markets if" + ], + "type": "u64" }, { - name: 'openAuctions' - docs: ['number of open orders with auction'] - type: 'u8' + "name": "numberOfSubAccounts", + "docs": [ + "The current number of sub accounts" + ], + "type": "u16" }, { - name: 'hasOpenAuction' - docs: ['Whether or not user has open order with auction'] - type: 'bool' + "name": "numberOfSubAccountsCreated", + "docs": [ + "The number of sub accounts created. Can be greater than the number of sub accounts if user", + "has deleted sub accounts" + ], + "type": "u16" }, { - name: 'padding' - type: { - array: ['u8', 21] - } - } - ] - } - }, - { - name: 'userStats' - type: { - kind: 'struct' - fields: [ - { - name: 'authority' - docs: ['The authority for all of a users sub accounts'] - type: 'publicKey' + "name": "isReferrer", + "docs": [ + "Whether the user is a referrer. Sub account 0 can not be deleted if user is a referrer" + ], + "type": "bool" }, { - name: 'referrer' - docs: ['The address that referred this user'] - type: 'publicKey' + "name": "disableUpdatePerpBidAskTwap", + "type": "bool" }, { - name: 'fees' - docs: ['Stats on the fees paid by the user'] - type: { - defined: 'UserFees' + "name": "padding1", + "type": { + "array": [ + "u8", + 2 + ] } }, { - name: 'nextEpochTs' - docs: [ - 'The timestamp of the next epoch', - 'Epoch is used to limit referrer rewards earned in single epoch' - ] - type: 'i64' + "name": "fuelInsurance", + "docs": [ + "accumulated fuel for token amounts of insurance" + ], + "type": "u32" }, { - name: 'makerVolume30d' - docs: [ - 'Rolling 30day maker volume for user', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "fuelDeposits", + "docs": [ + "accumulated fuel for notional of deposits" + ], + "type": "u32" }, { - name: 'takerVolume30d' - docs: [ - 'Rolling 30day taker volume for user', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "fuelBorrows", + "docs": [ + "accumulate fuel bonus for notional of borrows" + ], + "type": "u32" }, { - name: 'fillerVolume30d' - docs: [ - 'Rolling 30day filler volume for user', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "fuelPositions", + "docs": [ + "accumulated fuel for perp open interest" + ], + "type": "u32" }, { - name: 'lastMakerVolume30dTs' - docs: ['last time the maker volume was updated'] - type: 'i64' + "name": "fuelTaker", + "docs": [ + "accumulate fuel bonus for taker volume" + ], + "type": "u32" }, { - name: 'lastTakerVolume30dTs' - docs: ['last time the taker volume was updated'] - type: 'i64' + "name": "fuelMaker", + "docs": [ + "accumulate fuel bonus for maker volume" + ], + "type": "u32" }, { - name: 'lastFillerVolume30dTs' - docs: ['last time the filler volume was updated'] - type: 'i64' + "name": "ifStakedGovTokenAmount", + "docs": [ + "The amount of tokens staked in the governance spot markets if" + ], + "type": "u64" }, { - name: 'ifStakedQuoteAssetAmount' - docs: ['The amount of tokens staked in the quote spot markets if'] - type: 'u64' + "name": "lastFuelIfBonusUpdateTs", + "docs": [ + "last unix ts user stats data was used to update if fuel (u32 to save space)" + ], + "type": "u32" }, { - name: 'numberOfSubAccounts' - docs: ['The current number of sub accounts'] - type: 'u16' - }, + "name": "padding", + "type": { + "array": [ + "u8", + 12 + ] + } + } + ] + } + }, + { + "name": "ReferrerName", + "type": { + "kind": "struct", + "fields": [ { - name: 'numberOfSubAccountsCreated' - docs: [ - 'The number of sub accounts created. Can be greater than the number of sub accounts if user', - 'has deleted sub accounts' - ] - type: 'u16' + "name": "authority", + "type": "publicKey" }, { - name: 'isReferrer' - docs: [ - 'Whether the user is a referrer. Sub account 0 can not be deleted if user is a referrer' - ] - type: 'bool' + "name": "user", + "type": "publicKey" }, { - name: 'disableUpdatePerpBidAskTwap' - type: 'bool' + "name": "userStats", + "type": "publicKey" }, { - name: 'padding' - type: { - array: ['u8', 50] + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] } } ] } - }, + } + ], + "types": [ { - name: 'referrerName' - type: { - kind: 'struct' - fields: [ + "name": "UpdatePerpMarketSummaryStatsParams", + "type": { + "kind": "struct", + "fields": [ { - name: 'authority' - type: 'publicKey' - }, - { - name: 'user' - type: 'publicKey' + "name": "quoteAssetAmountWithUnsettledLp", + "type": { + "option": "i64" + } }, { - name: 'userStats' - type: 'publicKey' + "name": "netUnsettledFundingPnl", + "type": { + "option": "i64" + } }, { - name: 'name' - type: { - array: ['u8', 32] + "name": "updateAmmSummaryStats", + "type": { + "option": "bool" } } ] } - } - ] - types: [ + }, { - name: 'LiquidatePerpRecord' - type: { - kind: 'struct' - fields: [ + "name": "LiquidatePerpRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'oraclePrice' - type: 'i64' + "name": "oraclePrice", + "type": "i64" }, { - name: 'baseAssetAmount' - type: 'i64' + "name": "baseAssetAmount", + "type": "i64" }, { - name: 'quoteAssetAmount' - type: 'i64' + "name": "quoteAssetAmount", + "type": "i64" }, { - name: 'lpShares' - docs: ['precision: AMM_RESERVE_PRECISION'] - type: 'u64' + "name": "lpShares", + "docs": [ + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u64" }, { - name: 'fillRecordId' - type: 'u64' + "name": "fillRecordId", + "type": "u64" }, { - name: 'userOrderId' - type: 'u32' + "name": "userOrderId", + "type": "u32" }, { - name: 'liquidatorOrderId' - type: 'u32' + "name": "liquidatorOrderId", + "type": "u32" }, { - name: 'liquidatorFee' - docs: ['precision: QUOTE_PRECISION'] - type: 'u64' + "name": "liquidatorFee", + "docs": [ + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'ifFee' - docs: ['precision: QUOTE_PRECISION'] - type: 'u64' + "name": "ifFee", + "docs": [ + "precision: QUOTE_PRECISION" + ], + "type": "u64" } ] } }, { - name: 'LiquidateSpotRecord' - type: { - kind: 'struct' - fields: [ + "name": "LiquidateSpotRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'assetMarketIndex' - type: 'u16' + "name": "assetMarketIndex", + "type": "u16" }, { - name: 'assetPrice' - type: 'i64' + "name": "assetPrice", + "type": "i64" }, { - name: 'assetTransfer' - type: 'u128' + "name": "assetTransfer", + "type": "u128" }, { - name: 'liabilityMarketIndex' - type: 'u16' + "name": "liabilityMarketIndex", + "type": "u16" }, { - name: 'liabilityPrice' - type: 'i64' + "name": "liabilityPrice", + "type": "i64" }, { - name: 'liabilityTransfer' - docs: ['precision: token mint precision'] - type: 'u128' + "name": "liabilityTransfer", + "docs": [ + "precision: token mint precision" + ], + "type": "u128" }, { - name: 'ifFee' - docs: ['precision: token mint precision'] - type: 'u64' + "name": "ifFee", + "docs": [ + "precision: token mint precision" + ], + "type": "u64" } ] } }, { - name: 'LiquidateBorrowForPerpPnlRecord' - type: { - kind: 'struct' - fields: [ + "name": "LiquidateBorrowForPerpPnlRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'perpMarketIndex' - type: 'u16' + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'marketOraclePrice' - type: 'i64' + "name": "marketOraclePrice", + "type": "i64" }, { - name: 'pnlTransfer' - type: 'u128' + "name": "pnlTransfer", + "type": "u128" }, { - name: 'liabilityMarketIndex' - type: 'u16' + "name": "liabilityMarketIndex", + "type": "u16" }, { - name: 'liabilityPrice' - type: 'i64' + "name": "liabilityPrice", + "type": "i64" }, { - name: 'liabilityTransfer' - type: 'u128' + "name": "liabilityTransfer", + "type": "u128" } ] } }, { - name: 'LiquidatePerpPnlForDepositRecord' - type: { - kind: 'struct' - fields: [ + "name": "LiquidatePerpPnlForDepositRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'perpMarketIndex' - type: 'u16' + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'marketOraclePrice' - type: 'i64' + "name": "marketOraclePrice", + "type": "i64" }, { - name: 'pnlTransfer' - type: 'u128' + "name": "pnlTransfer", + "type": "u128" }, { - name: 'assetMarketIndex' - type: 'u16' + "name": "assetMarketIndex", + "type": "u16" }, { - name: 'assetPrice' - type: 'i64' + "name": "assetPrice", + "type": "i64" }, { - name: 'assetTransfer' - type: 'u128' + "name": "assetTransfer", + "type": "u128" } ] } }, { - name: 'PerpBankruptcyRecord' - type: { - kind: 'struct' - fields: [ + "name": "PerpBankruptcyRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'pnl' - type: 'i128' + "name": "pnl", + "type": "i128" }, { - name: 'ifPayment' - type: 'u128' + "name": "ifPayment", + "type": "u128" }, { - name: 'clawbackUser' - type: { - option: 'publicKey' + "name": "clawbackUser", + "type": { + "option": "publicKey" } }, { - name: 'clawbackUserPayment' - type: { - option: 'u128' + "name": "clawbackUserPayment", + "type": { + "option": "u128" } }, { - name: 'cumulativeFundingRateDelta' - type: 'i128' + "name": "cumulativeFundingRateDelta", + "type": "i128" } ] } }, { - name: 'SpotBankruptcyRecord' - type: { - kind: 'struct' - fields: [ + "name": "SpotBankruptcyRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'borrowAmount' - type: 'u128' + "name": "borrowAmount", + "type": "u128" }, { - name: 'ifPayment' - type: 'u128' + "name": "ifPayment", + "type": "u128" }, { - name: 'cumulativeDepositInterestDelta' - type: 'u128' + "name": "cumulativeDepositInterestDelta", + "type": "u128" } ] } }, { - name: 'MarketIdentifier' - type: { - kind: 'struct' - fields: [ + "name": "MarketIdentifier", + "type": { + "kind": "struct", + "fields": [ { - name: 'marketType' - type: { - defined: 'MarketType' + "name": "marketType", + "type": { + "defined": "MarketType" } }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" } ] } }, { - name: 'HistoricalOracleData' - type: { - kind: 'struct' - fields: [ + "name": "HistoricalOracleData", + "type": { + "kind": "struct", + "fields": [ { - name: 'lastOraclePrice' - docs: ['precision: PRICE_PRECISION'] - type: 'i64' + "name": "lastOraclePrice", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'lastOracleConf' - docs: ['precision: PRICE_PRECISION'] - type: 'u64' + "name": "lastOracleConf", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastOracleDelay' - docs: ['number of slots since last update'] - type: 'i64' + "name": "lastOracleDelay", + "docs": [ + "number of slots since last update" + ], + "type": "i64" }, { - name: 'lastOraclePriceTwap' - docs: ['precision: PRICE_PRECISION'] - type: 'i64' + "name": "lastOraclePriceTwap", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'lastOraclePriceTwap5min' - docs: ['precision: PRICE_PRECISION'] - type: 'i64' + "name": "lastOraclePriceTwap5min", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'lastOraclePriceTwapTs' - docs: ['unix_timestamp of last snapshot'] - type: 'i64' + "name": "lastOraclePriceTwapTs", + "docs": [ + "unix_timestamp of last snapshot" + ], + "type": "i64" } ] } }, { - name: 'HistoricalIndexData' - type: { - kind: 'struct' - fields: [ + "name": "HistoricalIndexData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lastIndexBidPrice", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" + }, + { + "name": "lastIndexAskPrice", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" + }, { - name: 'lastIndexBidPrice' - docs: ['precision: PRICE_PRECISION'] - type: 'u64' + "name": "lastIndexPriceTwap", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastIndexAskPrice' - docs: ['precision: PRICE_PRECISION'] - type: 'u64' + "name": "lastIndexPriceTwap5min", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastIndexPriceTwap' - docs: ['precision: PRICE_PRECISION'] - type: 'u64' + "name": "lastIndexPriceTwapTs", + "docs": [ + "unix_timestamp of last snapshot" + ], + "type": "i64" + } + ] + } + }, + { + "name": "PrelaunchOracleParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'lastIndexPriceTwap5min' - docs: ['precision: PRICE_PRECISION'] - type: 'u64' + "name": "price", + "type": { + "option": "i64" + } }, { - name: 'lastIndexPriceTwapTs' - docs: ['unix_timestamp of last snapshot'] - type: 'i64' + "name": "maxPrice", + "type": { + "option": "i64" + } } ] } }, { - name: 'OrderParams' - type: { - kind: 'struct' - fields: [ + "name": "OrderParams", + "type": { + "kind": "struct", + "fields": [ { - name: 'orderType' - type: { - defined: 'OrderType' + "name": "orderType", + "type": { + "defined": "OrderType" } }, { - name: 'marketType' - type: { - defined: 'MarketType' + "name": "marketType", + "type": { + "defined": "MarketType" } }, { - name: 'direction' - type: { - defined: 'PositionDirection' + "name": "direction", + "type": { + "defined": "PositionDirection" } }, { - name: 'userOrderId' - type: 'u8' + "name": "userOrderId", + "type": "u8" }, { - name: 'baseAssetAmount' - type: 'u64' + "name": "baseAssetAmount", + "type": "u64" }, { - name: 'price' - type: 'u64' + "name": "price", + "type": "u64" }, { - name: 'marketIndex' - type: 'u16' + "name": "marketIndex", + "type": "u16" }, { - name: 'reduceOnly' - type: 'bool' + "name": "reduceOnly", + "type": "bool" }, { - name: 'postOnly' - type: { - defined: 'PostOnlyParam' + "name": "postOnly", + "type": { + "defined": "PostOnlyParam" } }, { - name: 'immediateOrCancel' - type: 'bool' + "name": "immediateOrCancel", + "type": "bool" }, { - name: 'maxTs' - type: { - option: 'i64' + "name": "maxTs", + "type": { + "option": "i64" } }, { - name: 'triggerPrice' - type: { - option: 'u64' + "name": "triggerPrice", + "type": { + "option": "u64" } }, { - name: 'triggerCondition' - type: { - defined: 'OrderTriggerCondition' + "name": "triggerCondition", + "type": { + "defined": "OrderTriggerCondition" } }, { - name: 'oraclePriceOffset' - type: { - option: 'i32' + "name": "oraclePriceOffset", + "type": { + "option": "i32" } }, { - name: 'auctionDuration' - type: { - option: 'u8' + "name": "auctionDuration", + "type": { + "option": "u8" } }, { - name: 'auctionStartPrice' - type: { - option: 'i64' + "name": "auctionStartPrice", + "type": { + "option": "i64" } }, { - name: 'auctionEndPrice' - type: { - option: 'i64' + "name": "auctionEndPrice", + "type": { + "option": "i64" } } ] } }, { - name: 'ModifyOrderParams' - type: { - kind: 'struct' - fields: [ + "name": "ModifyOrderParams", + "type": { + "kind": "struct", + "fields": [ { - name: 'direction' - type: { - option: { - defined: 'PositionDirection' + "name": "direction", + "type": { + "option": { + "defined": "PositionDirection" } } }, { - name: 'baseAssetAmount' - type: { - option: 'u64' + "name": "baseAssetAmount", + "type": { + "option": "u64" } }, { - name: 'price' - type: { - option: 'u64' + "name": "price", + "type": { + "option": "u64" } }, { - name: 'reduceOnly' - type: { - option: 'bool' + "name": "reduceOnly", + "type": { + "option": "bool" } }, { - name: 'postOnly' - type: { - option: { - defined: 'PostOnlyParam' + "name": "postOnly", + "type": { + "option": { + "defined": "PostOnlyParam" } } }, { - name: 'immediateOrCancel' - type: { - option: 'bool' + "name": "immediateOrCancel", + "type": { + "option": "bool" } }, { - name: 'maxTs' - type: { - option: 'i64' + "name": "maxTs", + "type": { + "option": "i64" } }, { - name: 'triggerPrice' - type: { - option: 'u64' + "name": "triggerPrice", + "type": { + "option": "u64" } }, { - name: 'triggerCondition' - type: { - option: { - defined: 'OrderTriggerCondition' + "name": "triggerCondition", + "type": { + "option": { + "defined": "OrderTriggerCondition" } } }, { - name: 'oraclePriceOffset' - type: { - option: 'i32' + "name": "oraclePriceOffset", + "type": { + "option": "i32" } }, { - name: 'auctionDuration' - type: { - option: 'u8' + "name": "auctionDuration", + "type": { + "option": "u8" } }, { - name: 'auctionStartPrice' - type: { - option: 'i64' + "name": "auctionStartPrice", + "type": { + "option": "i64" } }, { - name: 'auctionEndPrice' - type: { - option: 'i64' + "name": "auctionEndPrice", + "type": { + "option": "i64" } }, { - name: 'policy' - type: { - option: { - defined: 'ModifyOrderPolicy' + "name": "policy", + "type": { + "option": { + "defined": "ModifyOrderPolicy" } } } @@ -6669,1783 +8141,1891 @@ export type Drift = { } }, { - name: 'InsuranceClaim' - type: { - kind: 'struct' - fields: [ + "name": "InsuranceClaim", + "type": { + "kind": "struct", + "fields": [ { - name: 'revenueWithdrawSinceLastSettle' - docs: [ - 'The amount of revenue last settled', - 'Positive if funds left the perp market,', - 'negative if funds were pulled into the perp market', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "revenueWithdrawSinceLastSettle", + "docs": [ + "The amount of revenue last settled", + "Positive if funds left the perp market,", + "negative if funds were pulled into the perp market", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'maxRevenueWithdrawPerPeriod' - docs: [ - 'The max amount of revenue that can be withdrawn per period', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "maxRevenueWithdrawPerPeriod", + "docs": [ + "The max amount of revenue that can be withdrawn per period", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'quoteMaxInsurance' - docs: [ - 'The max amount of insurance that perp market can use to resolve bankruptcy and pnl deficits', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "quoteMaxInsurance", + "docs": [ + "The max amount of insurance that perp market can use to resolve bankruptcy and pnl deficits", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'quoteSettledInsurance' - docs: [ - 'The amount of insurance that has been used to resolve bankruptcy and pnl deficits', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "quoteSettledInsurance", + "docs": [ + "The amount of insurance that has been used to resolve bankruptcy and pnl deficits", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'lastRevenueWithdrawTs' - docs: ['The last time revenue was settled in/out of market'] - type: 'i64' + "name": "lastRevenueWithdrawTs", + "docs": [ + "The last time revenue was settled in/out of market" + ], + "type": "i64" } ] } }, { - name: 'PoolBalance' - type: { - kind: 'struct' - fields: [ + "name": "PoolBalance", + "type": { + "kind": "struct", + "fields": [ { - name: 'scaledBalance' - docs: [ + "name": "scaledBalance", + "docs": [ "To get the pool's token amount, you must multiply the scaled balance by the market's cumulative", - 'deposit interest', - 'precision: SPOT_BALANCE_PRECISION' - ] - type: 'u128' + "deposit interest", + "precision: SPOT_BALANCE_PRECISION" + ], + "type": "u128" }, { - name: 'marketIndex' - docs: ['The spot market the pool is for'] - type: 'u16' + "name": "marketIndex", + "docs": [ + "The spot market the pool is for" + ], + "type": "u16" }, { - name: 'padding' - type: { - array: ['u8', 6] + "name": "padding", + "type": { + "array": [ + "u8", + 6 + ] } } ] } }, { - name: 'AMM' - type: { - kind: 'struct' - fields: [ + "name": "AMM", + "type": { + "kind": "struct", + "fields": [ { - name: 'oracle' - docs: ['oracle price data public key'] - type: 'publicKey' + "name": "oracle", + "docs": [ + "oracle price data public key" + ], + "type": "publicKey" }, { - name: 'historicalOracleData' - docs: ['stores historically witnessed oracle data'] - type: { - defined: 'HistoricalOracleData' + "name": "historicalOracleData", + "docs": [ + "stores historically witnessed oracle data" + ], + "type": { + "defined": "HistoricalOracleData" } }, { - name: 'baseAssetAmountPerLp' - docs: [ - 'accumulated base asset amount since inception per lp share', - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "name": "baseAssetAmountPerLp", + "docs": [ + "accumulated base asset amount since inception per lp share", + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'quoteAssetAmountPerLp' - docs: [ - 'accumulated quote asset amount since inception per lp share', - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "name": "quoteAssetAmountPerLp", + "docs": [ + "accumulated quote asset amount since inception per lp share", + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'feePool' - docs: [ - 'partition of fees from perp market trading moved from pnl settlements' - ] - type: { - defined: 'PoolBalance' + "name": "feePool", + "docs": [ + "partition of fees from perp market trading moved from pnl settlements" + ], + "type": { + "defined": "PoolBalance" } }, { - name: 'baseAssetReserve' - docs: [ - '`x` reserves for constant product mm formula (x * y = k)', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "baseAssetReserve", + "docs": [ + "`x` reserves for constant product mm formula (x * y = k)", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'quoteAssetReserve' - docs: [ - '`y` reserves for constant product mm formula (x * y = k)', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "quoteAssetReserve", + "docs": [ + "`y` reserves for constant product mm formula (x * y = k)", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'concentrationCoef' - docs: [ - 'determines how close the min/max base asset reserve sit vs base reserves', - 'allow for decreasing slippage without increasing liquidity and v.v.', - 'precision: PERCENTAGE_PRECISION' - ] - type: 'u128' + "name": "concentrationCoef", + "docs": [ + "determines how close the min/max base asset reserve sit vs base reserves", + "allow for decreasing slippage without increasing liquidity and v.v.", + "precision: PERCENTAGE_PRECISION" + ], + "type": "u128" }, { - name: 'minBaseAssetReserve' - docs: [ - 'minimum base_asset_reserve allowed before AMM is unavailable', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "minBaseAssetReserve", + "docs": [ + "minimum base_asset_reserve allowed before AMM is unavailable", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'maxBaseAssetReserve' - docs: [ - 'maximum base_asset_reserve allowed before AMM is unavailable', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "maxBaseAssetReserve", + "docs": [ + "maximum base_asset_reserve allowed before AMM is unavailable", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'sqrtK' - docs: [ - '`sqrt(k)` in constant product mm formula (x * y = k). stored to avoid drift caused by integer math issues', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "sqrtK", + "docs": [ + "`sqrt(k)` in constant product mm formula (x * y = k). stored to avoid drift caused by integer math issues", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'pegMultiplier' - docs: [ - 'normalizing numerical factor for y, its use offers lowest slippage in cp-curve when market is balanced', - 'precision: PEG_PRECISION' - ] - type: 'u128' + "name": "pegMultiplier", + "docs": [ + "normalizing numerical factor for y, its use offers lowest slippage in cp-curve when market is balanced", + "precision: PEG_PRECISION" + ], + "type": "u128" }, { - name: 'terminalQuoteAssetReserve' - docs: [ - 'y when market is balanced. stored to save computation', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "terminalQuoteAssetReserve", + "docs": [ + "y when market is balanced. stored to save computation", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'baseAssetAmountLong' - docs: [ - 'always non-negative. tracks number of total longs in market (regardless of counterparty)', - 'precision: BASE_PRECISION' - ] - type: 'i128' + "name": "baseAssetAmountLong", + "docs": [ + "always non-negative. tracks number of total longs in market (regardless of counterparty)", + "precision: BASE_PRECISION" + ], + "type": "i128" }, { - name: 'baseAssetAmountShort' - docs: [ - 'always non-positive. tracks number of total shorts in market (regardless of counterparty)', - 'precision: BASE_PRECISION' - ] - type: 'i128' + "name": "baseAssetAmountShort", + "docs": [ + "always non-positive. tracks number of total shorts in market (regardless of counterparty)", + "precision: BASE_PRECISION" + ], + "type": "i128" }, { - name: 'baseAssetAmountWithAmm' - docs: [ - 'tracks net position (longs-shorts) in market with AMM as counterparty', - 'precision: BASE_PRECISION' - ] - type: 'i128' + "name": "baseAssetAmountWithAmm", + "docs": [ + "tracks net position (longs-shorts) in market with AMM as counterparty", + "precision: BASE_PRECISION" + ], + "type": "i128" }, { - name: 'baseAssetAmountWithUnsettledLp' - docs: [ - 'tracks net position (longs-shorts) in market with LPs as counterparty', - 'precision: BASE_PRECISION' - ] - type: 'i128' + "name": "baseAssetAmountWithUnsettledLp", + "docs": [ + "tracks net position (longs-shorts) in market with LPs as counterparty", + "precision: BASE_PRECISION" + ], + "type": "i128" }, { - name: 'maxOpenInterest' - docs: [ - 'max allowed open interest, blocks trades that breach this value', - 'precision: BASE_PRECISION' - ] - type: 'u128' + "name": "maxOpenInterest", + "docs": [ + "max allowed open interest, blocks trades that breach this value", + "precision: BASE_PRECISION" + ], + "type": "u128" }, { - name: 'quoteAssetAmount' - docs: [ + "name": "quoteAssetAmount", + "docs": [ "sum of all user's perp quote_asset_amount in market", - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'quoteEntryAmountLong' - docs: [ + "name": "quoteEntryAmountLong", + "docs": [ "sum of all long user's quote_entry_amount in market", - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'quoteEntryAmountShort' - docs: [ + "name": "quoteEntryAmountShort", + "docs": [ "sum of all short user's quote_entry_amount in market", - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'quoteBreakEvenAmountLong' - docs: [ + "name": "quoteBreakEvenAmountLong", + "docs": [ "sum of all long user's quote_break_even_amount in market", - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'quoteBreakEvenAmountShort' - docs: [ + "name": "quoteBreakEvenAmountShort", + "docs": [ "sum of all short user's quote_break_even_amount in market", - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'userLpShares' - docs: [ - 'total user lp shares of sqrt_k (protocol owned liquidity = sqrt_k - last_funding_rate)', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "userLpShares", + "docs": [ + "total user lp shares of sqrt_k (protocol owned liquidity = sqrt_k - last_funding_rate)", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'lastFundingRate' - docs: [ - 'last funding rate in this perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "lastFundingRate", + "docs": [ + "last funding rate in this perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'lastFundingRateLong' - docs: [ - 'last funding rate for longs in this perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "lastFundingRateLong", + "docs": [ + "last funding rate for longs in this perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'lastFundingRateShort' - docs: [ - 'last funding rate for shorts in this perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "lastFundingRateShort", + "docs": [ + "last funding rate for shorts in this perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'last24hAvgFundingRate' - docs: [ - 'estimate of last 24h of funding rate perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "last24hAvgFundingRate", + "docs": [ + "estimate of last 24h of funding rate perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'totalFee' - docs: [ - 'total fees collected by this perp market', - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "name": "totalFee", + "docs": [ + "total fees collected by this perp market", + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'totalMmFee' - docs: [ + "name": "totalMmFee", + "docs": [ "total fees collected by the vAMM's bid/ask spread", - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'totalExchangeFee' - docs: [ - 'total fees collected by exchange fee schedule', - 'precision: QUOTE_PRECISION' - ] - type: 'u128' + "name": "totalExchangeFee", + "docs": [ + "total fees collected by exchange fee schedule", + "precision: QUOTE_PRECISION" + ], + "type": "u128" }, { - name: 'totalFeeMinusDistributions' - docs: [ - 'total fees minus any recognized upnl and pool withdraws', - 'precision: QUOTE_PRECISION' - ] - type: 'i128' + "name": "totalFeeMinusDistributions", + "docs": [ + "total fees minus any recognized upnl and pool withdraws", + "precision: QUOTE_PRECISION" + ], + "type": "i128" }, { - name: 'totalFeeWithdrawn' - docs: [ - 'sum of all fees from fee pool withdrawn to revenue pool', - 'precision: QUOTE_PRECISION' - ] - type: 'u128' + "name": "totalFeeWithdrawn", + "docs": [ + "sum of all fees from fee pool withdrawn to revenue pool", + "precision: QUOTE_PRECISION" + ], + "type": "u128" }, { - name: 'totalLiquidationFee' - docs: [ - 'all fees collected by market for liquidations', - 'precision: QUOTE_PRECISION' - ] - type: 'u128' + "name": "totalLiquidationFee", + "docs": [ + "all fees collected by market for liquidations", + "precision: QUOTE_PRECISION" + ], + "type": "u128" }, { - name: 'cumulativeFundingRateLong' - docs: [ - 'accumulated funding rate for longs since inception in market' - ] - type: 'i128' + "name": "cumulativeFundingRateLong", + "docs": [ + "accumulated funding rate for longs since inception in market" + ], + "type": "i128" }, { - name: 'cumulativeFundingRateShort' - docs: [ - 'accumulated funding rate for shorts since inception in market' - ] - type: 'i128' + "name": "cumulativeFundingRateShort", + "docs": [ + "accumulated funding rate for shorts since inception in market" + ], + "type": "i128" }, { - name: 'totalSocialLoss' - docs: [ - 'accumulated social loss paid by users since inception in market' - ] - type: 'u128' + "name": "totalSocialLoss", + "docs": [ + "accumulated social loss paid by users since inception in market" + ], + "type": "u128" }, { - name: 'askBaseAssetReserve' - docs: [ - 'transformed base_asset_reserve for users going long', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "askBaseAssetReserve", + "docs": [ + "transformed base_asset_reserve for users going long", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'askQuoteAssetReserve' - docs: [ - 'transformed quote_asset_reserve for users going long', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "askQuoteAssetReserve", + "docs": [ + "transformed quote_asset_reserve for users going long", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'bidBaseAssetReserve' - docs: [ - 'transformed base_asset_reserve for users going short', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "bidBaseAssetReserve", + "docs": [ + "transformed base_asset_reserve for users going short", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'bidQuoteAssetReserve' - docs: [ - 'transformed quote_asset_reserve for users going short', - 'precision: AMM_RESERVE_PRECISION' - ] - type: 'u128' + "name": "bidQuoteAssetReserve", + "docs": [ + "transformed quote_asset_reserve for users going short", + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u128" }, { - name: 'lastOracleNormalisedPrice' - docs: [ - 'the last seen oracle price partially shrunk toward the amm reserve price', - 'precision: PRICE_PRECISION' - ] - type: 'i64' + "name": "lastOracleNormalisedPrice", + "docs": [ + "the last seen oracle price partially shrunk toward the amm reserve price", + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'lastOracleReservePriceSpreadPct' - docs: [ - 'the gap between the oracle price and the reserve price = y * peg_multiplier / x' - ] - type: 'i64' + "name": "lastOracleReservePriceSpreadPct", + "docs": [ + "the gap between the oracle price and the reserve price = y * peg_multiplier / x" + ], + "type": "i64" }, { - name: 'lastBidPriceTwap' - docs: [ - 'average estimate of bid price over funding_period', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "lastBidPriceTwap", + "docs": [ + "average estimate of bid price over funding_period", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastAskPriceTwap' - docs: [ - 'average estimate of ask price over funding_period', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "lastAskPriceTwap", + "docs": [ + "average estimate of ask price over funding_period", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastMarkPriceTwap' - docs: [ - 'average estimate of (bid+ask)/2 price over funding_period', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "lastMarkPriceTwap", + "docs": [ + "average estimate of (bid+ask)/2 price over funding_period", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastMarkPriceTwap5min' - docs: ['average estimate of (bid+ask)/2 price over FIVE_MINUTES'] - type: 'u64' + "name": "lastMarkPriceTwap5min", + "docs": [ + "average estimate of (bid+ask)/2 price over FIVE_MINUTES" + ], + "type": "u64" }, { - name: 'lastUpdateSlot' - docs: ['the last blockchain slot the amm was updated'] - type: 'u64' + "name": "lastUpdateSlot", + "docs": [ + "the last blockchain slot the amm was updated" + ], + "type": "u64" }, { - name: 'lastOracleConfPct' - docs: [ - 'the pct size of the oracle confidence interval', - 'precision: PERCENTAGE_PRECISION' - ] - type: 'u64' + "name": "lastOracleConfPct", + "docs": [ + "the pct size of the oracle confidence interval", + "precision: PERCENTAGE_PRECISION" + ], + "type": "u64" }, { - name: 'netRevenueSinceLastFunding' - docs: [ - 'the total_fee_minus_distribution change since the last funding update', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "netRevenueSinceLastFunding", + "docs": [ + "the total_fee_minus_distribution change since the last funding update", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'lastFundingRateTs' - docs: ['the last funding rate update unix_timestamp'] - type: 'i64' + "name": "lastFundingRateTs", + "docs": [ + "the last funding rate update unix_timestamp" + ], + "type": "i64" }, { - name: 'fundingPeriod' - docs: ['the peridocity of the funding rate updates'] - type: 'i64' + "name": "fundingPeriod", + "docs": [ + "the peridocity of the funding rate updates" + ], + "type": "i64" }, { - name: 'orderStepSize' - docs: [ - 'the base step size (increment) of orders', - 'precision: BASE_PRECISION' - ] - type: 'u64' + "name": "orderStepSize", + "docs": [ + "the base step size (increment) of orders", + "precision: BASE_PRECISION" + ], + "type": "u64" }, { - name: 'orderTickSize' - docs: [ - 'the price tick size of orders', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "orderTickSize", + "docs": [ + "the price tick size of orders", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'minOrderSize' - docs: [ - 'the minimum base size of an order', - 'precision: BASE_PRECISION' - ] - type: 'u64' + "name": "minOrderSize", + "docs": [ + "the minimum base size of an order", + "precision: BASE_PRECISION" + ], + "type": "u64" }, { - name: 'maxPositionSize' - docs: [ - 'the max base size a single user can have', - 'precision: BASE_PRECISION' - ] - type: 'u64' + "name": "maxPositionSize", + "docs": [ + "the max base size a single user can have", + "precision: BASE_PRECISION" + ], + "type": "u64" }, { - name: 'volume24h' - docs: ['estimated total of volume in market', 'QUOTE_PRECISION'] - type: 'u64' + "name": "volume24h", + "docs": [ + "estimated total of volume in market", + "QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'longIntensityVolume' - docs: ['the volume intensity of long fills against AMM'] - type: 'u64' + "name": "longIntensityVolume", + "docs": [ + "the volume intensity of long fills against AMM" + ], + "type": "u64" }, { - name: 'shortIntensityVolume' - docs: ['the volume intensity of short fills against AMM'] - type: 'u64' + "name": "shortIntensityVolume", + "docs": [ + "the volume intensity of short fills against AMM" + ], + "type": "u64" }, { - name: 'lastTradeTs' - docs: [ - 'the blockchain unix timestamp at the time of the last trade' - ] - type: 'i64' + "name": "lastTradeTs", + "docs": [ + "the blockchain unix timestamp at the time of the last trade" + ], + "type": "i64" }, { - name: 'markStd' - docs: [ - 'estimate of standard deviation of the fill (mark) prices', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "markStd", + "docs": [ + "estimate of standard deviation of the fill (mark) prices", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'oracleStd' - docs: [ - 'estimate of standard deviation of the oracle price at each update', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "oracleStd", + "docs": [ + "estimate of standard deviation of the oracle price at each update", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastMarkPriceTwapTs' - docs: ['the last unix_timestamp the mark twap was updated'] - type: 'i64' + "name": "lastMarkPriceTwapTs", + "docs": [ + "the last unix_timestamp the mark twap was updated" + ], + "type": "i64" }, { - name: 'baseSpread' - docs: [ - 'the minimum spread the AMM can quote. also used as step size for some spread logic increases.' - ] - type: 'u32' + "name": "baseSpread", + "docs": [ + "the minimum spread the AMM can quote. also used as step size for some spread logic increases." + ], + "type": "u32" }, { - name: 'maxSpread' - docs: ['the maximum spread the AMM can quote'] - type: 'u32' + "name": "maxSpread", + "docs": [ + "the maximum spread the AMM can quote" + ], + "type": "u32" }, { - name: 'longSpread' - docs: ['the spread for asks vs the reserve price'] - type: 'u32' + "name": "longSpread", + "docs": [ + "the spread for asks vs the reserve price" + ], + "type": "u32" }, { - name: 'shortSpread' - docs: ['the spread for bids vs the reserve price'] - type: 'u32' + "name": "shortSpread", + "docs": [ + "the spread for bids vs the reserve price" + ], + "type": "u32" }, { - name: 'longIntensityCount' - docs: ['the count intensity of long fills against AMM'] - type: 'u32' + "name": "longIntensityCount", + "docs": [ + "the count intensity of long fills against AMM" + ], + "type": "u32" }, { - name: 'shortIntensityCount' - docs: ['the count intensity of short fills against AMM'] - type: 'u32' + "name": "shortIntensityCount", + "docs": [ + "the count intensity of short fills against AMM" + ], + "type": "u32" }, { - name: 'maxFillReserveFraction' - docs: [ - 'the fraction of total available liquidity a single fill on the AMM can consume' - ] - type: 'u16' + "name": "maxFillReserveFraction", + "docs": [ + "the fraction of total available liquidity a single fill on the AMM can consume" + ], + "type": "u16" }, { - name: 'maxSlippageRatio' - docs: ['the maximum slippage a single fill on the AMM can push'] - type: 'u16' + "name": "maxSlippageRatio", + "docs": [ + "the maximum slippage a single fill on the AMM can push" + ], + "type": "u16" }, { - name: 'curveUpdateIntensity' - docs: [ - 'the update intensity of AMM formulaic updates (adjusting k). 0-100' - ] - type: 'u8' + "name": "curveUpdateIntensity", + "docs": [ + "the update intensity of AMM formulaic updates (adjusting k). 0-100" + ], + "type": "u8" }, { - name: 'ammJitIntensity' - docs: [ - 'the jit intensity of AMM. larger intensity means larger participation in jit. 0 means no jit participation.', - '(0, 100] is intensity for protocol-owned AMM. (100, 200] is intensity for user LP-owned AMM.' - ] - type: 'u8' + "name": "ammJitIntensity", + "docs": [ + "the jit intensity of AMM. larger intensity means larger participation in jit. 0 means no jit participation.", + "(0, 100] is intensity for protocol-owned AMM. (100, 200] is intensity for user LP-owned AMM." + ], + "type": "u8" }, { - name: 'oracleSource' - docs: [ - 'the oracle provider information. used to decode/scale the oracle public key' - ] - type: { - defined: 'OracleSource' + "name": "oracleSource", + "docs": [ + "the oracle provider information. used to decode/scale the oracle public key" + ], + "type": { + "defined": "OracleSource" } }, { - name: 'lastOracleValid' - docs: [ - 'tracks whether the oracle was considered valid at the last AMM update' - ] - type: 'bool' + "name": "lastOracleValid", + "docs": [ + "tracks whether the oracle was considered valid at the last AMM update" + ], + "type": "bool" }, { - name: 'targetBaseAssetAmountPerLp' - docs: [ - 'the target value for `base_asset_amount_per_lp`, used during AMM JIT with LP split', - 'precision: BASE_PRECISION' - ] - type: 'i32' + "name": "targetBaseAssetAmountPerLp", + "docs": [ + "the target value for `base_asset_amount_per_lp`, used during AMM JIT with LP split", + "precision: BASE_PRECISION" + ], + "type": "i32" }, { - name: 'perLpBase' - docs: [ - 'expo for unit of per_lp, base 10 (if per_lp_base=X, then per_lp unit is 10^X)' - ] - type: 'i8' + "name": "perLpBase", + "docs": [ + "expo for unit of per_lp, base 10 (if per_lp_base=X, then per_lp unit is 10^X)" + ], + "type": "i8" }, { - name: 'padding1' - type: 'u8' + "name": "padding1", + "type": "u8" }, { - name: 'padding2' - type: 'u16' + "name": "padding2", + "type": "u16" }, { - name: 'totalFeeEarnedPerLp' - type: 'u64' + "name": "totalFeeEarnedPerLp", + "type": "u64" }, { - name: 'netUnsettledFundingPnl' - type: 'i64' + "name": "netUnsettledFundingPnl", + "type": "i64" }, { - name: 'quoteAssetAmountWithUnsettledLp' - type: 'i64' + "name": "quoteAssetAmountWithUnsettledLp", + "type": "i64" }, { - name: 'referencePriceOffset' - type: 'i32' + "name": "referencePriceOffset", + "type": "i32" }, { - name: 'padding' - type: { - array: ['u8', 12] + "name": "padding", + "type": { + "array": [ + "u8", + 12 + ] } } ] } }, { - name: 'InsuranceFund' - type: { - kind: 'struct' - fields: [ + "name": "InsuranceFund", + "type": { + "kind": "struct", + "fields": [ { - name: 'vault' - type: 'publicKey' + "name": "vault", + "type": "publicKey" }, { - name: 'totalShares' - type: 'u128' + "name": "totalShares", + "type": "u128" }, { - name: 'userShares' - type: 'u128' + "name": "userShares", + "type": "u128" }, { - name: 'sharesBase' - type: 'u128' + "name": "sharesBase", + "type": "u128" }, { - name: 'unstakingPeriod' - type: 'i64' + "name": "unstakingPeriod", + "type": "i64" }, { - name: 'lastRevenueSettleTs' - type: 'i64' + "name": "lastRevenueSettleTs", + "type": "i64" }, { - name: 'revenueSettlePeriod' - type: 'i64' + "name": "revenueSettlePeriod", + "type": "i64" }, { - name: 'totalFactor' - type: 'u32' + "name": "totalFactor", + "type": "u32" }, { - name: 'userFactor' - type: 'u32' + "name": "userFactor", + "type": "u32" } ] } }, { - name: 'OracleGuardRails' - type: { - kind: 'struct' - fields: [ + "name": "OracleGuardRails", + "type": { + "kind": "struct", + "fields": [ { - name: 'priceDivergence' - type: { - defined: 'PriceDivergenceGuardRails' + "name": "priceDivergence", + "type": { + "defined": "PriceDivergenceGuardRails" } }, { - name: 'validity' - type: { - defined: 'ValidityGuardRails' + "name": "validity", + "type": { + "defined": "ValidityGuardRails" } } ] } }, { - name: 'PriceDivergenceGuardRails' - type: { - kind: 'struct' - fields: [ + "name": "PriceDivergenceGuardRails", + "type": { + "kind": "struct", + "fields": [ { - name: 'markOraclePercentDivergence' - type: 'u64' + "name": "markOraclePercentDivergence", + "type": "u64" }, { - name: 'oracleTwap5minPercentDivergence' - type: 'u64' + "name": "oracleTwap5minPercentDivergence", + "type": "u64" } ] } }, { - name: 'ValidityGuardRails' - type: { - kind: 'struct' - fields: [ + "name": "ValidityGuardRails", + "type": { + "kind": "struct", + "fields": [ { - name: 'slotsBeforeStaleForAmm' - type: 'i64' + "name": "slotsBeforeStaleForAmm", + "type": "i64" }, { - name: 'slotsBeforeStaleForMargin' - type: 'i64' + "name": "slotsBeforeStaleForMargin", + "type": "i64" }, { - name: 'confidenceIntervalMaxSize' - type: 'u64' + "name": "confidenceIntervalMaxSize", + "type": "u64" }, { - name: 'tooVolatileRatio' - type: 'i64' + "name": "tooVolatileRatio", + "type": "i64" } ] } }, { - name: 'FeeStructure' - type: { - kind: 'struct' - fields: [ + "name": "FeeStructure", + "type": { + "kind": "struct", + "fields": [ { - name: 'feeTiers' - type: { - array: [ + "name": "feeTiers", + "type": { + "array": [ { - defined: 'FeeTier' + "defined": "FeeTier" }, 10 ] } }, { - name: 'fillerRewardStructure' - type: { - defined: 'OrderFillerRewardStructure' + "name": "fillerRewardStructure", + "type": { + "defined": "OrderFillerRewardStructure" } }, { - name: 'referrerRewardEpochUpperBound' - type: 'u64' + "name": "referrerRewardEpochUpperBound", + "type": "u64" }, { - name: 'flatFillerFee' - type: 'u64' + "name": "flatFillerFee", + "type": "u64" } ] } }, { - name: 'FeeTier' - type: { - kind: 'struct' - fields: [ + "name": "FeeTier", + "type": { + "kind": "struct", + "fields": [ { - name: 'feeNumerator' - type: 'u32' + "name": "feeNumerator", + "type": "u32" }, { - name: 'feeDenominator' - type: 'u32' + "name": "feeDenominator", + "type": "u32" }, { - name: 'makerRebateNumerator' - type: 'u32' + "name": "makerRebateNumerator", + "type": "u32" }, { - name: 'makerRebateDenominator' - type: 'u32' + "name": "makerRebateDenominator", + "type": "u32" }, { - name: 'referrerRewardNumerator' - type: 'u32' + "name": "referrerRewardNumerator", + "type": "u32" }, { - name: 'referrerRewardDenominator' - type: 'u32' + "name": "referrerRewardDenominator", + "type": "u32" }, { - name: 'refereeFeeNumerator' - type: 'u32' + "name": "refereeFeeNumerator", + "type": "u32" }, { - name: 'refereeFeeDenominator' - type: 'u32' + "name": "refereeFeeDenominator", + "type": "u32" } ] } }, { - name: 'OrderFillerRewardStructure' - type: { - kind: 'struct' - fields: [ + "name": "OrderFillerRewardStructure", + "type": { + "kind": "struct", + "fields": [ { - name: 'rewardNumerator' - type: 'u32' + "name": "rewardNumerator", + "type": "u32" }, { - name: 'rewardDenominator' - type: 'u32' + "name": "rewardDenominator", + "type": "u32" }, { - name: 'timeBasedRewardLowerBound' - type: 'u128' + "name": "timeBasedRewardLowerBound", + "type": "u128" } ] } }, { - name: 'UserFees' - type: { - kind: 'struct' - fields: [ + "name": "UserFees", + "type": { + "kind": "struct", + "fields": [ { - name: 'totalFeePaid' - docs: ['Total taker fee paid', 'precision: QUOTE_PRECISION'] - type: 'u64' + "name": "totalFeePaid", + "docs": [ + "Total taker fee paid", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalFeeRebate' - docs: ['Total maker fee rebate', 'precision: QUOTE_PRECISION'] - type: 'u64' + "name": "totalFeeRebate", + "docs": [ + "Total maker fee rebate", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalTokenDiscount' - docs: [ - 'Total discount from holding token', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "totalTokenDiscount", + "docs": [ + "Total discount from holding token", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalRefereeDiscount' - docs: [ - 'Total discount from being referred', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "totalRefereeDiscount", + "docs": [ + "Total discount from being referred", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalReferrerReward' - docs: ['Total reward to referrer', 'precision: QUOTE_PRECISION'] - type: 'u64' + "name": "totalReferrerReward", + "docs": [ + "Total reward to referrer", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'currentEpochReferrerReward' - docs: [ - 'Total reward to referrer this epoch', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "currentEpochReferrerReward", + "docs": [ + "Total reward to referrer this epoch", + "precision: QUOTE_PRECISION" + ], + "type": "u64" } ] } }, { - name: 'SpotPosition' - type: { - kind: 'struct' - fields: [ + "name": "SpotPosition", + "type": { + "kind": "struct", + "fields": [ { - name: 'scaledBalance' - docs: [ - 'The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow', - 'interest of corresponding market.', - 'precision: SPOT_BALANCE_PRECISION' - ] - type: 'u64' + "name": "scaledBalance", + "docs": [ + "The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow", + "interest of corresponding market.", + "precision: SPOT_BALANCE_PRECISION" + ], + "type": "u64" }, { - name: 'openBids' - docs: [ - 'How many spot bids the user has open', - 'precision: token mint precision' - ] - type: 'i64' + "name": "openBids", + "docs": [ + "How many spot bids the user has open", + "precision: token mint precision" + ], + "type": "i64" }, { - name: 'openAsks' - docs: [ - 'How many spot asks the user has open', - 'precision: token mint precision' - ] - type: 'i64' + "name": "openAsks", + "docs": [ + "How many spot asks the user has open", + "precision: token mint precision" + ], + "type": "i64" }, { - name: 'cumulativeDeposits' - docs: [ - 'The cumulative deposits/borrows a user has made into a market', - 'precision: token mint precision' - ] - type: 'i64' + "name": "cumulativeDeposits", + "docs": [ + "The cumulative deposits/borrows a user has made into a market", + "precision: token mint precision" + ], + "type": "i64" }, { - name: 'marketIndex' - docs: ['The market index of the corresponding spot market'] - type: 'u16' + "name": "marketIndex", + "docs": [ + "The market index of the corresponding spot market" + ], + "type": "u16" }, { - name: 'balanceType' - docs: ['Whether the position is deposit or borrow'] - type: { - defined: 'SpotBalanceType' + "name": "balanceType", + "docs": [ + "Whether the position is deposit or borrow" + ], + "type": { + "defined": "SpotBalanceType" } }, { - name: 'openOrders' - docs: ['Number of open orders'] - type: 'u8' + "name": "openOrders", + "docs": [ + "Number of open orders" + ], + "type": "u8" }, { - name: 'padding' - type: { - array: ['u8', 4] + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] } } ] } }, { - name: 'PerpPosition' - type: { - kind: 'struct' - fields: [ + "name": "PerpPosition", + "type": { + "kind": "struct", + "fields": [ { - name: 'lastCumulativeFundingRate' - docs: [ + "name": "lastCumulativeFundingRate", + "docs": [ "The perp market's last cumulative funding rate. Used to calculate the funding payment owed to user", - 'precision: FUNDING_RATE_PRECISION' - ] - type: 'i64' + "precision: FUNDING_RATE_PRECISION" + ], + "type": "i64" }, { - name: 'baseAssetAmount' - docs: [ - 'the size of the users perp position', - 'precision: BASE_PRECISION' - ] - type: 'i64' + "name": "baseAssetAmount", + "docs": [ + "the size of the users perp position", + "precision: BASE_PRECISION" + ], + "type": "i64" }, { - name: 'quoteAssetAmount' - docs: [ - 'Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees', - 'Updated when the user open/closes position or settles pnl. Includes fees/funding', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "quoteAssetAmount", + "docs": [ + "Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees", + "Updated when the user open/closes position or settles pnl. Includes fees/funding", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'quoteBreakEvenAmount' - docs: [ - 'The amount of quote the user would need to exit their position at to break even', - 'Updated when the user open/closes position or settles pnl. Includes fees/funding', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "quoteBreakEvenAmount", + "docs": [ + "The amount of quote the user would need to exit their position at to break even", + "Updated when the user open/closes position or settles pnl. Includes fees/funding", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'quoteEntryAmount' - docs: [ - 'The amount quote the user entered the position with. Equal to base asset amount * avg entry price', - 'Updated when the user open/closes position. Excludes fees/funding', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "quoteEntryAmount", + "docs": [ + "The amount quote the user entered the position with. Equal to base asset amount * avg entry price", + "Updated when the user open/closes position. Excludes fees/funding", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'openBids' - docs: [ - 'The amount of open bids the user has in this perp market', - 'precision: BASE_PRECISION' - ] - type: 'i64' + "name": "openBids", + "docs": [ + "The amount of open bids the user has in this perp market", + "precision: BASE_PRECISION" + ], + "type": "i64" }, { - name: 'openAsks' - docs: [ - 'The amount of open asks the user has in this perp market', - 'precision: BASE_PRECISION' - ] - type: 'i64' + "name": "openAsks", + "docs": [ + "The amount of open asks the user has in this perp market", + "precision: BASE_PRECISION" + ], + "type": "i64" }, { - name: 'settledPnl' - docs: [ - 'The amount of pnl settled in this market since opening the position', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "settledPnl", + "docs": [ + "The amount of pnl settled in this market since opening the position", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'lpShares' - docs: [ - 'The number of lp (liquidity provider) shares the user has in this perp market', - 'LP shares allow users to provide liquidity via the AMM', - 'precision: BASE_PRECISION' - ] - type: 'u64' + "name": "lpShares", + "docs": [ + "The number of lp (liquidity provider) shares the user has in this perp market", + "LP shares allow users to provide liquidity via the AMM", + "precision: BASE_PRECISION" + ], + "type": "u64" }, { - name: 'lastBaseAssetAmountPerLp' - docs: [ - 'The last base asset amount per lp the amm had', - 'Used to settle the users lp position', - 'precision: BASE_PRECISION' - ] - type: 'i64' + "name": "lastBaseAssetAmountPerLp", + "docs": [ + "The last base asset amount per lp the amm had", + "Used to settle the users lp position", + "precision: BASE_PRECISION" + ], + "type": "i64" }, { - name: 'lastQuoteAssetAmountPerLp' - docs: [ - 'The last quote asset amount per lp the amm had', - 'Used to settle the users lp position', - 'precision: QUOTE_PRECISION' - ] - type: 'i64' + "name": "lastQuoteAssetAmountPerLp", + "docs": [ + "The last quote asset amount per lp the amm had", + "Used to settle the users lp position", + "precision: QUOTE_PRECISION" + ], + "type": "i64" }, { - name: 'remainderBaseAssetAmount' - docs: [ - 'Settling LP position can lead to a small amount of base asset being left over smaller than step size', - 'This records that remainder so it can be settled later on', - 'precision: BASE_PRECISION' - ] - type: 'i32' + "name": "remainderBaseAssetAmount", + "docs": [ + "Settling LP position can lead to a small amount of base asset being left over smaller than step size", + "This records that remainder so it can be settled later on", + "precision: BASE_PRECISION" + ], + "type": "i32" }, { - name: 'marketIndex' - docs: ['The market index for the perp market'] - type: 'u16' + "name": "marketIndex", + "docs": [ + "The market index for the perp market" + ], + "type": "u16" }, { - name: 'openOrders' - docs: ['The number of open orders'] - type: 'u8' + "name": "openOrders", + "docs": [ + "The number of open orders" + ], + "type": "u8" }, { - name: 'perLpBase' - type: 'i8' + "name": "perLpBase", + "type": "i8" } ] } }, { - name: 'Order' - type: { - kind: 'struct' - fields: [ + "name": "Order", + "type": { + "kind": "struct", + "fields": [ { - name: 'slot' - docs: ['The slot the order was placed'] - type: 'u64' + "name": "slot", + "docs": [ + "The slot the order was placed" + ], + "type": "u64" }, { - name: 'price' - docs: [ - 'The limit price for the order (can be 0 for market orders)', + "name": "price", + "docs": [ + "The limit price for the order (can be 0 for market orders)", "For orders with an auction, this price isn't used until the auction is complete", - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'baseAssetAmount' - docs: [ - 'The size of the order', - 'precision for perps: BASE_PRECISION', - 'precision for spot: token mint precision' - ] - type: 'u64' + "name": "baseAssetAmount", + "docs": [ + "The size of the order", + "precision for perps: BASE_PRECISION", + "precision for spot: token mint precision" + ], + "type": "u64" }, { - name: 'baseAssetAmountFilled' - docs: [ - 'The amount of the order filled', - 'precision for perps: BASE_PRECISION', - 'precision for spot: token mint precision' - ] - type: 'u64' + "name": "baseAssetAmountFilled", + "docs": [ + "The amount of the order filled", + "precision for perps: BASE_PRECISION", + "precision for spot: token mint precision" + ], + "type": "u64" }, { - name: 'quoteAssetAmountFilled' - docs: [ - 'The amount of quote filled for the order', - 'precision: QUOTE_PRECISION' - ] - type: 'u64' + "name": "quoteAssetAmountFilled", + "docs": [ + "The amount of quote filled for the order", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'triggerPrice' - docs: [ - 'At what price the order will be triggered. Only relevant for trigger orders', - 'precision: PRICE_PRECISION' - ] - type: 'u64' + "name": "triggerPrice", + "docs": [ + "At what price the order will be triggered. Only relevant for trigger orders", + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'auctionStartPrice' - docs: [ - 'The start price for the auction. Only relevant for market/oracle orders', - 'precision: PRICE_PRECISION' - ] - type: 'i64' + "name": "auctionStartPrice", + "docs": [ + "The start price for the auction. Only relevant for market/oracle orders", + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'auctionEndPrice' - docs: [ - 'The end price for the auction. Only relevant for market/oracle orders', - 'precision: PRICE_PRECISION' - ] - type: 'i64' + "name": "auctionEndPrice", + "docs": [ + "The end price for the auction. Only relevant for market/oracle orders", + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'maxTs' - docs: ['The time when the order will expire'] - type: 'i64' + "name": "maxTs", + "docs": [ + "The time when the order will expire" + ], + "type": "i64" }, { - name: 'oraclePriceOffset' - docs: [ - 'If set, the order limit price is the oracle price + this offset', - 'precision: PRICE_PRECISION' - ] - type: 'i32' + "name": "oraclePriceOffset", + "docs": [ + "If set, the order limit price is the oracle price + this offset", + "precision: PRICE_PRECISION" + ], + "type": "i32" }, { - name: 'orderId' - docs: [ - 'The id for the order. Each users has their own order id space' - ] - type: 'u32' + "name": "orderId", + "docs": [ + "The id for the order. Each users has their own order id space" + ], + "type": "u32" }, { - name: 'marketIndex' - docs: ['The perp/spot market index'] - type: 'u16' + "name": "marketIndex", + "docs": [ + "The perp/spot market index" + ], + "type": "u16" }, { - name: 'status' - docs: ['Whether the order is open or unused'] - type: { - defined: 'OrderStatus' + "name": "status", + "docs": [ + "Whether the order is open or unused" + ], + "type": { + "defined": "OrderStatus" } }, { - name: 'orderType' - docs: ['The type of order'] - type: { - defined: 'OrderType' + "name": "orderType", + "docs": [ + "The type of order" + ], + "type": { + "defined": "OrderType" } }, { - name: 'marketType' - docs: ['Whether market is spot or perp'] - type: { - defined: 'MarketType' + "name": "marketType", + "docs": [ + "Whether market is spot or perp" + ], + "type": { + "defined": "MarketType" } }, { - name: 'userOrderId' - docs: [ - 'User generated order id. Can make it easier to place/cancel orders' - ] - type: 'u8' + "name": "userOrderId", + "docs": [ + "User generated order id. Can make it easier to place/cancel orders" + ], + "type": "u8" }, { - name: 'existingPositionDirection' - docs: ['What the users position was when the order was placed'] - type: { - defined: 'PositionDirection' + "name": "existingPositionDirection", + "docs": [ + "What the users position was when the order was placed" + ], + "type": { + "defined": "PositionDirection" } }, { - name: 'direction' - docs: [ - 'Whether the user is going long or short. LONG = bid, SHORT = ask' - ] - type: { - defined: 'PositionDirection' + "name": "direction", + "docs": [ + "Whether the user is going long or short. LONG = bid, SHORT = ask" + ], + "type": { + "defined": "PositionDirection" } }, { - name: 'reduceOnly' - docs: ['Whether the order is allowed to only reduce position size'] - type: 'bool' + "name": "reduceOnly", + "docs": [ + "Whether the order is allowed to only reduce position size" + ], + "type": "bool" }, { - name: 'postOnly' - docs: ['Whether the order must be a maker'] - type: 'bool' + "name": "postOnly", + "docs": [ + "Whether the order must be a maker" + ], + "type": "bool" }, { - name: 'immediateOrCancel' - docs: [ - 'Whether the order must be canceled the same slot it is placed' - ] - type: 'bool' + "name": "immediateOrCancel", + "docs": [ + "Whether the order must be canceled the same slot it is placed" + ], + "type": "bool" }, { - name: 'triggerCondition' - docs: [ - 'Whether the order is triggered above or below the trigger price. Only relevant for trigger orders' - ] - type: { - defined: 'OrderTriggerCondition' + "name": "triggerCondition", + "docs": [ + "Whether the order is triggered above or below the trigger price. Only relevant for trigger orders" + ], + "type": { + "defined": "OrderTriggerCondition" } }, { - name: 'auctionDuration' - docs: ['How many slots the auction lasts'] - type: 'u8' + "name": "auctionDuration", + "docs": [ + "How many slots the auction lasts" + ], + "type": "u8" }, { - name: 'padding' - type: { - array: ['u8', 3] + "name": "padding", + "type": { + "array": [ + "u8", + 3 + ] } } ] } }, { - name: 'SwapDirection' - type: { - kind: 'enum' - variants: [ + "name": "SwapDirection", + "type": { + "kind": "enum", + "variants": [ { - name: 'Add' + "name": "Add" }, { - name: 'Remove' + "name": "Remove" } ] } }, { - name: 'ModifyOrderId' - type: { - kind: 'enum' - variants: [ + "name": "ModifyOrderId", + "type": { + "kind": "enum", + "variants": [ { - name: 'UserOrderId' - fields: ['u8'] + "name": "UserOrderId", + "fields": [ + "u8" + ] }, { - name: 'OrderId' - fields: ['u32'] + "name": "OrderId", + "fields": [ + "u32" + ] } ] } }, { - name: 'PositionDirection' - type: { - kind: 'enum' - variants: [ + "name": "PositionDirection", + "type": { + "kind": "enum", + "variants": [ { - name: 'Long' + "name": "Long" }, { - name: 'Short' + "name": "Short" } ] } }, { - name: 'SpotFulfillmentType' - type: { - kind: 'enum' - variants: [ + "name": "SpotFulfillmentType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "SerumV3" + }, { - name: 'SerumV3' + "name": "Match" }, { - name: 'Match' + "name": "PhoenixV1" }, { - name: 'PhoenixV1' + "name": "OpenbookV2" } ] } }, { - name: 'SwapReduceOnly' - type: { - kind: 'enum' - variants: [ + "name": "SwapReduceOnly", + "type": { + "kind": "enum", + "variants": [ { - name: 'In' + "name": "In" }, { - name: 'Out' + "name": "Out" } ] } }, { - name: 'TwapPeriod' - type: { - kind: 'enum' - variants: [ + "name": "TwapPeriod", + "type": { + "kind": "enum", + "variants": [ { - name: 'FundingPeriod' + "name": "FundingPeriod" }, { - name: 'FiveMin' + "name": "FiveMin" } ] } }, { - name: 'LiquidationMultiplierType' - type: { - kind: 'enum' - variants: [ + "name": "LiquidationMultiplierType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Discount' + "name": "Discount" }, { - name: 'Premium' + "name": "Premium" } ] } }, { - name: 'MarginRequirementType' - type: { - kind: 'enum' - variants: [ + "name": "MarginRequirementType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Initial' + "name": "Initial" }, { - name: 'Fill' + "name": "Fill" }, { - name: 'Maintenance' + "name": "Maintenance" } ] } }, { - name: 'OracleValidity' - type: { - kind: 'enum' - variants: [ + "name": "OracleValidity", + "type": { + "kind": "enum", + "variants": [ { - name: 'Invalid' + "name": "NonPositive" }, { - name: 'TooVolatile' + "name": "TooVolatile" }, { - name: 'TooUncertain' + "name": "TooUncertain" }, { - name: 'StaleForMargin' + "name": "StaleForMargin" }, { - name: 'InsufficientDataPoints' + "name": "InsufficientDataPoints" }, { - name: 'StaleForAMM' + "name": "StaleForAMM" }, { - name: 'Valid' + "name": "Valid" } ] } }, { - name: 'DriftAction' - type: { - kind: 'enum' - variants: [ + "name": "DriftAction", + "type": { + "kind": "enum", + "variants": [ { - name: 'UpdateFunding' + "name": "UpdateFunding" }, { - name: 'SettlePnl' + "name": "SettlePnl" }, { - name: 'TriggerOrder' + "name": "TriggerOrder" }, { - name: 'FillOrderMatch' + "name": "FillOrderMatch" }, { - name: 'FillOrderAmm' + "name": "FillOrderAmm" }, { - name: 'Liquidate' + "name": "Liquidate" }, { - name: 'MarginCalc' + "name": "MarginCalc" }, { - name: 'UpdateTwap' + "name": "UpdateTwap" }, { - name: 'UpdateAMMCurve' + "name": "UpdateAMMCurve" }, { - name: 'OracleOrderPrice' + "name": "OracleOrderPrice" } ] } }, { - name: 'PositionUpdateType' - type: { - kind: 'enum' - variants: [ + "name": "PositionUpdateType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Open' + "name": "Open" }, { - name: 'Increase' + "name": "Increase" }, { - name: 'Reduce' + "name": "Reduce" }, { - name: 'Close' + "name": "Close" }, { - name: 'Flip' + "name": "Flip" } ] } }, { - name: 'DepositExplanation' - type: { - kind: 'enum' - variants: [ + "name": "DepositExplanation", + "type": { + "kind": "enum", + "variants": [ { - name: 'None' + "name": "None" }, { - name: 'Transfer' + "name": "Transfer" }, { - name: 'Borrow' + "name": "Borrow" }, { - name: 'RepayBorrow' + "name": "RepayBorrow" } ] } }, { - name: 'DepositDirection' - type: { - kind: 'enum' - variants: [ + "name": "DepositDirection", + "type": { + "kind": "enum", + "variants": [ { - name: 'Deposit' + "name": "Deposit" }, { - name: 'Withdraw' + "name": "Withdraw" } ] } }, { - name: 'OrderAction' - type: { - kind: 'enum' - variants: [ + "name": "OrderAction", + "type": { + "kind": "enum", + "variants": [ { - name: 'Place' + "name": "Place" }, { - name: 'Cancel' + "name": "Cancel" }, { - name: 'Fill' + "name": "Fill" }, { - name: 'Trigger' + "name": "Trigger" }, { - name: 'Expire' + "name": "Expire" } ] } }, { - name: 'OrderActionExplanation' - type: { - kind: 'enum' - variants: [ + "name": "OrderActionExplanation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "None" + }, { - name: 'None' + "name": "InsufficientFreeCollateral" }, { - name: 'InsufficientFreeCollateral' + "name": "OraclePriceBreachedLimitPrice" }, { - name: 'OraclePriceBreachedLimitPrice' + "name": "MarketOrderFilledToLimitPrice" }, { - name: 'MarketOrderFilledToLimitPrice' + "name": "OrderExpired" }, { - name: 'OrderExpired' + "name": "Liquidation" }, { - name: 'Liquidation' + "name": "OrderFilledWithAMM" }, { - name: 'OrderFilledWithAMM' + "name": "OrderFilledWithAMMJit" }, { - name: 'OrderFilledWithAMMJit' + "name": "OrderFilledWithMatch" }, { - name: 'OrderFilledWithMatch' + "name": "OrderFilledWithMatchJit" }, { - name: 'OrderFilledWithMatchJit' + "name": "MarketExpired" }, { - name: 'MarketExpired' + "name": "RiskingIncreasingOrder" }, { - name: 'RiskingIncreasingOrder' + "name": "ReduceOnlyOrderIncreasedPosition" }, { - name: 'ReduceOnlyOrderIncreasedPosition' + "name": "OrderFillWithSerum" }, { - name: 'OrderFillWithSerum' + "name": "NoBorrowLiquidity" }, { - name: 'NoBorrowLiquidity' + "name": "OrderFillWithPhoenix" }, { - name: 'OrderFillWithPhoenix' + "name": "OrderFilledWithAMMJitLPSplit" }, { - name: 'OrderFilledWithAMMJitLPSplit' + "name": "OrderFilledWithLPJit" }, { - name: 'OrderFilledWithLPJit' + "name": "DeriskLp" }, { - name: 'DeriskLp' + "name": "OrderFilledWithOpenbookV2" } ] } }, { - name: 'LPAction' - type: { - kind: 'enum' - variants: [ + "name": "LPAction", + "type": { + "kind": "enum", + "variants": [ { - name: 'AddLiquidity' + "name": "AddLiquidity" }, { - name: 'RemoveLiquidity' + "name": "RemoveLiquidity" }, { - name: 'SettleLiquidity' + "name": "SettleLiquidity" }, { - name: 'RemoveLiquidityDerisk' + "name": "RemoveLiquidityDerisk" } ] } }, { - name: 'LiquidationType' - type: { - kind: 'enum' - variants: [ + "name": "LiquidationType", + "type": { + "kind": "enum", + "variants": [ { - name: 'LiquidatePerp' + "name": "LiquidatePerp" }, { - name: 'LiquidateSpot' + "name": "LiquidateSpot" }, { - name: 'LiquidateBorrowForPerpPnl' + "name": "LiquidateBorrowForPerpPnl" }, { - name: 'LiquidatePerpPnlForDeposit' + "name": "LiquidatePerpPnlForDeposit" }, { - name: 'PerpBankruptcy' + "name": "PerpBankruptcy" }, { - name: 'SpotBankruptcy' + "name": "SpotBankruptcy" } ] } }, { - name: 'SettlePnlExplanation' - type: { - kind: 'enum' - variants: [ + "name": "SettlePnlExplanation", + "type": { + "kind": "enum", + "variants": [ { - name: 'None' + "name": "None" }, { - name: 'ExpiredPosition' + "name": "ExpiredPosition" } ] } }, { - name: 'StakeAction' - type: { - kind: 'enum' - variants: [ + "name": "StakeAction", + "type": { + "kind": "enum", + "variants": [ { - name: 'Stake' + "name": "Stake" }, { - name: 'UnstakeRequest' + "name": "UnstakeRequest" }, { - name: 'UnstakeCancelRequest' + "name": "UnstakeCancelRequest" }, { - name: 'Unstake' + "name": "Unstake" }, { - name: 'UnstakeTransfer' + "name": "UnstakeTransfer" }, { - name: 'StakeTransfer' + "name": "StakeTransfer" } ] } }, { - name: 'FillMode' - type: { - kind: 'enum' - variants: [ + "name": "FillMode", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Fill" + }, { - name: 'Fill' + "name": "PlaceAndMake" }, { - name: 'PlaceAndMake' + "name": "PlaceAndTake" }, { - name: 'PlaceAndTake' + "name": "Liquidation" } ] } }, { - name: 'PerpFulfillmentMethod' - type: { - kind: 'enum' - variants: [ + "name": "PerpFulfillmentMethod", + "type": { + "kind": "enum", + "variants": [ { - name: 'AMM' - fields: [ + "name": "AMM", + "fields": [ { - option: 'u64' + "option": "u64" } ] }, { - name: 'Match' - fields: ['publicKey', 'u16'] + "name": "Match", + "fields": [ + "publicKey", + "u16" + ] } ] } }, { - name: 'SpotFulfillmentMethod' - type: { - kind: 'enum' - variants: [ + "name": "SpotFulfillmentMethod", + "type": { + "kind": "enum", + "variants": [ { - name: 'ExternalMarket' + "name": "ExternalMarket" }, { - name: 'Match' + "name": "Match", + "fields": [ + "publicKey", + "u16" + ] } ] } }, { - name: 'MarginCalculationMode' - type: { - kind: 'enum' - variants: [ + "name": "MarginCalculationMode", + "type": { + "kind": "enum", + "variants": [ { - name: 'Standard' - fields: [ + "name": "Standard", + "fields": [ { - name: 'track_open_orders_fraction' - type: 'bool' + "name": "trackOpenOrdersFraction", + "type": "bool" } ] }, { - name: 'Liquidation' - fields: [ + "name": "Liquidation", + "fields": [ { - name: 'market_to_track_margin_requirement' - type: { - option: { - defined: 'MarketIdentifier' + "name": "marketToTrackMarginRequirement", + "type": { + "option": { + "defined": "MarketIdentifier" } } } @@ -8455,13817 +10035,15873 @@ export type Drift = { } }, { - name: 'OracleSource' - type: { - kind: 'enum' - variants: [ + "name": "OracleSource", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Pyth" + }, + { + "name": "Switchboard" + }, + { + "name": "QuoteAsset" + }, + { + "name": "Pyth1K" + }, + { + "name": "Pyth1M" + }, + { + "name": "PythStableCoin" + }, { - name: 'Pyth' + "name": "Prelaunch" }, { - name: 'Switchboard' + "name": "PythPull" }, { - name: 'QuoteAsset' + "name": "Pyth1KPull" }, { - name: 'Pyth1K' + "name": "Pyth1MPull" }, { - name: 'Pyth1M' + "name": "PythStableCoinPull" }, { - name: 'PythStableCoin' + "name": "SwitchboardOnDemand" } ] } }, { - name: 'PostOnlyParam' - type: { - kind: 'enum' - variants: [ + "name": "PostOnlyParam", + "type": { + "kind": "enum", + "variants": [ { - name: 'None' + "name": "None" }, { - name: 'MustPostOnly' + "name": "MustPostOnly" }, { - name: 'TryPostOnly' + "name": "TryPostOnly" }, { - name: 'Slide' + "name": "Slide" } ] } }, { - name: 'ModifyOrderPolicy' - type: { - kind: 'enum' - variants: [ + "name": "ModifyOrderPolicy", + "type": { + "kind": "enum", + "variants": [ { - name: 'TryModify' + "name": "TryModify" }, { - name: 'MustModify' + "name": "MustModify" } ] } }, { - name: 'PerpOperation' - type: { - kind: 'enum' - variants: [ + "name": "PerpOperation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "UpdateFunding" + }, + { + "name": "AmmFill" + }, + { + "name": "Fill" + }, + { + "name": "SettlePnl" + }, { - name: 'UpdateFunding' + "name": "SettlePnlWithPosition" }, { - name: 'AmmFill' + "name": "Liquidation" + } + ] + } + }, + { + "name": "SpotOperation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "UpdateCumulativeInterest" }, { - name: 'Fill' + "name": "Fill" }, { - name: 'SettlePnl' + "name": "Deposit" }, { - name: 'SettlePnlWithPosition' + "name": "Withdraw" }, { - name: 'Liquidation' + "name": "Liquidation" } ] } }, { - name: 'SpotOperation' - type: { - kind: 'enum' - variants: [ + "name": "InsuranceFundOperation", + "type": { + "kind": "enum", + "variants": [ { - name: 'UpdateCumulativeInterest' + "name": "Init" }, { - name: 'Fill' + "name": "Add" }, { - name: 'Withdraw' + "name": "RequestRemove" }, { - name: 'Liquidation' + "name": "Remove" } ] } }, { - name: 'MarketStatus' - type: { - kind: 'enum' - variants: [ + "name": "MarketStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'Initialized' + "name": "Initialized" }, { - name: 'Active' + "name": "Active" }, { - name: 'FundingPaused' + "name": "FundingPaused" }, { - name: 'AmmPaused' + "name": "AmmPaused" }, { - name: 'FillPaused' + "name": "FillPaused" }, { - name: 'WithdrawPaused' + "name": "WithdrawPaused" }, { - name: 'ReduceOnly' + "name": "ReduceOnly" }, { - name: 'Settlement' + "name": "Settlement" }, { - name: 'Delisted' + "name": "Delisted" } ] } }, { - name: 'ContractType' - type: { - kind: 'enum' - variants: [ + "name": "ContractType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Perpetual" + }, { - name: 'Perpetual' + "name": "Future" }, { - name: 'Future' + "name": "Prediction" } ] } }, { - name: 'ContractTier' - type: { - kind: 'enum' - variants: [ + "name": "ContractTier", + "type": { + "kind": "enum", + "variants": [ + { + "name": "A" + }, { - name: 'A' + "name": "B" }, { - name: 'B' + "name": "C" }, { - name: 'C' + "name": "Speculative" }, { - name: 'Speculative' + "name": "HighlySpeculative" }, { - name: 'Isolated' + "name": "Isolated" } ] } }, { - name: 'AMMLiquiditySplit' - type: { - kind: 'enum' - variants: [ + "name": "AMMLiquiditySplit", + "type": { + "kind": "enum", + "variants": [ + { + "name": "ProtocolOwned" + }, { - name: 'ProtocolOwned' + "name": "LPOwned" }, { - name: 'LPOwned' + "name": "Shared" + } + ] + } + }, + { + "name": "SettlePnlMode", + "type": { + "kind": "enum", + "variants": [ + { + "name": "MustSettle" }, { - name: 'Shared' + "name": "TrySettle" } ] } }, { - name: 'SpotBalanceType' - type: { - kind: 'enum' - variants: [ + "name": "SpotBalanceType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Deposit' + "name": "Deposit" }, { - name: 'Borrow' + "name": "Borrow" } ] } }, { - name: 'SpotFulfillmentConfigStatus' - type: { - kind: 'enum' - variants: [ + "name": "SpotFulfillmentConfigStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'Enabled' + "name": "Enabled" }, { - name: 'Disabled' + "name": "Disabled" } ] } }, { - name: 'AssetTier' - type: { - kind: 'enum' - variants: [ + "name": "AssetTier", + "type": { + "kind": "enum", + "variants": [ { - name: 'Collateral' + "name": "Collateral" }, { - name: 'Protected' + "name": "Protected" }, { - name: 'Cross' + "name": "Cross" }, { - name: 'Isolated' + "name": "Isolated" }, { - name: 'Unlisted' + "name": "Unlisted" } ] } }, { - name: 'ExchangeStatus' - type: { - kind: 'enum' - variants: [ + "name": "ExchangeStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'DepositPaused' + "name": "DepositPaused" }, { - name: 'WithdrawPaused' + "name": "WithdrawPaused" }, { - name: 'AmmPaused' + "name": "AmmPaused" }, { - name: 'FillPaused' + "name": "FillPaused" }, { - name: 'LiqPaused' + "name": "LiqPaused" }, { - name: 'FundingPaused' + "name": "FundingPaused" }, { - name: 'SettlePnlPaused' + "name": "SettlePnlPaused" } ] } }, { - name: 'UserStatus' - type: { - kind: 'enum' - variants: [ + "name": "UserStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'BeingLiquidated' + "name": "BeingLiquidated" }, { - name: 'Bankrupt' + "name": "Bankrupt" }, { - name: 'ReduceOnly' + "name": "ReduceOnly" }, { - name: 'AdvancedLp' + "name": "AdvancedLp" } ] } }, { - name: 'AssetType' - type: { - kind: 'enum' - variants: [ + "name": "AssetType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Base' + "name": "Base" }, { - name: 'Quote' + "name": "Quote" } ] } }, { - name: 'OrderStatus' - type: { - kind: 'enum' - variants: [ + "name": "OrderStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'Init' + "name": "Init" }, { - name: 'Open' + "name": "Open" }, { - name: 'Filled' + "name": "Filled" }, { - name: 'Canceled' + "name": "Canceled" } ] } }, { - name: 'OrderType' - type: { - kind: 'enum' - variants: [ + "name": "OrderType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Market' + "name": "Market" }, { - name: 'Limit' + "name": "Limit" }, { - name: 'TriggerMarket' + "name": "TriggerMarket" }, { - name: 'TriggerLimit' + "name": "TriggerLimit" }, { - name: 'Oracle' + "name": "Oracle" } ] } }, { - name: 'OrderTriggerCondition' - type: { - kind: 'enum' - variants: [ + "name": "OrderTriggerCondition", + "type": { + "kind": "enum", + "variants": [ { - name: 'Above' + "name": "Above" }, { - name: 'Below' + "name": "Below" }, { - name: 'TriggeredAbove' + "name": "TriggeredAbove" }, { - name: 'TriggeredBelow' + "name": "TriggeredBelow" } ] } }, { - name: 'MarketType' - type: { - kind: 'enum' - variants: [ + "name": "MarketType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Spot' + "name": "Spot" }, { - name: 'Perp' + "name": "Perp" } ] } } - ] - events: [ + ], + "events": [ { - name: 'NewUserRecord' - fields: [ + "name": "NewUserRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority' - type: 'publicKey' - index: false + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'subAccountId' - type: 'u16' - index: false + "name": "subAccountId", + "type": "u16", + "index": false }, { - name: 'name' - type: { - array: ['u8', 32] - } - index: false + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + }, + "index": false }, { - name: 'referrer' - type: 'publicKey' - index: false + "name": "referrer", + "type": "publicKey", + "index": false } ] }, { - name: 'DepositRecord' - fields: [ + "name": "DepositRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority' - type: 'publicKey' - index: false + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'direction' - type: { - defined: 'DepositDirection' - } - index: false + "name": "direction", + "type": { + "defined": "DepositDirection" + }, + "index": false }, { - name: 'depositRecordId' - type: 'u64' - index: false + "name": "depositRecordId", + "type": "u64", + "index": false }, { - name: 'amount' - type: 'u64' - index: false + "name": "amount", + "type": "u64", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'oraclePrice' - type: 'i64' - index: false + "name": "oraclePrice", + "type": "i64", + "index": false }, { - name: 'marketDepositBalance' - type: 'u128' - index: false + "name": "marketDepositBalance", + "type": "u128", + "index": false }, { - name: 'marketWithdrawBalance' - type: 'u128' - index: false + "name": "marketWithdrawBalance", + "type": "u128", + "index": false }, { - name: 'marketCumulativeDepositInterest' - type: 'u128' - index: false + "name": "marketCumulativeDepositInterest", + "type": "u128", + "index": false }, { - name: 'marketCumulativeBorrowInterest' - type: 'u128' - index: false + "name": "marketCumulativeBorrowInterest", + "type": "u128", + "index": false }, { - name: 'totalDepositsAfter' - type: 'u64' - index: false + "name": "totalDepositsAfter", + "type": "u64", + "index": false }, { - name: 'totalWithdrawsAfter' - type: 'u64' - index: false + "name": "totalWithdrawsAfter", + "type": "u64", + "index": false }, { - name: 'explanation' - type: { - defined: 'DepositExplanation' - } - index: false + "name": "explanation", + "type": { + "defined": "DepositExplanation" + }, + "index": false }, { - name: 'transferUser' - type: { - option: 'publicKey' - } - index: false + "name": "transferUser", + "type": { + "option": "publicKey" + }, + "index": false } ] }, { - name: 'SpotInterestRecord' - fields: [ + "name": "SpotInterestRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'depositBalance' - type: 'u128' - index: false + "name": "depositBalance", + "type": "u128", + "index": false }, { - name: 'cumulativeDepositInterest' - type: 'u128' - index: false + "name": "cumulativeDepositInterest", + "type": "u128", + "index": false }, { - name: 'borrowBalance' - type: 'u128' - index: false + "name": "borrowBalance", + "type": "u128", + "index": false }, { - name: 'cumulativeBorrowInterest' - type: 'u128' - index: false + "name": "cumulativeBorrowInterest", + "type": "u128", + "index": false }, { - name: 'optimalUtilization' - type: 'u32' - index: false + "name": "optimalUtilization", + "type": "u32", + "index": false }, { - name: 'optimalBorrowRate' - type: 'u32' - index: false + "name": "optimalBorrowRate", + "type": "u32", + "index": false }, { - name: 'maxBorrowRate' - type: 'u32' - index: false + "name": "maxBorrowRate", + "type": "u32", + "index": false } ] }, { - name: 'FundingPaymentRecord' - fields: [ + "name": "FundingPaymentRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority' - type: 'publicKey' - index: false + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'fundingPayment' - type: 'i64' - index: false + "name": "fundingPayment", + "type": "i64", + "index": false }, { - name: 'baseAssetAmount' - type: 'i64' - index: false + "name": "baseAssetAmount", + "type": "i64", + "index": false }, { - name: 'userLastCumulativeFunding' - type: 'i64' - index: false + "name": "userLastCumulativeFunding", + "type": "i64", + "index": false }, { - name: 'ammCumulativeFundingLong' - type: 'i128' - index: false + "name": "ammCumulativeFundingLong", + "type": "i128", + "index": false }, { - name: 'ammCumulativeFundingShort' - type: 'i128' - index: false + "name": "ammCumulativeFundingShort", + "type": "i128", + "index": false } ] }, { - name: 'FundingRateRecord' - fields: [ + "name": "FundingRateRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'recordId' - type: 'u64' - index: false + "name": "recordId", + "type": "u64", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'fundingRate' - type: 'i64' - index: false + "name": "fundingRate", + "type": "i64", + "index": false }, { - name: 'fundingRateLong' - type: 'i128' - index: false + "name": "fundingRateLong", + "type": "i128", + "index": false }, { - name: 'fundingRateShort' - type: 'i128' - index: false + "name": "fundingRateShort", + "type": "i128", + "index": false }, { - name: 'cumulativeFundingRateLong' - type: 'i128' - index: false + "name": "cumulativeFundingRateLong", + "type": "i128", + "index": false }, { - name: 'cumulativeFundingRateShort' - type: 'i128' - index: false + "name": "cumulativeFundingRateShort", + "type": "i128", + "index": false }, { - name: 'oraclePriceTwap' - type: 'i64' - index: false + "name": "oraclePriceTwap", + "type": "i64", + "index": false }, { - name: 'markPriceTwap' - type: 'u64' - index: false + "name": "markPriceTwap", + "type": "u64", + "index": false }, { - name: 'periodRevenue' - type: 'i64' - index: false + "name": "periodRevenue", + "type": "i64", + "index": false }, { - name: 'baseAssetAmountWithAmm' - type: 'i128' - index: false + "name": "baseAssetAmountWithAmm", + "type": "i128", + "index": false }, { - name: 'baseAssetAmountWithUnsettledLp' - type: 'i128' - index: false + "name": "baseAssetAmountWithUnsettledLp", + "type": "i128", + "index": false } ] }, { - name: 'CurveRecord' - fields: [ + "name": "CurveRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'recordId' - type: 'u64' - index: false + "name": "recordId", + "type": "u64", + "index": false }, { - name: 'pegMultiplierBefore' - type: 'u128' - index: false + "name": "pegMultiplierBefore", + "type": "u128", + "index": false }, { - name: 'baseAssetReserveBefore' - type: 'u128' - index: false + "name": "baseAssetReserveBefore", + "type": "u128", + "index": false }, { - name: 'quoteAssetReserveBefore' - type: 'u128' - index: false + "name": "quoteAssetReserveBefore", + "type": "u128", + "index": false }, { - name: 'sqrtKBefore' - type: 'u128' - index: false + "name": "sqrtKBefore", + "type": "u128", + "index": false }, { - name: 'pegMultiplierAfter' - type: 'u128' - index: false + "name": "pegMultiplierAfter", + "type": "u128", + "index": false }, { - name: 'baseAssetReserveAfter' - type: 'u128' - index: false + "name": "baseAssetReserveAfter", + "type": "u128", + "index": false }, { - name: 'quoteAssetReserveAfter' - type: 'u128' - index: false + "name": "quoteAssetReserveAfter", + "type": "u128", + "index": false }, { - name: 'sqrtKAfter' - type: 'u128' - index: false + "name": "sqrtKAfter", + "type": "u128", + "index": false }, { - name: 'baseAssetAmountLong' - type: 'u128' - index: false + "name": "baseAssetAmountLong", + "type": "u128", + "index": false }, { - name: 'baseAssetAmountShort' - type: 'u128' - index: false + "name": "baseAssetAmountShort", + "type": "u128", + "index": false }, { - name: 'baseAssetAmountWithAmm' - type: 'i128' - index: false + "name": "baseAssetAmountWithAmm", + "type": "i128", + "index": false }, { - name: 'totalFee' - type: 'i128' - index: false + "name": "totalFee", + "type": "i128", + "index": false }, { - name: 'totalFeeMinusDistributions' - type: 'i128' - index: false + "name": "totalFeeMinusDistributions", + "type": "i128", + "index": false }, { - name: 'adjustmentCost' - type: 'i128' - index: false + "name": "adjustmentCost", + "type": "i128", + "index": false }, { - name: 'oraclePrice' - type: 'i64' - index: false + "name": "oraclePrice", + "type": "i64", + "index": false }, { - name: 'fillRecord' - type: 'u128' - index: false + "name": "fillRecord", + "type": "u128", + "index": false }, { - name: 'numberOfUsers' - type: 'u32' - index: false + "name": "numberOfUsers", + "type": "u32", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false } ] }, { - name: 'OrderRecord' - fields: [ + "name": "OrderRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'order' - type: { - defined: 'Order' - } - index: false + "name": "order", + "type": { + "defined": "Order" + }, + "index": false } ] }, { - name: 'OrderActionRecord' - fields: [ + "name": "OrderActionRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'action' - type: { - defined: 'OrderAction' - } - index: false + "name": "action", + "type": { + "defined": "OrderAction" + }, + "index": false }, { - name: 'actionExplanation' - type: { - defined: 'OrderActionExplanation' - } - index: false + "name": "actionExplanation", + "type": { + "defined": "OrderActionExplanation" + }, + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'marketType' - type: { - defined: 'MarketType' - } - index: false + "name": "marketType", + "type": { + "defined": "MarketType" + }, + "index": false }, { - name: 'filler' - type: { - option: 'publicKey' - } - index: false + "name": "filler", + "type": { + "option": "publicKey" + }, + "index": false }, { - name: 'fillerReward' - type: { - option: 'u64' - } - index: false + "name": "fillerReward", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'fillRecordId' - type: { - option: 'u64' - } - index: false + "name": "fillRecordId", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'baseAssetAmountFilled' - type: { - option: 'u64' - } - index: false + "name": "baseAssetAmountFilled", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'quoteAssetAmountFilled' - type: { - option: 'u64' - } - index: false + "name": "quoteAssetAmountFilled", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'takerFee' - type: { - option: 'u64' - } - index: false + "name": "takerFee", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'makerFee' - type: { - option: 'i64' - } - index: false + "name": "makerFee", + "type": { + "option": "i64" + }, + "index": false }, { - name: 'referrerReward' - type: { - option: 'u32' - } - index: false + "name": "referrerReward", + "type": { + "option": "u32" + }, + "index": false }, { - name: 'quoteAssetAmountSurplus' - type: { - option: 'i64' - } - index: false + "name": "quoteAssetAmountSurplus", + "type": { + "option": "i64" + }, + "index": false }, { - name: 'spotFulfillmentMethodFee' - type: { - option: 'u64' - } - index: false + "name": "spotFulfillmentMethodFee", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'taker' - type: { - option: 'publicKey' - } - index: false + "name": "taker", + "type": { + "option": "publicKey" + }, + "index": false }, { - name: 'takerOrderId' - type: { - option: 'u32' - } - index: false + "name": "takerOrderId", + "type": { + "option": "u32" + }, + "index": false }, { - name: 'takerOrderDirection' - type: { - option: { - defined: 'PositionDirection' + "name": "takerOrderDirection", + "type": { + "option": { + "defined": "PositionDirection" } - } - index: false + }, + "index": false }, { - name: 'takerOrderBaseAssetAmount' - type: { - option: 'u64' - } - index: false + "name": "takerOrderBaseAssetAmount", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'takerOrderCumulativeBaseAssetAmountFilled' - type: { - option: 'u64' - } - index: false + "name": "takerOrderCumulativeBaseAssetAmountFilled", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'takerOrderCumulativeQuoteAssetAmountFilled' - type: { - option: 'u64' - } - index: false + "name": "takerOrderCumulativeQuoteAssetAmountFilled", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'maker' - type: { - option: 'publicKey' - } - index: false + "name": "maker", + "type": { + "option": "publicKey" + }, + "index": false }, { - name: 'makerOrderId' - type: { - option: 'u32' - } - index: false + "name": "makerOrderId", + "type": { + "option": "u32" + }, + "index": false }, { - name: 'makerOrderDirection' - type: { - option: { - defined: 'PositionDirection' + "name": "makerOrderDirection", + "type": { + "option": { + "defined": "PositionDirection" } - } - index: false + }, + "index": false }, { - name: 'makerOrderBaseAssetAmount' - type: { - option: 'u64' - } - index: false + "name": "makerOrderBaseAssetAmount", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'makerOrderCumulativeBaseAssetAmountFilled' - type: { - option: 'u64' - } - index: false + "name": "makerOrderCumulativeBaseAssetAmountFilled", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'makerOrderCumulativeQuoteAssetAmountFilled' - type: { - option: 'u64' - } - index: false + "name": "makerOrderCumulativeQuoteAssetAmountFilled", + "type": { + "option": "u64" + }, + "index": false }, { - name: 'oraclePrice' - type: 'i64' - index: false + "name": "oraclePrice", + "type": "i64", + "index": false } ] }, { - name: 'LPRecord' - fields: [ + "name": "LPRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'action' - type: { - defined: 'LPAction' - } - index: false + "name": "action", + "type": { + "defined": "LPAction" + }, + "index": false }, { - name: 'nShares' - type: 'u64' - index: false + "name": "nShares", + "type": "u64", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'deltaBaseAssetAmount' - type: 'i64' - index: false + "name": "deltaBaseAssetAmount", + "type": "i64", + "index": false }, { - name: 'deltaQuoteAssetAmount' - type: 'i64' - index: false + "name": "deltaQuoteAssetAmount", + "type": "i64", + "index": false }, { - name: 'pnl' - type: 'i64' - index: false + "name": "pnl", + "type": "i64", + "index": false } ] }, { - name: 'LiquidationRecord' - fields: [ + "name": "LiquidationRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'liquidationType' - type: { - defined: 'LiquidationType' - } - index: false + "name": "liquidationType", + "type": { + "defined": "LiquidationType" + }, + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'liquidator' - type: 'publicKey' - index: false + "name": "liquidator", + "type": "publicKey", + "index": false }, { - name: 'marginRequirement' - type: 'u128' - index: false + "name": "marginRequirement", + "type": "u128", + "index": false }, { - name: 'totalCollateral' - type: 'i128' - index: false + "name": "totalCollateral", + "type": "i128", + "index": false }, { - name: 'marginFreed' - type: 'u64' - index: false + "name": "marginFreed", + "type": "u64", + "index": false }, { - name: 'liquidationId' - type: 'u16' - index: false + "name": "liquidationId", + "type": "u16", + "index": false }, { - name: 'bankrupt' - type: 'bool' - index: false + "name": "bankrupt", + "type": "bool", + "index": false }, { - name: 'canceledOrderIds' - type: { - vec: 'u32' - } - index: false + "name": "canceledOrderIds", + "type": { + "vec": "u32" + }, + "index": false }, { - name: 'liquidatePerp' - type: { - defined: 'LiquidatePerpRecord' - } - index: false + "name": "liquidatePerp", + "type": { + "defined": "LiquidatePerpRecord" + }, + "index": false }, { - name: 'liquidateSpot' - type: { - defined: 'LiquidateSpotRecord' - } - index: false + "name": "liquidateSpot", + "type": { + "defined": "LiquidateSpotRecord" + }, + "index": false }, { - name: 'liquidateBorrowForPerpPnl' - type: { - defined: 'LiquidateBorrowForPerpPnlRecord' - } - index: false + "name": "liquidateBorrowForPerpPnl", + "type": { + "defined": "LiquidateBorrowForPerpPnlRecord" + }, + "index": false }, { - name: 'liquidatePerpPnlForDeposit' - type: { - defined: 'LiquidatePerpPnlForDepositRecord' - } - index: false + "name": "liquidatePerpPnlForDeposit", + "type": { + "defined": "LiquidatePerpPnlForDepositRecord" + }, + "index": false }, { - name: 'perpBankruptcy' - type: { - defined: 'PerpBankruptcyRecord' - } - index: false + "name": "perpBankruptcy", + "type": { + "defined": "PerpBankruptcyRecord" + }, + "index": false }, { - name: 'spotBankruptcy' - type: { - defined: 'SpotBankruptcyRecord' - } - index: false + "name": "spotBankruptcy", + "type": { + "defined": "SpotBankruptcyRecord" + }, + "index": false } ] }, { - name: 'SettlePnlRecord' - fields: [ + "name": "SettlePnlRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'pnl' - type: 'i128' - index: false + "name": "pnl", + "type": "i128", + "index": false }, { - name: 'baseAssetAmount' - type: 'i64' - index: false + "name": "baseAssetAmount", + "type": "i64", + "index": false }, { - name: 'quoteAssetAmountAfter' - type: 'i64' - index: false + "name": "quoteAssetAmountAfter", + "type": "i64", + "index": false }, { - name: 'quoteEntryAmount' - type: 'i64' - index: false + "name": "quoteEntryAmount", + "type": "i64", + "index": false }, { - name: 'settlePrice' - type: 'i64' - index: false + "name": "settlePrice", + "type": "i64", + "index": false }, { - name: 'explanation' - type: { - defined: 'SettlePnlExplanation' - } - index: false + "name": "explanation", + "type": { + "defined": "SettlePnlExplanation" + }, + "index": false } ] }, { - name: 'InsuranceFundRecord' - fields: [ + "name": "InsuranceFundRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'spotMarketIndex' - type: 'u16' - index: false + "name": "spotMarketIndex", + "type": "u16", + "index": false }, { - name: 'perpMarketIndex' - type: 'u16' - index: false + "name": "perpMarketIndex", + "type": "u16", + "index": false }, { - name: 'userIfFactor' - type: 'u32' - index: false + "name": "userIfFactor", + "type": "u32", + "index": false }, { - name: 'totalIfFactor' - type: 'u32' - index: false + "name": "totalIfFactor", + "type": "u32", + "index": false }, { - name: 'vaultAmountBefore' - type: 'u64' - index: false + "name": "vaultAmountBefore", + "type": "u64", + "index": false }, { - name: 'insuranceVaultAmountBefore' - type: 'u64' - index: false + "name": "insuranceVaultAmountBefore", + "type": "u64", + "index": false }, { - name: 'totalIfSharesBefore' - type: 'u128' - index: false + "name": "totalIfSharesBefore", + "type": "u128", + "index": false }, { - name: 'totalIfSharesAfter' - type: 'u128' - index: false + "name": "totalIfSharesAfter", + "type": "u128", + "index": false }, { - name: 'amount' - type: 'i64' - index: false + "name": "amount", + "type": "i64", + "index": false } ] }, { - name: 'InsuranceFundStakeRecord' - fields: [ + "name": "InsuranceFundStakeRecord", + "fields": [ { - name: 'ts' - type: 'i64' - index: false + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority' - type: 'publicKey' - index: false + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'action' - type: { - defined: 'StakeAction' - } - index: false + "name": "action", + "type": { + "defined": "StakeAction" + }, + "index": false }, { - name: 'amount' - type: 'u64' - index: false + "name": "amount", + "type": "u64", + "index": false }, { - name: 'marketIndex' - type: 'u16' - index: false + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'insuranceVaultAmountBefore' - type: 'u64' - index: false + "name": "insuranceVaultAmountBefore", + "type": "u64", + "index": false }, { - name: 'ifSharesBefore' - type: 'u128' - index: false + "name": "ifSharesBefore", + "type": "u128", + "index": false }, { - name: 'userIfSharesBefore' - type: 'u128' - index: false + "name": "userIfSharesBefore", + "type": "u128", + "index": false }, { - name: 'totalIfSharesBefore' - type: 'u128' - index: false + "name": "totalIfSharesBefore", + "type": "u128", + "index": false }, { - name: 'ifSharesAfter' - type: 'u128' - index: false + "name": "ifSharesAfter", + "type": "u128", + "index": false }, { - name: 'userIfSharesAfter' - type: 'u128' - index: false + "name": "userIfSharesAfter", + "type": "u128", + "index": false }, { - name: 'totalIfSharesAfter' - type: 'u128' - index: false + "name": "totalIfSharesAfter", + "type": "u128", + "index": false } ] }, { - name: 'SwapRecord' - fields: [ + "name": "SwapRecord", + "fields": [ + { + "name": "ts", + "type": "i64", + "index": false + }, + { + "name": "user", + "type": "publicKey", + "index": false + }, { - name: 'ts' - type: 'i64' - index: false + "name": "amountOut", + "type": "u64", + "index": false }, { - name: 'user' - type: 'publicKey' - index: false + "name": "amountIn", + "type": "u64", + "index": false }, { - name: 'amountOut' - type: 'u64' - index: false + "name": "outMarketIndex", + "type": "u16", + "index": false }, { - name: 'amountIn' - type: 'u64' - index: false + "name": "inMarketIndex", + "type": "u16", + "index": false }, { - name: 'outMarketIndex' - type: 'u16' - index: false + "name": "outOraclePrice", + "type": "i64", + "index": false }, { - name: 'inMarketIndex' - type: 'u16' - index: false + "name": "inOraclePrice", + "type": "i64", + "index": false }, { - name: 'outOraclePrice' - type: 'i64' - index: false + "name": "fee", + "type": "u64", + "index": false + } + ] + }, + { + "name": "SpotMarketVaultDepositRecord", + "fields": [ + { + "name": "ts", + "type": "i64", + "index": false + }, + { + "name": "marketIndex", + "type": "u16", + "index": false + }, + { + "name": "depositBalance", + "type": "u128", + "index": false + }, + { + "name": "cumulativeDepositInterestBefore", + "type": "u128", + "index": false + }, + { + "name": "cumulativeDepositInterestAfter", + "type": "u128", + "index": false }, { - name: 'inOraclePrice' - type: 'i64' - index: false + "name": "depositTokenAmountBefore", + "type": "u64", + "index": false }, { - name: 'fee' - type: 'u64' - index: false + "name": "amount", + "type": "u64", + "index": false } ] } - ] - errors: [ + ], + "errors": [ + { + "code": 6000, + "name": "InvalidSpotMarketAuthority", + "msg": "Invalid Spot Market Authority" + }, + { + "code": 6001, + "name": "InvalidInsuranceFundAuthority", + "msg": "Clearing house not insurance fund authority" + }, + { + "code": 6002, + "name": "InsufficientDeposit", + "msg": "Insufficient deposit" + }, + { + "code": 6003, + "name": "InsufficientCollateral", + "msg": "Insufficient collateral" + }, + { + "code": 6004, + "name": "SufficientCollateral", + "msg": "Sufficient collateral" + }, + { + "code": 6005, + "name": "MaxNumberOfPositions", + "msg": "Max number of positions taken" + }, + { + "code": 6006, + "name": "AdminControlsPricesDisabled", + "msg": "Admin Controls Prices Disabled" + }, + { + "code": 6007, + "name": "MarketDelisted", + "msg": "Market Delisted" + }, + { + "code": 6008, + "name": "MarketIndexAlreadyInitialized", + "msg": "Market Index Already Initialized" + }, + { + "code": 6009, + "name": "UserAccountAndUserPositionsAccountMismatch", + "msg": "User Account And User Positions Account Mismatch" + }, + { + "code": 6010, + "name": "UserHasNoPositionInMarket", + "msg": "User Has No Position In Market" + }, + { + "code": 6011, + "name": "InvalidInitialPeg", + "msg": "Invalid Initial Peg" + }, + { + "code": 6012, + "name": "InvalidRepegRedundant", + "msg": "AMM repeg already configured with amt given" + }, + { + "code": 6013, + "name": "InvalidRepegDirection", + "msg": "AMM repeg incorrect repeg direction" + }, + { + "code": 6014, + "name": "InvalidRepegProfitability", + "msg": "AMM repeg out of bounds pnl" + }, + { + "code": 6015, + "name": "SlippageOutsideLimit", + "msg": "Slippage Outside Limit Price" + }, + { + "code": 6016, + "name": "OrderSizeTooSmall", + "msg": "Order Size Too Small" + }, + { + "code": 6017, + "name": "InvalidUpdateK", + "msg": "Price change too large when updating K" + }, + { + "code": 6018, + "name": "AdminWithdrawTooLarge", + "msg": "Admin tried to withdraw amount larger than fees collected" + }, + { + "code": 6019, + "name": "MathError", + "msg": "Math Error" + }, + { + "code": 6020, + "name": "BnConversionError", + "msg": "Conversion to u128/u64 failed with an overflow or underflow" + }, + { + "code": 6021, + "name": "ClockUnavailable", + "msg": "Clock unavailable" + }, + { + "code": 6022, + "name": "UnableToLoadOracle", + "msg": "Unable To Load Oracles" + }, + { + "code": 6023, + "name": "PriceBandsBreached", + "msg": "Price Bands Breached" + }, + { + "code": 6024, + "name": "ExchangePaused", + "msg": "Exchange is paused" + }, + { + "code": 6025, + "name": "InvalidWhitelistToken", + "msg": "Invalid whitelist token" + }, + { + "code": 6026, + "name": "WhitelistTokenNotFound", + "msg": "Whitelist token not found" + }, { - code: 6000 - name: 'InvalidSpotMarketAuthority' - msg: 'Invalid Spot Market Authority' + "code": 6027, + "name": "InvalidDiscountToken", + "msg": "Invalid discount token" }, { - code: 6001 - name: 'InvalidInsuranceFundAuthority' - msg: 'Clearing house not insurance fund authority' + "code": 6028, + "name": "DiscountTokenNotFound", + "msg": "Discount token not found" }, { - code: 6002 - name: 'InsufficientDeposit' - msg: 'Insufficient deposit' + "code": 6029, + "name": "ReferrerNotFound", + "msg": "Referrer not found" }, { - code: 6003 - name: 'InsufficientCollateral' - msg: 'Insufficient collateral' + "code": 6030, + "name": "ReferrerStatsNotFound", + "msg": "ReferrerNotFound" }, { - code: 6004 - name: 'SufficientCollateral' - msg: 'Sufficient collateral' + "code": 6031, + "name": "ReferrerMustBeWritable", + "msg": "ReferrerMustBeWritable" }, { - code: 6005 - name: 'MaxNumberOfPositions' - msg: 'Max number of positions taken' + "code": 6032, + "name": "ReferrerStatsMustBeWritable", + "msg": "ReferrerMustBeWritable" }, { - code: 6006 - name: 'AdminControlsPricesDisabled' - msg: 'Admin Controls Prices Disabled' + "code": 6033, + "name": "ReferrerAndReferrerStatsAuthorityUnequal", + "msg": "ReferrerAndReferrerStatsAuthorityUnequal" }, { - code: 6007 - name: 'MarketDelisted' - msg: 'Market Delisted' + "code": 6034, + "name": "InvalidReferrer", + "msg": "InvalidReferrer" }, { - code: 6008 - name: 'MarketIndexAlreadyInitialized' - msg: 'Market Index Already Initialized' + "code": 6035, + "name": "InvalidOracle", + "msg": "InvalidOracle" }, { - code: 6009 - name: 'UserAccountAndUserPositionsAccountMismatch' - msg: 'User Account And User Positions Account Mismatch' + "code": 6036, + "name": "OracleNotFound", + "msg": "OracleNotFound" }, { - code: 6010 - name: 'UserHasNoPositionInMarket' - msg: 'User Has No Position In Market' + "code": 6037, + "name": "LiquidationsBlockedByOracle", + "msg": "Liquidations Blocked By Oracle" }, { - code: 6011 - name: 'InvalidInitialPeg' - msg: 'Invalid Initial Peg' + "code": 6038, + "name": "MaxDeposit", + "msg": "Can not deposit more than max deposit" }, { - code: 6012 - name: 'InvalidRepegRedundant' - msg: 'AMM repeg already configured with amt given' + "code": 6039, + "name": "CantDeleteUserWithCollateral", + "msg": "Can not delete user that still has collateral" }, { - code: 6013 - name: 'InvalidRepegDirection' - msg: 'AMM repeg incorrect repeg direction' + "code": 6040, + "name": "InvalidFundingProfitability", + "msg": "AMM funding out of bounds pnl" }, { - code: 6014 - name: 'InvalidRepegProfitability' - msg: 'AMM repeg out of bounds pnl' + "code": 6041, + "name": "CastingFailure", + "msg": "Casting Failure" }, { - code: 6015 - name: 'SlippageOutsideLimit' - msg: 'Slippage Outside Limit Price' + "code": 6042, + "name": "InvalidOrder", + "msg": "InvalidOrder" }, { - code: 6016 - name: 'OrderSizeTooSmall' - msg: 'Order Size Too Small' + "code": 6043, + "name": "InvalidOrderMaxTs", + "msg": "InvalidOrderMaxTs" }, { - code: 6017 - name: 'InvalidUpdateK' - msg: 'Price change too large when updating K' + "code": 6044, + "name": "InvalidOrderMarketType", + "msg": "InvalidOrderMarketType" }, { - code: 6018 - name: 'AdminWithdrawTooLarge' - msg: 'Admin tried to withdraw amount larger than fees collected' + "code": 6045, + "name": "InvalidOrderForInitialMarginReq", + "msg": "InvalidOrderForInitialMarginReq" }, { - code: 6019 - name: 'MathError' - msg: 'Math Error' + "code": 6046, + "name": "InvalidOrderNotRiskReducing", + "msg": "InvalidOrderNotRiskReducing" }, { - code: 6020 - name: 'BnConversionError' - msg: 'Conversion to u128/u64 failed with an overflow or underflow' + "code": 6047, + "name": "InvalidOrderSizeTooSmall", + "msg": "InvalidOrderSizeTooSmall" }, { - code: 6021 - name: 'ClockUnavailable' - msg: 'Clock unavailable' + "code": 6048, + "name": "InvalidOrderNotStepSizeMultiple", + "msg": "InvalidOrderNotStepSizeMultiple" }, { - code: 6022 - name: 'UnableToLoadOracle' - msg: 'Unable To Load Oracles' + "code": 6049, + "name": "InvalidOrderBaseQuoteAsset", + "msg": "InvalidOrderBaseQuoteAsset" }, { - code: 6023 - name: 'PriceBandsBreached' - msg: 'Price Bands Breached' + "code": 6050, + "name": "InvalidOrderIOC", + "msg": "InvalidOrderIOC" }, { - code: 6024 - name: 'ExchangePaused' - msg: 'Exchange is paused' + "code": 6051, + "name": "InvalidOrderPostOnly", + "msg": "InvalidOrderPostOnly" }, { - code: 6025 - name: 'InvalidWhitelistToken' - msg: 'Invalid whitelist token' + "code": 6052, + "name": "InvalidOrderIOCPostOnly", + "msg": "InvalidOrderIOCPostOnly" }, { - code: 6026 - name: 'WhitelistTokenNotFound' - msg: 'Whitelist token not found' + "code": 6053, + "name": "InvalidOrderTrigger", + "msg": "InvalidOrderTrigger" }, { - code: 6027 - name: 'InvalidDiscountToken' - msg: 'Invalid discount token' + "code": 6054, + "name": "InvalidOrderAuction", + "msg": "InvalidOrderAuction" }, { - code: 6028 - name: 'DiscountTokenNotFound' - msg: 'Discount token not found' + "code": 6055, + "name": "InvalidOrderOracleOffset", + "msg": "InvalidOrderOracleOffset" }, { - code: 6029 - name: 'ReferrerNotFound' - msg: 'Referrer not found' + "code": 6056, + "name": "InvalidOrderMinOrderSize", + "msg": "InvalidOrderMinOrderSize" }, { - code: 6030 - name: 'ReferrerStatsNotFound' - msg: 'ReferrerNotFound' + "code": 6057, + "name": "PlacePostOnlyLimitFailure", + "msg": "Failed to Place Post-Only Limit Order" }, { - code: 6031 - name: 'ReferrerMustBeWritable' - msg: 'ReferrerMustBeWritable' + "code": 6058, + "name": "UserHasNoOrder", + "msg": "User has no order" }, { - code: 6032 - name: 'ReferrerStatsMustBeWritable' - msg: 'ReferrerMustBeWritable' + "code": 6059, + "name": "OrderAmountTooSmall", + "msg": "Order Amount Too Small" }, { - code: 6033 - name: 'ReferrerAndReferrerStatsAuthorityUnequal' - msg: 'ReferrerAndReferrerStatsAuthorityUnequal' + "code": 6060, + "name": "MaxNumberOfOrders", + "msg": "Max number of orders taken" }, { - code: 6034 - name: 'InvalidReferrer' - msg: 'InvalidReferrer' + "code": 6061, + "name": "OrderDoesNotExist", + "msg": "Order does not exist" }, { - code: 6035 - name: 'InvalidOracle' - msg: 'InvalidOracle' + "code": 6062, + "name": "OrderNotOpen", + "msg": "Order not open" }, { - code: 6036 - name: 'OracleNotFound' - msg: 'OracleNotFound' + "code": 6063, + "name": "FillOrderDidNotUpdateState", + "msg": "FillOrderDidNotUpdateState" }, { - code: 6037 - name: 'LiquidationsBlockedByOracle' - msg: 'Liquidations Blocked By Oracle' + "code": 6064, + "name": "ReduceOnlyOrderIncreasedRisk", + "msg": "Reduce only order increased risk" }, { - code: 6038 - name: 'MaxDeposit' - msg: 'Can not deposit more than max deposit' + "code": 6065, + "name": "UnableToLoadAccountLoader", + "msg": "Unable to load AccountLoader" }, { - code: 6039 - name: 'CantDeleteUserWithCollateral' - msg: 'Can not delete user that still has collateral' + "code": 6066, + "name": "TradeSizeTooLarge", + "msg": "Trade Size Too Large" }, { - code: 6040 - name: 'InvalidFundingProfitability' - msg: 'AMM funding out of bounds pnl' + "code": 6067, + "name": "UserCantReferThemselves", + "msg": "User cant refer themselves" }, { - code: 6041 - name: 'CastingFailure' - msg: 'Casting Failure' + "code": 6068, + "name": "DidNotReceiveExpectedReferrer", + "msg": "Did not receive expected referrer" }, { - code: 6042 - name: 'InvalidOrder' - msg: 'InvalidOrder' + "code": 6069, + "name": "CouldNotDeserializeReferrer", + "msg": "Could not deserialize referrer" }, { - code: 6043 - name: 'InvalidOrderMaxTs' - msg: 'InvalidOrderMaxTs' + "code": 6070, + "name": "CouldNotDeserializeReferrerStats", + "msg": "Could not deserialize referrer stats" }, { - code: 6044 - name: 'InvalidOrderMarketType' - msg: 'InvalidOrderMarketType' + "code": 6071, + "name": "UserOrderIdAlreadyInUse", + "msg": "User Order Id Already In Use" }, { - code: 6045 - name: 'InvalidOrderForInitialMarginReq' - msg: 'InvalidOrderForInitialMarginReq' + "code": 6072, + "name": "NoPositionsLiquidatable", + "msg": "No positions liquidatable" }, { - code: 6046 - name: 'InvalidOrderNotRiskReducing' - msg: 'InvalidOrderNotRiskReducing' + "code": 6073, + "name": "InvalidMarginRatio", + "msg": "Invalid Margin Ratio" }, { - code: 6047 - name: 'InvalidOrderSizeTooSmall' - msg: 'InvalidOrderSizeTooSmall' + "code": 6074, + "name": "CantCancelPostOnlyOrder", + "msg": "Cant Cancel Post Only Order" }, { - code: 6048 - name: 'InvalidOrderNotStepSizeMultiple' - msg: 'InvalidOrderNotStepSizeMultiple' + "code": 6075, + "name": "InvalidOracleOffset", + "msg": "InvalidOracleOffset" }, { - code: 6049 - name: 'InvalidOrderBaseQuoteAsset' - msg: 'InvalidOrderBaseQuoteAsset' + "code": 6076, + "name": "CantExpireOrders", + "msg": "CantExpireOrders" }, { - code: 6050 - name: 'InvalidOrderIOC' - msg: 'InvalidOrderIOC' + "code": 6077, + "name": "CouldNotLoadMarketData", + "msg": "CouldNotLoadMarketData" }, { - code: 6051 - name: 'InvalidOrderPostOnly' - msg: 'InvalidOrderPostOnly' + "code": 6078, + "name": "PerpMarketNotFound", + "msg": "PerpMarketNotFound" }, { - code: 6052 - name: 'InvalidOrderIOCPostOnly' - msg: 'InvalidOrderIOCPostOnly' + "code": 6079, + "name": "InvalidMarketAccount", + "msg": "InvalidMarketAccount" }, { - code: 6053 - name: 'InvalidOrderTrigger' - msg: 'InvalidOrderTrigger' + "code": 6080, + "name": "UnableToLoadPerpMarketAccount", + "msg": "UnableToLoadMarketAccount" }, { - code: 6054 - name: 'InvalidOrderAuction' - msg: 'InvalidOrderAuction' + "code": 6081, + "name": "MarketWrongMutability", + "msg": "MarketWrongMutability" }, { - code: 6055 - name: 'InvalidOrderOracleOffset' - msg: 'InvalidOrderOracleOffset' + "code": 6082, + "name": "UnableToCastUnixTime", + "msg": "UnableToCastUnixTime" }, { - code: 6056 - name: 'InvalidOrderMinOrderSize' - msg: 'InvalidOrderMinOrderSize' + "code": 6083, + "name": "CouldNotFindSpotPosition", + "msg": "CouldNotFindSpotPosition" }, { - code: 6057 - name: 'PlacePostOnlyLimitFailure' - msg: 'Failed to Place Post-Only Limit Order' + "code": 6084, + "name": "NoSpotPositionAvailable", + "msg": "NoSpotPositionAvailable" }, { - code: 6058 - name: 'UserHasNoOrder' - msg: 'User has no order' + "code": 6085, + "name": "InvalidSpotMarketInitialization", + "msg": "InvalidSpotMarketInitialization" }, { - code: 6059 - name: 'OrderAmountTooSmall' - msg: 'Order Amount Too Small' + "code": 6086, + "name": "CouldNotLoadSpotMarketData", + "msg": "CouldNotLoadSpotMarketData" }, { - code: 6060 - name: 'MaxNumberOfOrders' - msg: 'Max number of orders taken' + "code": 6087, + "name": "SpotMarketNotFound", + "msg": "SpotMarketNotFound" }, { - code: 6061 - name: 'OrderDoesNotExist' - msg: 'Order does not exist' + "code": 6088, + "name": "InvalidSpotMarketAccount", + "msg": "InvalidSpotMarketAccount" }, { - code: 6062 - name: 'OrderNotOpen' - msg: 'Order not open' + "code": 6089, + "name": "UnableToLoadSpotMarketAccount", + "msg": "UnableToLoadSpotMarketAccount" }, { - code: 6063 - name: 'FillOrderDidNotUpdateState' - msg: 'FillOrderDidNotUpdateState' + "code": 6090, + "name": "SpotMarketWrongMutability", + "msg": "SpotMarketWrongMutability" }, { - code: 6064 - name: 'ReduceOnlyOrderIncreasedRisk' - msg: 'Reduce only order increased risk' + "code": 6091, + "name": "SpotMarketInterestNotUpToDate", + "msg": "SpotInterestNotUpToDate" }, { - code: 6065 - name: 'UnableToLoadAccountLoader' - msg: 'Unable to load AccountLoader' + "code": 6092, + "name": "SpotMarketInsufficientDeposits", + "msg": "SpotMarketInsufficientDeposits" }, { - code: 6066 - name: 'TradeSizeTooLarge' - msg: 'Trade Size Too Large' + "code": 6093, + "name": "UserMustSettleTheirOwnPositiveUnsettledPNL", + "msg": "UserMustSettleTheirOwnPositiveUnsettledPNL" }, { - code: 6067 - name: 'UserCantReferThemselves' - msg: 'User cant refer themselves' + "code": 6094, + "name": "CantUpdatePoolBalanceType", + "msg": "CantUpdatePoolBalanceType" }, { - code: 6068 - name: 'DidNotReceiveExpectedReferrer' - msg: 'Did not receive expected referrer' + "code": 6095, + "name": "InsufficientCollateralForSettlingPNL", + "msg": "InsufficientCollateralForSettlingPNL" }, { - code: 6069 - name: 'CouldNotDeserializeReferrer' - msg: 'Could not deserialize referrer' + "code": 6096, + "name": "AMMNotUpdatedInSameSlot", + "msg": "AMMNotUpdatedInSameSlot" }, { - code: 6070 - name: 'CouldNotDeserializeReferrerStats' - msg: 'Could not deserialize referrer stats' + "code": 6097, + "name": "AuctionNotComplete", + "msg": "AuctionNotComplete" }, { - code: 6071 - name: 'UserOrderIdAlreadyInUse' - msg: 'User Order Id Already In Use' + "code": 6098, + "name": "MakerNotFound", + "msg": "MakerNotFound" }, { - code: 6072 - name: 'NoPositionsLiquidatable' - msg: 'No positions liquidatable' + "code": 6099, + "name": "MakerStatsNotFound", + "msg": "MakerNotFound" }, { - code: 6073 - name: 'InvalidMarginRatio' - msg: 'Invalid Margin Ratio' + "code": 6100, + "name": "MakerMustBeWritable", + "msg": "MakerMustBeWritable" }, { - code: 6074 - name: 'CantCancelPostOnlyOrder' - msg: 'Cant Cancel Post Only Order' + "code": 6101, + "name": "MakerStatsMustBeWritable", + "msg": "MakerMustBeWritable" }, { - code: 6075 - name: 'InvalidOracleOffset' - msg: 'InvalidOracleOffset' + "code": 6102, + "name": "MakerOrderNotFound", + "msg": "MakerOrderNotFound" }, { - code: 6076 - name: 'CantExpireOrders' - msg: 'CantExpireOrders' + "code": 6103, + "name": "CouldNotDeserializeMaker", + "msg": "CouldNotDeserializeMaker" }, { - code: 6077 - name: 'CouldNotLoadMarketData' - msg: 'CouldNotLoadMarketData' + "code": 6104, + "name": "CouldNotDeserializeMakerStats", + "msg": "CouldNotDeserializeMaker" }, { - code: 6078 - name: 'PerpMarketNotFound' - msg: 'PerpMarketNotFound' + "code": 6105, + "name": "AuctionPriceDoesNotSatisfyMaker", + "msg": "AuctionPriceDoesNotSatisfyMaker" }, { - code: 6079 - name: 'InvalidMarketAccount' - msg: 'InvalidMarketAccount' + "code": 6106, + "name": "MakerCantFulfillOwnOrder", + "msg": "MakerCantFulfillOwnOrder" }, { - code: 6080 - name: 'UnableToLoadPerpMarketAccount' - msg: 'UnableToLoadMarketAccount' + "code": 6107, + "name": "MakerOrderMustBePostOnly", + "msg": "MakerOrderMustBePostOnly" }, { - code: 6081 - name: 'MarketWrongMutability' - msg: 'MarketWrongMutability' + "code": 6108, + "name": "CantMatchTwoPostOnlys", + "msg": "CantMatchTwoPostOnlys" }, { - code: 6082 - name: 'UnableToCastUnixTime' - msg: 'UnableToCastUnixTime' + "code": 6109, + "name": "OrderBreachesOraclePriceLimits", + "msg": "OrderBreachesOraclePriceLimits" }, { - code: 6083 - name: 'CouldNotFindSpotPosition' - msg: 'CouldNotFindSpotPosition' + "code": 6110, + "name": "OrderMustBeTriggeredFirst", + "msg": "OrderMustBeTriggeredFirst" }, { - code: 6084 - name: 'NoSpotPositionAvailable' - msg: 'NoSpotPositionAvailable' + "code": 6111, + "name": "OrderNotTriggerable", + "msg": "OrderNotTriggerable" }, { - code: 6085 - name: 'InvalidSpotMarketInitialization' - msg: 'InvalidSpotMarketInitialization' + "code": 6112, + "name": "OrderDidNotSatisfyTriggerCondition", + "msg": "OrderDidNotSatisfyTriggerCondition" }, { - code: 6086 - name: 'CouldNotLoadSpotMarketData' - msg: 'CouldNotLoadSpotMarketData' + "code": 6113, + "name": "PositionAlreadyBeingLiquidated", + "msg": "PositionAlreadyBeingLiquidated" }, { - code: 6087 - name: 'SpotMarketNotFound' - msg: 'SpotMarketNotFound' + "code": 6114, + "name": "PositionDoesntHaveOpenPositionOrOrders", + "msg": "PositionDoesntHaveOpenPositionOrOrders" }, { - code: 6088 - name: 'InvalidSpotMarketAccount' - msg: 'InvalidSpotMarketAccount' + "code": 6115, + "name": "AllOrdersAreAlreadyLiquidations", + "msg": "AllOrdersAreAlreadyLiquidations" }, { - code: 6089 - name: 'UnableToLoadSpotMarketAccount' - msg: 'UnableToLoadSpotMarketAccount' + "code": 6116, + "name": "CantCancelLiquidationOrder", + "msg": "CantCancelLiquidationOrder" }, { - code: 6090 - name: 'SpotMarketWrongMutability' - msg: 'SpotMarketWrongMutability' + "code": 6117, + "name": "UserIsBeingLiquidated", + "msg": "UserIsBeingLiquidated" }, { - code: 6091 - name: 'SpotMarketInterestNotUpToDate' - msg: 'SpotInterestNotUpToDate' + "code": 6118, + "name": "LiquidationsOngoing", + "msg": "LiquidationsOngoing" }, { - code: 6092 - name: 'SpotMarketInsufficientDeposits' - msg: 'SpotMarketInsufficientDeposits' + "code": 6119, + "name": "WrongSpotBalanceType", + "msg": "WrongSpotBalanceType" }, { - code: 6093 - name: 'UserMustSettleTheirOwnPositiveUnsettledPNL' - msg: 'UserMustSettleTheirOwnPositiveUnsettledPNL' + "code": 6120, + "name": "UserCantLiquidateThemself", + "msg": "UserCantLiquidateThemself" }, { - code: 6094 - name: 'CantUpdatePoolBalanceType' - msg: 'CantUpdatePoolBalanceType' + "code": 6121, + "name": "InvalidPerpPositionToLiquidate", + "msg": "InvalidPerpPositionToLiquidate" }, { - code: 6095 - name: 'InsufficientCollateralForSettlingPNL' - msg: 'InsufficientCollateralForSettlingPNL' + "code": 6122, + "name": "InvalidBaseAssetAmountForLiquidatePerp", + "msg": "InvalidBaseAssetAmountForLiquidatePerp" }, { - code: 6096 - name: 'AMMNotUpdatedInSameSlot' - msg: 'AMMNotUpdatedInSameSlot' + "code": 6123, + "name": "InvalidPositionLastFundingRate", + "msg": "InvalidPositionLastFundingRate" }, { - code: 6097 - name: 'AuctionNotComplete' - msg: 'AuctionNotComplete' + "code": 6124, + "name": "InvalidPositionDelta", + "msg": "InvalidPositionDelta" }, { - code: 6098 - name: 'MakerNotFound' - msg: 'MakerNotFound' + "code": 6125, + "name": "UserBankrupt", + "msg": "UserBankrupt" }, { - code: 6099 - name: 'MakerStatsNotFound' - msg: 'MakerNotFound' + "code": 6126, + "name": "UserNotBankrupt", + "msg": "UserNotBankrupt" }, { - code: 6100 - name: 'MakerMustBeWritable' - msg: 'MakerMustBeWritable' + "code": 6127, + "name": "UserHasInvalidBorrow", + "msg": "UserHasInvalidBorrow" }, { - code: 6101 - name: 'MakerStatsMustBeWritable' - msg: 'MakerMustBeWritable' + "code": 6128, + "name": "DailyWithdrawLimit", + "msg": "DailyWithdrawLimit" }, { - code: 6102 - name: 'MakerOrderNotFound' - msg: 'MakerOrderNotFound' + "code": 6129, + "name": "DefaultError", + "msg": "DefaultError" }, { - code: 6103 - name: 'CouldNotDeserializeMaker' - msg: 'CouldNotDeserializeMaker' + "code": 6130, + "name": "InsufficientLPTokens", + "msg": "Insufficient LP tokens" }, { - code: 6104 - name: 'CouldNotDeserializeMakerStats' - msg: 'CouldNotDeserializeMaker' + "code": 6131, + "name": "CantLPWithPerpPosition", + "msg": "Cant LP with a market position" }, { - code: 6105 - name: 'AuctionPriceDoesNotSatisfyMaker' - msg: 'AuctionPriceDoesNotSatisfyMaker' + "code": 6132, + "name": "UnableToBurnLPTokens", + "msg": "Unable to burn LP tokens" }, { - code: 6106 - name: 'MakerCantFulfillOwnOrder' - msg: 'MakerCantFulfillOwnOrder' + "code": 6133, + "name": "TryingToRemoveLiquidityTooFast", + "msg": "Trying to remove liqudity too fast after adding it" }, { - code: 6107 - name: 'MakerOrderMustBePostOnly' - msg: 'MakerOrderMustBePostOnly' + "code": 6134, + "name": "InvalidSpotMarketVault", + "msg": "Invalid Spot Market Vault" }, { - code: 6108 - name: 'CantMatchTwoPostOnlys' - msg: 'CantMatchTwoPostOnlys' + "code": 6135, + "name": "InvalidSpotMarketState", + "msg": "Invalid Spot Market State" }, { - code: 6109 - name: 'OrderBreachesOraclePriceLimits' - msg: 'OrderBreachesOraclePriceLimits' + "code": 6136, + "name": "InvalidSerumProgram", + "msg": "InvalidSerumProgram" }, { - code: 6110 - name: 'OrderMustBeTriggeredFirst' - msg: 'OrderMustBeTriggeredFirst' + "code": 6137, + "name": "InvalidSerumMarket", + "msg": "InvalidSerumMarket" }, { - code: 6111 - name: 'OrderNotTriggerable' - msg: 'OrderNotTriggerable' + "code": 6138, + "name": "InvalidSerumBids", + "msg": "InvalidSerumBids" }, { - code: 6112 - name: 'OrderDidNotSatisfyTriggerCondition' - msg: 'OrderDidNotSatisfyTriggerCondition' + "code": 6139, + "name": "InvalidSerumAsks", + "msg": "InvalidSerumAsks" }, { - code: 6113 - name: 'PositionAlreadyBeingLiquidated' - msg: 'PositionAlreadyBeingLiquidated' + "code": 6140, + "name": "InvalidSerumOpenOrders", + "msg": "InvalidSerumOpenOrders" }, { - code: 6114 - name: 'PositionDoesntHaveOpenPositionOrOrders' - msg: 'PositionDoesntHaveOpenPositionOrOrders' + "code": 6141, + "name": "FailedSerumCPI", + "msg": "FailedSerumCPI" }, { - code: 6115 - name: 'AllOrdersAreAlreadyLiquidations' - msg: 'AllOrdersAreAlreadyLiquidations' + "code": 6142, + "name": "FailedToFillOnExternalMarket", + "msg": "FailedToFillOnExternalMarket" }, { - code: 6116 - name: 'CantCancelLiquidationOrder' - msg: 'CantCancelLiquidationOrder' + "code": 6143, + "name": "InvalidFulfillmentConfig", + "msg": "InvalidFulfillmentConfig" }, { - code: 6117 - name: 'UserIsBeingLiquidated' - msg: 'UserIsBeingLiquidated' + "code": 6144, + "name": "InvalidFeeStructure", + "msg": "InvalidFeeStructure" }, { - code: 6118 - name: 'LiquidationsOngoing' - msg: 'LiquidationsOngoing' + "code": 6145, + "name": "InsufficientIFShares", + "msg": "Insufficient IF shares" }, { - code: 6119 - name: 'WrongSpotBalanceType' - msg: 'WrongSpotBalanceType' + "code": 6146, + "name": "MarketActionPaused", + "msg": "the Market has paused this action" }, { - code: 6120 - name: 'UserCantLiquidateThemself' - msg: 'UserCantLiquidateThemself' + "code": 6147, + "name": "MarketPlaceOrderPaused", + "msg": "the Market status doesnt allow placing orders" }, { - code: 6121 - name: 'InvalidPerpPositionToLiquidate' - msg: 'InvalidPerpPositionToLiquidate' + "code": 6148, + "name": "MarketFillOrderPaused", + "msg": "the Market status doesnt allow filling orders" }, { - code: 6122 - name: 'InvalidBaseAssetAmountForLiquidatePerp' - msg: 'InvalidBaseAssetAmountForLiquidatePerp' + "code": 6149, + "name": "MarketWithdrawPaused", + "msg": "the Market status doesnt allow withdraws" }, { - code: 6123 - name: 'InvalidPositionLastFundingRate' - msg: 'InvalidPositionLastFundingRate' + "code": 6150, + "name": "ProtectedAssetTierViolation", + "msg": "Action violates the Protected Asset Tier rules" }, { - code: 6124 - name: 'InvalidPositionDelta' - msg: 'InvalidPositionDelta' + "code": 6151, + "name": "IsolatedAssetTierViolation", + "msg": "Action violates the Isolated Asset Tier rules" }, { - code: 6125 - name: 'UserBankrupt' - msg: 'UserBankrupt' + "code": 6152, + "name": "UserCantBeDeleted", + "msg": "User Cant Be Deleted" }, { - code: 6126 - name: 'UserNotBankrupt' - msg: 'UserNotBankrupt' + "code": 6153, + "name": "ReduceOnlyWithdrawIncreasedRisk", + "msg": "Reduce Only Withdraw Increased Risk" }, { - code: 6127 - name: 'UserHasInvalidBorrow' - msg: 'UserHasInvalidBorrow' + "code": 6154, + "name": "MaxOpenInterest", + "msg": "Max Open Interest" }, { - code: 6128 - name: 'DailyWithdrawLimit' - msg: 'DailyWithdrawLimit' + "code": 6155, + "name": "CantResolvePerpBankruptcy", + "msg": "Cant Resolve Perp Bankruptcy" }, { - code: 6129 - name: 'DefaultError' - msg: 'DefaultError' + "code": 6156, + "name": "LiquidationDoesntSatisfyLimitPrice", + "msg": "Liquidation Doesnt Satisfy Limit Price" }, { - code: 6130 - name: 'InsufficientLPTokens' - msg: 'Insufficient LP tokens' + "code": 6157, + "name": "MarginTradingDisabled", + "msg": "Margin Trading Disabled" }, { - code: 6131 - name: 'CantLPWithPerpPosition' - msg: 'Cant LP with a market position' + "code": 6158, + "name": "InvalidMarketStatusToSettlePnl", + "msg": "Invalid Market Status to Settle Perp Pnl" }, { - code: 6132 - name: 'UnableToBurnLPTokens' - msg: 'Unable to burn LP tokens' + "code": 6159, + "name": "PerpMarketNotInSettlement", + "msg": "PerpMarketNotInSettlement" }, { - code: 6133 - name: 'TryingToRemoveLiquidityTooFast' - msg: 'Trying to remove liqudity too fast after adding it' + "code": 6160, + "name": "PerpMarketNotInReduceOnly", + "msg": "PerpMarketNotInReduceOnly" }, { - code: 6134 - name: 'InvalidSpotMarketVault' - msg: 'Invalid Spot Market Vault' + "code": 6161, + "name": "PerpMarketSettlementBufferNotReached", + "msg": "PerpMarketSettlementBufferNotReached" }, { - code: 6135 - name: 'InvalidSpotMarketState' - msg: 'Invalid Spot Market State' + "code": 6162, + "name": "PerpMarketSettlementUserHasOpenOrders", + "msg": "PerpMarketSettlementUserHasOpenOrders" }, { - code: 6136 - name: 'InvalidSerumProgram' - msg: 'InvalidSerumProgram' + "code": 6163, + "name": "PerpMarketSettlementUserHasActiveLP", + "msg": "PerpMarketSettlementUserHasActiveLP" }, { - code: 6137 - name: 'InvalidSerumMarket' - msg: 'InvalidSerumMarket' + "code": 6164, + "name": "UnableToSettleExpiredUserPosition", + "msg": "UnableToSettleExpiredUserPosition" }, { - code: 6138 - name: 'InvalidSerumBids' - msg: 'InvalidSerumBids' + "code": 6165, + "name": "UnequalMarketIndexForSpotTransfer", + "msg": "UnequalMarketIndexForSpotTransfer" }, { - code: 6139 - name: 'InvalidSerumAsks' - msg: 'InvalidSerumAsks' + "code": 6166, + "name": "InvalidPerpPositionDetected", + "msg": "InvalidPerpPositionDetected" }, { - code: 6140 - name: 'InvalidSerumOpenOrders' - msg: 'InvalidSerumOpenOrders' + "code": 6167, + "name": "InvalidSpotPositionDetected", + "msg": "InvalidSpotPositionDetected" }, { - code: 6141 - name: 'FailedSerumCPI' - msg: 'FailedSerumCPI' + "code": 6168, + "name": "InvalidAmmDetected", + "msg": "InvalidAmmDetected" }, { - code: 6142 - name: 'FailedToFillOnExternalMarket' - msg: 'FailedToFillOnExternalMarket' + "code": 6169, + "name": "InvalidAmmForFillDetected", + "msg": "InvalidAmmForFillDetected" }, { - code: 6143 - name: 'InvalidFulfillmentConfig' - msg: 'InvalidFulfillmentConfig' + "code": 6170, + "name": "InvalidAmmLimitPriceOverride", + "msg": "InvalidAmmLimitPriceOverride" }, { - code: 6144 - name: 'InvalidFeeStructure' - msg: 'InvalidFeeStructure' + "code": 6171, + "name": "InvalidOrderFillPrice", + "msg": "InvalidOrderFillPrice" }, { - code: 6145 - name: 'InsufficientIFShares' - msg: 'Insufficient IF shares' + "code": 6172, + "name": "SpotMarketBalanceInvariantViolated", + "msg": "SpotMarketBalanceInvariantViolated" }, { - code: 6146 - name: 'MarketActionPaused' - msg: 'the Market has paused this action' + "code": 6173, + "name": "SpotMarketVaultInvariantViolated", + "msg": "SpotMarketVaultInvariantViolated" }, { - code: 6147 - name: 'MarketPlaceOrderPaused' - msg: 'the Market status doesnt allow placing orders' + "code": 6174, + "name": "InvalidPDA", + "msg": "InvalidPDA" }, { - code: 6148 - name: 'MarketFillOrderPaused' - msg: 'the Market status doesnt allow filling orders' + "code": 6175, + "name": "InvalidPDASigner", + "msg": "InvalidPDASigner" }, { - code: 6149 - name: 'MarketWithdrawPaused' - msg: 'the Market status doesnt allow withdraws' + "code": 6176, + "name": "RevenueSettingsCannotSettleToIF", + "msg": "RevenueSettingsCannotSettleToIF" }, { - code: 6150 - name: 'ProtectedAssetTierViolation' - msg: 'Action violates the Protected Asset Tier rules' + "code": 6177, + "name": "NoRevenueToSettleToIF", + "msg": "NoRevenueToSettleToIF" }, { - code: 6151 - name: 'IsolatedAssetTierViolation' - msg: 'Action violates the Isolated Asset Tier rules' + "code": 6178, + "name": "NoAmmPerpPnlDeficit", + "msg": "NoAmmPerpPnlDeficit" }, { - code: 6152 - name: 'UserCantBeDeleted' - msg: 'User Cant Be Deleted' + "code": 6179, + "name": "SufficientPerpPnlPool", + "msg": "SufficientPerpPnlPool" }, { - code: 6153 - name: 'ReduceOnlyWithdrawIncreasedRisk' - msg: 'Reduce Only Withdraw Increased Risk' + "code": 6180, + "name": "InsufficientPerpPnlPool", + "msg": "InsufficientPerpPnlPool" }, { - code: 6154 - name: 'MaxOpenInterest' - msg: 'Max Open Interest' + "code": 6181, + "name": "PerpPnlDeficitBelowThreshold", + "msg": "PerpPnlDeficitBelowThreshold" }, { - code: 6155 - name: 'CantResolvePerpBankruptcy' - msg: 'Cant Resolve Perp Bankruptcy' + "code": 6182, + "name": "MaxRevenueWithdrawPerPeriodReached", + "msg": "MaxRevenueWithdrawPerPeriodReached" }, { - code: 6156 - name: 'LiquidationDoesntSatisfyLimitPrice' - msg: 'Liquidation Doesnt Satisfy Limit Price' + "code": 6183, + "name": "MaxIFWithdrawReached", + "msg": "InvalidSpotPositionDetected" }, { - code: 6157 - name: 'MarginTradingDisabled' - msg: 'Margin Trading Disabled' + "code": 6184, + "name": "NoIFWithdrawAvailable", + "msg": "NoIFWithdrawAvailable" }, { - code: 6158 - name: 'InvalidMarketStatusToSettlePnl' - msg: 'Invalid Market Status to Settle Perp Pnl' + "code": 6185, + "name": "InvalidIFUnstake", + "msg": "InvalidIFUnstake" }, { - code: 6159 - name: 'PerpMarketNotInSettlement' - msg: 'PerpMarketNotInSettlement' + "code": 6186, + "name": "InvalidIFUnstakeSize", + "msg": "InvalidIFUnstakeSize" }, { - code: 6160 - name: 'PerpMarketNotInReduceOnly' - msg: 'PerpMarketNotInReduceOnly' + "code": 6187, + "name": "InvalidIFUnstakeCancel", + "msg": "InvalidIFUnstakeCancel" }, { - code: 6161 - name: 'PerpMarketSettlementBufferNotReached' - msg: 'PerpMarketSettlementBufferNotReached' + "code": 6188, + "name": "InvalidIFForNewStakes", + "msg": "InvalidIFForNewStakes" }, { - code: 6162 - name: 'PerpMarketSettlementUserHasOpenOrders' - msg: 'PerpMarketSettlementUserHasOpenOrders' + "code": 6189, + "name": "InvalidIFRebase", + "msg": "InvalidIFRebase" }, { - code: 6163 - name: 'PerpMarketSettlementUserHasActiveLP' - msg: 'PerpMarketSettlementUserHasActiveLP' + "code": 6190, + "name": "InvalidInsuranceUnstakeSize", + "msg": "InvalidInsuranceUnstakeSize" }, { - code: 6164 - name: 'UnableToSettleExpiredUserPosition' - msg: 'UnableToSettleExpiredUserPosition' + "code": 6191, + "name": "InvalidOrderLimitPrice", + "msg": "InvalidOrderLimitPrice" }, { - code: 6165 - name: 'UnequalMarketIndexForSpotTransfer' - msg: 'UnequalMarketIndexForSpotTransfer' + "code": 6192, + "name": "InvalidIFDetected", + "msg": "InvalidIFDetected" }, { - code: 6166 - name: 'InvalidPerpPositionDetected' - msg: 'InvalidPerpPositionDetected' + "code": 6193, + "name": "InvalidAmmMaxSpreadDetected", + "msg": "InvalidAmmMaxSpreadDetected" }, { - code: 6167 - name: 'InvalidSpotPositionDetected' - msg: 'InvalidSpotPositionDetected' + "code": 6194, + "name": "InvalidConcentrationCoef", + "msg": "InvalidConcentrationCoef" }, { - code: 6168 - name: 'InvalidAmmDetected' - msg: 'InvalidAmmDetected' + "code": 6195, + "name": "InvalidSrmVault", + "msg": "InvalidSrmVault" }, { - code: 6169 - name: 'InvalidAmmForFillDetected' - msg: 'InvalidAmmForFillDetected' + "code": 6196, + "name": "InvalidVaultOwner", + "msg": "InvalidVaultOwner" }, { - code: 6170 - name: 'InvalidAmmLimitPriceOverride' - msg: 'InvalidAmmLimitPriceOverride' + "code": 6197, + "name": "InvalidMarketStatusForFills", + "msg": "InvalidMarketStatusForFills" }, { - code: 6171 - name: 'InvalidOrderFillPrice' - msg: 'InvalidOrderFillPrice' + "code": 6198, + "name": "IFWithdrawRequestInProgress", + "msg": "IFWithdrawRequestInProgress" }, { - code: 6172 - name: 'SpotMarketBalanceInvariantViolated' - msg: 'SpotMarketBalanceInvariantViolated' + "code": 6199, + "name": "NoIFWithdrawRequestInProgress", + "msg": "NoIFWithdrawRequestInProgress" }, { - code: 6173 - name: 'SpotMarketVaultInvariantViolated' - msg: 'SpotMarketVaultInvariantViolated' + "code": 6200, + "name": "IFWithdrawRequestTooSmall", + "msg": "IFWithdrawRequestTooSmall" }, { - code: 6174 - name: 'InvalidPDA' - msg: 'InvalidPDA' + "code": 6201, + "name": "IncorrectSpotMarketAccountPassed", + "msg": "IncorrectSpotMarketAccountPassed" }, { - code: 6175 - name: 'InvalidPDASigner' - msg: 'InvalidPDASigner' + "code": 6202, + "name": "BlockchainClockInconsistency", + "msg": "BlockchainClockInconsistency" }, { - code: 6176 - name: 'RevenueSettingsCannotSettleToIF' - msg: 'RevenueSettingsCannotSettleToIF' + "code": 6203, + "name": "InvalidIFSharesDetected", + "msg": "InvalidIFSharesDetected" }, { - code: 6177 - name: 'NoRevenueToSettleToIF' - msg: 'NoRevenueToSettleToIF' + "code": 6204, + "name": "NewLPSizeTooSmall", + "msg": "NewLPSizeTooSmall" }, { - code: 6178 - name: 'NoAmmPerpPnlDeficit' - msg: 'NoAmmPerpPnlDeficit' + "code": 6205, + "name": "MarketStatusInvalidForNewLP", + "msg": "MarketStatusInvalidForNewLP" }, { - code: 6179 - name: 'SufficientPerpPnlPool' - msg: 'SufficientPerpPnlPool' + "code": 6206, + "name": "InvalidMarkTwapUpdateDetected", + "msg": "InvalidMarkTwapUpdateDetected" }, { - code: 6180 - name: 'InsufficientPerpPnlPool' - msg: 'InsufficientPerpPnlPool' + "code": 6207, + "name": "MarketSettlementAttemptOnActiveMarket", + "msg": "MarketSettlementAttemptOnActiveMarket" }, { - code: 6181 - name: 'PerpPnlDeficitBelowThreshold' - msg: 'PerpPnlDeficitBelowThreshold' + "code": 6208, + "name": "MarketSettlementRequiresSettledLP", + "msg": "MarketSettlementRequiresSettledLP" }, { - code: 6182 - name: 'MaxRevenueWithdrawPerPeriodReached' - msg: 'MaxRevenueWithdrawPerPeriodReached' + "code": 6209, + "name": "MarketSettlementAttemptTooEarly", + "msg": "MarketSettlementAttemptTooEarly" }, { - code: 6183 - name: 'MaxIFWithdrawReached' - msg: 'InvalidSpotPositionDetected' + "code": 6210, + "name": "MarketSettlementTargetPriceInvalid", + "msg": "MarketSettlementTargetPriceInvalid" }, { - code: 6184 - name: 'NoIFWithdrawAvailable' - msg: 'NoIFWithdrawAvailable' + "code": 6211, + "name": "UnsupportedSpotMarket", + "msg": "UnsupportedSpotMarket" }, { - code: 6185 - name: 'InvalidIFUnstake' - msg: 'InvalidIFUnstake' + "code": 6212, + "name": "SpotOrdersDisabled", + "msg": "SpotOrdersDisabled" }, { - code: 6186 - name: 'InvalidIFUnstakeSize' - msg: 'InvalidIFUnstakeSize' + "code": 6213, + "name": "MarketBeingInitialized", + "msg": "Market Being Initialized" }, { - code: 6187 - name: 'InvalidIFUnstakeCancel' - msg: 'InvalidIFUnstakeCancel' + "code": 6214, + "name": "InvalidUserSubAccountId", + "msg": "Invalid Sub Account Id" }, { - code: 6188 - name: 'InvalidIFForNewStakes' - msg: 'InvalidIFForNewStakes' + "code": 6215, + "name": "InvalidTriggerOrderCondition", + "msg": "Invalid Trigger Order Condition" }, { - code: 6189 - name: 'InvalidIFRebase' - msg: 'InvalidIFRebase' + "code": 6216, + "name": "InvalidSpotPosition", + "msg": "Invalid Spot Position" }, { - code: 6190 - name: 'InvalidInsuranceUnstakeSize' - msg: 'InvalidInsuranceUnstakeSize' + "code": 6217, + "name": "CantTransferBetweenSameUserAccount", + "msg": "Cant transfer between same user account" }, { - code: 6191 - name: 'InvalidOrderLimitPrice' - msg: 'InvalidOrderLimitPrice' + "code": 6218, + "name": "InvalidPerpPosition", + "msg": "Invalid Perp Position" }, { - code: 6192 - name: 'InvalidIFDetected' - msg: 'InvalidIFDetected' + "code": 6219, + "name": "UnableToGetLimitPrice", + "msg": "Unable To Get Limit Price" }, { - code: 6193 - name: 'InvalidAmmMaxSpreadDetected' - msg: 'InvalidAmmMaxSpreadDetected' + "code": 6220, + "name": "InvalidLiquidation", + "msg": "Invalid Liquidation" }, { - code: 6194 - name: 'InvalidConcentrationCoef' - msg: 'InvalidConcentrationCoef' + "code": 6221, + "name": "SpotFulfillmentConfigDisabled", + "msg": "Spot Fulfillment Config Disabled" }, { - code: 6195 - name: 'InvalidSrmVault' - msg: 'InvalidSrmVault' + "code": 6222, + "name": "InvalidMaker", + "msg": "Invalid Maker" }, { - code: 6196 - name: 'InvalidVaultOwner' - msg: 'InvalidVaultOwner' + "code": 6223, + "name": "FailedUnwrap", + "msg": "Failed Unwrap" }, { - code: 6197 - name: 'InvalidMarketStatusForFills' - msg: 'InvalidMarketStatusForFills' + "code": 6224, + "name": "MaxNumberOfUsers", + "msg": "Max Number Of Users" }, { - code: 6198 - name: 'IFWithdrawRequestInProgress' - msg: 'IFWithdrawRequestInProgress' + "code": 6225, + "name": "InvalidOracleForSettlePnl", + "msg": "InvalidOracleForSettlePnl" }, { - code: 6199 - name: 'NoIFWithdrawRequestInProgress' - msg: 'NoIFWithdrawRequestInProgress' + "code": 6226, + "name": "MarginOrdersOpen", + "msg": "MarginOrdersOpen" }, { - code: 6200 - name: 'IFWithdrawRequestTooSmall' - msg: 'IFWithdrawRequestTooSmall' + "code": 6227, + "name": "TierViolationLiquidatingPerpPnl", + "msg": "TierViolationLiquidatingPerpPnl" }, { - code: 6201 - name: 'IncorrectSpotMarketAccountPassed' - msg: 'IncorrectSpotMarketAccountPassed' + "code": 6228, + "name": "CouldNotLoadUserData", + "msg": "CouldNotLoadUserData" }, { - code: 6202 - name: 'BlockchainClockInconsistency' - msg: 'BlockchainClockInconsistency' + "code": 6229, + "name": "UserWrongMutability", + "msg": "UserWrongMutability" }, { - code: 6203 - name: 'InvalidIFSharesDetected' - msg: 'InvalidIFSharesDetected' + "code": 6230, + "name": "InvalidUserAccount", + "msg": "InvalidUserAccount" }, { - code: 6204 - name: 'NewLPSizeTooSmall' - msg: 'NewLPSizeTooSmall' + "code": 6231, + "name": "CouldNotLoadUserStatsData", + "msg": "CouldNotLoadUserData" }, { - code: 6205 - name: 'MarketStatusInvalidForNewLP' - msg: 'MarketStatusInvalidForNewLP' + "code": 6232, + "name": "UserStatsWrongMutability", + "msg": "UserWrongMutability" }, { - code: 6206 - name: 'InvalidMarkTwapUpdateDetected' - msg: 'InvalidMarkTwapUpdateDetected' + "code": 6233, + "name": "InvalidUserStatsAccount", + "msg": "InvalidUserAccount" }, { - code: 6207 - name: 'MarketSettlementAttemptOnActiveMarket' - msg: 'MarketSettlementAttemptOnActiveMarket' + "code": 6234, + "name": "UserNotFound", + "msg": "UserNotFound" }, { - code: 6208 - name: 'MarketSettlementRequiresSettledLP' - msg: 'MarketSettlementRequiresSettledLP' + "code": 6235, + "name": "UnableToLoadUserAccount", + "msg": "UnableToLoadUserAccount" }, { - code: 6209 - name: 'MarketSettlementAttemptTooEarly' - msg: 'MarketSettlementAttemptTooEarly' + "code": 6236, + "name": "UserStatsNotFound", + "msg": "UserStatsNotFound" }, { - code: 6210 - name: 'MarketSettlementTargetPriceInvalid' - msg: 'MarketSettlementTargetPriceInvalid' + "code": 6237, + "name": "UnableToLoadUserStatsAccount", + "msg": "UnableToLoadUserStatsAccount" }, { - code: 6211 - name: 'UnsupportedSpotMarket' - msg: 'UnsupportedSpotMarket' + "code": 6238, + "name": "UserNotInactive", + "msg": "User Not Inactive" }, { - code: 6212 - name: 'SpotOrdersDisabled' - msg: 'SpotOrdersDisabled' + "code": 6239, + "name": "RevertFill", + "msg": "RevertFill" }, { - code: 6213 - name: 'MarketBeingInitialized' - msg: 'Market Being Initialized' + "code": 6240, + "name": "InvalidMarketAccountforDeletion", + "msg": "Invalid MarketAccount for Deletion" }, { - code: 6214 - name: 'InvalidUserSubAccountId' - msg: 'Invalid Sub Account Id' + "code": 6241, + "name": "InvalidSpotFulfillmentParams", + "msg": "Invalid Spot Fulfillment Params" }, { - code: 6215 - name: 'InvalidTriggerOrderCondition' - msg: 'Invalid Trigger Order Condition' + "code": 6242, + "name": "FailedToGetMint", + "msg": "Failed to Get Mint" }, { - code: 6216 - name: 'InvalidSpotPosition' - msg: 'Invalid Spot Position' + "code": 6243, + "name": "FailedPhoenixCPI", + "msg": "FailedPhoenixCPI" }, { - code: 6217 - name: 'CantTransferBetweenSameUserAccount' - msg: 'Cant transfer between same user account' + "code": 6244, + "name": "FailedToDeserializePhoenixMarket", + "msg": "FailedToDeserializePhoenixMarket" }, { - code: 6218 - name: 'InvalidPerpPosition' - msg: 'Invalid Perp Position' + "code": 6245, + "name": "InvalidPricePrecision", + "msg": "InvalidPricePrecision" }, { - code: 6219 - name: 'UnableToGetLimitPrice' - msg: 'Unable To Get Limit Price' + "code": 6246, + "name": "InvalidPhoenixProgram", + "msg": "InvalidPhoenixProgram" }, { - code: 6220 - name: 'InvalidLiquidation' - msg: 'Invalid Liquidation' + "code": 6247, + "name": "InvalidPhoenixMarket", + "msg": "InvalidPhoenixMarket" }, { - code: 6221 - name: 'SpotFulfillmentConfigDisabled' - msg: 'Spot Fulfillment Config Disabled' + "code": 6248, + "name": "InvalidSwap", + "msg": "InvalidSwap" }, { - code: 6222 - name: 'InvalidMaker' - msg: 'Invalid Maker' + "code": 6249, + "name": "SwapLimitPriceBreached", + "msg": "SwapLimitPriceBreached" }, { - code: 6223 - name: 'FailedUnwrap' - msg: 'Failed Unwrap' + "code": 6250, + "name": "SpotMarketReduceOnly", + "msg": "SpotMarketReduceOnly" }, { - code: 6224 - name: 'MaxNumberOfUsers' - msg: 'Max Number Of Users' + "code": 6251, + "name": "FundingWasNotUpdated", + "msg": "FundingWasNotUpdated" }, { - code: 6225 - name: 'InvalidOracleForSettlePnl' - msg: 'InvalidOracleForSettlePnl' + "code": 6252, + "name": "ImpossibleFill", + "msg": "ImpossibleFill" }, { - code: 6226 - name: 'MarginOrdersOpen' - msg: 'MarginOrdersOpen' + "code": 6253, + "name": "CantUpdatePerpBidAskTwap", + "msg": "CantUpdatePerpBidAskTwap" }, { - code: 6227 - name: 'TierViolationLiquidatingPerpPnl' - msg: 'TierViolationLiquidatingPerpPnl' + "code": 6254, + "name": "UserReduceOnly", + "msg": "UserReduceOnly" }, { - code: 6228 - name: 'CouldNotLoadUserData' - msg: 'CouldNotLoadUserData' + "code": 6255, + "name": "InvalidMarginCalculation", + "msg": "InvalidMarginCalculation" }, { - code: 6229 - name: 'UserWrongMutability' - msg: 'UserWrongMutability' + "code": 6256, + "name": "CantPayUserInitFee", + "msg": "CantPayUserInitFee" }, { - code: 6230 - name: 'InvalidUserAccount' - msg: 'InvalidUserAccount' + "code": 6257, + "name": "CantReclaimRent", + "msg": "CantReclaimRent" }, { - code: 6231 - name: 'CouldNotLoadUserStatsData' - msg: 'CouldNotLoadUserData' + "code": 6258, + "name": "InsuranceFundOperationPaused", + "msg": "InsuranceFundOperationPaused" }, { - code: 6232 - name: 'UserStatsWrongMutability' - msg: 'UserWrongMutability' + "code": 6259, + "name": "NoUnsettledPnl", + "msg": "NoUnsettledPnl" }, { - code: 6233 - name: 'InvalidUserStatsAccount' - msg: 'InvalidUserAccount' + "code": 6260, + "name": "PnlPoolCantSettleUser", + "msg": "PnlPoolCantSettleUser" }, { - code: 6234 - name: 'UserNotFound' - msg: 'UserNotFound' + "code": 6261, + "name": "OracleNonPositive", + "msg": "OracleInvalid" }, { - code: 6235 - name: 'UnableToLoadUserAccount' - msg: 'UnableToLoadUserAccount' + "code": 6262, + "name": "OracleTooVolatile", + "msg": "OracleTooVolatile" }, { - code: 6236 - name: 'UserStatsNotFound' - msg: 'UserStatsNotFound' + "code": 6263, + "name": "OracleTooUncertain", + "msg": "OracleTooUncertain" }, { - code: 6237 - name: 'UnableToLoadUserStatsAccount' - msg: 'UnableToLoadUserStatsAccount' + "code": 6264, + "name": "OracleStaleForMargin", + "msg": "OracleStaleForMargin" }, { - code: 6238 - name: 'UserNotInactive' - msg: 'User Not Inactive' + "code": 6265, + "name": "OracleInsufficientDataPoints", + "msg": "OracleInsufficientDataPoints" }, { - code: 6239 - name: 'RevertFill' - msg: 'RevertFill' + "code": 6266, + "name": "OracleStaleForAMM", + "msg": "OracleStaleForAMM" }, { - code: 6240 - name: 'InvalidMarketAccountforDeletion' - msg: 'Invalid MarketAccount for Deletion' + "code": 6267, + "name": "UnableToParsePullOracleMessage", + "msg": "Unable to parse pull oracle message" }, { - code: 6241 - name: 'InvalidSpotFulfillmentParams' - msg: 'Invalid Spot Fulfillment Params' + "code": 6268, + "name": "MaxBorrows", + "msg": "Can not borow more than max borrows" }, { - code: 6242 - name: 'FailedToGetMint' - msg: 'Failed to Get Mint' + "code": 6269, + "name": "OracleUpdatesNotMonotonic", + "msg": "Updates must be monotonically increasing" }, { - code: 6243 - name: 'FailedPhoenixCPI' - msg: 'FailedPhoenixCPI' + "code": 6270, + "name": "OraclePriceFeedMessageMismatch", + "msg": "Trying to update price feed with the wrong feed id" }, { - code: 6244 - name: 'FailedToDeserializePhoenixMarket' - msg: 'FailedToDeserializePhoenixMarket' + "code": 6271, + "name": "OracleUnsupportedMessageType", + "msg": "The message in the update must be a PriceFeedMessage" }, { - code: 6245 - name: 'InvalidPricePrecision' - msg: 'InvalidPricePrecision' + "code": 6272, + "name": "OracleDeserializeMessageFailed", + "msg": "Could not deserialize the message in the update" }, { - code: 6246 - name: 'InvalidPhoenixProgram' - msg: 'InvalidPhoenixProgram' + "code": 6273, + "name": "OracleWrongGuardianSetOwner", + "msg": "Wrong guardian set owner in update price atomic" }, { - code: 6247 - name: 'InvalidPhoenixMarket' - msg: 'InvalidPhoenixMarket' + "code": 6274, + "name": "OracleWrongWriteAuthority", + "msg": "Oracle post update atomic price feed account must be drift program" }, { - code: 6248 - name: 'InvalidSwap' - msg: 'InvalidSwap' + "code": 6275, + "name": "OracleWrongVaaOwner", + "msg": "Oracle vaa owner must be wormhole program" }, { - code: 6249 - name: 'SwapLimitPriceBreached' - msg: 'SwapLimitPriceBreached' + "code": 6276, + "name": "OracleTooManyPriceAccountUpdates", + "msg": "Multi updates must have 2 or fewer accounts passed in remaining accounts" }, { - code: 6250 - name: 'SpotMarketReduceOnly' - msg: 'SpotMarketReduceOnly' + "code": 6277, + "name": "OracleMismatchedVaaAndPriceUpdates", + "msg": "Don't have the same remaining accounts number and merkle price updates left" }, { - code: 6251 - name: 'FundingWasNotUpdated' - msg: 'FundingWasNotUpdated' + "code": 6278, + "name": "OracleBadRemainingAccountPublicKey", + "msg": "Remaining account passed is not a valid pda" }, { - code: 6252 - name: 'ImpossibleFill' - msg: 'ImpossibleFill' + "code": 6279, + "name": "FailedOpenbookV2CPI", + "msg": "FailedOpenbookV2CPI" }, { - code: 6253 - name: 'CantUpdatePerpBidAskTwap' - msg: 'CantUpdatePerpBidAskTwap' + "code": 6280, + "name": "InvalidOpenbookV2Program", + "msg": "InvalidOpenbookV2Program" }, { - code: 6254 - name: 'UserReduceOnly' - msg: 'UserReduceOnly' + "code": 6281, + "name": "InvalidOpenbookV2Market", + "msg": "InvalidOpenbookV2Market" }, { - code: 6255 - name: 'InvalidMarginCalculation' - msg: 'InvalidMarginCalculation' + "code": 6282, + "name": "NonZeroTransferFee", + "msg": "Non zero transfer fee" }, { - code: 6256 - name: 'CantPayUserInitFee' - msg: 'CantPayUserInitFee' + "code": 6283, + "name": "LiquidationOrderFailedToFill", + "msg": "Liquidation order failed to fill" }, { - code: 6257 - name: 'CantReclaimRent' - msg: 'CantReclaimRent' + "code": 6284, + "name": "InvalidPredictionMarketOrder", + "msg": "Invalid prediction market order" } ] } export const IDL: Drift = { - version: '2.66.0', - name: 'drift', - instructions: [ + "version": "2.92.0", + "name": "drift", + "instructions": [ { - name: 'initializeUser', - accounts: [ + "name": "initializeUser", + "accounts": [ + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "payer", + "isMut": true, + "isSigner": true + }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "subAccountId", + "type": "u16" }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + }, + { + "name": "initializeUserStats", + "accounts": [ + { + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'payer', - isMut: true, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: 'systemProgram', - isMut: false, - isSigner: false, + "name": "rent", + "isMut": false, + "isSigner": false }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [] + }, + { + "name": "initializeReferrerName", + "accounts": [ { - name: 'subAccountId', - type: 'u16', + "name": "referrerName", + "isMut": true, + "isSigner": false }, { - name: 'name', - type: { - array: ['u8', 32], - }, + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] }, { - name: 'initializeUserStats', - accounts: [ + "name": "deposit", + "accounts": [ { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'payer', - isMut: true, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'systemProgram', - isMut: false, - isSigner: false, + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [ + { + "name": "marketIndex", + "type": "u16" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "reduceOnly", + "type": "bool" + } + ] }, { - name: 'initializeReferrerName', - accounts: [ + "name": "withdraw", + "accounts": [ { - name: 'referrerName', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'payer', - isMut: true, - isSigner: true, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram', - isMut: false, - isSigner: false, + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'name', - type: { - array: ['u8', 32], - }, + "name": "marketIndex", + "type": "u16" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "reduceOnly", + "type": "bool" + } + ] + }, + { + "name": "transferDeposit", + "accounts": [ + { + "name": "fromUser", + "isMut": true, + "isSigner": false + }, + { + "name": "toUser", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "spotMarketVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + }, + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "placePerpOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "OrderParams" + } + } + ] + }, + { + "name": "cancelOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "orderId", + "type": { + "option": "u32" + } + } + ] + }, + { + "name": "cancelOrderByUserId", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "userOrderId", + "type": "u8" + } + ] + }, + { + "name": "cancelOrders", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "marketType", + "type": { + "option": { + "defined": "MarketType" + } + } + }, + { + "name": "marketIndex", + "type": { + "option": "u16" + } + }, + { + "name": "direction", + "type": { + "option": { + "defined": "PositionDirection" + } + } + } + ] + }, + { + "name": "cancelOrdersByIds", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "orderIds", + "type": { + "vec": "u32" + } + } + ] + }, + { + "name": "modifyOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "orderId", + "type": { + "option": "u32" + } + }, + { + "name": "modifyOrderParams", + "type": { + "defined": "ModifyOrderParams" + } + } + ] + }, + { + "name": "modifyOrderByUserId", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "userOrderId", + "type": "u8" + }, + { + "name": "modifyOrderParams", + "type": { + "defined": "ModifyOrderParams" + } + } + ] + }, + { + "name": "placeAndTakePerpOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "OrderParams" + } + }, + { + "name": "makerOrderId", + "type": { + "option": "u32" + } + } + ] + }, + { + "name": "placeAndMakePerpOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false + }, + { + "name": "taker", + "isMut": true, + "isSigner": false + }, + { + "name": "takerStats", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "OrderParams" + } + }, + { + "name": "takerOrderId", + "type": "u32" + } + ] + }, + { + "name": "placeSpotOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "OrderParams" + } + } + ] + }, + { + "name": "placeAndTakeSpotOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } ], + "args": [ + { + "name": "params", + "type": { + "defined": "OrderParams" + } + }, + { + "name": "fulfillmentType", + "type": { + "option": { + "defined": "SpotFulfillmentType" + } + } + }, + { + "name": "makerOrderId", + "type": { + "option": "u32" + } + } + ] }, { - name: 'deposit', - accounts: [ + "name": "placeAndMakeSpotOrder", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "taker", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "takerStats", + "isMut": true, + "isSigner": false }, { - name: 'userTokenAccount', - isMut: true, - isSigner: false, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "params", + "type": { + "defined": "OrderParams" + } }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', + "name": "takerOrderId", + "type": "u32" }, { - name: 'amount', - type: 'u64', + "name": "fulfillmentType", + "type": { + "option": { + "defined": "SpotFulfillmentType" + } + } + } + ] + }, + { + "name": "placeOrders", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'reduceOnly', - type: 'bool', + "name": "user", + "isMut": true, + "isSigner": false }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } ], + "args": [ + { + "name": "params", + "type": { + "vec": { + "defined": "OrderParams" + } + } + } + ] }, { - name: 'withdraw', - accounts: [ + "name": "beginSwap", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "outSpotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "inSpotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'userTokenAccount', - isMut: true, - isSigner: false, + "name": "outTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "inTokenAccount", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: 'amount', - type: 'u64', + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'reduceOnly', - type: 'bool', - }, + "name": "instructions", + "isMut": false, + "isSigner": false, + "docs": [ + "Instructions Sysvar for instruction introspection" + ] + } ], - }, - { - name: 'transferDeposit', - accounts: [ + "args": [ { - name: 'fromUser', - isMut: true, - isSigner: false, + "name": "inMarketIndex", + "type": "u16" }, { - name: 'toUser', - isMut: true, - isSigner: false, + "name": "outMarketIndex", + "type": "u16" }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "amountIn", + "type": "u64" + } + ] + }, + { + "name": "endSwap", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: false, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', + "name": "outSpotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'amount', - type: 'u64', + "name": "inSpotMarketVault", + "isMut": true, + "isSigner": false }, - ], - }, - { - name: 'placePerpOrder', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "outTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "inTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'params', - type: { - defined: 'OrderParams', - }, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, + { + "name": "instructions", + "isMut": false, + "isSigner": false, + "docs": [ + "Instructions Sysvar for instruction introspection" + ] + } ], - }, - { - name: 'cancelOrder', - accounts: [ + "args": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "inMarketIndex", + "type": "u16" }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "outMarketIndex", + "type": "u16" }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "limitPrice", + "type": { + "option": "u64" + } }, - ], - args: [ { - name: 'orderId', - type: { - option: 'u32', - }, - }, - ], + "name": "reduceOnly", + "type": { + "option": { + "defined": "SwapReduceOnly" + } + } + } + ] }, { - name: 'cancelOrderByUserId', - accounts: [ + "name": "addPerpLpShares", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], - args: [ + "args": [ { - name: 'userOrderId', - type: 'u8', + "name": "nShares", + "type": "u64" }, - ], + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'cancelOrders', - accounts: [ + "name": "removePerpLpShares", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], - args: [ - { - name: 'marketType', - type: { - option: { - defined: 'MarketType', - }, - }, - }, + "args": [ { - name: 'marketIndex', - type: { - option: 'u16', - }, + "name": "sharesToBurn", + "type": "u64" }, { - name: 'direction', - type: { - option: { - defined: 'PositionDirection', - }, - }, - }, - ], + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'cancelOrdersByIds', - accounts: [ - { - name: 'state', - isMut: false, - isSigner: false, - }, + "name": "removePerpLpSharesInExpiringMarket", + "accounts": [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "user", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'orderIds', - type: { - vec: 'u32', - }, + "name": "sharesToBurn", + "type": "u64" }, - ], + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'modifyOrder', - accounts: [ + "name": "updateUserName", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], - args: [ + "args": [ { - name: 'orderId', - type: { - option: 'u32', - }, + "name": "subAccountId", + "type": "u16" }, { - name: 'modifyOrderParams', - type: { - defined: 'ModifyOrderParams', - }, - }, - ], + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] }, { - name: 'modifyOrderByUserId', - accounts: [ + "name": "updateUserCustomMarginRatio", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], - args: [ + "args": [ { - name: 'userOrderId', - type: 'u8', + "name": "subAccountId", + "type": "u16" }, { - name: 'modifyOrderParams', - type: { - defined: 'ModifyOrderParams', - }, - }, - ], + "name": "marginRatio", + "type": "u32" + } + ] }, { - name: 'placeAndTakePerpOrder', - accounts: [ + "name": "updateUserMarginTradingEnabled", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "subAccountId", + "type": "u16" }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "marginTradingEnabled", + "type": "bool" + } + ] + }, + { + "name": "updateUserDelegate", + "accounts": [ + { + "name": "user", + "isMut": true, + "isSigner": false }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } ], - args: [ + "args": [ { - name: 'params', - type: { - defined: 'OrderParams', - }, + "name": "subAccountId", + "type": "u16" }, { - name: 'makerOrderId', - type: { - option: 'u32', - }, - }, - ], + "name": "delegate", + "type": "publicKey" + } + ] }, { - name: 'placeAndMakePerpOrder', - accounts: [ + "name": "updateUserReduceOnly", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "subAccountId", + "type": "u16" }, { - name: 'taker', - isMut: true, - isSigner: false, - }, + "name": "reduceOnly", + "type": "bool" + } + ] + }, + { + "name": "updateUserAdvancedLp", + "accounts": [ { - name: 'takerStats', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], - args: [ + "args": [ { - name: 'params', - type: { - defined: 'OrderParams', - }, + "name": "subAccountId", + "type": "u16" }, { - name: 'takerOrderId', - type: 'u32', - }, - ], + "name": "advancedLp", + "type": "bool" + } + ] }, { - name: 'placeSpotOrder', - accounts: [ + "name": "deleteUser", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "state", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'params', - type: { - defined: 'OrderParams', - }, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], + "args": [] }, { - name: 'placeAndTakeSpotOrder', - accounts: [ - { - name: 'state', - isMut: false, - isSigner: false, - }, - { - name: 'user', - isMut: true, - isSigner: false, - }, + "name": "reclaimRent", + "accounts": [ { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "userStats", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'params', - type: { - defined: 'OrderParams', - }, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'fulfillmentType', - type: { - option: { - defined: 'SpotFulfillmentType', - }, - }, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'makerOrderId', - type: { - option: 'u32', - }, - }, + "name": "rent", + "isMut": false, + "isSigner": false + } ], + "args": [] }, { - name: 'placeAndMakeSpotOrder', - accounts: [ + "name": "fillPerpOrder", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'taker', - isMut: true, - isSigner: false, + "name": "fillerStats", + "isMut": true, + "isSigner": false }, { - name: 'takerStats', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "userStats", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'params', - type: { - defined: 'OrderParams', - }, - }, - { - name: 'takerOrderId', - type: 'u32', + "name": "orderId", + "type": { + "option": "u32" + } }, { - name: 'fulfillmentType', - type: { - option: { - defined: 'SpotFulfillmentType', - }, - }, - }, - ], + "name": "makerOrderId", + "type": { + "option": "u32" + } + } + ] }, { - name: 'placeOrders', - accounts: [ + "name": "revertFill", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "filler", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'params', - type: { - vec: { - defined: 'OrderParams', - }, - }, - }, + "name": "fillerStats", + "isMut": true, + "isSigner": false + } ], + "args": [] }, { - name: 'beginSwap', - accounts: [ + "name": "fillSpotOrder", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "fillerStats", + "isMut": true, + "isSigner": false }, { - name: 'outSpotMarketVault', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'inSpotMarketVault', - isMut: true, - isSigner: false, - }, + "name": "userStats", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'outTokenAccount', - isMut: true, - isSigner: false, + "name": "orderId", + "type": { + "option": "u32" + } }, { - name: 'inTokenAccount', - isMut: true, - isSigner: false, + "name": "fulfillmentType", + "type": { + "option": { + "defined": "SpotFulfillmentType" + } + } }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "makerOrderId", + "type": { + "option": "u32" + } + } + ] + }, + { + "name": "triggerOrder", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'instructions', - isMut: false, - isSigner: false, - docs: ['Instructions Sysvar for instruction introspection'], + "name": "filler", + "isMut": true, + "isSigner": false }, + { + "name": "user", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ + { + "name": "orderId", + "type": "u32" + } + ] + }, + { + "name": "forceCancelOrders", + "accounts": [ { - name: 'inMarketIndex', - type: 'u16', + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'outMarketIndex', - type: 'u16', + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'amountIn', - type: 'u64', + "name": "filler", + "isMut": true, + "isSigner": false }, + { + "name": "user", + "isMut": true, + "isSigner": false + } ], + "args": [] }, { - name: 'endSwap', - accounts: [ + "name": "updateUserIdle", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "user", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateUserOpenOrdersCount", + "accounts": [ { - name: 'outSpotMarketVault', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'inSpotMarketVault', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'outTokenAccount', - isMut: true, - isSigner: false, + "name": "filler", + "isMut": true, + "isSigner": false }, { - name: 'inTokenAccount', - isMut: true, - isSigner: false, - }, + "name": "user", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "adminDisableUpdatePerpBidAskTwap", + "accounts": [ { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'instructions', - isMut: false, - isSigner: false, - docs: ['Instructions Sysvar for instruction introspection'], - }, + "name": "userStats", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'inMarketIndex', - type: 'u16', - }, + "name": "disable", + "type": "bool" + } + ] + }, + { + "name": "settlePnl", + "accounts": [ { - name: 'outMarketIndex', - type: 'u16', + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'limitPrice', - type: { - option: 'u64', - }, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'reduceOnly', - type: { - option: { - defined: 'SwapReduceOnly', - }, - }, + "name": "authority", + "isMut": false, + "isSigner": true }, + { + "name": "spotMarketVault", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'addPerpLpShares', - accounts: [ + "name": "settleMultiplePnls", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, + { + "name": "spotMarketVault", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'nShares', - type: 'u64', + "name": "marketIndexes", + "type": { + "vec": "u16" + } }, { - name: 'marketIndex', - type: 'u16', - }, - ], + "name": "mode", + "type": { + "defined": "SettlePnlMode" + } + } + ] }, { - name: 'removePerpLpShares', - accounts: [ + "name": "settleFundingPayment", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, - }, + "name": "user", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "settleLp", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "user", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'sharesToBurn', - type: 'u64', - }, + "name": "marketIndex", + "type": "u16" + } + ] + }, + { + "name": "settleExpiredMarket", + "accounts": [ { - name: 'marketIndex', - type: 'u16', + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'removePerpLpSharesInExpiringMarket', - accounts: [ + "name": "liquidatePerp", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, - ], - args: [ { - name: 'sharesToBurn', - type: 'u64', + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'marketIndex', - type: 'u16', + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, - ], - }, - { - name: 'updateUserName', - accounts: [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "userStats", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'subAccountId', - type: 'u16', + "name": "marketIndex", + "type": "u16" }, { - name: 'name', - type: { - array: ['u8', 32], - }, + "name": "liquidatorMaxBaseAssetAmount", + "type": "u64" }, - ], + { + "name": "limitPrice", + "type": { + "option": "u64" + } + } + ] }, { - name: 'updateUserCustomMarginRatio', - accounts: [ + "name": "liquidatePerpWithFill", + "accounts": [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "liquidator", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'subAccountId', - type: 'u16', + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, { - name: 'marginRatio', - type: 'u32', + "name": "user", + "isMut": true, + "isSigner": false }, + { + "name": "userStats", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'updateUserMarginTradingEnabled', - accounts: [ + "name": "liquidateSpot", + "accounts": [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, - ], - args: [ { - name: 'subAccountId', - type: 'u16', + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'marginTradingEnabled', - type: 'bool', + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, - ], - }, - { - name: 'updateUserDelegate', - accounts: [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false + }, + { + "name": "userStats", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "assetMarketIndex", + "type": "u16" }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "liabilityMarketIndex", + "type": "u16" }, - ], - args: [ { - name: 'subAccountId', - type: 'u16', + "name": "liquidatorMaxLiabilityTransfer", + "type": "u128" }, { - name: 'delegate', - type: 'publicKey', - }, - ], + "name": "limitPrice", + "type": { + "option": "u64" + } + } + ] }, { - name: 'updateUserReduceOnly', - accounts: [ + "name": "liquidateBorrowForPerpPnl", + "accounts": [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, - ], - args: [ { - name: 'subAccountId', - type: 'u16', + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'reduceOnly', - type: 'bool', + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, - ], - }, - { - name: 'updateUserAdvancedLp', - accounts: [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "userStats", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'subAccountId', - type: 'u16', + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'advancedLp', - type: 'bool', + "name": "spotMarketIndex", + "type": "u16" }, - ], + { + "name": "liquidatorMaxLiabilityTransfer", + "type": "u128" + }, + { + "name": "limitPrice", + "type": { + "option": "u64" + } + } + ] }, { - name: 'deleteUser', - accounts: [ + "name": "liquidatePerpPnlForDeposit", + "accounts": [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, - ], - args: [], - }, - { - name: 'reclaimRent', - accounts: [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "spotMarketIndex", + "type": "u16" }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "liquidatorMaxPnlTransfer", + "type": "u128" }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "limitPrice", + "type": { + "option": "u64" + } + } + ] + }, + { + "name": "setUserStatusToBeingLiquidated", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "user", + "isMut": true, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: 'fillPerpOrder', - accounts: [ + "name": "resolvePerpPnlDeficit", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler', - isMut: true, - isSigner: false, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'fillerStats', - isMut: true, - isSigner: false, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'orderId', - type: { - option: 'u32', - }, + "name": "spotMarketIndex", + "type": "u16" }, { - name: 'makerOrderId', - type: { - option: 'u32', - }, - }, - ], + "name": "perpMarketIndex", + "type": "u16" + } + ] }, { - name: 'revertFill', - accounts: [ + "name": "resolvePerpBankruptcy", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler', - isMut: true, - isSigner: false, + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'fillerStats', - isMut: true, - isSigner: false, + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, - ], - args: [], - }, - { - name: 'fillSpotOrder', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'filler', - isMut: true, - isSigner: false, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'fillerStats', - isMut: true, - isSigner: false, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], - args: [ - { - name: 'orderId', - type: { - option: 'u32', - }, - }, + "args": [ { - name: 'fulfillmentType', - type: { - option: { - defined: 'SpotFulfillmentType', - }, - }, + "name": "quoteSpotMarketIndex", + "type": "u16" }, { - name: 'makerOrderId', - type: { - option: 'u32', - }, - }, - ], + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'triggerOrder', - accounts: [ + "name": "resolveSpotBankruptcy", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'filler', - isMut: true, - isSigner: false, + "name": "liquidator", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "liquidatorStats", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'orderId', - type: 'u32', + "name": "user", + "isMut": true, + "isSigner": false }, - ], - }, - { - name: 'forceCancelOrders', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'filler', - isMut: true, - isSigner: false, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'updateUserIdle', - accounts: [ + "name": "settleRevenueToInsuranceFund", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'filler', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [ + { + "name": "spotMarketIndex", + "type": "u16" + } + ] }, { - name: 'updateUserOpenOrdersCount', - accounts: [ + "name": "updateFundingRate", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'filler', - isMut: true, - isSigner: false, - }, - { - name: 'user', - isMut: true, - isSigner: false, - }, + "name": "oracle", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'adminDisableUpdatePerpBidAskTwap', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updatePrelaunchOracle", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "perpMarket", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'disable', - type: 'bool', - }, + "name": "oracle", + "isMut": true, + "isSigner": false + } ], + "args": [] }, { - name: 'settlePnl', - accounts: [ + "name": "updatePerpBidAskTwap", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: false, - isSigner: false, + "name": "keeperStats", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], + "args": [] }, { - name: 'settleFundingPayment', - accounts: [ + "name": "updateSpotMarketCumulativeInterest", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "oracle", + "isMut": false, + "isSigner": false }, + { + "name": "spotMarketVault", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: 'settleLp', - accounts: [ + "name": "updateAmms", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, - }, + "name": "authority", + "isMut": false, + "isSigner": true + } ], - args: [ + "args": [ { - name: 'marketIndex', - type: 'u16', - }, - ], + "name": "marketIndexes", + "type": { + "array": [ + "u16", + 5 + ] + } + } + ] }, { - name: 'settleExpiredMarket', - accounts: [ + "name": "updateSpotMarketExpiry", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "expiryTs", + "type": "i64" + } + ] }, { - name: 'liquidatePerp', - accounts: [ + "name": "updateUserQuoteAssetInsuranceStake", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'liquidator', - isMut: true, - isSigner: false, + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "signer", + "isMut": false, + "isSigner": true }, { - name: 'userStats', - isMut: true, - isSigner: false, - }, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [] + }, + { + "name": "updateUserGovTokenInsuranceStake", + "accounts": [ { - name: 'marketIndex', - type: 'u16', + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'liquidatorMaxBaseAssetAmount', - type: 'u64', + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'limitPrice', - type: { - option: 'u64', - }, + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, - ], - }, - { - name: 'liquidateSpot', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "signer", + "isMut": false, + "isSigner": true }, { - name: 'liquidator', - isMut: true, - isSigner: false, - }, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializeInsuranceFundStake", + "accounts": [ { - name: 'liquidatorStats', - isMut: true, - isSigner: false, + "name": "spotMarket", + "isMut": false, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'assetMarketIndex', - type: 'u16', + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'liabilityMarketIndex', - type: 'u16', + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'liquidatorMaxLiabilityTransfer', - type: 'u128', + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: 'limitPrice', - type: { - option: 'u64', - }, + "name": "rent", + "isMut": false, + "isSigner": false }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'liquidateBorrowForPerpPnl', - accounts: [ + "name": "addInsuranceFundStake", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'liquidator', - isMut: true, - isSigner: false, + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'perpMarketIndex', - type: 'u16', + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketIndex', - type: 'u16', + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'liquidatorMaxLiabilityTransfer', - type: 'u128', + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'limitPrice', - type: { - option: 'u64', - }, - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + }, + { + "name": "amount", + "type": "u64" + } + ] }, { - name: 'liquidatePerpPnlForDeposit', - accounts: [ + "name": "requestRemoveInsuranceFundStake", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'liquidator', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorStats', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'user', - isMut: true, - isSigner: false, - }, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "marketIndex", + "type": "u16" }, - ], - args: [ { - name: 'perpMarketIndex', - type: 'u16', + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "cancelRequestRemoveInsuranceFundStake", + "accounts": [ + { + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketIndex', - type: 'u16', + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'liquidatorMaxPnlTransfer', - type: 'u128', + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'limitPrice', - type: { - option: 'u64', - }, + "name": "authority", + "isMut": false, + "isSigner": true }, + { + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'resolvePerpPnlDeficit', - accounts: [ + "name": "removeInsuranceFundStake", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'spotMarketIndex', - type: 'u16', + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'perpMarketIndex', - type: 'u16', + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'resolvePerpBankruptcy', - accounts: [ - { - name: 'state', - isMut: false, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, + "name": "transferProtocolIfShares", + "accounts": [ { - name: 'liquidator', - isMut: true, - isSigner: false, + "name": "signer", + "isMut": false, + "isSigner": true }, { - name: 'liquidatorStats', - isMut: true, - isSigner: false, + "name": "transferConfig", + "isMut": true, + "isSigner": false }, { - name: 'user', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "insuranceFundStake", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "userStats", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, + "name": "insuranceFundVault", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'quoteSpotMarketIndex', - type: 'u16', + "name": "marketIndex", + "type": "u16" }, { - name: 'marketIndex', - type: 'u16', - }, - ], + "name": "shares", + "type": "u128" + } + ] }, { - name: 'resolveSpotBankruptcy', - accounts: [ + "name": "updatePythPullOracle", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "keeper", + "isMut": true, + "isSigner": true }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false }, { - name: 'liquidator', - isMut: true, - isSigner: false, + "name": "encodedVaa", + "isMut": false, + "isSigner": false }, { - name: 'liquidatorStats', - isMut: true, - isSigner: false, - }, + "name": "priceFeed", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'user', - isMut: true, - isSigner: false, + "name": "feedId", + "type": { + "array": [ + "u8", + 32 + ] + } }, { - name: 'userStats', - isMut: true, - isSigner: false, - }, + "name": "params", + "type": "bytes" + } + ] + }, + { + "name": "postPythPullOracleUpdateAtomic", + "accounts": [ { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "keeper", + "isMut": true, + "isSigner": true }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "guardianSet", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, + "name": "priceFeed", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'marketIndex', - type: 'u16', + "name": "feedId", + "type": { + "array": [ + "u8", + 32 + ] + } }, - ], + { + "name": "params", + "type": "bytes" + } + ] }, { - name: 'settleRevenueToInsuranceFund', - accounts: [ + "name": "postMultiPythPullOracleUpdatesAtomic", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "keeper", + "isMut": true, + "isSigner": true }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, - }, + "name": "guardianSet", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'driftSigner', - isMut: false, - isSigner: false, - }, + "name": "params", + "type": "bytes" + } + ] + }, + { + "name": "initialize", + "accounts": [ { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'spotMarketIndex', - type: 'u16', + "name": "quoteAssetMint", + "isMut": false, + "isSigner": false }, - ], - }, - { - name: 'updateFundingRate', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, + "name": "systemProgram", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], + "args": [] }, { - name: 'updatePerpBidAskTwap', - accounts: [ - { - name: 'state', - isMut: false, - isSigner: false, - }, + "name": "initializeSpotMarket", + "accounts": [ { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, + "name": "spotMarketMint", + "isMut": false, + "isSigner": false }, { - name: 'keeperStats', - isMut: false, - isSigner: false, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, - ], - args: [], - }, - { - name: 'updateSpotMarketCumulativeInterest', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, - ], - args: [], - }, - { - name: 'updateAmms', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "systemProgram", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'marketIndexes', - type: { - array: ['u16', 5], - }, - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], - }, - { - name: 'updateSpotMarketExpiry', - accounts: [ + "args": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "optimalUtilization", + "type": "u32" }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "optimalBorrowRate", + "type": "u32" }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "maxBorrowRate", + "type": "u32" }, - ], - args: [ { - name: 'expiryTs', - type: 'i64', + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } }, - ], - }, - { - name: 'updateUserQuoteAssetInsuranceStake', - accounts: [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "initialAssetWeight", + "type": "u32" }, { - name: 'spotMarket', - isMut: false, - isSigner: false, + "name": "maintenanceAssetWeight", + "type": "u32" }, { - name: 'insuranceFundStake', - isMut: true, - isSigner: false, + "name": "initialLiabilityWeight", + "type": "u32" }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "maintenanceLiabilityWeight", + "type": "u32" }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "imfFactor", + "type": "u32" }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "liquidatorFee", + "type": "u32" }, - ], - args: [], - }, - { - name: 'initializeInsuranceFundStake', - accounts: [ { - name: 'spotMarket', - isMut: false, - isSigner: false, + "name": "ifLiquidationFee", + "type": "u32" }, { - name: 'insuranceFundStake', - isMut: true, - isSigner: false, + "name": "activeStatus", + "type": "bool" }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "assetTier", + "type": { + "defined": "AssetTier" + } }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "scaleInitialAssetWeightStart", + "type": "u64" }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "withdrawGuardThreshold", + "type": "u64" }, { - name: 'payer', - isMut: true, - isSigner: true, + "name": "orderTickSize", + "type": "u64" }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "orderStepSize", + "type": "u64" }, { - name: 'systemProgram', - isMut: false, - isSigner: false, + "name": "ifTotalFactor", + "type": "u32" }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', - }, - ], + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] }, { - name: 'addInsuranceFundStake', - accounts: [ + "name": "deleteInitializedSpotMarket", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'spotMarket', - isMut: false, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundStake', - isMut: true, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "insuranceFundVault", + "isMut": true, + "isSigner": false }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'driftSigner', - isMut: false, - isSigner: false, - }, + "name": "marketIndex", + "type": "u16" + } + ] + }, + { + "name": "initializeSerumFulfillmentConfig", + "accounts": [ { - name: 'userTokenAccount', - isMut: true, - isSigner: false, + "name": "baseSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "quoteSpotMarket", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'amount', - type: 'u64', + "name": "serumProgram", + "isMut": false, + "isSigner": false }, - ], - }, - { - name: 'requestRemoveInsuranceFundStake', - accounts: [ { - name: 'spotMarket', - isMut: false, - isSigner: false, + "name": "serumMarket", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundStake', - isMut: true, - isSigner: false, + "name": "serumOpenOrders", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "serumFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'amount', - type: 'u64', - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'cancelRequestRemoveInsuranceFundStake', - accounts: [ - { - name: 'spotMarket', - isMut: false, - isSigner: false, - }, + "name": "updateSerumFulfillmentConfigStatus", + "accounts": [ { - name: 'insuranceFundStake', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "serumFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, - }, + "name": "admin", + "isMut": true, + "isSigner": true + } ], - args: [ + "args": [ { - name: 'marketIndex', - type: 'u16', - }, - ], + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } + } + ] }, { - name: 'removeInsuranceFundStake', - accounts: [ + "name": "initializeOpenbookV2FulfillmentConfig", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "baseSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: false, - isSigner: false, + "name": "quoteSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundStake', - isMut: true, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "openbookV2Program", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "openbookV2Market", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "openbookV2FulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'userTokenAccount', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "rent", + "isMut": false, + "isSigner": false }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] + }, + { + "name": "openbookV2FulfillmentConfigStatus", + "accounts": [ { - name: 'marketIndex', - type: 'u16', + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "openbookV2FulfillmentConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + } ], + "args": [ + { + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } + } + ] }, { - name: 'transferProtocolIfShares', - accounts: [ + "name": "initializePhoenixFulfillmentConfig", + "accounts": [ { - name: 'signer', - isMut: false, - isSigner: true, + "name": "baseSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'transferConfig', - isMut: true, - isSigner: false, + "name": "quoteSpotMarket", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "phoenixProgram", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundStake', - isMut: true, - isSigner: false, + "name": "phoenixMarket", + "isMut": false, + "isSigner": false }, { - name: 'userStats', - isMut: true, - isSigner: false, + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: false, - isSigner: true, + "name": "phoenixFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'shares', - type: 'u128', - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'initialize', - accounts: [ + "name": "phoenixFulfillmentConfigStatus", + "accounts": [ { - name: 'admin', - isMut: true, - isSigner: true, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "phoenixFulfillmentConfig", + "isMut": true, + "isSigner": false }, { - name: 'quoteAssetMint', - isMut: false, - isSigner: false, - }, + "name": "admin", + "isMut": true, + "isSigner": true + } + ], + "args": [ { - name: 'driftSigner', - isMut: false, - isSigner: false, - }, + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } + } + ] + }, + { + "name": "updateSerumVault", + "accounts": [ { - name: 'rent', - isMut: false, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'systemProgram', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, + "name": "srmVault", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: 'initializeSpotMarket', - accounts: [ - { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "initializePerpMarket", + "accounts": [ { - name: 'spotMarketMint', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'admin', - isMut: true, - isSigner: true, + "name": "marketIndex", + "type": "u16" }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "ammBaseAssetReserve", + "type": "u128" }, { - name: 'systemProgram', - isMut: false, - isSigner: false, + "name": "ammQuoteAssetReserve", + "type": "u128" }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "ammPeriodicity", + "type": "i64" }, - ], - args: [ { - name: 'optimalUtilization', - type: 'u32', + "name": "ammPegMultiplier", + "type": "u128" }, { - name: 'optimalBorrowRate', - type: 'u32', + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } }, { - name: 'maxBorrowRate', - type: 'u32', + "name": "contractTier", + "type": { + "defined": "ContractTier" + } }, { - name: 'oracleSource', - type: { - defined: 'OracleSource', - }, + "name": "marginRatioInitial", + "type": "u32" }, { - name: 'initialAssetWeight', - type: 'u32', + "name": "marginRatioMaintenance", + "type": "u32" }, { - name: 'maintenanceAssetWeight', - type: 'u32', + "name": "liquidatorFee", + "type": "u32" }, { - name: 'initialLiabilityWeight', - type: 'u32', + "name": "ifLiquidationFee", + "type": "u32" }, { - name: 'maintenanceLiabilityWeight', - type: 'u32', + "name": "imfFactor", + "type": "u32" }, { - name: 'imfFactor', - type: 'u32', + "name": "activeStatus", + "type": "bool" }, { - name: 'liquidatorFee', - type: 'u32', + "name": "baseSpread", + "type": "u32" }, { - name: 'activeStatus', - type: 'bool', + "name": "maxSpread", + "type": "u32" }, { - name: 'name', - type: { - array: ['u8', 32], - }, + "name": "maxOpenInterest", + "type": "u128" }, - ], - }, - { - name: 'initializeSerumFulfillmentConfig', - accounts: [ { - name: 'baseSpotMarket', - isMut: false, - isSigner: false, + "name": "maxRevenueWithdrawPerPeriod", + "type": "u64" }, { - name: 'quoteSpotMarket', - isMut: false, - isSigner: false, + "name": "quoteMaxInsurance", + "type": "u64" }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "orderStepSize", + "type": "u64" }, { - name: 'serumProgram', - isMut: false, - isSigner: false, + "name": "orderTickSize", + "type": "u64" }, { - name: 'serumMarket', - isMut: false, - isSigner: false, + "name": "minOrderSize", + "type": "u64" }, { - name: 'serumOpenOrders', - isMut: true, - isSigner: false, + "name": "concentrationCoefScale", + "type": "u128" }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "curveUpdateIntensity", + "type": "u8" }, { - name: 'serumFulfillmentConfig', - isMut: true, - isSigner: false, + "name": "ammJitIntensity", + "type": "u8" }, { - name: 'admin', - isMut: true, - isSigner: true, - }, + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + }, + { + "name": "initializePredictionMarket", + "accounts": [ { - name: 'rent', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'systemProgram', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], + "args": [] }, { - name: 'updateSerumFulfillmentConfigStatus', - accounts: [ + "name": "deleteInitializedPerpMarket", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'serumFulfillmentConfig', - isMut: true, - isSigner: false, + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'admin', - isMut: true, - isSigner: true, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'status', - type: { - defined: 'SpotFulfillmentConfigStatus', - }, - }, - ], + "name": "marketIndex", + "type": "u16" + } + ] }, { - name: 'initializePhoenixFulfillmentConfig', - accounts: [ - { - name: 'baseSpotMarket', - isMut: false, - isSigner: false, - }, + "name": "moveAmmPrice", + "accounts": [ { - name: 'quoteSpotMarket', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'phoenixProgram', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'phoenixMarket', - isMut: false, - isSigner: false, + "name": "baseAssetReserve", + "type": "u128" }, { - name: 'driftSigner', - isMut: false, - isSigner: false, + "name": "quoteAssetReserve", + "type": "u128" }, { - name: 'phoenixFulfillmentConfig', - isMut: true, - isSigner: false, - }, + "name": "sqrtK", + "type": "u128" + } + ] + }, + { + "name": "recenterPerpMarketAmm", + "accounts": [ { - name: 'admin', - isMut: true, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'marketIndex', - type: 'u16', + "name": "pegMultiplier", + "type": "u128" }, - ], + { + "name": "sqrtK", + "type": "u128" + } + ] }, { - name: 'phoenixFulfillmentConfigStatus', - accounts: [ + "name": "updatePerpMarketAmmSummaryStats", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'phoenixFulfillmentConfig', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'admin', - isMut: true, - isSigner: true, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'status', - type: { - defined: 'SpotFulfillmentConfigStatus', - }, + "name": "spotMarket", + "isMut": false, + "isSigner": false }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "params", + "type": { + "defined": "UpdatePerpMarketSummaryStatsParams" + } + } + ] }, { - name: 'updateSerumVault', - accounts: [ + "name": "updatePerpMarketExpiry", + "accounts": [ { - name: 'state', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'admin', - isMut: true, - isSigner: true, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'srmVault', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [], + "args": [ + { + "name": "expiryTs", + "type": "i64" + } + ] }, { - name: 'initializePerpMarket', - accounts: [ - { - name: 'admin', - isMut: true, - isSigner: true, - }, - { - name: 'state', - isMut: true, - isSigner: false, - }, + "name": "settleExpiredMarketPoolsToRevenuePool", + "accounts": [ { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [] + }, + { + "name": "depositIntoPerpMarketFeePool", + "accounts": [ { - name: 'marketIndex', - type: 'u16', + "name": "state", + "isMut": true, + "isSigner": false }, { - name: 'ammBaseAssetReserve', - type: 'u128', + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'ammQuoteAssetReserve', - type: 'u128', + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'ammPeriodicity', - type: 'i64', + "name": "sourceVault", + "isMut": true, + "isSigner": false }, { - name: 'ammPegMultiplier', - type: 'u128', + "name": "driftSigner", + "isMut": false, + "isSigner": false }, { - name: 'oracleSource', - type: { - defined: 'OracleSource', - }, + "name": "quoteSpotMarket", + "isMut": true, + "isSigner": false }, { - name: 'marginRatioInitial', - type: 'u32', + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'marginRatioMaintenance', - type: 'u32', - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'liquidatorFee', - type: 'u32', - }, + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "depositIntoSpotMarketVault", + "accounts": [ { - name: 'activeStatus', - type: 'bool', + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'name', - type: { - array: ['u8', 32], - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, - ], - }, - { - name: 'deleteInitializedPerpMarket', - accounts: [ { - name: 'admin', - isMut: true, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "sourceVault", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] }, { - name: 'moveAmmPrice', - accounts: [ + "name": "depositIntoSpotMarketRevenuePool", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "authority", + "isMut": true, + "isSigner": true }, - ], - args: [ { - name: 'baseAssetReserve', - type: 'u128', + "name": "spotMarketVault", + "isMut": true, + "isSigner": false }, { - name: 'quoteAssetReserve', - type: 'u128', + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: 'sqrtK', - type: 'u128', - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] }, { - name: 'recenterPerpMarketAmm', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "repegAmmCurve", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'pegMultiplier', - type: 'u128', + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'sqrtK', - type: 'u128', - }, + "name": "admin", + "isMut": false, + "isSigner": true + } ], + "args": [ + { + "name": "newPegCandidate", + "type": "u128" + } + ] }, { - name: 'updatePerpMarketExpiry', - accounts: [ + "name": "updatePerpMarketAmmOracleTwap", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "oracle", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'expiryTs', - type: 'i64', - }, + "name": "admin", + "isMut": false, + "isSigner": true + } ], + "args": [] }, { - name: 'settleExpiredMarketPoolsToRevenuePool', - accounts: [ + "name": "resetPerpMarketAmmOracleTwap", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'admin', - isMut: false, - isSigner: true, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "oracle", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "admin", + "isMut": false, + "isSigner": true + } ], - args: [], + "args": [] }, { - name: 'depositIntoPerpMarketFeePool', - accounts: [ + "name": "updateK", + "accounts": [ { - name: 'state', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'admin', - isMut: false, - isSigner: true, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, { - name: 'sourceVault', - isMut: true, - isSigner: false, - }, + "name": "oracle", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'driftSigner', - isMut: false, - isSigner: false, - }, + "name": "sqrtK", + "type": "u128" + } + ] + }, + { + "name": "updatePerpMarketMarginRatio", + "accounts": [ { - name: 'quoteSpotMarket', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'spotMarketVault', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'amount', - type: 'u64', + "name": "marginRatioInitial", + "type": "u32" }, - ], + { + "name": "marginRatioMaintenance", + "type": "u32" + } + ] }, { - name: 'depositIntoSpotMarketRevenuePool', - accounts: [ + "name": "updatePerpMarketFundingPeriod", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'authority', - isMut: true, - isSigner: true, - }, - { - name: 'spotMarketVault', - isMut: true, - isSigner: false, - }, - { - name: 'userTokenAccount', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'amount', - type: 'u64', - }, - ], + "name": "fundingPeriod", + "type": "i64" + } + ] }, { - name: 'repegAmmCurve', - accounts: [ + "name": "updatePerpMarketMaxImbalances", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "unrealizedMaxImbalance", + "type": "u64" }, - ], - args: [ { - name: 'newPegCandidate', - type: 'u128', + "name": "maxRevenueWithdrawPerPeriod", + "type": "u64" }, - ], + { + "name": "quoteMaxInsurance", + "type": "u64" + } + ] }, { - name: 'updatePerpMarketAmmOracleTwap', - accounts: [ + "name": "updatePerpMarketLiquidationFee", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } + ], + "args": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "liquidatorFee", + "type": "u32" }, - ], - args: [], + { + "name": "ifLiquidationFee", + "type": "u32" + } + ] }, { - name: 'resetPerpMarketAmmOracleTwap', - accounts: [ - { - name: 'state', - isMut: false, - isSigner: false, - }, + "name": "updateInsuranceFundUnstakingPeriod", + "accounts": [ { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'oracle', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [], + "args": [ + { + "name": "insuranceFundUnstakingPeriod", + "type": "i64" + } + ] }, { - name: 'updateK', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updateSpotMarketLiquidationFee", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'sqrtK', - type: 'u128', + "name": "liquidatorFee", + "type": "u32" }, - ], + { + "name": "ifLiquidationFee", + "type": "u32" + } + ] }, { - name: 'updatePerpMarketMarginRatio', - accounts: [ + "name": "updateWithdrawGuardThreshold", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'marginRatioInitial', - type: 'u32', - }, - { - name: 'marginRatioMaintenance', - type: 'u32', - }, - ], + "name": "withdrawGuardThreshold", + "type": "u64" + } + ] }, { - name: 'updatePerpMarketMaxImbalances', - accounts: [ + "name": "updateSpotMarketIfFactor", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'unrealizedMaxImbalance', - type: 'u64', + "name": "spotMarketIndex", + "type": "u16" }, { - name: 'maxRevenueWithdrawPerPeriod', - type: 'u64', + "name": "userIfFactor", + "type": "u32" }, { - name: 'quoteMaxInsurance', - type: 'u64', - }, - ], + "name": "totalIfFactor", + "type": "u32" + } + ] }, { - name: 'updatePerpMarketLiquidationFee', - accounts: [ + "name": "updateSpotMarketRevenueSettlePeriod", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ + { + "name": "revenueSettlePeriod", + "type": "i64" + } + ] + }, + { + "name": "updateSpotMarketStatus", + "accounts": [ { - name: 'liquidatorFee', - type: 'u32', + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'ifLiquidationFee', - type: 'u32', + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "status", + "type": { + "defined": "MarketStatus" + } + } + ] }, { - name: 'updateInsuranceFundUnstakingPeriod', - accounts: [ + "name": "updateSpotMarketPausedOperations", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'insuranceFundUnstakingPeriod', - type: 'i64', - }, - ], + "name": "pausedOperations", + "type": "u8" + } + ] }, { - name: 'updateSpotMarketLiquidationFee', - accounts: [ + "name": "updateSpotMarketAssetTier", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ + { + "name": "assetTier", + "type": { + "defined": "AssetTier" + } + } + ] + }, + { + "name": "updateSpotMarketMarginWeights", + "accounts": [ { - name: 'liquidatorFee', - type: 'u32', + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'ifLiquidationFee', - type: 'u32', + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - }, - { - name: 'updateWithdrawGuardThreshold', - accounts: [ + "args": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "initialAssetWeight", + "type": "u32" }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "maintenanceAssetWeight", + "type": "u32" }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "initialLiabilityWeight", + "type": "u32" }, - ], - args: [ { - name: 'withdrawGuardThreshold', - type: 'u64', + "name": "maintenanceLiabilityWeight", + "type": "u32" }, - ], + { + "name": "imfFactor", + "type": "u32" + } + ] }, { - name: 'updateSpotMarketIfFactor', - accounts: [ + "name": "updateSpotMarketBorrowRate", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'spotMarketIndex', - type: 'u16', + "name": "optimalUtilization", + "type": "u32" }, { - name: 'userIfFactor', - type: 'u32', + "name": "optimalBorrowRate", + "type": "u32" }, { - name: 'totalIfFactor', - type: 'u32', + "name": "maxBorrowRate", + "type": "u32" }, - ], + { + "name": "minBorrowRate", + "type": { + "option": "u8" + } + } + ] }, { - name: 'updateSpotMarketRevenueSettlePeriod', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updateSpotMarketMaxTokenDeposits", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'revenueSettlePeriod', - type: 'i64', - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "maxTokenDeposits", + "type": "u64" + } + ] }, { - name: 'updateSpotMarketStatus', - accounts: [ + "name": "updateSpotMarketMaxTokenBorrows", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'status', - type: { - defined: 'MarketStatus', - }, - }, - ], + "name": "maxTokenBorrowsFraction", + "type": "u16" + } + ] }, { - name: 'updateSpotMarketPausedOperations', - accounts: [ + "name": "updateSpotMarketScaleInitialAssetWeightStart", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'pausedOperations', - type: 'u8', - }, - ], + "name": "scaleInitialAssetWeightStart", + "type": "u64" + } + ] }, { - name: 'updateSpotMarketAssetTier', - accounts: [ + "name": "updateSpotMarketOracle", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "spotMarket", + "isMut": true, + "isSigner": false }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'assetTier', - type: { - defined: 'AssetTier', - }, + "name": "oracle", + "type": "publicKey" }, - ], + { + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } + } + ] }, { - name: 'updateSpotMarketMarginWeights', - accounts: [ + "name": "updateSpotMarketStepSizeAndTickSize", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'initialAssetWeight', - type: 'u32', + "name": "stepSize", + "type": "u64" }, { - name: 'maintenanceAssetWeight', - type: 'u32', - }, + "name": "tickSize", + "type": "u64" + } + ] + }, + { + "name": "updateSpotMarketMinOrderSize", + "accounts": [ { - name: 'initialLiabilityWeight', - type: 'u32', + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'maintenanceLiabilityWeight', - type: 'u32', + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'imfFactor', - type: 'u32', - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "orderSize", + "type": "u64" + } + ] }, { - name: 'updateSpotMarketBorrowRate', - accounts: [ + "name": "updateSpotMarketOrdersEnabled", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'optimalUtilization', - type: 'u32', - }, + "name": "ordersEnabled", + "type": "bool" + } + ] + }, + { + "name": "updateSpotMarketIfPausedOperations", + "accounts": [ { - name: 'optimalBorrowRate', - type: 'u32', + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'maxBorrowRate', - type: 'u32', + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "pausedOperations", + "type": "u8" + } + ] }, { - name: 'updateSpotMarketMaxTokenDeposits', - accounts: [ + "name": "updateSpotMarketName", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'maxTokenDeposits', - type: 'u64', - }, - ], + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] }, { - name: 'updateSpotMarketScaleInitialAssetWeightStart', - accounts: [ + "name": "updatePerpMarketStatus", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'scaleInitialAssetWeightStart', - type: 'u64', - }, - ], + "name": "status", + "type": { + "defined": "MarketStatus" + } + } + ] }, { - name: 'updateSpotMarketOracle', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updatePerpMarketPausedOperations", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'spotMarket', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'oracle', - isMut: false, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ - { - name: 'oracle', - type: 'publicKey', - }, + "args": [ { - name: 'oracleSource', - type: { - defined: 'OracleSource', - }, - }, - ], + "name": "pausedOperations", + "type": "u8" + } + ] }, { - name: 'updateSpotMarketStepSizeAndTickSize', - accounts: [ + "name": "updatePerpMarketContractTier", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'stepSize', - type: 'u64', - }, - { - name: 'tickSize', - type: 'u64', - }, - ], + "name": "contractTier", + "type": { + "defined": "ContractTier" + } + } + ] }, { - name: 'updateSpotMarketMinOrderSize', - accounts: [ + "name": "updatePerpMarketImfFactor", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'orderSize', - type: 'u64', + "name": "imfFactor", + "type": "u32" }, - ], + { + "name": "unrealizedPnlImfFactor", + "type": "u32" + } + ] }, { - name: 'updateSpotMarketOrdersEnabled', - accounts: [ + "name": "updatePerpMarketUnrealizedAssetWeight", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'ordersEnabled', - type: 'bool', + "name": "unrealizedInitialAssetWeight", + "type": "u32" }, - ], + { + "name": "unrealizedMaintenanceAssetWeight", + "type": "u32" + } + ] }, { - name: 'updateSpotMarketName', - accounts: [ + "name": "updatePerpMarketConcentrationCoef", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'spotMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - ], + "name": "concentrationScale", + "type": "u128" + } + ] }, { - name: 'updatePerpMarketStatus', - accounts: [ + "name": "updatePerpMarketCurveUpdateIntensity", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'status', - type: { - defined: 'MarketStatus', - }, - }, - ], + "name": "curveUpdateIntensity", + "type": "u8" + } + ] }, { - name: 'updatePerpMarketPausedOperations', - accounts: [ + "name": "updatePerpMarketTargetBaseAssetAmountPerLp", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'pausedOperations', - type: 'u8', - }, - ], + "name": "targetBaseAssetAmountPerLp", + "type": "i32" + } + ] }, { - name: 'updatePerpMarketContractTier', - accounts: [ + "name": "updatePerpMarketPerLpBase", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'contractTier', - type: { - defined: 'ContractTier', - }, - }, - ], + "name": "perLpBase", + "type": "i8" + } + ] }, { - name: 'updatePerpMarketImfFactor', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updateLpCooldownTime", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'imfFactor', - type: 'u32', - }, + "name": "lpCooldownTime", + "type": "u64" + } + ] + }, + { + "name": "updatePerpFeeStructure", + "accounts": [ { - name: 'unrealizedPnlImfFactor', - type: 'u32', + "name": "admin", + "isMut": false, + "isSigner": true }, + { + "name": "state", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "feeStructure", + "type": { + "defined": "FeeStructure" + } + } + ] }, { - name: 'updatePerpMarketUnrealizedAssetWeight', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updateSpotFeeStructure", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'unrealizedInitialAssetWeight', - type: 'u32', - }, + "name": "feeStructure", + "type": { + "defined": "FeeStructure" + } + } + ] + }, + { + "name": "updateInitialPctToLiquidate", + "accounts": [ { - name: 'unrealizedMaintenanceAssetWeight', - type: 'u32', + "name": "admin", + "isMut": false, + "isSigner": true }, + { + "name": "state", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "initialPctToLiquidate", + "type": "u16" + } + ] }, { - name: 'updatePerpMarketConcentrationCoef', - accounts: [ + "name": "updateLiquidationDuration", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, - }, - { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'concentrationScale', - type: 'u128', - }, - ], + "name": "liquidationDuration", + "type": "u8" + } + ] }, { - name: 'updatePerpMarketCurveUpdateIntensity', - accounts: [ + "name": "updateLiquidationMarginBufferRatio", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, - }, - { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'curveUpdateIntensity', - type: 'u8', - }, - ], + "name": "liquidationMarginBufferRatio", + "type": "u32" + } + ] }, { - name: 'updatePerpMarketTargetBaseAssetAmountPerLp', - accounts: [ + "name": "updateOracleGuardRails", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, - }, - { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'targetBaseAssetAmountPerLp', - type: 'i32', - }, - ], + "name": "oracleGuardRails", + "type": { + "defined": "OracleGuardRails" + } + } + ] }, { - name: 'updatePerpMarketPerLpBase', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updateStateSettlementDuration", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'perLpBase', - type: 'i8', - }, - ], + "name": "settlementDuration", + "type": "u16" + } + ] }, { - name: 'updateLpCooldownTime', - accounts: [ + "name": "updateStateMaxNumberOfSubAccounts", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'lpCooldownTime', - type: 'u64', - }, - ], + "name": "maxNumberOfSubAccounts", + "type": "u16" + } + ] }, { - name: 'updatePerpFeeStructure', - accounts: [ + "name": "updateStateMaxInitializeUserFee", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'feeStructure', - type: { - defined: 'FeeStructure', - }, - }, - ], + "name": "maxInitializeUserFee", + "type": "u16" + } + ] }, { - name: 'updateSpotFeeStructure', - accounts: [ + "name": "updatePerpMarketOracle", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "perpMarket", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'feeStructure', - type: { - defined: 'FeeStructure', - }, + "name": "oracle", + "isMut": false, + "isSigner": false }, + { + "name": "admin", + "isMut": false, + "isSigner": true + } ], + "args": [ + { + "name": "oracle", + "type": "publicKey" + }, + { + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } + } + ] }, { - name: 'updateInitialPctToLiquidate', - accounts: [ + "name": "updatePerpMarketBaseSpread", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'initialPctToLiquidate', - type: 'u16', - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "baseSpread", + "type": "u32" + } + ] }, { - name: 'updateLiquidationDuration', - accounts: [ + "name": "updateAmmJitIntensity", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'liquidationDuration', - type: 'u8', - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "ammJitIntensity", + "type": "u8" + } + ] }, { - name: 'updateLiquidationMarginBufferRatio', - accounts: [ + "name": "updatePerpMarketMaxSpread", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'liquidationMarginBufferRatio', - type: 'u32', - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "maxSpread", + "type": "u32" + } + ] }, { - name: 'updateOracleGuardRails', - accounts: [ + "name": "updatePerpMarketStepSizeAndTickSize", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'oracleGuardRails', - type: { - defined: 'OracleGuardRails', - }, + "name": "stepSize", + "type": "u64" }, - ], + { + "name": "tickSize", + "type": "u64" + } + ] }, { - name: 'updateStateSettlementDuration', - accounts: [ + "name": "updatePerpMarketName", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'settlementDuration', - type: 'u16', - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] }, { - name: 'updateStateMaxNumberOfSubAccounts', - accounts: [ + "name": "updatePerpMarketMinOrderSize", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'maxNumberOfSubAccounts', - type: 'u16', - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "orderSize", + "type": "u64" + } + ] }, { - name: 'updateStateMaxInitializeUserFee', - accounts: [ + "name": "updatePerpMarketMaxSlippageRatio", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'maxInitializeUserFee', - type: 'u16', - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - }, - { - name: 'updatePerpMarketOracle', - accounts: [ + "args": [ { - name: 'state', - isMut: false, - isSigner: false, - }, + "name": "maxSlippageRatio", + "type": "u16" + } + ] + }, + { + "name": "updatePerpMarketMaxFillReserveFraction", + "accounts": [ { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'oracle', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ + { + "name": "maxFillReserveFraction", + "type": "u16" + } + ] + }, + { + "name": "updatePerpMarketMaxOpenInterest", + "accounts": [ { - name: 'oracle', - type: 'publicKey', + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'oracleSource', - type: { - defined: 'OracleSource', - }, + "name": "state", + "isMut": false, + "isSigner": false }, + { + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], + "args": [ + { + "name": "maxOpenInterest", + "type": "u128" + } + ] }, { - name: 'updatePerpMarketBaseSpread', - accounts: [ + "name": "updatePerpMarketNumberOfUsers", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'baseSpread', - type: 'u32', + "name": "numberOfUsers", + "type": { + "option": "u32" + } }, - ], + { + "name": "numberOfUsersWithBase", + "type": { + "option": "u32" + } + } + ] }, { - name: 'updateAmmJitIntensity', - accounts: [ + "name": "updatePerpMarketFeeAdjustment", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'ammJitIntensity', - type: 'u8', - }, - ], + "name": "feeAdjustment", + "type": "i16" + } + ] }, { - name: 'updatePerpMarketMaxSpread', - accounts: [ + "name": "updateSpotMarketFeeAdjustment", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'maxSpread', - type: 'u32', - }, - ], + "name": "feeAdjustment", + "type": "i16" + } + ] }, { - name: 'updatePerpMarketStepSizeAndTickSize', - accounts: [ + "name": "updatePerpMarketFuel", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "perpMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'stepSize', - type: 'u64', + "name": "fuelBoostTaker", + "type": { + "option": "u8" + } }, { - name: 'tickSize', - type: 'u64', + "name": "fuelBoostMaker", + "type": { + "option": "u8" + } }, - ], + { + "name": "fuelBoostPosition", + "type": { + "option": "u8" + } + } + ] }, { - name: 'updatePerpMarketName', - accounts: [ + "name": "updateSpotMarketFuel", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "spotMarket", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'name', - type: { - array: ['u8', 32], - }, + "name": "fuelBoostDeposits", + "type": { + "option": "u8" + } }, - ], - }, - { - name: 'updatePerpMarketMinOrderSize', - accounts: [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "fuelBoostBorrows", + "type": { + "option": "u8" + } }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "fuelBoostTaker", + "type": { + "option": "u8" + } }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "fuelBoostMaker", + "type": { + "option": "u8" + } }, - ], - args: [ { - name: 'orderSize', - type: 'u64', - }, - ], + "name": "fuelBoostInsurance", + "type": { + "option": "u8" + } + } + ] }, { - name: 'updatePerpMarketMaxSlippageRatio', - accounts: [ + "name": "initUserFuel", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "user", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'maxSlippageRatio', - type: 'u16', - }, + "name": "userStats", + "isMut": true, + "isSigner": false + } ], - }, - { - name: 'updatePerpMarketMaxFillReserveFraction', - accounts: [ + "args": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "fuelBoostDeposits", + "type": { + "option": "u32" + } }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "fuelBoostBorrows", + "type": { + "option": "u32" + } }, { - name: 'perpMarket', - isMut: true, - isSigner: false, + "name": "fuelBoostTaker", + "type": { + "option": "u32" + } }, - ], - args: [ { - name: 'maxFillReserveFraction', - type: 'u16', + "name": "fuelBoostMaker", + "type": { + "option": "u32" + } }, - ], + { + "name": "fuelBoostInsurance", + "type": { + "option": "u32" + } + } + ] }, { - name: 'updatePerpMarketMaxOpenInterest', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updateAdmin", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'maxOpenInterest', - type: 'u128', - }, - ], + "name": "admin", + "type": "publicKey" + } + ] }, { - name: 'updatePerpMarketFeeAdjustment', - accounts: [ - { - name: 'admin', - isMut: false, - isSigner: true, - }, + "name": "updateWhitelistMint", + "accounts": [ { - name: 'state', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'perpMarket', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'feeAdjustment', - type: 'i16', - }, - ], + "name": "whitelistMint", + "type": "publicKey" + } + ] }, { - name: 'updateAdmin', - accounts: [ + "name": "updateDiscountMint", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'admin', - type: 'publicKey', - }, - ], + "name": "discountMint", + "type": "publicKey" + } + ] }, { - name: 'updateWhitelistMint', - accounts: [ + "name": "updateExchangeStatus", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'whitelistMint', - type: 'publicKey', - }, - ], + "name": "exchangeStatus", + "type": "u8" + } + ] }, { - name: 'updateDiscountMint', - accounts: [ + "name": "updatePerpAuctionDuration", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'discountMint', - type: 'publicKey', - }, - ], + "name": "minPerpAuctionDuration", + "type": "u8" + } + ] }, { - name: 'updateExchangeStatus', - accounts: [ + "name": "updateSpotAuctionDuration", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": false, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, - }, + "name": "state", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'exchangeStatus', - type: 'u8', - }, - ], + "name": "defaultSpotAuctionDuration", + "type": "u8" + } + ] }, { - name: 'updatePerpAuctionDuration', - accounts: [ + "name": "initializeProtocolIfSharesTransferConfig", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "protocolIfSharesTransferConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false }, - ], - args: [ { - name: 'minPerpAuctionDuration', - type: 'u8', + "name": "rent", + "isMut": false, + "isSigner": false }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], + "args": [] }, { - name: 'updateSpotAuctionDuration', - accounts: [ + "name": "updateProtocolIfSharesTransferConfig", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'state', - isMut: true, - isSigner: false, + "name": "protocolIfSharesTransferConfig", + "isMut": true, + "isSigner": false }, + { + "name": "state", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: 'defaultSpotAuctionDuration', - type: 'u8', + "name": "whitelistedSigners", + "type": { + "option": { + "array": [ + "publicKey", + 4 + ] + } + } }, - ], + { + "name": "maxTransferPerEpoch", + "type": { + "option": "u128" + } + } + ] }, { - name: 'adminRemoveInsuranceFundStake', - accounts: [ + "name": "initializePrelaunchOracle", + "accounts": [ { - name: 'admin', - isMut: false, - isSigner: true, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "prelaunchOracle", + "isMut": true, + "isSigner": false }, { - name: 'spotMarket', - isMut: false, - isSigner: false, + "name": "state", + "isMut": false, + "isSigner": false }, { - name: 'insuranceFundVault', - isMut: true, - isSigner: false, + "name": "rent", + "isMut": false, + "isSigner": false }, { - name: 'driftSigner', - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ { - name: 'adminTokenAccount', - isMut: true, - isSigner: false, - }, + "name": "params", + "type": { + "defined": "PrelaunchOracleParams" + } + } + ] + }, + { + "name": "updatePrelaunchOracleParams", + "accounts": [ { - name: 'tokenProgram', - isMut: false, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, - ], - args: [ { - name: 'marketIndex', - type: 'u16', + "name": "prelaunchOracle", + "isMut": true, + "isSigner": false }, { - name: 'amount', - type: 'u64', + "name": "perpMarket", + "isMut": true, + "isSigner": false }, + { + "name": "state", + "isMut": false, + "isSigner": false + } ], + "args": [ + { + "name": "params", + "type": { + "defined": "PrelaunchOracleParams" + } + } + ] }, { - name: 'initializeProtocolIfSharesTransferConfig', - accounts: [ - { - name: 'admin', - isMut: true, - isSigner: true, - }, + "name": "deletePrelaunchOracle", + "accounts": [ { - name: 'protocolIfSharesTransferConfig', - isMut: true, - isSigner: false, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "prelaunchOracle", + "isMut": true, + "isSigner": false }, { - name: 'rent', - isMut: false, - isSigner: false, + "name": "perpMarket", + "isMut": false, + "isSigner": false }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, + "name": "state", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [ + { + "name": "perpMarketIndex", + "type": "u16" + } + ] }, { - name: 'updateProtocolIfSharesTransferConfig', - accounts: [ + "name": "initializePythPullOracle", + "accounts": [ { - name: 'admin', - isMut: true, - isSigner: true, + "name": "admin", + "isMut": true, + "isSigner": true }, { - name: 'protocolIfSharesTransferConfig', - isMut: true, - isSigner: false, + "name": "pythSolanaReceiver", + "isMut": false, + "isSigner": false }, { - name: 'state', - isMut: false, - isSigner: false, + "name": "priceFeed", + "isMut": true, + "isSigner": false }, - ], - args: [ { - name: 'whitelistedSigners', - type: { - option: { - array: ['publicKey', 4], - }, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: 'maxTransferPerEpoch', - type: { - option: 'u128', - }, - }, + "name": "state", + "isMut": false, + "isSigner": false + } ], - }, + "args": [ + { + "name": "feedId", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } ], - accounts: [ + "accounts": [ { - name: 'phoenixV1FulfillmentConfig', - type: { - kind: 'struct', - fields: [ + "name": "OpenbookV2FulfillmentConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pubkey", + "type": "publicKey" + }, + { + "name": "openbookV2ProgramId", + "type": "publicKey" + }, { - name: 'pubkey', - type: 'publicKey', + "name": "openbookV2Market", + "type": "publicKey" }, { - name: 'phoenixProgramId', - type: 'publicKey', + "name": "openbookV2MarketAuthority", + "type": "publicKey" }, { - name: 'phoenixLogAuthority', - type: 'publicKey', + "name": "openbookV2EventHeap", + "type": "publicKey" }, { - name: 'phoenixMarket', - type: 'publicKey', + "name": "openbookV2Bids", + "type": "publicKey" }, { - name: 'phoenixBaseVault', - type: 'publicKey', + "name": "openbookV2Asks", + "type": "publicKey" }, { - name: 'phoenixQuoteVault', - type: 'publicKey', + "name": "openbookV2BaseVault", + "type": "publicKey" }, { - name: 'marketIndex', - type: 'u16', + "name": "openbookV2QuoteVault", + "type": "publicKey" }, { - name: 'fulfillmentType', - type: { - defined: 'SpotFulfillmentType', - }, + "name": "marketIndex", + "type": "u16" }, { - name: 'status', - type: { - defined: 'SpotFulfillmentConfigStatus', - }, + "name": "fulfillmentType", + "type": { + "defined": "SpotFulfillmentType" + } }, { - name: 'padding', - type: { - array: ['u8', 4], - }, + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } }, - ], - }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } }, { - name: 'serumV3FulfillmentConfig', - type: { - kind: 'struct', - fields: [ + "name": "PhoenixV1FulfillmentConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pubkey", + "type": "publicKey" + }, + { + "name": "phoenixProgramId", + "type": "publicKey" + }, + { + "name": "phoenixLogAuthority", + "type": "publicKey" + }, + { + "name": "phoenixMarket", + "type": "publicKey" + }, + { + "name": "phoenixBaseVault", + "type": "publicKey" + }, + { + "name": "phoenixQuoteVault", + "type": "publicKey" + }, + { + "name": "marketIndex", + "type": "u16" + }, + { + "name": "fulfillmentType", + "type": { + "defined": "SpotFulfillmentType" + } + }, { - name: 'pubkey', - type: 'publicKey', + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } }, { - name: 'serumProgramId', - type: 'publicKey', + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, + { + "name": "SerumV3FulfillmentConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pubkey", + "type": "publicKey" }, { - name: 'serumMarket', - type: 'publicKey', + "name": "serumProgramId", + "type": "publicKey" }, { - name: 'serumRequestQueue', - type: 'publicKey', + "name": "serumMarket", + "type": "publicKey" }, { - name: 'serumEventQueue', - type: 'publicKey', + "name": "serumRequestQueue", + "type": "publicKey" }, { - name: 'serumBids', - type: 'publicKey', + "name": "serumEventQueue", + "type": "publicKey" }, { - name: 'serumAsks', - type: 'publicKey', + "name": "serumBids", + "type": "publicKey" }, { - name: 'serumBaseVault', - type: 'publicKey', + "name": "serumAsks", + "type": "publicKey" }, { - name: 'serumQuoteVault', - type: 'publicKey', + "name": "serumBaseVault", + "type": "publicKey" }, { - name: 'serumOpenOrders', - type: 'publicKey', + "name": "serumQuoteVault", + "type": "publicKey" }, { - name: 'serumSignerNonce', - type: 'u64', + "name": "serumOpenOrders", + "type": "publicKey" }, { - name: 'marketIndex', - type: 'u16', + "name": "serumSignerNonce", + "type": "u64" }, { - name: 'fulfillmentType', - type: { - defined: 'SpotFulfillmentType', - }, + "name": "marketIndex", + "type": "u16" }, { - name: 'status', - type: { - defined: 'SpotFulfillmentConfigStatus', - }, + "name": "fulfillmentType", + "type": { + "defined": "SpotFulfillmentType" + } }, { - name: 'padding', - type: { - array: ['u8', 4], - }, + "name": "status", + "type": { + "defined": "SpotFulfillmentConfigStatus" + } }, - ], - }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } }, { - name: 'insuranceFundStake', - type: { - kind: 'struct', - fields: [ + "name": "insuranceFundStake", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "ifShares", + "type": "u128" + }, + { + "name": "lastWithdrawRequestShares", + "type": "u128" + }, { - name: 'authority', - type: 'publicKey', + "name": "ifBase", + "type": "u128" }, { - name: 'ifShares', - type: 'u128', + "name": "lastValidTs", + "type": "i64" }, { - name: 'lastWithdrawRequestShares', - type: 'u128', + "name": "lastWithdrawRequestValue", + "type": "u64" }, { - name: 'ifBase', - type: 'u128', + "name": "lastWithdrawRequestTs", + "type": "i64" }, { - name: 'lastValidTs', - type: 'i64', + "name": "costBasis", + "type": "i64" }, { - name: 'lastWithdrawRequestValue', - type: 'u64', + "name": "marketIndex", + "type": "u16" }, { - name: 'lastWithdrawRequestTs', - type: 'i64', + "name": "padding", + "type": { + "array": [ + "u8", + 14 + ] + } + } + ] + } + }, + { + "name": "ProtocolIfSharesTransferConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whitelistedSigners", + "type": { + "array": [ + "publicKey", + 4 + ] + } }, { - name: 'costBasis', - type: 'i64', + "name": "maxTransferPerEpoch", + "type": "u128" }, { - name: 'marketIndex', - type: 'u16', + "name": "currentEpochTransfer", + "type": "u128" }, { - name: 'padding', - type: { - array: ['u8', 14], - }, + "name": "nextEpochTs", + "type": "i64" }, - ], - }, + { + "name": "padding", + "type": { + "array": [ + "u128", + 8 + ] + } + } + ] + } }, { - name: 'protocolIfSharesTransferConfig', - type: { - kind: 'struct', - fields: [ + "name": "PrelaunchOracle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "price", + "type": "i64" + }, { - name: 'whitelistedSigners', - type: { - array: ['publicKey', 4], - }, + "name": "maxPrice", + "type": "i64" }, { - name: 'maxTransferPerEpoch', - type: 'u128', + "name": "confidence", + "type": "u64" }, { - name: 'currentEpochTransfer', - type: 'u128', + "name": "lastUpdateSlot", + "type": "u64" }, { - name: 'nextEpochTs', - type: 'i64', + "name": "ammLastUpdateSlot", + "type": "u64" }, { - name: 'padding', - type: { - array: ['u128', 8], - }, + "name": "perpMarketIndex", + "type": "u16" }, - ], - }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 70 + ] + } + } + ] + } }, { - name: 'perpMarket', - type: { - kind: 'struct', - fields: [ + "name": "PerpMarket", + "type": { + "kind": "struct", + "fields": [ { - name: 'pubkey', - docs: [ - "The perp market's address. It is a pda of the market index", + "name": "pubkey", + "docs": [ + "The perp market's address. It is a pda of the market index" ], - type: 'publicKey', + "type": "publicKey" }, { - name: 'amm', - docs: ['The automated market maker'], - type: { - defined: 'AMM', - }, + "name": "amm", + "docs": [ + "The automated market maker" + ], + "type": { + "defined": "AMM" + } }, { - name: 'pnlPool', - docs: [ + "name": "pnlPool", + "docs": [ "The market's pnl pool. When users settle negative pnl, the balance increases.", - 'When users settle positive pnl, the balance decreases. Can not go negative.', + "When users settle positive pnl, the balance decreases. Can not go negative." + ], + "type": { + "defined": "PoolBalance" + } + }, + { + "name": "name", + "docs": [ + "Encoded display name for the perp market e.g. SOL-PERP" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "insuranceClaim", + "docs": [ + "The perp market's claim on the insurance fund" ], - type: { - defined: 'PoolBalance', - }, + "type": { + "defined": "InsuranceClaim" + } }, { - name: 'name', - docs: ['Encoded display name for the perp market e.g. SOL-PERP'], - type: { - array: ['u8', 32], - }, + "name": "unrealizedPnlMaxImbalance", + "docs": [ + "The max pnl imbalance before positive pnl asset weight is discounted", + "pnl imbalance is the difference between long and short pnl. When it's greater than 0,", + "the amm has negative pnl and the initial asset weight for positive pnl is discounted", + "precision = QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'insuranceClaim', - docs: ["The perp market's claim on the insurance fund"], - type: { - defined: 'InsuranceClaim', - }, + "name": "expiryTs", + "docs": [ + "The ts when the market will be expired. Only set if market is in reduce only mode" + ], + "type": "i64" }, { - name: 'unrealizedPnlMaxImbalance', - docs: [ - 'The max pnl imbalance before positive pnl asset weight is discounted', - "pnl imbalance is the difference between long and short pnl. When it's greater than 0,", - 'the amm has negative pnl and the initial asset weight for positive pnl is discounted', - 'precision = QUOTE_PRECISION', + "name": "expiryPrice", + "docs": [ + "The price at which positions will be settled. Only set if market is expired", + "precision = PRICE_PRECISION" ], - type: 'u64', + "type": "i64" }, { - name: 'expiryTs', - docs: [ - 'The ts when the market will be expired. Only set if market is in reduce only mode', + "name": "nextFillRecordId", + "docs": [ + "Every trade has a fill record id. This is the next id to be used" ], - type: 'i64', + "type": "u64" }, { - name: 'expiryPrice', - docs: [ - 'The price at which positions will be settled. Only set if market is expired', - 'precision = PRICE_PRECISION', + "name": "nextFundingRateRecordId", + "docs": [ + "Every funding rate update has a record id. This is the next id to be used" ], - type: 'i64', + "type": "u64" }, { - name: 'nextFillRecordId', - docs: [ - 'Every trade has a fill record id. This is the next id to be used', + "name": "nextCurveRecordId", + "docs": [ + "Every amm k updated has a record id. This is the next id to be used" ], - type: 'u64', + "type": "u64" }, { - name: 'nextFundingRateRecordId', - docs: [ - 'Every funding rate update has a record id. This is the next id to be used', + "name": "imfFactor", + "docs": [ + "The initial margin fraction factor. Used to increase margin ratio for large positions", + "precision: MARGIN_PRECISION" ], - type: 'u64', + "type": "u32" }, { - name: 'nextCurveRecordId', - docs: [ - 'Every amm k updated has a record id. This is the next id to be used', + "name": "unrealizedPnlImfFactor", + "docs": [ + "The imf factor for unrealized pnl. Used to discount asset weight for large positive pnl", + "precision: MARGIN_PRECISION" ], - type: 'u64', + "type": "u32" }, { - name: 'imfFactor', - docs: [ - 'The initial margin fraction factor. Used to increase margin ratio for large positions', - 'precision: MARGIN_PRECISION', + "name": "liquidatorFee", + "docs": [ + "The fee the liquidator is paid for taking over perp position", + "precision: LIQUIDATOR_FEE_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'unrealizedPnlImfFactor', - docs: [ - 'The imf factor for unrealized pnl. Used to discount asset weight for large positive pnl', - 'precision: MARGIN_PRECISION', + "name": "ifLiquidationFee", + "docs": [ + "The fee the insurance fund receives from liquidation", + "precision: LIQUIDATOR_FEE_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'liquidatorFee', - docs: [ - 'The fee the liquidator is paid for taking over perp position', - 'precision: LIQUIDATOR_FEE_PRECISION', + "name": "marginRatioInitial", + "docs": [ + "The margin ratio which determines how much collateral is required to open a position", + "e.g. margin ratio of .1 means a user must have $100 of total collateral to open a $1000 position", + "precision: MARGIN_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'ifLiquidationFee', - docs: [ - 'The fee the insurance fund receives from liquidation', - 'precision: LIQUIDATOR_FEE_PRECISION', + "name": "marginRatioMaintenance", + "docs": [ + "The margin ratio which determines when a user will be liquidated", + "e.g. margin ratio of .05 means a user must have $50 of total collateral to maintain a $1000 position", + "else they will be liquidated", + "precision: MARGIN_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'marginRatioInitial', - docs: [ - 'The margin ratio which determines how much collateral is required to open a position', - 'e.g. margin ratio of .1 means a user must have $100 of total collateral to open a $1000 position', - 'precision: MARGIN_PRECISION', + "name": "unrealizedPnlInitialAssetWeight", + "docs": [ + "The initial asset weight for positive pnl. Negative pnl always has an asset weight of 1", + "precision: SPOT_WEIGHT_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'marginRatioMaintenance', - docs: [ - 'The margin ratio which determines when a user will be liquidated', - 'e.g. margin ratio of .05 means a user must have $50 of total collateral to maintain a $1000 position', - 'else they will be liquidated', - 'precision: MARGIN_PRECISION', + "name": "unrealizedPnlMaintenanceAssetWeight", + "docs": [ + "The maintenance asset weight for positive pnl. Negative pnl always has an asset weight of 1", + "precision: SPOT_WEIGHT_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'unrealizedPnlInitialAssetWeight', - docs: [ - 'The initial asset weight for positive pnl. Negative pnl always has an asset weight of 1', - 'precision: SPOT_WEIGHT_PRECISION', + "name": "numberOfUsersWithBase", + "docs": [ + "number of users in a position (base)" ], - type: 'u32', + "type": "u32" }, { - name: 'unrealizedPnlMaintenanceAssetWeight', - docs: [ - 'The maintenance asset weight for positive pnl. Negative pnl always has an asset weight of 1', - 'precision: SPOT_WEIGHT_PRECISION', + "name": "numberOfUsers", + "docs": [ + "number of users in a position (pnl) or pnl (quote)" ], - type: 'u32', + "type": "u32" }, { - name: 'numberOfUsersWithBase', - docs: ['number of users in a position (base)'], - type: 'u32', + "name": "marketIndex", + "type": "u16" }, { - name: 'numberOfUsers', - docs: ['number of users in a position (pnl) or pnl (quote)'], - type: 'u32', + "name": "status", + "docs": [ + "Whether a market is active, reduce only, expired, etc", + "Affects whether users can open/close positions" + ], + "type": { + "defined": "MarketStatus" + } }, { - name: 'marketIndex', - type: 'u16', + "name": "contractType", + "docs": [ + "Currently only Perpetual markets are supported" + ], + "type": { + "defined": "ContractType" + } }, { - name: 'status', - docs: [ - 'Whether a market is active, reduce only, expired, etc', - 'Affects whether users can open/close positions', + "name": "contractTier", + "docs": [ + "The contract tier determines how much insurance a market can receive, with more speculative markets receiving less insurance", + "It also influences the order perp markets can be liquidated, with less speculative markets being liquidated first" ], - type: { - defined: 'MarketStatus', - }, + "type": { + "defined": "ContractTier" + } }, { - name: 'contractType', - docs: ['Currently only Perpetual markets are supported'], - type: { - defined: 'ContractType', - }, + "name": "pausedOperations", + "type": "u8" }, { - name: 'contractTier', - docs: [ - 'The contract tier determines how much insurance a market can receive, with more speculative markets receiving less insurance', - 'It also influences the order perp markets can be liquidated, with less speculative markets being liquidated first', + "name": "quoteSpotMarketIndex", + "docs": [ + "The spot market that pnl is settled in" ], - type: { - defined: 'ContractTier', - }, + "type": "u16" }, { - name: 'pausedOperations', - type: 'u8', + "name": "feeAdjustment", + "docs": [ + "Between -100 and 100, represents what % to increase/decrease the fee by", + "E.g. if this is -50 and the fee is 5bps, the new fee will be 2.5bps", + "if this is 50 and the fee is 5bps, the new fee will be 7.5bps" + ], + "type": "i16" }, { - name: 'quoteSpotMarketIndex', - docs: ['The spot market that pnl is settled in'], - type: 'u16', + "name": "fuelBoostPosition", + "docs": [ + "fuel multiplier for perp funding", + "precision: 10" + ], + "type": "u8" }, { - name: 'feeAdjustment', - docs: [ - 'Between -100 and 100, represents what % to increase/decrease the fee by', - 'E.g. if this is -50 and the fee is 5bps, the new fee will be 2.5bps', - 'if this is 50 and the fee is 5bps, the new fee will be 7.5bps', + "name": "fuelBoostTaker", + "docs": [ + "fuel multiplier for perp taker", + "precision: 10" ], - type: 'i16', + "type": "u8" }, { - name: 'padding', - type: { - array: ['u8', 46], - }, + "name": "fuelBoostMaker", + "docs": [ + "fuel multiplier for perp maker", + "precision: 10" + ], + "type": "u8" }, - ], - }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 43 + ] + } + } + ] + } }, { - name: 'spotMarket', - type: { - kind: 'struct', - fields: [ + "name": "spotMarket", + "type": { + "kind": "struct", + "fields": [ { - name: 'pubkey', - docs: [ - 'The address of the spot market. It is a pda of the market index', + "name": "pubkey", + "docs": [ + "The address of the spot market. It is a pda of the market index" ], - type: 'publicKey', + "type": "publicKey" }, { - name: 'oracle', - docs: ['The oracle used to price the markets deposits/borrows'], - type: 'publicKey', + "name": "oracle", + "docs": [ + "The oracle used to price the markets deposits/borrows" + ], + "type": "publicKey" }, { - name: 'mint', - docs: ['The token mint of the market'], - type: 'publicKey', + "name": "mint", + "docs": [ + "The token mint of the market" + ], + "type": "publicKey" }, { - name: 'vault', - docs: [ + "name": "vault", + "docs": [ "The vault used to store the market's deposits", - 'The amount in the vault should be equal to or greater than deposits - borrows', + "The amount in the vault should be equal to or greater than deposits - borrows" ], - type: 'publicKey', + "type": "publicKey" }, { - name: 'name', - docs: ['The encoded display name for the market e.g. SOL'], - type: { - array: ['u8', 32], - }, + "name": "name", + "docs": [ + "The encoded display name for the market e.g. SOL" + ], + "type": { + "array": [ + "u8", + 32 + ] + } }, { - name: 'historicalOracleData', - type: { - defined: 'HistoricalOracleData', - }, + "name": "historicalOracleData", + "type": { + "defined": "HistoricalOracleData" + } }, { - name: 'historicalIndexData', - type: { - defined: 'HistoricalIndexData', - }, + "name": "historicalIndexData", + "type": { + "defined": "HistoricalIndexData" + } }, { - name: 'revenuePool', - docs: [ - 'Revenue the protocol has collected in this markets token', - 'e.g. for SOL-PERP, funds can be settled in usdc and will flow into the USDC revenue pool', + "name": "revenuePool", + "docs": [ + "Revenue the protocol has collected in this markets token", + "e.g. for SOL-PERP, funds can be settled in usdc and will flow into the USDC revenue pool" ], - type: { - defined: 'PoolBalance', - }, + "type": { + "defined": "PoolBalance" + } }, { - name: 'spotFeePool', - docs: [ - 'The fees collected from swaps between this market and the quote market', - 'Is settled to the quote markets revenue pool', + "name": "spotFeePool", + "docs": [ + "The fees collected from swaps between this market and the quote market", + "Is settled to the quote markets revenue pool" ], - type: { - defined: 'PoolBalance', - }, + "type": { + "defined": "PoolBalance" + } }, { - name: 'insuranceFund', - docs: [ - 'Details on the insurance fund covering bankruptcies in this markets token', - 'Covers bankruptcies for borrows with this markets token and perps settling in this markets token', + "name": "insuranceFund", + "docs": [ + "Details on the insurance fund covering bankruptcies in this markets token", + "Covers bankruptcies for borrows with this markets token and perps settling in this markets token" ], - type: { - defined: 'InsuranceFund', - }, + "type": { + "defined": "InsuranceFund" + } }, { - name: 'totalSpotFee', - docs: [ - 'The total spot fees collected for this market', - 'precision: QUOTE_PRECISION', + "name": "totalSpotFee", + "docs": [ + "The total spot fees collected for this market", + "precision: QUOTE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'depositBalance', - docs: [ - 'The sum of the scaled balances for deposits across users and pool balances', - 'To convert to the deposit token amount, multiply by the cumulative deposit interest', - 'precision: SPOT_BALANCE_PRECISION', + "name": "depositBalance", + "docs": [ + "The sum of the scaled balances for deposits across users and pool balances", + "To convert to the deposit token amount, multiply by the cumulative deposit interest", + "precision: SPOT_BALANCE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'borrowBalance', - docs: [ - 'The sum of the scaled balances for borrows across users and pool balances', - 'To convert to the borrow token amount, multiply by the cumulative borrow interest', - 'precision: SPOT_BALANCE_PRECISION', + "name": "borrowBalance", + "docs": [ + "The sum of the scaled balances for borrows across users and pool balances", + "To convert to the borrow token amount, multiply by the cumulative borrow interest", + "precision: SPOT_BALANCE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'cumulativeDepositInterest', - docs: [ - 'The cumulative interest earned by depositors', - 'Used to calculate the deposit token amount from the deposit balance', - 'precision: SPOT_CUMULATIVE_INTEREST_PRECISION', + "name": "cumulativeDepositInterest", + "docs": [ + "The cumulative interest earned by depositors", + "Used to calculate the deposit token amount from the deposit balance", + "precision: SPOT_CUMULATIVE_INTEREST_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'cumulativeBorrowInterest', - docs: [ - 'The cumulative interest earned by borrowers', - 'Used to calculate the borrow token amount from the borrow balance', - 'precision: SPOT_CUMULATIVE_INTEREST_PRECISION', + "name": "cumulativeBorrowInterest", + "docs": [ + "The cumulative interest earned by borrowers", + "Used to calculate the borrow token amount from the borrow balance", + "precision: SPOT_CUMULATIVE_INTEREST_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'totalSocialLoss', - docs: [ + "name": "totalSocialLoss", + "docs": [ "The total socialized loss from borrows, in the mint's token", - 'precision: token mint precision', + "precision: token mint precision" ], - type: 'u128', + "type": "u128" }, { - name: 'totalQuoteSocialLoss', - docs: [ + "name": "totalQuoteSocialLoss", + "docs": [ "The total socialized loss from borrows, in the quote market's token", - 'preicision: QUOTE_PRECISION', + "preicision: QUOTE_PRECISION" + ], + "type": "u128" + }, + { + "name": "withdrawGuardThreshold", + "docs": [ + "no withdraw limits/guards when deposits below this threshold", + "precision: token mint precision" + ], + "type": "u64" + }, + { + "name": "maxTokenDeposits", + "docs": [ + "The max amount of token deposits in this market", + "0 if there is no limit", + "precision: token mint precision" ], - type: 'u128', + "type": "u64" }, { - name: 'withdrawGuardThreshold', - docs: [ - 'no withdraw limits/guards when deposits below this threshold', - 'precision: token mint precision', + "name": "depositTokenTwap", + "docs": [ + "24hr average of deposit token amount", + "precision: token mint precision" ], - type: 'u64', + "type": "u64" }, { - name: 'maxTokenDeposits', - docs: [ - 'The max amount of token deposits in this market', - '0 if there is no limit', - 'precision: token mint precision', + "name": "borrowTokenTwap", + "docs": [ + "24hr average of borrow token amount", + "precision: token mint precision" ], - type: 'u64', + "type": "u64" }, { - name: 'depositTokenTwap', - docs: [ - '24hr average of deposit token amount', - 'precision: token mint precision', + "name": "utilizationTwap", + "docs": [ + "24hr average of utilization", + "which is borrow amount over token amount", + "precision: SPOT_UTILIZATION_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'borrowTokenTwap', - docs: [ - '24hr average of borrow token amount', - 'precision: token mint precision', + "name": "lastInterestTs", + "docs": [ + "Last time the cumulative deposit and borrow interest was updated" ], - type: 'u64', + "type": "u64" }, { - name: 'utilizationTwap', - docs: [ - '24hr average of utilization', - 'which is borrow amount over token amount', - 'precision: SPOT_UTILIZATION_PRECISION', + "name": "lastTwapTs", + "docs": [ + "Last time the deposit/borrow/utilization averages were updated" ], - type: 'u64', + "type": "u64" }, { - name: 'lastInterestTs', - docs: [ - 'Last time the cumulative deposit and borrow interest was updated', + "name": "expiryTs", + "docs": [ + "The time the market is set to expire. Only set if market is in reduce only mode" ], - type: 'u64', + "type": "i64" }, { - name: 'lastTwapTs', - docs: [ - 'Last time the deposit/borrow/utilization averages were updated', + "name": "orderStepSize", + "docs": [ + "Spot orders must be a multiple of the step size", + "precision: token mint precision" ], - type: 'u64', + "type": "u64" }, { - name: 'expiryTs', - docs: [ - 'The time the market is set to expire. Only set if market is in reduce only mode', + "name": "orderTickSize", + "docs": [ + "Spot orders must be a multiple of the tick size", + "precision: PRICE_PRECISION" ], - type: 'i64', + "type": "u64" }, { - name: 'orderStepSize', - docs: [ - 'Spot orders must be a multiple of the step size', - 'precision: token mint precision', + "name": "minOrderSize", + "docs": [ + "The minimum order size", + "precision: token mint precision" ], - type: 'u64', + "type": "u64" }, { - name: 'orderTickSize', - docs: [ - 'Spot orders must be a multiple of the tick size', - 'precision: PRICE_PRECISION', + "name": "maxPositionSize", + "docs": [ + "The maximum spot position size", + "if the limit is 0, there is no limit", + "precision: token mint precision" ], - type: 'u64', + "type": "u64" }, { - name: 'minOrderSize', - docs: ['The minimum order size', 'precision: token mint precision'], - type: 'u64', + "name": "nextFillRecordId", + "docs": [ + "Every spot trade has a fill record id. This is the next id to use" + ], + "type": "u64" }, { - name: 'maxPositionSize', - docs: [ - 'The maximum spot position size', - 'if the limit is 0, there is no limit', - 'precision: token mint precision', + "name": "nextDepositRecordId", + "docs": [ + "Every deposit has a deposit record id. This is the next id to use" ], - type: 'u64', + "type": "u64" }, { - name: 'nextFillRecordId', - docs: [ - 'Every spot trade has a fill record id. This is the next id to use', + "name": "initialAssetWeight", + "docs": [ + "The initial asset weight used to calculate a deposits contribution to a users initial total collateral", + "e.g. if the asset weight is .8, $100 of deposits contributes $80 to the users initial total collateral", + "precision: SPOT_WEIGHT_PRECISION" ], - type: 'u64', + "type": "u32" }, { - name: 'nextDepositRecordId', - docs: [ - 'Every deposit has a deposit record id. This is the next id to use', + "name": "maintenanceAssetWeight", + "docs": [ + "The maintenance asset weight used to calculate a deposits contribution to a users maintenance total collateral", + "e.g. if the asset weight is .9, $100 of deposits contributes $90 to the users maintenance total collateral", + "precision: SPOT_WEIGHT_PRECISION" ], - type: 'u64', + "type": "u32" }, { - name: 'initialAssetWeight', - docs: [ - 'The initial asset weight used to calculate a deposits contribution to a users initial total collateral', - 'e.g. if the asset weight is .8, $100 of deposits contributes $80 to the users initial total collateral', - 'precision: SPOT_WEIGHT_PRECISION', + "name": "initialLiabilityWeight", + "docs": [ + "The initial liability weight used to calculate a borrows contribution to a users initial margin requirement", + "e.g. if the liability weight is .9, $100 of borrows contributes $90 to the users initial margin requirement", + "precision: SPOT_WEIGHT_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'maintenanceAssetWeight', - docs: [ - 'The maintenance asset weight used to calculate a deposits contribution to a users maintenance total collateral', - 'e.g. if the asset weight is .9, $100 of deposits contributes $90 to the users maintenance total collateral', - 'precision: SPOT_WEIGHT_PRECISION', + "name": "maintenanceLiabilityWeight", + "docs": [ + "The maintenance liability weight used to calculate a borrows contribution to a users maintenance margin requirement", + "e.g. if the liability weight is .8, $100 of borrows contributes $80 to the users maintenance margin requirement", + "precision: SPOT_WEIGHT_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'initialLiabilityWeight', - docs: [ - 'The initial liability weight used to calculate a borrows contribution to a users initial margin requirement', - 'e.g. if the liability weight is .9, $100 of borrows contributes $90 to the users initial margin requirement', - 'precision: SPOT_WEIGHT_PRECISION', + "name": "imfFactor", + "docs": [ + "The initial margin fraction factor. Used to increase liability weight/decrease asset weight for large positions", + "precision: MARGIN_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'maintenanceLiabilityWeight', - docs: [ - 'The maintenance liability weight used to calculate a borrows contribution to a users maintenance margin requirement', - 'e.g. if the liability weight is .8, $100 of borrows contributes $80 to the users maintenance margin requirement', - 'precision: SPOT_WEIGHT_PRECISION', + "name": "liquidatorFee", + "docs": [ + "The fee the liquidator is paid for taking over borrow/deposit", + "precision: LIQUIDATOR_FEE_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'imfFactor', - docs: [ - 'The initial margin fraction factor. Used to increase liability weight/decrease asset weight for large positions', - 'precision: MARGIN_PRECISION', + "name": "ifLiquidationFee", + "docs": [ + "The fee the insurance fund receives from liquidation", + "precision: LIQUIDATOR_FEE_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'liquidatorFee', - docs: [ - 'The fee the liquidator is paid for taking over borrow/deposit', - 'precision: LIQUIDATOR_FEE_PRECISION', + "name": "optimalUtilization", + "docs": [ + "The optimal utilization rate for this market.", + "Used to determine the markets borrow rate", + "precision: SPOT_UTILIZATION_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'ifLiquidationFee', - docs: [ - 'The fee the insurance fund receives from liquidation', - 'precision: LIQUIDATOR_FEE_PRECISION', + "name": "optimalBorrowRate", + "docs": [ + "The borrow rate for this market when the market has optimal utilization", + "precision: SPOT_RATE_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'optimalUtilization', - docs: [ - 'The optimal utilization rate for this market.', - 'Used to determine the markets borrow rate', - 'precision: SPOT_UTILIZATION_PRECISION', + "name": "maxBorrowRate", + "docs": [ + "The borrow rate for this market when the market has 1000 utilization", + "precision: SPOT_RATE_PRECISION" ], - type: 'u32', + "type": "u32" }, { - name: 'optimalBorrowRate', - docs: [ - 'The borrow rate for this market when the market has optimal utilization', - 'precision: SPOT_RATE_PRECISION', + "name": "decimals", + "docs": [ + "The market's token mint's decimals. To from decimals to a precision, 10^decimals" ], - type: 'u32', + "type": "u32" + }, + { + "name": "marketIndex", + "type": "u16" }, { - name: 'maxBorrowRate', - docs: [ - 'The borrow rate for this market when the market has 1000 utilization', - 'precision: SPOT_RATE_PRECISION', + "name": "ordersEnabled", + "docs": [ + "Whether or not spot trading is enabled" ], - type: 'u32', + "type": "bool" + }, + { + "name": "oracleSource", + "type": { + "defined": "OracleSource" + } }, { - name: 'decimals', - docs: [ - "The market's token mint's decimals. To from decimals to a precision, 10^decimals", + "name": "status", + "type": { + "defined": "MarketStatus" + } + }, + { + "name": "assetTier", + "docs": [ + "The asset tier affects how a deposit can be used as collateral and the priority for a borrow being liquidated" ], - type: 'u32', + "type": { + "defined": "AssetTier" + } + }, + { + "name": "pausedOperations", + "type": "u8" + }, + { + "name": "ifPausedOperations", + "type": "u8" }, { - name: 'marketIndex', - type: 'u16', + "name": "feeAdjustment", + "type": "i16" }, { - name: 'ordersEnabled', - docs: ['Whether or not spot trading is enabled'], - type: 'bool', + "name": "maxTokenBorrowsFraction", + "docs": [ + "What fraction of max_token_deposits", + "disabled when 0, 1 => 1/10000 => .01% of max_token_deposits", + "precision: X/10000" + ], + "type": "u16" + }, + { + "name": "flashLoanAmount", + "docs": [ + "For swaps, the amount of token loaned out in the begin_swap ix", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'oracleSource', - type: { - defined: 'OracleSource', - }, + "name": "flashLoanInitialTokenAmount", + "docs": [ + "For swaps, the amount in the users token account in the begin_swap ix", + "Used to calculate how much of the token left the system in end_swap ix", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'status', - type: { - defined: 'MarketStatus', - }, + "name": "totalSwapFee", + "docs": [ + "The total fees received from swaps", + "precision: token mint precision" + ], + "type": "u64" }, { - name: 'assetTier', - docs: [ - 'The asset tier affects how a deposit can be used as collateral and the priority for a borrow being liquidated', + "name": "scaleInitialAssetWeightStart", + "docs": [ + "When to begin scaling down the initial asset weight", + "disabled when 0", + "precision: QUOTE_PRECISION" ], - type: { - defined: 'AssetTier', - }, + "type": "u64" }, { - name: 'pausedOperations', - type: 'u8', + "name": "minBorrowRate", + "docs": [ + "The min borrow rate for this market when the market regardless of utilization", + "1 => 1/200 => .5%", + "precision: X/200" + ], + "type": "u8" }, { - name: 'padding1', - type: { - array: ['u8', 5], - }, + "name": "fuelBoostDeposits", + "docs": [ + "fuel multiplier for spot deposits", + "precision: 10" + ], + "type": "u8" }, { - name: 'flashLoanAmount', - docs: [ - 'For swaps, the amount of token loaned out in the begin_swap ix', - 'precision: token mint precision', + "name": "fuelBoostBorrows", + "docs": [ + "fuel multiplier for spot borrows", + "precision: 10" ], - type: 'u64', + "type": "u8" }, { - name: 'flashLoanInitialTokenAmount', - docs: [ - 'For swaps, the amount in the users token account in the begin_swap ix', - 'Used to calculate how much of the token left the system in end_swap ix', - 'precision: token mint precision', + "name": "fuelBoostTaker", + "docs": [ + "fuel multiplier for spot taker", + "precision: 10" ], - type: 'u64', + "type": "u8" }, { - name: 'totalSwapFee', - docs: [ - 'The total fees received from swaps', - 'precision: token mint precision', + "name": "fuelBoostMaker", + "docs": [ + "fuel multiplier for spot maker", + "precision: 10" ], - type: 'u64', + "type": "u8" }, { - name: 'scaleInitialAssetWeightStart', - docs: [ - 'When to begin scaling down the initial asset weight', - 'disabled when 0', - 'precision: QUOTE_PRECISION', + "name": "fuelBoostInsurance", + "docs": [ + "fuel multiplier for spot insurance stake", + "precision: 10" ], - type: 'u64', + "type": "u8" }, { - name: 'padding', - type: { - array: ['u8', 48], - }, + "name": "tokenProgram", + "type": "u8" }, - ], - }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 41 + ] + } + } + ] + } }, { - name: 'state', - type: { - kind: 'struct', - fields: [ + "name": "State", + "type": { + "kind": "struct", + "fields": [ { - name: 'admin', - type: 'publicKey', + "name": "admin", + "type": "publicKey" }, { - name: 'whitelistMint', - type: 'publicKey', + "name": "whitelistMint", + "type": "publicKey" }, { - name: 'discountMint', - type: 'publicKey', + "name": "discountMint", + "type": "publicKey" }, { - name: 'signer', - type: 'publicKey', + "name": "signer", + "type": "publicKey" }, { - name: 'srmVault', - type: 'publicKey', + "name": "srmVault", + "type": "publicKey" }, { - name: 'perpFeeStructure', - type: { - defined: 'FeeStructure', - }, + "name": "perpFeeStructure", + "type": { + "defined": "FeeStructure" + } }, { - name: 'spotFeeStructure', - type: { - defined: 'FeeStructure', - }, + "name": "spotFeeStructure", + "type": { + "defined": "FeeStructure" + } }, { - name: 'oracleGuardRails', - type: { - defined: 'OracleGuardRails', - }, + "name": "oracleGuardRails", + "type": { + "defined": "OracleGuardRails" + } }, { - name: 'numberOfAuthorities', - type: 'u64', + "name": "numberOfAuthorities", + "type": "u64" }, { - name: 'numberOfSubAccounts', - type: 'u64', + "name": "numberOfSubAccounts", + "type": "u64" }, { - name: 'lpCooldownTime', - type: 'u64', + "name": "lpCooldownTime", + "type": "u64" }, { - name: 'liquidationMarginBufferRatio', - type: 'u32', + "name": "liquidationMarginBufferRatio", + "type": "u32" }, { - name: 'settlementDuration', - type: 'u16', + "name": "settlementDuration", + "type": "u16" }, { - name: 'numberOfMarkets', - type: 'u16', + "name": "numberOfMarkets", + "type": "u16" }, { - name: 'numberOfSpotMarkets', - type: 'u16', + "name": "numberOfSpotMarkets", + "type": "u16" }, { - name: 'signerNonce', - type: 'u8', + "name": "signerNonce", + "type": "u8" }, { - name: 'minPerpAuctionDuration', - type: 'u8', + "name": "minPerpAuctionDuration", + "type": "u8" }, { - name: 'defaultMarketOrderTimeInForce', - type: 'u8', + "name": "defaultMarketOrderTimeInForce", + "type": "u8" }, { - name: 'defaultSpotAuctionDuration', - type: 'u8', + "name": "defaultSpotAuctionDuration", + "type": "u8" }, { - name: 'exchangeStatus', - type: 'u8', + "name": "exchangeStatus", + "type": "u8" }, { - name: 'liquidationDuration', - type: 'u8', + "name": "liquidationDuration", + "type": "u8" }, { - name: 'initialPctToLiquidate', - type: 'u16', + "name": "initialPctToLiquidate", + "type": "u16" }, { - name: 'maxNumberOfSubAccounts', - type: 'u16', + "name": "maxNumberOfSubAccounts", + "type": "u16" }, { - name: 'maxInitializeUserFee', - type: 'u16', + "name": "maxInitializeUserFee", + "type": "u16" }, { - name: 'padding', - type: { - array: ['u8', 10], - }, - }, - ], - }, + "name": "padding", + "type": { + "array": [ + "u8", + 10 + ] + } + } + ] + } }, { - name: 'user', - type: { - kind: 'struct', - fields: [ + "name": "User", + "type": { + "kind": "struct", + "fields": [ { - name: 'authority', - docs: ['The owner/authority of the account'], - type: 'publicKey', + "name": "authority", + "docs": [ + "The owner/authority of the account" + ], + "type": "publicKey" }, { - name: 'delegate', - docs: [ - "An addresses that can control the account on the authority's behalf. Has limited power, cant withdraw", + "name": "delegate", + "docs": [ + "An addresses that can control the account on the authority's behalf. Has limited power, cant withdraw" ], - type: 'publicKey', + "type": "publicKey" }, { - name: 'name', - docs: ['Encoded display name e.g. "toly"'], - type: { - array: ['u8', 32], - }, + "name": "name", + "docs": [ + "Encoded display name e.g. \"toly\"" + ], + "type": { + "array": [ + "u8", + 32 + ] + } }, { - name: 'spotPositions', - docs: ["The user's spot positions"], - type: { - array: [ + "name": "spotPositions", + "docs": [ + "The user's spot positions" + ], + "type": { + "array": [ { - defined: 'SpotPosition', + "defined": "SpotPosition" }, - 8, - ], - }, + 8 + ] + } }, { - name: 'perpPositions', - docs: ["The user's perp positions"], - type: { - array: [ + "name": "perpPositions", + "docs": [ + "The user's perp positions" + ], + "type": { + "array": [ { - defined: 'PerpPosition', + "defined": "PerpPosition" }, - 8, - ], - }, + 8 + ] + } }, { - name: 'orders', - docs: ["The user's orders"], - type: { - array: [ + "name": "orders", + "docs": [ + "The user's orders" + ], + "type": { + "array": [ { - defined: 'Order', + "defined": "Order" }, - 32, - ], - }, + 32 + ] + } }, { - name: 'lastAddPerpLpSharesTs', - docs: ['The last time the user added perp lp positions'], - type: 'i64', + "name": "lastAddPerpLpSharesTs", + "docs": [ + "The last time the user added perp lp positions" + ], + "type": "i64" }, { - name: 'totalDeposits', - docs: [ - 'The total values of deposits the user has made', - 'precision: QUOTE_PRECISION', + "name": "totalDeposits", + "docs": [ + "The total values of deposits the user has made", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'totalWithdraws', - docs: [ - 'The total values of withdrawals the user has made', - 'precision: QUOTE_PRECISION', + "name": "totalWithdraws", + "docs": [ + "The total values of withdrawals the user has made", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'totalSocialLoss', - docs: [ - 'The total socialized loss the users has incurred upon the protocol', - 'precision: QUOTE_PRECISION', + "name": "totalSocialLoss", + "docs": [ + "The total socialized loss the users has incurred upon the protocol", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'settledPerpPnl', - docs: [ - 'Fees (taker fees, maker rebate, referrer reward, filler reward) and pnl for perps', - 'precision: QUOTE_PRECISION', + "name": "settledPerpPnl", + "docs": [ + "Fees (taker fees, maker rebate, referrer reward, filler reward) and pnl for perps", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'cumulativeSpotFees', - docs: [ - 'Fees (taker fees, maker rebate, filler reward) for spot', - 'precision: QUOTE_PRECISION', + "name": "cumulativeSpotFees", + "docs": [ + "Fees (taker fees, maker rebate, filler reward) for spot", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'cumulativePerpFunding', - docs: [ - 'Cumulative funding paid/received for perps', - 'precision: QUOTE_PRECISION', + "name": "cumulativePerpFunding", + "docs": [ + "Cumulative funding paid/received for perps", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'liquidationMarginFreed', - docs: [ - 'The amount of margin freed during liquidation. Used to force the liquidation to occur over a period of time', - 'Defaults to zero when not being liquidated', - 'precision: QUOTE_PRECISION', + "name": "liquidationMarginFreed", + "docs": [ + "The amount of margin freed during liquidation. Used to force the liquidation to occur over a period of time", + "Defaults to zero when not being liquidated", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastActiveSlot', - docs: [ - 'The last slot a user was active. Used to determine if a user is idle', + "name": "lastActiveSlot", + "docs": [ + "The last slot a user was active. Used to determine if a user is idle" ], - type: 'u64', + "type": "u64" }, { - name: 'nextOrderId', - docs: [ - 'Every user order has an order id. This is the next order id to be used', + "name": "nextOrderId", + "docs": [ + "Every user order has an order id. This is the next order id to be used" ], - type: 'u32', + "type": "u32" }, { - name: 'maxMarginRatio', - docs: ['Custom max initial margin ratio for the user'], - type: 'u32', + "name": "maxMarginRatio", + "docs": [ + "Custom max initial margin ratio for the user" + ], + "type": "u32" }, { - name: 'nextLiquidationId', - docs: ['The next liquidation id to be used for user'], - type: 'u16', + "name": "nextLiquidationId", + "docs": [ + "The next liquidation id to be used for user" + ], + "type": "u16" }, { - name: 'subAccountId', - docs: ['The sub account id for this user'], - type: 'u16', + "name": "subAccountId", + "docs": [ + "The sub account id for this user" + ], + "type": "u16" }, { - name: 'status', - docs: ['Whether the user is active, being liquidated or bankrupt'], - type: 'u8', + "name": "status", + "docs": [ + "Whether the user is active, being liquidated or bankrupt" + ], + "type": "u8" }, { - name: 'isMarginTradingEnabled', - docs: ['Whether the user has enabled margin trading'], - type: 'bool', + "name": "isMarginTradingEnabled", + "docs": [ + "Whether the user has enabled margin trading" + ], + "type": "bool" }, { - name: 'idle', - docs: [ + "name": "idle", + "docs": [ "User is idle if they haven't interacted with the protocol in 1 week and they have no orders, perp positions or borrows", - 'Off-chain keeper bots can ignore users that are idle', + "Off-chain keeper bots can ignore users that are idle" ], - type: 'bool', + "type": "bool" }, { - name: 'openOrders', - docs: ['number of open orders'], - type: 'u8', + "name": "openOrders", + "docs": [ + "number of open orders" + ], + "type": "u8" + }, + { + "name": "hasOpenOrder", + "docs": [ + "Whether or not user has open order" + ], + "type": "bool" }, { - name: 'hasOpenOrder', - docs: ['Whether or not user has open order'], - type: 'bool', + "name": "openAuctions", + "docs": [ + "number of open orders with auction" + ], + "type": "u8" }, { - name: 'openAuctions', - docs: ['number of open orders with auction'], - type: 'u8', + "name": "hasOpenAuction", + "docs": [ + "Whether or not user has open order with auction" + ], + "type": "bool" }, { - name: 'hasOpenAuction', - docs: ['Whether or not user has open order with auction'], - type: 'bool', + "name": "padding1", + "type": { + "array": [ + "u8", + 5 + ] + } }, { - name: 'padding', - type: { - array: ['u8', 21], - }, + "name": "lastFuelBonusUpdateTs", + "type": "u32" }, - ], - }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 12 + ] + } + } + ] + } }, { - name: 'userStats', - type: { - kind: 'struct', - fields: [ + "name": "UserStats", + "type": { + "kind": "struct", + "fields": [ { - name: 'authority', - docs: ['The authority for all of a users sub accounts'], - type: 'publicKey', + "name": "authority", + "docs": [ + "The authority for all of a users sub accounts" + ], + "type": "publicKey" }, { - name: 'referrer', - docs: ['The address that referred this user'], - type: 'publicKey', + "name": "referrer", + "docs": [ + "The address that referred this user" + ], + "type": "publicKey" }, { - name: 'fees', - docs: ['Stats on the fees paid by the user'], - type: { - defined: 'UserFees', - }, + "name": "fees", + "docs": [ + "Stats on the fees paid by the user" + ], + "type": { + "defined": "UserFees" + } }, { - name: 'nextEpochTs', - docs: [ - 'The timestamp of the next epoch', - 'Epoch is used to limit referrer rewards earned in single epoch', + "name": "nextEpochTs", + "docs": [ + "The timestamp of the next epoch", + "Epoch is used to limit referrer rewards earned in single epoch" ], - type: 'i64', + "type": "i64" }, { - name: 'makerVolume30d', - docs: [ - 'Rolling 30day maker volume for user', - 'precision: QUOTE_PRECISION', + "name": "makerVolume30d", + "docs": [ + "Rolling 30day maker volume for user", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'takerVolume30d', - docs: [ - 'Rolling 30day taker volume for user', - 'precision: QUOTE_PRECISION', + "name": "takerVolume30d", + "docs": [ + "Rolling 30day taker volume for user", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'fillerVolume30d', - docs: [ - 'Rolling 30day filler volume for user', - 'precision: QUOTE_PRECISION', + "name": "fillerVolume30d", + "docs": [ + "Rolling 30day filler volume for user", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastMakerVolume30dTs', - docs: ['last time the maker volume was updated'], - type: 'i64', + "name": "lastMakerVolume30dTs", + "docs": [ + "last time the maker volume was updated" + ], + "type": "i64" }, { - name: 'lastTakerVolume30dTs', - docs: ['last time the taker volume was updated'], - type: 'i64', + "name": "lastTakerVolume30dTs", + "docs": [ + "last time the taker volume was updated" + ], + "type": "i64" }, { - name: 'lastFillerVolume30dTs', - docs: ['last time the filler volume was updated'], - type: 'i64', + "name": "lastFillerVolume30dTs", + "docs": [ + "last time the filler volume was updated" + ], + "type": "i64" }, { - name: 'ifStakedQuoteAssetAmount', - docs: ['The amount of tokens staked in the quote spot markets if'], - type: 'u64', + "name": "ifStakedQuoteAssetAmount", + "docs": [ + "The amount of tokens staked in the quote spot markets if" + ], + "type": "u64" }, { - name: 'numberOfSubAccounts', - docs: ['The current number of sub accounts'], - type: 'u16', + "name": "numberOfSubAccounts", + "docs": [ + "The current number of sub accounts" + ], + "type": "u16" }, { - name: 'numberOfSubAccountsCreated', - docs: [ - 'The number of sub accounts created. Can be greater than the number of sub accounts if user', - 'has deleted sub accounts', + "name": "numberOfSubAccountsCreated", + "docs": [ + "The number of sub accounts created. Can be greater than the number of sub accounts if user", + "has deleted sub accounts" ], - type: 'u16', + "type": "u16" }, { - name: 'isReferrer', - docs: [ - 'Whether the user is a referrer. Sub account 0 can not be deleted if user is a referrer', + "name": "isReferrer", + "docs": [ + "Whether the user is a referrer. Sub account 0 can not be deleted if user is a referrer" ], - type: 'bool', + "type": "bool" }, { - name: 'disableUpdatePerpBidAskTwap', - type: 'bool', + "name": "disableUpdatePerpBidAskTwap", + "type": "bool" }, { - name: 'padding', - type: { - array: ['u8', 50], - }, + "name": "padding1", + "type": { + "array": [ + "u8", + 2 + ] + } }, - ], - }, - }, - { - name: 'referrerName', - type: { - kind: 'struct', - fields: [ { - name: 'authority', - type: 'publicKey', + "name": "fuelInsurance", + "docs": [ + "accumulated fuel for token amounts of insurance" + ], + "type": "u32" }, { - name: 'user', - type: 'publicKey', + "name": "fuelDeposits", + "docs": [ + "accumulated fuel for notional of deposits" + ], + "type": "u32" }, { - name: 'userStats', - type: 'publicKey', + "name": "fuelBorrows", + "docs": [ + "accumulate fuel bonus for notional of borrows" + ], + "type": "u32" }, { - name: 'name', - type: { - array: ['u8', 32], - }, + "name": "fuelPositions", + "docs": [ + "accumulated fuel for perp open interest" + ], + "type": "u32" }, - ], - }, - }, - ], - types: [ - { - name: 'LiquidatePerpRecord', - type: { - kind: 'struct', - fields: [ { - name: 'marketIndex', - type: 'u16', + "name": "fuelTaker", + "docs": [ + "accumulate fuel bonus for taker volume" + ], + "type": "u32" }, { - name: 'oraclePrice', - type: 'i64', + "name": "fuelMaker", + "docs": [ + "accumulate fuel bonus for maker volume" + ], + "type": "u32" }, { - name: 'baseAssetAmount', - type: 'i64', + "name": "ifStakedGovTokenAmount", + "docs": [ + "The amount of tokens staked in the governance spot markets if" + ], + "type": "u64" }, { - name: 'quoteAssetAmount', - type: 'i64', + "name": "lastFuelIfBonusUpdateTs", + "docs": [ + "last unix ts user stats data was used to update if fuel (u32 to save space)" + ], + "type": "u32" }, { - name: 'lpShares', - docs: ['precision: AMM_RESERVE_PRECISION'], - type: 'u64', - }, + "name": "padding", + "type": { + "array": [ + "u8", + 12 + ] + } + } + ] + } + }, + { + "name": "ReferrerName", + "type": { + "kind": "struct", + "fields": [ { - name: 'fillRecordId', - type: 'u64', + "name": "authority", + "type": "publicKey" }, { - name: 'userOrderId', - type: 'u32', + "name": "user", + "type": "publicKey" }, { - name: 'liquidatorOrderId', - type: 'u32', + "name": "userStats", + "type": "publicKey" }, { - name: 'liquidatorFee', - docs: ['precision: QUOTE_PRECISION'], - type: 'u64', + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "UpdatePerpMarketSummaryStatsParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "quoteAssetAmountWithUnsettledLp", + "type": { + "option": "i64" + } }, { - name: 'ifFee', - docs: ['precision: QUOTE_PRECISION'], - type: 'u64', + "name": "netUnsettledFundingPnl", + "type": { + "option": "i64" + } }, - ], - }, + { + "name": "updateAmmSummaryStats", + "type": { + "option": "bool" + } + } + ] + } }, { - name: 'LiquidateSpotRecord', - type: { - kind: 'struct', - fields: [ + "name": "LiquidatePerpRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "marketIndex", + "type": "u16" + }, + { + "name": "oraclePrice", + "type": "i64" + }, { - name: 'assetMarketIndex', - type: 'u16', + "name": "baseAssetAmount", + "type": "i64" }, { - name: 'assetPrice', - type: 'i64', + "name": "quoteAssetAmount", + "type": "i64" }, { - name: 'assetTransfer', - type: 'u128', + "name": "lpShares", + "docs": [ + "precision: AMM_RESERVE_PRECISION" + ], + "type": "u64" }, { - name: 'liabilityMarketIndex', - type: 'u16', + "name": "fillRecordId", + "type": "u64" }, { - name: 'liabilityPrice', - type: 'i64', + "name": "userOrderId", + "type": "u32" }, { - name: 'liabilityTransfer', - docs: ['precision: token mint precision'], - type: 'u128', + "name": "liquidatorOrderId", + "type": "u32" }, { - name: 'ifFee', - docs: ['precision: token mint precision'], - type: 'u64', + "name": "liquidatorFee", + "docs": [ + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, - ], - }, + { + "name": "ifFee", + "docs": [ + "precision: QUOTE_PRECISION" + ], + "type": "u64" + } + ] + } }, { - name: 'LiquidateBorrowForPerpPnlRecord', - type: { - kind: 'struct', - fields: [ + "name": "LiquidateSpotRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'perpMarketIndex', - type: 'u16', + "name": "assetMarketIndex", + "type": "u16" }, { - name: 'marketOraclePrice', - type: 'i64', + "name": "assetPrice", + "type": "i64" }, { - name: 'pnlTransfer', - type: 'u128', + "name": "assetTransfer", + "type": "u128" }, { - name: 'liabilityMarketIndex', - type: 'u16', + "name": "liabilityMarketIndex", + "type": "u16" }, { - name: 'liabilityPrice', - type: 'i64', + "name": "liabilityPrice", + "type": "i64" }, { - name: 'liabilityTransfer', - type: 'u128', + "name": "liabilityTransfer", + "docs": [ + "precision: token mint precision" + ], + "type": "u128" }, - ], - }, + { + "name": "ifFee", + "docs": [ + "precision: token mint precision" + ], + "type": "u64" + } + ] + } }, { - name: 'LiquidatePerpPnlForDepositRecord', - type: { - kind: 'struct', - fields: [ + "name": "LiquidateBorrowForPerpPnlRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'perpMarketIndex', - type: 'u16', + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'marketOraclePrice', - type: 'i64', + "name": "marketOraclePrice", + "type": "i64" }, { - name: 'pnlTransfer', - type: 'u128', + "name": "pnlTransfer", + "type": "u128" }, { - name: 'assetMarketIndex', - type: 'u16', + "name": "liabilityMarketIndex", + "type": "u16" }, { - name: 'assetPrice', - type: 'i64', + "name": "liabilityPrice", + "type": "i64" }, { - name: 'assetTransfer', - type: 'u128', - }, - ], - }, + "name": "liabilityTransfer", + "type": "u128" + } + ] + } }, { - name: 'PerpBankruptcyRecord', - type: { - kind: 'struct', - fields: [ + "name": "LiquidatePerpPnlForDepositRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'marketIndex', - type: 'u16', + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'pnl', - type: 'i128', + "name": "marketOraclePrice", + "type": "i64" }, { - name: 'ifPayment', - type: 'u128', + "name": "pnlTransfer", + "type": "u128" }, { - name: 'clawbackUser', - type: { - option: 'publicKey', - }, + "name": "assetMarketIndex", + "type": "u16" }, { - name: 'clawbackUserPayment', - type: { - option: 'u128', - }, + "name": "assetPrice", + "type": "i64" }, { - name: 'cumulativeFundingRateDelta', - type: 'i128', - }, - ], - }, + "name": "assetTransfer", + "type": "u128" + } + ] + } }, { - name: 'SpotBankruptcyRecord', - type: { - kind: 'struct', - fields: [ + "name": "PerpBankruptcyRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'marketIndex', - type: 'u16', + "name": "marketIndex", + "type": "u16" }, { - name: 'borrowAmount', - type: 'u128', + "name": "pnl", + "type": "i128" }, { - name: 'ifPayment', - type: 'u128', + "name": "ifPayment", + "type": "u128" }, { - name: 'cumulativeDepositInterestDelta', - type: 'u128', + "name": "clawbackUser", + "type": { + "option": "publicKey" + } + }, + { + "name": "clawbackUserPayment", + "type": { + "option": "u128" + } }, - ], - }, + { + "name": "cumulativeFundingRateDelta", + "type": "i128" + } + ] + } }, { - name: 'MarketIdentifier', - type: { - kind: 'struct', - fields: [ + "name": "SpotBankruptcyRecord", + "type": { + "kind": "struct", + "fields": [ { - name: 'marketType', - type: { - defined: 'MarketType', - }, + "name": "marketIndex", + "type": "u16" }, { - name: 'marketIndex', - type: 'u16', + "name": "borrowAmount", + "type": "u128" }, - ], - }, + { + "name": "ifPayment", + "type": "u128" + }, + { + "name": "cumulativeDepositInterestDelta", + "type": "u128" + } + ] + } }, { - name: 'HistoricalOracleData', - type: { - kind: 'struct', - fields: [ + "name": "MarketIdentifier", + "type": { + "kind": "struct", + "fields": [ { - name: 'lastOraclePrice', - docs: ['precision: PRICE_PRECISION'], - type: 'i64', + "name": "marketType", + "type": { + "defined": "MarketType" + } }, { - name: 'lastOracleConf', - docs: ['precision: PRICE_PRECISION'], - type: 'u64', + "name": "marketIndex", + "type": "u16" + } + ] + } + }, + { + "name": "HistoricalOracleData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lastOraclePrice", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'lastOracleDelay', - docs: ['number of slots since last update'], - type: 'i64', + "name": "lastOracleConf", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastOraclePriceTwap', - docs: ['precision: PRICE_PRECISION'], - type: 'i64', + "name": "lastOracleDelay", + "docs": [ + "number of slots since last update" + ], + "type": "i64" }, { - name: 'lastOraclePriceTwap5min', - docs: ['precision: PRICE_PRECISION'], - type: 'i64', + "name": "lastOraclePriceTwap", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "i64" }, { - name: 'lastOraclePriceTwapTs', - docs: ['unix_timestamp of last snapshot'], - type: 'i64', + "name": "lastOraclePriceTwap5min", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "i64" }, - ], - }, + { + "name": "lastOraclePriceTwapTs", + "docs": [ + "unix_timestamp of last snapshot" + ], + "type": "i64" + } + ] + } }, { - name: 'HistoricalIndexData', - type: { - kind: 'struct', - fields: [ + "name": "HistoricalIndexData", + "type": { + "kind": "struct", + "fields": [ { - name: 'lastIndexBidPrice', - docs: ['precision: PRICE_PRECISION'], - type: 'u64', + "name": "lastIndexBidPrice", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastIndexAskPrice', - docs: ['precision: PRICE_PRECISION'], - type: 'u64', + "name": "lastIndexAskPrice", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastIndexPriceTwap', - docs: ['precision: PRICE_PRECISION'], - type: 'u64', + "name": "lastIndexPriceTwap", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastIndexPriceTwap5min', - docs: ['precision: PRICE_PRECISION'], - type: 'u64', + "name": "lastIndexPriceTwap5min", + "docs": [ + "precision: PRICE_PRECISION" + ], + "type": "u64" }, { - name: 'lastIndexPriceTwapTs', - docs: ['unix_timestamp of last snapshot'], - type: 'i64', - }, - ], - }, + "name": "lastIndexPriceTwapTs", + "docs": [ + "unix_timestamp of last snapshot" + ], + "type": "i64" + } + ] + } }, { - name: 'OrderParams', - type: { - kind: 'struct', - fields: [ + "name": "PrelaunchOracleParams", + "type": { + "kind": "struct", + "fields": [ { - name: 'orderType', - type: { - defined: 'OrderType', - }, + "name": "perpMarketIndex", + "type": "u16" }, { - name: 'marketType', - type: { - defined: 'MarketType', - }, + "name": "price", + "type": { + "option": "i64" + } + }, + { + "name": "maxPrice", + "type": { + "option": "i64" + } + } + ] + } + }, + { + "name": "OrderParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "orderType", + "type": { + "defined": "OrderType" + } }, { - name: 'direction', - type: { - defined: 'PositionDirection', - }, + "name": "marketType", + "type": { + "defined": "MarketType" + } }, { - name: 'userOrderId', - type: 'u8', + "name": "direction", + "type": { + "defined": "PositionDirection" + } }, { - name: 'baseAssetAmount', - type: 'u64', + "name": "userOrderId", + "type": "u8" }, { - name: 'price', - type: 'u64', + "name": "baseAssetAmount", + "type": "u64" }, { - name: 'marketIndex', - type: 'u16', + "name": "price", + "type": "u64" }, { - name: 'reduceOnly', - type: 'bool', + "name": "marketIndex", + "type": "u16" }, { - name: 'postOnly', - type: { - defined: 'PostOnlyParam', - }, + "name": "reduceOnly", + "type": "bool" }, { - name: 'immediateOrCancel', - type: 'bool', + "name": "postOnly", + "type": { + "defined": "PostOnlyParam" + } }, { - name: 'maxTs', - type: { - option: 'i64', - }, + "name": "immediateOrCancel", + "type": "bool" }, { - name: 'triggerPrice', - type: { - option: 'u64', - }, + "name": "maxTs", + "type": { + "option": "i64" + } }, { - name: 'triggerCondition', - type: { - defined: 'OrderTriggerCondition', - }, + "name": "triggerPrice", + "type": { + "option": "u64" + } }, { - name: 'oraclePriceOffset', - type: { - option: 'i32', - }, + "name": "triggerCondition", + "type": { + "defined": "OrderTriggerCondition" + } }, { - name: 'auctionDuration', - type: { - option: 'u8', - }, + "name": "oraclePriceOffset", + "type": { + "option": "i32" + } }, { - name: 'auctionStartPrice', - type: { - option: 'i64', - }, + "name": "auctionDuration", + "type": { + "option": "u8" + } }, { - name: 'auctionEndPrice', - type: { - option: 'i64', - }, + "name": "auctionStartPrice", + "type": { + "option": "i64" + } }, - ], - }, + { + "name": "auctionEndPrice", + "type": { + "option": "i64" + } + } + ] + } }, { - name: 'ModifyOrderParams', - type: { - kind: 'struct', - fields: [ + "name": "ModifyOrderParams", + "type": { + "kind": "struct", + "fields": [ { - name: 'direction', - type: { - option: { - defined: 'PositionDirection', - }, - }, + "name": "direction", + "type": { + "option": { + "defined": "PositionDirection" + } + } }, { - name: 'baseAssetAmount', - type: { - option: 'u64', - }, + "name": "baseAssetAmount", + "type": { + "option": "u64" + } }, { - name: 'price', - type: { - option: 'u64', - }, + "name": "price", + "type": { + "option": "u64" + } }, { - name: 'reduceOnly', - type: { - option: 'bool', - }, + "name": "reduceOnly", + "type": { + "option": "bool" + } }, { - name: 'postOnly', - type: { - option: { - defined: 'PostOnlyParam', - }, - }, + "name": "postOnly", + "type": { + "option": { + "defined": "PostOnlyParam" + } + } }, { - name: 'immediateOrCancel', - type: { - option: 'bool', - }, + "name": "immediateOrCancel", + "type": { + "option": "bool" + } }, { - name: 'maxTs', - type: { - option: 'i64', - }, + "name": "maxTs", + "type": { + "option": "i64" + } }, { - name: 'triggerPrice', - type: { - option: 'u64', - }, + "name": "triggerPrice", + "type": { + "option": "u64" + } }, { - name: 'triggerCondition', - type: { - option: { - defined: 'OrderTriggerCondition', - }, - }, + "name": "triggerCondition", + "type": { + "option": { + "defined": "OrderTriggerCondition" + } + } }, { - name: 'oraclePriceOffset', - type: { - option: 'i32', - }, + "name": "oraclePriceOffset", + "type": { + "option": "i32" + } }, { - name: 'auctionDuration', - type: { - option: 'u8', - }, + "name": "auctionDuration", + "type": { + "option": "u8" + } }, { - name: 'auctionStartPrice', - type: { - option: 'i64', - }, + "name": "auctionStartPrice", + "type": { + "option": "i64" + } }, { - name: 'auctionEndPrice', - type: { - option: 'i64', - }, + "name": "auctionEndPrice", + "type": { + "option": "i64" + } }, { - name: 'policy', - type: { - option: { - defined: 'ModifyOrderPolicy', - }, - }, - }, - ], - }, + "name": "policy", + "type": { + "option": { + "defined": "ModifyOrderPolicy" + } + } + } + ] + } }, { - name: 'InsuranceClaim', - type: { - kind: 'struct', - fields: [ + "name": "InsuranceClaim", + "type": { + "kind": "struct", + "fields": [ { - name: 'revenueWithdrawSinceLastSettle', - docs: [ - 'The amount of revenue last settled', - 'Positive if funds left the perp market,', - 'negative if funds were pulled into the perp market', - 'precision: QUOTE_PRECISION', + "name": "revenueWithdrawSinceLastSettle", + "docs": [ + "The amount of revenue last settled", + "Positive if funds left the perp market,", + "negative if funds were pulled into the perp market", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'maxRevenueWithdrawPerPeriod', - docs: [ - 'The max amount of revenue that can be withdrawn per period', - 'precision: QUOTE_PRECISION', + "name": "maxRevenueWithdrawPerPeriod", + "docs": [ + "The max amount of revenue that can be withdrawn per period", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'quoteMaxInsurance', - docs: [ - 'The max amount of insurance that perp market can use to resolve bankruptcy and pnl deficits', - 'precision: QUOTE_PRECISION', + "name": "quoteMaxInsurance", + "docs": [ + "The max amount of insurance that perp market can use to resolve bankruptcy and pnl deficits", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'quoteSettledInsurance', - docs: [ - 'The amount of insurance that has been used to resolve bankruptcy and pnl deficits', - 'precision: QUOTE_PRECISION', + "name": "quoteSettledInsurance", + "docs": [ + "The amount of insurance that has been used to resolve bankruptcy and pnl deficits", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastRevenueWithdrawTs', - docs: ['The last time revenue was settled in/out of market'], - type: 'i64', - }, - ], - }, + "name": "lastRevenueWithdrawTs", + "docs": [ + "The last time revenue was settled in/out of market" + ], + "type": "i64" + } + ] + } }, { - name: 'PoolBalance', - type: { - kind: 'struct', - fields: [ + "name": "PoolBalance", + "type": { + "kind": "struct", + "fields": [ { - name: 'scaledBalance', - docs: [ + "name": "scaledBalance", + "docs": [ "To get the pool's token amount, you must multiply the scaled balance by the market's cumulative", - 'deposit interest', - 'precision: SPOT_BALANCE_PRECISION', + "deposit interest", + "precision: SPOT_BALANCE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'marketIndex', - docs: ['The spot market the pool is for'], - type: 'u16', + "name": "marketIndex", + "docs": [ + "The spot market the pool is for" + ], + "type": "u16" }, { - name: 'padding', - type: { - array: ['u8', 6], - }, - }, - ], - }, + "name": "padding", + "type": { + "array": [ + "u8", + 6 + ] + } + } + ] + } }, { - name: 'AMM', - type: { - kind: 'struct', - fields: [ + "name": "AMM", + "type": { + "kind": "struct", + "fields": [ { - name: 'oracle', - docs: ['oracle price data public key'], - type: 'publicKey', + "name": "oracle", + "docs": [ + "oracle price data public key" + ], + "type": "publicKey" }, { - name: 'historicalOracleData', - docs: ['stores historically witnessed oracle data'], - type: { - defined: 'HistoricalOracleData', - }, + "name": "historicalOracleData", + "docs": [ + "stores historically witnessed oracle data" + ], + "type": { + "defined": "HistoricalOracleData" + } }, { - name: 'baseAssetAmountPerLp', - docs: [ - 'accumulated base asset amount since inception per lp share', - 'precision: QUOTE_PRECISION', + "name": "baseAssetAmountPerLp", + "docs": [ + "accumulated base asset amount since inception per lp share", + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'quoteAssetAmountPerLp', - docs: [ - 'accumulated quote asset amount since inception per lp share', - 'precision: QUOTE_PRECISION', + "name": "quoteAssetAmountPerLp", + "docs": [ + "accumulated quote asset amount since inception per lp share", + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'feePool', - docs: [ - 'partition of fees from perp market trading moved from pnl settlements', + "name": "feePool", + "docs": [ + "partition of fees from perp market trading moved from pnl settlements" ], - type: { - defined: 'PoolBalance', - }, + "type": { + "defined": "PoolBalance" + } }, { - name: 'baseAssetReserve', - docs: [ - '`x` reserves for constant product mm formula (x * y = k)', - 'precision: AMM_RESERVE_PRECISION', + "name": "baseAssetReserve", + "docs": [ + "`x` reserves for constant product mm formula (x * y = k)", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'quoteAssetReserve', - docs: [ - '`y` reserves for constant product mm formula (x * y = k)', - 'precision: AMM_RESERVE_PRECISION', + "name": "quoteAssetReserve", + "docs": [ + "`y` reserves for constant product mm formula (x * y = k)", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'concentrationCoef', - docs: [ - 'determines how close the min/max base asset reserve sit vs base reserves', - 'allow for decreasing slippage without increasing liquidity and v.v.', - 'precision: PERCENTAGE_PRECISION', + "name": "concentrationCoef", + "docs": [ + "determines how close the min/max base asset reserve sit vs base reserves", + "allow for decreasing slippage without increasing liquidity and v.v.", + "precision: PERCENTAGE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'minBaseAssetReserve', - docs: [ - 'minimum base_asset_reserve allowed before AMM is unavailable', - 'precision: AMM_RESERVE_PRECISION', + "name": "minBaseAssetReserve", + "docs": [ + "minimum base_asset_reserve allowed before AMM is unavailable", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'maxBaseAssetReserve', - docs: [ - 'maximum base_asset_reserve allowed before AMM is unavailable', - 'precision: AMM_RESERVE_PRECISION', + "name": "maxBaseAssetReserve", + "docs": [ + "maximum base_asset_reserve allowed before AMM is unavailable", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'sqrtK', - docs: [ - '`sqrt(k)` in constant product mm formula (x * y = k). stored to avoid drift caused by integer math issues', - 'precision: AMM_RESERVE_PRECISION', + "name": "sqrtK", + "docs": [ + "`sqrt(k)` in constant product mm formula (x * y = k). stored to avoid drift caused by integer math issues", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'pegMultiplier', - docs: [ - 'normalizing numerical factor for y, its use offers lowest slippage in cp-curve when market is balanced', - 'precision: PEG_PRECISION', + "name": "pegMultiplier", + "docs": [ + "normalizing numerical factor for y, its use offers lowest slippage in cp-curve when market is balanced", + "precision: PEG_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'terminalQuoteAssetReserve', - docs: [ - 'y when market is balanced. stored to save computation', - 'precision: AMM_RESERVE_PRECISION', + "name": "terminalQuoteAssetReserve", + "docs": [ + "y when market is balanced. stored to save computation", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'baseAssetAmountLong', - docs: [ - 'always non-negative. tracks number of total longs in market (regardless of counterparty)', - 'precision: BASE_PRECISION', + "name": "baseAssetAmountLong", + "docs": [ + "always non-negative. tracks number of total longs in market (regardless of counterparty)", + "precision: BASE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'baseAssetAmountShort', - docs: [ - 'always non-positive. tracks number of total shorts in market (regardless of counterparty)', - 'precision: BASE_PRECISION', + "name": "baseAssetAmountShort", + "docs": [ + "always non-positive. tracks number of total shorts in market (regardless of counterparty)", + "precision: BASE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'baseAssetAmountWithAmm', - docs: [ - 'tracks net position (longs-shorts) in market with AMM as counterparty', - 'precision: BASE_PRECISION', + "name": "baseAssetAmountWithAmm", + "docs": [ + "tracks net position (longs-shorts) in market with AMM as counterparty", + "precision: BASE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'baseAssetAmountWithUnsettledLp', - docs: [ - 'tracks net position (longs-shorts) in market with LPs as counterparty', - 'precision: BASE_PRECISION', + "name": "baseAssetAmountWithUnsettledLp", + "docs": [ + "tracks net position (longs-shorts) in market with LPs as counterparty", + "precision: BASE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'maxOpenInterest', - docs: [ - 'max allowed open interest, blocks trades that breach this value', - 'precision: BASE_PRECISION', + "name": "maxOpenInterest", + "docs": [ + "max allowed open interest, blocks trades that breach this value", + "precision: BASE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'quoteAssetAmount', - docs: [ + "name": "quoteAssetAmount", + "docs": [ "sum of all user's perp quote_asset_amount in market", - 'precision: QUOTE_PRECISION', + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'quoteEntryAmountLong', - docs: [ + "name": "quoteEntryAmountLong", + "docs": [ "sum of all long user's quote_entry_amount in market", - 'precision: QUOTE_PRECISION', + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'quoteEntryAmountShort', - docs: [ + "name": "quoteEntryAmountShort", + "docs": [ "sum of all short user's quote_entry_amount in market", - 'precision: QUOTE_PRECISION', + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'quoteBreakEvenAmountLong', - docs: [ + "name": "quoteBreakEvenAmountLong", + "docs": [ "sum of all long user's quote_break_even_amount in market", - 'precision: QUOTE_PRECISION', + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'quoteBreakEvenAmountShort', - docs: [ + "name": "quoteBreakEvenAmountShort", + "docs": [ "sum of all short user's quote_break_even_amount in market", - 'precision: QUOTE_PRECISION', + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'userLpShares', - docs: [ - 'total user lp shares of sqrt_k (protocol owned liquidity = sqrt_k - last_funding_rate)', - 'precision: AMM_RESERVE_PRECISION', + "name": "userLpShares", + "docs": [ + "total user lp shares of sqrt_k (protocol owned liquidity = sqrt_k - last_funding_rate)", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'lastFundingRate', - docs: [ - 'last funding rate in this perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION', + "name": "lastFundingRate", + "docs": [ + "last funding rate in this perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'lastFundingRateLong', - docs: [ - 'last funding rate for longs in this perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION', + "name": "lastFundingRateLong", + "docs": [ + "last funding rate for longs in this perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'lastFundingRateShort', - docs: [ - 'last funding rate for shorts in this perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION', + "name": "lastFundingRateShort", + "docs": [ + "last funding rate for shorts in this perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'last24hAvgFundingRate', - docs: [ - 'estimate of last 24h of funding rate perp market (unit is quote per base)', - 'precision: QUOTE_PRECISION', + "name": "last24hAvgFundingRate", + "docs": [ + "estimate of last 24h of funding rate perp market (unit is quote per base)", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'totalFee', - docs: [ - 'total fees collected by this perp market', - 'precision: QUOTE_PRECISION', + "name": "totalFee", + "docs": [ + "total fees collected by this perp market", + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'totalMmFee', - docs: [ + "name": "totalMmFee", + "docs": [ "total fees collected by the vAMM's bid/ask spread", - 'precision: QUOTE_PRECISION', + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'totalExchangeFee', - docs: [ - 'total fees collected by exchange fee schedule', - 'precision: QUOTE_PRECISION', + "name": "totalExchangeFee", + "docs": [ + "total fees collected by exchange fee schedule", + "precision: QUOTE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'totalFeeMinusDistributions', - docs: [ - 'total fees minus any recognized upnl and pool withdraws', - 'precision: QUOTE_PRECISION', + "name": "totalFeeMinusDistributions", + "docs": [ + "total fees minus any recognized upnl and pool withdraws", + "precision: QUOTE_PRECISION" ], - type: 'i128', + "type": "i128" }, { - name: 'totalFeeWithdrawn', - docs: [ - 'sum of all fees from fee pool withdrawn to revenue pool', - 'precision: QUOTE_PRECISION', + "name": "totalFeeWithdrawn", + "docs": [ + "sum of all fees from fee pool withdrawn to revenue pool", + "precision: QUOTE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'totalLiquidationFee', - docs: [ - 'all fees collected by market for liquidations', - 'precision: QUOTE_PRECISION', + "name": "totalLiquidationFee", + "docs": [ + "all fees collected by market for liquidations", + "precision: QUOTE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'cumulativeFundingRateLong', - docs: [ - 'accumulated funding rate for longs since inception in market', + "name": "cumulativeFundingRateLong", + "docs": [ + "accumulated funding rate for longs since inception in market" ], - type: 'i128', + "type": "i128" }, { - name: 'cumulativeFundingRateShort', - docs: [ - 'accumulated funding rate for shorts since inception in market', + "name": "cumulativeFundingRateShort", + "docs": [ + "accumulated funding rate for shorts since inception in market" ], - type: 'i128', + "type": "i128" }, { - name: 'totalSocialLoss', - docs: [ - 'accumulated social loss paid by users since inception in market', + "name": "totalSocialLoss", + "docs": [ + "accumulated social loss paid by users since inception in market" ], - type: 'u128', + "type": "u128" }, { - name: 'askBaseAssetReserve', - docs: [ - 'transformed base_asset_reserve for users going long', - 'precision: AMM_RESERVE_PRECISION', + "name": "askBaseAssetReserve", + "docs": [ + "transformed base_asset_reserve for users going long", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'askQuoteAssetReserve', - docs: [ - 'transformed quote_asset_reserve for users going long', - 'precision: AMM_RESERVE_PRECISION', + "name": "askQuoteAssetReserve", + "docs": [ + "transformed quote_asset_reserve for users going long", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'bidBaseAssetReserve', - docs: [ - 'transformed base_asset_reserve for users going short', - 'precision: AMM_RESERVE_PRECISION', + "name": "bidBaseAssetReserve", + "docs": [ + "transformed base_asset_reserve for users going short", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'bidQuoteAssetReserve', - docs: [ - 'transformed quote_asset_reserve for users going short', - 'precision: AMM_RESERVE_PRECISION', + "name": "bidQuoteAssetReserve", + "docs": [ + "transformed quote_asset_reserve for users going short", + "precision: AMM_RESERVE_PRECISION" ], - type: 'u128', + "type": "u128" }, { - name: 'lastOracleNormalisedPrice', - docs: [ - 'the last seen oracle price partially shrunk toward the amm reserve price', - 'precision: PRICE_PRECISION', + "name": "lastOracleNormalisedPrice", + "docs": [ + "the last seen oracle price partially shrunk toward the amm reserve price", + "precision: PRICE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'lastOracleReservePriceSpreadPct', - docs: [ - 'the gap between the oracle price and the reserve price = y * peg_multiplier / x', + "name": "lastOracleReservePriceSpreadPct", + "docs": [ + "the gap between the oracle price and the reserve price = y * peg_multiplier / x" ], - type: 'i64', + "type": "i64" }, { - name: 'lastBidPriceTwap', - docs: [ - 'average estimate of bid price over funding_period', - 'precision: PRICE_PRECISION', + "name": "lastBidPriceTwap", + "docs": [ + "average estimate of bid price over funding_period", + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastAskPriceTwap', - docs: [ - 'average estimate of ask price over funding_period', - 'precision: PRICE_PRECISION', + "name": "lastAskPriceTwap", + "docs": [ + "average estimate of ask price over funding_period", + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastMarkPriceTwap', - docs: [ - 'average estimate of (bid+ask)/2 price over funding_period', - 'precision: PRICE_PRECISION', + "name": "lastMarkPriceTwap", + "docs": [ + "average estimate of (bid+ask)/2 price over funding_period", + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastMarkPriceTwap5min', - docs: ['average estimate of (bid+ask)/2 price over FIVE_MINUTES'], - type: 'u64', + "name": "lastMarkPriceTwap5min", + "docs": [ + "average estimate of (bid+ask)/2 price over FIVE_MINUTES" + ], + "type": "u64" }, { - name: 'lastUpdateSlot', - docs: ['the last blockchain slot the amm was updated'], - type: 'u64', + "name": "lastUpdateSlot", + "docs": [ + "the last blockchain slot the amm was updated" + ], + "type": "u64" }, { - name: 'lastOracleConfPct', - docs: [ - 'the pct size of the oracle confidence interval', - 'precision: PERCENTAGE_PRECISION', + "name": "lastOracleConfPct", + "docs": [ + "the pct size of the oracle confidence interval", + "precision: PERCENTAGE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'netRevenueSinceLastFunding', - docs: [ - 'the total_fee_minus_distribution change since the last funding update', - 'precision: QUOTE_PRECISION', + "name": "netRevenueSinceLastFunding", + "docs": [ + "the total_fee_minus_distribution change since the last funding update", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'lastFundingRateTs', - docs: ['the last funding rate update unix_timestamp'], - type: 'i64', + "name": "lastFundingRateTs", + "docs": [ + "the last funding rate update unix_timestamp" + ], + "type": "i64" }, { - name: 'fundingPeriod', - docs: ['the peridocity of the funding rate updates'], - type: 'i64', + "name": "fundingPeriod", + "docs": [ + "the peridocity of the funding rate updates" + ], + "type": "i64" }, { - name: 'orderStepSize', - docs: [ - 'the base step size (increment) of orders', - 'precision: BASE_PRECISION', + "name": "orderStepSize", + "docs": [ + "the base step size (increment) of orders", + "precision: BASE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'orderTickSize', - docs: [ - 'the price tick size of orders', - 'precision: PRICE_PRECISION', + "name": "orderTickSize", + "docs": [ + "the price tick size of orders", + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'minOrderSize', - docs: [ - 'the minimum base size of an order', - 'precision: BASE_PRECISION', + "name": "minOrderSize", + "docs": [ + "the minimum base size of an order", + "precision: BASE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'maxPositionSize', - docs: [ - 'the max base size a single user can have', - 'precision: BASE_PRECISION', + "name": "maxPositionSize", + "docs": [ + "the max base size a single user can have", + "precision: BASE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'volume24h', - docs: ['estimated total of volume in market', 'QUOTE_PRECISION'], - type: 'u64', + "name": "volume24h", + "docs": [ + "estimated total of volume in market", + "QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'longIntensityVolume', - docs: ['the volume intensity of long fills against AMM'], - type: 'u64', + "name": "longIntensityVolume", + "docs": [ + "the volume intensity of long fills against AMM" + ], + "type": "u64" }, { - name: 'shortIntensityVolume', - docs: ['the volume intensity of short fills against AMM'], - type: 'u64', + "name": "shortIntensityVolume", + "docs": [ + "the volume intensity of short fills against AMM" + ], + "type": "u64" }, { - name: 'lastTradeTs', - docs: [ - 'the blockchain unix timestamp at the time of the last trade', + "name": "lastTradeTs", + "docs": [ + "the blockchain unix timestamp at the time of the last trade" ], - type: 'i64', + "type": "i64" }, { - name: 'markStd', - docs: [ - 'estimate of standard deviation of the fill (mark) prices', - 'precision: PRICE_PRECISION', + "name": "markStd", + "docs": [ + "estimate of standard deviation of the fill (mark) prices", + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'oracleStd', - docs: [ - 'estimate of standard deviation of the oracle price at each update', - 'precision: PRICE_PRECISION', + "name": "oracleStd", + "docs": [ + "estimate of standard deviation of the oracle price at each update", + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastMarkPriceTwapTs', - docs: ['the last unix_timestamp the mark twap was updated'], - type: 'i64', + "name": "lastMarkPriceTwapTs", + "docs": [ + "the last unix_timestamp the mark twap was updated" + ], + "type": "i64" }, { - name: 'baseSpread', - docs: [ - 'the minimum spread the AMM can quote. also used as step size for some spread logic increases.', + "name": "baseSpread", + "docs": [ + "the minimum spread the AMM can quote. also used as step size for some spread logic increases." ], - type: 'u32', + "type": "u32" }, { - name: 'maxSpread', - docs: ['the maximum spread the AMM can quote'], - type: 'u32', + "name": "maxSpread", + "docs": [ + "the maximum spread the AMM can quote" + ], + "type": "u32" }, { - name: 'longSpread', - docs: ['the spread for asks vs the reserve price'], - type: 'u32', + "name": "longSpread", + "docs": [ + "the spread for asks vs the reserve price" + ], + "type": "u32" }, { - name: 'shortSpread', - docs: ['the spread for bids vs the reserve price'], - type: 'u32', + "name": "shortSpread", + "docs": [ + "the spread for bids vs the reserve price" + ], + "type": "u32" }, { - name: 'longIntensityCount', - docs: ['the count intensity of long fills against AMM'], - type: 'u32', + "name": "longIntensityCount", + "docs": [ + "the count intensity of long fills against AMM" + ], + "type": "u32" }, { - name: 'shortIntensityCount', - docs: ['the count intensity of short fills against AMM'], - type: 'u32', + "name": "shortIntensityCount", + "docs": [ + "the count intensity of short fills against AMM" + ], + "type": "u32" }, { - name: 'maxFillReserveFraction', - docs: [ - 'the fraction of total available liquidity a single fill on the AMM can consume', + "name": "maxFillReserveFraction", + "docs": [ + "the fraction of total available liquidity a single fill on the AMM can consume" ], - type: 'u16', + "type": "u16" }, { - name: 'maxSlippageRatio', - docs: ['the maximum slippage a single fill on the AMM can push'], - type: 'u16', + "name": "maxSlippageRatio", + "docs": [ + "the maximum slippage a single fill on the AMM can push" + ], + "type": "u16" }, { - name: 'curveUpdateIntensity', - docs: [ - 'the update intensity of AMM formulaic updates (adjusting k). 0-100', + "name": "curveUpdateIntensity", + "docs": [ + "the update intensity of AMM formulaic updates (adjusting k). 0-100" ], - type: 'u8', + "type": "u8" }, { - name: 'ammJitIntensity', - docs: [ - 'the jit intensity of AMM. larger intensity means larger participation in jit. 0 means no jit participation.', - '(0, 100] is intensity for protocol-owned AMM. (100, 200] is intensity for user LP-owned AMM.', + "name": "ammJitIntensity", + "docs": [ + "the jit intensity of AMM. larger intensity means larger participation in jit. 0 means no jit participation.", + "(0, 100] is intensity for protocol-owned AMM. (100, 200] is intensity for user LP-owned AMM." ], - type: 'u8', + "type": "u8" }, { - name: 'oracleSource', - docs: [ - 'the oracle provider information. used to decode/scale the oracle public key', + "name": "oracleSource", + "docs": [ + "the oracle provider information. used to decode/scale the oracle public key" ], - type: { - defined: 'OracleSource', - }, + "type": { + "defined": "OracleSource" + } }, { - name: 'lastOracleValid', - docs: [ - 'tracks whether the oracle was considered valid at the last AMM update', + "name": "lastOracleValid", + "docs": [ + "tracks whether the oracle was considered valid at the last AMM update" ], - type: 'bool', + "type": "bool" }, { - name: 'targetBaseAssetAmountPerLp', - docs: [ - 'the target value for `base_asset_amount_per_lp`, used during AMM JIT with LP split', - 'precision: BASE_PRECISION', + "name": "targetBaseAssetAmountPerLp", + "docs": [ + "the target value for `base_asset_amount_per_lp`, used during AMM JIT with LP split", + "precision: BASE_PRECISION" ], - type: 'i32', + "type": "i32" }, { - name: 'perLpBase', - docs: [ - 'expo for unit of per_lp, base 10 (if per_lp_base=X, then per_lp unit is 10^X)', + "name": "perLpBase", + "docs": [ + "expo for unit of per_lp, base 10 (if per_lp_base=X, then per_lp unit is 10^X)" ], - type: 'i8', + "type": "i8" }, { - name: 'padding1', - type: 'u8', + "name": "padding1", + "type": "u8" }, { - name: 'padding2', - type: 'u16', + "name": "padding2", + "type": "u16" }, { - name: 'totalFeeEarnedPerLp', - type: 'u64', + "name": "totalFeeEarnedPerLp", + "type": "u64" }, { - name: 'netUnsettledFundingPnl', - type: 'i64', + "name": "netUnsettledFundingPnl", + "type": "i64" }, { - name: 'quoteAssetAmountWithUnsettledLp', - type: 'i64', + "name": "quoteAssetAmountWithUnsettledLp", + "type": "i64" }, { - name: 'referencePriceOffset', - type: 'i32', + "name": "referencePriceOffset", + "type": "i32" }, { - name: 'padding', - type: { - array: ['u8', 12], - }, - }, - ], - }, + "name": "padding", + "type": { + "array": [ + "u8", + 12 + ] + } + } + ] + } }, { - name: 'InsuranceFund', - type: { - kind: 'struct', - fields: [ + "name": "InsuranceFund", + "type": { + "kind": "struct", + "fields": [ { - name: 'vault', - type: 'publicKey', + "name": "vault", + "type": "publicKey" }, { - name: 'totalShares', - type: 'u128', + "name": "totalShares", + "type": "u128" }, { - name: 'userShares', - type: 'u128', + "name": "userShares", + "type": "u128" }, { - name: 'sharesBase', - type: 'u128', + "name": "sharesBase", + "type": "u128" }, { - name: 'unstakingPeriod', - type: 'i64', + "name": "unstakingPeriod", + "type": "i64" }, { - name: 'lastRevenueSettleTs', - type: 'i64', + "name": "lastRevenueSettleTs", + "type": "i64" }, { - name: 'revenueSettlePeriod', - type: 'i64', + "name": "revenueSettlePeriod", + "type": "i64" }, { - name: 'totalFactor', - type: 'u32', + "name": "totalFactor", + "type": "u32" }, { - name: 'userFactor', - type: 'u32', - }, - ], - }, + "name": "userFactor", + "type": "u32" + } + ] + } }, { - name: 'OracleGuardRails', - type: { - kind: 'struct', - fields: [ + "name": "OracleGuardRails", + "type": { + "kind": "struct", + "fields": [ { - name: 'priceDivergence', - type: { - defined: 'PriceDivergenceGuardRails', - }, + "name": "priceDivergence", + "type": { + "defined": "PriceDivergenceGuardRails" + } }, { - name: 'validity', - type: { - defined: 'ValidityGuardRails', - }, - }, - ], - }, + "name": "validity", + "type": { + "defined": "ValidityGuardRails" + } + } + ] + } }, { - name: 'PriceDivergenceGuardRails', - type: { - kind: 'struct', - fields: [ + "name": "PriceDivergenceGuardRails", + "type": { + "kind": "struct", + "fields": [ { - name: 'markOraclePercentDivergence', - type: 'u64', + "name": "markOraclePercentDivergence", + "type": "u64" }, { - name: 'oracleTwap5minPercentDivergence', - type: 'u64', - }, - ], - }, + "name": "oracleTwap5minPercentDivergence", + "type": "u64" + } + ] + } }, { - name: 'ValidityGuardRails', - type: { - kind: 'struct', - fields: [ + "name": "ValidityGuardRails", + "type": { + "kind": "struct", + "fields": [ { - name: 'slotsBeforeStaleForAmm', - type: 'i64', + "name": "slotsBeforeStaleForAmm", + "type": "i64" }, { - name: 'slotsBeforeStaleForMargin', - type: 'i64', + "name": "slotsBeforeStaleForMargin", + "type": "i64" }, { - name: 'confidenceIntervalMaxSize', - type: 'u64', + "name": "confidenceIntervalMaxSize", + "type": "u64" }, { - name: 'tooVolatileRatio', - type: 'i64', - }, - ], - }, + "name": "tooVolatileRatio", + "type": "i64" + } + ] + } }, { - name: 'FeeStructure', - type: { - kind: 'struct', - fields: [ + "name": "FeeStructure", + "type": { + "kind": "struct", + "fields": [ { - name: 'feeTiers', - type: { - array: [ + "name": "feeTiers", + "type": { + "array": [ { - defined: 'FeeTier', + "defined": "FeeTier" }, - 10, - ], - }, + 10 + ] + } }, { - name: 'fillerRewardStructure', - type: { - defined: 'OrderFillerRewardStructure', - }, + "name": "fillerRewardStructure", + "type": { + "defined": "OrderFillerRewardStructure" + } }, { - name: 'referrerRewardEpochUpperBound', - type: 'u64', + "name": "referrerRewardEpochUpperBound", + "type": "u64" }, { - name: 'flatFillerFee', - type: 'u64', - }, - ], - }, + "name": "flatFillerFee", + "type": "u64" + } + ] + } }, { - name: 'FeeTier', - type: { - kind: 'struct', - fields: [ + "name": "FeeTier", + "type": { + "kind": "struct", + "fields": [ { - name: 'feeNumerator', - type: 'u32', + "name": "feeNumerator", + "type": "u32" }, { - name: 'feeDenominator', - type: 'u32', + "name": "feeDenominator", + "type": "u32" }, { - name: 'makerRebateNumerator', - type: 'u32', + "name": "makerRebateNumerator", + "type": "u32" }, { - name: 'makerRebateDenominator', - type: 'u32', + "name": "makerRebateDenominator", + "type": "u32" }, { - name: 'referrerRewardNumerator', - type: 'u32', + "name": "referrerRewardNumerator", + "type": "u32" }, { - name: 'referrerRewardDenominator', - type: 'u32', + "name": "referrerRewardDenominator", + "type": "u32" }, { - name: 'refereeFeeNumerator', - type: 'u32', + "name": "refereeFeeNumerator", + "type": "u32" }, { - name: 'refereeFeeDenominator', - type: 'u32', - }, - ], - }, + "name": "refereeFeeDenominator", + "type": "u32" + } + ] + } }, { - name: 'OrderFillerRewardStructure', - type: { - kind: 'struct', - fields: [ + "name": "OrderFillerRewardStructure", + "type": { + "kind": "struct", + "fields": [ { - name: 'rewardNumerator', - type: 'u32', + "name": "rewardNumerator", + "type": "u32" }, { - name: 'rewardDenominator', - type: 'u32', + "name": "rewardDenominator", + "type": "u32" }, { - name: 'timeBasedRewardLowerBound', - type: 'u128', - }, - ], - }, + "name": "timeBasedRewardLowerBound", + "type": "u128" + } + ] + } }, { - name: 'UserFees', - type: { - kind: 'struct', - fields: [ + "name": "UserFees", + "type": { + "kind": "struct", + "fields": [ { - name: 'totalFeePaid', - docs: ['Total taker fee paid', 'precision: QUOTE_PRECISION'], - type: 'u64', + "name": "totalFeePaid", + "docs": [ + "Total taker fee paid", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalFeeRebate', - docs: ['Total maker fee rebate', 'precision: QUOTE_PRECISION'], - type: 'u64', + "name": "totalFeeRebate", + "docs": [ + "Total maker fee rebate", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'totalTokenDiscount', - docs: [ - 'Total discount from holding token', - 'precision: QUOTE_PRECISION', + "name": "totalTokenDiscount", + "docs": [ + "Total discount from holding token", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'totalRefereeDiscount', - docs: [ - 'Total discount from being referred', - 'precision: QUOTE_PRECISION', + "name": "totalRefereeDiscount", + "docs": [ + "Total discount from being referred", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'totalReferrerReward', - docs: ['Total reward to referrer', 'precision: QUOTE_PRECISION'], - type: 'u64', + "name": "totalReferrerReward", + "docs": [ + "Total reward to referrer", + "precision: QUOTE_PRECISION" + ], + "type": "u64" }, { - name: 'currentEpochReferrerReward', - docs: [ - 'Total reward to referrer this epoch', - 'precision: QUOTE_PRECISION', + "name": "currentEpochReferrerReward", + "docs": [ + "Total reward to referrer this epoch", + "precision: QUOTE_PRECISION" ], - type: 'u64', - }, - ], - }, + "type": "u64" + } + ] + } }, { - name: 'SpotPosition', - type: { - kind: 'struct', - fields: [ + "name": "SpotPosition", + "type": { + "kind": "struct", + "fields": [ { - name: 'scaledBalance', - docs: [ - 'The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow', - 'interest of corresponding market.', - 'precision: SPOT_BALANCE_PRECISION', + "name": "scaledBalance", + "docs": [ + "The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow", + "interest of corresponding market.", + "precision: SPOT_BALANCE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'openBids', - docs: [ - 'How many spot bids the user has open', - 'precision: token mint precision', + "name": "openBids", + "docs": [ + "How many spot bids the user has open", + "precision: token mint precision" ], - type: 'i64', + "type": "i64" }, { - name: 'openAsks', - docs: [ - 'How many spot asks the user has open', - 'precision: token mint precision', + "name": "openAsks", + "docs": [ + "How many spot asks the user has open", + "precision: token mint precision" ], - type: 'i64', + "type": "i64" }, { - name: 'cumulativeDeposits', - docs: [ - 'The cumulative deposits/borrows a user has made into a market', - 'precision: token mint precision', + "name": "cumulativeDeposits", + "docs": [ + "The cumulative deposits/borrows a user has made into a market", + "precision: token mint precision" ], - type: 'i64', + "type": "i64" }, { - name: 'marketIndex', - docs: ['The market index of the corresponding spot market'], - type: 'u16', + "name": "marketIndex", + "docs": [ + "The market index of the corresponding spot market" + ], + "type": "u16" }, { - name: 'balanceType', - docs: ['Whether the position is deposit or borrow'], - type: { - defined: 'SpotBalanceType', - }, + "name": "balanceType", + "docs": [ + "Whether the position is deposit or borrow" + ], + "type": { + "defined": "SpotBalanceType" + } }, { - name: 'openOrders', - docs: ['Number of open orders'], - type: 'u8', + "name": "openOrders", + "docs": [ + "Number of open orders" + ], + "type": "u8" }, { - name: 'padding', - type: { - array: ['u8', 4], - }, - }, - ], - }, + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } }, { - name: 'PerpPosition', - type: { - kind: 'struct', - fields: [ + "name": "PerpPosition", + "type": { + "kind": "struct", + "fields": [ { - name: 'lastCumulativeFundingRate', - docs: [ + "name": "lastCumulativeFundingRate", + "docs": [ "The perp market's last cumulative funding rate. Used to calculate the funding payment owed to user", - 'precision: FUNDING_RATE_PRECISION', + "precision: FUNDING_RATE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'baseAssetAmount', - docs: [ - 'the size of the users perp position', - 'precision: BASE_PRECISION', + "name": "baseAssetAmount", + "docs": [ + "the size of the users perp position", + "precision: BASE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'quoteAssetAmount', - docs: [ - 'Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees', - 'Updated when the user open/closes position or settles pnl. Includes fees/funding', - 'precision: QUOTE_PRECISION', + "name": "quoteAssetAmount", + "docs": [ + "Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees", + "Updated when the user open/closes position or settles pnl. Includes fees/funding", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'quoteBreakEvenAmount', - docs: [ - 'The amount of quote the user would need to exit their position at to break even', - 'Updated when the user open/closes position or settles pnl. Includes fees/funding', - 'precision: QUOTE_PRECISION', + "name": "quoteBreakEvenAmount", + "docs": [ + "The amount of quote the user would need to exit their position at to break even", + "Updated when the user open/closes position or settles pnl. Includes fees/funding", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'quoteEntryAmount', - docs: [ - 'The amount quote the user entered the position with. Equal to base asset amount * avg entry price', - 'Updated when the user open/closes position. Excludes fees/funding', - 'precision: QUOTE_PRECISION', + "name": "quoteEntryAmount", + "docs": [ + "The amount quote the user entered the position with. Equal to base asset amount * avg entry price", + "Updated when the user open/closes position. Excludes fees/funding", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'openBids', - docs: [ - 'The amount of open bids the user has in this perp market', - 'precision: BASE_PRECISION', + "name": "openBids", + "docs": [ + "The amount of open bids the user has in this perp market", + "precision: BASE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'openAsks', - docs: [ - 'The amount of open asks the user has in this perp market', - 'precision: BASE_PRECISION', + "name": "openAsks", + "docs": [ + "The amount of open asks the user has in this perp market", + "precision: BASE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'settledPnl', - docs: [ - 'The amount of pnl settled in this market since opening the position', - 'precision: QUOTE_PRECISION', + "name": "settledPnl", + "docs": [ + "The amount of pnl settled in this market since opening the position", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'lpShares', - docs: [ - 'The number of lp (liquidity provider) shares the user has in this perp market', - 'LP shares allow users to provide liquidity via the AMM', - 'precision: BASE_PRECISION', + "name": "lpShares", + "docs": [ + "The number of lp (liquidity provider) shares the user has in this perp market", + "LP shares allow users to provide liquidity via the AMM", + "precision: BASE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'lastBaseAssetAmountPerLp', - docs: [ - 'The last base asset amount per lp the amm had', - 'Used to settle the users lp position', - 'precision: BASE_PRECISION', + "name": "lastBaseAssetAmountPerLp", + "docs": [ + "The last base asset amount per lp the amm had", + "Used to settle the users lp position", + "precision: BASE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'lastQuoteAssetAmountPerLp', - docs: [ - 'The last quote asset amount per lp the amm had', - 'Used to settle the users lp position', - 'precision: QUOTE_PRECISION', + "name": "lastQuoteAssetAmountPerLp", + "docs": [ + "The last quote asset amount per lp the amm had", + "Used to settle the users lp position", + "precision: QUOTE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'remainderBaseAssetAmount', - docs: [ - 'Settling LP position can lead to a small amount of base asset being left over smaller than step size', - 'This records that remainder so it can be settled later on', - 'precision: BASE_PRECISION', + "name": "remainderBaseAssetAmount", + "docs": [ + "Settling LP position can lead to a small amount of base asset being left over smaller than step size", + "This records that remainder so it can be settled later on", + "precision: BASE_PRECISION" ], - type: 'i32', + "type": "i32" }, { - name: 'marketIndex', - docs: ['The market index for the perp market'], - type: 'u16', + "name": "marketIndex", + "docs": [ + "The market index for the perp market" + ], + "type": "u16" }, { - name: 'openOrders', - docs: ['The number of open orders'], - type: 'u8', + "name": "openOrders", + "docs": [ + "The number of open orders" + ], + "type": "u8" }, { - name: 'perLpBase', - type: 'i8', - }, - ], - }, + "name": "perLpBase", + "type": "i8" + } + ] + } }, { - name: 'Order', - type: { - kind: 'struct', - fields: [ + "name": "Order", + "type": { + "kind": "struct", + "fields": [ { - name: 'slot', - docs: ['The slot the order was placed'], - type: 'u64', + "name": "slot", + "docs": [ + "The slot the order was placed" + ], + "type": "u64" }, { - name: 'price', - docs: [ - 'The limit price for the order (can be 0 for market orders)', + "name": "price", + "docs": [ + "The limit price for the order (can be 0 for market orders)", "For orders with an auction, this price isn't used until the auction is complete", - 'precision: PRICE_PRECISION', + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'baseAssetAmount', - docs: [ - 'The size of the order', - 'precision for perps: BASE_PRECISION', - 'precision for spot: token mint precision', + "name": "baseAssetAmount", + "docs": [ + "The size of the order", + "precision for perps: BASE_PRECISION", + "precision for spot: token mint precision" ], - type: 'u64', + "type": "u64" }, { - name: 'baseAssetAmountFilled', - docs: [ - 'The amount of the order filled', - 'precision for perps: BASE_PRECISION', - 'precision for spot: token mint precision', + "name": "baseAssetAmountFilled", + "docs": [ + "The amount of the order filled", + "precision for perps: BASE_PRECISION", + "precision for spot: token mint precision" ], - type: 'u64', + "type": "u64" }, { - name: 'quoteAssetAmountFilled', - docs: [ - 'The amount of quote filled for the order', - 'precision: QUOTE_PRECISION', + "name": "quoteAssetAmountFilled", + "docs": [ + "The amount of quote filled for the order", + "precision: QUOTE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'triggerPrice', - docs: [ - 'At what price the order will be triggered. Only relevant for trigger orders', - 'precision: PRICE_PRECISION', + "name": "triggerPrice", + "docs": [ + "At what price the order will be triggered. Only relevant for trigger orders", + "precision: PRICE_PRECISION" ], - type: 'u64', + "type": "u64" }, { - name: 'auctionStartPrice', - docs: [ - 'The start price for the auction. Only relevant for market/oracle orders', - 'precision: PRICE_PRECISION', + "name": "auctionStartPrice", + "docs": [ + "The start price for the auction. Only relevant for market/oracle orders", + "precision: PRICE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'auctionEndPrice', - docs: [ - 'The end price for the auction. Only relevant for market/oracle orders', - 'precision: PRICE_PRECISION', + "name": "auctionEndPrice", + "docs": [ + "The end price for the auction. Only relevant for market/oracle orders", + "precision: PRICE_PRECISION" ], - type: 'i64', + "type": "i64" }, { - name: 'maxTs', - docs: ['The time when the order will expire'], - type: 'i64', + "name": "maxTs", + "docs": [ + "The time when the order will expire" + ], + "type": "i64" }, { - name: 'oraclePriceOffset', - docs: [ - 'If set, the order limit price is the oracle price + this offset', - 'precision: PRICE_PRECISION', + "name": "oraclePriceOffset", + "docs": [ + "If set, the order limit price is the oracle price + this offset", + "precision: PRICE_PRECISION" ], - type: 'i32', + "type": "i32" }, { - name: 'orderId', - docs: [ - 'The id for the order. Each users has their own order id space', + "name": "orderId", + "docs": [ + "The id for the order. Each users has their own order id space" ], - type: 'u32', + "type": "u32" }, { - name: 'marketIndex', - docs: ['The perp/spot market index'], - type: 'u16', + "name": "marketIndex", + "docs": [ + "The perp/spot market index" + ], + "type": "u16" }, { - name: 'status', - docs: ['Whether the order is open or unused'], - type: { - defined: 'OrderStatus', - }, + "name": "status", + "docs": [ + "Whether the order is open or unused" + ], + "type": { + "defined": "OrderStatus" + } }, { - name: 'orderType', - docs: ['The type of order'], - type: { - defined: 'OrderType', - }, + "name": "orderType", + "docs": [ + "The type of order" + ], + "type": { + "defined": "OrderType" + } }, { - name: 'marketType', - docs: ['Whether market is spot or perp'], - type: { - defined: 'MarketType', - }, + "name": "marketType", + "docs": [ + "Whether market is spot or perp" + ], + "type": { + "defined": "MarketType" + } }, { - name: 'userOrderId', - docs: [ - 'User generated order id. Can make it easier to place/cancel orders', + "name": "userOrderId", + "docs": [ + "User generated order id. Can make it easier to place/cancel orders" ], - type: 'u8', + "type": "u8" }, { - name: 'existingPositionDirection', - docs: ['What the users position was when the order was placed'], - type: { - defined: 'PositionDirection', - }, + "name": "existingPositionDirection", + "docs": [ + "What the users position was when the order was placed" + ], + "type": { + "defined": "PositionDirection" + } }, { - name: 'direction', - docs: [ - 'Whether the user is going long or short. LONG = bid, SHORT = ask', + "name": "direction", + "docs": [ + "Whether the user is going long or short. LONG = bid, SHORT = ask" ], - type: { - defined: 'PositionDirection', - }, + "type": { + "defined": "PositionDirection" + } }, { - name: 'reduceOnly', - docs: ['Whether the order is allowed to only reduce position size'], - type: 'bool', + "name": "reduceOnly", + "docs": [ + "Whether the order is allowed to only reduce position size" + ], + "type": "bool" }, { - name: 'postOnly', - docs: ['Whether the order must be a maker'], - type: 'bool', + "name": "postOnly", + "docs": [ + "Whether the order must be a maker" + ], + "type": "bool" }, { - name: 'immediateOrCancel', - docs: [ - 'Whether the order must be canceled the same slot it is placed', + "name": "immediateOrCancel", + "docs": [ + "Whether the order must be canceled the same slot it is placed" ], - type: 'bool', + "type": "bool" }, { - name: 'triggerCondition', - docs: [ - 'Whether the order is triggered above or below the trigger price. Only relevant for trigger orders', + "name": "triggerCondition", + "docs": [ + "Whether the order is triggered above or below the trigger price. Only relevant for trigger orders" ], - type: { - defined: 'OrderTriggerCondition', - }, + "type": { + "defined": "OrderTriggerCondition" + } }, { - name: 'auctionDuration', - docs: ['How many slots the auction lasts'], - type: 'u8', + "name": "auctionDuration", + "docs": [ + "How many slots the auction lasts" + ], + "type": "u8" }, { - name: 'padding', - type: { - array: ['u8', 3], - }, - }, - ], - }, + "name": "padding", + "type": { + "array": [ + "u8", + 3 + ] + } + } + ] + } }, { - name: 'SwapDirection', - type: { - kind: 'enum', - variants: [ + "name": "SwapDirection", + "type": { + "kind": "enum", + "variants": [ { - name: 'Add', + "name": "Add" }, { - name: 'Remove', - }, - ], - }, + "name": "Remove" + } + ] + } }, { - name: 'ModifyOrderId', - type: { - kind: 'enum', - variants: [ + "name": "ModifyOrderId", + "type": { + "kind": "enum", + "variants": [ { - name: 'UserOrderId', - fields: ['u8'], + "name": "UserOrderId", + "fields": [ + "u8" + ] }, { - name: 'OrderId', - fields: ['u32'], - }, - ], - }, + "name": "OrderId", + "fields": [ + "u32" + ] + } + ] + } }, { - name: 'PositionDirection', - type: { - kind: 'enum', - variants: [ + "name": "PositionDirection", + "type": { + "kind": "enum", + "variants": [ { - name: 'Long', + "name": "Long" }, { - name: 'Short', - }, - ], - }, + "name": "Short" + } + ] + } }, { - name: 'SpotFulfillmentType', - type: { - kind: 'enum', - variants: [ + "name": "SpotFulfillmentType", + "type": { + "kind": "enum", + "variants": [ { - name: 'SerumV3', + "name": "SerumV3" }, { - name: 'Match', + "name": "Match" }, { - name: 'PhoenixV1', + "name": "PhoenixV1" }, - ], - }, + { + "name": "OpenbookV2" + } + ] + } }, { - name: 'SwapReduceOnly', - type: { - kind: 'enum', - variants: [ + "name": "SwapReduceOnly", + "type": { + "kind": "enum", + "variants": [ { - name: 'In', + "name": "In" }, { - name: 'Out', - }, - ], - }, + "name": "Out" + } + ] + } }, { - name: 'TwapPeriod', - type: { - kind: 'enum', - variants: [ + "name": "TwapPeriod", + "type": { + "kind": "enum", + "variants": [ { - name: 'FundingPeriod', + "name": "FundingPeriod" }, { - name: 'FiveMin', - }, - ], - }, + "name": "FiveMin" + } + ] + } }, { - name: 'LiquidationMultiplierType', - type: { - kind: 'enum', - variants: [ + "name": "LiquidationMultiplierType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Discount', + "name": "Discount" }, { - name: 'Premium', - }, - ], - }, + "name": "Premium" + } + ] + } }, { - name: 'MarginRequirementType', - type: { - kind: 'enum', - variants: [ + "name": "MarginRequirementType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Initial', + "name": "Initial" }, { - name: 'Fill', + "name": "Fill" }, { - name: 'Maintenance', - }, - ], - }, + "name": "Maintenance" + } + ] + } }, { - name: 'OracleValidity', - type: { - kind: 'enum', - variants: [ + "name": "OracleValidity", + "type": { + "kind": "enum", + "variants": [ { - name: 'Invalid', + "name": "NonPositive" }, { - name: 'TooVolatile', + "name": "TooVolatile" }, { - name: 'TooUncertain', + "name": "TooUncertain" }, { - name: 'StaleForMargin', + "name": "StaleForMargin" }, { - name: 'InsufficientDataPoints', + "name": "InsufficientDataPoints" }, { - name: 'StaleForAMM', + "name": "StaleForAMM" }, { - name: 'Valid', - }, - ], - }, + "name": "Valid" + } + ] + } }, { - name: 'DriftAction', - type: { - kind: 'enum', - variants: [ + "name": "DriftAction", + "type": { + "kind": "enum", + "variants": [ { - name: 'UpdateFunding', + "name": "UpdateFunding" }, { - name: 'SettlePnl', + "name": "SettlePnl" }, { - name: 'TriggerOrder', + "name": "TriggerOrder" }, { - name: 'FillOrderMatch', + "name": "FillOrderMatch" }, { - name: 'FillOrderAmm', + "name": "FillOrderAmm" }, { - name: 'Liquidate', + "name": "Liquidate" }, { - name: 'MarginCalc', + "name": "MarginCalc" }, { - name: 'UpdateTwap', + "name": "UpdateTwap" }, { - name: 'UpdateAMMCurve', + "name": "UpdateAMMCurve" }, { - name: 'OracleOrderPrice', - }, - ], - }, + "name": "OracleOrderPrice" + } + ] + } }, { - name: 'PositionUpdateType', - type: { - kind: 'enum', - variants: [ + "name": "PositionUpdateType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Open', + "name": "Open" }, { - name: 'Increase', + "name": "Increase" }, { - name: 'Reduce', + "name": "Reduce" }, { - name: 'Close', + "name": "Close" }, { - name: 'Flip', - }, - ], - }, + "name": "Flip" + } + ] + } }, { - name: 'DepositExplanation', - type: { - kind: 'enum', - variants: [ + "name": "DepositExplanation", + "type": { + "kind": "enum", + "variants": [ { - name: 'None', + "name": "None" }, { - name: 'Transfer', + "name": "Transfer" }, { - name: 'Borrow', + "name": "Borrow" }, { - name: 'RepayBorrow', - }, - ], - }, + "name": "RepayBorrow" + } + ] + } }, { - name: 'DepositDirection', - type: { - kind: 'enum', - variants: [ + "name": "DepositDirection", + "type": { + "kind": "enum", + "variants": [ { - name: 'Deposit', + "name": "Deposit" }, { - name: 'Withdraw', - }, - ], - }, + "name": "Withdraw" + } + ] + } }, { - name: 'OrderAction', - type: { - kind: 'enum', - variants: [ + "name": "OrderAction", + "type": { + "kind": "enum", + "variants": [ { - name: 'Place', + "name": "Place" }, { - name: 'Cancel', + "name": "Cancel" }, { - name: 'Fill', + "name": "Fill" }, { - name: 'Trigger', + "name": "Trigger" }, { - name: 'Expire', - }, - ], - }, + "name": "Expire" + } + ] + } }, { - name: 'OrderActionExplanation', - type: { - kind: 'enum', - variants: [ + "name": "OrderActionExplanation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "None" + }, + { + "name": "InsufficientFreeCollateral" + }, + { + "name": "OraclePriceBreachedLimitPrice" + }, { - name: 'None', + "name": "MarketOrderFilledToLimitPrice" }, { - name: 'InsufficientFreeCollateral', + "name": "OrderExpired" }, { - name: 'OraclePriceBreachedLimitPrice', + "name": "Liquidation" }, { - name: 'MarketOrderFilledToLimitPrice', + "name": "OrderFilledWithAMM" }, { - name: 'OrderExpired', + "name": "OrderFilledWithAMMJit" }, { - name: 'Liquidation', + "name": "OrderFilledWithMatch" }, { - name: 'OrderFilledWithAMM', + "name": "OrderFilledWithMatchJit" }, { - name: 'OrderFilledWithAMMJit', + "name": "MarketExpired" }, { - name: 'OrderFilledWithMatch', + "name": "RiskingIncreasingOrder" }, { - name: 'OrderFilledWithMatchJit', + "name": "ReduceOnlyOrderIncreasedPosition" }, { - name: 'MarketExpired', + "name": "OrderFillWithSerum" }, { - name: 'RiskingIncreasingOrder', + "name": "NoBorrowLiquidity" }, { - name: 'ReduceOnlyOrderIncreasedPosition', + "name": "OrderFillWithPhoenix" }, { - name: 'OrderFillWithSerum', + "name": "OrderFilledWithAMMJitLPSplit" }, { - name: 'NoBorrowLiquidity', + "name": "OrderFilledWithLPJit" }, { - name: 'OrderFillWithPhoenix', + "name": "DeriskLp" }, { - name: 'OrderFilledWithAMMJitLPSplit', + "name": "OrderFilledWithOpenbookV2" + } + ] + } + }, + { + "name": "LPAction", + "type": { + "kind": "enum", + "variants": [ + { + "name": "AddLiquidity" }, { - name: 'OrderFilledWithLPJit', + "name": "RemoveLiquidity" }, { - name: 'DeriskLp', + "name": "SettleLiquidity" }, - ], - }, + { + "name": "RemoveLiquidityDerisk" + } + ] + } }, { - name: 'LPAction', - type: { - kind: 'enum', - variants: [ + "name": "LiquidationType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "LiquidatePerp" + }, + { + "name": "LiquidateSpot" + }, { - name: 'AddLiquidity', + "name": "LiquidateBorrowForPerpPnl" }, { - name: 'RemoveLiquidity', + "name": "LiquidatePerpPnlForDeposit" }, { - name: 'SettleLiquidity', + "name": "PerpBankruptcy" }, { - name: 'RemoveLiquidityDerisk', + "name": "SpotBankruptcy" + } + ] + } + }, + { + "name": "SettlePnlExplanation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "None" }, - ], - }, + { + "name": "ExpiredPosition" + } + ] + } }, { - name: 'LiquidationType', - type: { - kind: 'enum', - variants: [ + "name": "StakeAction", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Stake" + }, + { + "name": "UnstakeRequest" + }, + { + "name": "UnstakeCancelRequest" + }, + { + "name": "Unstake" + }, { - name: 'LiquidatePerp', + "name": "UnstakeTransfer" }, { - name: 'LiquidateSpot', + "name": "StakeTransfer" + } + ] + } + }, + { + "name": "FillMode", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Fill" }, { - name: 'LiquidateBorrowForPerpPnl', + "name": "PlaceAndMake" }, { - name: 'LiquidatePerpPnlForDeposit', + "name": "PlaceAndTake" }, { - name: 'PerpBankruptcy', + "name": "Liquidation" + } + ] + } + }, + { + "name": "PerpFulfillmentMethod", + "type": { + "kind": "enum", + "variants": [ + { + "name": "AMM", + "fields": [ + { + "option": "u64" + } + ] }, { - name: 'SpotBankruptcy', + "name": "Match", + "fields": [ + "publicKey", + "u16" + ] + } + ] + } + }, + { + "name": "SpotFulfillmentMethod", + "type": { + "kind": "enum", + "variants": [ + { + "name": "ExternalMarket" }, - ], - }, + { + "name": "Match", + "fields": [ + "publicKey", + "u16" + ] + } + ] + } }, { - name: 'SettlePnlExplanation', - type: { - kind: 'enum', - variants: [ + "name": "MarginCalculationMode", + "type": { + "kind": "enum", + "variants": [ { - name: 'None', + "name": "Standard", + "fields": [ + { + "name": "trackOpenOrdersFraction", + "type": "bool" + } + ] }, { - name: 'ExpiredPosition', - }, - ], - }, + "name": "Liquidation", + "fields": [ + { + "name": "marketToTrackMarginRequirement", + "type": { + "option": { + "defined": "MarketIdentifier" + } + } + } + ] + } + ] + } }, { - name: 'StakeAction', - type: { - kind: 'enum', - variants: [ + "name": "OracleSource", + "type": { + "kind": "enum", + "variants": [ { - name: 'Stake', + "name": "Pyth" }, { - name: 'UnstakeRequest', + "name": "Switchboard" }, { - name: 'UnstakeCancelRequest', + "name": "QuoteAsset" }, { - name: 'Unstake', + "name": "Pyth1K" }, { - name: 'UnstakeTransfer', + "name": "Pyth1M" }, { - name: 'StakeTransfer', + "name": "PythStableCoin" }, - ], - }, - }, - { - name: 'FillMode', - type: { - kind: 'enum', - variants: [ { - name: 'Fill', + "name": "Prelaunch" }, { - name: 'PlaceAndMake', + "name": "PythPull" }, { - name: 'PlaceAndTake', + "name": "Pyth1KPull" }, - ], - }, - }, - { - name: 'PerpFulfillmentMethod', - type: { - kind: 'enum', - variants: [ { - name: 'AMM', - fields: [ - { - option: 'u64', - }, - ], + "name": "Pyth1MPull" }, { - name: 'Match', - fields: ['publicKey', 'u16'], + "name": "PythStableCoinPull" }, - ], - }, + { + "name": "SwitchboardOnDemand" + } + ] + } }, { - name: 'SpotFulfillmentMethod', - type: { - kind: 'enum', - variants: [ + "name": "PostOnlyParam", + "type": { + "kind": "enum", + "variants": [ { - name: 'ExternalMarket', + "name": "None" }, { - name: 'Match', + "name": "MustPostOnly" }, - ], - }, - }, - { - name: 'MarginCalculationMode', - type: { - kind: 'enum', - variants: [ { - name: 'Standard', - fields: [ - { - name: 'track_open_orders_fraction', - type: 'bool', - }, - ], + "name": "TryPostOnly" }, { - name: 'Liquidation', - fields: [ - { - name: 'market_to_track_margin_requirement', - type: { - option: { - defined: 'MarketIdentifier', - }, - }, - }, - ], - }, - ], - }, + "name": "Slide" + } + ] + } }, { - name: 'OracleSource', - type: { - kind: 'enum', - variants: [ - { - name: 'Pyth', - }, - { - name: 'Switchboard', - }, - { - name: 'QuoteAsset', - }, - { - name: 'Pyth1K', - }, + "name": "ModifyOrderPolicy", + "type": { + "kind": "enum", + "variants": [ { - name: 'Pyth1M', + "name": "TryModify" }, { - name: 'PythStableCoin', - }, - ], - }, + "name": "MustModify" + } + ] + } }, { - name: 'PostOnlyParam', - type: { - kind: 'enum', - variants: [ + "name": "PerpOperation", + "type": { + "kind": "enum", + "variants": [ { - name: 'None', + "name": "UpdateFunding" }, { - name: 'MustPostOnly', + "name": "AmmFill" }, { - name: 'TryPostOnly', + "name": "Fill" }, { - name: 'Slide', + "name": "SettlePnl" }, - ], - }, - }, - { - name: 'ModifyOrderPolicy', - type: { - kind: 'enum', - variants: [ { - name: 'TryModify', + "name": "SettlePnlWithPosition" }, { - name: 'MustModify', - }, - ], - }, + "name": "Liquidation" + } + ] + } }, { - name: 'PerpOperation', - type: { - kind: 'enum', - variants: [ - { - name: 'UpdateFunding', - }, + "name": "SpotOperation", + "type": { + "kind": "enum", + "variants": [ { - name: 'AmmFill', + "name": "UpdateCumulativeInterest" }, { - name: 'Fill', + "name": "Fill" }, { - name: 'SettlePnl', + "name": "Deposit" }, { - name: 'SettlePnlWithPosition', + "name": "Withdraw" }, { - name: 'Liquidation', - }, - ], - }, + "name": "Liquidation" + } + ] + } }, { - name: 'SpotOperation', - type: { - kind: 'enum', - variants: [ + "name": "InsuranceFundOperation", + "type": { + "kind": "enum", + "variants": [ { - name: 'UpdateCumulativeInterest', + "name": "Init" }, { - name: 'Fill', + "name": "Add" }, { - name: 'Withdraw', + "name": "RequestRemove" }, { - name: 'Liquidation', - }, - ], - }, + "name": "Remove" + } + ] + } }, { - name: 'MarketStatus', - type: { - kind: 'enum', - variants: [ + "name": "MarketStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'Initialized', + "name": "Initialized" }, { - name: 'Active', + "name": "Active" }, { - name: 'FundingPaused', + "name": "FundingPaused" }, { - name: 'AmmPaused', + "name": "AmmPaused" }, { - name: 'FillPaused', + "name": "FillPaused" }, { - name: 'WithdrawPaused', + "name": "WithdrawPaused" }, { - name: 'ReduceOnly', + "name": "ReduceOnly" }, { - name: 'Settlement', + "name": "Settlement" }, { - name: 'Delisted', - }, - ], - }, + "name": "Delisted" + } + ] + } }, { - name: 'ContractType', - type: { - kind: 'enum', - variants: [ + "name": "ContractType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Perpetual', + "name": "Perpetual" }, { - name: 'Future', + "name": "Future" }, - ], - }, + { + "name": "Prediction" + } + ] + } }, { - name: 'ContractTier', - type: { - kind: 'enum', - variants: [ + "name": "ContractTier", + "type": { + "kind": "enum", + "variants": [ { - name: 'A', + "name": "A" }, { - name: 'B', + "name": "B" }, { - name: 'C', + "name": "C" }, { - name: 'Speculative', + "name": "Speculative" }, { - name: 'Isolated', + "name": "HighlySpeculative" }, - ], - }, + { + "name": "Isolated" + } + ] + } }, { - name: 'AMMLiquiditySplit', - type: { - kind: 'enum', - variants: [ + "name": "AMMLiquiditySplit", + "type": { + "kind": "enum", + "variants": [ { - name: 'ProtocolOwned', + "name": "ProtocolOwned" }, { - name: 'LPOwned', + "name": "LPOwned" }, { - name: 'Shared', - }, - ], - }, + "name": "Shared" + } + ] + } }, { - name: 'SpotBalanceType', - type: { - kind: 'enum', - variants: [ + "name": "SettlePnlMode", + "type": { + "kind": "enum", + "variants": [ { - name: 'Deposit', + "name": "MustSettle" }, { - name: 'Borrow', - }, - ], - }, + "name": "TrySettle" + } + ] + } }, { - name: 'SpotFulfillmentConfigStatus', - type: { - kind: 'enum', - variants: [ + "name": "SpotBalanceType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Enabled', + "name": "Deposit" }, { - name: 'Disabled', - }, - ], - }, + "name": "Borrow" + } + ] + } }, { - name: 'AssetTier', - type: { - kind: 'enum', - variants: [ + "name": "SpotFulfillmentConfigStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'Collateral', + "name": "Enabled" }, { - name: 'Protected', + "name": "Disabled" + } + ] + } + }, + { + "name": "AssetTier", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Collateral" }, { - name: 'Cross', + "name": "Protected" }, { - name: 'Isolated', + "name": "Cross" }, { - name: 'Unlisted', + "name": "Isolated" }, - ], - }, + { + "name": "Unlisted" + } + ] + } }, { - name: 'ExchangeStatus', - type: { - kind: 'enum', - variants: [ + "name": "ExchangeStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'DepositPaused', + "name": "DepositPaused" }, { - name: 'WithdrawPaused', + "name": "WithdrawPaused" }, { - name: 'AmmPaused', + "name": "AmmPaused" }, { - name: 'FillPaused', + "name": "FillPaused" }, { - name: 'LiqPaused', + "name": "LiqPaused" }, { - name: 'FundingPaused', + "name": "FundingPaused" }, { - name: 'SettlePnlPaused', - }, - ], - }, + "name": "SettlePnlPaused" + } + ] + } }, { - name: 'UserStatus', - type: { - kind: 'enum', - variants: [ + "name": "UserStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'BeingLiquidated', + "name": "BeingLiquidated" }, { - name: 'Bankrupt', + "name": "Bankrupt" }, { - name: 'ReduceOnly', + "name": "ReduceOnly" }, { - name: 'AdvancedLp', - }, - ], - }, + "name": "AdvancedLp" + } + ] + } }, { - name: 'AssetType', - type: { - kind: 'enum', - variants: [ + "name": "AssetType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Base', + "name": "Base" }, { - name: 'Quote', - }, - ], - }, + "name": "Quote" + } + ] + } }, { - name: 'OrderStatus', - type: { - kind: 'enum', - variants: [ + "name": "OrderStatus", + "type": { + "kind": "enum", + "variants": [ { - name: 'Init', + "name": "Init" }, { - name: 'Open', + "name": "Open" }, { - name: 'Filled', + "name": "Filled" }, { - name: 'Canceled', - }, - ], - }, + "name": "Canceled" + } + ] + } }, { - name: 'OrderType', - type: { - kind: 'enum', - variants: [ + "name": "OrderType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Market', + "name": "Market" }, { - name: 'Limit', + "name": "Limit" }, { - name: 'TriggerMarket', + "name": "TriggerMarket" }, { - name: 'TriggerLimit', + "name": "TriggerLimit" }, { - name: 'Oracle', - }, - ], - }, + "name": "Oracle" + } + ] + } }, { - name: 'OrderTriggerCondition', - type: { - kind: 'enum', - variants: [ + "name": "OrderTriggerCondition", + "type": { + "kind": "enum", + "variants": [ { - name: 'Above', + "name": "Above" }, { - name: 'Below', + "name": "Below" }, { - name: 'TriggeredAbove', + "name": "TriggeredAbove" }, { - name: 'TriggeredBelow', - }, - ], - }, + "name": "TriggeredBelow" + } + ] + } }, { - name: 'MarketType', - type: { - kind: 'enum', - variants: [ + "name": "MarketType", + "type": { + "kind": "enum", + "variants": [ { - name: 'Spot', + "name": "Spot" }, { - name: 'Perp', - }, - ], - }, - }, + "name": "Perp" + } + ] + } + } ], - events: [ + "events": [ { - name: 'NewUserRecord', - fields: [ + "name": "NewUserRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority', - type: 'publicKey', - index: false, + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'subAccountId', - type: 'u16', - index: false, + "name": "subAccountId", + "type": "u16", + "index": false }, { - name: 'name', - type: { - array: ['u8', 32], + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] }, - index: false, + "index": false }, { - name: 'referrer', - type: 'publicKey', - index: false, - }, - ], + "name": "referrer", + "type": "publicKey", + "index": false + } + ] }, { - name: 'DepositRecord', - fields: [ + "name": "DepositRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority', - type: 'publicKey', - index: false, + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'direction', - type: { - defined: 'DepositDirection', + "name": "direction", + "type": { + "defined": "DepositDirection" }, - index: false, + "index": false }, { - name: 'depositRecordId', - type: 'u64', - index: false, + "name": "depositRecordId", + "type": "u64", + "index": false }, { - name: 'amount', - type: 'u64', - index: false, + "name": "amount", + "type": "u64", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'oraclePrice', - type: 'i64', - index: false, + "name": "oraclePrice", + "type": "i64", + "index": false }, { - name: 'marketDepositBalance', - type: 'u128', - index: false, + "name": "marketDepositBalance", + "type": "u128", + "index": false }, { - name: 'marketWithdrawBalance', - type: 'u128', - index: false, + "name": "marketWithdrawBalance", + "type": "u128", + "index": false }, { - name: 'marketCumulativeDepositInterest', - type: 'u128', - index: false, + "name": "marketCumulativeDepositInterest", + "type": "u128", + "index": false }, { - name: 'marketCumulativeBorrowInterest', - type: 'u128', - index: false, + "name": "marketCumulativeBorrowInterest", + "type": "u128", + "index": false }, { - name: 'totalDepositsAfter', - type: 'u64', - index: false, + "name": "totalDepositsAfter", + "type": "u64", + "index": false }, { - name: 'totalWithdrawsAfter', - type: 'u64', - index: false, + "name": "totalWithdrawsAfter", + "type": "u64", + "index": false }, { - name: 'explanation', - type: { - defined: 'DepositExplanation', + "name": "explanation", + "type": { + "defined": "DepositExplanation" }, - index: false, + "index": false }, { - name: 'transferUser', - type: { - option: 'publicKey', + "name": "transferUser", + "type": { + "option": "publicKey" }, - index: false, - }, - ], + "index": false + } + ] }, { - name: 'SpotInterestRecord', - fields: [ + "name": "SpotInterestRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'depositBalance', - type: 'u128', - index: false, + "name": "depositBalance", + "type": "u128", + "index": false }, { - name: 'cumulativeDepositInterest', - type: 'u128', - index: false, + "name": "cumulativeDepositInterest", + "type": "u128", + "index": false }, { - name: 'borrowBalance', - type: 'u128', - index: false, + "name": "borrowBalance", + "type": "u128", + "index": false }, { - name: 'cumulativeBorrowInterest', - type: 'u128', - index: false, + "name": "cumulativeBorrowInterest", + "type": "u128", + "index": false }, { - name: 'optimalUtilization', - type: 'u32', - index: false, + "name": "optimalUtilization", + "type": "u32", + "index": false }, { - name: 'optimalBorrowRate', - type: 'u32', - index: false, + "name": "optimalBorrowRate", + "type": "u32", + "index": false }, { - name: 'maxBorrowRate', - type: 'u32', - index: false, - }, - ], + "name": "maxBorrowRate", + "type": "u32", + "index": false + } + ] }, { - name: 'FundingPaymentRecord', - fields: [ + "name": "FundingPaymentRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority', - type: 'publicKey', - index: false, + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'fundingPayment', - type: 'i64', - index: false, + "name": "fundingPayment", + "type": "i64", + "index": false }, { - name: 'baseAssetAmount', - type: 'i64', - index: false, + "name": "baseAssetAmount", + "type": "i64", + "index": false }, { - name: 'userLastCumulativeFunding', - type: 'i64', - index: false, + "name": "userLastCumulativeFunding", + "type": "i64", + "index": false }, { - name: 'ammCumulativeFundingLong', - type: 'i128', - index: false, + "name": "ammCumulativeFundingLong", + "type": "i128", + "index": false }, { - name: 'ammCumulativeFundingShort', - type: 'i128', - index: false, - }, - ], + "name": "ammCumulativeFundingShort", + "type": "i128", + "index": false + } + ] }, { - name: 'FundingRateRecord', - fields: [ + "name": "FundingRateRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'recordId', - type: 'u64', - index: false, + "name": "recordId", + "type": "u64", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'fundingRate', - type: 'i64', - index: false, + "name": "fundingRate", + "type": "i64", + "index": false }, { - name: 'fundingRateLong', - type: 'i128', - index: false, + "name": "fundingRateLong", + "type": "i128", + "index": false }, { - name: 'fundingRateShort', - type: 'i128', - index: false, + "name": "fundingRateShort", + "type": "i128", + "index": false }, { - name: 'cumulativeFundingRateLong', - type: 'i128', - index: false, + "name": "cumulativeFundingRateLong", + "type": "i128", + "index": false }, { - name: 'cumulativeFundingRateShort', - type: 'i128', - index: false, + "name": "cumulativeFundingRateShort", + "type": "i128", + "index": false }, { - name: 'oraclePriceTwap', - type: 'i64', - index: false, + "name": "oraclePriceTwap", + "type": "i64", + "index": false }, { - name: 'markPriceTwap', - type: 'u64', - index: false, + "name": "markPriceTwap", + "type": "u64", + "index": false }, { - name: 'periodRevenue', - type: 'i64', - index: false, + "name": "periodRevenue", + "type": "i64", + "index": false }, { - name: 'baseAssetAmountWithAmm', - type: 'i128', - index: false, + "name": "baseAssetAmountWithAmm", + "type": "i128", + "index": false }, { - name: 'baseAssetAmountWithUnsettledLp', - type: 'i128', - index: false, - }, - ], + "name": "baseAssetAmountWithUnsettledLp", + "type": "i128", + "index": false + } + ] }, { - name: 'CurveRecord', - fields: [ + "name": "CurveRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'recordId', - type: 'u64', - index: false, + "name": "recordId", + "type": "u64", + "index": false }, { - name: 'pegMultiplierBefore', - type: 'u128', - index: false, + "name": "pegMultiplierBefore", + "type": "u128", + "index": false }, { - name: 'baseAssetReserveBefore', - type: 'u128', - index: false, + "name": "baseAssetReserveBefore", + "type": "u128", + "index": false }, { - name: 'quoteAssetReserveBefore', - type: 'u128', - index: false, + "name": "quoteAssetReserveBefore", + "type": "u128", + "index": false }, { - name: 'sqrtKBefore', - type: 'u128', - index: false, + "name": "sqrtKBefore", + "type": "u128", + "index": false }, { - name: 'pegMultiplierAfter', - type: 'u128', - index: false, + "name": "pegMultiplierAfter", + "type": "u128", + "index": false }, { - name: 'baseAssetReserveAfter', - type: 'u128', - index: false, + "name": "baseAssetReserveAfter", + "type": "u128", + "index": false }, { - name: 'quoteAssetReserveAfter', - type: 'u128', - index: false, + "name": "quoteAssetReserveAfter", + "type": "u128", + "index": false }, { - name: 'sqrtKAfter', - type: 'u128', - index: false, + "name": "sqrtKAfter", + "type": "u128", + "index": false }, { - name: 'baseAssetAmountLong', - type: 'u128', - index: false, + "name": "baseAssetAmountLong", + "type": "u128", + "index": false }, { - name: 'baseAssetAmountShort', - type: 'u128', - index: false, + "name": "baseAssetAmountShort", + "type": "u128", + "index": false }, { - name: 'baseAssetAmountWithAmm', - type: 'i128', - index: false, + "name": "baseAssetAmountWithAmm", + "type": "i128", + "index": false }, { - name: 'totalFee', - type: 'i128', - index: false, + "name": "totalFee", + "type": "i128", + "index": false }, { - name: 'totalFeeMinusDistributions', - type: 'i128', - index: false, + "name": "totalFeeMinusDistributions", + "type": "i128", + "index": false }, { - name: 'adjustmentCost', - type: 'i128', - index: false, + "name": "adjustmentCost", + "type": "i128", + "index": false }, { - name: 'oraclePrice', - type: 'i64', - index: false, + "name": "oraclePrice", + "type": "i64", + "index": false }, { - name: 'fillRecord', - type: 'u128', - index: false, + "name": "fillRecord", + "type": "u128", + "index": false }, { - name: 'numberOfUsers', - type: 'u32', - index: false, + "name": "numberOfUsers", + "type": "u32", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, - }, - ], + "name": "marketIndex", + "type": "u16", + "index": false + } + ] }, { - name: 'OrderRecord', - fields: [ + "name": "OrderRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'order', - type: { - defined: 'Order', + "name": "order", + "type": { + "defined": "Order" }, - index: false, - }, - ], + "index": false + } + ] }, { - name: 'OrderActionRecord', - fields: [ + "name": "OrderActionRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'action', - type: { - defined: 'OrderAction', + "name": "action", + "type": { + "defined": "OrderAction" }, - index: false, + "index": false }, { - name: 'actionExplanation', - type: { - defined: 'OrderActionExplanation', + "name": "actionExplanation", + "type": { + "defined": "OrderActionExplanation" }, - index: false, + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'marketType', - type: { - defined: 'MarketType', + "name": "marketType", + "type": { + "defined": "MarketType" }, - index: false, + "index": false }, { - name: 'filler', - type: { - option: 'publicKey', + "name": "filler", + "type": { + "option": "publicKey" }, - index: false, + "index": false }, { - name: 'fillerReward', - type: { - option: 'u64', + "name": "fillerReward", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'fillRecordId', - type: { - option: 'u64', + "name": "fillRecordId", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'baseAssetAmountFilled', - type: { - option: 'u64', + "name": "baseAssetAmountFilled", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'quoteAssetAmountFilled', - type: { - option: 'u64', + "name": "quoteAssetAmountFilled", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'takerFee', - type: { - option: 'u64', + "name": "takerFee", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'makerFee', - type: { - option: 'i64', + "name": "makerFee", + "type": { + "option": "i64" }, - index: false, + "index": false }, { - name: 'referrerReward', - type: { - option: 'u32', + "name": "referrerReward", + "type": { + "option": "u32" }, - index: false, + "index": false }, { - name: 'quoteAssetAmountSurplus', - type: { - option: 'i64', + "name": "quoteAssetAmountSurplus", + "type": { + "option": "i64" }, - index: false, + "index": false }, { - name: 'spotFulfillmentMethodFee', - type: { - option: 'u64', + "name": "spotFulfillmentMethodFee", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'taker', - type: { - option: 'publicKey', + "name": "taker", + "type": { + "option": "publicKey" }, - index: false, + "index": false }, { - name: 'takerOrderId', - type: { - option: 'u32', + "name": "takerOrderId", + "type": { + "option": "u32" }, - index: false, + "index": false }, { - name: 'takerOrderDirection', - type: { - option: { - defined: 'PositionDirection', - }, + "name": "takerOrderDirection", + "type": { + "option": { + "defined": "PositionDirection" + } }, - index: false, + "index": false }, { - name: 'takerOrderBaseAssetAmount', - type: { - option: 'u64', + "name": "takerOrderBaseAssetAmount", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'takerOrderCumulativeBaseAssetAmountFilled', - type: { - option: 'u64', + "name": "takerOrderCumulativeBaseAssetAmountFilled", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'takerOrderCumulativeQuoteAssetAmountFilled', - type: { - option: 'u64', + "name": "takerOrderCumulativeQuoteAssetAmountFilled", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'maker', - type: { - option: 'publicKey', + "name": "maker", + "type": { + "option": "publicKey" }, - index: false, + "index": false }, { - name: 'makerOrderId', - type: { - option: 'u32', + "name": "makerOrderId", + "type": { + "option": "u32" }, - index: false, + "index": false }, { - name: 'makerOrderDirection', - type: { - option: { - defined: 'PositionDirection', - }, + "name": "makerOrderDirection", + "type": { + "option": { + "defined": "PositionDirection" + } }, - index: false, + "index": false }, { - name: 'makerOrderBaseAssetAmount', - type: { - option: 'u64', + "name": "makerOrderBaseAssetAmount", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'makerOrderCumulativeBaseAssetAmountFilled', - type: { - option: 'u64', + "name": "makerOrderCumulativeBaseAssetAmountFilled", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'makerOrderCumulativeQuoteAssetAmountFilled', - type: { - option: 'u64', + "name": "makerOrderCumulativeQuoteAssetAmountFilled", + "type": { + "option": "u64" }, - index: false, + "index": false }, { - name: 'oraclePrice', - type: 'i64', - index: false, - }, - ], + "name": "oraclePrice", + "type": "i64", + "index": false + } + ] }, { - name: 'LPRecord', - fields: [ + "name": "LPRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'action', - type: { - defined: 'LPAction', + "name": "action", + "type": { + "defined": "LPAction" }, - index: false, + "index": false }, { - name: 'nShares', - type: 'u64', - index: false, + "name": "nShares", + "type": "u64", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'deltaBaseAssetAmount', - type: 'i64', - index: false, + "name": "deltaBaseAssetAmount", + "type": "i64", + "index": false }, { - name: 'deltaQuoteAssetAmount', - type: 'i64', - index: false, + "name": "deltaQuoteAssetAmount", + "type": "i64", + "index": false }, { - name: 'pnl', - type: 'i64', - index: false, - }, - ], + "name": "pnl", + "type": "i64", + "index": false + } + ] }, { - name: 'LiquidationRecord', - fields: [ + "name": "LiquidationRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'liquidationType', - type: { - defined: 'LiquidationType', + "name": "liquidationType", + "type": { + "defined": "LiquidationType" }, - index: false, + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'liquidator', - type: 'publicKey', - index: false, + "name": "liquidator", + "type": "publicKey", + "index": false }, { - name: 'marginRequirement', - type: 'u128', - index: false, + "name": "marginRequirement", + "type": "u128", + "index": false }, { - name: 'totalCollateral', - type: 'i128', - index: false, + "name": "totalCollateral", + "type": "i128", + "index": false }, { - name: 'marginFreed', - type: 'u64', - index: false, + "name": "marginFreed", + "type": "u64", + "index": false }, { - name: 'liquidationId', - type: 'u16', - index: false, + "name": "liquidationId", + "type": "u16", + "index": false }, { - name: 'bankrupt', - type: 'bool', - index: false, + "name": "bankrupt", + "type": "bool", + "index": false }, { - name: 'canceledOrderIds', - type: { - vec: 'u32', + "name": "canceledOrderIds", + "type": { + "vec": "u32" }, - index: false, + "index": false }, { - name: 'liquidatePerp', - type: { - defined: 'LiquidatePerpRecord', + "name": "liquidatePerp", + "type": { + "defined": "LiquidatePerpRecord" }, - index: false, + "index": false }, { - name: 'liquidateSpot', - type: { - defined: 'LiquidateSpotRecord', + "name": "liquidateSpot", + "type": { + "defined": "LiquidateSpotRecord" }, - index: false, + "index": false }, { - name: 'liquidateBorrowForPerpPnl', - type: { - defined: 'LiquidateBorrowForPerpPnlRecord', + "name": "liquidateBorrowForPerpPnl", + "type": { + "defined": "LiquidateBorrowForPerpPnlRecord" }, - index: false, + "index": false }, { - name: 'liquidatePerpPnlForDeposit', - type: { - defined: 'LiquidatePerpPnlForDepositRecord', + "name": "liquidatePerpPnlForDeposit", + "type": { + "defined": "LiquidatePerpPnlForDepositRecord" }, - index: false, + "index": false }, { - name: 'perpBankruptcy', - type: { - defined: 'PerpBankruptcyRecord', + "name": "perpBankruptcy", + "type": { + "defined": "PerpBankruptcyRecord" }, - index: false, + "index": false }, { - name: 'spotBankruptcy', - type: { - defined: 'SpotBankruptcyRecord', + "name": "spotBankruptcy", + "type": { + "defined": "SpotBankruptcyRecord" }, - index: false, - }, - ], + "index": false + } + ] }, { - name: 'SettlePnlRecord', - fields: [ + "name": "SettlePnlRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'pnl', - type: 'i128', - index: false, + "name": "pnl", + "type": "i128", + "index": false }, { - name: 'baseAssetAmount', - type: 'i64', - index: false, + "name": "baseAssetAmount", + "type": "i64", + "index": false }, { - name: 'quoteAssetAmountAfter', - type: 'i64', - index: false, + "name": "quoteAssetAmountAfter", + "type": "i64", + "index": false }, { - name: 'quoteEntryAmount', - type: 'i64', - index: false, + "name": "quoteEntryAmount", + "type": "i64", + "index": false }, { - name: 'settlePrice', - type: 'i64', - index: false, + "name": "settlePrice", + "type": "i64", + "index": false }, { - name: 'explanation', - type: { - defined: 'SettlePnlExplanation', + "name": "explanation", + "type": { + "defined": "SettlePnlExplanation" }, - index: false, - }, - ], + "index": false + } + ] }, { - name: 'InsuranceFundRecord', - fields: [ + "name": "InsuranceFundRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'spotMarketIndex', - type: 'u16', - index: false, + "name": "spotMarketIndex", + "type": "u16", + "index": false }, { - name: 'perpMarketIndex', - type: 'u16', - index: false, + "name": "perpMarketIndex", + "type": "u16", + "index": false }, { - name: 'userIfFactor', - type: 'u32', - index: false, + "name": "userIfFactor", + "type": "u32", + "index": false }, { - name: 'totalIfFactor', - type: 'u32', - index: false, + "name": "totalIfFactor", + "type": "u32", + "index": false }, { - name: 'vaultAmountBefore', - type: 'u64', - index: false, + "name": "vaultAmountBefore", + "type": "u64", + "index": false }, { - name: 'insuranceVaultAmountBefore', - type: 'u64', - index: false, + "name": "insuranceVaultAmountBefore", + "type": "u64", + "index": false }, { - name: 'totalIfSharesBefore', - type: 'u128', - index: false, + "name": "totalIfSharesBefore", + "type": "u128", + "index": false }, { - name: 'totalIfSharesAfter', - type: 'u128', - index: false, + "name": "totalIfSharesAfter", + "type": "u128", + "index": false }, { - name: 'amount', - type: 'i64', - index: false, - }, - ], + "name": "amount", + "type": "i64", + "index": false + } + ] }, { - name: 'InsuranceFundStakeRecord', - fields: [ + "name": "InsuranceFundStakeRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'userAuthority', - type: 'publicKey', - index: false, + "name": "userAuthority", + "type": "publicKey", + "index": false }, { - name: 'action', - type: { - defined: 'StakeAction', + "name": "action", + "type": { + "defined": "StakeAction" }, - index: false, + "index": false }, { - name: 'amount', - type: 'u64', - index: false, + "name": "amount", + "type": "u64", + "index": false }, { - name: 'marketIndex', - type: 'u16', - index: false, + "name": "marketIndex", + "type": "u16", + "index": false }, { - name: 'insuranceVaultAmountBefore', - type: 'u64', - index: false, + "name": "insuranceVaultAmountBefore", + "type": "u64", + "index": false }, { - name: 'ifSharesBefore', - type: 'u128', - index: false, + "name": "ifSharesBefore", + "type": "u128", + "index": false }, { - name: 'userIfSharesBefore', - type: 'u128', - index: false, + "name": "userIfSharesBefore", + "type": "u128", + "index": false }, { - name: 'totalIfSharesBefore', - type: 'u128', - index: false, + "name": "totalIfSharesBefore", + "type": "u128", + "index": false }, { - name: 'ifSharesAfter', - type: 'u128', - index: false, + "name": "ifSharesAfter", + "type": "u128", + "index": false }, { - name: 'userIfSharesAfter', - type: 'u128', - index: false, + "name": "userIfSharesAfter", + "type": "u128", + "index": false }, { - name: 'totalIfSharesAfter', - type: 'u128', - index: false, - }, - ], + "name": "totalIfSharesAfter", + "type": "u128", + "index": false + } + ] }, { - name: 'SwapRecord', - fields: [ + "name": "SwapRecord", + "fields": [ { - name: 'ts', - type: 'i64', - index: false, + "name": "ts", + "type": "i64", + "index": false }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'amountOut', - type: 'u64', - index: false, + "name": "amountOut", + "type": "u64", + "index": false }, { - name: 'amountIn', - type: 'u64', - index: false, + "name": "amountIn", + "type": "u64", + "index": false }, { - name: 'outMarketIndex', - type: 'u16', - index: false, + "name": "outMarketIndex", + "type": "u16", + "index": false }, { - name: 'inMarketIndex', - type: 'u16', - index: false, + "name": "inMarketIndex", + "type": "u16", + "index": false }, { - name: 'outOraclePrice', - type: 'i64', - index: false, + "name": "outOraclePrice", + "type": "i64", + "index": false }, { - name: 'inOraclePrice', - type: 'i64', - index: false, + "name": "inOraclePrice", + "type": "i64", + "index": false }, { - name: 'fee', - type: 'u64', - index: false, - }, - ], + "name": "fee", + "type": "u64", + "index": false + } + ] }, + { + "name": "SpotMarketVaultDepositRecord", + "fields": [ + { + "name": "ts", + "type": "i64", + "index": false + }, + { + "name": "marketIndex", + "type": "u16", + "index": false + }, + { + "name": "depositBalance", + "type": "u128", + "index": false + }, + { + "name": "cumulativeDepositInterestBefore", + "type": "u128", + "index": false + }, + { + "name": "cumulativeDepositInterestAfter", + "type": "u128", + "index": false + }, + { + "name": "depositTokenAmountBefore", + "type": "u64", + "index": false + }, + { + "name": "amount", + "type": "u64", + "index": false + } + ] + } ], - errors: [ + "errors": [ { - code: 6000, - name: 'InvalidSpotMarketAuthority', - msg: 'Invalid Spot Market Authority', + "code": 6000, + "name": "InvalidSpotMarketAuthority", + "msg": "Invalid Spot Market Authority" }, { - code: 6001, - name: 'InvalidInsuranceFundAuthority', - msg: 'Clearing house not insurance fund authority', + "code": 6001, + "name": "InvalidInsuranceFundAuthority", + "msg": "Clearing house not insurance fund authority" }, { - code: 6002, - name: 'InsufficientDeposit', - msg: 'Insufficient deposit', + "code": 6002, + "name": "InsufficientDeposit", + "msg": "Insufficient deposit" }, { - code: 6003, - name: 'InsufficientCollateral', - msg: 'Insufficient collateral', + "code": 6003, + "name": "InsufficientCollateral", + "msg": "Insufficient collateral" }, { - code: 6004, - name: 'SufficientCollateral', - msg: 'Sufficient collateral', + "code": 6004, + "name": "SufficientCollateral", + "msg": "Sufficient collateral" }, { - code: 6005, - name: 'MaxNumberOfPositions', - msg: 'Max number of positions taken', + "code": 6005, + "name": "MaxNumberOfPositions", + "msg": "Max number of positions taken" }, { - code: 6006, - name: 'AdminControlsPricesDisabled', - msg: 'Admin Controls Prices Disabled', + "code": 6006, + "name": "AdminControlsPricesDisabled", + "msg": "Admin Controls Prices Disabled" }, { - code: 6007, - name: 'MarketDelisted', - msg: 'Market Delisted', + "code": 6007, + "name": "MarketDelisted", + "msg": "Market Delisted" }, { - code: 6008, - name: 'MarketIndexAlreadyInitialized', - msg: 'Market Index Already Initialized', + "code": 6008, + "name": "MarketIndexAlreadyInitialized", + "msg": "Market Index Already Initialized" }, { - code: 6009, - name: 'UserAccountAndUserPositionsAccountMismatch', - msg: 'User Account And User Positions Account Mismatch', + "code": 6009, + "name": "UserAccountAndUserPositionsAccountMismatch", + "msg": "User Account And User Positions Account Mismatch" }, { - code: 6010, - name: 'UserHasNoPositionInMarket', - msg: 'User Has No Position In Market', + "code": 6010, + "name": "UserHasNoPositionInMarket", + "msg": "User Has No Position In Market" }, { - code: 6011, - name: 'InvalidInitialPeg', - msg: 'Invalid Initial Peg', + "code": 6011, + "name": "InvalidInitialPeg", + "msg": "Invalid Initial Peg" }, { - code: 6012, - name: 'InvalidRepegRedundant', - msg: 'AMM repeg already configured with amt given', + "code": 6012, + "name": "InvalidRepegRedundant", + "msg": "AMM repeg already configured with amt given" }, { - code: 6013, - name: 'InvalidRepegDirection', - msg: 'AMM repeg incorrect repeg direction', + "code": 6013, + "name": "InvalidRepegDirection", + "msg": "AMM repeg incorrect repeg direction" }, { - code: 6014, - name: 'InvalidRepegProfitability', - msg: 'AMM repeg out of bounds pnl', + "code": 6014, + "name": "InvalidRepegProfitability", + "msg": "AMM repeg out of bounds pnl" }, { - code: 6015, - name: 'SlippageOutsideLimit', - msg: 'Slippage Outside Limit Price', + "code": 6015, + "name": "SlippageOutsideLimit", + "msg": "Slippage Outside Limit Price" }, { - code: 6016, - name: 'OrderSizeTooSmall', - msg: 'Order Size Too Small', + "code": 6016, + "name": "OrderSizeTooSmall", + "msg": "Order Size Too Small" }, { - code: 6017, - name: 'InvalidUpdateK', - msg: 'Price change too large when updating K', + "code": 6017, + "name": "InvalidUpdateK", + "msg": "Price change too large when updating K" }, { - code: 6018, - name: 'AdminWithdrawTooLarge', - msg: 'Admin tried to withdraw amount larger than fees collected', + "code": 6018, + "name": "AdminWithdrawTooLarge", + "msg": "Admin tried to withdraw amount larger than fees collected" }, { - code: 6019, - name: 'MathError', - msg: 'Math Error', + "code": 6019, + "name": "MathError", + "msg": "Math Error" }, { - code: 6020, - name: 'BnConversionError', - msg: 'Conversion to u128/u64 failed with an overflow or underflow', + "code": 6020, + "name": "BnConversionError", + "msg": "Conversion to u128/u64 failed with an overflow or underflow" }, { - code: 6021, - name: 'ClockUnavailable', - msg: 'Clock unavailable', + "code": 6021, + "name": "ClockUnavailable", + "msg": "Clock unavailable" }, { - code: 6022, - name: 'UnableToLoadOracle', - msg: 'Unable To Load Oracles', + "code": 6022, + "name": "UnableToLoadOracle", + "msg": "Unable To Load Oracles" }, { - code: 6023, - name: 'PriceBandsBreached', - msg: 'Price Bands Breached', + "code": 6023, + "name": "PriceBandsBreached", + "msg": "Price Bands Breached" }, { - code: 6024, - name: 'ExchangePaused', - msg: 'Exchange is paused', + "code": 6024, + "name": "ExchangePaused", + "msg": "Exchange is paused" }, { - code: 6025, - name: 'InvalidWhitelistToken', - msg: 'Invalid whitelist token', + "code": 6025, + "name": "InvalidWhitelistToken", + "msg": "Invalid whitelist token" }, { - code: 6026, - name: 'WhitelistTokenNotFound', - msg: 'Whitelist token not found', + "code": 6026, + "name": "WhitelistTokenNotFound", + "msg": "Whitelist token not found" }, { - code: 6027, - name: 'InvalidDiscountToken', - msg: 'Invalid discount token', + "code": 6027, + "name": "InvalidDiscountToken", + "msg": "Invalid discount token" }, { - code: 6028, - name: 'DiscountTokenNotFound', - msg: 'Discount token not found', + "code": 6028, + "name": "DiscountTokenNotFound", + "msg": "Discount token not found" }, { - code: 6029, - name: 'ReferrerNotFound', - msg: 'Referrer not found', + "code": 6029, + "name": "ReferrerNotFound", + "msg": "Referrer not found" }, { - code: 6030, - name: 'ReferrerStatsNotFound', - msg: 'ReferrerNotFound', + "code": 6030, + "name": "ReferrerStatsNotFound", + "msg": "ReferrerNotFound" }, { - code: 6031, - name: 'ReferrerMustBeWritable', - msg: 'ReferrerMustBeWritable', + "code": 6031, + "name": "ReferrerMustBeWritable", + "msg": "ReferrerMustBeWritable" }, { - code: 6032, - name: 'ReferrerStatsMustBeWritable', - msg: 'ReferrerMustBeWritable', + "code": 6032, + "name": "ReferrerStatsMustBeWritable", + "msg": "ReferrerMustBeWritable" }, { - code: 6033, - name: 'ReferrerAndReferrerStatsAuthorityUnequal', - msg: 'ReferrerAndReferrerStatsAuthorityUnequal', + "code": 6033, + "name": "ReferrerAndReferrerStatsAuthorityUnequal", + "msg": "ReferrerAndReferrerStatsAuthorityUnequal" }, { - code: 6034, - name: 'InvalidReferrer', - msg: 'InvalidReferrer', + "code": 6034, + "name": "InvalidReferrer", + "msg": "InvalidReferrer" }, { - code: 6035, - name: 'InvalidOracle', - msg: 'InvalidOracle', + "code": 6035, + "name": "InvalidOracle", + "msg": "InvalidOracle" }, { - code: 6036, - name: 'OracleNotFound', - msg: 'OracleNotFound', + "code": 6036, + "name": "OracleNotFound", + "msg": "OracleNotFound" }, { - code: 6037, - name: 'LiquidationsBlockedByOracle', - msg: 'Liquidations Blocked By Oracle', + "code": 6037, + "name": "LiquidationsBlockedByOracle", + "msg": "Liquidations Blocked By Oracle" }, { - code: 6038, - name: 'MaxDeposit', - msg: 'Can not deposit more than max deposit', + "code": 6038, + "name": "MaxDeposit", + "msg": "Can not deposit more than max deposit" }, { - code: 6039, - name: 'CantDeleteUserWithCollateral', - msg: 'Can not delete user that still has collateral', + "code": 6039, + "name": "CantDeleteUserWithCollateral", + "msg": "Can not delete user that still has collateral" }, { - code: 6040, - name: 'InvalidFundingProfitability', - msg: 'AMM funding out of bounds pnl', + "code": 6040, + "name": "InvalidFundingProfitability", + "msg": "AMM funding out of bounds pnl" }, { - code: 6041, - name: 'CastingFailure', - msg: 'Casting Failure', + "code": 6041, + "name": "CastingFailure", + "msg": "Casting Failure" }, { - code: 6042, - name: 'InvalidOrder', - msg: 'InvalidOrder', + "code": 6042, + "name": "InvalidOrder", + "msg": "InvalidOrder" }, { - code: 6043, - name: 'InvalidOrderMaxTs', - msg: 'InvalidOrderMaxTs', + "code": 6043, + "name": "InvalidOrderMaxTs", + "msg": "InvalidOrderMaxTs" }, { - code: 6044, - name: 'InvalidOrderMarketType', - msg: 'InvalidOrderMarketType', + "code": 6044, + "name": "InvalidOrderMarketType", + "msg": "InvalidOrderMarketType" }, { - code: 6045, - name: 'InvalidOrderForInitialMarginReq', - msg: 'InvalidOrderForInitialMarginReq', + "code": 6045, + "name": "InvalidOrderForInitialMarginReq", + "msg": "InvalidOrderForInitialMarginReq" }, { - code: 6046, - name: 'InvalidOrderNotRiskReducing', - msg: 'InvalidOrderNotRiskReducing', + "code": 6046, + "name": "InvalidOrderNotRiskReducing", + "msg": "InvalidOrderNotRiskReducing" }, { - code: 6047, - name: 'InvalidOrderSizeTooSmall', - msg: 'InvalidOrderSizeTooSmall', + "code": 6047, + "name": "InvalidOrderSizeTooSmall", + "msg": "InvalidOrderSizeTooSmall" }, { - code: 6048, - name: 'InvalidOrderNotStepSizeMultiple', - msg: 'InvalidOrderNotStepSizeMultiple', + "code": 6048, + "name": "InvalidOrderNotStepSizeMultiple", + "msg": "InvalidOrderNotStepSizeMultiple" }, { - code: 6049, - name: 'InvalidOrderBaseQuoteAsset', - msg: 'InvalidOrderBaseQuoteAsset', + "code": 6049, + "name": "InvalidOrderBaseQuoteAsset", + "msg": "InvalidOrderBaseQuoteAsset" }, { - code: 6050, - name: 'InvalidOrderIOC', - msg: 'InvalidOrderIOC', + "code": 6050, + "name": "InvalidOrderIOC", + "msg": "InvalidOrderIOC" }, { - code: 6051, - name: 'InvalidOrderPostOnly', - msg: 'InvalidOrderPostOnly', + "code": 6051, + "name": "InvalidOrderPostOnly", + "msg": "InvalidOrderPostOnly" }, { - code: 6052, - name: 'InvalidOrderIOCPostOnly', - msg: 'InvalidOrderIOCPostOnly', + "code": 6052, + "name": "InvalidOrderIOCPostOnly", + "msg": "InvalidOrderIOCPostOnly" }, { - code: 6053, - name: 'InvalidOrderTrigger', - msg: 'InvalidOrderTrigger', + "code": 6053, + "name": "InvalidOrderTrigger", + "msg": "InvalidOrderTrigger" }, { - code: 6054, - name: 'InvalidOrderAuction', - msg: 'InvalidOrderAuction', + "code": 6054, + "name": "InvalidOrderAuction", + "msg": "InvalidOrderAuction" }, { - code: 6055, - name: 'InvalidOrderOracleOffset', - msg: 'InvalidOrderOracleOffset', + "code": 6055, + "name": "InvalidOrderOracleOffset", + "msg": "InvalidOrderOracleOffset" }, { - code: 6056, - name: 'InvalidOrderMinOrderSize', - msg: 'InvalidOrderMinOrderSize', + "code": 6056, + "name": "InvalidOrderMinOrderSize", + "msg": "InvalidOrderMinOrderSize" }, { - code: 6057, - name: 'PlacePostOnlyLimitFailure', - msg: 'Failed to Place Post-Only Limit Order', + "code": 6057, + "name": "PlacePostOnlyLimitFailure", + "msg": "Failed to Place Post-Only Limit Order" }, { - code: 6058, - name: 'UserHasNoOrder', - msg: 'User has no order', + "code": 6058, + "name": "UserHasNoOrder", + "msg": "User has no order" }, { - code: 6059, - name: 'OrderAmountTooSmall', - msg: 'Order Amount Too Small', + "code": 6059, + "name": "OrderAmountTooSmall", + "msg": "Order Amount Too Small" }, { - code: 6060, - name: 'MaxNumberOfOrders', - msg: 'Max number of orders taken', + "code": 6060, + "name": "MaxNumberOfOrders", + "msg": "Max number of orders taken" }, { - code: 6061, - name: 'OrderDoesNotExist', - msg: 'Order does not exist', + "code": 6061, + "name": "OrderDoesNotExist", + "msg": "Order does not exist" }, { - code: 6062, - name: 'OrderNotOpen', - msg: 'Order not open', + "code": 6062, + "name": "OrderNotOpen", + "msg": "Order not open" }, { - code: 6063, - name: 'FillOrderDidNotUpdateState', - msg: 'FillOrderDidNotUpdateState', + "code": 6063, + "name": "FillOrderDidNotUpdateState", + "msg": "FillOrderDidNotUpdateState" }, { - code: 6064, - name: 'ReduceOnlyOrderIncreasedRisk', - msg: 'Reduce only order increased risk', + "code": 6064, + "name": "ReduceOnlyOrderIncreasedRisk", + "msg": "Reduce only order increased risk" }, { - code: 6065, - name: 'UnableToLoadAccountLoader', - msg: 'Unable to load AccountLoader', + "code": 6065, + "name": "UnableToLoadAccountLoader", + "msg": "Unable to load AccountLoader" }, { - code: 6066, - name: 'TradeSizeTooLarge', - msg: 'Trade Size Too Large', + "code": 6066, + "name": "TradeSizeTooLarge", + "msg": "Trade Size Too Large" }, { - code: 6067, - name: 'UserCantReferThemselves', - msg: 'User cant refer themselves', + "code": 6067, + "name": "UserCantReferThemselves", + "msg": "User cant refer themselves" }, { - code: 6068, - name: 'DidNotReceiveExpectedReferrer', - msg: 'Did not receive expected referrer', + "code": 6068, + "name": "DidNotReceiveExpectedReferrer", + "msg": "Did not receive expected referrer" }, { - code: 6069, - name: 'CouldNotDeserializeReferrer', - msg: 'Could not deserialize referrer', + "code": 6069, + "name": "CouldNotDeserializeReferrer", + "msg": "Could not deserialize referrer" }, { - code: 6070, - name: 'CouldNotDeserializeReferrerStats', - msg: 'Could not deserialize referrer stats', + "code": 6070, + "name": "CouldNotDeserializeReferrerStats", + "msg": "Could not deserialize referrer stats" }, { - code: 6071, - name: 'UserOrderIdAlreadyInUse', - msg: 'User Order Id Already In Use', + "code": 6071, + "name": "UserOrderIdAlreadyInUse", + "msg": "User Order Id Already In Use" }, { - code: 6072, - name: 'NoPositionsLiquidatable', - msg: 'No positions liquidatable', + "code": 6072, + "name": "NoPositionsLiquidatable", + "msg": "No positions liquidatable" }, { - code: 6073, - name: 'InvalidMarginRatio', - msg: 'Invalid Margin Ratio', + "code": 6073, + "name": "InvalidMarginRatio", + "msg": "Invalid Margin Ratio" }, { - code: 6074, - name: 'CantCancelPostOnlyOrder', - msg: 'Cant Cancel Post Only Order', + "code": 6074, + "name": "CantCancelPostOnlyOrder", + "msg": "Cant Cancel Post Only Order" }, { - code: 6075, - name: 'InvalidOracleOffset', - msg: 'InvalidOracleOffset', + "code": 6075, + "name": "InvalidOracleOffset", + "msg": "InvalidOracleOffset" }, { - code: 6076, - name: 'CantExpireOrders', - msg: 'CantExpireOrders', + "code": 6076, + "name": "CantExpireOrders", + "msg": "CantExpireOrders" }, { - code: 6077, - name: 'CouldNotLoadMarketData', - msg: 'CouldNotLoadMarketData', + "code": 6077, + "name": "CouldNotLoadMarketData", + "msg": "CouldNotLoadMarketData" }, { - code: 6078, - name: 'PerpMarketNotFound', - msg: 'PerpMarketNotFound', + "code": 6078, + "name": "PerpMarketNotFound", + "msg": "PerpMarketNotFound" }, { - code: 6079, - name: 'InvalidMarketAccount', - msg: 'InvalidMarketAccount', + "code": 6079, + "name": "InvalidMarketAccount", + "msg": "InvalidMarketAccount" }, { - code: 6080, - name: 'UnableToLoadPerpMarketAccount', - msg: 'UnableToLoadMarketAccount', + "code": 6080, + "name": "UnableToLoadPerpMarketAccount", + "msg": "UnableToLoadMarketAccount" }, { - code: 6081, - name: 'MarketWrongMutability', - msg: 'MarketWrongMutability', + "code": 6081, + "name": "MarketWrongMutability", + "msg": "MarketWrongMutability" }, { - code: 6082, - name: 'UnableToCastUnixTime', - msg: 'UnableToCastUnixTime', + "code": 6082, + "name": "UnableToCastUnixTime", + "msg": "UnableToCastUnixTime" }, { - code: 6083, - name: 'CouldNotFindSpotPosition', - msg: 'CouldNotFindSpotPosition', + "code": 6083, + "name": "CouldNotFindSpotPosition", + "msg": "CouldNotFindSpotPosition" }, { - code: 6084, - name: 'NoSpotPositionAvailable', - msg: 'NoSpotPositionAvailable', + "code": 6084, + "name": "NoSpotPositionAvailable", + "msg": "NoSpotPositionAvailable" }, { - code: 6085, - name: 'InvalidSpotMarketInitialization', - msg: 'InvalidSpotMarketInitialization', + "code": 6085, + "name": "InvalidSpotMarketInitialization", + "msg": "InvalidSpotMarketInitialization" }, { - code: 6086, - name: 'CouldNotLoadSpotMarketData', - msg: 'CouldNotLoadSpotMarketData', + "code": 6086, + "name": "CouldNotLoadSpotMarketData", + "msg": "CouldNotLoadSpotMarketData" }, { - code: 6087, - name: 'SpotMarketNotFound', - msg: 'SpotMarketNotFound', + "code": 6087, + "name": "SpotMarketNotFound", + "msg": "SpotMarketNotFound" }, { - code: 6088, - name: 'InvalidSpotMarketAccount', - msg: 'InvalidSpotMarketAccount', + "code": 6088, + "name": "InvalidSpotMarketAccount", + "msg": "InvalidSpotMarketAccount" }, { - code: 6089, - name: 'UnableToLoadSpotMarketAccount', - msg: 'UnableToLoadSpotMarketAccount', + "code": 6089, + "name": "UnableToLoadSpotMarketAccount", + "msg": "UnableToLoadSpotMarketAccount" }, { - code: 6090, - name: 'SpotMarketWrongMutability', - msg: 'SpotMarketWrongMutability', + "code": 6090, + "name": "SpotMarketWrongMutability", + "msg": "SpotMarketWrongMutability" }, { - code: 6091, - name: 'SpotMarketInterestNotUpToDate', - msg: 'SpotInterestNotUpToDate', + "code": 6091, + "name": "SpotMarketInterestNotUpToDate", + "msg": "SpotInterestNotUpToDate" }, { - code: 6092, - name: 'SpotMarketInsufficientDeposits', - msg: 'SpotMarketInsufficientDeposits', + "code": 6092, + "name": "SpotMarketInsufficientDeposits", + "msg": "SpotMarketInsufficientDeposits" }, { - code: 6093, - name: 'UserMustSettleTheirOwnPositiveUnsettledPNL', - msg: 'UserMustSettleTheirOwnPositiveUnsettledPNL', + "code": 6093, + "name": "UserMustSettleTheirOwnPositiveUnsettledPNL", + "msg": "UserMustSettleTheirOwnPositiveUnsettledPNL" }, { - code: 6094, - name: 'CantUpdatePoolBalanceType', - msg: 'CantUpdatePoolBalanceType', + "code": 6094, + "name": "CantUpdatePoolBalanceType", + "msg": "CantUpdatePoolBalanceType" }, { - code: 6095, - name: 'InsufficientCollateralForSettlingPNL', - msg: 'InsufficientCollateralForSettlingPNL', + "code": 6095, + "name": "InsufficientCollateralForSettlingPNL", + "msg": "InsufficientCollateralForSettlingPNL" }, { - code: 6096, - name: 'AMMNotUpdatedInSameSlot', - msg: 'AMMNotUpdatedInSameSlot', + "code": 6096, + "name": "AMMNotUpdatedInSameSlot", + "msg": "AMMNotUpdatedInSameSlot" }, { - code: 6097, - name: 'AuctionNotComplete', - msg: 'AuctionNotComplete', + "code": 6097, + "name": "AuctionNotComplete", + "msg": "AuctionNotComplete" }, { - code: 6098, - name: 'MakerNotFound', - msg: 'MakerNotFound', + "code": 6098, + "name": "MakerNotFound", + "msg": "MakerNotFound" }, { - code: 6099, - name: 'MakerStatsNotFound', - msg: 'MakerNotFound', + "code": 6099, + "name": "MakerStatsNotFound", + "msg": "MakerNotFound" }, { - code: 6100, - name: 'MakerMustBeWritable', - msg: 'MakerMustBeWritable', + "code": 6100, + "name": "MakerMustBeWritable", + "msg": "MakerMustBeWritable" }, { - code: 6101, - name: 'MakerStatsMustBeWritable', - msg: 'MakerMustBeWritable', + "code": 6101, + "name": "MakerStatsMustBeWritable", + "msg": "MakerMustBeWritable" }, { - code: 6102, - name: 'MakerOrderNotFound', - msg: 'MakerOrderNotFound', + "code": 6102, + "name": "MakerOrderNotFound", + "msg": "MakerOrderNotFound" }, { - code: 6103, - name: 'CouldNotDeserializeMaker', - msg: 'CouldNotDeserializeMaker', + "code": 6103, + "name": "CouldNotDeserializeMaker", + "msg": "CouldNotDeserializeMaker" }, { - code: 6104, - name: 'CouldNotDeserializeMakerStats', - msg: 'CouldNotDeserializeMaker', + "code": 6104, + "name": "CouldNotDeserializeMakerStats", + "msg": "CouldNotDeserializeMaker" }, { - code: 6105, - name: 'AuctionPriceDoesNotSatisfyMaker', - msg: 'AuctionPriceDoesNotSatisfyMaker', + "code": 6105, + "name": "AuctionPriceDoesNotSatisfyMaker", + "msg": "AuctionPriceDoesNotSatisfyMaker" }, { - code: 6106, - name: 'MakerCantFulfillOwnOrder', - msg: 'MakerCantFulfillOwnOrder', + "code": 6106, + "name": "MakerCantFulfillOwnOrder", + "msg": "MakerCantFulfillOwnOrder" }, { - code: 6107, - name: 'MakerOrderMustBePostOnly', - msg: 'MakerOrderMustBePostOnly', + "code": 6107, + "name": "MakerOrderMustBePostOnly", + "msg": "MakerOrderMustBePostOnly" }, { - code: 6108, - name: 'CantMatchTwoPostOnlys', - msg: 'CantMatchTwoPostOnlys', + "code": 6108, + "name": "CantMatchTwoPostOnlys", + "msg": "CantMatchTwoPostOnlys" }, { - code: 6109, - name: 'OrderBreachesOraclePriceLimits', - msg: 'OrderBreachesOraclePriceLimits', + "code": 6109, + "name": "OrderBreachesOraclePriceLimits", + "msg": "OrderBreachesOraclePriceLimits" }, { - code: 6110, - name: 'OrderMustBeTriggeredFirst', - msg: 'OrderMustBeTriggeredFirst', + "code": 6110, + "name": "OrderMustBeTriggeredFirst", + "msg": "OrderMustBeTriggeredFirst" }, { - code: 6111, - name: 'OrderNotTriggerable', - msg: 'OrderNotTriggerable', + "code": 6111, + "name": "OrderNotTriggerable", + "msg": "OrderNotTriggerable" }, { - code: 6112, - name: 'OrderDidNotSatisfyTriggerCondition', - msg: 'OrderDidNotSatisfyTriggerCondition', + "code": 6112, + "name": "OrderDidNotSatisfyTriggerCondition", + "msg": "OrderDidNotSatisfyTriggerCondition" }, { - code: 6113, - name: 'PositionAlreadyBeingLiquidated', - msg: 'PositionAlreadyBeingLiquidated', + "code": 6113, + "name": "PositionAlreadyBeingLiquidated", + "msg": "PositionAlreadyBeingLiquidated" }, { - code: 6114, - name: 'PositionDoesntHaveOpenPositionOrOrders', - msg: 'PositionDoesntHaveOpenPositionOrOrders', + "code": 6114, + "name": "PositionDoesntHaveOpenPositionOrOrders", + "msg": "PositionDoesntHaveOpenPositionOrOrders" }, { - code: 6115, - name: 'AllOrdersAreAlreadyLiquidations', - msg: 'AllOrdersAreAlreadyLiquidations', + "code": 6115, + "name": "AllOrdersAreAlreadyLiquidations", + "msg": "AllOrdersAreAlreadyLiquidations" }, { - code: 6116, - name: 'CantCancelLiquidationOrder', - msg: 'CantCancelLiquidationOrder', + "code": 6116, + "name": "CantCancelLiquidationOrder", + "msg": "CantCancelLiquidationOrder" }, { - code: 6117, - name: 'UserIsBeingLiquidated', - msg: 'UserIsBeingLiquidated', + "code": 6117, + "name": "UserIsBeingLiquidated", + "msg": "UserIsBeingLiquidated" }, { - code: 6118, - name: 'LiquidationsOngoing', - msg: 'LiquidationsOngoing', + "code": 6118, + "name": "LiquidationsOngoing", + "msg": "LiquidationsOngoing" }, { - code: 6119, - name: 'WrongSpotBalanceType', - msg: 'WrongSpotBalanceType', + "code": 6119, + "name": "WrongSpotBalanceType", + "msg": "WrongSpotBalanceType" }, { - code: 6120, - name: 'UserCantLiquidateThemself', - msg: 'UserCantLiquidateThemself', + "code": 6120, + "name": "UserCantLiquidateThemself", + "msg": "UserCantLiquidateThemself" }, { - code: 6121, - name: 'InvalidPerpPositionToLiquidate', - msg: 'InvalidPerpPositionToLiquidate', + "code": 6121, + "name": "InvalidPerpPositionToLiquidate", + "msg": "InvalidPerpPositionToLiquidate" }, { - code: 6122, - name: 'InvalidBaseAssetAmountForLiquidatePerp', - msg: 'InvalidBaseAssetAmountForLiquidatePerp', + "code": 6122, + "name": "InvalidBaseAssetAmountForLiquidatePerp", + "msg": "InvalidBaseAssetAmountForLiquidatePerp" }, { - code: 6123, - name: 'InvalidPositionLastFundingRate', - msg: 'InvalidPositionLastFundingRate', + "code": 6123, + "name": "InvalidPositionLastFundingRate", + "msg": "InvalidPositionLastFundingRate" }, { - code: 6124, - name: 'InvalidPositionDelta', - msg: 'InvalidPositionDelta', + "code": 6124, + "name": "InvalidPositionDelta", + "msg": "InvalidPositionDelta" }, { - code: 6125, - name: 'UserBankrupt', - msg: 'UserBankrupt', + "code": 6125, + "name": "UserBankrupt", + "msg": "UserBankrupt" }, { - code: 6126, - name: 'UserNotBankrupt', - msg: 'UserNotBankrupt', + "code": 6126, + "name": "UserNotBankrupt", + "msg": "UserNotBankrupt" }, { - code: 6127, - name: 'UserHasInvalidBorrow', - msg: 'UserHasInvalidBorrow', + "code": 6127, + "name": "UserHasInvalidBorrow", + "msg": "UserHasInvalidBorrow" }, { - code: 6128, - name: 'DailyWithdrawLimit', - msg: 'DailyWithdrawLimit', + "code": 6128, + "name": "DailyWithdrawLimit", + "msg": "DailyWithdrawLimit" }, { - code: 6129, - name: 'DefaultError', - msg: 'DefaultError', + "code": 6129, + "name": "DefaultError", + "msg": "DefaultError" }, { - code: 6130, - name: 'InsufficientLPTokens', - msg: 'Insufficient LP tokens', + "code": 6130, + "name": "InsufficientLPTokens", + "msg": "Insufficient LP tokens" }, { - code: 6131, - name: 'CantLPWithPerpPosition', - msg: 'Cant LP with a market position', + "code": 6131, + "name": "CantLPWithPerpPosition", + "msg": "Cant LP with a market position" }, { - code: 6132, - name: 'UnableToBurnLPTokens', - msg: 'Unable to burn LP tokens', + "code": 6132, + "name": "UnableToBurnLPTokens", + "msg": "Unable to burn LP tokens" }, { - code: 6133, - name: 'TryingToRemoveLiquidityTooFast', - msg: 'Trying to remove liqudity too fast after adding it', + "code": 6133, + "name": "TryingToRemoveLiquidityTooFast", + "msg": "Trying to remove liqudity too fast after adding it" }, { - code: 6134, - name: 'InvalidSpotMarketVault', - msg: 'Invalid Spot Market Vault', + "code": 6134, + "name": "InvalidSpotMarketVault", + "msg": "Invalid Spot Market Vault" }, { - code: 6135, - name: 'InvalidSpotMarketState', - msg: 'Invalid Spot Market State', + "code": 6135, + "name": "InvalidSpotMarketState", + "msg": "Invalid Spot Market State" }, { - code: 6136, - name: 'InvalidSerumProgram', - msg: 'InvalidSerumProgram', + "code": 6136, + "name": "InvalidSerumProgram", + "msg": "InvalidSerumProgram" }, { - code: 6137, - name: 'InvalidSerumMarket', - msg: 'InvalidSerumMarket', + "code": 6137, + "name": "InvalidSerumMarket", + "msg": "InvalidSerumMarket" }, { - code: 6138, - name: 'InvalidSerumBids', - msg: 'InvalidSerumBids', + "code": 6138, + "name": "InvalidSerumBids", + "msg": "InvalidSerumBids" }, { - code: 6139, - name: 'InvalidSerumAsks', - msg: 'InvalidSerumAsks', + "code": 6139, + "name": "InvalidSerumAsks", + "msg": "InvalidSerumAsks" }, { - code: 6140, - name: 'InvalidSerumOpenOrders', - msg: 'InvalidSerumOpenOrders', + "code": 6140, + "name": "InvalidSerumOpenOrders", + "msg": "InvalidSerumOpenOrders" }, { - code: 6141, - name: 'FailedSerumCPI', - msg: 'FailedSerumCPI', + "code": 6141, + "name": "FailedSerumCPI", + "msg": "FailedSerumCPI" }, { - code: 6142, - name: 'FailedToFillOnExternalMarket', - msg: 'FailedToFillOnExternalMarket', + "code": 6142, + "name": "FailedToFillOnExternalMarket", + "msg": "FailedToFillOnExternalMarket" }, { - code: 6143, - name: 'InvalidFulfillmentConfig', - msg: 'InvalidFulfillmentConfig', + "code": 6143, + "name": "InvalidFulfillmentConfig", + "msg": "InvalidFulfillmentConfig" }, { - code: 6144, - name: 'InvalidFeeStructure', - msg: 'InvalidFeeStructure', + "code": 6144, + "name": "InvalidFeeStructure", + "msg": "InvalidFeeStructure" }, { - code: 6145, - name: 'InsufficientIFShares', - msg: 'Insufficient IF shares', + "code": 6145, + "name": "InsufficientIFShares", + "msg": "Insufficient IF shares" }, { - code: 6146, - name: 'MarketActionPaused', - msg: 'the Market has paused this action', + "code": 6146, + "name": "MarketActionPaused", + "msg": "the Market has paused this action" }, { - code: 6147, - name: 'MarketPlaceOrderPaused', - msg: 'the Market status doesnt allow placing orders', + "code": 6147, + "name": "MarketPlaceOrderPaused", + "msg": "the Market status doesnt allow placing orders" }, { - code: 6148, - name: 'MarketFillOrderPaused', - msg: 'the Market status doesnt allow filling orders', + "code": 6148, + "name": "MarketFillOrderPaused", + "msg": "the Market status doesnt allow filling orders" }, { - code: 6149, - name: 'MarketWithdrawPaused', - msg: 'the Market status doesnt allow withdraws', + "code": 6149, + "name": "MarketWithdrawPaused", + "msg": "the Market status doesnt allow withdraws" }, { - code: 6150, - name: 'ProtectedAssetTierViolation', - msg: 'Action violates the Protected Asset Tier rules', + "code": 6150, + "name": "ProtectedAssetTierViolation", + "msg": "Action violates the Protected Asset Tier rules" }, { - code: 6151, - name: 'IsolatedAssetTierViolation', - msg: 'Action violates the Isolated Asset Tier rules', + "code": 6151, + "name": "IsolatedAssetTierViolation", + "msg": "Action violates the Isolated Asset Tier rules" }, { - code: 6152, - name: 'UserCantBeDeleted', - msg: 'User Cant Be Deleted', + "code": 6152, + "name": "UserCantBeDeleted", + "msg": "User Cant Be Deleted" }, { - code: 6153, - name: 'ReduceOnlyWithdrawIncreasedRisk', - msg: 'Reduce Only Withdraw Increased Risk', + "code": 6153, + "name": "ReduceOnlyWithdrawIncreasedRisk", + "msg": "Reduce Only Withdraw Increased Risk" }, { - code: 6154, - name: 'MaxOpenInterest', - msg: 'Max Open Interest', + "code": 6154, + "name": "MaxOpenInterest", + "msg": "Max Open Interest" }, { - code: 6155, - name: 'CantResolvePerpBankruptcy', - msg: 'Cant Resolve Perp Bankruptcy', + "code": 6155, + "name": "CantResolvePerpBankruptcy", + "msg": "Cant Resolve Perp Bankruptcy" }, { - code: 6156, - name: 'LiquidationDoesntSatisfyLimitPrice', - msg: 'Liquidation Doesnt Satisfy Limit Price', + "code": 6156, + "name": "LiquidationDoesntSatisfyLimitPrice", + "msg": "Liquidation Doesnt Satisfy Limit Price" }, { - code: 6157, - name: 'MarginTradingDisabled', - msg: 'Margin Trading Disabled', + "code": 6157, + "name": "MarginTradingDisabled", + "msg": "Margin Trading Disabled" }, { - code: 6158, - name: 'InvalidMarketStatusToSettlePnl', - msg: 'Invalid Market Status to Settle Perp Pnl', + "code": 6158, + "name": "InvalidMarketStatusToSettlePnl", + "msg": "Invalid Market Status to Settle Perp Pnl" }, { - code: 6159, - name: 'PerpMarketNotInSettlement', - msg: 'PerpMarketNotInSettlement', + "code": 6159, + "name": "PerpMarketNotInSettlement", + "msg": "PerpMarketNotInSettlement" }, { - code: 6160, - name: 'PerpMarketNotInReduceOnly', - msg: 'PerpMarketNotInReduceOnly', + "code": 6160, + "name": "PerpMarketNotInReduceOnly", + "msg": "PerpMarketNotInReduceOnly" }, { - code: 6161, - name: 'PerpMarketSettlementBufferNotReached', - msg: 'PerpMarketSettlementBufferNotReached', + "code": 6161, + "name": "PerpMarketSettlementBufferNotReached", + "msg": "PerpMarketSettlementBufferNotReached" }, { - code: 6162, - name: 'PerpMarketSettlementUserHasOpenOrders', - msg: 'PerpMarketSettlementUserHasOpenOrders', + "code": 6162, + "name": "PerpMarketSettlementUserHasOpenOrders", + "msg": "PerpMarketSettlementUserHasOpenOrders" }, { - code: 6163, - name: 'PerpMarketSettlementUserHasActiveLP', - msg: 'PerpMarketSettlementUserHasActiveLP', + "code": 6163, + "name": "PerpMarketSettlementUserHasActiveLP", + "msg": "PerpMarketSettlementUserHasActiveLP" }, { - code: 6164, - name: 'UnableToSettleExpiredUserPosition', - msg: 'UnableToSettleExpiredUserPosition', + "code": 6164, + "name": "UnableToSettleExpiredUserPosition", + "msg": "UnableToSettleExpiredUserPosition" }, { - code: 6165, - name: 'UnequalMarketIndexForSpotTransfer', - msg: 'UnequalMarketIndexForSpotTransfer', + "code": 6165, + "name": "UnequalMarketIndexForSpotTransfer", + "msg": "UnequalMarketIndexForSpotTransfer" }, { - code: 6166, - name: 'InvalidPerpPositionDetected', - msg: 'InvalidPerpPositionDetected', + "code": 6166, + "name": "InvalidPerpPositionDetected", + "msg": "InvalidPerpPositionDetected" }, { - code: 6167, - name: 'InvalidSpotPositionDetected', - msg: 'InvalidSpotPositionDetected', + "code": 6167, + "name": "InvalidSpotPositionDetected", + "msg": "InvalidSpotPositionDetected" }, { - code: 6168, - name: 'InvalidAmmDetected', - msg: 'InvalidAmmDetected', + "code": 6168, + "name": "InvalidAmmDetected", + "msg": "InvalidAmmDetected" }, { - code: 6169, - name: 'InvalidAmmForFillDetected', - msg: 'InvalidAmmForFillDetected', + "code": 6169, + "name": "InvalidAmmForFillDetected", + "msg": "InvalidAmmForFillDetected" }, { - code: 6170, - name: 'InvalidAmmLimitPriceOverride', - msg: 'InvalidAmmLimitPriceOverride', + "code": 6170, + "name": "InvalidAmmLimitPriceOverride", + "msg": "InvalidAmmLimitPriceOverride" }, { - code: 6171, - name: 'InvalidOrderFillPrice', - msg: 'InvalidOrderFillPrice', + "code": 6171, + "name": "InvalidOrderFillPrice", + "msg": "InvalidOrderFillPrice" }, { - code: 6172, - name: 'SpotMarketBalanceInvariantViolated', - msg: 'SpotMarketBalanceInvariantViolated', + "code": 6172, + "name": "SpotMarketBalanceInvariantViolated", + "msg": "SpotMarketBalanceInvariantViolated" }, { - code: 6173, - name: 'SpotMarketVaultInvariantViolated', - msg: 'SpotMarketVaultInvariantViolated', + "code": 6173, + "name": "SpotMarketVaultInvariantViolated", + "msg": "SpotMarketVaultInvariantViolated" }, { - code: 6174, - name: 'InvalidPDA', - msg: 'InvalidPDA', + "code": 6174, + "name": "InvalidPDA", + "msg": "InvalidPDA" }, { - code: 6175, - name: 'InvalidPDASigner', - msg: 'InvalidPDASigner', + "code": 6175, + "name": "InvalidPDASigner", + "msg": "InvalidPDASigner" }, { - code: 6176, - name: 'RevenueSettingsCannotSettleToIF', - msg: 'RevenueSettingsCannotSettleToIF', + "code": 6176, + "name": "RevenueSettingsCannotSettleToIF", + "msg": "RevenueSettingsCannotSettleToIF" }, { - code: 6177, - name: 'NoRevenueToSettleToIF', - msg: 'NoRevenueToSettleToIF', + "code": 6177, + "name": "NoRevenueToSettleToIF", + "msg": "NoRevenueToSettleToIF" }, { - code: 6178, - name: 'NoAmmPerpPnlDeficit', - msg: 'NoAmmPerpPnlDeficit', + "code": 6178, + "name": "NoAmmPerpPnlDeficit", + "msg": "NoAmmPerpPnlDeficit" }, { - code: 6179, - name: 'SufficientPerpPnlPool', - msg: 'SufficientPerpPnlPool', + "code": 6179, + "name": "SufficientPerpPnlPool", + "msg": "SufficientPerpPnlPool" }, { - code: 6180, - name: 'InsufficientPerpPnlPool', - msg: 'InsufficientPerpPnlPool', + "code": 6180, + "name": "InsufficientPerpPnlPool", + "msg": "InsufficientPerpPnlPool" }, { - code: 6181, - name: 'PerpPnlDeficitBelowThreshold', - msg: 'PerpPnlDeficitBelowThreshold', + "code": 6181, + "name": "PerpPnlDeficitBelowThreshold", + "msg": "PerpPnlDeficitBelowThreshold" }, { - code: 6182, - name: 'MaxRevenueWithdrawPerPeriodReached', - msg: 'MaxRevenueWithdrawPerPeriodReached', + "code": 6182, + "name": "MaxRevenueWithdrawPerPeriodReached", + "msg": "MaxRevenueWithdrawPerPeriodReached" }, { - code: 6183, - name: 'MaxIFWithdrawReached', - msg: 'InvalidSpotPositionDetected', + "code": 6183, + "name": "MaxIFWithdrawReached", + "msg": "InvalidSpotPositionDetected" }, { - code: 6184, - name: 'NoIFWithdrawAvailable', - msg: 'NoIFWithdrawAvailable', + "code": 6184, + "name": "NoIFWithdrawAvailable", + "msg": "NoIFWithdrawAvailable" }, { - code: 6185, - name: 'InvalidIFUnstake', - msg: 'InvalidIFUnstake', + "code": 6185, + "name": "InvalidIFUnstake", + "msg": "InvalidIFUnstake" }, { - code: 6186, - name: 'InvalidIFUnstakeSize', - msg: 'InvalidIFUnstakeSize', + "code": 6186, + "name": "InvalidIFUnstakeSize", + "msg": "InvalidIFUnstakeSize" }, { - code: 6187, - name: 'InvalidIFUnstakeCancel', - msg: 'InvalidIFUnstakeCancel', + "code": 6187, + "name": "InvalidIFUnstakeCancel", + "msg": "InvalidIFUnstakeCancel" }, { - code: 6188, - name: 'InvalidIFForNewStakes', - msg: 'InvalidIFForNewStakes', + "code": 6188, + "name": "InvalidIFForNewStakes", + "msg": "InvalidIFForNewStakes" }, { - code: 6189, - name: 'InvalidIFRebase', - msg: 'InvalidIFRebase', + "code": 6189, + "name": "InvalidIFRebase", + "msg": "InvalidIFRebase" }, { - code: 6190, - name: 'InvalidInsuranceUnstakeSize', - msg: 'InvalidInsuranceUnstakeSize', + "code": 6190, + "name": "InvalidInsuranceUnstakeSize", + "msg": "InvalidInsuranceUnstakeSize" }, { - code: 6191, - name: 'InvalidOrderLimitPrice', - msg: 'InvalidOrderLimitPrice', + "code": 6191, + "name": "InvalidOrderLimitPrice", + "msg": "InvalidOrderLimitPrice" }, { - code: 6192, - name: 'InvalidIFDetected', - msg: 'InvalidIFDetected', + "code": 6192, + "name": "InvalidIFDetected", + "msg": "InvalidIFDetected" }, { - code: 6193, - name: 'InvalidAmmMaxSpreadDetected', - msg: 'InvalidAmmMaxSpreadDetected', + "code": 6193, + "name": "InvalidAmmMaxSpreadDetected", + "msg": "InvalidAmmMaxSpreadDetected" }, { - code: 6194, - name: 'InvalidConcentrationCoef', - msg: 'InvalidConcentrationCoef', + "code": 6194, + "name": "InvalidConcentrationCoef", + "msg": "InvalidConcentrationCoef" }, { - code: 6195, - name: 'InvalidSrmVault', - msg: 'InvalidSrmVault', + "code": 6195, + "name": "InvalidSrmVault", + "msg": "InvalidSrmVault" }, { - code: 6196, - name: 'InvalidVaultOwner', - msg: 'InvalidVaultOwner', + "code": 6196, + "name": "InvalidVaultOwner", + "msg": "InvalidVaultOwner" }, { - code: 6197, - name: 'InvalidMarketStatusForFills', - msg: 'InvalidMarketStatusForFills', + "code": 6197, + "name": "InvalidMarketStatusForFills", + "msg": "InvalidMarketStatusForFills" }, { - code: 6198, - name: 'IFWithdrawRequestInProgress', - msg: 'IFWithdrawRequestInProgress', + "code": 6198, + "name": "IFWithdrawRequestInProgress", + "msg": "IFWithdrawRequestInProgress" }, { - code: 6199, - name: 'NoIFWithdrawRequestInProgress', - msg: 'NoIFWithdrawRequestInProgress', + "code": 6199, + "name": "NoIFWithdrawRequestInProgress", + "msg": "NoIFWithdrawRequestInProgress" }, { - code: 6200, - name: 'IFWithdrawRequestTooSmall', - msg: 'IFWithdrawRequestTooSmall', + "code": 6200, + "name": "IFWithdrawRequestTooSmall", + "msg": "IFWithdrawRequestTooSmall" }, { - code: 6201, - name: 'IncorrectSpotMarketAccountPassed', - msg: 'IncorrectSpotMarketAccountPassed', + "code": 6201, + "name": "IncorrectSpotMarketAccountPassed", + "msg": "IncorrectSpotMarketAccountPassed" }, { - code: 6202, - name: 'BlockchainClockInconsistency', - msg: 'BlockchainClockInconsistency', + "code": 6202, + "name": "BlockchainClockInconsistency", + "msg": "BlockchainClockInconsistency" }, { - code: 6203, - name: 'InvalidIFSharesDetected', - msg: 'InvalidIFSharesDetected', + "code": 6203, + "name": "InvalidIFSharesDetected", + "msg": "InvalidIFSharesDetected" }, { - code: 6204, - name: 'NewLPSizeTooSmall', - msg: 'NewLPSizeTooSmall', + "code": 6204, + "name": "NewLPSizeTooSmall", + "msg": "NewLPSizeTooSmall" }, { - code: 6205, - name: 'MarketStatusInvalidForNewLP', - msg: 'MarketStatusInvalidForNewLP', + "code": 6205, + "name": "MarketStatusInvalidForNewLP", + "msg": "MarketStatusInvalidForNewLP" }, { - code: 6206, - name: 'InvalidMarkTwapUpdateDetected', - msg: 'InvalidMarkTwapUpdateDetected', + "code": 6206, + "name": "InvalidMarkTwapUpdateDetected", + "msg": "InvalidMarkTwapUpdateDetected" }, { - code: 6207, - name: 'MarketSettlementAttemptOnActiveMarket', - msg: 'MarketSettlementAttemptOnActiveMarket', + "code": 6207, + "name": "MarketSettlementAttemptOnActiveMarket", + "msg": "MarketSettlementAttemptOnActiveMarket" }, { - code: 6208, - name: 'MarketSettlementRequiresSettledLP', - msg: 'MarketSettlementRequiresSettledLP', + "code": 6208, + "name": "MarketSettlementRequiresSettledLP", + "msg": "MarketSettlementRequiresSettledLP" }, { - code: 6209, - name: 'MarketSettlementAttemptTooEarly', - msg: 'MarketSettlementAttemptTooEarly', + "code": 6209, + "name": "MarketSettlementAttemptTooEarly", + "msg": "MarketSettlementAttemptTooEarly" }, { - code: 6210, - name: 'MarketSettlementTargetPriceInvalid', - msg: 'MarketSettlementTargetPriceInvalid', + "code": 6210, + "name": "MarketSettlementTargetPriceInvalid", + "msg": "MarketSettlementTargetPriceInvalid" }, { - code: 6211, - name: 'UnsupportedSpotMarket', - msg: 'UnsupportedSpotMarket', + "code": 6211, + "name": "UnsupportedSpotMarket", + "msg": "UnsupportedSpotMarket" }, { - code: 6212, - name: 'SpotOrdersDisabled', - msg: 'SpotOrdersDisabled', + "code": 6212, + "name": "SpotOrdersDisabled", + "msg": "SpotOrdersDisabled" }, { - code: 6213, - name: 'MarketBeingInitialized', - msg: 'Market Being Initialized', + "code": 6213, + "name": "MarketBeingInitialized", + "msg": "Market Being Initialized" }, { - code: 6214, - name: 'InvalidUserSubAccountId', - msg: 'Invalid Sub Account Id', + "code": 6214, + "name": "InvalidUserSubAccountId", + "msg": "Invalid Sub Account Id" }, { - code: 6215, - name: 'InvalidTriggerOrderCondition', - msg: 'Invalid Trigger Order Condition', + "code": 6215, + "name": "InvalidTriggerOrderCondition", + "msg": "Invalid Trigger Order Condition" }, { - code: 6216, - name: 'InvalidSpotPosition', - msg: 'Invalid Spot Position', + "code": 6216, + "name": "InvalidSpotPosition", + "msg": "Invalid Spot Position" }, { - code: 6217, - name: 'CantTransferBetweenSameUserAccount', - msg: 'Cant transfer between same user account', + "code": 6217, + "name": "CantTransferBetweenSameUserAccount", + "msg": "Cant transfer between same user account" }, { - code: 6218, - name: 'InvalidPerpPosition', - msg: 'Invalid Perp Position', + "code": 6218, + "name": "InvalidPerpPosition", + "msg": "Invalid Perp Position" }, { - code: 6219, - name: 'UnableToGetLimitPrice', - msg: 'Unable To Get Limit Price', + "code": 6219, + "name": "UnableToGetLimitPrice", + "msg": "Unable To Get Limit Price" }, { - code: 6220, - name: 'InvalidLiquidation', - msg: 'Invalid Liquidation', + "code": 6220, + "name": "InvalidLiquidation", + "msg": "Invalid Liquidation" }, { - code: 6221, - name: 'SpotFulfillmentConfigDisabled', - msg: 'Spot Fulfillment Config Disabled', + "code": 6221, + "name": "SpotFulfillmentConfigDisabled", + "msg": "Spot Fulfillment Config Disabled" }, { - code: 6222, - name: 'InvalidMaker', - msg: 'Invalid Maker', + "code": 6222, + "name": "InvalidMaker", + "msg": "Invalid Maker" }, { - code: 6223, - name: 'FailedUnwrap', - msg: 'Failed Unwrap', + "code": 6223, + "name": "FailedUnwrap", + "msg": "Failed Unwrap" }, { - code: 6224, - name: 'MaxNumberOfUsers', - msg: 'Max Number Of Users', + "code": 6224, + "name": "MaxNumberOfUsers", + "msg": "Max Number Of Users" }, { - code: 6225, - name: 'InvalidOracleForSettlePnl', - msg: 'InvalidOracleForSettlePnl', + "code": 6225, + "name": "InvalidOracleForSettlePnl", + "msg": "InvalidOracleForSettlePnl" }, { - code: 6226, - name: 'MarginOrdersOpen', - msg: 'MarginOrdersOpen', + "code": 6226, + "name": "MarginOrdersOpen", + "msg": "MarginOrdersOpen" }, { - code: 6227, - name: 'TierViolationLiquidatingPerpPnl', - msg: 'TierViolationLiquidatingPerpPnl', + "code": 6227, + "name": "TierViolationLiquidatingPerpPnl", + "msg": "TierViolationLiquidatingPerpPnl" }, { - code: 6228, - name: 'CouldNotLoadUserData', - msg: 'CouldNotLoadUserData', + "code": 6228, + "name": "CouldNotLoadUserData", + "msg": "CouldNotLoadUserData" }, { - code: 6229, - name: 'UserWrongMutability', - msg: 'UserWrongMutability', + "code": 6229, + "name": "UserWrongMutability", + "msg": "UserWrongMutability" }, { - code: 6230, - name: 'InvalidUserAccount', - msg: 'InvalidUserAccount', + "code": 6230, + "name": "InvalidUserAccount", + "msg": "InvalidUserAccount" }, { - code: 6231, - name: 'CouldNotLoadUserStatsData', - msg: 'CouldNotLoadUserData', + "code": 6231, + "name": "CouldNotLoadUserStatsData", + "msg": "CouldNotLoadUserData" }, { - code: 6232, - name: 'UserStatsWrongMutability', - msg: 'UserWrongMutability', + "code": 6232, + "name": "UserStatsWrongMutability", + "msg": "UserWrongMutability" }, { - code: 6233, - name: 'InvalidUserStatsAccount', - msg: 'InvalidUserAccount', + "code": 6233, + "name": "InvalidUserStatsAccount", + "msg": "InvalidUserAccount" }, { - code: 6234, - name: 'UserNotFound', - msg: 'UserNotFound', + "code": 6234, + "name": "UserNotFound", + "msg": "UserNotFound" }, { - code: 6235, - name: 'UnableToLoadUserAccount', - msg: 'UnableToLoadUserAccount', + "code": 6235, + "name": "UnableToLoadUserAccount", + "msg": "UnableToLoadUserAccount" }, { - code: 6236, - name: 'UserStatsNotFound', - msg: 'UserStatsNotFound', + "code": 6236, + "name": "UserStatsNotFound", + "msg": "UserStatsNotFound" }, { - code: 6237, - name: 'UnableToLoadUserStatsAccount', - msg: 'UnableToLoadUserStatsAccount', + "code": 6237, + "name": "UnableToLoadUserStatsAccount", + "msg": "UnableToLoadUserStatsAccount" }, { - code: 6238, - name: 'UserNotInactive', - msg: 'User Not Inactive', + "code": 6238, + "name": "UserNotInactive", + "msg": "User Not Inactive" }, { - code: 6239, - name: 'RevertFill', - msg: 'RevertFill', + "code": 6239, + "name": "RevertFill", + "msg": "RevertFill" }, { - code: 6240, - name: 'InvalidMarketAccountforDeletion', - msg: 'Invalid MarketAccount for Deletion', + "code": 6240, + "name": "InvalidMarketAccountforDeletion", + "msg": "Invalid MarketAccount for Deletion" }, { - code: 6241, - name: 'InvalidSpotFulfillmentParams', - msg: 'Invalid Spot Fulfillment Params', + "code": 6241, + "name": "InvalidSpotFulfillmentParams", + "msg": "Invalid Spot Fulfillment Params" }, { - code: 6242, - name: 'FailedToGetMint', - msg: 'Failed to Get Mint', + "code": 6242, + "name": "FailedToGetMint", + "msg": "Failed to Get Mint" }, { - code: 6243, - name: 'FailedPhoenixCPI', - msg: 'FailedPhoenixCPI', + "code": 6243, + "name": "FailedPhoenixCPI", + "msg": "FailedPhoenixCPI" }, { - code: 6244, - name: 'FailedToDeserializePhoenixMarket', - msg: 'FailedToDeserializePhoenixMarket', + "code": 6244, + "name": "FailedToDeserializePhoenixMarket", + "msg": "FailedToDeserializePhoenixMarket" }, { - code: 6245, - name: 'InvalidPricePrecision', - msg: 'InvalidPricePrecision', + "code": 6245, + "name": "InvalidPricePrecision", + "msg": "InvalidPricePrecision" }, { - code: 6246, - name: 'InvalidPhoenixProgram', - msg: 'InvalidPhoenixProgram', + "code": 6246, + "name": "InvalidPhoenixProgram", + "msg": "InvalidPhoenixProgram" }, { - code: 6247, - name: 'InvalidPhoenixMarket', - msg: 'InvalidPhoenixMarket', + "code": 6247, + "name": "InvalidPhoenixMarket", + "msg": "InvalidPhoenixMarket" }, { - code: 6248, - name: 'InvalidSwap', - msg: 'InvalidSwap', + "code": 6248, + "name": "InvalidSwap", + "msg": "InvalidSwap" }, { - code: 6249, - name: 'SwapLimitPriceBreached', - msg: 'SwapLimitPriceBreached', + "code": 6249, + "name": "SwapLimitPriceBreached", + "msg": "SwapLimitPriceBreached" }, { - code: 6250, - name: 'SpotMarketReduceOnly', - msg: 'SpotMarketReduceOnly', + "code": 6250, + "name": "SpotMarketReduceOnly", + "msg": "SpotMarketReduceOnly" }, { - code: 6251, - name: 'FundingWasNotUpdated', - msg: 'FundingWasNotUpdated', + "code": 6251, + "name": "FundingWasNotUpdated", + "msg": "FundingWasNotUpdated" }, { - code: 6252, - name: 'ImpossibleFill', - msg: 'ImpossibleFill', + "code": 6252, + "name": "ImpossibleFill", + "msg": "ImpossibleFill" }, { - code: 6253, - name: 'CantUpdatePerpBidAskTwap', - msg: 'CantUpdatePerpBidAskTwap', + "code": 6253, + "name": "CantUpdatePerpBidAskTwap", + "msg": "CantUpdatePerpBidAskTwap" }, { - code: 6254, - name: 'UserReduceOnly', - msg: 'UserReduceOnly', + "code": 6254, + "name": "UserReduceOnly", + "msg": "UserReduceOnly" }, { - code: 6255, - name: 'InvalidMarginCalculation', - msg: 'InvalidMarginCalculation', + "code": 6255, + "name": "InvalidMarginCalculation", + "msg": "InvalidMarginCalculation" }, { - code: 6256, - name: 'CantPayUserInitFee', - msg: 'CantPayUserInitFee', + "code": 6256, + "name": "CantPayUserInitFee", + "msg": "CantPayUserInitFee" }, { - code: 6257, - name: 'CantReclaimRent', - msg: 'CantReclaimRent', + "code": 6257, + "name": "CantReclaimRent", + "msg": "CantReclaimRent" }, - ], -} + { + "code": 6258, + "name": "InsuranceFundOperationPaused", + "msg": "InsuranceFundOperationPaused" + }, + { + "code": 6259, + "name": "NoUnsettledPnl", + "msg": "NoUnsettledPnl" + }, + { + "code": 6260, + "name": "PnlPoolCantSettleUser", + "msg": "PnlPoolCantSettleUser" + }, + { + "code": 6261, + "name": "OracleNonPositive", + "msg": "OracleInvalid" + }, + { + "code": 6262, + "name": "OracleTooVolatile", + "msg": "OracleTooVolatile" + }, + { + "code": 6263, + "name": "OracleTooUncertain", + "msg": "OracleTooUncertain" + }, + { + "code": 6264, + "name": "OracleStaleForMargin", + "msg": "OracleStaleForMargin" + }, + { + "code": 6265, + "name": "OracleInsufficientDataPoints", + "msg": "OracleInsufficientDataPoints" + }, + { + "code": 6266, + "name": "OracleStaleForAMM", + "msg": "OracleStaleForAMM" + }, + { + "code": 6267, + "name": "UnableToParsePullOracleMessage", + "msg": "Unable to parse pull oracle message" + }, + { + "code": 6268, + "name": "MaxBorrows", + "msg": "Can not borow more than max borrows" + }, + { + "code": 6269, + "name": "OracleUpdatesNotMonotonic", + "msg": "Updates must be monotonically increasing" + }, + { + "code": 6270, + "name": "OraclePriceFeedMessageMismatch", + "msg": "Trying to update price feed with the wrong feed id" + }, + { + "code": 6271, + "name": "OracleUnsupportedMessageType", + "msg": "The message in the update must be a PriceFeedMessage" + }, + { + "code": 6272, + "name": "OracleDeserializeMessageFailed", + "msg": "Could not deserialize the message in the update" + }, + { + "code": 6273, + "name": "OracleWrongGuardianSetOwner", + "msg": "Wrong guardian set owner in update price atomic" + }, + { + "code": 6274, + "name": "OracleWrongWriteAuthority", + "msg": "Oracle post update atomic price feed account must be drift program" + }, + { + "code": 6275, + "name": "OracleWrongVaaOwner", + "msg": "Oracle vaa owner must be wormhole program" + }, + { + "code": 6276, + "name": "OracleTooManyPriceAccountUpdates", + "msg": "Multi updates must have 2 or fewer accounts passed in remaining accounts" + }, + { + "code": 6277, + "name": "OracleMismatchedVaaAndPriceUpdates", + "msg": "Don't have the same remaining accounts number and merkle price updates left" + }, + { + "code": 6278, + "name": "OracleBadRemainingAccountPublicKey", + "msg": "Remaining account passed is not a valid pda" + }, + { + "code": 6279, + "name": "FailedOpenbookV2CPI", + "msg": "FailedOpenbookV2CPI" + }, + { + "code": 6280, + "name": "InvalidOpenbookV2Program", + "msg": "InvalidOpenbookV2Program" + }, + { + "code": 6281, + "name": "InvalidOpenbookV2Market", + "msg": "InvalidOpenbookV2Market" + }, + { + "code": 6282, + "name": "NonZeroTransferFee", + "msg": "Non zero transfer fee" + }, + { + "code": 6283, + "name": "LiquidationOrderFailedToFill", + "msg": "Liquidation order failed to fill" + }, + { + "code": 6284, + "name": "InvalidPredictionMarketOrder", + "msg": "Invalid prediction market order" + } + ] +} \ No newline at end of file diff --git a/VoteStakeRegistry/components/Account/DepositCard.tsx b/VoteStakeRegistry/components/Account/DepositCard.tsx index 3f4d51a83a..3a77d2cd53 100644 --- a/VoteStakeRegistry/components/Account/DepositCard.tsx +++ b/VoteStakeRegistry/components/Account/DepositCard.tsx @@ -7,6 +7,7 @@ import { voteRegistryWithdraw } from 'VoteStakeRegistry/actions/voteRegistryWith import { DepositWithMintAccount, LockupType, + Registrar, } from 'VoteStakeRegistry/sdk/accounts' import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore' import tokenPriceService from '@utils/services/tokenPrice' @@ -35,9 +36,11 @@ import {useVsrClient} from "../../../VoterWeightPlugins/useVsrClient"; const DepositCard = ({ deposit, vsrClient, + registrar }: { deposit: DepositWithMintAccount - vsrClient?: VsrClient | undefined + vsrClient?: VsrClient | undefined, + registrar?: Registrar | undefined }) => { const { getOwnedDeposits } = useDepositStore() const ownTokenRecord = useUserCommunityTokenOwnerRecord().data?.result @@ -146,6 +149,7 @@ const DepositCard = ({ const tokenInfo = tokenPriceService.getTokenInfo( deposit.mint.publicKey.toBase58() ) + return (