@electra.finance/contracts
Version:
Electra Finance contracts typings
1,155 lines • 22.8 kB
JSON
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "int112",
"name": "balance",
"type": "int112"
},
{
"indexed": false,
"internalType": "int112",
"name": "position",
"type": "int112"
},
{
"indexed": false,
"internalType": "enum SingleCFD.UpdateReason",
"name": "reason",
"type": "uint8"
},
{
"indexed": false,
"internalType": "uint80",
"name": "positionPrice",
"type": "uint80"
},
{
"indexed": false,
"internalType": "int112",
"name": "fundingRate",
"type": "int112"
},
{
"indexed": false,
"internalType": "int112",
"name": "realizedPNL",
"type": "int112"
},
{
"indexed": false,
"internalType": "int112",
"name": "realizedFR",
"type": "int112"
}
],
"name": "AccountUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "oracle",
"type": "address"
},
{
"indexed": false,
"internalType": "uint16",
"name": "withdrawMarginLevel",
"type": "uint16"
}
],
"name": "BasicParamsUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "leverage",
"type": "uint8"
},
{
"indexed": false,
"internalType": "uint8",
"name": "so_level",
"type": "uint8"
}
],
"name": "LevelsUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "int256",
"name": "long",
"type": "int256"
},
{
"indexed": false,
"internalType": "int256",
"name": "short",
"type": "int256"
},
{
"indexed": false,
"internalType": "int256",
"name": "long_fr_stored",
"type": "int256"
},
{
"indexed": false,
"internalType": "int256",
"name": "short_fr_stored",
"type": "int256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "last_fr_price_update_time",
"type": "uint256"
}
],
"name": "NewFundingRate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "buyer",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "seller",
"type": "address"
},
{
"indexed": false,
"internalType": "uint80",
"name": "filledPrice",
"type": "uint80"
},
{
"indexed": false,
"internalType": "uint192",
"name": "filledAmount",
"type": "uint192"
}
],
"name": "NewTrade",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "int112",
"name": "so_level",
"type": "int112"
}
],
"name": "customStopOutLevelUpdate",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "activePositions",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "allowedMatchers",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
},
{
"internalType": "int112",
"name": "marginLevel",
"type": "int112"
}
],
"name": "checkMargin",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"internalType": "int112",
"name": "",
"type": "int112"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "collateral_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "trader",
"type": "address"
},
{
"internalType": "bytes",
"name": "call_data",
"type": "bytes"
}
],
"name": "delegatedAction",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint112",
"name": "amount",
"type": "uint112"
}
],
"name": "depositAsset",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint112",
"name": "amount",
"type": "uint112"
},
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "depositAssetTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "cfdContract",
"type": "address"
},
{
"internalType": "uint112",
"name": "amount",
"type": "uint112"
}
],
"name": "depositAssetToAnotherCFD",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "senderAddress",
"type": "address"
},
{
"internalType": "address",
"name": "matcherAddress",
"type": "address"
},
{
"internalType": "uint64",
"name": "amount",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "price",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "matcherFee",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "nonce",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "expiration",
"type": "uint64"
},
{
"internalType": "address",
"name": "instrumentAddress",
"type": "address"
},
{
"internalType": "uint8",
"name": "buySide",
"type": "uint8"
},
{
"internalType": "bool",
"name": "isFromDelegate",
"type": "bool"
},
{
"internalType": "bool",
"name": "isPersonalSign",
"type": "bool"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"internalType": "struct LibValidator.Order",
"name": "buyOrder",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "senderAddress",
"type": "address"
},
{
"internalType": "address",
"name": "matcherAddress",
"type": "address"
},
{
"internalType": "uint64",
"name": "amount",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "price",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "matcherFee",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "nonce",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "expiration",
"type": "uint64"
},
{
"internalType": "address",
"name": "instrumentAddress",
"type": "address"
},
{
"internalType": "uint8",
"name": "buySide",
"type": "uint8"
},
{
"internalType": "bool",
"name": "isFromDelegate",
"type": "bool"
},
{
"internalType": "bool",
"name": "isPersonalSign",
"type": "bool"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"internalType": "struct LibValidator.Order",
"name": "sellOrder",
"type": "tuple"
},
{
"internalType": "uint80",
"name": "filledPrice",
"type": "uint80"
},
{
"internalType": "uint96",
"name": "filledAmount",
"type": "uint96"
}
],
"name": "fillOrders",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"name": "filled_amounts_",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "offset",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "limit",
"type": "uint256"
}
],
"name": "getActivePositions",
"outputs": [
{
"internalType": "address[]",
"name": "res",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getActivePositionsLength",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getAssetPrice",
"outputs": [
{
"internalType": "uint80",
"name": "price",
"type": "uint80"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getDelegateStorage",
"outputs": [
{
"internalType": "address",
"name": "delegateStorage",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "getFR",
"outputs": [
{
"internalType": "int112",
"name": "",
"type": "int112"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getLongFR",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint80",
"name": "price",
"type": "uint80"
}
],
"name": "getPNL",
"outputs": [
{
"internalType": "int112",
"name": "",
"type": "int112"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getPriceIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "getSenderOverride",
"outputs": [
{
"internalType": "address",
"name": "senderOverride",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getShortFR",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getSymbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "collateral",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "last_fr_price_update_time_",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "leverage_",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "accountToLiquidate",
"type": "address"
},
{
"internalType": "address",
"name": "liquidator",
"type": "address"
},
{
"internalType": "address",
"name": "instrumentAddress",
"type": "address"
},
{
"internalType": "uint64",
"name": "expiration",
"type": "uint64"
},
{
"internalType": "int112",
"name": "position",
"type": "int112"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"internalType": "struct LibValidator.LiquidationOrder",
"name": "liquidationOrder",
"type": "tuple"
}
],
"name": "liquidatePosition",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "long_fr_",
"outputs": [
{
"internalType": "int48",
"name": "",
"type": "int48"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "long_fr_stored_",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oracle_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "oracle",
"type": "address"
},
{
"internalType": "address",
"name": "delegateStorage",
"type": "address"
},
{
"internalType": "uint16",
"name": "withdrawMarginLevel",
"type": "uint16"
}
],
"name": "setBasicParams",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "int112",
"name": "so_level",
"type": "int112"
}
],
"name": "setCustomStopOutLevel",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "delegateStorage_",
"type": "address"
}
],
"name": "setDelegateStorage",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "int256",
"name": "long_fr",
"type": "int256"
},
{
"internalType": "int256",
"name": "short_fr",
"type": "int256"
}
],
"name": "setFR",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "leverage",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "so_level",
"type": "uint8"
}
],
"name": "setLevels",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "senderOverride",
"type": "address"
}
],
"name": "setSenderOverride",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "short_fr_",
"outputs": [
{
"internalType": "int48",
"name": "",
"type": "int48"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "short_fr_stored_",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "so_level_",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "matchers",
"type": "address[]"
},
{
"internalType": "bool[]",
"name": "values",
"type": "bool[]"
}
],
"name": "updateMatchers",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "userIndexes",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "user_data_",
"outputs": [
{
"internalType": "int112",
"name": "balance",
"type": "int112"
},
{
"internalType": "int112",
"name": "fr_base",
"type": "int112"
},
{
"internalType": "int112",
"name": "position",
"type": "int112"
},
{
"internalType": "uint80",
"name": "pos_avg_price",
"type": "uint80"
},
{
"internalType": "uint32",
"name": "pos_last_update",
"type": "uint32"
},
{
"internalType": "int256",
"name": "long_fr_last",
"type": "int256"
},
{
"internalType": "int256",
"name": "short_fr_last",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint112",
"name": "amount",
"type": "uint112"
}
],
"name": "withdrawAsset",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint112",
"name": "amount",
"type": "uint112"
},
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "withdrawAssetTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "withdrawFR",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "withdrawMarginLevel_",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
}
]