diff --git a/src/apps/lyra-avalon/assets/logo.png b/src/apps/lyra-avalon/assets/logo.png new file mode 100644 index 000000000..0a5ff7f12 Binary files /dev/null and b/src/apps/lyra-avalon/assets/logo.png differ diff --git a/src/apps/lyra-avalon/contracts/abis/liquidity-pool.json b/src/apps/lyra-avalon/contracts/abis/liquidity-pool.json new file mode 100644 index 000000000..578902ccd --- /dev/null +++ b/src/apps/lyra-avalon/contracts/abis/liquidity-pool.json @@ -0,0 +1,2360 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "AlreadyInitialised", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BaseTransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentValue", + "type": "uint256" + } + ], + "name": "HedgerIsNotEmpty", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pendingBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estimatedExchangeCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + } + ], + "name": "InsufficientFreeLiquidityForBaseExchange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "InvalidBeneficiaryAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "minDepositWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePaid", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.LiquidityPoolParameters", + "name": "lpParams", + "type": "tuple" + } + ], + "name": "InvalidLiquidityPoolParameters", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteToLock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "quote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "base", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.Collateral", + "name": "lockedCollateral", + "type": "tuple" + } + ], + "name": "LockingMoreQuoteThanIsFree", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minDeposit", + "type": "uint256" + } + ], + "name": "MinimumDepositNotMet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountLiquidityTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minWithdraw", + "type": "uint256" + } + ], + "name": "MinimumWithdrawNotMet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.Liquidity", + "name": "liquidity", + "type": "tuple" + } + ], + "name": "NotEnoughFreeToReclaimInsolvency", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + } + ], + "name": "OnlyNominatedOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + } + ], + "name": "OnlyOptionMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OnlyOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "poolHedger", + "type": "address" + } + ], + "name": "OnlyPoolHedger", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "poolHedger", + "type": "address" + } + ], + "name": "OnlyShortCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "int256", + "name": "totalAssetValue", + "type": "int256" + }, + { + "internalType": "int256", + "name": "optionValueDebt", + "type": "int256" + } + ], + "name": "OptionValueDebtExceedsTotalAssets", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "QuoteTransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + } + ], + "name": "SendPremiumNotEnoughCollateral", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "baseFreed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralBase", + "type": "uint256" + } + ], + "name": "BaseFreed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "baseLocked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralBase", + "type": "uint256" + } + ], + "name": "BaseLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "quoteSpent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseReceived", + "type": "uint256" + } + ], + "name": "BasePurchased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteReceived", + "type": "uint256" + } + ], + "name": "BaseSold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "insolventSettlementAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountQuoteReserved", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalOutstandingSettlements", + "type": "uint256" + } + ], + "name": "BoardSettlement", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newTimestamp", + "type": "uint256" + } + ], + "name": "BoardSettlementCircuitBreakerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "entryId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "boardNotStale", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "validEntry", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "guardianBypass", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "delaysExpired", + "type": "bool" + } + ], + "name": "CheckingCanProcess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "ivVarianceThresholdCrossed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "skewVarianceThresholdCrossed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "liquidityThresholdCrossed", + "type": "bool" + } + ], + "name": "CircuitBreakerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "depositQueueId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountDeposited", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReceived", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "DepositProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "depositQueueId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountDeposited", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalQueuedDeposits", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "DepositQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amountQuoteAdded", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalInsolventSettlementAmount", + "type": "uint256" + } + ], + "name": "InsolventSettlementAmountUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "minDepositWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePaid", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct LiquidityPool.LiquidityPoolParameters", + "name": "lpParams", + "type": "tuple" + } + ], + "name": "LiquidityPoolParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalOutstandingSettlements", + "type": "uint256" + } + ], + "name": "OutstandingSettlementSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract PoolHedger", + "name": "poolHedger", + "type": "address" + } + ], + "name": "PoolHedgerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "recipientPortion", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "optionMarketPortion", + "type": "uint256" + } + ], + "name": "PremiumTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "quoteFreed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralQuote", + "type": "uint256" + } + ], + "name": "QuoteFreed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "quoteLocked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralQuote", + "type": "uint256" + } + ], + "name": "QuoteLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } + ], + "name": "QuoteTransferredToPoolHedger", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "withdrawalQueueId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountWithdrawn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteReceived", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalQueuedWithdrawals", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "WithdrawPartiallyProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "withdrawalQueueId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountWithdrawn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteReceived", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalQueuedWithdrawals", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "WithdrawProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "withdrawer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "withdrawalQueueId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountWithdrawn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalQueuedWithdrawals", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "WithdrawQueued", + "type": "event" + }, + { + "inputs": [], + "name": "CBTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "insolventSettlements", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountQuoteFreed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountQuoteReserved", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBaseFreed", + "type": "uint256" + } + ], + "name": "boardSettlement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeBase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountQuoteFreed", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + } + ], + "name": "freeQuoteCollateralAndSendPremium", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "basePrice", + "type": "uint256" + }, + { + "internalType": "contract ICollateralShort", + "name": "short", + "type": "address" + } + ], + "name": "getLiquidity", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.Liquidity", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLiquidityParams", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.Liquidity", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLpParams", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "minDepositWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePaid", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.LiquidityPoolParameters", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalPoolValueQuote", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalTokenSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract SynthetixAdapter", + "name": "_synthetixAdapter", + "type": "address" + }, + { + "internalType": "contract OptionMarket", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract LiquidityTokens", + "name": "_liquidityTokens", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "_greekCache", + "type": "address" + }, + { + "internalType": "contract PoolHedger", + "name": "_poolHedger", + "type": "address" + }, + { + "internalType": "contract ShortCollateral", + "name": "_shortCollateral", + "type": "address" + }, + { + "internalType": "contract ERC20", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract ERC20", + "name": "_baseAsset", + "type": "address" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } + ], + "name": "initiateDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountLiquidityTokens", + "type": "uint256" + } + ], + "name": "initiateWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "insolventSettlementAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + } + ], + "name": "liquidateBaseAndSendPremium", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationInsolventAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "contract ICollateralShort", + "name": "short", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteBaseFeeRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseQuoteFeeRate", + "type": "uint256" + } + ], + "internalType": "struct SynthetixAdapter.ExchangeParams", + "name": "exchangeParams", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + } + ], + "name": "lockBase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + } + ], + "name": "lockQuote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockedCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "quote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "base", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lpParams", + "outputs": [ + { + "internalType": "uint256", + "name": "minDepositWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePaid", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextQueuedDepositId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextQueuedWithdrawalId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "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": "poolHedger", + "outputs": [ + { + "internalType": "contract PoolHedger", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "processDepositQueue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "processWithdrawalQueue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "queuedDepositHead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "queuedDeposits", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintedTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositInitiatedTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "queuedWithdrawalHead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "queuedWithdrawals", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteSent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawInitiatedTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "contract ICollateralShort", + "name": "short", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteBaseFeeRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseQuoteFeeRate", + "type": "uint256" + } + ], + "internalType": "struct SynthetixAdapter.ExchangeParams", + "name": "exchangeParams", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + } + ], + "name": "reclaimInsolventBase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "contract ICollateralShort", + "name": "short", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteBaseFeeRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseQuoteFeeRate", + "type": "uint256" + } + ], + "internalType": "struct SynthetixAdapter.ExchangeParams", + "name": "exchangeParams", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } + ], + "name": "reclaimInsolventQuote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendSettlementValue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + } + ], + "name": "sendShortPremium", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "minDepositWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidityCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewVarianceCBTimeout", + "type": "uint256" + }, + { + "internalType": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePaid", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.LiquidityPoolParameters", + "name": "_lpParams", + "type": "tuple" + } + ], + "name": "setLiquidityPoolParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PoolHedger", + "name": "newPoolHedger", + "type": "address" + } + ], + "name": "setPoolHedger", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingSettlements", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalQueuedDeposits", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalQueuedWithdrawals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "contract ICollateralShort", + "name": "short", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteBaseFeeRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseQuoteFeeRate", + "type": "uint256" + } + ], + "internalType": "struct SynthetixAdapter.ExchangeParams", + "name": "exchangeParams", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferQuoteToHedge", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateCBs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "insolvencyAmountInQuote", + "type": "uint256" + } + ], + "name": "updateLiquidationInsolvency", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/lyra-avalon/contracts/abis/liquidity-token.json b/src/apps/lyra-avalon/contracts/abis/liquidity-token.json new file mode 100644 index 000000000..305af0ae7 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/abis/liquidity-token.json @@ -0,0 +1,528 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "AlreadyInitialised", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidityPool", + "type": "address" + } + ], + "name": "OnlyLiquidityPool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + } + ], + "name": "OnlyNominatedOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OnlyOwner", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_liquidityPool", + "type": "address" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidityPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidityTracker", + "outputs": [ + { + "internalType": "contract ILiquidityTracker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ILiquidityTracker", + "name": "_liquidityTracker", + "type": "address" + } + ], + "name": "setLiquidityTracker", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/lyra-avalon/contracts/abis/lyra-registry.json b/src/apps/lyra-avalon/contracts/abis/lyra-registry.json new file mode 100644 index 000000000..90783cc5e --- /dev/null +++ b/src/apps/lyra-avalon/contracts/abis/lyra-registry.json @@ -0,0 +1,428 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + } + ], + "name": "OnlyNominatedOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OnlyOwner", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "GlobalAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract OptionMarket", + "name": "market", + "type": "address" + } + ], + "name": "MarketRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract OptionMarket", + "name": "optionMarket", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract LiquidityPool", + "name": "liquidityPool", + "type": "address" + }, + { + "internalType": "contract LiquidityTokens", + "name": "liquidityTokens", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "greekCache", + "type": "address" + }, + { + "internalType": "contract OptionMarket", + "name": "optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionMarketPricer", + "name": "optionMarketPricer", + "type": "address" + }, + { + "internalType": "contract OptionToken", + "name": "optionToken", + "type": "address" + }, + { + "internalType": "contract PoolHedger", + "name": "poolHedger", + "type": "address" + }, + { + "internalType": "contract ShortCollateral", + "name": "shortCollateral", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "baseAsset", + "type": "address" + } + ], + "indexed": false, + "internalType": "struct LyraRegistry.OptionMarketAddresses", + "name": "market", + "type": "tuple" + } + ], + "name": "MarketUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract LiquidityPool", + "name": "liquidityPool", + "type": "address" + }, + { + "internalType": "contract LiquidityTokens", + "name": "liquidityTokens", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "greekCache", + "type": "address" + }, + { + "internalType": "contract OptionMarket", + "name": "optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionMarketPricer", + "name": "optionMarketPricer", + "type": "address" + }, + { + "internalType": "contract OptionToken", + "name": "optionToken", + "type": "address" + }, + { + "internalType": "contract PoolHedger", + "name": "poolHedger", + "type": "address" + }, + { + "internalType": "contract ShortCollateral", + "name": "shortCollateral", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "baseAsset", + "type": "address" + } + ], + "internalType": "struct LyraRegistry.OptionMarketAddresses", + "name": "newMarketAddresses", + "type": "tuple" + } + ], + "name": "addMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "globalAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract OptionMarket", + "name": "", + "type": "address" + } + ], + "name": "marketAddresses", + "outputs": [ + { + "internalType": "contract LiquidityPool", + "name": "liquidityPool", + "type": "address" + }, + { + "internalType": "contract LiquidityTokens", + "name": "liquidityTokens", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "greekCache", + "type": "address" + }, + { + "internalType": "contract OptionMarket", + "name": "optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionMarketPricer", + "name": "optionMarketPricer", + "type": "address" + }, + { + "internalType": "contract OptionToken", + "name": "optionToken", + "type": "address" + }, + { + "internalType": "contract PoolHedger", + "name": "poolHedger", + "type": "address" + }, + { + "internalType": "contract ShortCollateral", + "name": "shortCollateral", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "baseAsset", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "optionMarkets", + "outputs": [ + { + "internalType": "contract OptionMarket", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract OptionMarket", + "name": "market", + "type": "address" + } + ], + "name": "removeMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "names", + "type": "bytes32[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + } + ], + "name": "updateGlobalAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/lyra-avalon/contracts/abis/option-market.json b/src/apps/lyra-avalon/contracts/abis/option-market.json new file mode 100644 index 000000000..d0003ac62 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/abis/option-market.json @@ -0,0 +1,1963 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "AlreadyInitialised", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BaseTransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "BoardAlreadySettled", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardExpiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentTime", + "type": "uint256" + } + ], + "name": "BoardExpired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "BoardIsFrozen", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "BoardNotExpired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "BoardNotFrozen", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "enum OptionMarket.NonZeroValues", + "name": "valueType", + "type": "uint8" + } + ], + "name": "ExpectedNonZeroValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "InvalidBoardId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBoardExpiry", + "type": "uint256" + } + ], + "name": "InvalidExpiryTimestamp", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "maxBoardExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "securityModule", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feePortionReserved", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.OptionMarketParameters", + "name": "optionMarketParams", + "type": "tuple" + } + ], + "name": "InvalidOptionMarketParams", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } + ], + "name": "InvalidStrikeId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + } + ], + "name": "OnlyNominatedOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OnlyOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "securityModule", + "type": "address" + } + ], + "name": "OnlySecurityModule", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "QuoteTransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "strikesLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewsLength", + "type": "uint256" + } + ], + "name": "StrikeSkewLengthMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCost", + "type": "uint256" + } + ], + "name": "TotalCostOutsideOfSpecifiedBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "iterations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tradeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalAmount", + "type": "uint256" + } + ], + "name": "TradeIterationsHasRemainder", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseIv", + "type": "uint256" + } + ], + "name": "BoardBaseIvSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseIv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "frozen", + "type": "bool" + } + ], + "name": "BoardCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "frozen", + "type": "bool" + } + ], + "name": "BoardFrozen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "spotPriceAtExpiry", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalUserLongProfitQuote", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBoardLongCallCollateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBoardLongPutCollateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalAMMShortCallProfitBase", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalAMMShortCallProfitQuote", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalAMMShortPutProfitQuote", + "type": "uint256" + } + ], + "name": "BoardSettled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "maxBoardExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "securityModule", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feePortionReserved", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct OptionMarket.OptionMarketParameters", + "name": "optionMarketParams", + "type": "tuple" + } + ], + "name": "OptionMarketParamsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "securityModule", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseAmount", + "type": "uint256" + } + ], + "name": "SMClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } + ], + "name": "StrikeAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } + ], + "name": "StrikeSkewSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "enum OptionMarket.TradeDirection", + "name": "tradeDirection", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setCollateralTo", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isForceClose", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct OptionMarket.TradeEventData", + "name": "trade", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "int256", + "name": "preTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "int256", + "name": "postTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "vegaUtil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "volTraded", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaUtilFee", + "type": "uint256" + } + ], + "internalType": "struct OptionMarketPricer.VegaUtilFeeComponents", + "name": "vegaUtilFee", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "varianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vega", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVariance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "varianceFee", + "type": "uint256" + } + ], + "internalType": "struct OptionMarketPricer.VarianceFeeComponents", + "name": "varianceFee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "totalFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "volTraded", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newBaseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newSkew", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct OptionMarketPricer.TradeResult[]", + "name": "tradeResults", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "rewardBeneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "returnCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lpPremiums", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lpFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "insolventAmount", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct OptionMarket.LiquidationEventData", + "name": "liquidation", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "Trade", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountCollateral", + "type": "uint256" + } + ], + "name": "addCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } + ], + "name": "addStrikeToBoard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "boardToPriceAtExpiry", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "iterations", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setCollateralTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTotalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalCost", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.TradeInputParameters", + "name": "params", + "type": "tuple" + } + ], + "name": "closePosition", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFee", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.Result", + "name": "result", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseIV", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "strikePrices", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "skews", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "frozen", + "type": "bool" + } + ], + "name": "createOptionBoard", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "iterations", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setCollateralTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTotalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalCost", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.TradeInputParameters", + "name": "params", + "type": "tuple" + } + ], + "name": "forceClosePosition", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFee", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.Result", + "name": "result", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "forceSettleBoard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "getBoardAndStrikeDetails", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "iv", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "frozen", + "type": "bool" + }, + { + "internalType": "uint256[]", + "name": "strikeIds", + "type": "uint256[]" + } + ], + "internalType": "struct OptionMarket.OptionBoard", + "name": "", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longCall", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortCallBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortCallQuote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longPut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortPut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.Strike[]", + "name": "", + "type": "tuple[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "getBoardStrikes", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLiveBoards", + "outputs": [ + { + "internalType": "uint256[]", + "name": "_liveBoards", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumLiveBoards", + "outputs": [ + { + "internalType": "uint256", + "name": "numLiveBoards", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "getOptionBoard", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "iv", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "frozen", + "type": "bool" + }, + { + "internalType": "uint256[]", + "name": "strikeIds", + "type": "uint256[]" + } + ], + "internalType": "struct OptionMarket.OptionBoard", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } + ], + "name": "getSettlementParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceAtExpiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeToBaseReturned", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } + ], + "name": "getStrike", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longCall", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortCallBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortCallQuote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longPut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortPut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.Strike", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } + ], + "name": "getStrikeAndBoard", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longCall", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortCallBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortCallQuote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longPut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortPut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.Strike", + "name": "", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "iv", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "frozen", + "type": "bool" + }, + { + "internalType": "uint256[]", + "name": "strikeIds", + "type": "uint256[]" + } + ], + "internalType": "struct OptionMarket.OptionBoard", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } + ], + "name": "getStrikeAndExpiry", + "outputs": [ + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract SynthetixAdapter", + "name": "_synthetixAdapter", + "type": "address" + }, + { + "internalType": "contract LiquidityPool", + "name": "_liquidityPool", + "type": "address" + }, + { + "internalType": "contract OptionMarketPricer", + "name": "_optionPricer", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "_greekCache", + "type": "address" + }, + { + "internalType": "contract ShortCollateral", + "name": "_shortCollateral", + "type": "address" + }, + { + "internalType": "contract OptionToken", + "name": "_optionToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_baseAsset", + "type": "address" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "rewardBeneficiary", + "type": "address" + } + ], + "name": "liquidatePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "iterations", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setCollateralTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTotalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalCost", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.TradeInputParameters", + "name": "params", + "type": "tuple" + } + ], + "name": "openPosition", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFee", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.Result", + "name": "result", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "optionMarketParams", + "outputs": [ + { + "internalType": "uint256", + "name": "maxBoardExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "securityModule", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feePortionReserved", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseIv", + "type": "uint256" + } + ], + "name": "setBoardBaseIv", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "frozen", + "type": "bool" + } + ], + "name": "setBoardFrozen", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "maxBoardExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "securityModule", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feePortionReserved", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.OptionMarketParameters", + "name": "_optionMarketParams", + "type": "tuple" + } + ], + "name": "setOptionMarketParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } + ], + "name": "setStrikeSkew", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "settleExpiredBoard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "smClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "strikeToBaseReturnedRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/apps/lyra-avalon/contracts/abis/option-token.json b/src/apps/lyra-avalon/contracts/abis/option-token.json new file mode 100644 index 000000000..33ae66b3a --- /dev/null +++ b/src/apps/lyra-avalon/contracts/abis/option-token.json @@ -0,0 +1,2257 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "invalidPositionId", + "type": "bool" + }, + { + "internalType": "bool", + "name": "positionInactive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isShort", + "type": "bool" + } + ], + "name": "AddingCollateralToInvalidPosition", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "position", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "name": "AdjustmentResultsInMinimumCollateralNotBeingMet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "AlreadyInitialised", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "invalidPositionId", + "type": "bool" + }, + { + "internalType": "bool", + "name": "positionInactive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "strikeMismatch", + "type": "bool" + }, + { + "internalType": "bool", + "name": "optionTypeMismatch", + "type": "bool" + } + ], + "name": "CannotAdjustInvalidPosition", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "CannotClosePositionZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "CannotOpenZeroAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setCollateralTo", + "type": "uint256" + } + ], + "name": "FullyClosingWithNonZeroSetCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "penaltyRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLiquidationFee", + "type": "uint256" + } + ], + "internalType": "struct OptionToken.PartialCollateralParameters", + "name": "partialCollatParams", + "type": "tuple" + } + ], + "name": "InvalidPartialCollateralParameters", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "originalPositionAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "splitAmount", + "type": "uint256" + } + ], + "name": "InvalidSplitAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + } + ], + "name": "MergingUnapprovedPosition", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "MustMergeTwoOrMorePositions", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + } + ], + "name": "OnlyNominatedOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + } + ], + "name": "OnlyOptionMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OnlyOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OnlyOwnerCanAdjustPosition", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "shortCollateral", + "type": "address" + } + ], + "name": "OnlyShortCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "firstPosition", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "nextPosition", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "ownerMismatch", + "type": "bool" + }, + { + "internalType": "bool", + "name": "strikeMismatch", + "type": "bool" + }, + { + "internalType": "bool", + "name": "optionTypeMismatch", + "type": "bool" + }, + { + "internalType": "bool", + "name": "duplicatePositionId", + "type": "bool" + } + ], + "name": "PositionMismatchWhenMerging", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "position", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "name": "PositionNotLiquidatable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "position", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "name": "ResultingNewPositionLiquidatable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "position", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "name": "ResultingOriginalPositionLiquidatable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + } + ], + "name": "SplittingUnapprovedPosition", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum OptionToken.PositionUpdatedType", + "name": "updatedType", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "indexed": false, + "internalType": "struct OptionToken.OptionPosition", + "name": "position", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "PositionUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountCollateral", + "type": "uint256" + } + ], + "name": "addCollateral", + "outputs": [ + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "isBuy", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isForceClose", + "type": "bool" + }, + { + "internalType": "enum OptionMarket.TradeDirection", + "name": "tradeDirection", + "type": "uint8" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.Liquidity", + "name": "liquidity", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "contract ICollateralShort", + "name": "short", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteBaseFeeRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseQuoteFeeRate", + "type": "uint256" + } + ], + "internalType": "struct SynthetixAdapter.ExchangeParams", + "name": "exchangeParams", + "type": "tuple" + } + ], + "internalType": "struct OptionMarket.TradeParameters", + "name": "trade", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setCollateralTo", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isOpen", + "type": "bool" + } + ], + "name": "adjustPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "pendingCollateral", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "position", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "name": "canLiquidate", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gwavPremium", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userPositionCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "convertedMinLiquidationFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "insolvencyMultiplier", + "type": "uint256" + } + ], + "name": "getLiquidationFees", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "returnCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lpPremiums", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lpFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "insolventAmount", + "type": "uint256" + } + ], + "internalType": "struct OptionToken.LiquidationFees", + "name": "liquidationFees", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + } + ], + "name": "getOptionPosition", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "positionIds", + "type": "uint256[]" + } + ], + "name": "getOptionPositions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "getOwnerPositions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "internalType": "struct OptionToken.OptionPosition[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPartialCollatParams", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "penaltyRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLiquidationFee", + "type": "uint256" + } + ], + "internalType": "struct OptionToken.PartialCollateralParameters", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + } + ], + "name": "getPositionState", + "outputs": [ + { + "internalType": "enum OptionToken.PositionState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + } + ], + "name": "getPositionWithOwner", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "internalType": "struct OptionToken.PositionWithOwner", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "positionIds", + "type": "uint256[]" + } + ], + "name": "getPositionsWithOwner", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "internalType": "struct OptionToken.PositionWithOwner[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract OptionMarket", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "_greekCache", + "type": "address" + }, + { + "internalType": "address", + "name": "_shortCollateral", + "type": "address" + }, + { + "internalType": "contract SynthetixAdapter", + "name": "_synthetixAdapter", + "type": "address" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isBuy", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isForceClose", + "type": "bool" + }, + { + "internalType": "enum OptionMarket.TradeDirection", + "name": "tradeDirection", + "type": "uint8" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + } + ], + "internalType": "struct LiquidityPool.Liquidity", + "name": "liquidity", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "contract ICollateralShort", + "name": "short", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteBaseFeeRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseQuoteFeeRate", + "type": "uint256" + } + ], + "internalType": "struct SynthetixAdapter.ExchangeParams", + "name": "exchangeParams", + "type": "tuple" + } + ], + "internalType": "struct OptionMarket.TradeParameters", + "name": "trade", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + } + ], + "name": "liquidate", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "returnCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lpPremiums", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lpFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "insolventAmount", + "type": "uint256" + } + ], + "internalType": "struct OptionToken.LiquidationFees", + "name": "liquidationFees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "positionIds", + "type": "uint256[]" + } + ], + "name": "merge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "partialCollatParams", + "outputs": [ + { + "internalType": "uint256", + "name": "penaltyRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLiquidationFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "positions", + "outputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "enum OptionToken.PositionState", + "name": "state", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "penaltyRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLiquidationFee", + "type": "uint256" + } + ], + "internalType": "struct OptionToken.PartialCollateralParameters", + "name": "_partialCollatParams", + "type": "tuple" + } + ], + "name": "setPartialCollateralParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newURI", + "type": "string" + } + ], + "name": "setURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "positionIds", + "type": "uint256[]" + } + ], + "name": "settlePositions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newCollateral", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "split", + "outputs": [ + { + "internalType": "uint256", + "name": "newPositionId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/lyra-avalon/contracts/ethers/LiquidityPool.ts b/src/apps/lyra-avalon/contracts/ethers/LiquidityPool.ts new file mode 100644 index 000000000..b8d2d1c10 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/LiquidityPool.ts @@ -0,0 +1,1883 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export declare namespace LiquidityPool { + export type LiquidityPoolParametersStruct = { + minDepositWithdraw: BigNumberish; + depositDelay: BigNumberish; + withdrawalDelay: BigNumberish; + withdrawalFee: BigNumberish; + liquidityCBThreshold: BigNumberish; + liquidityCBTimeout: BigNumberish; + ivVarianceCBThreshold: BigNumberish; + skewVarianceCBThreshold: BigNumberish; + ivVarianceCBTimeout: BigNumberish; + skewVarianceCBTimeout: BigNumberish; + guardianMultisig: string; + guardianDelay: BigNumberish; + boardSettlementCBTimeout: BigNumberish; + maxFeePaid: BigNumberish; + }; + + export type LiquidityPoolParametersStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + ] & { + minDepositWithdraw: BigNumber; + depositDelay: BigNumber; + withdrawalDelay: BigNumber; + withdrawalFee: BigNumber; + liquidityCBThreshold: BigNumber; + liquidityCBTimeout: BigNumber; + ivVarianceCBThreshold: BigNumber; + skewVarianceCBThreshold: BigNumber; + ivVarianceCBTimeout: BigNumber; + skewVarianceCBTimeout: BigNumber; + guardianMultisig: string; + guardianDelay: BigNumber; + boardSettlementCBTimeout: BigNumber; + maxFeePaid: BigNumber; + }; + + export type LiquidityStruct = { + freeLiquidity: BigNumberish; + burnableLiquidity: BigNumberish; + usedCollatLiquidity: BigNumberish; + pendingDeltaLiquidity: BigNumberish; + usedDeltaLiquidity: BigNumberish; + NAV: BigNumberish; + }; + + export type LiquidityStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + freeLiquidity: BigNumber; + burnableLiquidity: BigNumber; + usedCollatLiquidity: BigNumber; + pendingDeltaLiquidity: BigNumber; + usedDeltaLiquidity: BigNumber; + NAV: BigNumber; + }; +} + +export declare namespace SynthetixAdapter { + export type ExchangeParamsStruct = { + spotPrice: BigNumberish; + quoteKey: BytesLike; + baseKey: BytesLike; + short: string; + quoteBaseFeeRate: BigNumberish; + baseQuoteFeeRate: BigNumberish; + }; + + export type ExchangeParamsStructOutput = [BigNumber, string, string, string, BigNumber, BigNumber] & { + spotPrice: BigNumber; + quoteKey: string; + baseKey: string; + short: string; + quoteBaseFeeRate: BigNumber; + baseQuoteFeeRate: BigNumber; + }; +} + +export interface LiquidityPoolInterface extends utils.Interface { + functions: { + 'CBTimestamp()': FunctionFragment; + 'acceptOwnership()': FunctionFragment; + 'boardSettlement(uint256,uint256,uint256,uint256)': FunctionFragment; + 'exchangeBase()': FunctionFragment; + 'freeQuoteCollateralAndSendPremium(uint256,address,uint256,uint256)': FunctionFragment; + 'getLiquidity(uint256,address)': FunctionFragment; + 'getLiquidityParams()': FunctionFragment; + 'getLpParams()': FunctionFragment; + 'getTokenPrice()': FunctionFragment; + 'getTotalPoolValueQuote()': FunctionFragment; + 'getTotalTokenSupply()': FunctionFragment; + 'init(address,address,address,address,address,address,address,address)': FunctionFragment; + 'initiateDeposit(address,uint256)': FunctionFragment; + 'initiateWithdraw(address,uint256)': FunctionFragment; + 'insolventSettlementAmount()': FunctionFragment; + 'liquidateBaseAndSendPremium(uint256,address,uint256,uint256)': FunctionFragment; + 'liquidationInsolventAmount()': FunctionFragment; + 'lockBase(uint256,(uint256,bytes32,bytes32,address,uint256,uint256),uint256)': FunctionFragment; + 'lockQuote(uint256,uint256)': FunctionFragment; + 'lockedCollateral()': FunctionFragment; + 'lpParams()': FunctionFragment; + 'nextQueuedDepositId()': FunctionFragment; + 'nextQueuedWithdrawalId()': FunctionFragment; + 'nominateNewOwner(address)': FunctionFragment; + 'nominatedOwner()': FunctionFragment; + 'owner()': FunctionFragment; + 'poolHedger()': FunctionFragment; + 'processDepositQueue(uint256)': FunctionFragment; + 'processWithdrawalQueue(uint256)': FunctionFragment; + 'queuedDepositHead()': FunctionFragment; + 'queuedDeposits(uint256)': FunctionFragment; + 'queuedWithdrawalHead()': FunctionFragment; + 'queuedWithdrawals(uint256)': FunctionFragment; + 'reclaimInsolventBase((uint256,bytes32,bytes32,address,uint256,uint256),uint256)': FunctionFragment; + 'reclaimInsolventQuote((uint256,bytes32,bytes32,address,uint256,uint256),uint256)': FunctionFragment; + 'sendSettlementValue(address,uint256)': FunctionFragment; + 'sendShortPremium(address,uint256,uint256,uint256)': FunctionFragment; + 'setLiquidityPoolParameters((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,address,uint256,uint256,uint256))': FunctionFragment; + 'setPoolHedger(address)': FunctionFragment; + 'totalOutstandingSettlements()': FunctionFragment; + 'totalQueuedDeposits()': FunctionFragment; + 'totalQueuedWithdrawals()': FunctionFragment; + 'transferQuoteToHedge((uint256,bytes32,bytes32,address,uint256,uint256),uint256)': FunctionFragment; + 'updateCBs()': FunctionFragment; + 'updateLiquidationInsolvency(uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'CBTimestamp' + | 'acceptOwnership' + | 'boardSettlement' + | 'exchangeBase' + | 'freeQuoteCollateralAndSendPremium' + | 'getLiquidity' + | 'getLiquidityParams' + | 'getLpParams' + | 'getTokenPrice' + | 'getTotalPoolValueQuote' + | 'getTotalTokenSupply' + | 'init' + | 'initiateDeposit' + | 'initiateWithdraw' + | 'insolventSettlementAmount' + | 'liquidateBaseAndSendPremium' + | 'liquidationInsolventAmount' + | 'lockBase' + | 'lockQuote' + | 'lockedCollateral' + | 'lpParams' + | 'nextQueuedDepositId' + | 'nextQueuedWithdrawalId' + | 'nominateNewOwner' + | 'nominatedOwner' + | 'owner' + | 'poolHedger' + | 'processDepositQueue' + | 'processWithdrawalQueue' + | 'queuedDepositHead' + | 'queuedDeposits' + | 'queuedWithdrawalHead' + | 'queuedWithdrawals' + | 'reclaimInsolventBase' + | 'reclaimInsolventQuote' + | 'sendSettlementValue' + | 'sendShortPremium' + | 'setLiquidityPoolParameters' + | 'setPoolHedger' + | 'totalOutstandingSettlements' + | 'totalQueuedDeposits' + | 'totalQueuedWithdrawals' + | 'transferQuoteToHedge' + | 'updateCBs' + | 'updateLiquidationInsolvency', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'CBTimestamp', values?: undefined): string; + encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string; + encodeFunctionData( + functionFragment: 'boardSettlement', + values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'exchangeBase', values?: undefined): string; + encodeFunctionData( + functionFragment: 'freeQuoteCollateralAndSendPremium', + values: [BigNumberish, string, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'getLiquidity', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'getLiquidityParams', values?: undefined): string; + encodeFunctionData(functionFragment: 'getLpParams', values?: undefined): string; + encodeFunctionData(functionFragment: 'getTokenPrice', values?: undefined): string; + encodeFunctionData(functionFragment: 'getTotalPoolValueQuote', values?: undefined): string; + encodeFunctionData(functionFragment: 'getTotalTokenSupply', values?: undefined): string; + encodeFunctionData( + functionFragment: 'init', + values: [string, string, string, string, string, string, string, string], + ): string; + encodeFunctionData(functionFragment: 'initiateDeposit', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'initiateWithdraw', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'insolventSettlementAmount', values?: undefined): string; + encodeFunctionData( + functionFragment: 'liquidateBaseAndSendPremium', + values: [BigNumberish, string, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'liquidationInsolventAmount', values?: undefined): string; + encodeFunctionData( + functionFragment: 'lockBase', + values: [BigNumberish, SynthetixAdapter.ExchangeParamsStruct, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'lockQuote', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'lockedCollateral', values?: undefined): string; + encodeFunctionData(functionFragment: 'lpParams', values?: undefined): string; + encodeFunctionData(functionFragment: 'nextQueuedDepositId', values?: undefined): string; + encodeFunctionData(functionFragment: 'nextQueuedWithdrawalId', values?: undefined): string; + encodeFunctionData(functionFragment: 'nominateNewOwner', values: [string]): string; + encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'poolHedger', values?: undefined): string; + encodeFunctionData(functionFragment: 'processDepositQueue', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'processWithdrawalQueue', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'queuedDepositHead', values?: undefined): string; + encodeFunctionData(functionFragment: 'queuedDeposits', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'queuedWithdrawalHead', values?: undefined): string; + encodeFunctionData(functionFragment: 'queuedWithdrawals', values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: 'reclaimInsolventBase', + values: [SynthetixAdapter.ExchangeParamsStruct, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'reclaimInsolventQuote', + values: [SynthetixAdapter.ExchangeParamsStruct, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'sendSettlementValue', values: [string, BigNumberish]): string; + encodeFunctionData( + functionFragment: 'sendShortPremium', + values: [string, BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'setLiquidityPoolParameters', + values: [LiquidityPool.LiquidityPoolParametersStruct], + ): string; + encodeFunctionData(functionFragment: 'setPoolHedger', values: [string]): string; + encodeFunctionData(functionFragment: 'totalOutstandingSettlements', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalQueuedDeposits', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalQueuedWithdrawals', values?: undefined): string; + encodeFunctionData( + functionFragment: 'transferQuoteToHedge', + values: [SynthetixAdapter.ExchangeParamsStruct, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'updateCBs', values?: undefined): string; + encodeFunctionData(functionFragment: 'updateLiquidationInsolvency', values: [BigNumberish]): string; + + decodeFunctionResult(functionFragment: 'CBTimestamp', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'boardSettlement', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'exchangeBase', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'freeQuoteCollateralAndSendPremium', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLiquidity', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLiquidityParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLpParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getTokenPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getTotalPoolValueQuote', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getTotalTokenSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'init', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initiateDeposit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initiateWithdraw', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'insolventSettlementAmount', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'liquidateBaseAndSendPremium', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'liquidationInsolventAmount', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lockBase', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lockQuote', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lockedCollateral', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lpParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nextQueuedDepositId', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nextQueuedWithdrawalId', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'poolHedger', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'processDepositQueue', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'processWithdrawalQueue', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'queuedDepositHead', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'queuedDeposits', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'queuedWithdrawalHead', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'queuedWithdrawals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'reclaimInsolventBase', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'reclaimInsolventQuote', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'sendSettlementValue', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'sendShortPremium', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setLiquidityPoolParameters', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setPoolHedger', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalOutstandingSettlements', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalQueuedDeposits', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalQueuedWithdrawals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferQuoteToHedge', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateCBs', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateLiquidationInsolvency', data: BytesLike): Result; + + events: { + 'BaseFreed(uint256,uint256)': EventFragment; + 'BaseLocked(uint256,uint256)': EventFragment; + 'BasePurchased(uint256,uint256)': EventFragment; + 'BaseSold(uint256,uint256)': EventFragment; + 'BoardSettlement(uint256,uint256,uint256)': EventFragment; + 'BoardSettlementCircuitBreakerUpdated(uint256)': EventFragment; + 'CheckingCanProcess(uint256,bool,bool,bool,bool)': EventFragment; + 'CircuitBreakerUpdated(uint256,bool,bool,bool)': EventFragment; + 'DepositProcessed(address,address,uint256,uint256,uint256,uint256,uint256)': EventFragment; + 'DepositQueued(address,address,uint256,uint256,uint256,uint256)': EventFragment; + 'InsolventSettlementAmountUpdated(uint256,uint256)': EventFragment; + 'LiquidityPoolParametersUpdated(tuple)': EventFragment; + 'OutstandingSettlementSent(address,uint256,uint256)': EventFragment; + 'OwnerChanged(address,address)': EventFragment; + 'OwnerNominated(address)': EventFragment; + 'PoolHedgerUpdated(address)': EventFragment; + 'PremiumTransferred(address,uint256,uint256)': EventFragment; + 'QuoteFreed(uint256,uint256)': EventFragment; + 'QuoteLocked(uint256,uint256)': EventFragment; + 'QuoteTransferredToPoolHedger(uint256)': EventFragment; + 'WithdrawPartiallyProcessed(address,address,uint256,uint256,uint256,uint256,uint256,uint256)': EventFragment; + 'WithdrawProcessed(address,address,uint256,uint256,uint256,uint256,uint256,uint256)': EventFragment; + 'WithdrawQueued(address,address,uint256,uint256,uint256,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'BaseFreed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BaseLocked'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BasePurchased'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BaseSold'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BoardSettlement'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BoardSettlementCircuitBreakerUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'CheckingCanProcess'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'CircuitBreakerUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DepositProcessed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DepositQueued'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'InsolventSettlementAmountUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LiquidityPoolParametersUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OutstandingSettlementSent'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PoolHedgerUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PremiumTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'QuoteFreed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'QuoteLocked'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'QuoteTransferredToPoolHedger'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'WithdrawPartiallyProcessed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'WithdrawProcessed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'WithdrawQueued'): EventFragment; +} + +export interface BaseFreedEventObject { + baseFreed: BigNumber; + lockedCollateralBase: BigNumber; +} +export type BaseFreedEvent = TypedEvent<[BigNumber, BigNumber], BaseFreedEventObject>; + +export type BaseFreedEventFilter = TypedEventFilter; + +export interface BaseLockedEventObject { + baseLocked: BigNumber; + lockedCollateralBase: BigNumber; +} +export type BaseLockedEvent = TypedEvent<[BigNumber, BigNumber], BaseLockedEventObject>; + +export type BaseLockedEventFilter = TypedEventFilter; + +export interface BasePurchasedEventObject { + quoteSpent: BigNumber; + baseReceived: BigNumber; +} +export type BasePurchasedEvent = TypedEvent<[BigNumber, BigNumber], BasePurchasedEventObject>; + +export type BasePurchasedEventFilter = TypedEventFilter; + +export interface BaseSoldEventObject { + amountBase: BigNumber; + quoteReceived: BigNumber; +} +export type BaseSoldEvent = TypedEvent<[BigNumber, BigNumber], BaseSoldEventObject>; + +export type BaseSoldEventFilter = TypedEventFilter; + +export interface BoardSettlementEventObject { + insolventSettlementAmount: BigNumber; + amountQuoteReserved: BigNumber; + totalOutstandingSettlements: BigNumber; +} +export type BoardSettlementEvent = TypedEvent<[BigNumber, BigNumber, BigNumber], BoardSettlementEventObject>; + +export type BoardSettlementEventFilter = TypedEventFilter; + +export interface BoardSettlementCircuitBreakerUpdatedEventObject { + newTimestamp: BigNumber; +} +export type BoardSettlementCircuitBreakerUpdatedEvent = TypedEvent< + [BigNumber], + BoardSettlementCircuitBreakerUpdatedEventObject +>; + +export type BoardSettlementCircuitBreakerUpdatedEventFilter = + TypedEventFilter; + +export interface CheckingCanProcessEventObject { + entryId: BigNumber; + boardNotStale: boolean; + validEntry: boolean; + guardianBypass: boolean; + delaysExpired: boolean; +} +export type CheckingCanProcessEvent = TypedEvent< + [BigNumber, boolean, boolean, boolean, boolean], + CheckingCanProcessEventObject +>; + +export type CheckingCanProcessEventFilter = TypedEventFilter; + +export interface CircuitBreakerUpdatedEventObject { + newTimestamp: BigNumber; + ivVarianceThresholdCrossed: boolean; + skewVarianceThresholdCrossed: boolean; + liquidityThresholdCrossed: boolean; +} +export type CircuitBreakerUpdatedEvent = TypedEvent< + [BigNumber, boolean, boolean, boolean], + CircuitBreakerUpdatedEventObject +>; + +export type CircuitBreakerUpdatedEventFilter = TypedEventFilter; + +export interface DepositProcessedEventObject { + caller: string; + beneficiary: string; + depositQueueId: BigNumber; + amountDeposited: BigNumber; + tokenPrice: BigNumber; + tokensReceived: BigNumber; + timestamp: BigNumber; +} +export type DepositProcessedEvent = TypedEvent< + [string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], + DepositProcessedEventObject +>; + +export type DepositProcessedEventFilter = TypedEventFilter; + +export interface DepositQueuedEventObject { + depositor: string; + beneficiary: string; + depositQueueId: BigNumber; + amountDeposited: BigNumber; + totalQueuedDeposits: BigNumber; + timestamp: BigNumber; +} +export type DepositQueuedEvent = TypedEvent< + [string, string, BigNumber, BigNumber, BigNumber, BigNumber], + DepositQueuedEventObject +>; + +export type DepositQueuedEventFilter = TypedEventFilter; + +export interface InsolventSettlementAmountUpdatedEventObject { + amountQuoteAdded: BigNumber; + totalInsolventSettlementAmount: BigNumber; +} +export type InsolventSettlementAmountUpdatedEvent = TypedEvent< + [BigNumber, BigNumber], + InsolventSettlementAmountUpdatedEventObject +>; + +export type InsolventSettlementAmountUpdatedEventFilter = TypedEventFilter; + +export interface LiquidityPoolParametersUpdatedEventObject { + lpParams: LiquidityPool.LiquidityPoolParametersStructOutput; +} +export type LiquidityPoolParametersUpdatedEvent = TypedEvent< + [LiquidityPool.LiquidityPoolParametersStructOutput], + LiquidityPoolParametersUpdatedEventObject +>; + +export type LiquidityPoolParametersUpdatedEventFilter = TypedEventFilter; + +export interface OutstandingSettlementSentEventObject { + user: string; + amount: BigNumber; + totalOutstandingSettlements: BigNumber; +} +export type OutstandingSettlementSentEvent = TypedEvent< + [string, BigNumber, BigNumber], + OutstandingSettlementSentEventObject +>; + +export type OutstandingSettlementSentEventFilter = TypedEventFilter; + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface PoolHedgerUpdatedEventObject { + poolHedger: string; +} +export type PoolHedgerUpdatedEvent = TypedEvent<[string], PoolHedgerUpdatedEventObject>; + +export type PoolHedgerUpdatedEventFilter = TypedEventFilter; + +export interface PremiumTransferredEventObject { + recipient: string; + recipientPortion: BigNumber; + optionMarketPortion: BigNumber; +} +export type PremiumTransferredEvent = TypedEvent<[string, BigNumber, BigNumber], PremiumTransferredEventObject>; + +export type PremiumTransferredEventFilter = TypedEventFilter; + +export interface QuoteFreedEventObject { + quoteFreed: BigNumber; + lockedCollateralQuote: BigNumber; +} +export type QuoteFreedEvent = TypedEvent<[BigNumber, BigNumber], QuoteFreedEventObject>; + +export type QuoteFreedEventFilter = TypedEventFilter; + +export interface QuoteLockedEventObject { + quoteLocked: BigNumber; + lockedCollateralQuote: BigNumber; +} +export type QuoteLockedEvent = TypedEvent<[BigNumber, BigNumber], QuoteLockedEventObject>; + +export type QuoteLockedEventFilter = TypedEventFilter; + +export interface QuoteTransferredToPoolHedgerEventObject { + amountQuote: BigNumber; +} +export type QuoteTransferredToPoolHedgerEvent = TypedEvent<[BigNumber], QuoteTransferredToPoolHedgerEventObject>; + +export type QuoteTransferredToPoolHedgerEventFilter = TypedEventFilter; + +export interface WithdrawPartiallyProcessedEventObject { + caller: string; + beneficiary: string; + withdrawalQueueId: BigNumber; + amountWithdrawn: BigNumber; + tokenPrice: BigNumber; + quoteReceived: BigNumber; + totalQueuedWithdrawals: BigNumber; + timestamp: BigNumber; +} +export type WithdrawPartiallyProcessedEvent = TypedEvent< + [string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], + WithdrawPartiallyProcessedEventObject +>; + +export type WithdrawPartiallyProcessedEventFilter = TypedEventFilter; + +export interface WithdrawProcessedEventObject { + caller: string; + beneficiary: string; + withdrawalQueueId: BigNumber; + amountWithdrawn: BigNumber; + tokenPrice: BigNumber; + quoteReceived: BigNumber; + totalQueuedWithdrawals: BigNumber; + timestamp: BigNumber; +} +export type WithdrawProcessedEvent = TypedEvent< + [string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], + WithdrawProcessedEventObject +>; + +export type WithdrawProcessedEventFilter = TypedEventFilter; + +export interface WithdrawQueuedEventObject { + withdrawer: string; + beneficiary: string; + withdrawalQueueId: BigNumber; + amountWithdrawn: BigNumber; + totalQueuedWithdrawals: BigNumber; + timestamp: BigNumber; +} +export type WithdrawQueuedEvent = TypedEvent< + [string, string, BigNumber, BigNumber, BigNumber, BigNumber], + WithdrawQueuedEventObject +>; + +export type WithdrawQueuedEventFilter = TypedEventFilter; + +export interface LiquidityPool extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: LiquidityPoolInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CBTimestamp(overrides?: CallOverrides): Promise<[BigNumber]>; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + boardSettlement( + insolventSettlements: BigNumberish, + amountQuoteFreed: BigNumberish, + amountQuoteReserved: BigNumberish, + amountBaseFreed: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + exchangeBase(overrides?: Overrides & { from?: string | Promise }): Promise; + + freeQuoteCollateralAndSendPremium( + amountQuoteFreed: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getLiquidity( + basePrice: BigNumberish, + short: string, + overrides?: CallOverrides, + ): Promise<[LiquidityPool.LiquidityStructOutput]>; + + getLiquidityParams(overrides?: CallOverrides): Promise<[LiquidityPool.LiquidityStructOutput]>; + + getLpParams(overrides?: CallOverrides): Promise<[LiquidityPool.LiquidityPoolParametersStructOutput]>; + + getTokenPrice(overrides?: CallOverrides): Promise<[BigNumber]>; + + getTotalPoolValueQuote(overrides?: CallOverrides): Promise<[BigNumber]>; + + getTotalTokenSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + init( + _synthetixAdapter: string, + _optionMarket: string, + _liquidityTokens: string, + _greekCache: string, + _poolHedger: string, + _shortCollateral: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateDeposit( + beneficiary: string, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateWithdraw( + beneficiary: string, + amountLiquidityTokens: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + insolventSettlementAmount(overrides?: CallOverrides): Promise<[BigNumber]>; + + liquidateBaseAndSendPremium( + amountBase: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidationInsolventAmount(overrides?: CallOverrides): Promise<[BigNumber]>; + + lockBase( + amount: BigNumberish, + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockQuote( + amount: BigNumberish, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockedCollateral( + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { quote: BigNumber; base: BigNumber }>; + + lpParams(overrides?: CallOverrides): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + ] & { + minDepositWithdraw: BigNumber; + depositDelay: BigNumber; + withdrawalDelay: BigNumber; + withdrawalFee: BigNumber; + liquidityCBThreshold: BigNumber; + liquidityCBTimeout: BigNumber; + ivVarianceCBThreshold: BigNumber; + skewVarianceCBThreshold: BigNumber; + ivVarianceCBTimeout: BigNumber; + skewVarianceCBTimeout: BigNumber; + guardianMultisig: string; + guardianDelay: BigNumber; + boardSettlementCBTimeout: BigNumber; + maxFeePaid: BigNumber; + } + >; + + nextQueuedDepositId(overrides?: CallOverrides): Promise<[BigNumber]>; + + nextQueuedWithdrawalId(overrides?: CallOverrides): Promise<[BigNumber]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + poolHedger(overrides?: CallOverrides): Promise<[string]>; + + processDepositQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + processWithdrawalQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queuedDepositHead(overrides?: CallOverrides): Promise<[BigNumber]>; + + queuedDeposits( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + beneficiary: string; + amountLiquidity: BigNumber; + mintedTokens: BigNumber; + depositInitiatedTime: BigNumber; + } + >; + + queuedWithdrawalHead(overrides?: CallOverrides): Promise<[BigNumber]>; + + queuedWithdrawals( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + beneficiary: string; + amountTokens: BigNumber; + quoteSent: BigNumber; + withdrawInitiatedTime: BigNumber; + } + >; + + reclaimInsolventBase( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountBase: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + reclaimInsolventQuote( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendSettlementValue( + user: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendShortPremium( + recipient: string, + premium: BigNumberish, + freeLiquidity: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setLiquidityPoolParameters( + _lpParams: LiquidityPool.LiquidityPoolParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPoolHedger( + newPoolHedger: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + totalOutstandingSettlements(overrides?: CallOverrides): Promise<[BigNumber]>; + + totalQueuedDeposits(overrides?: CallOverrides): Promise<[BigNumber]>; + + totalQueuedWithdrawals(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferQuoteToHedge( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateCBs(overrides?: Overrides & { from?: string | Promise }): Promise; + + updateLiquidationInsolvency( + insolvencyAmountInQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + CBTimestamp(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + boardSettlement( + insolventSettlements: BigNumberish, + amountQuoteFreed: BigNumberish, + amountQuoteReserved: BigNumberish, + amountBaseFreed: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + exchangeBase(overrides?: Overrides & { from?: string | Promise }): Promise; + + freeQuoteCollateralAndSendPremium( + amountQuoteFreed: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getLiquidity( + basePrice: BigNumberish, + short: string, + overrides?: CallOverrides, + ): Promise; + + getLiquidityParams(overrides?: CallOverrides): Promise; + + getLpParams(overrides?: CallOverrides): Promise; + + getTokenPrice(overrides?: CallOverrides): Promise; + + getTotalPoolValueQuote(overrides?: CallOverrides): Promise; + + getTotalTokenSupply(overrides?: CallOverrides): Promise; + + init( + _synthetixAdapter: string, + _optionMarket: string, + _liquidityTokens: string, + _greekCache: string, + _poolHedger: string, + _shortCollateral: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateDeposit( + beneficiary: string, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateWithdraw( + beneficiary: string, + amountLiquidityTokens: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + insolventSettlementAmount(overrides?: CallOverrides): Promise; + + liquidateBaseAndSendPremium( + amountBase: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidationInsolventAmount(overrides?: CallOverrides): Promise; + + lockBase( + amount: BigNumberish, + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockQuote( + amount: BigNumberish, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockedCollateral(overrides?: CallOverrides): Promise<[BigNumber, BigNumber] & { quote: BigNumber; base: BigNumber }>; + + lpParams(overrides?: CallOverrides): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + ] & { + minDepositWithdraw: BigNumber; + depositDelay: BigNumber; + withdrawalDelay: BigNumber; + withdrawalFee: BigNumber; + liquidityCBThreshold: BigNumber; + liquidityCBTimeout: BigNumber; + ivVarianceCBThreshold: BigNumber; + skewVarianceCBThreshold: BigNumber; + ivVarianceCBTimeout: BigNumber; + skewVarianceCBTimeout: BigNumber; + guardianMultisig: string; + guardianDelay: BigNumber; + boardSettlementCBTimeout: BigNumber; + maxFeePaid: BigNumber; + } + >; + + nextQueuedDepositId(overrides?: CallOverrides): Promise; + + nextQueuedWithdrawalId(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + poolHedger(overrides?: CallOverrides): Promise; + + processDepositQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + processWithdrawalQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queuedDepositHead(overrides?: CallOverrides): Promise; + + queuedDeposits( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + beneficiary: string; + amountLiquidity: BigNumber; + mintedTokens: BigNumber; + depositInitiatedTime: BigNumber; + } + >; + + queuedWithdrawalHead(overrides?: CallOverrides): Promise; + + queuedWithdrawals( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + beneficiary: string; + amountTokens: BigNumber; + quoteSent: BigNumber; + withdrawInitiatedTime: BigNumber; + } + >; + + reclaimInsolventBase( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountBase: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + reclaimInsolventQuote( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendSettlementValue( + user: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendShortPremium( + recipient: string, + premium: BigNumberish, + freeLiquidity: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setLiquidityPoolParameters( + _lpParams: LiquidityPool.LiquidityPoolParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPoolHedger( + newPoolHedger: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + totalOutstandingSettlements(overrides?: CallOverrides): Promise; + + totalQueuedDeposits(overrides?: CallOverrides): Promise; + + totalQueuedWithdrawals(overrides?: CallOverrides): Promise; + + transferQuoteToHedge( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateCBs(overrides?: Overrides & { from?: string | Promise }): Promise; + + updateLiquidationInsolvency( + insolvencyAmountInQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + CBTimestamp(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + boardSettlement( + insolventSettlements: BigNumberish, + amountQuoteFreed: BigNumberish, + amountQuoteReserved: BigNumberish, + amountBaseFreed: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + exchangeBase(overrides?: CallOverrides): Promise; + + freeQuoteCollateralAndSendPremium( + amountQuoteFreed: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getLiquidity( + basePrice: BigNumberish, + short: string, + overrides?: CallOverrides, + ): Promise; + + getLiquidityParams(overrides?: CallOverrides): Promise; + + getLpParams(overrides?: CallOverrides): Promise; + + getTokenPrice(overrides?: CallOverrides): Promise; + + getTotalPoolValueQuote(overrides?: CallOverrides): Promise; + + getTotalTokenSupply(overrides?: CallOverrides): Promise; + + init( + _synthetixAdapter: string, + _optionMarket: string, + _liquidityTokens: string, + _greekCache: string, + _poolHedger: string, + _shortCollateral: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: CallOverrides, + ): Promise; + + initiateDeposit(beneficiary: string, amountQuote: BigNumberish, overrides?: CallOverrides): Promise; + + initiateWithdraw( + beneficiary: string, + amountLiquidityTokens: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + insolventSettlementAmount(overrides?: CallOverrides): Promise; + + liquidateBaseAndSendPremium( + amountBase: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + liquidationInsolventAmount(overrides?: CallOverrides): Promise; + + lockBase( + amount: BigNumberish, + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + freeLiquidity: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + lockQuote(amount: BigNumberish, freeLiquidity: BigNumberish, overrides?: CallOverrides): Promise; + + lockedCollateral( + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { quote: BigNumber; base: BigNumber }>; + + lpParams(overrides?: CallOverrides): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + ] & { + minDepositWithdraw: BigNumber; + depositDelay: BigNumber; + withdrawalDelay: BigNumber; + withdrawalFee: BigNumber; + liquidityCBThreshold: BigNumber; + liquidityCBTimeout: BigNumber; + ivVarianceCBThreshold: BigNumber; + skewVarianceCBThreshold: BigNumber; + ivVarianceCBTimeout: BigNumber; + skewVarianceCBTimeout: BigNumber; + guardianMultisig: string; + guardianDelay: BigNumber; + boardSettlementCBTimeout: BigNumber; + maxFeePaid: BigNumber; + } + >; + + nextQueuedDepositId(overrides?: CallOverrides): Promise; + + nextQueuedWithdrawalId(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + poolHedger(overrides?: CallOverrides): Promise; + + processDepositQueue(limit: BigNumberish, overrides?: CallOverrides): Promise; + + processWithdrawalQueue(limit: BigNumberish, overrides?: CallOverrides): Promise; + + queuedDepositHead(overrides?: CallOverrides): Promise; + + queuedDeposits( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + beneficiary: string; + amountLiquidity: BigNumber; + mintedTokens: BigNumber; + depositInitiatedTime: BigNumber; + } + >; + + queuedWithdrawalHead(overrides?: CallOverrides): Promise; + + queuedWithdrawals( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + beneficiary: string; + amountTokens: BigNumber; + quoteSent: BigNumber; + withdrawInitiatedTime: BigNumber; + } + >; + + reclaimInsolventBase( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountBase: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + reclaimInsolventQuote( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountQuote: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + sendSettlementValue(user: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + sendShortPremium( + recipient: string, + premium: BigNumberish, + freeLiquidity: BigNumberish, + reservedFee: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + setLiquidityPoolParameters( + _lpParams: LiquidityPool.LiquidityPoolParametersStruct, + overrides?: CallOverrides, + ): Promise; + + setPoolHedger(newPoolHedger: string, overrides?: CallOverrides): Promise; + + totalOutstandingSettlements(overrides?: CallOverrides): Promise; + + totalQueuedDeposits(overrides?: CallOverrides): Promise; + + totalQueuedWithdrawals(overrides?: CallOverrides): Promise; + + transferQuoteToHedge( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + updateCBs(overrides?: CallOverrides): Promise; + + updateLiquidationInsolvency(insolvencyAmountInQuote: BigNumberish, overrides?: CallOverrides): Promise; + }; + + filters: { + 'BaseFreed(uint256,uint256)'(baseFreed?: null, lockedCollateralBase?: null): BaseFreedEventFilter; + BaseFreed(baseFreed?: null, lockedCollateralBase?: null): BaseFreedEventFilter; + + 'BaseLocked(uint256,uint256)'(baseLocked?: null, lockedCollateralBase?: null): BaseLockedEventFilter; + BaseLocked(baseLocked?: null, lockedCollateralBase?: null): BaseLockedEventFilter; + + 'BasePurchased(uint256,uint256)'(quoteSpent?: null, baseReceived?: null): BasePurchasedEventFilter; + BasePurchased(quoteSpent?: null, baseReceived?: null): BasePurchasedEventFilter; + + 'BaseSold(uint256,uint256)'(amountBase?: null, quoteReceived?: null): BaseSoldEventFilter; + BaseSold(amountBase?: null, quoteReceived?: null): BaseSoldEventFilter; + + 'BoardSettlement(uint256,uint256,uint256)'( + insolventSettlementAmount?: null, + amountQuoteReserved?: null, + totalOutstandingSettlements?: null, + ): BoardSettlementEventFilter; + BoardSettlement( + insolventSettlementAmount?: null, + amountQuoteReserved?: null, + totalOutstandingSettlements?: null, + ): BoardSettlementEventFilter; + + 'BoardSettlementCircuitBreakerUpdated(uint256)'( + newTimestamp?: null, + ): BoardSettlementCircuitBreakerUpdatedEventFilter; + BoardSettlementCircuitBreakerUpdated(newTimestamp?: null): BoardSettlementCircuitBreakerUpdatedEventFilter; + + 'CheckingCanProcess(uint256,bool,bool,bool,bool)'( + entryId?: null, + boardNotStale?: null, + validEntry?: null, + guardianBypass?: null, + delaysExpired?: null, + ): CheckingCanProcessEventFilter; + CheckingCanProcess( + entryId?: null, + boardNotStale?: null, + validEntry?: null, + guardianBypass?: null, + delaysExpired?: null, + ): CheckingCanProcessEventFilter; + + 'CircuitBreakerUpdated(uint256,bool,bool,bool)'( + newTimestamp?: null, + ivVarianceThresholdCrossed?: null, + skewVarianceThresholdCrossed?: null, + liquidityThresholdCrossed?: null, + ): CircuitBreakerUpdatedEventFilter; + CircuitBreakerUpdated( + newTimestamp?: null, + ivVarianceThresholdCrossed?: null, + skewVarianceThresholdCrossed?: null, + liquidityThresholdCrossed?: null, + ): CircuitBreakerUpdatedEventFilter; + + 'DepositProcessed(address,address,uint256,uint256,uint256,uint256,uint256)'( + caller?: string | null, + beneficiary?: string | null, + depositQueueId?: BigNumberish | null, + amountDeposited?: null, + tokenPrice?: null, + tokensReceived?: null, + timestamp?: null, + ): DepositProcessedEventFilter; + DepositProcessed( + caller?: string | null, + beneficiary?: string | null, + depositQueueId?: BigNumberish | null, + amountDeposited?: null, + tokenPrice?: null, + tokensReceived?: null, + timestamp?: null, + ): DepositProcessedEventFilter; + + 'DepositQueued(address,address,uint256,uint256,uint256,uint256)'( + depositor?: string | null, + beneficiary?: string | null, + depositQueueId?: BigNumberish | null, + amountDeposited?: null, + totalQueuedDeposits?: null, + timestamp?: null, + ): DepositQueuedEventFilter; + DepositQueued( + depositor?: string | null, + beneficiary?: string | null, + depositQueueId?: BigNumberish | null, + amountDeposited?: null, + totalQueuedDeposits?: null, + timestamp?: null, + ): DepositQueuedEventFilter; + + 'InsolventSettlementAmountUpdated(uint256,uint256)'( + amountQuoteAdded?: null, + totalInsolventSettlementAmount?: null, + ): InsolventSettlementAmountUpdatedEventFilter; + InsolventSettlementAmountUpdated( + amountQuoteAdded?: null, + totalInsolventSettlementAmount?: null, + ): InsolventSettlementAmountUpdatedEventFilter; + + 'LiquidityPoolParametersUpdated(tuple)'(lpParams?: null): LiquidityPoolParametersUpdatedEventFilter; + LiquidityPoolParametersUpdated(lpParams?: null): LiquidityPoolParametersUpdatedEventFilter; + + 'OutstandingSettlementSent(address,uint256,uint256)'( + user?: string | null, + amount?: null, + totalOutstandingSettlements?: null, + ): OutstandingSettlementSentEventFilter; + OutstandingSettlementSent( + user?: string | null, + amount?: null, + totalOutstandingSettlements?: null, + ): OutstandingSettlementSentEventFilter; + + 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + 'PoolHedgerUpdated(address)'(poolHedger?: null): PoolHedgerUpdatedEventFilter; + PoolHedgerUpdated(poolHedger?: null): PoolHedgerUpdatedEventFilter; + + 'PremiumTransferred(address,uint256,uint256)'( + recipient?: string | null, + recipientPortion?: null, + optionMarketPortion?: null, + ): PremiumTransferredEventFilter; + PremiumTransferred( + recipient?: string | null, + recipientPortion?: null, + optionMarketPortion?: null, + ): PremiumTransferredEventFilter; + + 'QuoteFreed(uint256,uint256)'(quoteFreed?: null, lockedCollateralQuote?: null): QuoteFreedEventFilter; + QuoteFreed(quoteFreed?: null, lockedCollateralQuote?: null): QuoteFreedEventFilter; + + 'QuoteLocked(uint256,uint256)'(quoteLocked?: null, lockedCollateralQuote?: null): QuoteLockedEventFilter; + QuoteLocked(quoteLocked?: null, lockedCollateralQuote?: null): QuoteLockedEventFilter; + + 'QuoteTransferredToPoolHedger(uint256)'(amountQuote?: null): QuoteTransferredToPoolHedgerEventFilter; + QuoteTransferredToPoolHedger(amountQuote?: null): QuoteTransferredToPoolHedgerEventFilter; + + 'WithdrawPartiallyProcessed(address,address,uint256,uint256,uint256,uint256,uint256,uint256)'( + caller?: string | null, + beneficiary?: string | null, + withdrawalQueueId?: BigNumberish | null, + amountWithdrawn?: null, + tokenPrice?: null, + quoteReceived?: null, + totalQueuedWithdrawals?: null, + timestamp?: null, + ): WithdrawPartiallyProcessedEventFilter; + WithdrawPartiallyProcessed( + caller?: string | null, + beneficiary?: string | null, + withdrawalQueueId?: BigNumberish | null, + amountWithdrawn?: null, + tokenPrice?: null, + quoteReceived?: null, + totalQueuedWithdrawals?: null, + timestamp?: null, + ): WithdrawPartiallyProcessedEventFilter; + + 'WithdrawProcessed(address,address,uint256,uint256,uint256,uint256,uint256,uint256)'( + caller?: string | null, + beneficiary?: string | null, + withdrawalQueueId?: BigNumberish | null, + amountWithdrawn?: null, + tokenPrice?: null, + quoteReceived?: null, + totalQueuedWithdrawals?: null, + timestamp?: null, + ): WithdrawProcessedEventFilter; + WithdrawProcessed( + caller?: string | null, + beneficiary?: string | null, + withdrawalQueueId?: BigNumberish | null, + amountWithdrawn?: null, + tokenPrice?: null, + quoteReceived?: null, + totalQueuedWithdrawals?: null, + timestamp?: null, + ): WithdrawProcessedEventFilter; + + 'WithdrawQueued(address,address,uint256,uint256,uint256,uint256)'( + withdrawer?: string | null, + beneficiary?: string | null, + withdrawalQueueId?: BigNumberish | null, + amountWithdrawn?: null, + totalQueuedWithdrawals?: null, + timestamp?: null, + ): WithdrawQueuedEventFilter; + WithdrawQueued( + withdrawer?: string | null, + beneficiary?: string | null, + withdrawalQueueId?: BigNumberish | null, + amountWithdrawn?: null, + totalQueuedWithdrawals?: null, + timestamp?: null, + ): WithdrawQueuedEventFilter; + }; + + estimateGas: { + CBTimestamp(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + boardSettlement( + insolventSettlements: BigNumberish, + amountQuoteFreed: BigNumberish, + amountQuoteReserved: BigNumberish, + amountBaseFreed: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + exchangeBase(overrides?: Overrides & { from?: string | Promise }): Promise; + + freeQuoteCollateralAndSendPremium( + amountQuoteFreed: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getLiquidity(basePrice: BigNumberish, short: string, overrides?: CallOverrides): Promise; + + getLiquidityParams(overrides?: CallOverrides): Promise; + + getLpParams(overrides?: CallOverrides): Promise; + + getTokenPrice(overrides?: CallOverrides): Promise; + + getTotalPoolValueQuote(overrides?: CallOverrides): Promise; + + getTotalTokenSupply(overrides?: CallOverrides): Promise; + + init( + _synthetixAdapter: string, + _optionMarket: string, + _liquidityTokens: string, + _greekCache: string, + _poolHedger: string, + _shortCollateral: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateDeposit( + beneficiary: string, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateWithdraw( + beneficiary: string, + amountLiquidityTokens: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + insolventSettlementAmount(overrides?: CallOverrides): Promise; + + liquidateBaseAndSendPremium( + amountBase: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidationInsolventAmount(overrides?: CallOverrides): Promise; + + lockBase( + amount: BigNumberish, + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockQuote( + amount: BigNumberish, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockedCollateral(overrides?: CallOverrides): Promise; + + lpParams(overrides?: CallOverrides): Promise; + + nextQueuedDepositId(overrides?: CallOverrides): Promise; + + nextQueuedWithdrawalId(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + poolHedger(overrides?: CallOverrides): Promise; + + processDepositQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + processWithdrawalQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queuedDepositHead(overrides?: CallOverrides): Promise; + + queuedDeposits(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + queuedWithdrawalHead(overrides?: CallOverrides): Promise; + + queuedWithdrawals(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + reclaimInsolventBase( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountBase: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + reclaimInsolventQuote( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendSettlementValue( + user: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendShortPremium( + recipient: string, + premium: BigNumberish, + freeLiquidity: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setLiquidityPoolParameters( + _lpParams: LiquidityPool.LiquidityPoolParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPoolHedger( + newPoolHedger: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + totalOutstandingSettlements(overrides?: CallOverrides): Promise; + + totalQueuedDeposits(overrides?: CallOverrides): Promise; + + totalQueuedWithdrawals(overrides?: CallOverrides): Promise; + + transferQuoteToHedge( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateCBs(overrides?: Overrides & { from?: string | Promise }): Promise; + + updateLiquidationInsolvency( + insolvencyAmountInQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + CBTimestamp(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + boardSettlement( + insolventSettlements: BigNumberish, + amountQuoteFreed: BigNumberish, + amountQuoteReserved: BigNumberish, + amountBaseFreed: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + exchangeBase(overrides?: Overrides & { from?: string | Promise }): Promise; + + freeQuoteCollateralAndSendPremium( + amountQuoteFreed: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getLiquidity(basePrice: BigNumberish, short: string, overrides?: CallOverrides): Promise; + + getLiquidityParams(overrides?: CallOverrides): Promise; + + getLpParams(overrides?: CallOverrides): Promise; + + getTokenPrice(overrides?: CallOverrides): Promise; + + getTotalPoolValueQuote(overrides?: CallOverrides): Promise; + + getTotalTokenSupply(overrides?: CallOverrides): Promise; + + init( + _synthetixAdapter: string, + _optionMarket: string, + _liquidityTokens: string, + _greekCache: string, + _poolHedger: string, + _shortCollateral: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateDeposit( + beneficiary: string, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initiateWithdraw( + beneficiary: string, + amountLiquidityTokens: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + insolventSettlementAmount(overrides?: CallOverrides): Promise; + + liquidateBaseAndSendPremium( + amountBase: BigNumberish, + recipient: string, + totalCost: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidationInsolventAmount(overrides?: CallOverrides): Promise; + + lockBase( + amount: BigNumberish, + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockQuote( + amount: BigNumberish, + freeLiquidity: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lockedCollateral(overrides?: CallOverrides): Promise; + + lpParams(overrides?: CallOverrides): Promise; + + nextQueuedDepositId(overrides?: CallOverrides): Promise; + + nextQueuedWithdrawalId(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + poolHedger(overrides?: CallOverrides): Promise; + + processDepositQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + processWithdrawalQueue( + limit: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queuedDepositHead(overrides?: CallOverrides): Promise; + + queuedDeposits(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + queuedWithdrawalHead(overrides?: CallOverrides): Promise; + + queuedWithdrawals(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + reclaimInsolventBase( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountBase: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + reclaimInsolventQuote( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amountQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendSettlementValue( + user: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + sendShortPremium( + recipient: string, + premium: BigNumberish, + freeLiquidity: BigNumberish, + reservedFee: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setLiquidityPoolParameters( + _lpParams: LiquidityPool.LiquidityPoolParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPoolHedger( + newPoolHedger: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + totalOutstandingSettlements(overrides?: CallOverrides): Promise; + + totalQueuedDeposits(overrides?: CallOverrides): Promise; + + totalQueuedWithdrawals(overrides?: CallOverrides): Promise; + + transferQuoteToHedge( + exchangeParams: SynthetixAdapter.ExchangeParamsStruct, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateCBs(overrides?: Overrides & { from?: string | Promise }): Promise; + + updateLiquidationInsolvency( + insolvencyAmountInQuote: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/lyra-avalon/contracts/ethers/LiquidityToken.ts b/src/apps/lyra-avalon/contracts/ethers/LiquidityToken.ts new file mode 100644 index 000000000..94ed9b4d3 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/LiquidityToken.ts @@ -0,0 +1,563 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export interface LiquidityTokenInterface extends utils.Interface { + functions: { + 'acceptOwnership()': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'burn(address,uint256)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'init(address)': FunctionFragment; + 'liquidityPool()': FunctionFragment; + 'liquidityTracker()': FunctionFragment; + 'mint(address,uint256)': FunctionFragment; + 'name()': FunctionFragment; + 'nominateNewOwner(address)': FunctionFragment; + 'nominatedOwner()': FunctionFragment; + 'owner()': FunctionFragment; + 'setLiquidityTracker(address)': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'acceptOwnership' + | 'allowance' + | 'approve' + | 'balanceOf' + | 'burn' + | 'decimals' + | 'decreaseAllowance' + | 'increaseAllowance' + | 'init' + | 'liquidityPool' + | 'liquidityTracker' + | 'mint' + | 'name' + | 'nominateNewOwner' + | 'nominatedOwner' + | 'owner' + | 'setLiquidityTracker' + | 'symbol' + | 'totalSupply' + | 'transfer' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'allowance', values: [string, string]): string; + encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'burn', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'decreaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'increaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'init', values: [string]): string; + encodeFunctionData(functionFragment: 'liquidityPool', values?: undefined): string; + encodeFunctionData(functionFragment: 'liquidityTracker', values?: undefined): string; + encodeFunctionData(functionFragment: 'mint', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'nominateNewOwner', values: [string]): string; + encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'setLiquidityTracker', values: [string]): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData(functionFragment: 'transfer', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; + + decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'init', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'liquidityPool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'liquidityTracker', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setLiquidityTracker', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'OwnerChanged(address,address)': EventFragment; + 'OwnerNominated(address)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface LiquidityToken extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: LiquidityTokenInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + init( + _liquidityPool: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidityPool(overrides?: CallOverrides): Promise<[string]>; + + liquidityTracker(overrides?: CallOverrides): Promise<[string]>; + + mint( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + setLiquidityTracker( + _liquidityTracker: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + init( + _liquidityPool: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidityPool(overrides?: CallOverrides): Promise; + + liquidityTracker(overrides?: CallOverrides): Promise; + + mint( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setLiquidityTracker( + _liquidityTracker: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve(spender: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn(owner: string, tokenAmount: BigNumberish, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance(spender: string, subtractedValue: BigNumberish, overrides?: CallOverrides): Promise; + + increaseAllowance(spender: string, addedValue: BigNumberish, overrides?: CallOverrides): Promise; + + init(_liquidityPool: string, overrides?: CallOverrides): Promise; + + liquidityPool(overrides?: CallOverrides): Promise; + + liquidityTracker(overrides?: CallOverrides): Promise; + + mint(owner: string, tokenAmount: BigNumberish, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setLiquidityTracker(_liquidityTracker: string, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer(recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + transferFrom(sender: string, recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + Approval(owner?: string | null, spender?: string | null, value?: null): ApprovalEventFilter; + + 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + 'Transfer(address,address,uint256)'(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + Transfer(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + }; + + estimateGas: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + init(_liquidityPool: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + liquidityPool(overrides?: CallOverrides): Promise; + + liquidityTracker(overrides?: CallOverrides): Promise; + + mint( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setLiquidityTracker( + _liquidityTracker: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + init( + _liquidityPool: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidityPool(overrides?: CallOverrides): Promise; + + liquidityTracker(overrides?: CallOverrides): Promise; + + mint( + owner: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setLiquidityTracker( + _liquidityTracker: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/lyra-avalon/contracts/ethers/LyraRegistry.ts b/src/apps/lyra-avalon/contracts/ethers/LyraRegistry.ts new file mode 100644 index 000000000..e00a7e3c1 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/LyraRegistry.ts @@ -0,0 +1,405 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export declare namespace LyraRegistry { + export type OptionMarketAddressesStruct = { + liquidityPool: string; + liquidityTokens: string; + greekCache: string; + optionMarket: string; + optionMarketPricer: string; + optionToken: string; + poolHedger: string; + shortCollateral: string; + quoteAsset: string; + baseAsset: string; + }; + + export type OptionMarketAddressesStructOutput = [ + string, + string, + string, + string, + string, + string, + string, + string, + string, + string, + ] & { + liquidityPool: string; + liquidityTokens: string; + greekCache: string; + optionMarket: string; + optionMarketPricer: string; + optionToken: string; + poolHedger: string; + shortCollateral: string; + quoteAsset: string; + baseAsset: string; + }; +} + +export interface LyraRegistryInterface extends utils.Interface { + functions: { + 'acceptOwnership()': FunctionFragment; + 'addMarket((address,address,address,address,address,address,address,address,address,address))': FunctionFragment; + 'globalAddresses(bytes32)': FunctionFragment; + 'marketAddresses(address)': FunctionFragment; + 'nominateNewOwner(address)': FunctionFragment; + 'nominatedOwner()': FunctionFragment; + 'optionMarkets(uint256)': FunctionFragment; + 'owner()': FunctionFragment; + 'removeMarket(address)': FunctionFragment; + 'updateGlobalAddresses(bytes32[],address[])': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'acceptOwnership' + | 'addMarket' + | 'globalAddresses' + | 'marketAddresses' + | 'nominateNewOwner' + | 'nominatedOwner' + | 'optionMarkets' + | 'owner' + | 'removeMarket' + | 'updateGlobalAddresses', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'addMarket', values: [LyraRegistry.OptionMarketAddressesStruct]): string; + encodeFunctionData(functionFragment: 'globalAddresses', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'marketAddresses', values: [string]): string; + encodeFunctionData(functionFragment: 'nominateNewOwner', values: [string]): string; + encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string; + encodeFunctionData(functionFragment: 'optionMarkets', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'removeMarket', values: [string]): string; + encodeFunctionData(functionFragment: 'updateGlobalAddresses', values: [BytesLike[], string[]]): string; + + decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addMarket', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'globalAddresses', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'marketAddresses', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'optionMarkets', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'removeMarket', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateGlobalAddresses', data: BytesLike): Result; + + events: { + 'GlobalAddressUpdated(bytes32,address)': EventFragment; + 'MarketRemoved(address)': EventFragment; + 'MarketUpdated(address,tuple)': EventFragment; + 'OwnerChanged(address,address)': EventFragment; + 'OwnerNominated(address)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'GlobalAddressUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'MarketRemoved'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'MarketUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment; +} + +export interface GlobalAddressUpdatedEventObject { + name: string; + addr: string; +} +export type GlobalAddressUpdatedEvent = TypedEvent<[string, string], GlobalAddressUpdatedEventObject>; + +export type GlobalAddressUpdatedEventFilter = TypedEventFilter; + +export interface MarketRemovedEventObject { + market: string; +} +export type MarketRemovedEvent = TypedEvent<[string], MarketRemovedEventObject>; + +export type MarketRemovedEventFilter = TypedEventFilter; + +export interface MarketUpdatedEventObject { + optionMarket: string; + market: LyraRegistry.OptionMarketAddressesStructOutput; +} +export type MarketUpdatedEvent = TypedEvent< + [string, LyraRegistry.OptionMarketAddressesStructOutput], + MarketUpdatedEventObject +>; + +export type MarketUpdatedEventFilter = TypedEventFilter; + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface LyraRegistry extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: LyraRegistryInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addMarket( + newMarketAddresses: LyraRegistry.OptionMarketAddressesStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + globalAddresses(arg0: BytesLike, overrides?: CallOverrides): Promise<[string]>; + + marketAddresses( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [string, string, string, string, string, string, string, string, string, string] & { + liquidityPool: string; + liquidityTokens: string; + greekCache: string; + optionMarket: string; + optionMarketPricer: string; + optionToken: string; + poolHedger: string; + shortCollateral: string; + quoteAsset: string; + baseAsset: string; + } + >; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + optionMarkets(arg0: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + removeMarket( + market: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateGlobalAddresses( + names: BytesLike[], + addresses: string[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addMarket( + newMarketAddresses: LyraRegistry.OptionMarketAddressesStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + globalAddresses(arg0: BytesLike, overrides?: CallOverrides): Promise; + + marketAddresses( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [string, string, string, string, string, string, string, string, string, string] & { + liquidityPool: string; + liquidityTokens: string; + greekCache: string; + optionMarket: string; + optionMarketPricer: string; + optionToken: string; + poolHedger: string; + shortCollateral: string; + quoteAsset: string; + baseAsset: string; + } + >; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + optionMarkets(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeMarket( + market: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateGlobalAddresses( + names: BytesLike[], + addresses: string[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + addMarket(newMarketAddresses: LyraRegistry.OptionMarketAddressesStruct, overrides?: CallOverrides): Promise; + + globalAddresses(arg0: BytesLike, overrides?: CallOverrides): Promise; + + marketAddresses( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [string, string, string, string, string, string, string, string, string, string] & { + liquidityPool: string; + liquidityTokens: string; + greekCache: string; + optionMarket: string; + optionMarketPricer: string; + optionToken: string; + poolHedger: string; + shortCollateral: string; + quoteAsset: string; + baseAsset: string; + } + >; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + optionMarkets(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeMarket(market: string, overrides?: CallOverrides): Promise; + + updateGlobalAddresses(names: BytesLike[], addresses: string[], overrides?: CallOverrides): Promise; + }; + + filters: { + 'GlobalAddressUpdated(bytes32,address)'(name?: BytesLike | null, addr?: null): GlobalAddressUpdatedEventFilter; + GlobalAddressUpdated(name?: BytesLike | null, addr?: null): GlobalAddressUpdatedEventFilter; + + 'MarketRemoved(address)'(market?: string | null): MarketRemovedEventFilter; + MarketRemoved(market?: string | null): MarketRemovedEventFilter; + + 'MarketUpdated(address,tuple)'(optionMarket?: string | null, market?: null): MarketUpdatedEventFilter; + MarketUpdated(optionMarket?: string | null, market?: null): MarketUpdatedEventFilter; + + 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + }; + + estimateGas: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addMarket( + newMarketAddresses: LyraRegistry.OptionMarketAddressesStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + globalAddresses(arg0: BytesLike, overrides?: CallOverrides): Promise; + + marketAddresses(arg0: string, overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + optionMarkets(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeMarket(market: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + updateGlobalAddresses( + names: BytesLike[], + addresses: string[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addMarket( + newMarketAddresses: LyraRegistry.OptionMarketAddressesStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + globalAddresses(arg0: BytesLike, overrides?: CallOverrides): Promise; + + marketAddresses(arg0: string, overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + optionMarkets(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeMarket( + market: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateGlobalAddresses( + names: BytesLike[], + addresses: string[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/lyra-avalon/contracts/ethers/OptionMarket.ts b/src/apps/lyra-avalon/contracts/ethers/OptionMarket.ts new file mode 100644 index 000000000..e89d5fa43 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/OptionMarket.ts @@ -0,0 +1,1357 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export declare namespace OptionMarket { + export type OptionMarketParametersStruct = { + maxBoardExpiry: BigNumberish; + securityModule: string; + feePortionReserved: BigNumberish; + }; + + export type OptionMarketParametersStructOutput = [BigNumber, string, BigNumber] & { + maxBoardExpiry: BigNumber; + securityModule: string; + feePortionReserved: BigNumber; + }; + + export type TradeEventDataStruct = { + expiry: BigNumberish; + strikePrice: BigNumberish; + optionType: BigNumberish; + tradeDirection: BigNumberish; + amount: BigNumberish; + setCollateralTo: BigNumberish; + isForceClose: boolean; + spotPrice: BigNumberish; + reservedFee: BigNumberish; + totalCost: BigNumberish; + }; + + export type TradeEventDataStructOutput = [ + BigNumber, + BigNumber, + number, + number, + BigNumber, + BigNumber, + boolean, + BigNumber, + BigNumber, + BigNumber, + ] & { + expiry: BigNumber; + strikePrice: BigNumber; + optionType: number; + tradeDirection: number; + amount: BigNumber; + setCollateralTo: BigNumber; + isForceClose: boolean; + spotPrice: BigNumber; + reservedFee: BigNumber; + totalCost: BigNumber; + }; + + export type LiquidationEventDataStruct = { + rewardBeneficiary: string; + caller: string; + returnCollateral: BigNumberish; + lpPremiums: BigNumberish; + lpFee: BigNumberish; + liquidatorFee: BigNumberish; + smFee: BigNumberish; + insolventAmount: BigNumberish; + }; + + export type LiquidationEventDataStructOutput = [ + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + ] & { + rewardBeneficiary: string; + caller: string; + returnCollateral: BigNumber; + lpPremiums: BigNumber; + lpFee: BigNumber; + liquidatorFee: BigNumber; + smFee: BigNumber; + insolventAmount: BigNumber; + }; + + export type TradeInputParametersStruct = { + strikeId: BigNumberish; + positionId: BigNumberish; + iterations: BigNumberish; + optionType: BigNumberish; + amount: BigNumberish; + setCollateralTo: BigNumberish; + minTotalCost: BigNumberish; + maxTotalCost: BigNumberish; + }; + + export type TradeInputParametersStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + number, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + ] & { + strikeId: BigNumber; + positionId: BigNumber; + iterations: BigNumber; + optionType: number; + amount: BigNumber; + setCollateralTo: BigNumber; + minTotalCost: BigNumber; + maxTotalCost: BigNumber; + }; + + export type ResultStruct = { + positionId: BigNumberish; + totalCost: BigNumberish; + totalFee: BigNumberish; + }; + + export type ResultStructOutput = [BigNumber, BigNumber, BigNumber] & { + positionId: BigNumber; + totalCost: BigNumber; + totalFee: BigNumber; + }; + + export type OptionBoardStruct = { + id: BigNumberish; + expiry: BigNumberish; + iv: BigNumberish; + frozen: boolean; + strikeIds: BigNumberish[]; + }; + + export type OptionBoardStructOutput = [BigNumber, BigNumber, BigNumber, boolean, BigNumber[]] & { + id: BigNumber; + expiry: BigNumber; + iv: BigNumber; + frozen: boolean; + strikeIds: BigNumber[]; + }; + + export type StrikeStruct = { + id: BigNumberish; + strikePrice: BigNumberish; + skew: BigNumberish; + longCall: BigNumberish; + shortCallBase: BigNumberish; + shortCallQuote: BigNumberish; + longPut: BigNumberish; + shortPut: BigNumberish; + boardId: BigNumberish; + }; + + export type StrikeStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + ] & { + id: BigNumber; + strikePrice: BigNumber; + skew: BigNumber; + longCall: BigNumber; + shortCallBase: BigNumber; + shortCallQuote: BigNumber; + longPut: BigNumber; + shortPut: BigNumber; + boardId: BigNumber; + }; +} + +export declare namespace OptionMarketPricer { + export type VegaUtilFeeComponentsStruct = { + preTradeAmmNetStdVega: BigNumberish; + postTradeAmmNetStdVega: BigNumberish; + vegaUtil: BigNumberish; + volTraded: BigNumberish; + NAV: BigNumberish; + vegaUtilFee: BigNumberish; + }; + + export type VegaUtilFeeComponentsStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + preTradeAmmNetStdVega: BigNumber; + postTradeAmmNetStdVega: BigNumber; + vegaUtil: BigNumber; + volTraded: BigNumber; + NAV: BigNumber; + vegaUtilFee: BigNumber; + }; + + export type VarianceFeeComponentsStruct = { + varianceFeeCoefficient: BigNumberish; + vega: BigNumberish; + vegaCoefficient: BigNumberish; + skew: BigNumberish; + skewCoefficient: BigNumberish; + ivVariance: BigNumberish; + ivVarianceCoefficient: BigNumberish; + varianceFee: BigNumberish; + }; + + export type VarianceFeeComponentsStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + ] & { + varianceFeeCoefficient: BigNumber; + vega: BigNumber; + vegaCoefficient: BigNumber; + skew: BigNumber; + skewCoefficient: BigNumber; + ivVariance: BigNumber; + ivVarianceCoefficient: BigNumber; + varianceFee: BigNumber; + }; + + export type TradeResultStruct = { + amount: BigNumberish; + premium: BigNumberish; + optionPriceFee: BigNumberish; + spotPriceFee: BigNumberish; + vegaUtilFee: OptionMarketPricer.VegaUtilFeeComponentsStruct; + varianceFee: OptionMarketPricer.VarianceFeeComponentsStruct; + totalFee: BigNumberish; + totalCost: BigNumberish; + volTraded: BigNumberish; + newBaseIv: BigNumberish; + newSkew: BigNumberish; + }; + + export type TradeResultStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + OptionMarketPricer.VegaUtilFeeComponentsStructOutput, + OptionMarketPricer.VarianceFeeComponentsStructOutput, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + ] & { + amount: BigNumber; + premium: BigNumber; + optionPriceFee: BigNumber; + spotPriceFee: BigNumber; + vegaUtilFee: OptionMarketPricer.VegaUtilFeeComponentsStructOutput; + varianceFee: OptionMarketPricer.VarianceFeeComponentsStructOutput; + totalFee: BigNumber; + totalCost: BigNumber; + volTraded: BigNumber; + newBaseIv: BigNumber; + newSkew: BigNumber; + }; +} + +export interface OptionMarketInterface extends utils.Interface { + functions: { + 'acceptOwnership()': FunctionFragment; + 'addCollateral(uint256,uint256)': FunctionFragment; + 'addStrikeToBoard(uint256,uint256,uint256)': FunctionFragment; + 'boardToPriceAtExpiry(uint256)': FunctionFragment; + 'closePosition((uint256,uint256,uint256,uint8,uint256,uint256,uint256,uint256))': FunctionFragment; + 'createOptionBoard(uint256,uint256,uint256[],uint256[],bool)': FunctionFragment; + 'forceClosePosition((uint256,uint256,uint256,uint8,uint256,uint256,uint256,uint256))': FunctionFragment; + 'forceSettleBoard(uint256)': FunctionFragment; + 'getBoardAndStrikeDetails(uint256)': FunctionFragment; + 'getBoardStrikes(uint256)': FunctionFragment; + 'getLiveBoards()': FunctionFragment; + 'getNumLiveBoards()': FunctionFragment; + 'getOptionBoard(uint256)': FunctionFragment; + 'getSettlementParameters(uint256)': FunctionFragment; + 'getStrike(uint256)': FunctionFragment; + 'getStrikeAndBoard(uint256)': FunctionFragment; + 'getStrikeAndExpiry(uint256)': FunctionFragment; + 'init(address,address,address,address,address,address,address,address)': FunctionFragment; + 'liquidatePosition(uint256,address)': FunctionFragment; + 'nominateNewOwner(address)': FunctionFragment; + 'nominatedOwner()': FunctionFragment; + 'openPosition((uint256,uint256,uint256,uint8,uint256,uint256,uint256,uint256))': FunctionFragment; + 'optionMarketParams()': FunctionFragment; + 'owner()': FunctionFragment; + 'setBoardBaseIv(uint256,uint256)': FunctionFragment; + 'setBoardFrozen(uint256,bool)': FunctionFragment; + 'setOptionMarketParams((uint256,address,uint256))': FunctionFragment; + 'setStrikeSkew(uint256,uint256)': FunctionFragment; + 'settleExpiredBoard(uint256)': FunctionFragment; + 'smClaim()': FunctionFragment; + 'strikeToBaseReturnedRatio(uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'acceptOwnership' + | 'addCollateral' + | 'addStrikeToBoard' + | 'boardToPriceAtExpiry' + | 'closePosition' + | 'createOptionBoard' + | 'forceClosePosition' + | 'forceSettleBoard' + | 'getBoardAndStrikeDetails' + | 'getBoardStrikes' + | 'getLiveBoards' + | 'getNumLiveBoards' + | 'getOptionBoard' + | 'getSettlementParameters' + | 'getStrike' + | 'getStrikeAndBoard' + | 'getStrikeAndExpiry' + | 'init' + | 'liquidatePosition' + | 'nominateNewOwner' + | 'nominatedOwner' + | 'openPosition' + | 'optionMarketParams' + | 'owner' + | 'setBoardBaseIv' + | 'setBoardFrozen' + | 'setOptionMarketParams' + | 'setStrikeSkew' + | 'settleExpiredBoard' + | 'smClaim' + | 'strikeToBaseReturnedRatio', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'addCollateral', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'addStrikeToBoard', values: [BigNumberish, BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'boardToPriceAtExpiry', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'closePosition', values: [OptionMarket.TradeInputParametersStruct]): string; + encodeFunctionData( + functionFragment: 'createOptionBoard', + values: [BigNumberish, BigNumberish, BigNumberish[], BigNumberish[], boolean], + ): string; + encodeFunctionData(functionFragment: 'forceClosePosition', values: [OptionMarket.TradeInputParametersStruct]): string; + encodeFunctionData(functionFragment: 'forceSettleBoard', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getBoardAndStrikeDetails', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getBoardStrikes', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getLiveBoards', values?: undefined): string; + encodeFunctionData(functionFragment: 'getNumLiveBoards', values?: undefined): string; + encodeFunctionData(functionFragment: 'getOptionBoard', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getSettlementParameters', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getStrike', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getStrikeAndBoard', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getStrikeAndExpiry', values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: 'init', + values: [string, string, string, string, string, string, string, string], + ): string; + encodeFunctionData(functionFragment: 'liquidatePosition', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'nominateNewOwner', values: [string]): string; + encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string; + encodeFunctionData(functionFragment: 'openPosition', values: [OptionMarket.TradeInputParametersStruct]): string; + encodeFunctionData(functionFragment: 'optionMarketParams', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'setBoardBaseIv', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'setBoardFrozen', values: [BigNumberish, boolean]): string; + encodeFunctionData( + functionFragment: 'setOptionMarketParams', + values: [OptionMarket.OptionMarketParametersStruct], + ): string; + encodeFunctionData(functionFragment: 'setStrikeSkew', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'settleExpiredBoard', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'smClaim', values?: undefined): string; + encodeFunctionData(functionFragment: 'strikeToBaseReturnedRatio', values: [BigNumberish]): string; + + decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addCollateral', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addStrikeToBoard', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'boardToPriceAtExpiry', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'closePosition', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'createOptionBoard', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'forceClosePosition', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'forceSettleBoard', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getBoardAndStrikeDetails', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getBoardStrikes', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLiveBoards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getNumLiveBoards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getOptionBoard', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getSettlementParameters', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getStrike', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getStrikeAndBoard', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getStrikeAndExpiry', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'init', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'liquidatePosition', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'openPosition', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'optionMarketParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setBoardBaseIv', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setBoardFrozen', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setOptionMarketParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setStrikeSkew', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'settleExpiredBoard', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'smClaim', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'strikeToBaseReturnedRatio', data: BytesLike): Result; + + events: { + 'BoardBaseIvSet(uint256,uint256)': EventFragment; + 'BoardCreated(uint256,uint256,uint256,bool)': EventFragment; + 'BoardFrozen(uint256,bool)': EventFragment; + 'BoardSettled(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)': EventFragment; + 'OptionMarketParamsSet(tuple)': EventFragment; + 'OwnerChanged(address,address)': EventFragment; + 'OwnerNominated(address)': EventFragment; + 'SMClaimed(address,uint256,uint256)': EventFragment; + 'StrikeAdded(uint256,uint256,uint256,uint256)': EventFragment; + 'StrikeSkewSet(uint256,uint256)': EventFragment; + 'Trade(address,uint256,uint256,tuple,tuple[],tuple,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'BoardBaseIvSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BoardCreated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BoardFrozen'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BoardSettled'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OptionMarketParamsSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'SMClaimed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'StrikeAdded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'StrikeSkewSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Trade'): EventFragment; +} + +export interface BoardBaseIvSetEventObject { + boardId: BigNumber; + baseIv: BigNumber; +} +export type BoardBaseIvSetEvent = TypedEvent<[BigNumber, BigNumber], BoardBaseIvSetEventObject>; + +export type BoardBaseIvSetEventFilter = TypedEventFilter; + +export interface BoardCreatedEventObject { + boardId: BigNumber; + expiry: BigNumber; + baseIv: BigNumber; + frozen: boolean; +} +export type BoardCreatedEvent = TypedEvent<[BigNumber, BigNumber, BigNumber, boolean], BoardCreatedEventObject>; + +export type BoardCreatedEventFilter = TypedEventFilter; + +export interface BoardFrozenEventObject { + boardId: BigNumber; + frozen: boolean; +} +export type BoardFrozenEvent = TypedEvent<[BigNumber, boolean], BoardFrozenEventObject>; + +export type BoardFrozenEventFilter = TypedEventFilter; + +export interface BoardSettledEventObject { + boardId: BigNumber; + spotPriceAtExpiry: BigNumber; + totalUserLongProfitQuote: BigNumber; + totalBoardLongCallCollateral: BigNumber; + totalBoardLongPutCollateral: BigNumber; + totalAMMShortCallProfitBase: BigNumber; + totalAMMShortCallProfitQuote: BigNumber; + totalAMMShortPutProfitQuote: BigNumber; +} +export type BoardSettledEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], + BoardSettledEventObject +>; + +export type BoardSettledEventFilter = TypedEventFilter; + +export interface OptionMarketParamsSetEventObject { + optionMarketParams: OptionMarket.OptionMarketParametersStructOutput; +} +export type OptionMarketParamsSetEvent = TypedEvent< + [OptionMarket.OptionMarketParametersStructOutput], + OptionMarketParamsSetEventObject +>; + +export type OptionMarketParamsSetEventFilter = TypedEventFilter; + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface SMClaimedEventObject { + securityModule: string; + quoteAmount: BigNumber; + baseAmount: BigNumber; +} +export type SMClaimedEvent = TypedEvent<[string, BigNumber, BigNumber], SMClaimedEventObject>; + +export type SMClaimedEventFilter = TypedEventFilter; + +export interface StrikeAddedEventObject { + boardId: BigNumber; + strikeId: BigNumber; + strikePrice: BigNumber; + skew: BigNumber; +} +export type StrikeAddedEvent = TypedEvent<[BigNumber, BigNumber, BigNumber, BigNumber], StrikeAddedEventObject>; + +export type StrikeAddedEventFilter = TypedEventFilter; + +export interface StrikeSkewSetEventObject { + strikeId: BigNumber; + skew: BigNumber; +} +export type StrikeSkewSetEvent = TypedEvent<[BigNumber, BigNumber], StrikeSkewSetEventObject>; + +export type StrikeSkewSetEventFilter = TypedEventFilter; + +export interface TradeEventObject { + trader: string; + strikeId: BigNumber; + positionId: BigNumber; + trade: OptionMarket.TradeEventDataStructOutput; + tradeResults: OptionMarketPricer.TradeResultStructOutput[]; + liquidation: OptionMarket.LiquidationEventDataStructOutput; + timestamp: BigNumber; +} +export type TradeEvent = TypedEvent< + [ + string, + BigNumber, + BigNumber, + OptionMarket.TradeEventDataStructOutput, + OptionMarketPricer.TradeResultStructOutput[], + OptionMarket.LiquidationEventDataStructOutput, + BigNumber, + ], + TradeEventObject +>; + +export type TradeEventFilter = TypedEventFilter; + +export interface OptionMarket extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: OptionMarketInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + addStrikeToBoard( + boardId: BigNumberish, + strikePrice: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + boardToPriceAtExpiry(arg0: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + createOptionBoard( + expiry: BigNumberish, + baseIV: BigNumberish, + strikePrices: BigNumberish[], + skews: BigNumberish[], + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceSettleBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getBoardAndStrikeDetails( + boardId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionMarket.OptionBoardStructOutput, OptionMarket.StrikeStructOutput[], BigNumber[], BigNumber]>; + + getBoardStrikes(boardId: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber[]]>; + + getLiveBoards(overrides?: CallOverrides): Promise<[BigNumber[]] & { _liveBoards: BigNumber[] }>; + + getNumLiveBoards(overrides?: CallOverrides): Promise<[BigNumber] & { numLiveBoards: BigNumber }>; + + getOptionBoard(boardId: BigNumberish, overrides?: CallOverrides): Promise<[OptionMarket.OptionBoardStructOutput]>; + + getSettlementParameters( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + strikePrice: BigNumber; + priceAtExpiry: BigNumber; + strikeToBaseReturned: BigNumber; + } + >; + + getStrike(strikeId: BigNumberish, overrides?: CallOverrides): Promise<[OptionMarket.StrikeStructOutput]>; + + getStrikeAndBoard( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionMarket.StrikeStructOutput, OptionMarket.OptionBoardStructOutput]>; + + getStrikeAndExpiry( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { strikePrice: BigNumber; expiry: BigNumber }>; + + init( + _synthetixAdapter: string, + _liquidityPool: string, + _optionPricer: string, + _greekCache: string, + _shortCollateral: string, + _optionToken: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidatePosition( + positionId: BigNumberish, + rewardBeneficiary: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + optionMarketParams(overrides?: CallOverrides): Promise< + [BigNumber, string, BigNumber] & { + maxBoardExpiry: BigNumber; + securityModule: string; + feePortionReserved: BigNumber; + } + >; + + owner(overrides?: CallOverrides): Promise<[string]>; + + setBoardBaseIv( + boardId: BigNumberish, + baseIv: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBoardFrozen( + boardId: BigNumberish, + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStrikeSkew( + strikeId: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + settleExpiredBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + smClaim(overrides?: Overrides & { from?: string | Promise }): Promise; + + strikeToBaseReturnedRatio(arg0: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + }; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + addStrikeToBoard( + boardId: BigNumberish, + strikePrice: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + boardToPriceAtExpiry(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + createOptionBoard( + expiry: BigNumberish, + baseIV: BigNumberish, + strikePrices: BigNumberish[], + skews: BigNumberish[], + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceSettleBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getBoardAndStrikeDetails( + boardId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionMarket.OptionBoardStructOutput, OptionMarket.StrikeStructOutput[], BigNumber[], BigNumber]>; + + getBoardStrikes(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getSettlementParameters( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + strikePrice: BigNumber; + priceAtExpiry: BigNumber; + strikeToBaseReturned: BigNumber; + } + >; + + getStrike(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrikeAndBoard( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionMarket.StrikeStructOutput, OptionMarket.OptionBoardStructOutput]>; + + getStrikeAndExpiry( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { strikePrice: BigNumber; expiry: BigNumber }>; + + init( + _synthetixAdapter: string, + _liquidityPool: string, + _optionPricer: string, + _greekCache: string, + _shortCollateral: string, + _optionToken: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidatePosition( + positionId: BigNumberish, + rewardBeneficiary: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + optionMarketParams(overrides?: CallOverrides): Promise< + [BigNumber, string, BigNumber] & { + maxBoardExpiry: BigNumber; + securityModule: string; + feePortionReserved: BigNumber; + } + >; + + owner(overrides?: CallOverrides): Promise; + + setBoardBaseIv( + boardId: BigNumberish, + baseIv: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBoardFrozen( + boardId: BigNumberish, + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStrikeSkew( + strikeId: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + settleExpiredBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + smClaim(overrides?: Overrides & { from?: string | Promise }): Promise; + + strikeToBaseReturnedRatio(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + addCollateral(positionId: BigNumberish, amountCollateral: BigNumberish, overrides?: CallOverrides): Promise; + + addStrikeToBoard( + boardId: BigNumberish, + strikePrice: BigNumberish, + skew: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + boardToPriceAtExpiry(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: CallOverrides, + ): Promise; + + createOptionBoard( + expiry: BigNumberish, + baseIV: BigNumberish, + strikePrices: BigNumberish[], + skews: BigNumberish[], + frozen: boolean, + overrides?: CallOverrides, + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: CallOverrides, + ): Promise; + + forceSettleBoard(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getBoardAndStrikeDetails( + boardId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionMarket.OptionBoardStructOutput, OptionMarket.StrikeStructOutput[], BigNumber[], BigNumber]>; + + getBoardStrikes(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getSettlementParameters( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + strikePrice: BigNumber; + priceAtExpiry: BigNumber; + strikeToBaseReturned: BigNumber; + } + >; + + getStrike(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrikeAndBoard( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionMarket.StrikeStructOutput, OptionMarket.OptionBoardStructOutput]>; + + getStrikeAndExpiry( + strikeId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { strikePrice: BigNumber; expiry: BigNumber }>; + + init( + _synthetixAdapter: string, + _liquidityPool: string, + _optionPricer: string, + _greekCache: string, + _shortCollateral: string, + _optionToken: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: CallOverrides, + ): Promise; + + liquidatePosition(positionId: BigNumberish, rewardBeneficiary: string, overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: CallOverrides, + ): Promise; + + optionMarketParams(overrides?: CallOverrides): Promise< + [BigNumber, string, BigNumber] & { + maxBoardExpiry: BigNumber; + securityModule: string; + feePortionReserved: BigNumber; + } + >; + + owner(overrides?: CallOverrides): Promise; + + setBoardBaseIv(boardId: BigNumberish, baseIv: BigNumberish, overrides?: CallOverrides): Promise; + + setBoardFrozen(boardId: BigNumberish, frozen: boolean, overrides?: CallOverrides): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: CallOverrides, + ): Promise; + + setStrikeSkew(strikeId: BigNumberish, skew: BigNumberish, overrides?: CallOverrides): Promise; + + settleExpiredBoard(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + smClaim(overrides?: CallOverrides): Promise; + + strikeToBaseReturnedRatio(arg0: BigNumberish, overrides?: CallOverrides): Promise; + }; + + filters: { + 'BoardBaseIvSet(uint256,uint256)'(boardId?: BigNumberish | null, baseIv?: null): BoardBaseIvSetEventFilter; + BoardBaseIvSet(boardId?: BigNumberish | null, baseIv?: null): BoardBaseIvSetEventFilter; + + 'BoardCreated(uint256,uint256,uint256,bool)'( + boardId?: BigNumberish | null, + expiry?: null, + baseIv?: null, + frozen?: null, + ): BoardCreatedEventFilter; + BoardCreated(boardId?: BigNumberish | null, expiry?: null, baseIv?: null, frozen?: null): BoardCreatedEventFilter; + + 'BoardFrozen(uint256,bool)'(boardId?: BigNumberish | null, frozen?: null): BoardFrozenEventFilter; + BoardFrozen(boardId?: BigNumberish | null, frozen?: null): BoardFrozenEventFilter; + + 'BoardSettled(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)'( + boardId?: BigNumberish | null, + spotPriceAtExpiry?: null, + totalUserLongProfitQuote?: null, + totalBoardLongCallCollateral?: null, + totalBoardLongPutCollateral?: null, + totalAMMShortCallProfitBase?: null, + totalAMMShortCallProfitQuote?: null, + totalAMMShortPutProfitQuote?: null, + ): BoardSettledEventFilter; + BoardSettled( + boardId?: BigNumberish | null, + spotPriceAtExpiry?: null, + totalUserLongProfitQuote?: null, + totalBoardLongCallCollateral?: null, + totalBoardLongPutCollateral?: null, + totalAMMShortCallProfitBase?: null, + totalAMMShortCallProfitQuote?: null, + totalAMMShortPutProfitQuote?: null, + ): BoardSettledEventFilter; + + 'OptionMarketParamsSet(tuple)'(optionMarketParams?: null): OptionMarketParamsSetEventFilter; + OptionMarketParamsSet(optionMarketParams?: null): OptionMarketParamsSetEventFilter; + + 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + 'SMClaimed(address,uint256,uint256)'( + securityModule?: null, + quoteAmount?: null, + baseAmount?: null, + ): SMClaimedEventFilter; + SMClaimed(securityModule?: null, quoteAmount?: null, baseAmount?: null): SMClaimedEventFilter; + + 'StrikeAdded(uint256,uint256,uint256,uint256)'( + boardId?: BigNumberish | null, + strikeId?: BigNumberish | null, + strikePrice?: null, + skew?: null, + ): StrikeAddedEventFilter; + StrikeAdded( + boardId?: BigNumberish | null, + strikeId?: BigNumberish | null, + strikePrice?: null, + skew?: null, + ): StrikeAddedEventFilter; + + 'StrikeSkewSet(uint256,uint256)'(strikeId?: BigNumberish | null, skew?: null): StrikeSkewSetEventFilter; + StrikeSkewSet(strikeId?: BigNumberish | null, skew?: null): StrikeSkewSetEventFilter; + + 'Trade(address,uint256,uint256,tuple,tuple[],tuple,uint256)'( + trader?: string | null, + strikeId?: BigNumberish | null, + positionId?: BigNumberish | null, + trade?: null, + tradeResults?: null, + liquidation?: null, + timestamp?: null, + ): TradeEventFilter; + Trade( + trader?: string | null, + strikeId?: BigNumberish | null, + positionId?: BigNumberish | null, + trade?: null, + tradeResults?: null, + liquidation?: null, + timestamp?: null, + ): TradeEventFilter; + }; + + estimateGas: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + addStrikeToBoard( + boardId: BigNumberish, + strikePrice: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + boardToPriceAtExpiry(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + createOptionBoard( + expiry: BigNumberish, + baseIV: BigNumberish, + strikePrices: BigNumberish[], + skews: BigNumberish[], + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceSettleBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getBoardAndStrikeDetails(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getBoardStrikes(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getSettlementParameters(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrike(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrikeAndBoard(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrikeAndExpiry(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + init( + _synthetixAdapter: string, + _liquidityPool: string, + _optionPricer: string, + _greekCache: string, + _shortCollateral: string, + _optionToken: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidatePosition( + positionId: BigNumberish, + rewardBeneficiary: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominateNewOwner(_owner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + optionMarketParams(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setBoardBaseIv( + boardId: BigNumberish, + baseIv: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBoardFrozen( + boardId: BigNumberish, + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStrikeSkew( + strikeId: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + settleExpiredBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + smClaim(overrides?: Overrides & { from?: string | Promise }): Promise; + + strikeToBaseReturnedRatio(arg0: BigNumberish, overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + addStrikeToBoard( + boardId: BigNumberish, + strikePrice: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + boardToPriceAtExpiry(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + createOptionBoard( + expiry: BigNumberish, + baseIV: BigNumberish, + strikePrices: BigNumberish[], + skews: BigNumberish[], + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + forceSettleBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getBoardAndStrikeDetails(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getBoardStrikes(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard(boardId: BigNumberish, overrides?: CallOverrides): Promise; + + getSettlementParameters(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrike(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrikeAndBoard(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + getStrikeAndExpiry(strikeId: BigNumberish, overrides?: CallOverrides): Promise; + + init( + _synthetixAdapter: string, + _liquidityPool: string, + _optionPricer: string, + _greekCache: string, + _shortCollateral: string, + _optionToken: string, + _quoteAsset: string, + _baseAsset: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + liquidatePosition( + positionId: BigNumberish, + rewardBeneficiary: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + optionMarketParams(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setBoardBaseIv( + boardId: BigNumberish, + baseIv: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBoardFrozen( + boardId: BigNumberish, + frozen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStrikeSkew( + strikeId: BigNumberish, + skew: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + settleExpiredBoard( + boardId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + smClaim(overrides?: Overrides & { from?: string | Promise }): Promise; + + strikeToBaseReturnedRatio(arg0: BigNumberish, overrides?: CallOverrides): Promise; + }; +} diff --git a/src/apps/lyra-avalon/contracts/ethers/OptionToken.ts b/src/apps/lyra-avalon/contracts/ethers/OptionToken.ts new file mode 100644 index 000000000..9dcaba736 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/OptionToken.ts @@ -0,0 +1,1396 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export declare namespace OptionToken { + export type OptionPositionStruct = { + positionId: BigNumberish; + strikeId: BigNumberish; + optionType: BigNumberish; + amount: BigNumberish; + collateral: BigNumberish; + state: BigNumberish; + }; + + export type OptionPositionStructOutput = [BigNumber, BigNumber, number, BigNumber, BigNumber, number] & { + positionId: BigNumber; + strikeId: BigNumber; + optionType: number; + amount: BigNumber; + collateral: BigNumber; + state: number; + }; + + export type LiquidationFeesStruct = { + returnCollateral: BigNumberish; + lpPremiums: BigNumberish; + lpFee: BigNumberish; + liquidatorFee: BigNumberish; + smFee: BigNumberish; + insolventAmount: BigNumberish; + }; + + export type LiquidationFeesStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + returnCollateral: BigNumber; + lpPremiums: BigNumber; + lpFee: BigNumber; + liquidatorFee: BigNumber; + smFee: BigNumber; + insolventAmount: BigNumber; + }; + + export type PartialCollateralParametersStruct = { + penaltyRatio: BigNumberish; + liquidatorFeeRatio: BigNumberish; + smFeeRatio: BigNumberish; + minLiquidationFee: BigNumberish; + }; + + export type PartialCollateralParametersStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber] & { + penaltyRatio: BigNumber; + liquidatorFeeRatio: BigNumber; + smFeeRatio: BigNumber; + minLiquidationFee: BigNumber; + }; + + export type PositionWithOwnerStruct = { + positionId: BigNumberish; + strikeId: BigNumberish; + optionType: BigNumberish; + amount: BigNumberish; + collateral: BigNumberish; + state: BigNumberish; + owner: string; + }; + + export type PositionWithOwnerStructOutput = [BigNumber, BigNumber, number, BigNumber, BigNumber, number, string] & { + positionId: BigNumber; + strikeId: BigNumber; + optionType: number; + amount: BigNumber; + collateral: BigNumber; + state: number; + owner: string; + }; +} + +export declare namespace LiquidityPool { + export type LiquidityStruct = { + freeLiquidity: BigNumberish; + burnableLiquidity: BigNumberish; + usedCollatLiquidity: BigNumberish; + pendingDeltaLiquidity: BigNumberish; + usedDeltaLiquidity: BigNumberish; + NAV: BigNumberish; + }; + + export type LiquidityStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + freeLiquidity: BigNumber; + burnableLiquidity: BigNumber; + usedCollatLiquidity: BigNumber; + pendingDeltaLiquidity: BigNumber; + usedDeltaLiquidity: BigNumber; + NAV: BigNumber; + }; +} + +export declare namespace SynthetixAdapter { + export type ExchangeParamsStruct = { + spotPrice: BigNumberish; + quoteKey: BytesLike; + baseKey: BytesLike; + short: string; + quoteBaseFeeRate: BigNumberish; + baseQuoteFeeRate: BigNumberish; + }; + + export type ExchangeParamsStructOutput = [BigNumber, string, string, string, BigNumber, BigNumber] & { + spotPrice: BigNumber; + quoteKey: string; + baseKey: string; + short: string; + quoteBaseFeeRate: BigNumber; + baseQuoteFeeRate: BigNumber; + }; +} + +export declare namespace OptionMarket { + export type TradeParametersStruct = { + isBuy: boolean; + isForceClose: boolean; + tradeDirection: BigNumberish; + optionType: BigNumberish; + amount: BigNumberish; + expiry: BigNumberish; + strikePrice: BigNumberish; + liquidity: LiquidityPool.LiquidityStruct; + exchangeParams: SynthetixAdapter.ExchangeParamsStruct; + }; + + export type TradeParametersStructOutput = [ + boolean, + boolean, + number, + number, + BigNumber, + BigNumber, + BigNumber, + LiquidityPool.LiquidityStructOutput, + SynthetixAdapter.ExchangeParamsStructOutput, + ] & { + isBuy: boolean; + isForceClose: boolean; + tradeDirection: number; + optionType: number; + amount: BigNumber; + expiry: BigNumber; + strikePrice: BigNumber; + liquidity: LiquidityPool.LiquidityStructOutput; + exchangeParams: SynthetixAdapter.ExchangeParamsStructOutput; + }; +} + +export interface OptionTokenInterface extends utils.Interface { + functions: { + 'acceptOwnership()': FunctionFragment; + 'addCollateral(uint256,uint256)': FunctionFragment; + 'adjustPosition((bool,bool,uint8,uint8,uint256,uint256,uint256,(uint256,uint256,uint256,uint256,uint256,uint256),(uint256,bytes32,bytes32,address,uint256,uint256)),uint256,address,uint256,uint256,uint256,bool)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'baseURI()': FunctionFragment; + 'canLiquidate((uint256,uint256,uint8,uint256,uint256,uint8),uint256,uint256,uint256)': FunctionFragment; + 'getApproved(uint256)': FunctionFragment; + 'getLiquidationFees(uint256,uint256,uint256,uint256)': FunctionFragment; + 'getOptionPosition(uint256)': FunctionFragment; + 'getOptionPositions(uint256[])': FunctionFragment; + 'getOwnerPositions(address)': FunctionFragment; + 'getPartialCollatParams()': FunctionFragment; + 'getPositionState(uint256)': FunctionFragment; + 'getPositionWithOwner(uint256)': FunctionFragment; + 'getPositionsWithOwner(uint256[])': FunctionFragment; + 'init(address,address,address,address)': FunctionFragment; + 'isApprovedForAll(address,address)': FunctionFragment; + 'liquidate(uint256,(bool,bool,uint8,uint8,uint256,uint256,uint256,(uint256,uint256,uint256,uint256,uint256,uint256),(uint256,bytes32,bytes32,address,uint256,uint256)),uint256)': FunctionFragment; + 'merge(uint256[])': FunctionFragment; + 'name()': FunctionFragment; + 'nextId()': FunctionFragment; + 'nominateNewOwner(address)': FunctionFragment; + 'nominatedOwner()': FunctionFragment; + 'owner()': FunctionFragment; + 'ownerOf(uint256)': FunctionFragment; + 'partialCollatParams()': FunctionFragment; + 'positions(uint256)': FunctionFragment; + 'safeTransferFrom(address,address,uint256)': FunctionFragment; + 'safeTransferFrom(address,address,uint256,bytes)': FunctionFragment; + 'setApprovalForAll(address,bool)': FunctionFragment; + 'setPartialCollateralParams((uint256,uint256,uint256,uint256))': FunctionFragment; + 'setURI(string)': FunctionFragment; + 'settlePositions(uint256[])': FunctionFragment; + 'split(uint256,uint256,uint256,address)': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'symbol()': FunctionFragment; + 'tokenByIndex(uint256)': FunctionFragment; + 'tokenOfOwnerByIndex(address,uint256)': FunctionFragment; + 'tokenURI(uint256)': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'acceptOwnership' + | 'addCollateral' + | 'adjustPosition' + | 'approve' + | 'balanceOf' + | 'baseURI' + | 'canLiquidate' + | 'getApproved' + | 'getLiquidationFees' + | 'getOptionPosition' + | 'getOptionPositions' + | 'getOwnerPositions' + | 'getPartialCollatParams' + | 'getPositionState' + | 'getPositionWithOwner' + | 'getPositionsWithOwner' + | 'init' + | 'isApprovedForAll' + | 'liquidate' + | 'merge' + | 'name' + | 'nextId' + | 'nominateNewOwner' + | 'nominatedOwner' + | 'owner' + | 'ownerOf' + | 'partialCollatParams' + | 'positions' + | 'safeTransferFrom(address,address,uint256)' + | 'safeTransferFrom(address,address,uint256,bytes)' + | 'setApprovalForAll' + | 'setPartialCollateralParams' + | 'setURI' + | 'settlePositions' + | 'split' + | 'supportsInterface' + | 'symbol' + | 'tokenByIndex' + | 'tokenOfOwnerByIndex' + | 'tokenURI' + | 'totalSupply' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'addCollateral', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData( + functionFragment: 'adjustPosition', + values: [ + OptionMarket.TradeParametersStruct, + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + boolean, + ], + ): string; + encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'baseURI', values?: undefined): string; + encodeFunctionData( + functionFragment: 'canLiquidate', + values: [OptionToken.OptionPositionStruct, BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'getApproved', values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: 'getLiquidationFees', + values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'getOptionPosition', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getOptionPositions', values: [BigNumberish[]]): string; + encodeFunctionData(functionFragment: 'getOwnerPositions', values: [string]): string; + encodeFunctionData(functionFragment: 'getPartialCollatParams', values?: undefined): string; + encodeFunctionData(functionFragment: 'getPositionState', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getPositionWithOwner', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getPositionsWithOwner', values: [BigNumberish[]]): string; + encodeFunctionData(functionFragment: 'init', values: [string, string, string, string]): string; + encodeFunctionData(functionFragment: 'isApprovedForAll', values: [string, string]): string; + encodeFunctionData( + functionFragment: 'liquidate', + values: [BigNumberish, OptionMarket.TradeParametersStruct, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'merge', values: [BigNumberish[]]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'nextId', values?: undefined): string; + encodeFunctionData(functionFragment: 'nominateNewOwner', values: [string]): string; + encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'ownerOf', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'partialCollatParams', values?: undefined): string; + encodeFunctionData(functionFragment: 'positions', values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: 'safeTransferFrom(address,address,uint256)', + values: [string, string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', + values: [string, string, BigNumberish, BytesLike], + ): string; + encodeFunctionData(functionFragment: 'setApprovalForAll', values: [string, boolean]): string; + encodeFunctionData( + functionFragment: 'setPartialCollateralParams', + values: [OptionToken.PartialCollateralParametersStruct], + ): string; + encodeFunctionData(functionFragment: 'setURI', values: [string]): string; + encodeFunctionData(functionFragment: 'settlePositions', values: [BigNumberish[]]): string; + encodeFunctionData(functionFragment: 'split', values: [BigNumberish, BigNumberish, BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'tokenByIndex', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'tokenOfOwnerByIndex', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'tokenURI', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; + + decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addCollateral', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'adjustPosition', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'baseURI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'canLiquidate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getApproved', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLiquidationFees', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getOptionPosition', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getOptionPositions', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getOwnerPositions', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPartialCollatParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPositionState', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPositionWithOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPositionsWithOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'init', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'liquidate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'merge', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nextId', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ownerOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'partialCollatParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'positions', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setPartialCollateralParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setURI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'settlePositions', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'split', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tokenByIndex', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tokenOfOwnerByIndex', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tokenURI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'ApprovalForAll(address,address,bool)': EventFragment; + 'OwnerChanged(address,address)': EventFragment; + 'OwnerNominated(address)': EventFragment; + 'PositionUpdated(uint256,address,uint8,tuple,uint256)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PositionUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + approved: string; + tokenId: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface ApprovalForAllEventObject { + owner: string; + operator: string; + approved: boolean; +} +export type ApprovalForAllEvent = TypedEvent<[string, string, boolean], ApprovalForAllEventObject>; + +export type ApprovalForAllEventFilter = TypedEventFilter; + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface PositionUpdatedEventObject { + positionId: BigNumber; + owner: string; + updatedType: number; + position: OptionToken.OptionPositionStructOutput; + timestamp: BigNumber; +} +export type PositionUpdatedEvent = TypedEvent< + [BigNumber, string, number, OptionToken.OptionPositionStructOutput, BigNumber], + PositionUpdatedEventObject +>; + +export type PositionUpdatedEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + tokenId: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface OptionToken extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: OptionTokenInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + adjustPosition( + trade: OptionMarket.TradeParametersStruct, + strikeId: BigNumberish, + trader: string, + positionId: BigNumberish, + optionCost: BigNumberish, + setCollateralTo: BigNumberish, + isOpen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + baseURI(overrides?: CallOverrides): Promise<[string]>; + + canLiquidate( + position: OptionToken.OptionPositionStruct, + expiry: BigNumberish, + strikePrice: BigNumberish, + spotPrice: BigNumberish, + overrides?: CallOverrides, + ): Promise<[boolean]>; + + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + + getLiquidationFees( + gwavPremium: BigNumberish, + userPositionCollateral: BigNumberish, + convertedMinLiquidationFee: BigNumberish, + insolvencyMultiplier: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [OptionToken.LiquidationFeesStructOutput] & { + liquidationFees: OptionToken.LiquidationFeesStructOutput; + } + >; + + getOptionPosition( + positionId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionToken.OptionPositionStructOutput]>; + + getOptionPositions( + positionIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise<[OptionToken.OptionPositionStructOutput[]]>; + + getOwnerPositions(target: string, overrides?: CallOverrides): Promise<[OptionToken.OptionPositionStructOutput[]]>; + + getPartialCollatParams(overrides?: CallOverrides): Promise<[OptionToken.PartialCollateralParametersStructOutput]>; + + getPositionState(positionId: BigNumberish, overrides?: CallOverrides): Promise<[number]>; + + getPositionWithOwner( + positionId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[OptionToken.PositionWithOwnerStructOutput]>; + + getPositionsWithOwner( + positionIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise<[OptionToken.PositionWithOwnerStructOutput[]]>; + + init( + _optionMarket: string, + _greekCache: string, + _shortCollateral: string, + _synthetixAdapter: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise<[boolean]>; + + liquidate( + positionId: BigNumberish, + trade: OptionMarket.TradeParametersStruct, + totalCost: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + merge( + positionIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + nextId(overrides?: CallOverrides): Promise<[BigNumber]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + + partialCollatParams(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + penaltyRatio: BigNumber; + liquidatorFeeRatio: BigNumber; + smFeeRatio: BigNumber; + minLiquidationFee: BigNumber; + } + >; + + positions( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, number, BigNumber, BigNumber, number] & { + positionId: BigNumber; + strikeId: BigNumber; + optionType: number; + amount: BigNumber; + collateral: BigNumber; + state: number; + } + >; + + 'safeTransferFrom(address,address,uint256)'( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPartialCollateralParams( + _partialCollatParams: OptionToken.PartialCollateralParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setURI(newURI: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + settlePositions( + positionIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + split( + positionId: BigNumberish, + newAmount: BigNumberish, + newCollateral: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + tokenByIndex(index: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + + tokenOfOwnerByIndex(owner: string, index: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + + tokenURI(tokenId: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + adjustPosition( + trade: OptionMarket.TradeParametersStruct, + strikeId: BigNumberish, + trader: string, + positionId: BigNumberish, + optionCost: BigNumberish, + setCollateralTo: BigNumberish, + isOpen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + baseURI(overrides?: CallOverrides): Promise; + + canLiquidate( + position: OptionToken.OptionPositionStruct, + expiry: BigNumberish, + strikePrice: BigNumberish, + spotPrice: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiquidationFees( + gwavPremium: BigNumberish, + userPositionCollateral: BigNumberish, + convertedMinLiquidationFee: BigNumberish, + insolvencyMultiplier: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getOptionPosition( + positionId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getOptionPositions( + positionIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + getOwnerPositions(target: string, overrides?: CallOverrides): Promise; + + getPartialCollatParams(overrides?: CallOverrides): Promise; + + getPositionState(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionWithOwner( + positionId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPositionsWithOwner( + positionIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + init( + _optionMarket: string, + _greekCache: string, + _shortCollateral: string, + _synthetixAdapter: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; + + liquidate( + positionId: BigNumberish, + trade: OptionMarket.TradeParametersStruct, + totalCost: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + merge( + positionIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nextId(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + partialCollatParams(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + penaltyRatio: BigNumber; + liquidatorFeeRatio: BigNumber; + smFeeRatio: BigNumber; + minLiquidationFee: BigNumber; + } + >; + + positions( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, number, BigNumber, BigNumber, number] & { + positionId: BigNumber; + strikeId: BigNumber; + optionType: number; + amount: BigNumber; + collateral: BigNumber; + state: number; + } + >; + + 'safeTransferFrom(address,address,uint256)'( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPartialCollateralParams( + _partialCollatParams: OptionToken.PartialCollateralParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setURI(newURI: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + settlePositions( + positionIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + split( + positionId: BigNumberish, + newAmount: BigNumberish, + newCollateral: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex(index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenOfOwnerByIndex(owner: string, index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenURI(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + addCollateral(positionId: BigNumberish, amountCollateral: BigNumberish, overrides?: CallOverrides): Promise; + + adjustPosition( + trade: OptionMarket.TradeParametersStruct, + strikeId: BigNumberish, + trader: string, + positionId: BigNumberish, + optionCost: BigNumberish, + setCollateralTo: BigNumberish, + isOpen: boolean, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { pendingCollateral: BigNumber }>; + + approve(to: string, tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + baseURI(overrides?: CallOverrides): Promise; + + canLiquidate( + position: OptionToken.OptionPositionStruct, + expiry: BigNumberish, + strikePrice: BigNumberish, + spotPrice: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiquidationFees( + gwavPremium: BigNumberish, + userPositionCollateral: BigNumberish, + convertedMinLiquidationFee: BigNumberish, + insolvencyMultiplier: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getOptionPosition( + positionId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getOptionPositions( + positionIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + getOwnerPositions(target: string, overrides?: CallOverrides): Promise; + + getPartialCollatParams(overrides?: CallOverrides): Promise; + + getPositionState(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionWithOwner( + positionId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPositionsWithOwner( + positionIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + init( + _optionMarket: string, + _greekCache: string, + _shortCollateral: string, + _synthetixAdapter: string, + overrides?: CallOverrides, + ): Promise; + + isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; + + liquidate( + positionId: BigNumberish, + trade: OptionMarket.TradeParametersStruct, + totalCost: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + merge(positionIds: BigNumberish[], overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + nextId(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + partialCollatParams(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + penaltyRatio: BigNumber; + liquidatorFeeRatio: BigNumber; + smFeeRatio: BigNumber; + minLiquidationFee: BigNumber; + } + >; + + positions( + arg0: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, number, BigNumber, BigNumber, number] & { + positionId: BigNumber; + strikeId: BigNumber; + optionType: number; + amount: BigNumber; + collateral: BigNumber; + state: number; + } + >; + + 'safeTransferFrom(address,address,uint256)'( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides, + ): Promise; + + setApprovalForAll(operator: string, approved: boolean, overrides?: CallOverrides): Promise; + + setPartialCollateralParams( + _partialCollatParams: OptionToken.PartialCollateralParametersStruct, + overrides?: CallOverrides, + ): Promise; + + setURI(newURI: string, overrides?: CallOverrides): Promise; + + settlePositions(positionIds: BigNumberish[], overrides?: CallOverrides): Promise; + + split( + positionId: BigNumberish, + newAmount: BigNumberish, + newCollateral: BigNumberish, + recipient: string, + overrides?: CallOverrides, + ): Promise; + + supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex(index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenOfOwnerByIndex(owner: string, index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenURI(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom(from: string, to: string, tokenId: BigNumberish, overrides?: CallOverrides): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null, + ): ApprovalEventFilter; + Approval(owner?: string | null, approved?: string | null, tokenId?: BigNumberish | null): ApprovalEventFilter; + + 'ApprovalForAll(address,address,bool)'( + owner?: string | null, + operator?: string | null, + approved?: null, + ): ApprovalForAllEventFilter; + ApprovalForAll(owner?: string | null, operator?: string | null, approved?: null): ApprovalForAllEventFilter; + + 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + 'PositionUpdated(uint256,address,uint8,tuple,uint256)'( + positionId?: BigNumberish | null, + owner?: string | null, + updatedType?: BigNumberish | null, + position?: null, + timestamp?: null, + ): PositionUpdatedEventFilter; + PositionUpdated( + positionId?: BigNumberish | null, + owner?: string | null, + updatedType?: BigNumberish | null, + position?: null, + timestamp?: null, + ): PositionUpdatedEventFilter; + + 'Transfer(address,address,uint256)'( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null, + ): TransferEventFilter; + Transfer(from?: string | null, to?: string | null, tokenId?: BigNumberish | null): TransferEventFilter; + }; + + estimateGas: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + adjustPosition( + trade: OptionMarket.TradeParametersStruct, + strikeId: BigNumberish, + trader: string, + positionId: BigNumberish, + optionCost: BigNumberish, + setCollateralTo: BigNumberish, + isOpen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + baseURI(overrides?: CallOverrides): Promise; + + canLiquidate( + position: OptionToken.OptionPositionStruct, + expiry: BigNumberish, + strikePrice: BigNumberish, + spotPrice: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiquidationFees( + gwavPremium: BigNumberish, + userPositionCollateral: BigNumberish, + convertedMinLiquidationFee: BigNumberish, + insolvencyMultiplier: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getOptionPosition(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getOptionPositions(positionIds: BigNumberish[], overrides?: CallOverrides): Promise; + + getOwnerPositions(target: string, overrides?: CallOverrides): Promise; + + getPartialCollatParams(overrides?: CallOverrides): Promise; + + getPositionState(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionWithOwner(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionsWithOwner(positionIds: BigNumberish[], overrides?: CallOverrides): Promise; + + init( + _optionMarket: string, + _greekCache: string, + _shortCollateral: string, + _synthetixAdapter: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; + + liquidate( + positionId: BigNumberish, + trade: OptionMarket.TradeParametersStruct, + totalCost: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + merge(positionIds: BigNumberish[], overrides?: Overrides & { from?: string | Promise }): Promise; + + name(overrides?: CallOverrides): Promise; + + nextId(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + partialCollatParams(overrides?: CallOverrides): Promise; + + positions(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + 'safeTransferFrom(address,address,uint256)'( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPartialCollateralParams( + _partialCollatParams: OptionToken.PartialCollateralParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setURI(newURI: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + settlePositions( + positionIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + split( + positionId: BigNumberish, + newAmount: BigNumberish, + newCollateral: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex(index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenOfOwnerByIndex(owner: string, index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenURI(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + addCollateral( + positionId: BigNumberish, + amountCollateral: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + adjustPosition( + trade: OptionMarket.TradeParametersStruct, + strikeId: BigNumberish, + trader: string, + positionId: BigNumberish, + optionCost: BigNumberish, + setCollateralTo: BigNumberish, + isOpen: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + baseURI(overrides?: CallOverrides): Promise; + + canLiquidate( + position: OptionToken.OptionPositionStruct, + expiry: BigNumberish, + strikePrice: BigNumberish, + spotPrice: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getApproved(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + getLiquidationFees( + gwavPremium: BigNumberish, + userPositionCollateral: BigNumberish, + convertedMinLiquidationFee: BigNumberish, + insolvencyMultiplier: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getOptionPosition(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getOptionPositions(positionIds: BigNumberish[], overrides?: CallOverrides): Promise; + + getOwnerPositions(target: string, overrides?: CallOverrides): Promise; + + getPartialCollatParams(overrides?: CallOverrides): Promise; + + getPositionState(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionWithOwner(positionId: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionsWithOwner(positionIds: BigNumberish[], overrides?: CallOverrides): Promise; + + init( + _optionMarket: string, + _greekCache: string, + _shortCollateral: string, + _synthetixAdapter: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isApprovedForAll(owner: string, operator: string, overrides?: CallOverrides): Promise; + + liquidate( + positionId: BigNumberish, + trade: OptionMarket.TradeParametersStruct, + totalCost: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + merge( + positionIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nextId(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + partialCollatParams(overrides?: CallOverrides): Promise; + + positions(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + 'safeTransferFrom(address,address,uint256)'( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPartialCollateralParams( + _partialCollatParams: OptionToken.PartialCollateralParametersStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setURI(newURI: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + settlePositions( + positionIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + split( + positionId: BigNumberish, + newAmount: BigNumberish, + newCollateral: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + supportsInterface(interfaceId: BytesLike, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex(index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenOfOwnerByIndex(owner: string, index: BigNumberish, overrides?: CallOverrides): Promise; + + tokenURI(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/lyra-avalon/contracts/ethers/common.ts b/src/apps/lyra-avalon/contracts/ethers/common.ts new file mode 100644 index 000000000..6cfb10425 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/common.ts @@ -0,0 +1,30 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { Listener } from '@ethersproject/providers'; +import type { Event, EventFilter } from 'ethers'; + +export interface TypedEvent = any, TArgsObject = any> extends Event { + args: TArgsArray & TArgsObject; +} + +export interface TypedEventFilter<_TEvent extends TypedEvent> extends EventFilter {} + +export interface TypedListener { + (...listenerArg: [...__TypechainArgsArray, TEvent]): void; +} + +type __TypechainArgsArray = T extends TypedEvent ? U : never; + +export interface OnEvent { + (eventFilter: TypedEventFilter, listener: TypedListener): TRes; + (eventName: string, listener: Listener): TRes; +} + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory ? C : never; + +export type GetARGsTypeFromFactory = F extends MinEthersFactory ? Parameters : never; diff --git a/src/apps/lyra-avalon/contracts/ethers/factories/LiquidityPool__factory.ts b/src/apps/lyra-avalon/contracts/ethers/factories/LiquidityPool__factory.ts new file mode 100644 index 000000000..7eae8b2b7 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/factories/LiquidityPool__factory.ts @@ -0,0 +1,2378 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { LiquidityPool, LiquidityPoolInterface } from '../LiquidityPool'; + +const _abi = [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + ], + name: 'AlreadyInitialised', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'BaseTransferFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'currentValue', + type: 'uint256', + }, + ], + name: 'HedgerIsNotEmpty', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'pendingBase', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'estimatedExchangeCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + ], + name: 'InsufficientFreeLiquidityForBaseExchange', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'InvalidBeneficiaryAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'minDepositWithdraw', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'address', + name: 'guardianMultisig', + type: 'address', + }, + { + internalType: 'uint256', + name: 'guardianDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardSettlementCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxFeePaid', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.LiquidityPoolParameters', + name: 'lpParams', + type: 'tuple', + }, + ], + name: 'InvalidLiquidityPoolParameters', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'quoteToLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'quote', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'base', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.Collateral', + name: 'lockedCollateral', + type: 'tuple', + }, + ], + name: 'LockingMoreQuoteThanIsFree', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountQuote', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minDeposit', + type: 'uint256', + }, + ], + name: 'MinimumDepositNotMet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountLiquidityTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minWithdraw', + type: 'uint256', + }, + ], + name: 'MinimumWithdrawNotMet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountQuote', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'burnableLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedCollatLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pendingDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'NAV', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.Liquidity', + name: 'liquidity', + type: 'tuple', + }, + ], + name: 'NotEnoughFreeToReclaimInsolvency', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'nominatedOwner', + type: 'address', + }, + ], + name: 'OnlyNominatedOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'optionMarket', + type: 'address', + }, + ], + name: 'OnlyOptionMarket', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'OnlyOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'poolHedger', + type: 'address', + }, + ], + name: 'OnlyPoolHedger', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'poolHedger', + type: 'address', + }, + ], + name: 'OnlyShortCollateral', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'int256', + name: 'totalAssetValue', + type: 'int256', + }, + { + internalType: 'int256', + name: 'optionValueDebt', + type: 'int256', + }, + ], + name: 'OptionValueDebtExceedsTotalAssets', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'QuoteTransferFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'premium', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reservedFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + ], + name: 'SendPremiumNotEnoughCollateral', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'baseFreed', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'lockedCollateralBase', + type: 'uint256', + }, + ], + name: 'BaseFreed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'baseLocked', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'lockedCollateralBase', + type: 'uint256', + }, + ], + name: 'BaseLocked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'quoteSpent', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'baseReceived', + type: 'uint256', + }, + ], + name: 'BasePurchased', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amountBase', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'quoteReceived', + type: 'uint256', + }, + ], + name: 'BaseSold', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'insolventSettlementAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountQuoteReserved', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalOutstandingSettlements', + type: 'uint256', + }, + ], + name: 'BoardSettlement', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTimestamp', + type: 'uint256', + }, + ], + name: 'BoardSettlementCircuitBreakerUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'entryId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'boardNotStale', + type: 'bool', + }, + { + indexed: false, + internalType: 'bool', + name: 'validEntry', + type: 'bool', + }, + { + indexed: false, + internalType: 'bool', + name: 'guardianBypass', + type: 'bool', + }, + { + indexed: false, + internalType: 'bool', + name: 'delaysExpired', + type: 'bool', + }, + ], + name: 'CheckingCanProcess', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTimestamp', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'ivVarianceThresholdCrossed', + type: 'bool', + }, + { + indexed: false, + internalType: 'bool', + name: 'skewVarianceThresholdCrossed', + type: 'bool', + }, + { + indexed: false, + internalType: 'bool', + name: 'liquidityThresholdCrossed', + type: 'bool', + }, + ], + name: 'CircuitBreakerUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'depositQueueId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountDeposited', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenPrice', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokensReceived', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'DepositProcessed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'depositor', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'depositQueueId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountDeposited', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalQueuedDeposits', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'DepositQueued', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amountQuoteAdded', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalInsolventSettlementAmount', + type: 'uint256', + }, + ], + name: 'InsolventSettlementAmountUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'minDepositWithdraw', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'address', + name: 'guardianMultisig', + type: 'address', + }, + { + internalType: 'uint256', + name: 'guardianDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardSettlementCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxFeePaid', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LiquidityPool.LiquidityPoolParameters', + name: 'lpParams', + type: 'tuple', + }, + ], + name: 'LiquidityPoolParametersUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalOutstandingSettlements', + type: 'uint256', + }, + ], + name: 'OutstandingSettlementSent', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oldOwner', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerNominated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'contract PoolHedger', + name: 'poolHedger', + type: 'address', + }, + ], + name: 'PoolHedgerUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'recipientPortion', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'optionMarketPortion', + type: 'uint256', + }, + ], + name: 'PremiumTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'quoteFreed', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'lockedCollateralQuote', + type: 'uint256', + }, + ], + name: 'QuoteFreed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'quoteLocked', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'lockedCollateralQuote', + type: 'uint256', + }, + ], + name: 'QuoteLocked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amountQuote', + type: 'uint256', + }, + ], + name: 'QuoteTransferredToPoolHedger', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'withdrawalQueueId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountWithdrawn', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenPrice', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'quoteReceived', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalQueuedWithdrawals', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'WithdrawPartiallyProcessed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'withdrawalQueueId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountWithdrawn', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenPrice', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'quoteReceived', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalQueuedWithdrawals', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'WithdrawProcessed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'withdrawer', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'withdrawalQueueId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountWithdrawn', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalQueuedWithdrawals', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'WithdrawQueued', + type: 'event', + }, + { + inputs: [], + name: 'CBTimestamp', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'acceptOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'insolventSettlements', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountQuoteFreed', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountQuoteReserved', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountBaseFreed', + type: 'uint256', + }, + ], + name: 'boardSettlement', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'exchangeBase', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountQuoteFreed', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reservedFee', + type: 'uint256', + }, + ], + name: 'freeQuoteCollateralAndSendPremium', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'basePrice', + type: 'uint256', + }, + { + internalType: 'contract ICollateralShort', + name: 'short', + type: 'address', + }, + ], + name: 'getLiquidity', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'burnableLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedCollatLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pendingDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'NAV', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.Liquidity', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLiquidityParams', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'burnableLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedCollatLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pendingDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'NAV', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.Liquidity', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLpParams', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'minDepositWithdraw', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'address', + name: 'guardianMultisig', + type: 'address', + }, + { + internalType: 'uint256', + name: 'guardianDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardSettlementCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxFeePaid', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.LiquidityPoolParameters', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenPrice', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTotalPoolValueQuote', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTotalTokenSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract SynthetixAdapter', + name: '_synthetixAdapter', + type: 'address', + }, + { + internalType: 'contract OptionMarket', + name: '_optionMarket', + type: 'address', + }, + { + internalType: 'contract LiquidityTokens', + name: '_liquidityTokens', + type: 'address', + }, + { + internalType: 'contract OptionGreekCache', + name: '_greekCache', + type: 'address', + }, + { + internalType: 'contract PoolHedger', + name: '_poolHedger', + type: 'address', + }, + { + internalType: 'contract ShortCollateral', + name: '_shortCollateral', + type: 'address', + }, + { + internalType: 'contract ERC20', + name: '_quoteAsset', + type: 'address', + }, + { + internalType: 'contract ERC20', + name: '_baseAsset', + type: 'address', + }, + ], + name: 'init', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountQuote', + type: 'uint256', + }, + ], + name: 'initiateDeposit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountLiquidityTokens', + type: 'uint256', + }, + ], + name: 'initiateWithdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'insolventSettlementAmount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountBase', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reservedFee', + type: 'uint256', + }, + ], + name: 'liquidateBaseAndSendPremium', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'liquidationInsolventAmount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'quoteKey', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'baseKey', + type: 'bytes32', + }, + { + internalType: 'contract ICollateralShort', + name: 'short', + type: 'address', + }, + { + internalType: 'uint256', + name: 'quoteBaseFeeRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseQuoteFeeRate', + type: 'uint256', + }, + ], + internalType: 'struct SynthetixAdapter.ExchangeParams', + name: 'exchangeParams', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + ], + name: 'lockBase', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + ], + name: 'lockQuote', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'lockedCollateral', + outputs: [ + { + internalType: 'uint256', + name: 'quote', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'base', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lpParams', + outputs: [ + { + internalType: 'uint256', + name: 'minDepositWithdraw', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'address', + name: 'guardianMultisig', + type: 'address', + }, + { + internalType: 'uint256', + name: 'guardianDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardSettlementCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxFeePaid', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nextQueuedDepositId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nextQueuedWithdrawalId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'nominateNewOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'nominatedOwner', + 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: 'poolHedger', + outputs: [ + { + internalType: 'contract PoolHedger', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'limit', + type: 'uint256', + }, + ], + name: 'processDepositQueue', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'limit', + type: 'uint256', + }, + ], + name: 'processWithdrawalQueue', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'queuedDepositHead', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'queuedDeposits', + outputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'mintedTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositInitiatedTime', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'queuedWithdrawalHead', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'queuedWithdrawals', + outputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'quoteSent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawInitiatedTime', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'quoteKey', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'baseKey', + type: 'bytes32', + }, + { + internalType: 'contract ICollateralShort', + name: 'short', + type: 'address', + }, + { + internalType: 'uint256', + name: 'quoteBaseFeeRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseQuoteFeeRate', + type: 'uint256', + }, + ], + internalType: 'struct SynthetixAdapter.ExchangeParams', + name: 'exchangeParams', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'amountBase', + type: 'uint256', + }, + ], + name: 'reclaimInsolventBase', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'quoteKey', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'baseKey', + type: 'bytes32', + }, + { + internalType: 'contract ICollateralShort', + name: 'short', + type: 'address', + }, + { + internalType: 'uint256', + name: 'quoteBaseFeeRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseQuoteFeeRate', + type: 'uint256', + }, + ], + internalType: 'struct SynthetixAdapter.ExchangeParams', + name: 'exchangeParams', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'amountQuote', + type: 'uint256', + }, + ], + name: 'reclaimInsolventQuote', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'sendSettlementValue', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'premium', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reservedFee', + type: 'uint256', + }, + ], + name: 'sendShortPremium', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'minDepositWithdraw', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawalFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidityCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewVarianceCBTimeout', + type: 'uint256', + }, + { + internalType: 'address', + name: 'guardianMultisig', + type: 'address', + }, + { + internalType: 'uint256', + name: 'guardianDelay', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardSettlementCBTimeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxFeePaid', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.LiquidityPoolParameters', + name: '_lpParams', + type: 'tuple', + }, + ], + name: 'setLiquidityPoolParameters', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract PoolHedger', + name: 'newPoolHedger', + type: 'address', + }, + ], + name: 'setPoolHedger', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'totalOutstandingSettlements', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalQueuedDeposits', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalQueuedWithdrawals', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'quoteKey', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'baseKey', + type: 'bytes32', + }, + { + internalType: 'contract ICollateralShort', + name: 'short', + type: 'address', + }, + { + internalType: 'uint256', + name: 'quoteBaseFeeRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseQuoteFeeRate', + type: 'uint256', + }, + ], + internalType: 'struct SynthetixAdapter.ExchangeParams', + name: 'exchangeParams', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferQuoteToHedge', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'updateCBs', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'insolvencyAmountInQuote', + type: 'uint256', + }, + ], + name: 'updateLiquidationInsolvency', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class LiquidityPool__factory { + static readonly abi = _abi; + static createInterface(): LiquidityPoolInterface { + return new utils.Interface(_abi) as LiquidityPoolInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): LiquidityPool { + return new Contract(address, _abi, signerOrProvider) as LiquidityPool; + } +} diff --git a/src/apps/lyra-avalon/contracts/ethers/factories/LiquidityToken__factory.ts b/src/apps/lyra-avalon/contracts/ethers/factories/LiquidityToken__factory.ts new file mode 100644 index 000000000..d43dda20b --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/factories/LiquidityToken__factory.ts @@ -0,0 +1,546 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { LiquidityToken, LiquidityTokenInterface } from '../LiquidityToken'; + +const _abi = [ + { + inputs: [ + { + internalType: 'string', + name: '_name', + type: 'string', + }, + { + internalType: 'string', + name: '_symbol', + type: 'string', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + ], + name: 'AlreadyInitialised', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'liquidityPool', + type: 'address', + }, + ], + name: 'OnlyLiquidityPool', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'nominatedOwner', + type: 'address', + }, + ], + name: 'OnlyNominatedOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'OnlyOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oldOwner', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerNominated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [], + name: 'acceptOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenAmount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_liquidityPool', + type: 'address', + }, + ], + name: 'init', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'liquidityPool', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'liquidityTracker', + outputs: [ + { + internalType: 'contract ILiquidityTracker', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenAmount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'nominateNewOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'nominatedOwner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract ILiquidityTracker', + name: '_liquidityTracker', + type: 'address', + }, + ], + name: 'setLiquidityTracker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class LiquidityToken__factory { + static readonly abi = _abi; + static createInterface(): LiquidityTokenInterface { + return new utils.Interface(_abi) as LiquidityTokenInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): LiquidityToken { + return new Contract(address, _abi, signerOrProvider) as LiquidityToken; + } +} diff --git a/src/apps/lyra-avalon/contracts/ethers/factories/LyraRegistry__factory.ts b/src/apps/lyra-avalon/contracts/ethers/factories/LyraRegistry__factory.ts new file mode 100644 index 000000000..d6b226c8c --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/factories/LyraRegistry__factory.ts @@ -0,0 +1,446 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { LyraRegistry, LyraRegistryInterface } from '../LyraRegistry'; + +const _abi = [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'nominatedOwner', + type: 'address', + }, + ], + name: 'OnlyNominatedOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'OnlyOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'name', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'GlobalAddressUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract OptionMarket', + name: 'market', + type: 'address', + }, + ], + name: 'MarketRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract OptionMarket', + name: 'optionMarket', + type: 'address', + }, + { + components: [ + { + internalType: 'contract LiquidityPool', + name: 'liquidityPool', + type: 'address', + }, + { + internalType: 'contract LiquidityTokens', + name: 'liquidityTokens', + type: 'address', + }, + { + internalType: 'contract OptionGreekCache', + name: 'greekCache', + type: 'address', + }, + { + internalType: 'contract OptionMarket', + name: 'optionMarket', + type: 'address', + }, + { + internalType: 'contract OptionMarketPricer', + name: 'optionMarketPricer', + type: 'address', + }, + { + internalType: 'contract OptionToken', + name: 'optionToken', + type: 'address', + }, + { + internalType: 'contract PoolHedger', + name: 'poolHedger', + type: 'address', + }, + { + internalType: 'contract ShortCollateral', + name: 'shortCollateral', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'quoteAsset', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'baseAsset', + type: 'address', + }, + ], + indexed: false, + internalType: 'struct LyraRegistry.OptionMarketAddresses', + name: 'market', + type: 'tuple', + }, + ], + name: 'MarketUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oldOwner', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerNominated', + type: 'event', + }, + { + inputs: [], + name: 'acceptOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'contract LiquidityPool', + name: 'liquidityPool', + type: 'address', + }, + { + internalType: 'contract LiquidityTokens', + name: 'liquidityTokens', + type: 'address', + }, + { + internalType: 'contract OptionGreekCache', + name: 'greekCache', + type: 'address', + }, + { + internalType: 'contract OptionMarket', + name: 'optionMarket', + type: 'address', + }, + { + internalType: 'contract OptionMarketPricer', + name: 'optionMarketPricer', + type: 'address', + }, + { + internalType: 'contract OptionToken', + name: 'optionToken', + type: 'address', + }, + { + internalType: 'contract PoolHedger', + name: 'poolHedger', + type: 'address', + }, + { + internalType: 'contract ShortCollateral', + name: 'shortCollateral', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'quoteAsset', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'baseAsset', + type: 'address', + }, + ], + internalType: 'struct LyraRegistry.OptionMarketAddresses', + name: 'newMarketAddresses', + type: 'tuple', + }, + ], + name: 'addMarket', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'globalAddresses', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract OptionMarket', + name: '', + type: 'address', + }, + ], + name: 'marketAddresses', + outputs: [ + { + internalType: 'contract LiquidityPool', + name: 'liquidityPool', + type: 'address', + }, + { + internalType: 'contract LiquidityTokens', + name: 'liquidityTokens', + type: 'address', + }, + { + internalType: 'contract OptionGreekCache', + name: 'greekCache', + type: 'address', + }, + { + internalType: 'contract OptionMarket', + name: 'optionMarket', + type: 'address', + }, + { + internalType: 'contract OptionMarketPricer', + name: 'optionMarketPricer', + type: 'address', + }, + { + internalType: 'contract OptionToken', + name: 'optionToken', + type: 'address', + }, + { + internalType: 'contract PoolHedger', + name: 'poolHedger', + type: 'address', + }, + { + internalType: 'contract ShortCollateral', + name: 'shortCollateral', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'quoteAsset', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'baseAsset', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'nominateNewOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'nominatedOwner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'optionMarkets', + outputs: [ + { + internalType: 'contract OptionMarket', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract OptionMarket', + name: 'market', + type: 'address', + }, + ], + name: 'removeMarket', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32[]', + name: 'names', + type: 'bytes32[]', + }, + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'updateGlobalAddresses', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class LyraRegistry__factory { + static readonly abi = _abi; + static createInterface(): LyraRegistryInterface { + return new utils.Interface(_abi) as LyraRegistryInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): LyraRegistry { + return new Contract(address, _abi, signerOrProvider) as LyraRegistry; + } +} diff --git a/src/apps/lyra-avalon/contracts/ethers/factories/OptionMarket__factory.ts b/src/apps/lyra-avalon/contracts/ethers/factories/OptionMarket__factory.ts new file mode 100644 index 000000000..4badb5239 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/factories/OptionMarket__factory.ts @@ -0,0 +1,1981 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { OptionMarket, OptionMarketInterface } from '../OptionMarket'; + +const _abi = [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + ], + name: 'AlreadyInitialised', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'BaseTransferFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'BoardAlreadySettled', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardExpiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'currentTime', + type: 'uint256', + }, + ], + name: 'BoardExpired', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'BoardIsFrozen', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'BoardNotExpired', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'BoardNotFrozen', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'enum OptionMarket.NonZeroValues', + name: 'valueType', + type: 'uint8', + }, + ], + name: 'ExpectedNonZeroValue', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'InvalidBoardId', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'currentTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxBoardExpiry', + type: 'uint256', + }, + ], + name: 'InvalidExpiryTimestamp', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'maxBoardExpiry', + type: 'uint256', + }, + { + internalType: 'address', + name: 'securityModule', + type: 'address', + }, + { + internalType: 'uint256', + name: 'feePortionReserved', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.OptionMarketParameters', + name: 'optionMarketParams', + type: 'tuple', + }, + ], + name: 'InvalidOptionMarketParams', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + ], + name: 'InvalidStrikeId', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'nominatedOwner', + type: 'address', + }, + ], + name: 'OnlyNominatedOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'OnlyOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'securityModule', + type: 'address', + }, + ], + name: 'OnlySecurityModule', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'QuoteTransferFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'strikesLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewsLength', + type: 'uint256', + }, + ], + name: 'StrikeSkewLengthMismatch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxCost', + type: 'uint256', + }, + ], + name: 'TotalCostOutsideOfSpecifiedBounds', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'iterations', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expectedAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'tradeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalAmount', + type: 'uint256', + }, + ], + name: 'TradeIterationsHasRemainder', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'baseIv', + type: 'uint256', + }, + ], + name: 'BoardBaseIvSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'baseIv', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + name: 'BoardCreated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + name: 'BoardFrozen', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'spotPriceAtExpiry', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalUserLongProfitQuote', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalBoardLongCallCollateral', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalBoardLongPutCollateral', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalAMMShortCallProfitBase', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalAMMShortCallProfitQuote', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalAMMShortPutProfitQuote', + type: 'uint256', + }, + ], + name: 'BoardSettled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'maxBoardExpiry', + type: 'uint256', + }, + { + internalType: 'address', + name: 'securityModule', + type: 'address', + }, + { + internalType: 'uint256', + name: 'feePortionReserved', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct OptionMarket.OptionMarketParameters', + name: 'optionMarketParams', + type: 'tuple', + }, + ], + name: 'OptionMarketParamsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oldOwner', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerNominated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'securityModule', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'quoteAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'baseAmount', + type: 'uint256', + }, + ], + name: 'SMClaimed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + ], + name: 'StrikeAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + ], + name: 'StrikeSkewSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'trader', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'enum OptionMarket.TradeDirection', + name: 'tradeDirection', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'setCollateralTo', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'isForceClose', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reservedFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct OptionMarket.TradeEventData', + name: 'trade', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'premium', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'optionPriceFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'spotPriceFee', + type: 'uint256', + }, + { + components: [ + { + internalType: 'int256', + name: 'preTradeAmmNetStdVega', + type: 'int256', + }, + { + internalType: 'int256', + name: 'postTradeAmmNetStdVega', + type: 'int256', + }, + { + internalType: 'uint256', + name: 'vegaUtil', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'volTraded', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'NAV', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'vegaUtilFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarketPricer.VegaUtilFeeComponents', + name: 'vegaUtilFee', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'varianceFeeCoefficient', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'vega', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'vegaCoefficient', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skewCoefficient', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVariance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ivVarianceCoefficient', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'varianceFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarketPricer.VarianceFeeComponents', + name: 'varianceFee', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'totalFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'volTraded', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newBaseIv', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newSkew', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct OptionMarketPricer.TradeResult[]', + name: 'tradeResults', + type: 'tuple[]', + }, + { + components: [ + { + internalType: 'address', + name: 'rewardBeneficiary', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'uint256', + name: 'returnCollateral', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lpPremiums', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lpFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidatorFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'smFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'insolventAmount', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct OptionMarket.LiquidationEventData', + name: 'liquidation', + type: 'tuple', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'Trade', + type: 'event', + }, + { + inputs: [], + name: 'acceptOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountCollateral', + type: 'uint256', + }, + ], + name: 'addCollateral', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + ], + name: 'addStrikeToBoard', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'boardToPriceAtExpiry', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'iterations', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'setCollateralTo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTotalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTotalCost', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.TradeInputParameters', + name: 'params', + type: 'tuple', + }, + ], + name: 'closePosition', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.Result', + name: 'result', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseIV', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'strikePrices', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'skews', + type: 'uint256[]', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + name: 'createOptionBoard', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'iterations', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'setCollateralTo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTotalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTotalCost', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.TradeInputParameters', + name: 'params', + type: 'tuple', + }, + ], + name: 'forceClosePosition', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.Result', + name: 'result', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'forceSettleBoard', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'getBoardAndStrikeDetails', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'iv', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + { + internalType: 'uint256[]', + name: 'strikeIds', + type: 'uint256[]', + }, + ], + internalType: 'struct OptionMarket.OptionBoard', + name: '', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'longCall', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortCallBase', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortCallQuote', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'longPut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortPut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.Strike[]', + name: '', + type: 'tuple[]', + }, + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'getBoardStrikes', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLiveBoards', + outputs: [ + { + internalType: 'uint256[]', + name: '_liveBoards', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNumLiveBoards', + outputs: [ + { + internalType: 'uint256', + name: 'numLiveBoards', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'getOptionBoard', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'iv', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + { + internalType: 'uint256[]', + name: 'strikeIds', + type: 'uint256[]', + }, + ], + internalType: 'struct OptionMarket.OptionBoard', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + ], + name: 'getSettlementParameters', + outputs: [ + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'priceAtExpiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeToBaseReturned', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + ], + name: 'getStrike', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'longCall', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortCallBase', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortCallQuote', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'longPut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortPut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.Strike', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + ], + name: 'getStrikeAndBoard', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'longCall', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortCallBase', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortCallQuote', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'longPut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'shortPut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.Strike', + name: '', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'iv', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + { + internalType: 'uint256[]', + name: 'strikeIds', + type: 'uint256[]', + }, + ], + internalType: 'struct OptionMarket.OptionBoard', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + ], + name: 'getStrikeAndExpiry', + outputs: [ + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract SynthetixAdapter', + name: '_synthetixAdapter', + type: 'address', + }, + { + internalType: 'contract LiquidityPool', + name: '_liquidityPool', + type: 'address', + }, + { + internalType: 'contract OptionMarketPricer', + name: '_optionPricer', + type: 'address', + }, + { + internalType: 'contract OptionGreekCache', + name: '_greekCache', + type: 'address', + }, + { + internalType: 'contract ShortCollateral', + name: '_shortCollateral', + type: 'address', + }, + { + internalType: 'contract OptionToken', + name: '_optionToken', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: '_quoteAsset', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: '_baseAsset', + type: 'address', + }, + ], + name: 'init', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'rewardBeneficiary', + type: 'address', + }, + ], + name: 'liquidatePosition', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'nominateNewOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'nominatedOwner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'iterations', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'setCollateralTo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTotalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTotalCost', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.TradeInputParameters', + name: 'params', + type: 'tuple', + }, + ], + name: 'openPosition', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.Result', + name: 'result', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'optionMarketParams', + outputs: [ + { + internalType: 'uint256', + name: 'maxBoardExpiry', + type: 'uint256', + }, + { + internalType: 'address', + name: 'securityModule', + type: 'address', + }, + { + internalType: 'uint256', + name: 'feePortionReserved', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseIv', + type: 'uint256', + }, + ], + name: 'setBoardBaseIv', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + name: 'setBoardFrozen', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'maxBoardExpiry', + type: 'uint256', + }, + { + internalType: 'address', + name: 'securityModule', + type: 'address', + }, + { + internalType: 'uint256', + name: 'feePortionReserved', + type: 'uint256', + }, + ], + internalType: 'struct OptionMarket.OptionMarketParameters', + name: '_optionMarketParams', + type: 'tuple', + }, + ], + name: 'setOptionMarketParams', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'skew', + type: 'uint256', + }, + ], + name: 'setStrikeSkew', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'boardId', + type: 'uint256', + }, + ], + name: 'settleExpiredBoard', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'smClaim', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'strikeToBaseReturnedRatio', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, +]; + +export class OptionMarket__factory { + static readonly abi = _abi; + static createInterface(): OptionMarketInterface { + return new utils.Interface(_abi) as OptionMarketInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): OptionMarket { + return new Contract(address, _abi, signerOrProvider) as OptionMarket; + } +} diff --git a/src/apps/lyra-avalon/contracts/ethers/factories/OptionToken__factory.ts b/src/apps/lyra-avalon/contracts/ethers/factories/OptionToken__factory.ts new file mode 100644 index 000000000..01b113499 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/factories/OptionToken__factory.ts @@ -0,0 +1,2275 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { OptionToken, OptionTokenInterface } from '../OptionToken'; + +const _abi = [ + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'invalidPositionId', + type: 'bool', + }, + { + internalType: 'bool', + name: 'positionInactive', + type: 'bool', + }, + { + internalType: 'bool', + name: 'isShort', + type: 'bool', + }, + ], + name: 'AddingCollateralToInvalidPosition', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: 'position', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + ], + name: 'AdjustmentResultsInMinimumCollateralNotBeingMet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + ], + name: 'AlreadyInitialised', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'invalidPositionId', + type: 'bool', + }, + { + internalType: 'bool', + name: 'positionInactive', + type: 'bool', + }, + { + internalType: 'bool', + name: 'strikeMismatch', + type: 'bool', + }, + { + internalType: 'bool', + name: 'optionTypeMismatch', + type: 'bool', + }, + ], + name: 'CannotAdjustInvalidPosition', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + ], + name: 'CannotClosePositionZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + ], + name: 'CannotOpenZeroAmount', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'setCollateralTo', + type: 'uint256', + }, + ], + name: 'FullyClosingWithNonZeroSetCollateral', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'penaltyRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidatorFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'smFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minLiquidationFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionToken.PartialCollateralParameters', + name: 'partialCollatParams', + type: 'tuple', + }, + ], + name: 'InvalidPartialCollateralParameters', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'originalPositionAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'splitAmount', + type: 'uint256', + }, + ], + name: 'InvalidSplitAmount', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + ], + name: 'MergingUnapprovedPosition', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + ], + name: 'MustMergeTwoOrMorePositions', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'nominatedOwner', + type: 'address', + }, + ], + name: 'OnlyNominatedOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'optionMarket', + type: 'address', + }, + ], + name: 'OnlyOptionMarket', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'OnlyOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'trader', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'OnlyOwnerCanAdjustPosition', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'address', + name: 'shortCollateral', + type: 'address', + }, + ], + name: 'OnlyShortCollateral', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: 'firstPosition', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: 'nextPosition', + type: 'tuple', + }, + { + internalType: 'bool', + name: 'ownerMismatch', + type: 'bool', + }, + { + internalType: 'bool', + name: 'strikeMismatch', + type: 'bool', + }, + { + internalType: 'bool', + name: 'optionTypeMismatch', + type: 'bool', + }, + { + internalType: 'bool', + name: 'duplicatePositionId', + type: 'bool', + }, + ], + name: 'PositionMismatchWhenMerging', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: 'position', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + ], + name: 'PositionNotLiquidatable', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: 'position', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + ], + name: 'ResultingNewPositionLiquidatable', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: 'position', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + ], + name: 'ResultingOriginalPositionLiquidatable', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'thrower', + type: 'address', + }, + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + ], + name: 'SplittingUnapprovedPosition', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oldOwner', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerNominated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'enum OptionToken.PositionUpdatedType', + name: 'updatedType', + type: 'uint8', + }, + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + indexed: false, + internalType: 'struct OptionToken.OptionPosition', + name: 'position', + type: 'tuple', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'PositionUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [], + name: 'acceptOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountCollateral', + type: 'uint256', + }, + ], + name: 'addCollateral', + outputs: [ + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'bool', + name: 'isBuy', + type: 'bool', + }, + { + internalType: 'bool', + name: 'isForceClose', + type: 'bool', + }, + { + internalType: 'enum OptionMarket.TradeDirection', + name: 'tradeDirection', + type: 'uint8', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'burnableLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedCollatLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pendingDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'NAV', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.Liquidity', + name: 'liquidity', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'quoteKey', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'baseKey', + type: 'bytes32', + }, + { + internalType: 'contract ICollateralShort', + name: 'short', + type: 'address', + }, + { + internalType: 'uint256', + name: 'quoteBaseFeeRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseQuoteFeeRate', + type: 'uint256', + }, + ], + internalType: 'struct SynthetixAdapter.ExchangeParams', + name: 'exchangeParams', + type: 'tuple', + }, + ], + internalType: 'struct OptionMarket.TradeParameters', + name: 'trade', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'trader', + type: 'address', + }, + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'optionCost', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'setCollateralTo', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'isOpen', + type: 'bool', + }, + ], + name: 'adjustPosition', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'int256', + name: 'pendingCollateral', + type: 'int256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'baseURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: 'position', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + ], + name: 'canLiquidate', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'gwavPremium', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'userPositionCollateral', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'convertedMinLiquidationFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'insolvencyMultiplier', + type: 'uint256', + }, + ], + name: 'getLiquidationFees', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'returnCollateral', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lpPremiums', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lpFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidatorFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'smFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'insolventAmount', + type: 'uint256', + }, + ], + internalType: 'struct OptionToken.LiquidationFees', + name: 'liquidationFees', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + ], + name: 'getOptionPosition', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'positionIds', + type: 'uint256[]', + }, + ], + name: 'getOptionPositions', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + ], + name: 'getOwnerPositions', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct OptionToken.OptionPosition[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPartialCollatParams', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'penaltyRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidatorFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'smFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minLiquidationFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionToken.PartialCollateralParameters', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + ], + name: 'getPositionState', + outputs: [ + { + internalType: 'enum OptionToken.PositionState', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + ], + name: 'getPositionWithOwner', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + internalType: 'struct OptionToken.PositionWithOwner', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'positionIds', + type: 'uint256[]', + }, + ], + name: 'getPositionsWithOwner', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + internalType: 'struct OptionToken.PositionWithOwner[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract OptionMarket', + name: '_optionMarket', + type: 'address', + }, + { + internalType: 'contract OptionGreekCache', + name: '_greekCache', + type: 'address', + }, + { + internalType: 'address', + name: '_shortCollateral', + type: 'address', + }, + { + internalType: 'contract SynthetixAdapter', + name: '_synthetixAdapter', + type: 'address', + }, + ], + name: 'init', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'bool', + name: 'isBuy', + type: 'bool', + }, + { + internalType: 'bool', + name: 'isForceClose', + type: 'bool', + }, + { + internalType: 'enum OptionMarket.TradeDirection', + name: 'tradeDirection', + type: 'uint8', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikePrice', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'freeLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'burnableLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedCollatLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pendingDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usedDeltaLiquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'NAV', + type: 'uint256', + }, + ], + internalType: 'struct LiquidityPool.Liquidity', + name: 'liquidity', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'spotPrice', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'quoteKey', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'baseKey', + type: 'bytes32', + }, + { + internalType: 'contract ICollateralShort', + name: 'short', + type: 'address', + }, + { + internalType: 'uint256', + name: 'quoteBaseFeeRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'baseQuoteFeeRate', + type: 'uint256', + }, + ], + internalType: 'struct SynthetixAdapter.ExchangeParams', + name: 'exchangeParams', + type: 'tuple', + }, + ], + internalType: 'struct OptionMarket.TradeParameters', + name: 'trade', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'totalCost', + type: 'uint256', + }, + ], + name: 'liquidate', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'returnCollateral', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lpPremiums', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lpFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidatorFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'smFee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'insolventAmount', + type: 'uint256', + }, + ], + internalType: 'struct OptionToken.LiquidationFees', + name: 'liquidationFees', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'positionIds', + type: 'uint256[]', + }, + ], + name: 'merge', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nextId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'nominateNewOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'nominatedOwner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'partialCollatParams', + outputs: [ + { + internalType: 'uint256', + name: 'penaltyRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidatorFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'smFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minLiquidationFee', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'positions', + outputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'strikeId', + type: 'uint256', + }, + { + internalType: 'enum OptionMarket.OptionType', + name: 'optionType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'collateral', + type: 'uint256', + }, + { + internalType: 'enum OptionToken.PositionState', + name: 'state', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'penaltyRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidatorFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'smFeeRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minLiquidationFee', + type: 'uint256', + }, + ], + internalType: 'struct OptionToken.PartialCollateralParameters', + name: '_partialCollatParams', + type: 'tuple', + }, + ], + name: 'setPartialCollateralParams', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'newURI', + type: 'string', + }, + ], + name: 'setURI', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'positionIds', + type: 'uint256[]', + }, + ], + name: 'settlePositions', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'positionId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newCollateral', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'split', + outputs: [ + { + internalType: 'uint256', + name: 'newPositionId', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class OptionToken__factory { + static readonly abi = _abi; + static createInterface(): OptionTokenInterface { + return new utils.Interface(_abi) as OptionTokenInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): OptionToken { + return new Contract(address, _abi, signerOrProvider) as OptionToken; + } +} diff --git a/src/apps/lyra-avalon/contracts/ethers/factories/index.ts b/src/apps/lyra-avalon/contracts/ethers/factories/index.ts new file mode 100644 index 000000000..0c98eae05 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/factories/index.ts @@ -0,0 +1,8 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { LiquidityPool__factory } from './LiquidityPool__factory'; +export { LiquidityToken__factory } from './LiquidityToken__factory'; +export { LyraRegistry__factory } from './LyraRegistry__factory'; +export { OptionMarket__factory } from './OptionMarket__factory'; +export { OptionToken__factory } from './OptionToken__factory'; diff --git a/src/apps/lyra-avalon/contracts/ethers/index.ts b/src/apps/lyra-avalon/contracts/ethers/index.ts new file mode 100644 index 000000000..ee381a3c7 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/ethers/index.ts @@ -0,0 +1,14 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { LiquidityPool } from './LiquidityPool'; +export type { LiquidityToken } from './LiquidityToken'; +export type { LyraRegistry } from './LyraRegistry'; +export type { OptionMarket } from './OptionMarket'; +export type { OptionToken } from './OptionToken'; +export * as factories from './factories'; +export { LiquidityPool__factory } from './factories/LiquidityPool__factory'; +export { LiquidityToken__factory } from './factories/LiquidityToken__factory'; +export { LyraRegistry__factory } from './factories/LyraRegistry__factory'; +export { OptionMarket__factory } from './factories/OptionMarket__factory'; +export { OptionToken__factory } from './factories/OptionToken__factory'; diff --git a/src/apps/lyra-avalon/contracts/index.ts b/src/apps/lyra-avalon/contracts/index.ts new file mode 100644 index 000000000..559f2ad09 --- /dev/null +++ b/src/apps/lyra-avalon/contracts/index.ts @@ -0,0 +1,43 @@ +import { Injectable, Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { ContractFactory } from '~contract/contracts'; +import { Network } from '~types/network.interface'; + +import { LiquidityPool__factory } from './ethers'; +import { LiquidityToken__factory } from './ethers'; +import { LyraRegistry__factory } from './ethers'; +import { OptionMarket__factory } from './ethers'; +import { OptionToken__factory } from './ethers'; + +// eslint-disable-next-line +type ContractOpts = { address: string; network: Network }; + +@Injectable() +export class LyraAvalonContractFactory extends ContractFactory { + constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) { + super((network: Network) => appToolkit.getNetworkProvider(network)); + } + + liquidityPool({ address, network }: ContractOpts) { + return LiquidityPool__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + liquidityToken({ address, network }: ContractOpts) { + return LiquidityToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + lyraRegistry({ address, network }: ContractOpts) { + return LyraRegistry__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + optionMarket({ address, network }: ContractOpts) { + return OptionMarket__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + optionToken({ address, network }: ContractOpts) { + return OptionToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } +} + +export type { LiquidityPool } from './ethers'; +export type { LiquidityToken } from './ethers'; +export type { LyraRegistry } from './ethers'; +export type { OptionMarket } from './ethers'; +export type { OptionToken } from './ethers'; diff --git a/src/apps/lyra-avalon/index.ts b/src/apps/lyra-avalon/index.ts new file mode 100644 index 000000000..bcafa443a --- /dev/null +++ b/src/apps/lyra-avalon/index.ts @@ -0,0 +1,3 @@ +export { LYRA_AVALON_DEFINITION, LyraAvalonAppDefinition } from './lyra-avalon.definition'; +export { LyraAvalonAppModule } from './lyra-avalon.module'; +export { LyraAvalonContractFactory } from './contracts'; diff --git a/src/apps/lyra-avalon/lyra-avalon.definition.ts b/src/apps/lyra-avalon/lyra-avalon.definition.ts new file mode 100644 index 000000000..a07f72bc1 --- /dev/null +++ b/src/apps/lyra-avalon/lyra-avalon.definition.ts @@ -0,0 +1,44 @@ +import { Register } from '~app-toolkit/decorators'; +import { appDefinition, AppDefinition } from '~app/app.definition'; +import { AppAction, AppTag, GroupType } from '~app/app.interface'; +import { Network } from '~types/network.interface'; + +export const LYRA_AVALON_DEFINITION = appDefinition({ + id: 'lyra-avalon', + name: 'Lyra Avalon', + description: + 'Lyra is an options trading protocol accessing the scalability of Layer 2 Ethereum to provide a robust, lightning-fast and reliable trading experience.', + url: 'https://avalon.app.lyra.finance/', + + groups: { + options: { + id: 'options', + type: GroupType.TOKEN, + label: 'Options', + }, + pool: { + id: 'pool', + type: GroupType.TOKEN, + label: 'Liquidity Pool', + }, + }, + + tags: [AppTag.OPTIONS], + keywords: [], + links: {}, + + supportedNetworks: { + [Network.OPTIMISM_MAINNET]: [AppAction.VIEW], + }, + + primaryColor: '#fff', +}); + +@Register.AppDefinition(LYRA_AVALON_DEFINITION.id) +export class LyraAvalonAppDefinition extends AppDefinition { + constructor() { + super(LYRA_AVALON_DEFINITION); + } +} + +export default LYRA_AVALON_DEFINITION; diff --git a/src/apps/lyra-avalon/lyra-avalon.module.ts b/src/apps/lyra-avalon/lyra-avalon.module.ts new file mode 100644 index 000000000..9a6eecfe7 --- /dev/null +++ b/src/apps/lyra-avalon/lyra-avalon.module.ts @@ -0,0 +1,20 @@ +import { Register } from '~app-toolkit/decorators'; +import { AbstractApp } from '~app/app.dynamic-module'; + +import { LyraAvalonContractFactory } from './contracts'; +import { LyraAvalonAppDefinition, LYRA_AVALON_DEFINITION } from './lyra-avalon.definition'; +import { OptimismLyraAvalonBalanceFetcher } from './optimism/lyra-avalon.balance-fetcher'; +import { OptimismLyraAvalonOptionsContractPositionFetcher } from './optimism/lyra-avalon.options.contract-position-fetcher'; +import { OptimismLyraAvalonPoolTokenFetcher } from './optimism/lyra-avalon.pool.token-fetcher'; + +@Register.AppModule({ + appId: LYRA_AVALON_DEFINITION.id, + providers: [ + LyraAvalonAppDefinition, + LyraAvalonContractFactory, + OptimismLyraAvalonBalanceFetcher, + OptimismLyraAvalonOptionsContractPositionFetcher, + OptimismLyraAvalonPoolTokenFetcher, + ], +}) +export class LyraAvalonAppModule extends AbstractApp() {} diff --git a/src/apps/lyra-avalon/optimism/helpers/consts.ts b/src/apps/lyra-avalon/optimism/helpers/consts.ts new file mode 100644 index 000000000..6f608c61c --- /dev/null +++ b/src/apps/lyra-avalon/optimism/helpers/consts.ts @@ -0,0 +1,7 @@ +export const OPTION_TYPES = { + 0: 'Long Call', + 1: 'Long Put', + 2: 'Short Call Base', + 3: 'Short Call Quote', + 4: 'Short Put Quote', +}; diff --git a/src/apps/lyra-avalon/optimism/helpers/graph.ts b/src/apps/lyra-avalon/optimism/helpers/graph.ts new file mode 100644 index 000000000..0326a3a12 --- /dev/null +++ b/src/apps/lyra-avalon/optimism/helpers/graph.ts @@ -0,0 +1,68 @@ +import { gql } from 'graphql-request'; + +import { TheGraphHelper } from '~app-toolkit/helpers/the-graph/the-graph.helper'; + +type OptionPrice = { + latestOptionPriceAndGreeks: { + optionPrice: string; + }; +}; +type OptionsResponse = { + markets: { + id: string; + optionToken: { + id: string; + }; + baseAddress: string; + quoteAddress: string; + boards: { + strikes: { + strikeId: string; + strikePriceReadable: string; + putOption: OptionPrice; + callOption: OptionPrice; + }[]; + }[]; + }[]; +}; +const OPTIONS_QUERY = gql` + { + markets(where: { isRemoved: false }) { + id + baseAddress + quoteAddress + optionToken { + id + } + boards(where: { isExpired: false }) { + boardId + strikes { + strikeId + strikePriceReadable + putOption { + latestOptionPriceAndGreeks { + optionPrice + } + } + callOption { + latestOptionPriceAndGreeks { + optionPrice + } + } + } + } + } + } +`; +const subgraphUrl = 'https://api.thegraph.com/subgraphs/name/lyra-finance/mainnet'; + +export const runQuery = (graphHelper: TheGraphHelper, query) => { + return graphHelper.requestGraph({ + endpoint: subgraphUrl, + query, + }); +}; + +export const getOptions = (graphHelper: TheGraphHelper) => { + return runQuery(graphHelper, OPTIONS_QUERY); +}; diff --git a/src/apps/lyra-avalon/optimism/lyra-avalon.balance-fetcher.ts b/src/apps/lyra-avalon/optimism/lyra-avalon.balance-fetcher.ts new file mode 100644 index 000000000..b7d95691a --- /dev/null +++ b/src/apps/lyra-avalon/optimism/lyra-avalon.balance-fetcher.ts @@ -0,0 +1,119 @@ +import { Inject } from '@nestjs/common'; +import _ from 'lodash'; + +import { drillBalance } from '~app-toolkit'; +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { isSupplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { LyraAvalonContractFactory } from '../contracts'; +import { LYRA_AVALON_DEFINITION } from '../lyra-avalon.definition'; + +import { OPTION_TYPES } from './helpers/consts'; +import { getOptions } from './helpers/graph'; +import { LyraAvalonOptionContractPositionDataProps } from './lyra-avalon.options.contract-position-fetcher'; + +const appId = LYRA_AVALON_DEFINITION.id; +const network = Network.OPTIMISM_MAINNET; + +@Register.BalanceFetcher(LYRA_AVALON_DEFINITION.id, network) +export class OptimismLyraAvalonBalanceFetcher implements BalanceFetcher { + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(LyraAvalonContractFactory) private readonly contractFactory: LyraAvalonContractFactory, + ) {} + + async getPoolBalances(address: string) { + return await this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId, + groupId: LYRA_AVALON_DEFINITION.groups.pool.id, + network, + }); + } + + async getOptionsBalances(address: string) { + const multicall = this.appToolkit.getMulticall(network); + const response = await getOptions(this.appToolkit.helpers.theGraphHelper); + const markets = await Promise.all( + response.markets.map(async market => { + const tokenContract = this.contractFactory.optionToken({ + address: market.optionToken.id.toLowerCase(), + network, + }); + const userPositions = await multicall.wrap(tokenContract).getOwnerPositions(address); + return { + userPositions, + marketAddress: market.optionToken.id.toLowerCase(), + quoteAddress: market.quoteAddress, + strikes: _.flatten(market.boards.map(board => board.strikes)), + }; + }), + ); + + return this.appToolkit.helpers.contractPositionBalanceHelper.getContractPositionBalances({ + address, + appId, + groupId: LYRA_AVALON_DEFINITION.groups.options.id, + network, + resolveBalances: async ({ + contractPosition, + }: { + contractPosition: ContractPosition; + }) => { + // Find matching market for contract position + const market = markets.find(market => market.marketAddress === contractPosition.address); + if (!market?.strikes) return []; + + // Extract information from contract position + const { strikeId, optionType } = contractPosition.dataProps; + const collateralToken = contractPosition.tokens.find(isSupplied)!; + const quoteToken = contractPosition.tokens.find(token => token.address === market.quoteAddress.toLowerCase())!; + + // Find matching user position for contract position + const userPosition = market.userPositions.find( + position => Number(position.strikeId) === strikeId && position.optionType === optionType, + ); + if (!userPosition) return []; + + // Determine price of the contract position strike + const strike = market.strikes.find(strike => Number(strike.strikeId) === strikeId); + if (!strike) return []; + const price = (OPTION_TYPES[optionType].includes('Call') ? strike.callOption : strike.putOption) + .latestOptionPriceAndGreeks.optionPrice; + const balance = ((Number(price) * Number(userPosition.amount)) / 10 ** quoteToken.decimals).toString(); + + // Return balance. Note: may not be totally accurate + if (Number(optionType) >= 2) { + // Short Option + const debt = drillBalance(quoteToken, balance, { isDebt: true }); + const collateral = drillBalance(collateralToken, userPosition.collateral.toString()); + return [debt, collateral]; + } + return [drillBalance(quoteToken, balance)]; + }, + }); + } + + async getBalances(address: string) { + const [tokenBalances, optionsBalances] = await Promise.all([ + this.getPoolBalances(address), + this.getOptionsBalances(address), + ]); + + return presentBalanceFetcherResponse([ + { + label: 'Pools', + assets: tokenBalances, + }, + { + label: 'Options', + assets: optionsBalances, + }, + ]); + } +} diff --git a/src/apps/lyra-avalon/optimism/lyra-avalon.options.contract-position-fetcher.ts b/src/apps/lyra-avalon/optimism/lyra-avalon.options.contract-position-fetcher.ts new file mode 100644 index 000000000..efe90c659 --- /dev/null +++ b/src/apps/lyra-avalon/optimism/lyra-avalon.options.contract-position-fetcher.ts @@ -0,0 +1,74 @@ +import { Inject } from '@nestjs/common'; +import _ from 'lodash'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { getAppImg } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { DefaultDataProps } from '~position/display.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { ContractPosition } from '~position/position.interface'; +import { supplied } from '~position/position.utils'; +import { Network } from '~types/network.interface'; + +import { LYRA_AVALON_DEFINITION } from '../lyra-avalon.definition'; + +import { OPTION_TYPES } from './helpers/consts'; +import { getOptions } from './helpers/graph'; + +const appId = LYRA_AVALON_DEFINITION.id; +const groupId = LYRA_AVALON_DEFINITION.groups.options.id; +const network = Network.OPTIMISM_MAINNET; + +export interface LyraAvalonOptionContractPositionDataProps extends DefaultDataProps { + optionType: number; + strikeId: number; +} + +@Register.ContractPositionFetcher({ appId, groupId, network }) +export class OptimismLyraAvalonOptionsContractPositionFetcher implements PositionFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + async getPositions() { + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const response = await getOptions(this.appToolkit.helpers.theGraphHelper); + + const markets = response.markets.map(market => { + const quoteToken = baseTokens.find(t => t.address === market.quoteAddress.toLowerCase())!; + const baseToken = baseTokens.find(t => t.address === market.baseAddress.toLowerCase())!; + const boards = market.boards.map(board => { + const strikes = board.strikes.map(strike => { + const position = { + type: ContractType.POSITION, + appId, + groupId, + address: market.optionToken.id.toLowerCase(), + network, + displayProps: { + images: [getAppImg(appId)], + }, + dataProps: {}, + }; + const positions = _.keys(OPTION_TYPES).map(key => { + return { + ...position, + tokens: Number(key) === 2 ? [supplied(baseToken), quoteToken] : [baseToken, supplied(quoteToken)], + dataProps: { + strikeId: Number(strike.strikeId), + optionType: Number(key), + }, + displayProps: { + ...position.displayProps, + label: `${OPTION_TYPES[key]} ${baseToken.symbol} @ $${strike.strikePriceReadable}`, + }, + } as ContractPosition; + }); + return positions; + }); + return _.flatten(strikes); + }); + return _.flatten(boards); + }); + return _.flatten(markets); + } +} diff --git a/src/apps/lyra-avalon/optimism/lyra-avalon.pool.token-fetcher.ts b/src/apps/lyra-avalon/optimism/lyra-avalon.pool.token-fetcher.ts new file mode 100644 index 000000000..d4a786c51 --- /dev/null +++ b/src/apps/lyra-avalon/optimism/lyra-avalon.pool.token-fetcher.ts @@ -0,0 +1,83 @@ +import { Inject } from '@nestjs/common'; +import { gql } from 'graphql-request'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { LyraAvalonContractFactory, LiquidityToken } from '../contracts'; +import { LYRA_AVALON_DEFINITION } from '../lyra-avalon.definition'; + +import { runQuery } from './helpers/graph'; + +const appId = LYRA_AVALON_DEFINITION.id; +const groupId = LYRA_AVALON_DEFINITION.groups.pool.id; +const network = Network.OPTIMISM_MAINNET; + +const REGISTRY_ADDRESS = '0x7c7AbDdbCb6c731237f7546d3e4c5165531fb0c1'.toLowerCase(); + +// TODO: find better way to determine available markets +type QueryResponse = { + markets: { + id: string; + baseAddress: string; + quoteAddress: string; + liquidityPool: { + id: string; + }; + }[]; +}; +const QUERY = gql` + { + markets(where: { isRemoved: false }) { + id + baseAddress + quoteAddress + liquidityPool { + id + } + } + } +`; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class OptimismLyraAvalonPoolTokenFetcher implements PositionFetcher { + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(LyraAvalonContractFactory) private readonly contractFactory: LyraAvalonContractFactory, + ) {} + + async getPositions() { + const multicall = this.appToolkit.getMulticall(network); + const registryContract = this.contractFactory.lyraRegistry({ address: REGISTRY_ADDRESS, network }); + + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + const quoteToken = baseTokens.find(token => token.symbol === 'sUSD')!; + + const response = await runQuery(this.appToolkit.helpers.theGraphHelper, QUERY); + const markets = await Promise.all( + response.markets.map(market => multicall.wrap(registryContract).marketAddresses(market.id)), + ); + + const tokens = await this.appToolkit.helpers.vaultTokenHelper.getTokens({ + appId, + groupId, + network, + resolveVaultAddresses: () => markets.map(market => market.liquidityTokens), + resolveContract: ({ address, network }) => this.contractFactory.liquidityToken({ address, network }), + // Note: There are actually two underlying tokens + // We will pretend there is only USD and use the price specified by the pool contract + resolveUnderlyingTokenAddress: () => quoteToken.address, + resolveReserve: () => 0, + resolvePricePerShare: async ({ multicall, contract, underlyingToken }) => { + const pool = await multicall.wrap(contract).liquidityPool(); + const poolContract = this.contractFactory.liquidityPool({ address: pool, network }); + const ratio = await multicall.wrap(poolContract).getTokenPrice(); + return Number(ratio) / 10 ** underlyingToken.decimals; + }, + }); + return tokens; + } +}