Nado Typescript SDK Documentation
    Preparing search index...

    Variable PERP_ENGINE_ABIConst

    PERP_ENGINE_ABI: readonly [
        {
            anonymous: false;
            inputs: readonly [
                {
                    indexed: false;
                    internalType: "uint32";
                    name: "productId";
                    type: "uint32";
                },
            ];
            name: "AddProduct";
            type: "event";
        },
        {
            anonymous: false;
            inputs: readonly [
                {
                    indexed: false;
                    internalType: "uint32";
                    name: "productId";
                    type: "uint32";
                },
                {
                    indexed: false;
                    internalType: "bytes32";
                    name: "subaccount";
                    type: "bytes32";
                },
            ];
            name: "BalanceUpdate";
            type: "event";
        },
        {
            anonymous: false;
            inputs: readonly [
                {
                    indexed: false;
                    internalType: "uint32";
                    name: "productId";
                    type: "uint32";
                },
                { indexed: false; internalType: "uint128"; name: "dt"; type: "uint128" },
                {
                    indexed: false;
                    internalType: "int128";
                    name: "openInterest";
                    type: "int128";
                },
                {
                    indexed: false;
                    internalType: "int128";
                    name: "payment";
                    type: "int128";
                },
            ];
            name: "FundingPayment";
            type: "event";
        },
        {
            anonymous: false;
            inputs: readonly [
                {
                    indexed: false;
                    internalType: "uint8";
                    name: "version";
                    type: "uint8";
                },
            ];
            name: "Initialized";
            type: "event";
        },
        {
            anonymous: false;
            inputs: readonly [
                {
                    indexed: true;
                    internalType: "address";
                    name: "previousOwner";
                    type: "address";
                },
                {
                    indexed: true;
                    internalType: "address";
                    name: "newOwner";
                    type: "address";
                },
            ];
            name: "OwnershipTransferred";
            type: "event";
        },
        {
            anonymous: false;
            inputs: readonly [
                {
                    indexed: false;
                    internalType: "uint32";
                    name: "productId";
                    type: "uint32";
                },
            ];
            name: "ProductUpdate";
            type: "event";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                { internalType: "int128"; name: "sizeIncrement"; type: "int128" },
                { internalType: "int128"; name: "minSize"; type: "int128" },
                {
                    components: readonly [
                        { internalType: "int32"; name: "longWeightInitial"; type: "int32" },
                        { internalType: "int32"; name: "shortWeightInitial"; type: "int32" },
                        { internalType: "int32"; name: "longWeightMaintenance"; type: "int32" },
                        {
                            internalType: "int32";
                            name: "shortWeightMaintenance";
                            type: "int32";
                        },
                        { internalType: "int128"; name: "priceX18"; type: "int128" },
                    ];
                    internalType: "struct RiskHelper.RiskStore";
                    name: "riskStore";
                    type: "tuple";
                },
            ];
            name: "addProduct";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: ""; type: "uint32" },
                { internalType: "bytes32"; name: ""; type: "bytes32" },
            ];
            name: "balances";
            outputs: readonly [
                { internalType: "int128"; name: "amount"; type: "int128" },
                { internalType: "int128"; name: "vQuoteBalance"; type: "int128" },
                {
                    internalType: "int128";
                    name: "lastCumulativeFundingX18";
                    type: "int128";
                },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
            ];
            name: "getBalance";
            outputs: readonly [
                {
                    components: readonly [
                        { internalType: "int128"; name: "amount"; type: "int128" },
                        { internalType: "int128"; name: "vQuoteBalance"; type: "int128" },
                        {
                            internalType: "int128";
                            name: "lastCumulativeFundingX18";
                            type: "int128";
                        },
                    ];
                    internalType: "struct IPerpEngine.Balance";
                    name: "";
                    type: "tuple";
                },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [];
            name: "getClearinghouse";
            outputs: readonly [{ internalType: "address"; name: ""; type: "address" }];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                {
                    internalType: "enum IProductEngine.HealthType";
                    name: "healthType";
                    type: "uint8";
                },
            ];
            name: "getCoreRisk";
            outputs: readonly [
                {
                    components: readonly [
                        { internalType: "int128"; name: "amount"; type: "int128" },
                        { internalType: "int128"; name: "price"; type: "int128" },
                        { internalType: "int128"; name: "longWeight"; type: "int128" },
                    ];
                    internalType: "struct IProductEngine.CoreRisk";
                    name: "";
                    type: "tuple";
                },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [];
            name: "getEndpoint";
            outputs: readonly [{ internalType: "address"; name: ""; type: "address" }];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [];
            name: "getEngineType";
            outputs: readonly [
                {
                    internalType: "enum IProductEngine.EngineType";
                    name: "";
                    type: "uint8";
                },
            ];
            stateMutability: "pure";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
                {
                    internalType: "enum IProductEngine.HealthType";
                    name: "healthType";
                    type: "uint8";
                },
            ];
            name: "getHealthContribution";
            outputs: readonly [
                { internalType: "int128"; name: "health"; type: "int128" },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
            ];
            name: "getPositionPnl";
            outputs: readonly [{ internalType: "int128"; name: ""; type: "int128" }];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [];
            name: "getProductIds";
            outputs: readonly [
                { internalType: "uint32[]"; name: ""; type: "uint32[]" },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
            ];
            name: "getRisk";
            outputs: readonly [
                {
                    components: readonly [
                        {
                            internalType: "int128";
                            name: "longWeightInitialX18";
                            type: "int128";
                        },
                        {
                            internalType: "int128";
                            name: "shortWeightInitialX18";
                            type: "int128";
                        },
                        {
                            internalType: "int128";
                            name: "longWeightMaintenanceX18";
                            type: "int128";
                        },
                        {
                            internalType: "int128";
                            name: "shortWeightMaintenanceX18";
                            type: "int128";
                        },
                        { internalType: "int128"; name: "priceX18"; type: "int128" },
                    ];
                    internalType: "struct RiskHelper.Risk";
                    name: "";
                    type: "tuple";
                },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
            ];
            name: "getSettlementState";
            outputs: readonly [
                { internalType: "int128"; name: "availableSettle"; type: "int128" },
                {
                    components: readonly [
                        {
                            internalType: "int128";
                            name: "cumulativeFundingLongX18";
                            type: "int128";
                        },
                        {
                            internalType: "int128";
                            name: "cumulativeFundingShortX18";
                            type: "int128";
                        },
                        { internalType: "int128"; name: "availableSettle"; type: "int128" },
                        { internalType: "int128"; name: "openInterest"; type: "int128" },
                    ];
                    internalType: "struct IPerpEngine.State";
                    name: "state";
                    type: "tuple";
                },
                {
                    components: readonly [
                        { internalType: "int128"; name: "amount"; type: "int128" },
                        { internalType: "int128"; name: "vQuoteBalance"; type: "int128" },
                        {
                            internalType: "int128";
                            name: "lastCumulativeFundingX18";
                            type: "int128";
                        },
                    ];
                    internalType: "struct IPerpEngine.Balance";
                    name: "balance";
                    type: "tuple";
                },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
            ];
            name: "getStateAndBalance";
            outputs: readonly [
                {
                    components: readonly [
                        {
                            internalType: "int128";
                            name: "cumulativeFundingLongX18";
                            type: "int128";
                        },
                        {
                            internalType: "int128";
                            name: "cumulativeFundingShortX18";
                            type: "int128";
                        },
                        { internalType: "int128"; name: "availableSettle"; type: "int128" },
                        { internalType: "int128"; name: "openInterest"; type: "int128" },
                    ];
                    internalType: "struct IPerpEngine.State";
                    name: "";
                    type: "tuple";
                },
                {
                    components: readonly [
                        { internalType: "int128"; name: "amount"; type: "int128" },
                        { internalType: "int128"; name: "vQuoteBalance"; type: "int128" },
                        {
                            internalType: "int128";
                            name: "lastCumulativeFundingX18";
                            type: "int128";
                        },
                    ];
                    internalType: "struct IPerpEngine.Balance";
                    name: "";
                    type: "tuple";
                },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "address"; name: "_clearinghouse"; type: "address" },
                { internalType: "address"; name: "_offchainExchange"; type: "address" },
                { internalType: "address"; name: ""; type: "address" },
                { internalType: "address"; name: "_endpoint"; type: "address" },
                { internalType: "address"; name: "_admin"; type: "address" },
            ];
            name: "initialize";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "int128[]"; name: "openInterests"; type: "int128[]" },
            ];
            name: "manualAssert";
            outputs: readonly [];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [];
            name: "owner";
            outputs: readonly [{ internalType: "address"; name: ""; type: "address" }];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [];
            name: "renounceOwnership";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
                { internalType: "uint256"; name: "productIds"; type: "uint256" },
            ];
            name: "settlePnl";
            outputs: readonly [{ internalType: "int128"; name: ""; type: "int128" }];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
                { internalType: "int128"; name: "insurance"; type: "int128" },
            ];
            name: "socializeSubaccount";
            outputs: readonly [{ internalType: "int128"; name: ""; type: "int128" }];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [{ internalType: "uint32"; name: ""; type: "uint32" }];
            name: "states";
            outputs: readonly [
                {
                    internalType: "int128";
                    name: "cumulativeFundingLongX18";
                    type: "int128";
                },
                {
                    internalType: "int128";
                    name: "cumulativeFundingShortX18";
                    type: "int128";
                },
                { internalType: "int128"; name: "availableSettle"; type: "int128" },
                { internalType: "int128"; name: "openInterest"; type: "int128" },
            ];
            stateMutability: "view";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "address"; name: "newOwner"; type: "address" },
            ];
            name: "transferOwnership";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                { internalType: "bytes32"; name: "subaccount"; type: "bytes32" },
                { internalType: "int128"; name: "amountDelta"; type: "int128" },
                { internalType: "int128"; name: "vQuoteDelta"; type: "int128" },
            ];
            name: "updateBalance";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                { internalType: "int128"; name: "priceX18"; type: "int128" },
            ];
            name: "updatePrice";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "bytes"; name: "rawTxn"; type: "bytes" },
            ];
            name: "updateProduct";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint32"; name: "productId"; type: "uint32" },
                {
                    components: readonly [
                        { internalType: "int32"; name: "longWeightInitial"; type: "int32" },
                        { internalType: "int32"; name: "shortWeightInitial"; type: "int32" },
                        { internalType: "int32"; name: "longWeightMaintenance"; type: "int32" },
                        {
                            internalType: "int32";
                            name: "shortWeightMaintenance";
                            type: "int32";
                        },
                        { internalType: "int128"; name: "priceX18"; type: "int128" },
                    ];
                    internalType: "struct RiskHelper.RiskStore";
                    name: "riskStore";
                    type: "tuple";
                },
            ];
            name: "updateRisk";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
        {
            inputs: readonly [
                { internalType: "uint128"; name: "dt"; type: "uint128" },
                { internalType: "int128[]"; name: "avgPriceDiffs"; type: "int128[]" },
            ];
            name: "updateStates";
            outputs: readonly [];
            stateMutability: "nonpayable";
            type: "function";
        },
    ] = ...