update program, and deploy to devnet
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
faba5c47bf
commit
795fa532da
|
@ -1,5 +1,5 @@
|
||||||
[programs.localnet]
|
[programs.localnet]
|
||||||
mango_v4 = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
|
mango_v4 = "m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
seeds = true
|
seeds = true
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub mod state;
|
||||||
|
|
||||||
use state::{OrderType, PerpMarketIndex, Serum3MarketIndex, Side, TokenIndex};
|
use state::{OrderType, PerpMarketIndex, Serum3MarketIndex, Side, TokenIndex};
|
||||||
|
|
||||||
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
|
declare_id!("m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD");
|
||||||
|
|
||||||
#[program]
|
#[program]
|
||||||
pub mod mango_v4 {
|
pub mod mango_v4 {
|
||||||
|
|
|
@ -22,7 +22,7 @@ yarn clean && yarn build && cp package.json ./dist/
|
||||||
# # update on chain program and IDL, atm used for testing/developing
|
# # update on chain program and IDL, atm used for testing/developing
|
||||||
# anchor deploy --provider.cluster devnet --provider.wallet ${PROVIDER_WALLET}
|
# anchor deploy --provider.cluster devnet --provider.wallet ${PROVIDER_WALLET}
|
||||||
# anchor idl upgrade --provider.cluster devnet --provider.wallet ${PROVIDER_WALLET}\
|
# anchor idl upgrade --provider.cluster devnet --provider.wallet ${PROVIDER_WALLET}\
|
||||||
# --filepath target/idl/voter_stake_registry.json Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS
|
# --filepath target/idl/voter_stake_registry.json m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
|
||||||
|
|
||||||
|
|
||||||
# # publish the npm package
|
# # publish the npm package
|
||||||
|
|
13
ts/client.ts
13
ts/client.ts
|
@ -3,14 +3,11 @@ import { PublicKey } from '@solana/web3.js';
|
||||||
import { MangoV4, IDL } from './mango_v4';
|
import { MangoV4, IDL } from './mango_v4';
|
||||||
|
|
||||||
export const MANGO_V4_ID = new PublicKey(
|
export const MANGO_V4_ID = new PublicKey(
|
||||||
'Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS',
|
'm43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD',
|
||||||
);
|
);
|
||||||
|
|
||||||
export class MangoClient {
|
export class MangoClient {
|
||||||
constructor(
|
constructor(public program: Program<MangoV4>, public devnet?: boolean) {}
|
||||||
public program: Program<MangoV4>,
|
|
||||||
public devnet?: boolean,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
static async connect(
|
static async connect(
|
||||||
provider: Provider,
|
provider: Provider,
|
||||||
|
@ -21,11 +18,7 @@ export class MangoClient {
|
||||||
const idl = IDL;
|
const idl = IDL;
|
||||||
|
|
||||||
return new MangoClient(
|
return new MangoClient(
|
||||||
new Program<MangoV4>(
|
new Program<MangoV4>(idl as MangoV4, MANGO_V4_ID, provider),
|
||||||
idl as MangoV4,
|
|
||||||
MANGO_V4_ID,
|
|
||||||
provider,
|
|
||||||
),
|
|
||||||
devnet,
|
devnet,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
742
ts/mango_v4.ts
742
ts/mango_v4.ts
|
@ -195,6 +195,10 @@ export type MangoV4 = {
|
||||||
{
|
{
|
||||||
"name": "initLiabWeight",
|
"name": "initLiabWeight",
|
||||||
"type": "f32"
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": "f32"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -499,6 +503,16 @@ export type MangoV4 = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "quoteBank",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "baseBank",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "payer",
|
"name": "payer",
|
||||||
"isMut": true,
|
"isMut": true,
|
||||||
|
@ -516,18 +530,6 @@ export type MangoV4 = {
|
||||||
"type": {
|
"type": {
|
||||||
"defined": "Serum3MarketIndex"
|
"defined": "Serum3MarketIndex"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "baseTokenIndex",
|
|
||||||
"type": {
|
|
||||||
"defined": "TokenIndex"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "quoteTokenIndex",
|
|
||||||
"type": {
|
|
||||||
"defined": "TokenIndex"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -954,6 +956,51 @@ export type MangoV4 = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "liqTokenWithToken",
|
||||||
|
"accounts": [
|
||||||
|
{
|
||||||
|
"name": "group",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liqor",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liqorOwner",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liqee",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "assetTokenIndex",
|
||||||
|
"type": {
|
||||||
|
"defined": "TokenIndex"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liabTokenIndex",
|
||||||
|
"type": {
|
||||||
|
"defined": "TokenIndex"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maxLiabTransfer",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "createPerpMarket",
|
"name": "createPerpMarket",
|
||||||
"accounts": [
|
"accounts": [
|
||||||
|
@ -1010,7 +1057,7 @@ export type MangoV4 = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eventQueue",
|
"name": "eventQueue",
|
||||||
"isMut": false,
|
"isMut": true,
|
||||||
"isSigner": false
|
"isSigner": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1052,6 +1099,34 @@ export type MangoV4 = {
|
||||||
{
|
{
|
||||||
"name": "baseLotSize",
|
"name": "baseLotSize",
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maintAssetWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initAssetWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maintLiabWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initLiabWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "makerFee",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerFee",
|
||||||
|
"type": "f32"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1085,7 +1160,7 @@ export type MangoV4 = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eventQueue",
|
"name": "eventQueue",
|
||||||
"isMut": false,
|
"isMut": true,
|
||||||
"isSigner": false
|
"isSigner": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1100,6 +1175,12 @@ export type MangoV4 = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"args": [
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "side",
|
||||||
|
"type": {
|
||||||
|
"defined": "Side"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "price",
|
"name": "price",
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
|
@ -1131,6 +1212,39 @@ export type MangoV4 = {
|
||||||
"type": "u8"
|
"type": "u8"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "consumeEvents",
|
||||||
|
"accounts": [
|
||||||
|
{
|
||||||
|
"name": "group",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "perpMarket",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "eventQueue",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "limit",
|
||||||
|
"type": {
|
||||||
|
"defined": "usize"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "benchmark",
|
||||||
|
"accounts": [],
|
||||||
|
"args": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"accounts": [
|
"accounts": [
|
||||||
|
@ -1203,6 +1317,12 @@ export type MangoV4 = {
|
||||||
"defined": "I80F48"
|
"defined": "I80F48"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "dust",
|
"name": "dust",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -1318,6 +1438,52 @@ export type MangoV4 = {
|
||||||
"defined": "Serum3AccountMap"
|
"defined": "Serum3AccountMap"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "perpAccountMap",
|
||||||
|
"type": {
|
||||||
|
"defined": "PerpAccountMap"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "orderMarket",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "PerpMarketIndex"
|
||||||
|
},
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "orderSide",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "Side"
|
||||||
|
},
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "orders",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
"i128",
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clientOrderIds",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
"u64",
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "beingLiquidated",
|
"name": "beingLiquidated",
|
||||||
"type": "bool"
|
"type": "bool"
|
||||||
|
@ -1439,10 +1605,62 @@ export type MangoV4 = {
|
||||||
"name": "baseLotSize",
|
"name": "baseLotSize",
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "maintAssetWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initAssetWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maintLiabWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initLiabWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "makerFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "openInterest",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "seqNum",
|
"name": "seqNum",
|
||||||
"type": "u64"
|
"type": "u64"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "feesAccrued",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "bump",
|
"name": "bump",
|
||||||
"type": "u8"
|
"type": "u8"
|
||||||
|
@ -1469,16 +1687,35 @@ export type MangoV4 = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eventQueueHeader",
|
"name": "queue",
|
||||||
"type": {
|
"type": {
|
||||||
"kind": "struct",
|
"kind": "struct",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "metaData",
|
"name": "header",
|
||||||
"type": {
|
"type": {
|
||||||
"defined": "MetaData"
|
"defined": "H"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "buf",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "H::Item"
|
||||||
|
},
|
||||||
|
512
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "eventQueueHeader",
|
||||||
|
"type": {
|
||||||
|
"kind": "struct",
|
||||||
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "head",
|
"name": "head",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -1636,6 +1873,65 @@ export type MangoV4 = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "PerpAccount",
|
||||||
|
"type": {
|
||||||
|
"kind": "struct",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "marketIndex",
|
||||||
|
"type": {
|
||||||
|
"defined": "PerpMarketIndex"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "basePosition",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quotePosition",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bidsQuantity",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "asksQuantity",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerBase",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerQuote",
|
||||||
|
"type": "i64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PerpAccountMap",
|
||||||
|
"type": {
|
||||||
|
"kind": "struct",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "values",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "PerpAccount"
|
||||||
|
},
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "BookSideType",
|
"name": "BookSideType",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -1651,45 +1947,15 @@ export type MangoV4 = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "DataType",
|
"name": "HealthType",
|
||||||
"type": {
|
"type": {
|
||||||
"kind": "enum",
|
"kind": "enum",
|
||||||
"variants": [
|
"variants": [
|
||||||
{
|
{
|
||||||
"name": "MangoGroup"
|
"name": "Init"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MangoAccount"
|
"name": "Maint"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "RootBank"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "NodeBank"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "PerpMarket"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bids"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Asks"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MangoCache"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "EventQueue"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AdvancedOrders"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ReferrerMemory"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ReferrerIdRecord"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1907,6 +2173,11 @@ export type MangoV4 = {
|
||||||
"code": 6005,
|
"code": 6005,
|
||||||
"name": "HealthMustBePositive",
|
"name": "HealthMustBePositive",
|
||||||
"msg": ""
|
"msg": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6006,
|
||||||
|
"name": "IsBankrupt",
|
||||||
|
"msg": "The account is bankrupt"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -2108,6 +2379,10 @@ export const IDL: MangoV4 = {
|
||||||
{
|
{
|
||||||
"name": "initLiabWeight",
|
"name": "initLiabWeight",
|
||||||
"type": "f32"
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": "f32"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2412,6 +2687,16 @@ export const IDL: MangoV4 = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "quoteBank",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "baseBank",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "payer",
|
"name": "payer",
|
||||||
"isMut": true,
|
"isMut": true,
|
||||||
|
@ -2429,18 +2714,6 @@ export const IDL: MangoV4 = {
|
||||||
"type": {
|
"type": {
|
||||||
"defined": "Serum3MarketIndex"
|
"defined": "Serum3MarketIndex"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "baseTokenIndex",
|
|
||||||
"type": {
|
|
||||||
"defined": "TokenIndex"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "quoteTokenIndex",
|
|
||||||
"type": {
|
|
||||||
"defined": "TokenIndex"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2867,6 +3140,51 @@ export const IDL: MangoV4 = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "liqTokenWithToken",
|
||||||
|
"accounts": [
|
||||||
|
{
|
||||||
|
"name": "group",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liqor",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liqorOwner",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liqee",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "assetTokenIndex",
|
||||||
|
"type": {
|
||||||
|
"defined": "TokenIndex"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liabTokenIndex",
|
||||||
|
"type": {
|
||||||
|
"defined": "TokenIndex"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maxLiabTransfer",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "createPerpMarket",
|
"name": "createPerpMarket",
|
||||||
"accounts": [
|
"accounts": [
|
||||||
|
@ -2923,7 +3241,7 @@ export const IDL: MangoV4 = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eventQueue",
|
"name": "eventQueue",
|
||||||
"isMut": false,
|
"isMut": true,
|
||||||
"isSigner": false
|
"isSigner": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -2965,6 +3283,34 @@ export const IDL: MangoV4 = {
|
||||||
{
|
{
|
||||||
"name": "baseLotSize",
|
"name": "baseLotSize",
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maintAssetWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initAssetWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maintLiabWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initLiabWeight",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "makerFee",
|
||||||
|
"type": "f32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerFee",
|
||||||
|
"type": "f32"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2998,7 +3344,7 @@ export const IDL: MangoV4 = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eventQueue",
|
"name": "eventQueue",
|
||||||
"isMut": false,
|
"isMut": true,
|
||||||
"isSigner": false
|
"isSigner": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -3013,6 +3359,12 @@ export const IDL: MangoV4 = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"args": [
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "side",
|
||||||
|
"type": {
|
||||||
|
"defined": "Side"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "price",
|
"name": "price",
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
|
@ -3044,6 +3396,39 @@ export const IDL: MangoV4 = {
|
||||||
"type": "u8"
|
"type": "u8"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "consumeEvents",
|
||||||
|
"accounts": [
|
||||||
|
{
|
||||||
|
"name": "group",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "perpMarket",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "eventQueue",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "limit",
|
||||||
|
"type": {
|
||||||
|
"defined": "usize"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "benchmark",
|
||||||
|
"accounts": [],
|
||||||
|
"args": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"accounts": [
|
"accounts": [
|
||||||
|
@ -3116,6 +3501,12 @@ export const IDL: MangoV4 = {
|
||||||
"defined": "I80F48"
|
"defined": "I80F48"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "dust",
|
"name": "dust",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -3231,6 +3622,52 @@ export const IDL: MangoV4 = {
|
||||||
"defined": "Serum3AccountMap"
|
"defined": "Serum3AccountMap"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "perpAccountMap",
|
||||||
|
"type": {
|
||||||
|
"defined": "PerpAccountMap"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "orderMarket",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "PerpMarketIndex"
|
||||||
|
},
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "orderSide",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "Side"
|
||||||
|
},
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "orders",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
"i128",
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clientOrderIds",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
"u64",
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "beingLiquidated",
|
"name": "beingLiquidated",
|
||||||
"type": "bool"
|
"type": "bool"
|
||||||
|
@ -3352,10 +3789,62 @@ export const IDL: MangoV4 = {
|
||||||
"name": "baseLotSize",
|
"name": "baseLotSize",
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "maintAssetWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initAssetWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maintLiabWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "initLiabWeight",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "liquidationFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "makerFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerFee",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "openInterest",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "seqNum",
|
"name": "seqNum",
|
||||||
"type": "u64"
|
"type": "u64"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "feesAccrued",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "bump",
|
"name": "bump",
|
||||||
"type": "u8"
|
"type": "u8"
|
||||||
|
@ -3382,16 +3871,35 @@ export const IDL: MangoV4 = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eventQueueHeader",
|
"name": "queue",
|
||||||
"type": {
|
"type": {
|
||||||
"kind": "struct",
|
"kind": "struct",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "metaData",
|
"name": "header",
|
||||||
"type": {
|
"type": {
|
||||||
"defined": "MetaData"
|
"defined": "H"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "buf",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "H::Item"
|
||||||
|
},
|
||||||
|
512
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "eventQueueHeader",
|
||||||
|
"type": {
|
||||||
|
"kind": "struct",
|
||||||
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "head",
|
"name": "head",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -3549,6 +4057,65 @@ export const IDL: MangoV4 = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "PerpAccount",
|
||||||
|
"type": {
|
||||||
|
"kind": "struct",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "marketIndex",
|
||||||
|
"type": {
|
||||||
|
"defined": "PerpMarketIndex"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "basePosition",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quotePosition",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bidsQuantity",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "asksQuantity",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerBase",
|
||||||
|
"type": "i64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "takerQuote",
|
||||||
|
"type": "i64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PerpAccountMap",
|
||||||
|
"type": {
|
||||||
|
"kind": "struct",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "values",
|
||||||
|
"type": {
|
||||||
|
"array": [
|
||||||
|
{
|
||||||
|
"defined": "PerpAccount"
|
||||||
|
},
|
||||||
|
8
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "BookSideType",
|
"name": "BookSideType",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -3564,45 +4131,15 @@ export const IDL: MangoV4 = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "DataType",
|
"name": "HealthType",
|
||||||
"type": {
|
"type": {
|
||||||
"kind": "enum",
|
"kind": "enum",
|
||||||
"variants": [
|
"variants": [
|
||||||
{
|
{
|
||||||
"name": "MangoGroup"
|
"name": "Init"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MangoAccount"
|
"name": "Maint"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "RootBank"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "NodeBank"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "PerpMarket"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bids"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Asks"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MangoCache"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "EventQueue"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AdvancedOrders"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ReferrerMemory"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ReferrerIdRecord"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -3820,6 +4357,11 @@ export const IDL: MangoV4 = {
|
||||||
"code": 6005,
|
"code": 6005,
|
||||||
"name": "HealthMustBePositive",
|
"name": "HealthMustBePositive",
|
||||||
"msg": ""
|
"msg": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6006,
|
||||||
|
"name": "IsBankrupt",
|
||||||
|
"msg": "The account is bankrupt"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue