diff --git a/app/package.json b/app/package.json index 95dd710..8afb88c 100644 --- a/app/package.json +++ b/app/package.json @@ -24,7 +24,7 @@ "@ethersproject/bytes": "^5.7.0", "@ethersproject/providers": "^5.7.2", "@ethersproject/units": "^5.7.0", - "@lyrafinance/lyra-js": "^0.0.25", + "@lyrafinance/lyra-js": "^0.0.26", "axios": "^1.3.2", "cross-fetch": "^3.1.5", "dayjs": "^1.11.7", diff --git a/app/src/bot.ts b/app/src/bot.ts index 9517fbe..b6b756b 100644 --- a/app/src/bot.ts +++ b/app/src/bot.ts @@ -1,9 +1,11 @@ import { RunTradeBot } from './lyra/trades' import { FetchLeaderBoard } from './lyra/leaderboard' import { - DISCORD_ACCESS_TOKEN, + DISCORD_ACCESS_TOKEN_ARB, DISCORD_ACCESS_TOKEN_BTC, + DISCORD_ACCESS_TOKEN_ETH, DISCORD_ACCESS_TOKEN_LYRA, + DISCORD_ACCESS_TOKEN_OP, TELEGRAM_ENABLED, TESTNET, TWITTER_ENABLED, @@ -17,31 +19,37 @@ import { TelegramClient } from './clients/telegramClient' import { Network } from '@lyrafinance/lyra-js' import { GetPrices } from './integrations/prices' import { TrackEvents } from './event/blockEvent' -import { ArbitrageJob, LeaderBoardFillJob, LeaderboardSendJob, PricingJob, StatsJob } from './schedule' +import { ArbitrageJob, LeaderBoardFillJob, LeaderboardSendJob, OneMinuteJob, StatsJob } from './schedule' import { SetUpDiscord } from './discord' -import printObject from './utils/printObject' import getLyraSDK from './utils/getLyraSDK' +import { GetArbitrageDeals } from './lyra/arbitrage' +import { getLyraRates } from './providers/Lyra' -let discordClient: Client -let discordClientBtc: Client -let discordClientLyra: Client +let discordClientEth: Client +let discordClientBtc: Client +let discordClientLyra: Client +let discordClientArb: Client +let discordClientOp: Client let twitterClient: TwitterApi let twitterClient1: TwitterApi let telegramClient: Telegraf -const networks = [Network.Optimism, Network.Arbitrum] +const networks = [Network.Arbitrum, Network.Optimism] // Network.Arbitrum] export async function Run() { InitVariables() - await GetPrices() + const pairs = await GetPrices() + global.PRICES = pairs // set up the clients await Promise.all([ - SetUpDiscord((discordClient = DiscordClient()), 'eth', DISCORD_ACCESS_TOKEN), + SetUpDiscord((discordClientEth = DiscordClient()), 'eth', DISCORD_ACCESS_TOKEN_ETH), SetUpDiscord((discordClientBtc = DiscordClient()), 'btc', DISCORD_ACCESS_TOKEN_BTC), - //SetUpDiscord((discordClientLyra = DiscordClient()), 'lyra', DISCORD_ACCESS_TOKEN_LYRA), + SetUpDiscord((discordClientArb = DiscordClient()), 'arb', DISCORD_ACCESS_TOKEN_ARB), + SetUpDiscord((discordClientOp = DiscordClient()), 'op', DISCORD_ACCESS_TOKEN_OP), + SetUpDiscord((discordClientLyra = DiscordClient()), 'lyra', DISCORD_ACCESS_TOKEN_LYRA), SetUpTwitter(), SetUpTelegram(), FetchLeaderBoard(), @@ -51,14 +59,13 @@ export async function Run() { networks.map(async (network) => { await runBot(network) }) - + OneMinuteJob(discordClientEth, discordClientBtc, discordClientOp, discordClientArb, discordClientLyra) // periodic jobs if (!TESTNET) { - PricingJob(discordClient, discordClientBtc, discordClientLyra) LeaderBoardFillJob() - LeaderboardSendJob(discordClient, twitterClient, telegramClient, networks) - StatsJob(discordClient, discordClientBtc, twitterClient, telegramClient, networks) - ArbitrageJob(discordClient, discordClientBtc, twitterClient, telegramClient, networks) + LeaderboardSendJob(discordClientLyra, twitterClient, telegramClient, networks) + StatsJob(discordClientLyra, twitterClient, telegramClient, networks) + ArbitrageJob(discordClientLyra, twitterClient, telegramClient, networks) } } @@ -66,20 +73,15 @@ function InitVariables() { global.LYRA_ENS = {} global.LEADERBOARD_OPT = [] global.LEADERBOARD_ARB = [] + global.PRICES = [] global.FREN = {} global.LYRA_ARB = getLyraSDK(Network.Arbitrum) global.LYRA_OPT = getLyraSDK(Network.Optimism) - global.ETH_PRICE = 0 - global.ETH_24HR = 0 - global.BTC_PRICE = 0 - global.BTC_24HR = 0 - global.LYRA_PRICE = 0 - global.LYRA_24HR = 0 } export async function runBot(network: Network) { - await RunTradeBot(discordClient, discordClientBtc, twitterClient, telegramClient, network) - await TrackEvents(discordClient, discordClientBtc, telegramClient, twitterClient, twitterClient1, network) + await RunTradeBot(discordClientLyra, twitterClient, telegramClient, network) + await TrackEvents(discordClientLyra, telegramClient, twitterClient, twitterClient1, network) } export async function SetUpTwitter() { diff --git a/app/src/config/index.ts b/app/src/config/index.ts index c047053..c26d81d 100644 --- a/app/src/config/index.ts +++ b/app/src/config/index.ts @@ -38,9 +38,11 @@ export const DISCORD_ENABLED: boolean = _.defaultTo( export const TELEGRAM_ACCESS_TOKEN = _.defaultTo(process.env.TELEGRAM_ACCESS_TOKEN, '') export const TELEGRAM_CHANNEL = _.defaultTo(process.env.TELEGRAM_CHANNEL, '') -export const DISCORD_ACCESS_TOKEN = _.defaultTo(process.env.DISCORD_ACCESS_TOKEN, '') +export const DISCORD_ACCESS_TOKEN_ETH = _.defaultTo(process.env.DISCORD_ACCESS_TOKEN_ETH, '') export const DISCORD_ACCESS_TOKEN_BTC = _.defaultTo(process.env.DISCORD_ACCESS_TOKEN_BTC, '') export const DISCORD_ACCESS_TOKEN_LYRA = _.defaultTo(process.env.DISCORD_ACCESS_TOKEN_LYRA, '') +export const DISCORD_ACCESS_TOKEN_ARB = _.defaultTo(process.env.DISCORD_ACCESS_TOKEN_ARB, '') +export const DISCORD_ACCESS_TOKEN_OP = _.defaultTo(process.env.DISCORD_ACCESS_TOKEN_OP, '') export const TESTNET: boolean = _.defaultTo(convertToBoolean(process.env.TESTNET as string), true) as boolean export const ENTROPY = _.defaultTo(process.env.ENTROPY, '') @@ -54,6 +56,6 @@ export const TWITTER_APP_KEY1 = _.defaultTo(process.env.TWITTER_APP_KEY1, '') export const TWITTER_APP_SECRET1 = _.defaultTo(process.env.TWITTER_APP_SECRET1, '') export const TWITTER_ACCESS_TOKEN1 = _.defaultTo(process.env.TWITTER_ACCESS_TOKEN1, '') export const TWITTER_ACCESS_SECRET1 = _.defaultTo(process.env.TWITTER_ACCESS_SECRET1, '') - +export const SATSUMA_API_KEY = _.defaultTo(process.env.SATSUMA_API_KEY, '') export const TOKEN_THRESHOLD = _.defaultTo(process.env.TOKEN_THRESHOLD, 1000) export const DEPOSIT_THRESHOLD = _.defaultTo(process.env.DEPOSIT_THRESHOLD, 1000) diff --git a/app/src/constants/contractAddresses.ts b/app/src/constants/contractAddresses.ts index c98bfc6..d32609b 100644 --- a/app/src/constants/contractAddresses.ts +++ b/app/src/constants/contractAddresses.ts @@ -10,6 +10,12 @@ export const ETH_OPTION_MARKET_ARB = '0x919e5e0c096002cb8a21397d724c4e3ebe77bc15 export const BTC_OPTION_MARKET_OP = '0xc7f1a22c30ae981e6a74a0267ce6cbbf27d8ecd5' export const BTC_OPTION_MARKET_ARB = '0xe044919cf58dfb066fc9de7c69c7db19f336b20c' +export const OP_LIQUIDITY_POOL_OP = '0x12a4fd54aa321eb16b45310ccb177bd87c6ae447' +export const OP_OPTION_MARKET_OP = '0x2a21bfca834d122769cdf9d50b609ca6b210b7f0' + +export const ARB_LIQUIDITY_POOL_OP = '0xdd0d125475453767e65f1a4dd30b62699fdcc9f5' +export const ARB_OPTION_MARKET_OP = '0xf10bb5296aa5bda5c190ce22f8acb4d4adaae1cd' + export const LYRA_TOKENS = { LYRA_ETH: '0x01ba67aac7f75f647d94220cc98fb30fcc5105bf', STKLYRA_ETH: '0xcb9f85730f57732fc899fb158164b9ed60c77d49', @@ -22,6 +28,8 @@ export const LYRA_TOKENS = { export const LYRA_OP = '0x50c5725949a6f0c72e6c4a641f24049a917db0cb' export const ETH_OP = '0x4200000000000000000000000000000000000006' export const BTC_OP = '0x68f180fcce6836688e9084f035309e29bf0a2095' +export const ARB_OP = '0x912CE59144191C1204E64559FE8253a0e49E6548' +export const OP_OP = '0x4200000000000000000000000000000000000042' export const CONTRACT_ADDRESSES = [ LYRA_TOKENS.LYRA_ETH, @@ -30,12 +38,22 @@ export const CONTRACT_ADDRESSES = [ LYRA_TOKENS.STKLYRA_OP, LYRA_TOKENS.LYRA_ARB, LYRA_TOKENS.STKLYRA_ARB, + ETH_LIQUIDITY_POOL_OP, ETH_LIQUIDITY_POOL_ARB, + BTC_LIQUIDITY_POOL_OP, BTC_LIQUIDITY_POOL_ARB, + + OP_LIQUIDITY_POOL_OP, + OP_OPTION_MARKET_OP, + + ARB_LIQUIDITY_POOL_OP, + ARB_OPTION_MARKET_OP, + ETH_OPTION_MARKET_OP, ETH_OPTION_MARKET_ARB, + BTC_OPTION_MARKET_OP, BTC_OPTION_MARKET_ARB, ] diff --git a/app/src/constants/urls.ts b/app/src/constants/urls.ts index f931706..d6ac764 100644 --- a/app/src/constants/urls.ts +++ b/app/src/constants/urls.ts @@ -8,14 +8,20 @@ export const urls = { } export const iconUrls = { - optimism: 'https://raw.githubusercontent.com/ethboi/assets/main/optimism.png', - arbitrum: 'https://raw.githubusercontent.com/ethboi/assets/main/arbitrum.png', + lyra: 'https://raw.githubusercontent.com/ethboi/assets/main/general/lyra.png', } export const bannerUrls = { - optimism: 'https://raw.githubusercontent.com/ethboi/assets/main/op-bg.jpg', - arbitrum: 'https://raw.githubusercontent.com/ethboi/assets/main/arb-bg.jpg', - optimismSpacer: 'https://raw.githubusercontent.com/ethboi/assets/main/op-spacer.jpg', - arbitrumSpacer: 'https://raw.githubusercontent.com/ethboi/assets/main/arb-spacer.jpg', + lyra: 'https://raw.githubusercontent.com/ethboi/assets/main/lyra-bg.jpg', spacer: 'https://raw.githubusercontent.com/ethboi/assets/main/spacer.jpg', } + +export type AssetType = 'eth' | 'wbtc' | 'op' | 'arb' | 'btc' + +export const thumbUrls: Record = { + eth: 'https://raw.githubusercontent.com/ethboi/assets/main/discord/eth.png', + wbtc: 'https://raw.githubusercontent.com/ethboi/assets/main/discord/wbtc.png', + op: 'https://raw.githubusercontent.com/ethboi/assets/main/discord/op.png', + arb: 'https://raw.githubusercontent.com/ethboi/assets/main/discord/arb.png', + btc: 'https://raw.githubusercontent.com/ethboi/assets/main/discord/wbtc.png', +} diff --git a/app/src/discord/index.ts b/app/src/discord/index.ts index 71e275b..dffab62 100644 --- a/app/src/discord/index.ts +++ b/app/src/discord/index.ts @@ -20,11 +20,13 @@ import { GetArbitrageDeals } from '../lyra/arbitrage' import { ArbDiscord } from '../templates/arb' import { GetTrader } from '../lyra/trader' import { TraderDiscord } from '../templates/trader' -import { TradeDto } from '../types/lyra' import {} from 'discord.js' -import dayjs from 'dayjs' -import { FN } from '../templates/common' import printObject from '../utils/printObject' +import formatNumber from '../utils/formatNumber' +import { Pair } from '../types/dexscreener' +import { ARB_OP, BTC_OP, ETH_OP, LYRA_OP, OP_OP } from '../constants/contractAddresses' +import { GetPrices } from '../integrations/prices' +import { titleCaseWord } from '../utils/utils' export async function SetUpDiscord( discordClient: Client, @@ -34,6 +36,31 @@ export async function SetUpDiscord( if (DISCORD_ENABLED) { discordClient.on('ready', async (client) => { console.debug(`Discord bot ${market} is online!`) + const pairs = await GetPrices() + let address = '' + + if (market == 'eth') { + address = ETH_OP.toLowerCase() + } + if (market == 'btc') { + address = BTC_OP.toLowerCase() + } + if (market == 'op') { + address = OP_OP.toLowerCase() + } + if (market == 'arb') { + address = ARB_OP.toLowerCase() + } + if (market == 'lyra') { + address = LYRA_OP.toLowerCase() + } + + if (address) { + const marketPair = pairs.find((pair) => pair.baseToken.address.toLowerCase() == address.toLowerCase()) + if (marketPair) { + await setNameActivityPrice(discordClient, marketPair, market) + } + } }) discordClient.on('interactionCreate', async (interaction) => { @@ -46,7 +73,7 @@ export async function SetUpDiscord( const channelName = (interaction?.channel as TextChannel).name const { commandName } = interaction - if (market == 'eth') { + if (market == 'lyra') { if (commandName === 'leaderboard') { await LeaderBoardInteraction( channelName, @@ -82,32 +109,20 @@ export async function SetUpDiscord( tradeChannel as GuildBasedChannel, ) } - } - - if (commandName === 'arbs') { - await ArbInteraction( - market, - channelName, - interaction as ChatInputCommandInteraction, - arbChannel as GuildBasedChannel, - ) - } - - if (commandName === 'stats') { - await StatsInteraction( - market, - channelName, - interaction as ChatInputCommandInteraction, - statsChannel as GuildBasedChannel, - ) + if (commandName === 'arbs') { + await ArbInteraction(channelName, interaction as ChatInputCommandInteraction, arbChannel as GuildBasedChannel) + } + if (commandName === 'stats') { + await StatsInteraction( + channelName, + interaction as ChatInputCommandInteraction, + statsChannel as GuildBasedChannel, + ) + } } }) await discordClient.login(accessToken) - if (!TESTNET) { - defaultActivity(discordClient, market) - await defaultName(discordClient, market) - } } return discordClient } @@ -134,7 +149,6 @@ async function LeaderBoardInteraction( } async function StatsInteraction( - market: string, channelName: string, interaction: ChatInputCommandInteraction, channel: GuildBasedChannel, @@ -142,6 +156,15 @@ async function StatsInteraction( if (channelName === STATS_CHANNEL) { await interaction.deferReply() const network = interaction.options.getString('chain') as Network + const market = interaction.options.getString('market') as string + + if (network == Network.Arbitrum) { + if (market == 'op' || market == 'arb') { + await interaction.editReply(`${market.toUpperCase()} not available on ${titleCaseWord(Network.Arbitrum)}`) + return + } + } + const statsDto = await GetStats(market, network) const stats = StatDiscord(statsDto, network) await interaction.editReply({ embeds: stats }) @@ -151,7 +174,6 @@ async function StatsInteraction( } async function ArbInteraction( - market: string, channelName: string, interaction: ChatInputCommandInteraction, channel: GuildBasedChannel, @@ -159,6 +181,8 @@ async function ArbInteraction( if (channelName === ARBS_CHANNEL) { await interaction.deferReply() const network = interaction.options.getString('chain') as Network + const market = interaction.options.getString('market') as string + const arbs = await GetArbitrageDeals(market, network) if (arbs.arbs.length > 0) { const { embeds, rows } = ArbDiscord(arbs, network) @@ -195,10 +219,10 @@ async function TraderInteraction( export async function PostDiscord( embed: EmbedBuilder[], rows: ActionRowBuilder[], - client: Client, + client: Client, channelName: string, ) { - if (TESTNET) { + if (!TESTNET) { printObject(embed) } else { try { @@ -214,39 +238,22 @@ export async function PostDiscord( } } -export function activityString(trade: TradeDto) { - return `${trade.asset} ${dayjs(trade.expiry).format('DD MMM')} ${trade.isLong ? 'Long' : 'Short'} ${ - trade.isCall ? 'C' : 'P' - } $${trade.strike} x ${trade.size} $${trade.premium}` -} - -export function defaultActivity(client: Client, market: string) { +export async function setNameActivityPrice(client: Client, pair: Pair, market: string) { try { - if (market === 'eth') { - client.user?.setActivity(`24h: ${FN(global.ETH_24HR, 2)}%`, { type: ActivityType.Watching }) - } - if (market === 'btc') { - client.user?.setActivity(`24h: ${FN(global.BTC_24HR, 2)}%`, { type: ActivityType.Watching }) - } - if (market === 'lyra') { - client.user?.setActivity(`24h: ${FN(global.LYRA_24HR, 2)}%`, { type: ActivityType.Watching }) - } - } catch (e: any) { - console.log(e) - } -} + const username = `${market.toUpperCase()} $${formatNumber(Number(pair.priceUsd), { dps: 2 })} (${ + Number(pair.priceChange.h24) >= 0 ? '↗' : '↘' + })` + const activity = `24h: ${formatNumber(Number(pair.priceChange.h24), { dps: 2, showSign: true })}%` + console.log(`PRICE: ${market.toUpperCase()}`) + console.log(username) + console.log(activity) -export async function defaultName(client: Client, market: string) { - try { - if (market === 'eth') { - await client.user?.setUsername(`ETH $${FN(global.ETH_PRICE, 2)} (${global.ETH_24HR >= 0 ? '↗' : '↘'})`) - } - if (market === 'btc') { - await client.user?.setUsername(`BTC $${FN(global.BTC_PRICE, 2)} (${global.BTC_24HR >= 0 ? '↗' : '↘'})`) - } - if (market === 'lyra') { - await client.user?.setUsername(`LYRA $${FN(global.LYRA_PRICE, 2)} (${global.LYRA_24HR >= 0 ? '↗' : '↘'})`) - } + client.guilds.cache.map( + async (guild) => await guild.members.cache.find((m) => m.id == client.user?.id)?.setNickname(username), + ) + client.user?.setActivity(activity, { + type: ActivityType.Watching, + }) } catch (e: any) { console.log(e) } diff --git a/app/src/event/blockEvent.ts b/app/src/event/blockEvent.ts index 520c98d..d7d8f64 100644 --- a/app/src/event/blockEvent.ts +++ b/app/src/event/blockEvent.ts @@ -1,22 +1,19 @@ import { TESTNET } from '../config' import { Client } from 'discord.js' import { BlockEvent } from '../event' -import { Context, Telegraf } from 'telegraf' -import { Update } from 'telegraf/typings/core/types/typegram' +import { Telegraf } from 'telegraf' import { TwitterApi } from 'twitter-api-v2' import { DEPOSIT_PROCESSED, STRIKE_ADDED, TRANSFER_TOPIC } from '../constants/topics' import { CONTRACT_ADDRESSES } from '../constants/contractAddresses' import { Network } from '@lyrafinance/lyra-js' import { TrackTransfer } from '../lyra/tracker' import { TrackDeposits } from '../lyra/deposits' -import printObject from '../utils/printObject' -import { TrackStrikeAdded } from '../lyra/expiries' import getLyraSDK from '../utils/getLyraSDK' +import { TrackStrikeAdded } from '../lyra/expiries' export async function TrackEvents( - discordClient: Client, - discordClientBtc: Client, - telegramClient: Telegraf>, + discordClient: Client, + telegramClient: Telegraf, twitterClient: TwitterApi, twitterClient1: TwitterApi, network: Network, @@ -37,10 +34,10 @@ export async function TrackEvents( await TrackTransfer(discordClient, twitterClient1, event[0], network) } if (event[0].topics[0].toLowerCase() === DEPOSIT_PROCESSED.toLowerCase()) { - await TrackDeposits(discordClient, discordClientBtc, twitterClient1, event[0], network) + await TrackDeposits(discordClient, twitterClient1, event[0], network) } if (event[0].topics[0].toLowerCase() === STRIKE_ADDED.toLowerCase()) { - await TrackStrikeAdded(discordClient, discordClientBtc, telegramClient, twitterClient, lyra, network, event) + await TrackStrikeAdded(discordClient, telegramClient, twitterClient, network, event) } }, { diff --git a/app/src/integrations/prices.ts b/app/src/integrations/prices.ts index e5fa97b..a9b8815 100644 --- a/app/src/integrations/prices.ts +++ b/app/src/integrations/prices.ts @@ -1,35 +1,79 @@ import axios from 'axios' -import { ETH_OP, BTC_OP, LYRA_OP } from '../constants/contractAddresses' +import { ETH_OP, BTC_OP, OP_OP, ARB_OP, LYRA_OP } from '../constants/contractAddresses' import { urls } from '../constants/urls' -import { Dexscreener } from '../types/dexscreener' +import { Dexscreener, Pair } from '../types/dexscreener' + +export async function GetPrices() { + const pairs: Pair[] = [] -export async function GetPrices(): Promise { try { - const addresses = [LYRA_OP, ETH_OP, BTC_OP] - addresses.map(async (address) => { - const dexscreenerData = (await axios.get(`${urls.dexscreenerUrl}${address}`)).data as Dexscreener - const pair = dexscreenerData.pairs.find((pair) => pair.baseToken.address.toLowerCase() == address.toLowerCase()) - if (pair) { - if (address.toLowerCase() == ETH_OP.toLowerCase()) { - global.ETH_PRICE = Number(pair.priceUsd) - global.ETH_24HR = Number(pair.priceChange.h24) - //console.log(`New ETH PRICE: ${global.ETH_PRICE}`) - } - if (address.toLowerCase() == BTC_OP.toLowerCase()) { - global.BTC_PRICE = Number(pair.priceUsd) - global.BTC_24HR = Number(pair.priceChange.h24) - //console.log(`New BTC PRICE: ${global.BTC_PRICE}`) - } - if (address.toLowerCase() == LYRA_OP.toLowerCase()) { - global.LYRA_PRICE = Number(pair.priceUsd) - global.LYRA_24HR = Number(pair.priceChange.h24) - //console.log(`New LYRA PRICE: ${global.LYRA_PRICE}`) - } - } else { - console.log(`Pair not found: ${address.toLowerCase()}`) + const [dexEth, dexBtc, dexOp, dexArb, dexLyra] = await Promise.all([ + axios.get(`${urls.dexscreenerUrl}${ETH_OP}`), + axios.get(`${urls.dexscreenerUrl}${BTC_OP}`), + axios.get(`${urls.dexscreenerUrl}${OP_OP}`), + axios.get(`${urls.dexscreenerUrl}${ARB_OP}`), + axios.get(`${urls.dexscreenerUrl}${LYRA_OP}`), + ]) + + try { + // ETH + const pairEth = dexEth.data?.pairs.find((pair) => pair.baseToken.address.toLowerCase() == ETH_OP.toLowerCase()) + if (pairEth) { + pairs.push(pairEth) + } + // BTC + const pairBtc = dexBtc.data?.pairs.find((pair) => pair.baseToken.address.toLowerCase() == BTC_OP.toLowerCase()) + if (pairBtc) { + pairs.push(pairBtc) + } + // OP + const pairOp = dexOp.data?.pairs.find((pair) => pair.baseToken.address.toLowerCase() == OP_OP.toLowerCase()) + if (pairOp) { + pairs.push(pairOp) + } + // ARB + const pairArb = dexArb.data?.pairs.find((pair) => pair.baseToken.address.toLowerCase() == ARB_OP.toLowerCase()) + if (pairArb) { + pairs.push(pairArb) } - }) + // LYRA + const pairLyra = dexLyra.data?.pairs.find((pair) => pair.baseToken.address.toLowerCase() == LYRA_OP.toLowerCase()) + if (pairLyra) { + pairs.push(pairLyra) + } + } catch (error) { + console.log(error) + } } catch (error) { console.log(error) } + return pairs +} + +export function GetPricePair(market: string) { + try { + if (market.toLowerCase() == 'eth') { + market = 'weth' + } + + if (market.toLowerCase() == 'btc') { + market = 'wbtc' + } + + const pricePair = global.PRICES.find((pair) => pair.baseToken.symbol.toLowerCase() == market.toLowerCase()) + if (pricePair) { + return pricePair + } + } catch (error) { + console.log(error) + } + return undefined +} + +export function GetPrice(market: string) { + const pricePair = GetPricePair(market) + if (pricePair) { + return Number(pricePair.priceUsd) + } + return 1 } diff --git a/app/src/lyra/arbitrage.ts b/app/src/lyra/arbitrage.ts index 62da2a7..3885b5a 100644 --- a/app/src/lyra/arbitrage.ts +++ b/app/src/lyra/arbitrage.ts @@ -5,18 +5,10 @@ import { maxBy, minBy } from 'lodash' import moment from 'moment' import { Arb, ArbDto } from '../types/lyra' import { EventType } from '../constants/eventType' - -export function getPriceForMarket(market: string) { - let price = ETH_PRICE - - if (market === 'btc') { - price = BTC_PRICE - } - return price -} +import { GetPrice } from '../integrations/prices' export async function GetArbitrageDeals(market: string, network: Network) { - const price = getPriceForMarket(market) + const price = GetPrice(market) const deals = await useDeals(market, network) const data = deals.map((deal) => { diff --git a/app/src/lyra/deposits.ts b/app/src/lyra/deposits.ts index a359a4b..c64e940 100644 --- a/app/src/lyra/deposits.ts +++ b/app/src/lyra/deposits.ts @@ -8,7 +8,7 @@ import { SendTweet } from '../integrations/twitter' import { Event as GenericEvent } from 'ethers' import { TwitterApi } from 'twitter-api-v2' import { DEPOSITS_CHANNEL } from '../constants/discordChannels' -import { AvalonLiquidityPool__factory, Network } from '@lyrafinance/lyra-js' +import { Network, NewportLiquidityPool__factory } from '@lyrafinance/lyra-js' import { DepositDto } from '../types/lyra' import { DepositDiscord, DepositTwitter } from '../templates/deposit' import { GetAsset, GetMarket } from '../templates/common' @@ -19,8 +19,7 @@ import { } from '@lyrafinance/lyra-js/src/contracts/avalon/typechain/AvalonLiquidityPool' export async function TrackDeposits( - discordClient: Client, - discordClientBtc: Client, + discordClient: Client, twitterClient: TwitterApi, genericEvent: GenericEvent, network: Network, @@ -57,7 +56,7 @@ export async function TrackDeposits( transactionHash: event.transactionHash, blockNumber: event.blockNumber, } - await BroadCastDeposit(dto, discordClient, discordClientBtc, twitterClient, network) + await BroadCastDeposit(dto, discordClient, twitterClient, network) } catch (ex) { console.log(ex) } @@ -68,21 +67,14 @@ export async function TrackDeposits( export async function BroadCastDeposit( dto: DepositDto, - discordClient: Client, - discordClientBtc: Client, + discordClient: Client, twitterClient: TwitterApi, network: Network, ): Promise { if (DISCORD_ENABLED) { const post = DepositDiscord(dto, network) const rows: ActionRowBuilder[] = [] - - if (dto.asset.toLowerCase() === 'eth') { - await PostDiscord(post, rows, discordClient, DEPOSITS_CHANNEL) - } - if (dto.asset.toLowerCase() == 'btc') { - await PostDiscord(post, rows, discordClientBtc, DEPOSITS_CHANNEL) - } + await PostDiscord(post, rows, discordClient, DEPOSITS_CHANNEL) } if (TWITTER_ENABLED) { @@ -92,7 +84,7 @@ export async function BroadCastDeposit( } export function parseEvent(event: DepositQueuedEvent): DepositQueuedEvent { - const parsedEvent = AvalonLiquidityPool__factory.createInterface().parseLog(event) + const parsedEvent = NewportLiquidityPool__factory.createInterface().parseLog(event) if ((parsedEvent.args as DepositQueuedEvent['args']).length > 0) { event.args = parsedEvent.args as DepositQueuedEvent['args'] @@ -101,7 +93,7 @@ export function parseEvent(event: DepositQueuedEvent): DepositQueuedEvent { } export function parseProcessedEvent(event: DepositProcessedEvent): DepositProcessedEvent { - const parsedEvent = AvalonLiquidityPool__factory.createInterface().parseLog(event) + const parsedEvent = NewportLiquidityPool__factory.createInterface().parseLog(event) if ((parsedEvent.args as DepositProcessedEvent['args']).length > 0) { event.args = parsedEvent.args as DepositProcessedEvent['args'] diff --git a/app/src/lyra/expiries.ts b/app/src/lyra/expiries.ts index 862c370..92d7751 100644 --- a/app/src/lyra/expiries.ts +++ b/app/src/lyra/expiries.ts @@ -8,20 +8,18 @@ import { SendTweet } from '../integrations/twitter' import { Event as GenericEvent } from 'ethers' import { TwitterApi } from 'twitter-api-v2' import { EXPIRY_CHANNEL } from '../constants/discordChannels' -import Lyra, { AvalonOptionMarket__factory, Network } from '@lyrafinance/lyra-js' -import printObject from '../utils/printObject' +import { AvalonFactories, Network } from '@lyrafinance/lyra-js' import { BoardDiscord, BoardTelegram, BoardTwitter } from '../templates/strike' import { PostDiscord } from '../discord' import { PostTelegram } from '../integrations/telegram' import { StrikeAddedEvent } from '@lyrafinance/lyra-js/src/contracts/avalon/typechain/AvalonOptionMarket' import { GetAsset } from '../templates/common' +import getLyraSDK from '../utils/getLyraSDK' export async function TrackStrikeAdded( discordClient: Client, - discordClientBtc: Client, telegramClient: Telegraf, twitterClient: TwitterApi, - lyra: Lyra, network: Network, genericEvents: GenericEvent[], ): Promise { @@ -29,27 +27,17 @@ export async function TrackStrikeAdded( const boardEvents = groupBy(events, (i) => i.args.boardId.toNumber() as unknown as string) Object.keys(boardEvents).map( - async (x) => - await processBoardStrikes( - discordClient, - discordClientBtc, - telegramClient, - twitterClient, - boardEvents[x], - lyra, - network, - ), + async (x) => await processBoardStrikes(discordClient, telegramClient, twitterClient, boardEvents[x], network), ) } export async function processBoardStrikes( - discordClient: Client, - discordClientBtc: Client, + discordClient: Client, telegramClient: Telegraf, twitterClient: TwitterApi, events: StrikeAddedEvent[], - lyra: Lyra, network: Network, ) { + const lyra = getLyraSDK(network) const board = await lyra.board(events[0].address, events[0].args.boardId.toNumber()) const event = events[0] const market = board.market() @@ -73,7 +61,7 @@ export async function processBoardStrikes( } console.log(boardDto) try { - BroadCastStrike(boardDto, discordClient, discordClientBtc, telegramClient, twitterClient, network) + BroadCastStrike(boardDto, discordClient, telegramClient, twitterClient, network) } catch (ex) { console.log(ex) } @@ -82,7 +70,6 @@ export async function processBoardStrikes( export async function BroadCastStrike( dto: BoardDto, discordClient: Client, - discordClientBtc: Client, telegramClient: Telegraf, twitterClient: TwitterApi, network: Network, @@ -90,12 +77,7 @@ export async function BroadCastStrike( if (DISCORD_ENABLED) { const post = BoardDiscord(dto, network) const rows: ActionRowBuilder[] = [] - if (dto.asset.toLowerCase() === 'eth') { - await PostDiscord(post, rows, discordClient, EXPIRY_CHANNEL) - } - if (dto.asset.toLowerCase() == 'btc') { - await PostDiscord(post, rows, discordClientBtc, EXPIRY_CHANNEL) - } + await PostDiscord(post, rows, discordClient, EXPIRY_CHANNEL) } if (TELEGRAM_ENABLED) { @@ -111,7 +93,7 @@ export async function BroadCastStrike( export function parseEvents(events: StrikeAddedEvent[]): StrikeAddedEvent[] { const result = events.map((x) => { - const parsedEvent = AvalonOptionMarket__factory.createInterface().parseLog(x) + const parsedEvent = AvalonFactories.AvalonOptionMarket__factory.createInterface().parseLog(x) if ((parsedEvent.args as StrikeAddedEvent['args']).length > 0) { x.args = parsedEvent.args as StrikeAddedEvent['args'] diff --git a/app/src/lyra/stats.ts b/app/src/lyra/stats.ts index 924414e..bdac553 100644 --- a/app/src/lyra/stats.ts +++ b/app/src/lyra/stats.ts @@ -50,6 +50,7 @@ export async function GetStats(marketName: string, network: Network): Promise { const event = parseEvent(genericEvent as TransferEvent) const amount = fromBigNumber(event.args.value) - const value = global.LYRA_PRICE * amount + const price = GetPrice('lyra') + const value = price * amount console.log(`Transfer Value: ${value}`) diff --git a/app/src/lyra/trades.ts b/app/src/lyra/trades.ts index 8dd97b3..a9962fa 100644 --- a/app/src/lyra/trades.ts +++ b/app/src/lyra/trades.ts @@ -30,8 +30,7 @@ import printObject from '../utils/printObject' import formatUSD from '../utils/formatUSD' export async function RunTradeBot( - discordClient: Client, - discordClientBtc: Client, + discordClient: Client, twitterClient: TwitterApi, telegramClient: Telegraf, network: Network, @@ -39,6 +38,7 @@ export async function RunTradeBot( console.log('### Polling for Trades ###') const lyra = getLyra(network) + // eslint-disable-next-line prefer-const let blockNumber: number | undefined = undefined let pollInterval = 60000 // 1 min @@ -51,17 +51,7 @@ export async function RunTradeBot( async (trade) => { try { const tradeDto = await MapToTradeDto(trade, network) - //console.log(tradeDto) - switch (tradeDto.market.toUpperCase()) { - case 'SBTC-SUSD': - case 'WBTC-USDC': - await BroadCastTrade(tradeDto, network, twitterClient, telegramClient, discordClientBtc) - break - case 'SETH-SUSD': - case 'ETH-USDC': - await BroadCastTrade(tradeDto, network, twitterClient, telegramClient, discordClient) - break - } + await BroadCastTrade(tradeDto, network, twitterClient, telegramClient, discordClient) } catch (e: any) { console.log(e) } diff --git a/app/src/providers/Lyra/index.ts b/app/src/providers/Lyra/index.ts index a1773a8..14822b2 100644 --- a/app/src/providers/Lyra/index.ts +++ b/app/src/providers/Lyra/index.ts @@ -3,7 +3,8 @@ import { UNIT } from '../../constants/bn' import { OptionsMap, OptionType, ProviderType } from '../../types/arbs' import fromBigNumber from '../../utils/fromBigNumber' import { getExpirationTerm } from '../../utils/arbUtils' -import getLyra from '../..//utils/getLyra' +import getLyraSDK from '../../utils/getLyraSDK' +import filterNulls from '../../utils/filterNulls' export async function getMarket(market: Market) { const options = market.liveBoards().map((board) => { @@ -11,57 +12,62 @@ export async function getMarket(market: Market) { const term = getExpirationTerm(expiration) return board.strikes().map(async (strike) => { - const strikePrice = fromBigNumber(strike.strikePrice) - const quotes = await Promise.all([ - strike.quote(true, true, UNIT), - strike.quote(true, false, UNIT), - strike.quote(false, true, UNIT), - strike.quote(false, false, UNIT), - ]) - const [callBuyPrice, callSellPrice, putBuyPrice, putSellPrice] = quotes.map((quote) => - fromBigNumber(quote.pricePerOption), - ) + try { + if (!strike.isDeltaInRange) { + return + } + const strikePrice = fromBigNumber(strike.strikePrice) + const allQuotes = await strike.quoteAll(UNIT) + const callBuyPrice = fromBigNumber(allQuotes.callAsk.pricePerOption) + const callSellPrice = fromBigNumber(allQuotes.callBid.pricePerOption) + const putBuyPrice = fromBigNumber(allQuotes.putAsk.pricePerOption) + const putSellPrice = fromBigNumber(allQuotes.putBid.pricePerOption) - if ([callBuyPrice, callSellPrice, putBuyPrice, putSellPrice].every((val) => !val)) { - return - } + if ([callBuyPrice, callSellPrice, putBuyPrice, putSellPrice].every((val) => !val)) { + return + } - const instrumentMeta = { - strike: strikePrice, - term, - expiration, - provider: ProviderType.LYRA, - } + const instrumentMeta = { + strike: strikePrice, + term, + expiration, + provider: ProviderType.LYRA, + } - return { - ...instrumentMeta, - [OptionType.CALL]: { + return { ...instrumentMeta, - type: OptionType.CALL, - askPrice: callBuyPrice, - bidPrice: callSellPrice, - midPrice: (callBuyPrice + callSellPrice) / 2, - }, - [OptionType.PUT]: { - ...instrumentMeta, - type: OptionType.PUT, - askPrice: putBuyPrice, - bidPrice: putSellPrice, - midPrice: (putBuyPrice + putSellPrice) / 2, - }, + [OptionType.CALL]: { + ...instrumentMeta, + type: OptionType.CALL, + askPrice: callBuyPrice, + bidPrice: callSellPrice, + midPrice: (callBuyPrice + callSellPrice) / 2, + }, + [OptionType.PUT]: { + ...instrumentMeta, + type: OptionType.PUT, + askPrice: putBuyPrice, + bidPrice: putSellPrice, + midPrice: (putBuyPrice + putSellPrice) / 2, + }, + } + } catch (error) { + console.log(error) + return } }) }) - return (await Promise.all(options?.flat()).catch(console.error))?.filter(Boolean) as OptionsMap[] + const flatOptions = options?.flat() + const optionsFound = await Promise.all(flatOptions) + const result = filterNulls(optionsFound) as OptionsMap[] + return result } export async function getLyraRates(marketName: string, network: Network): Promise { - console.log(`Getting market ${network}`) - const lyra0 = getLyra(network) console.log(`Getting market ${marketName}`) - console.log(lyra0.version) - const market = await lyra0.market(marketName) + const lyra = getLyraSDK(network) + const market = await lyra.market(marketName) const rates = await getMarket(market) return rates } diff --git a/app/src/providers/deribit/index.ts b/app/src/providers/deribit/index.ts index bcc5bf4..80d7243 100644 --- a/app/src/providers/deribit/index.ts +++ b/app/src/providers/deribit/index.ts @@ -2,7 +2,7 @@ import moment from 'moment' import { pick } from 'lodash' import { Instrument, OptionsMap, OptionType, ProviderType } from '../../types/arbs' import { RpcWebSocketClient } from 'rpc-websocket-client' -import { getPriceForMarket } from '../../lyra/arbitrage' +import { GetPrice } from '../../integrations/prices' // const authRequest = { // jsonrpc: "2.0", @@ -119,7 +119,7 @@ async function useDeribitData(market: string) { export async function getDeribitRates(market: string) { const [data] = await useDeribitData(market) - const price = getPriceForMarket(market) + const price = GetPrice(market) const optionsMap = data .filter(({ mid_price, ask_price, bid_price }) => ask_price && bid_price) diff --git a/app/src/schedule/index.ts b/app/src/schedule/index.ts index dd593c7..eb15bad 100644 --- a/app/src/schedule/index.ts +++ b/app/src/schedule/index.ts @@ -5,30 +5,63 @@ import { Telegraf } from 'telegraf' import { TwitterApi } from 'twitter-api-v2' import { BroadCast } from '../event/broadcast' import { GetPrices } from '../integrations/prices' -import { defaultActivity, defaultName } from '../discord' +import { setNameActivityPrice } from '../discord' import { GetArbitrageDeals } from '../lyra/arbitrage' import { BroadcastLeaderBoard, FetchLeaderBoard } from '../lyra/leaderboard' import { GetStats, BroadCastStats } from '../lyra/stats' +import { ETH_OP, BTC_OP, ARB_OP, OP_OP, LYRA_OP } from '../constants/contractAddresses' const markets = ['eth', 'btc'] -export function PricingJob( - discordClient: Client, - discordClientBtc: Client, - discordClientLyra: Client, +export function OneMinuteJob( + discordClientEth: Client, + discordClientBtc: Client, + discordOP: Client, + discordArb: Client, + discordLyra: Client, ): void { - console.log('30 min pricing job running') - scheduleJob('*/30 * * * *', async () => { - await GetPrices() + scheduleJob('*/1 * * * *', async () => { + try { + console.log(`Getting Prices: ${Date.now()}`) + const pairs = await GetPrices() + global.PRICES = pairs + //ETH + const ethPair = pairs.find((pair) => pair.baseToken.address.toLowerCase() == ETH_OP.toLowerCase()) + if (ethPair) { + console.log(ethPair.priceUsd) + await setNameActivityPrice(discordClientEth, ethPair, 'eth') + } + + //BTC + const btcPair = pairs.find((pair) => pair.baseToken.address.toLowerCase() == BTC_OP.toLowerCase()) + if (btcPair) { + console.log(btcPair.priceUsd) + await setNameActivityPrice(discordClientBtc, btcPair, 'btc') + } - defaultActivity(discordClient, 'eth') - await defaultName(discordClient, 'eth') + //ARB + const arbPair = pairs.find((pair) => pair.baseToken.address.toLowerCase() == ARB_OP.toLowerCase()) + if (arbPair) { + console.log(arbPair.priceUsd) + await setNameActivityPrice(discordArb, arbPair, 'arb') + } - defaultActivity(discordClientBtc, 'btc') - await defaultName(discordClientBtc, 'btc') + //OP + const opPair = pairs.find((pair) => pair.baseToken.address.toLowerCase() == OP_OP.toLowerCase()) + if (opPair) { + console.log(opPair.priceUsd) + await setNameActivityPrice(discordOP, opPair, 'op') + } - defaultActivity(discordClientLyra, 'lyra') - await defaultName(discordClientLyra, 'lyra') + //LYRA + const lyraPair = pairs.find((pair) => pair.baseToken.address.toLowerCase() == LYRA_OP.toLowerCase()) + if (lyraPair) { + console.log(lyraPair.priceUsd) + await setNameActivityPrice(discordLyra, lyraPair, 'lyra') + } + } catch (e) { + console.log(e) + } }) } @@ -55,7 +88,6 @@ export function LeaderboardSendJob( export function StatsJob( discordClient: Client, - discordClientBtc: Client, twitterClient: TwitterApi, telegramClient: Telegraf, networks: Network[], @@ -65,8 +97,7 @@ export function StatsJob( networks.map(async (network) => { markets.map(async (market) => { const statsDto = await GetStats(market, network) - const discord = market == 'eth' ? discordClient : discordClientBtc - await BroadCastStats(statsDto, twitterClient, telegramClient, discord, network) + await BroadCastStats(statsDto, twitterClient, telegramClient, discordClient, network) }) }) }) @@ -74,7 +105,6 @@ export function StatsJob( export function ArbitrageJob( discordClient: Client, - discordClientBtc: Client, twitterClient: TwitterApi, telegramClient: Telegraf, networks: Network[], @@ -83,8 +113,7 @@ export function ArbitrageJob( networks.map(async (network) => { markets.map(async (market) => { const arbDto = await GetArbitrageDeals(market, network) - const discord = market == 'eth' ? discordClient : discordClientBtc - await BroadCast(arbDto, twitterClient, telegramClient, discord, network) + await BroadCast(arbDto, twitterClient, telegramClient, discordClient, network) }) }) }) diff --git a/app/src/templates/arb.ts b/app/src/templates/arb.ts index 5f5e066..649e0db 100644 --- a/app/src/templates/arb.ts +++ b/app/src/templates/arb.ts @@ -1,8 +1,9 @@ import { ActionRowBuilder, ButtonBuilder, EmbedBuilder } from 'discord.js' import { ArbDto, Arb } from '../types/lyra' import { ProviderType } from '../types/arbs' -import { FN, FormattedDate, FormattedDateShort, MarketColor, NetworkFooter, StatSymbol } from './common' +import { FN, FormattedDate, FormattedDateShort, MarketColor, Footer, StatSymbol, getThumb } from './common' import { Network } from '@lyrafinance/lyra-js' +import { titleCaseWord } from '../utils/utils' const deribitUrl = 'https://www.deribit.com/?reg=17349.7477' @@ -59,6 +60,16 @@ export function ArbDiscord(dto: ArbDto, network: Network) { const embed = new EmbedBuilder() .setColor(`${MarketColor(dto.market)}`) .setTitle(`$${dto.market.toUpperCase()} Arbitrage: DERIBIT | LYRA`) + const assetThumb = getThumb(dto.market.toLowerCase()) + + if (assetThumb) { + embed.setThumbnail(assetThumb) + } + embed.addFields({ + name: `⛓️ Network`, + value: `> ${titleCaseWord(network)}`, + inline: false, + }) dto.arbs.slice(0, 10).map((arb) => { Arb(arb, dto.market, network, embed) @@ -72,7 +83,7 @@ export function ArbDiscord(dto: ArbDto, network: Network) { // new ButtonBuilder().setCustomId('arb-deribit5').setLabel('Arb Deribit 5').setStyle(ButtonStyle.Success), // ) - NetworkFooter(embed, network) + Footer(embed) embeds.push(embed) //rows.push(buttons) diff --git a/app/src/templates/common.ts b/app/src/templates/common.ts index 4a2321b..da4b90b 100644 --- a/app/src/templates/common.ts +++ b/app/src/templates/common.ts @@ -11,8 +11,12 @@ import { BTC_LIQUIDITY_POOL_ARB, ETH_OPTION_MARKET_ARB, BTC_OPTION_MARKET_ARB, + ARB_LIQUIDITY_POOL_OP, + ARB_OPTION_MARKET_OP, + OP_LIQUIDITY_POOL_OP, + OP_OPTION_MARKET_OP, } from '../constants/contractAddresses' -import { bannerUrls, iconUrls } from '../constants/urls' +import { AssetType, bannerUrls, iconUrls, thumbUrls } from '../constants/urls' import { TradeDto, TraderAddress } from '../types/lyra' import { shortAddress } from '../utils/utils' @@ -66,14 +70,27 @@ export function TwitterLink(handle: string) { return `https://twitter.com/${handle}` } -export function NetworkFooter(embed: EmbedBuilder, network: Network) { +export function Footer(embed: EmbedBuilder) { embed .setFooter({ - iconURL: `${network === Network.Optimism ? iconUrls.optimism : iconUrls.arbitrum}`, - text: `${network === Network.Optimism ? 'Optimism' : 'Arbitrum'}`, + iconURL: `${iconUrls.lyra}`, + text: `Lyra`, }) .setTimestamp() - .setImage(network === Network.Optimism ? bannerUrls.optimism : bannerUrls.arbitrum) + .setImage(`${bannerUrls.lyra}`) +} + +export function getThumb(market: string): string | undefined { + const marketType = market as any as AssetType + + // Check if the passed market exists within our thumbUrls constant + // eslint-disable-next-line no-prototype-builtins + if (thumbUrls.hasOwnProperty(marketType)) { + return thumbUrls[marketType] + } + + // If no match is found, return null + return undefined } export function ExpiryLink(market: string, network: Network, date: string) { @@ -148,6 +165,7 @@ export function FNS(value: number, decimals: number) { })}` } +//todo add these to a config per asset export function GetAsset(address: string) { const asset = '' @@ -162,6 +180,12 @@ export function GetAsset(address: string) { case BTC_OPTION_MARKET_OP.toLowerCase(): case BTC_OPTION_MARKET_ARB.toLowerCase(): return 'BTC' + case OP_LIQUIDITY_POOL_OP.toLowerCase(): + case OP_OPTION_MARKET_OP.toLowerCase(): + return 'OP' + case ARB_LIQUIDITY_POOL_OP.toLowerCase(): + case ARB_OPTION_MARKET_OP.toLowerCase(): + return 'ARB' } return asset } @@ -172,16 +196,20 @@ export function GetMarket(address: string) { switch (address.toLowerCase()) { case ETH_LIQUIDITY_POOL_ARB.toLowerCase(): case ETH_OPTION_MARKET_ARB.toLowerCase(): - return 'ETH-USDC' case ETH_LIQUIDITY_POOL_OP.toLowerCase(): case ETH_OPTION_MARKET_OP.toLowerCase(): - return 'sETH-sUSD' + return 'ETH-USDC' case BTC_LIQUIDITY_POOL_OP.toLowerCase(): - case BTC_OPTION_MARKET_OP.toLowerCase(): - return 'sBTC-sUSD' case BTC_LIQUIDITY_POOL_ARB.toLowerCase(): + case BTC_OPTION_MARKET_OP.toLowerCase(): case BTC_OPTION_MARKET_ARB.toLowerCase(): return 'WBTC-USDC' + case OP_LIQUIDITY_POOL_OP.toLowerCase(): + case OP_OPTION_MARKET_OP.toLowerCase(): + return 'OP-USDC' + case ARB_LIQUIDITY_POOL_OP.toLowerCase(): + case ARB_OPTION_MARKET_OP.toLowerCase(): + return 'ARB-USDC' } return market } @@ -212,6 +240,7 @@ export function DisplayTraderNoEmoji(trade: TraderAddress) { } export function MarketColor(marketName: string) { + return '#1AF7C0' if ( marketName.toLowerCase() == 'eth' || marketName.toLowerCase() == 'seth-susd' || @@ -226,8 +255,12 @@ export function MarketColor(marketName: string) { ) { return '#F7931A' } - - return '#1AF7C0' + if (marketName.toLowerCase() == 'arb' || marketName.toLowerCase() == 'arb-usdc') { + return '#28A0F0' + } + if (marketName.toLowerCase() == 'op' || marketName.toLowerCase() == 'op-usdc') { + return '#FF0420' + } } export function StatSymbol(marketName: string) { @@ -245,4 +278,10 @@ export function StatSymbol(marketName: string) { ) { return '🔶' } + if (marketName.toLowerCase() == 'op' || marketName.toLowerCase() == 'op-usdc') { + return '🔴' + } + if (marketName.toLowerCase() == 'arb' || marketName.toLowerCase() == 'arb-usdc') { + return '🟦' + } } diff --git a/app/src/templates/deposit.ts b/app/src/templates/deposit.ts index 456e9cd..b49e849 100644 --- a/app/src/templates/deposit.ts +++ b/app/src/templates/deposit.ts @@ -8,12 +8,14 @@ import { BlockExplorerLink, LyraDappUrl, StatSymbol, - NetworkFooter, + Footer, PortfolioLink, MarketColor, + getThumb, } from './common' +import { titleCaseWord } from '../utils/utils' -export function DepositTwitter(dto: DepositDto, network: Network, mainnet = false) { +export function DepositTwitter(dto: DepositDto, network: Network) { const post: string[] = [] post.push(`💵 ${formatUSD(dto.amount)} Deposit\n\n`) post.push(`from ${DisplayTrader(dto)}\n`) @@ -26,13 +28,18 @@ export function DepositTwitter(dto: DepositDto, network: Network, mainnet = fals return post.join('') } -export function DepositDiscord(dto: DepositDto, network: Network, mainnet = false): EmbedBuilder[] { +export function DepositDiscord(dto: DepositDto, network: Network): EmbedBuilder[] { const embeds: EmbedBuilder[] = [] const embed = new EmbedBuilder() .setColor(`${MarketColor(dto.market)}`) .setURL(`${BlockExplorerLink(dto.transactionHash, network)}`) - .setTitle(`Deposit: ${StatSymbol(dto.market)} ${dto.market} Market Vault`) + .setTitle(`Deposit: ${dto.market} Market Vault`) .addFields( + { + name: `⛓️ Network`, + value: `> ${titleCaseWord(network)}`, + inline: false, + }, { name: `💵 Amount:`, value: `> ${formatUSD(dto.value)}`, @@ -52,7 +59,13 @@ export function DepositDiscord(dto: DepositDto, network: Network, mainnet = fals inline: false, }) } - NetworkFooter(embed, network) + + const assetThumb = getThumb(dto.asset.toLowerCase()) + + if (assetThumb) { + embed.setThumbnail(assetThumb) + } + Footer(embed) embeds.push(embed) return embeds } diff --git a/app/src/templates/help.ts b/app/src/templates/help.ts index 118b778..5c1ba23 100644 --- a/app/src/templates/help.ts +++ b/app/src/templates/help.ts @@ -10,9 +10,7 @@ export function HelpDiscord(): string { post.push('/leaderboard | Top 10 traders\n') post.push('/stats | Vault stats\n') post.push('/arbs | Lyra / Deribit arbs\n') - - // post.push('/trader | Last 5 trades\n') - + post.push('/trader | Last 5 trades\n') post.push('```\n') return post.join('') } diff --git a/app/src/templates/leaderboard.ts b/app/src/templates/leaderboard.ts index 3f5a3c3..c3281a7 100644 --- a/app/src/templates/leaderboard.ts +++ b/app/src/templates/leaderboard.ts @@ -1,16 +1,17 @@ import { Network } from '@lyrafinance/lyra-js' import { EmbedBuilder } from 'discord.js' -import { bannerUrls, iconUrls } from '../constants/urls' +import { bannerUrls } from '../constants/urls' import { Trader } from '../types/lyra' import formatUSD from '../utils/formatUSD' -import { DisplayTrader, LyraDappUrl, Medal, NetworkFooter, PortfolioLink } from './common' +import { DisplayTrader, LyraDappUrl, Medal, Footer, PortfolioLink } from './common' +import { titleCaseWord } from '../utils/utils' export function LeaderboardDiscord(leaderBoard: Trader[], network: Network): EmbedBuilder[] { const messageEmbeds: EmbedBuilder[] = [] const tradeEmbed = new EmbedBuilder() .setColor('#0099ff') - .setTitle(`Top ${leaderBoard.length} Profitable Traders`) + .setTitle(`Top ${leaderBoard.length} Profitable Traders ${titleCaseWord(network)}`) .addFields( { name: 'Trader', value: '-------------', inline: true }, { name: `\u200b`, value: '-------------', inline: true }, @@ -44,11 +45,7 @@ export function LeaderboardDiscord(leaderBoard: Trader[], network: Network): Emb if (messageEmbeds.length > 0) { const embedLast = messageEmbeds.pop() if (embedLast) { - embedLast.setFooter({ - iconURL: `${network === Network.Optimism ? iconUrls.optimism : iconUrls.arbitrum}`, - text: `${network === Network.Optimism ? 'Optimism' : 'Arbitrum'}`, - }) - embedLast.setImage(network === Network.Optimism ? bannerUrls.optimism : bannerUrls.arbitrum).setTimestamp() + Footer(embedLast) messageEmbeds.push(embedLast) } } diff --git a/app/src/templates/stats.ts b/app/src/templates/stats.ts index 7fa54b9..88657d6 100644 --- a/app/src/templates/stats.ts +++ b/app/src/templates/stats.ts @@ -2,7 +2,8 @@ import { Network } from '@lyrafinance/lyra-js' import { EmbedBuilder } from 'discord.js' import { VaultStats } from '../types/lyra' import fromBigNumber from '../utils/fromBigNumber' -import { FN, FNS, MarketColor, NetworkFooter, StatSymbol, VaultLink } from './common' +import { FN, FNS, MarketColor, Footer, StatSymbol, VaultLink, getThumb } from './common' +import { titleCaseWord } from '../utils/utils' export function StatDiscord(stat: VaultStats, network: Network): EmbedBuilder[] { const messageEmbeds: EmbedBuilder[] = [] @@ -11,25 +12,34 @@ export function StatDiscord(stat: VaultStats, network: Network): EmbedBuilder[] .setURL(`${VaultLink(stat.market.name, network)}`) .setTitle(`${stat.market.name} Market Vault`) .addFields( - { name: 'TVL', value: `> $${FN(stat.tvl, 0)}`, inline: true }, - { name: 'TVL Change (30d)', value: `> ${FNS(stat.tvlChange * 100, 2)}%`, inline: true }, - { name: `Volume (30d)`, value: `> $${FN(stat.totalNotionalVolume, 2)}`, inline: true }, - { name: 'Token Value', value: `> $${FN(stat.tokenPrice, 4)}`, inline: true }, - { name: `Fees (30d)`, value: `> $${FN(stat.totalFees, 2)}`, inline: true }, - { name: 'Open Interest', value: `> $${FN(stat.openInterest, 2)}`, inline: true }, - { name: 'Annualized Perf', value: `> ${FNS(stat.tokenPriceChangeAnnualized * 100, 2)}%`, inline: true }, - { name: 'Net Delta', value: `> ${FNS(fromBigNumber(stat.netGreeks.netDelta), 3)}`, inline: true }, - { name: 'Net Vega', value: `> ${FNS(fromBigNumber(stat.netGreeks.netStdVega), 3)}`, inline: true }, - { name: 'Utilization', value: `> ${FN(stat.liquidity.utilization * 100, 2)}%`, inline: true }, - { name: 'Pending Deposits', value: `> $${FN(fromBigNumber(stat.liquidity.pendingDeposits), 2)}`, inline: true }, + { name: `⛓️ Network`, value: `> ${titleCaseWord(network)}`, inline: true }, + { name: '🏦 TVL', value: `> $${FN(stat.tvl, 0)}`, inline: true }, + { name: '💸 TVL Change', value: `> ${FNS(stat.tvlChange * 100, 2)}%`, inline: true }, + { name: `📊 Volume 30d`, value: `> $${FN(stat.totalNotionalVolume, 2)}`, inline: true }, + { name: '🪙 Token Value', value: `> $${FN(stat.tokenPrice, 4)}`, inline: true }, + { name: `💰 Fees 30d`, value: `> $${FN(stat.totalFees, 2)}`, inline: true }, + { name: '📈 Open Inter.', value: `> $${FN(stat.openInterest, 2)}`, inline: true }, + { name: '💵 Annual Perf', value: `> ${FNS(stat.tokenPriceChangeAnnualized * 100, 2)}%`, inline: true }, + { name: '🧮 Net Delta', value: `> ${FNS(fromBigNumber(stat.netGreeks.netDelta), 3)}`, inline: true }, + { name: '〽️ Net Vega', value: `> ${FNS(fromBigNumber(stat.netGreeks.netStdVega), 3)}`, inline: true }, + { name: '🔒 Utilization', value: `> ${FN(stat.liquidity.utilization * 100, 2)}%`, inline: true }, { - name: 'Pending Withdrawals', + name: '📥 Deposits', + value: `> $${FN(fromBigNumber(stat.liquidity.pendingDeposits), 2)}`, + inline: true, + }, + { + name: '📤 Withdrawals', value: `> $${FN(fromBigNumber(stat.liquidity.pendingWithdrawals), 2)}`, inline: true, }, ) + const assetThumb = getThumb(stat.asset.toLowerCase()) - NetworkFooter(tradeEmbed, network) + if (assetThumb) { + tradeEmbed.setThumbnail(assetThumb) + } + Footer(tradeEmbed) messageEmbeds.push(tradeEmbed) return messageEmbeds } @@ -37,7 +47,7 @@ export function StatDiscord(stat: VaultStats, network: Network): EmbedBuilder[] export function StatTwitter(stat: VaultStats, network: Network) { const post: string[] = [] post.push(`${StatSymbol(stat.market.name)} ${stat.market.name} Market Vault\n`) - post.push(`⛓️ Network: ${network}\n`) + post.push(`⛓️ Network: ${titleCaseWord(network)}\n`) post.push(`💵 30d Perf (Annualized) ${FNS(stat.tokenPriceChangeAnnualized * 100, 4)}%\n`) post.push(`🏦 TVL $${FN(stat.tvl, 0)}\n`) post.push(`📊 Volume (30d) $${FN(stat.totalNotionalVolume, 2)}\n`) @@ -57,7 +67,7 @@ export function StatTelegram(stat: VaultStats, network: Network) { stat.market.name } Market Vault\n`, ) - post.push(`⛓️ Network: ${network}\n`) + post.push(`⛓️ Network: ${titleCaseWord(network)}\n`) post.push(`💵 30d Perf (Annualized) ${FNS(stat.tokenPriceChangeAnnualized, 4)}%\n`) post.push(`🏦 TVL $${FN(stat.tvl, 0)}\n`) post.push(`📊 Volume (30d) $${FN(stat.totalNotionalVolume, 2)}\n`) diff --git a/app/src/templates/strike.ts b/app/src/templates/strike.ts index 92ae675..e7a3f49 100644 --- a/app/src/templates/strike.ts +++ b/app/src/templates/strike.ts @@ -3,7 +3,7 @@ import { EmbedBuilder } from 'discord.js' import { BoardDto } from '../types/lyra' import formatUSD from '../utils/formatUSD' import { titleCaseWord } from '../utils/utils' -import { ExpiryLink, FormattedDate, MarketColor, NetworkFooter, StatSymbol } from './common' +import { ExpiryLink, FormattedDate, MarketColor, Footer, StatSymbol, getThumb } from './common' // TWITTER export function BoardTwitter(dto: BoardDto, network: Network) { @@ -41,12 +41,17 @@ export function BoardDiscord(dto: BoardDto, network: Network): EmbedBuilder[] { const embed = new EmbedBuilder() .setColor(MarketColor(dto.asset)) .setURL(`${ExpiryLink(dto.market, network, dto.expiryString)}`) - .setTitle( - `Strike${dto.strikes.length > 1 ? 's' : ''}: ${StatSymbol(dto.market)} ${dto.market} Market | ${FormattedDate( - dto.expiry, - )}`, - ) + .setTitle(`Strike${dto.strikes.length > 1 ? 's' : ''}: ${dto.market} Market | ${FormattedDate(dto.expiry)}`) + embed.addFields({ + name: `⛓️ Network`, + value: `> ${titleCaseWord(network)}`, + inline: false, + }) + const assetThumb = getThumb(dto.asset.toLowerCase()) + if (assetThumb) { + embed.setThumbnail(assetThumb) + } dto.strikes.map((strike) => { embed.addFields({ name: `🎯 ${formatUSD(strike.strikePrice)}`, @@ -55,7 +60,7 @@ export function BoardDiscord(dto: BoardDto, network: Network): EmbedBuilder[] { }) }) - NetworkFooter(embed, network) + Footer(embed) embeds.push(embed) return embeds } diff --git a/app/src/templates/trade.ts b/app/src/templates/trade.ts index 4e84625..30062f6 100644 --- a/app/src/templates/trade.ts +++ b/app/src/templates/trade.ts @@ -8,7 +8,7 @@ import { FN, FormattedDate, Medal, - NetworkFooter, + Footer, PortfolioLink, PositionLink, ShowProfitAndLoss, @@ -17,9 +17,11 @@ import { TwitterLink, MarketColor, BlockExplorerAddress, + getThumb, } from './common' import { Network } from '@lyrafinance/lyra-js' import formatUSD from '../utils/formatUSD' +import { titleCaseWord } from '../utils/utils' export function TradeTwitter(trade: TradeDto, network: Network) { const post: string[] = [] @@ -66,7 +68,7 @@ export function TradeTwitter(trade: TradeDto, network: Network) { } export function TradeTelegram(trade: TradeDto, network: Network) { - const img = TradeShareImage(trade) + //const img = TradeShareImage(trade) const post: string[] = [] if (!trade.isLiquidation) { post.push( @@ -125,13 +127,24 @@ export function TradeTelegram(trade: TradeDto, network: Network) { export function TradeDiscord(trade: TradeDto, network: Network): EmbedBuilder { const url = PositionLink(trade, network) const tradeEmbed = new EmbedBuilder().setURL(`${url}`) + const assetThumb = getThumb(trade.asset.toLowerCase()) + + if (assetThumb) { + tradeEmbed.setThumbnail(assetThumb) + } + + let decimals = 0 + + if (trade.asset == 'OP' || trade.asset == 'ARB') { + decimals = 2 + } if (!trade.isLiquidation) { tradeEmbed .setTitle( `${trade.isOpen ? '✅ Opened:' : '🚫 Closed:'} ${trade.isLong ? 'Long' : 'Short'} ${trade.size} ${ trade.asset - } $${FN(trade.strike, 0)} ${trade.isCall ? 'Call' : 'Put'}`, + } $${FN(trade.strike, decimals)} ${trade.isCall ? 'Call' : 'Put'}`, ) .setColor(`${MarketColor(trade.market)}`) } else { @@ -141,6 +154,11 @@ export function TradeDiscord(trade: TradeDto, network: Network): EmbedBuilder { } tradeEmbed.addFields( + { + name: `🪙 Market`, + value: `> ${trade.market}`, + inline: false, + }, { name: `⏰ Expiry`, value: `> ${FormattedDate(trade.expiry)}`, @@ -151,6 +169,11 @@ export function TradeDiscord(trade: TradeDto, network: Network): EmbedBuilder { value: `> ${trade.premiumFormatted}`, inline: false, }, + { + name: `⛓️ Network`, + value: `> ${titleCaseWord(network)}`, + inline: false, + }, ) if (trade.setCollateralTo != undefined && trade.setCollateralTo > 0) { @@ -215,6 +238,6 @@ export function TradeDiscord(trade: TradeDto, network: Network): EmbedBuilder { tradeEmbed.addFields({ name: '🏦 Vault', value: `> [deposit into vault](${trade.url})`, inline: false }) } - NetworkFooter(tradeEmbed, network) + Footer(tradeEmbed) return tradeEmbed } diff --git a/app/src/templates/transfer.ts b/app/src/templates/transfer.ts index e595cdb..8ef2202 100644 --- a/app/src/templates/transfer.ts +++ b/app/src/templates/transfer.ts @@ -2,7 +2,8 @@ import { Network } from '@lyrafinance/lyra-js' import { EmbedBuilder } from 'discord.js' import { TransferDto } from '../types/lyra' import formatUSD from '../utils/formatUSD' -import { BlockExplorerAddress, BlockExplorerLink, FN, LyraDappUrl, NetworkFooter } from './common' +import { BlockExplorerAddress, BlockExplorerLink, FN, LyraDappUrl, Footer } from './common' +import { titleCaseWord } from '../utils/utils' // TWITTER export function TransferTwitter(dto: TransferDto, network: Network) { @@ -25,17 +26,22 @@ export function TransferDiscord(dto: TransferDto, network: Network): EmbedBuilde .setTitle(`✅ Transfer: ${FN(dto.amount, 2)} $${dto.token} (${formatUSD(dto.value)})`) .addFields( { - name: `From:`, + name: `⛓️ Network`, + value: `> ${titleCaseWord(network)}`, + inline: false, + }, + { + name: `📤 From:`, value: `> [${dto.fromEns ? dto.fromEns : dto.from}](${BlockExplorerAddress(dto.fromAddress, network)})`, inline: false, }, { - name: `To:`, + name: `📥 To:`, value: `> [${dto.toEns ? dto.toEns : dto.to}](${BlockExplorerAddress(dto.toAddress, network)})`, inline: false, }, ) - NetworkFooter(tradeEmbed, network) + Footer(tradeEmbed) messageEmbeds.push(tradeEmbed) return messageEmbeds } diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index 8ecfa32..ded4971 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -3,21 +3,16 @@ import Lyra from '@lyrafinance/lyra-js' import { Fren } from './fren' import { LeaderboardElement } from './leaderboardAPI' +import { Pair } from './dexscreener' declare global { var LEADERBOARD_ARB: LeaderboardElement[] = [] var LEADERBOARD_OPT: LeaderboardElement[] = [] var LYRA_ENS: { [key: string]: string } = {} var FREN: { [key: string]: Fren } = {} - - var LYRA_PRICE: number - var LYRA_24HR: number - var ETH_PRICE: number - var ETH_24HR: number - var BTC_PRICE: number - var BTC_24HR: number var LYRA_ARB: Lyra var LYRA_OPT: Lyra + var PRICES: Pair[] = [] } declare module '*.json' { diff --git a/app/src/types/lyra.ts b/app/src/types/lyra.ts index e96f2e1..d6226cc 100644 --- a/app/src/types/lyra.ts +++ b/app/src/types/lyra.ts @@ -111,6 +111,7 @@ export type LyraDto = BaseEvent & { } export type VaultStats = { + asset: string market: Market liquidity: MarketLiquiditySnapshot netGreeks: MarketNetGreeksSnapshot diff --git a/app/src/utils/arbUtils.ts b/app/src/utils/arbUtils.ts index eed32bd..461d639 100644 --- a/app/src/utils/arbUtils.ts +++ b/app/src/utils/arbUtils.ts @@ -5,6 +5,7 @@ import { OptionsMap, OptionType, ProviderType } from '../types/arbs' import { getDeribitRates } from '../providers/deribit' import { getLyraRates } from '../providers/Lyra' import { Network } from '@lyrafinance/lyra-js' +import { GetPrice } from '../integrations/prices' type Strikes = { allStrikes?: number[] @@ -14,7 +15,7 @@ type Strikes = { } export const useStrikes = (): Strikes => { - const basePrice = ETH_PRICE + const basePrice = GetPrice('eth') // Call : 0.8x spot -> 2x spot // Put : 0.5x spot -> 1.2x spot @@ -70,7 +71,8 @@ type TermStrikesOptions = { export async function useRatesData(marketName: string, network: Network, filterSell = false) { const providers: ProviderType[] = [ProviderType.LYRA, ProviderType.DERIBIT] - const [deribit, lyra] = await Promise.all([getDeribitRates(marketName), getLyraRates(marketName, network)]) + const deribit = await getDeribitRates(marketName) + const lyra = await getLyraRates(marketName, network) const rates = { [ProviderType.DERIBIT]: deribit, diff --git a/app/src/utils/filterNulls.ts b/app/src/utils/filterNulls.ts new file mode 100644 index 0000000..9a83d8d --- /dev/null +++ b/app/src/utils/filterNulls.ts @@ -0,0 +1,3 @@ +export default function filterNulls(array: (TValue | null | undefined)[]): TValue[] { + return array.filter((val: TValue | null | undefined) => val !== null && val !== undefined) as TValue[] +} diff --git a/app/src/utils/lyra.ts b/app/src/utils/lyra.ts index a6174c8..f3af6b2 100644 --- a/app/src/utils/lyra.ts +++ b/app/src/utils/lyra.ts @@ -1,10 +1,10 @@ -import Lyra, { Version } from '@lyrafinance/lyra-js' +import Lyra, { Version, Network } from '@lyrafinance/lyra-js' import { NETWORK_CONFIGS } from '../constants/networks' import CachedStaticJsonRpcProvider from './CachedStaticJsonRpcProvider' import getArbitrumChainId from './getArbitrumChainId' import getChainForChainId from './getChainForChainId' import getOptimismChainId from './getOptimismChainId' -import mainnetProvider from './mainnetProvider' +import { SATSUMA_API_KEY } from '../config' const optimismChainId = getOptimismChainId() const optimismNetworkConfig = NETWORK_CONFIGS[getChainForChainId(optimismChainId)] @@ -16,6 +16,26 @@ export const optimismProvider = new CachedStaticJsonRpcProvider( const arbitrumChainId = getArbitrumChainId() const arbitrumNetworkConfig = NETWORK_CONFIGS[getChainForChainId(arbitrumChainId)] + +const getLyraSubgraphURI = (network: Network): string | undefined => { + switch (network) { + case Network.Optimism: + return `https://subgraph.satsuma-prod.com/${SATSUMA_API_KEY}/lyra/optimism-mainnet-newport/api` + + case Network.Arbitrum: + return `https://subgraph.satsuma-prod.com/${SATSUMA_API_KEY}/lyra/arbitrum-mainnet/api` + } +} + +const getLyraGovSubgraphURI = (network: Network): string | undefined => { + switch (network) { + case Network.Optimism: + return `https://subgraph.satsuma-prod.com/${SATSUMA_API_KEY}/lyra/optimism-governance/api` + case Network.Arbitrum: + return `https://subgraph.satsuma-prod.com/${SATSUMA_API_KEY}/lyra/arbitrum-governance/api` + } +} + export const arbitrumProvider = new CachedStaticJsonRpcProvider( arbitrumNetworkConfig.readRpcUrls, arbitrumNetworkConfig.chainId, @@ -23,12 +43,16 @@ export const arbitrumProvider = new CachedStaticJsonRpcProvider( export const lyraOptimism = new Lyra({ provider: optimismProvider, - optimismProvider: optimismProvider, - ethereumProvider: mainnetProvider, + apiUri: process.env.REACT_APP_API_URL, + subgraphUri: getLyraSubgraphURI(Network.Optimism), + govSubgraphUri: getLyraGovSubgraphURI(Network.Optimism), + version: Version.Newport, }) export const lyraArbitrum = new Lyra({ provider: arbitrumProvider, - optimismProvider: optimismProvider, - ethereumProvider: mainnetProvider, + apiUri: process.env.REACT_APP_API_URL, + subgraphUri: getLyraSubgraphURI(Network.Arbitrum), + govSubgraphUri: getLyraGovSubgraphURI(Network.Arbitrum), + version: Version.Newport, }) diff --git a/sdk/package.json b/sdk/package.json index 863972f..3dbb7ce 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,7 +1,7 @@ { "name": "@lyrafinance/lyra-js", - "version": "0.0.25", - "description": "A JavaScript SDK for Optimistic Ethereum and the Lyra Protocol.", + "version": "0.0.26", + "description": "A JavaScript SDK for the Lyra Protocol.", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", "exports": { @@ -21,11 +21,12 @@ "tsc": "yarn build", "watch": "concurrently \"tsc --project tsconfig.esm.json --watch\" \"tsc --project tsconfig.cjs.json --watch\"", "script": "env-cmd -f scripts/.env.local ts-node --project tsconfig.node.json scripts/index.ts", - "generate-types": "ts-node --project tsconfig.node.json src/contracts/generate-types.ts", + "typegen": "ts-node --project tsconfig.node.json src/contracts/typegen.ts", "sync": "ts-node --project tsconfig.node.json src/contracts/sync.ts", "format": "prettier --write \"src/**/*.ts\"", "lint": "eslint '**/*.ts'", "clean": "rimraf node_modules dist", + "ts-prune": "ts-prune -p tsconfig.esm.json -i 'src/contracts/.*/typechain/|src/index.ts'", "prepare": "yarn build", "preversion": "yarn lint", "version": "yarn format && git add -A src", @@ -34,7 +35,7 @@ "dependencies": { "@apollo/client": "^3.7.3", "cross-fetch": "^3.1.5", - "ethers": "5.6.0", + "ethers": "^5.6.1", "graphql": "^16.6.0" }, "devDependencies": { @@ -55,6 +56,7 @@ "prettier": "^2.7.0", "rimraf": "^3.0.2", "ts-node": "^10.5.0", + "ts-prune": "^0.10.3", "tslib": "^2.4.0", "typechain": "^8.1.1", "typescript": "^4.7.3", diff --git a/sdk/scripts/reward-epoch.ts b/sdk/scripts/reward-epoch.ts index 993bb16..27afa16 100644 --- a/sdk/scripts/reward-epoch.ts +++ b/sdk/scripts/reward-epoch.ts @@ -5,6 +5,5 @@ export default async function rewardEpoch() { const epoch = await lyra.latestGlobalRewardEpoch() const minVaultApy = epoch?.minVaultApy('eth') const maxVaultApy = epoch?.maxVaultApy('eth') - const stakingApy = epoch?.stakingApy - console.log('Global', { minVaultApy, maxVaultApy, stakingApy }) + console.log('Global', { minVaultApy, maxVaultApy }) } diff --git a/sdk/scripts/staking.ts b/sdk/scripts/staking.ts deleted file mode 100644 index 244e0c6..0000000 --- a/sdk/scripts/staking.ts +++ /dev/null @@ -1,7 +0,0 @@ -import getLyra from './utils/getLyra' - -export default async function staking() { - const lyra = getLyra() - const globalStakingData = await lyra.lyraStaking() - console.log(globalStakingData) -} diff --git a/sdk/scripts/utils/approve.ts b/sdk/scripts/utils/approve.ts index a641ef5..6f95eee 100644 --- a/sdk/scripts/utils/approve.ts +++ b/sdk/scripts/utils/approve.ts @@ -1,4 +1,4 @@ -import { Trade } from '../..' +import { Trade, TradeDisabledReason } from '../..' import { MAX_BN } from '../../src/constants/bn' import getLyra from './getLyra' import getSigner from './getSigner' @@ -7,27 +7,17 @@ export default async function approve(trade: Trade): Promise { const lyra = getLyra() const signer = getSigner(lyra) - const account = lyra.account(signer.address) - const marketBalance = await account.marketBalances(trade.marketAddress) - const quoteAsset = marketBalance.quoteAsset - - if (quoteAsset.tradeAllowance.isZero()) { + if (trade.disabledReason === TradeDisabledReason.InsufficientQuoteAllowance) { console.log('approving quote...') - const tx = await trade.approveQuote(account.address, MAX_BN) - if (!tx) { - throw new Error('Cannot approve quote') - } + const tx = await trade.approveQuote(MAX_BN) const response = await signer.sendTransaction(tx) await response.wait() console.log('approved quote') } - if (marketBalance.baseAsset.tradeAllowance.isZero()) { + if (trade.disabledReason === TradeDisabledReason.InsufficientBaseAllowance) { console.log('approving base...') - const tx = await trade.approveBase(account.address, MAX_BN) - if (!tx) { - throw new Error('Cannot approve base') - } + const tx = await trade.approveBase(MAX_BN) const response = await signer.sendTransaction(tx) await response.wait() console.log('approved base') diff --git a/sdk/scripts/utils/getLyra.ts b/sdk/scripts/utils/getLyra.ts index 4845857..a508c5c 100644 --- a/sdk/scripts/utils/getLyra.ts +++ b/sdk/scripts/utils/getLyra.ts @@ -12,10 +12,6 @@ export default function getLyra(): Lyra { const rpcUrl = process.env.RPC_URL ?? getLyraDeploymentRPCURL(chain) const lyra = new Lyra({ provider: new StaticJsonRpcProvider(rpcUrl, chainId), - optimismProvider: new StaticJsonRpcProvider( - getLyraDeploymentRPCURL(Chain.Optimism), - getLyraDeploymentChainId(Chain.Optimism) - ), }) return lyra } diff --git a/sdk/src/account/fetchAccountBalancesAndAllowances.ts b/sdk/src/account/fetchAccountBalancesAndAllowances.ts index 41fe4f0..861229e 100644 --- a/sdk/src/account/fetchAccountBalancesAndAllowances.ts +++ b/sdk/src/account/fetchAccountBalancesAndAllowances.ts @@ -1,10 +1,10 @@ -import { BigNumber } from 'ethers' - import { LyraMarketContractId } from '../constants/contracts' -import Lyra from '../lyra' -import callContractWithMulticall from '../utils/callContractWithMulticall' +import { LyraMarketContractMap } from '../constants/mappings' +import { ERC20 } from '../contracts/common/typechain' +import Lyra, { Version } from '../lyra' import getERC20Contract from '../utils/getERC20Contract' import getLyraMarketContract from '../utils/getLyraMarketContract' +import multicall, { MulticallRequest } from '../utils/multicall' import { AccountBalances } from '.' export default async function fetchAccountBalancesAndAllowances(lyra: Lyra, owner: string): Promise { @@ -33,80 +33,82 @@ export default async function fetchAccountBalancesAndAllowances(lyra: Lyra, owne LyraMarketContractId.LiquidityToken ) - const [ - [quoteSymbol], - [quoteDecimals], - [quoteBalance], - [quoteTradeAllowance], - [quoteDepositAllowance], - [baseSymbol], - [baseDecimals], - [baseBalance], - [baseTradeAllowance], - [liquidityBalance], - ] = await callContractWithMulticall< + const { + returnData: [ + quoteSymbol, + quoteDecimals, + quoteBalance, + quoteTradeAllowance, + quoteDepositAllowance, + baseSymbol, + baseDecimals, + baseBalance, + baseTradeAllowance, + liquidityBalance, + ], + } = await multicall< [ - [string], - [number], - [BigNumber], - [BigNumber], - [BigNumber], - [string], - [number], - [BigNumber], - [BigNumber], - [BigNumber] + MulticallRequest, + MulticallRequest, + MulticallRequest, + MulticallRequest, + MulticallRequest, + MulticallRequest, + MulticallRequest, + MulticallRequest, + MulticallRequest, + MulticallRequest, 'balanceOf'> ] >(lyra, [ { - callData: quoteToken.interface.encodeFunctionData('symbol'), contract: quoteToken, - functionFragment: 'symbol', + function: 'symbol', + args: [], }, { - callData: quoteToken.interface.encodeFunctionData('decimals'), contract: quoteToken, - functionFragment: 'decimals', + function: 'decimals', + args: [], }, { - callData: quoteToken.interface.encodeFunctionData('balanceOf', [owner]), contract: quoteToken, - functionFragment: 'balanceOf', + function: 'balanceOf', + args: [owner], }, { - callData: quoteToken.interface.encodeFunctionData('allowance', [owner, optionMarket.address]), contract: quoteToken, - functionFragment: 'allowance', + function: 'allowance', + args: [owner, optionMarket.address], }, { - callData: quoteToken.interface.encodeFunctionData('allowance', [owner, liquidityPool.address]), contract: quoteToken, - functionFragment: 'allowance', + function: 'allowance', + args: [owner, liquidityPool.address], }, { - callData: baseToken.interface.encodeFunctionData('symbol'), contract: baseToken, - functionFragment: 'symbol', + function: 'symbol', + args: [], }, { - callData: baseToken.interface.encodeFunctionData('decimals'), contract: baseToken, - functionFragment: 'decimals', + function: 'decimals', + args: [], }, { - callData: baseToken.interface.encodeFunctionData('balanceOf', [owner]), contract: baseToken, - functionFragment: 'balanceOf', + function: 'balanceOf', + args: [owner], }, { - callData: baseToken.interface.encodeFunctionData('allowance', [owner, optionMarket.address]), contract: baseToken, - functionFragment: 'allowance', + function: 'allowance', + args: [owner, optionMarket.address], }, { - callData: liquidityToken.interface.encodeFunctionData('balanceOf', [owner]), contract: liquidityToken, - functionFragment: 'balanceOf', + function: 'balanceOf', + args: [owner], }, ]) diff --git a/sdk/src/account/getAverageCostPerLPToken.ts b/sdk/src/account/getAverageCostPerLPToken.ts deleted file mode 100644 index e7024c5..0000000 --- a/sdk/src/account/getAverageCostPerLPToken.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { BigNumber } from '@ethersproject/bignumber' - -import { LiquidityDeposit, LiquidityWithdrawal } from '..' -import { UNIT, ZERO_BN } from '../constants/bn' - -export default function getAverageCostPerLPToken( - liquidityDeposits: LiquidityDeposit[], - liquidityWithdrawals: LiquidityWithdrawal[] -): BigNumber { - const deposits = liquidityDeposits - .filter(deposit => !deposit.isPending && deposit.balance) - .map(deposit => { - return { - isDeposit: true, - timestamp: deposit.depositTimestamp, - value: deposit.value, - balance: deposit.balance ?? ZERO_BN, - } - }) - const withdrawals = liquidityWithdrawals - .filter(withdrawal => !withdrawal.isPending && withdrawal.value) - .map(withdrawal => { - return { - isDeposit: false, - timestamp: withdrawal.withdrawalTimestamp, - value: withdrawal.value ?? ZERO_BN, - balance: withdrawal.balance, - } - }) - const depositsAndWithdrawals = [...deposits, ...withdrawals].sort((a, b) => a.timestamp - b.timestamp) - const { averageTokenPrice } = depositsAndWithdrawals.reduce( - (profitAndLoss, event) => { - const { balance: prevBalance, averageTokenPrice: prevAverageTokenPrice } = profitAndLoss - const { isDeposit, value, balance } = event - const newTotalTokenAmount = isDeposit ? prevBalance.add(balance) : prevBalance.sub(balance) - const prevTotalTokenValue = prevBalance.mul(prevAverageTokenPrice).div(UNIT) - const totalTokenValue = prevTotalTokenValue.add(value) - const averageTokenPrice = - isDeposit && newTotalTokenAmount.gt(0) - ? totalTokenValue.mul(UNIT).div(newTotalTokenAmount) - : prevAverageTokenPrice - return { - averageTokenPrice, - balance: newTotalTokenAmount, - } - }, - { - averageTokenPrice: ZERO_BN, - balance: ZERO_BN, - } - ) - return averageTokenPrice -} diff --git a/sdk/src/account/index.ts b/sdk/src/account/index.ts index 4b52c88..cc516ab 100644 --- a/sdk/src/account/index.ts +++ b/sdk/src/account/index.ts @@ -1,35 +1,12 @@ -import { getAddress } from '@ethersproject/address' import { BigNumber } from '@ethersproject/bignumber' import { PopulatedTransaction } from '@ethersproject/contracts' -import { MAX_BN, ONE_BN, UNIT, ZERO_BN } from '../constants/bn' -import { - Deployment, - LYRA_ETHEREUM_MAINNET_ADDRESS, - LYRA_OPTIMISM_KOVAN_ADDRESS, - LyraContractId, - LyraGlobalContractId, - LyraMarketContractId, - NEW_STAKED_LYRA_OPTIMISM_ADDRESS, - OLD_STAKED_LYRA_OPTIMISM_ADDRESS, - OP_OPTIMISM_MAINNET_ADDRESS, -} from '../constants/contracts' -import { LiquidityDeposit } from '../liquidity_deposit' -import { LiquidityWithdrawal } from '../liquidity_withdrawal' +import { Deployment, LyraContractId } from '../constants/contracts' import Lyra from '../lyra' -import { LyraStake } from '../lyra_stake' -import { LyraStaking } from '../lyra_staking' -import { LyraUnstake } from '../lyra_unstake' import { Market } from '../market' -import buildTxWithGasEstimate from '../utils/buildTxWithGasEstimate' -import fetchLyraBalances from '../utils/fetchLyraBalances' -import getERC20Contract from '../utils/getERC20Contract' -import getGlobalContract from '../utils/getGlobalContract' +import buildTx from '../utils/buildTx' import getLyraContract from '../utils/getLyraContract' -import getLyraMarketContract from '../utils/getLyraMarketContract' -import toBigNumber from '../utils/toBigNumber' import fetchAccountBalancesAndAllowances from './fetchAccountBalancesAndAllowances' -import getAverageCostPerLPToken from './getAverageCostPerLPToken' export type AccountTokenBalance = { address: string @@ -59,55 +36,6 @@ export type AccountBalances = { liquidityToken: AccountLiquidityTokenBalance } -export type AccountLyraStaking = { - staking: LyraStaking - lyraBalances: AccountLyraBalances - lyraAllowances: AccountLyraAllowances - isInUnstakeWindow: boolean - isInCooldown: boolean - unstakeWindowStartTimestamp: number | null - unstakeWindowEndTimestamp: number | null -} - -export type AccountWethLyraStakingL2 = { - unstakedLPTokenBalance: BigNumber - stakedLPTokenBalance: BigNumber - rewards: BigNumber - opRewards: BigNumber - allowance: BigNumber -} - -export type AccountWethLyraStaking = { - unstakedLPTokenBalance: BigNumber - stakedLPTokenBalance: BigNumber - rewards: BigNumber - allowance: BigNumber -} - -export type AccountLyraBalances = { - ethereumLyra: BigNumber - optimismLyra: BigNumber - optimismOldStkLyra: BigNumber - ethereumStkLyra: BigNumber - optimismStkLyra: BigNumber -} - -export type AccountLyraAllowances = { - stakingAllowance: BigNumber - migrationAllowance: BigNumber -} - -export type ClaimableBalanceL2 = { - op: BigNumber - oldStkLyra: BigNumber - newStkLyra: BigNumber -} - -export type ClaimableBalanceL1 = { - newStkLyra: BigNumber - lyra: BigNumber -} - export type AccountPnlSnapshot = { timestamp: number livePnl: number @@ -143,418 +71,12 @@ export class Account { return balance } - async liquidityUnrealizedPnl(marketAddressOrName: string): Promise<{ pnl: BigNumber; pnlPercent: BigNumber }> { - const [market, balance, liquidityDeposits, liquidityWithdrawals] = await Promise.all([ - this.lyra.market(marketAddressOrName), - this.marketBalances(marketAddressOrName), - this.lyra.liquidityDeposits(marketAddressOrName, this.address), - this.lyra.liquidityWithdrawals(marketAddressOrName, this.address), - ]) - if (!balance) { - throw new Error('No balance found for market') - } - const marketLiquidity = await market.liquidity() - const value = marketLiquidity.tokenPrice.mul(balance.liquidityToken.balance).div(UNIT) - const avgCostPerToken = getAverageCostPerLPToken(liquidityDeposits, liquidityWithdrawals) - const avgValue = avgCostPerToken.mul(balance.liquidityToken.balance).div(UNIT) - const pnl = value.sub(avgValue) - const pnlPercent = avgCostPerToken.gt(0) - ? marketLiquidity.tokenPrice.mul(UNIT).div(avgCostPerToken).sub(ONE_BN) - : ZERO_BN - return { - pnl, - pnlPercent, - } - } - - async lyraBalances(): Promise { - const lyraBalances = await fetchLyraBalances(this.address) - return { - ethereumLyra: lyraBalances.mainnetLYRA, - optimismLyra: lyraBalances.opLYRA, - optimismOldStkLyra: lyraBalances.opOldStkLYRA, - ethereumStkLyra: lyraBalances.mainnetStkLYRA, - optimismStkLyra: lyraBalances.opStkLYRA, - } - } - - async lyraStakingAllowance(): Promise { - if (!this.lyra.ethereumProvider) { - throw new Error('Ethereum provider required.') - } - const lyraTokenContract = getERC20Contract(this.lyra.ethereumProvider, LYRA_ETHEREUM_MAINNET_ADDRESS) - const lyraStakingModuleContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.LyraStakingModule, - this.lyra.ethereumProvider - ) - return await lyraTokenContract.allowance(this.address, lyraStakingModuleContract.address) - } - - async stkLyraMigrationAllowance(): Promise { - if (!this.lyra.optimismProvider) { - throw new Error('Optimism provider required.') - } - const oldStakedLyraContract = getERC20Contract(this.lyra.optimismProvider, OLD_STAKED_LYRA_OPTIMISM_ADDRESS) - const tokenMigratorContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.TokenMigrator, - this.lyra.optimismProvider - ) - return await oldStakedLyraContract.allowance(this.address, tokenMigratorContract.address) - } - - async lyraAllowances(): Promise { - const [stakingAllowance, migrationAllowance] = await Promise.all([ - this.lyraStakingAllowance(), - this.stkLyraMigrationAllowance(), - ]) - return { - stakingAllowance, - migrationAllowance, - } - } - - async claimableRewardsL1(): Promise { - const wethLyraStakingRewardsL1Contract = getGlobalContract( - this.lyra, - LyraGlobalContractId.WethLyraStakingRewardsL1, - this.lyra.ethereumProvider - ) - const [stakingRewardsClaimableBalance, wethLyraRewardsL1ClaimableBalance] = await Promise.all([ - LyraStaking.getStakingRewardsBalance(this.lyra, this.address), - wethLyraStakingRewardsL1Contract.earned(this.address), - ]) - return { - newStkLyra: stakingRewardsClaimableBalance, - lyra: wethLyraRewardsL1ClaimableBalance, - } - } - - async claimableRewardsL2(): Promise { - const distributorContract = getGlobalContract(this.lyra, LyraGlobalContractId.MultiDistributor) - const newStkLyraAddress = getAddress(NEW_STAKED_LYRA_OPTIMISM_ADDRESS) - const oldStkLyraAddress = getAddress(OLD_STAKED_LYRA_OPTIMISM_ADDRESS) - const opAddress = - this.lyra.deployment === Deployment.Mainnet ? OP_OPTIMISM_MAINNET_ADDRESS : LYRA_OPTIMISM_KOVAN_ADDRESS - const [newStkLyraClaimableBalance, oldStkLyraClaimableBalance, opClaimableBalance] = await Promise.all([ - distributorContract.claimableBalances(this.address, newStkLyraAddress), - distributorContract.claimableBalances(this.address, oldStkLyraAddress), - distributorContract.claimableBalances(this.address, opAddress), - ]) - return { - newStkLyra: newStkLyraClaimableBalance ?? ZERO_BN, - oldStkLyra: oldStkLyraClaimableBalance ?? ZERO_BN, - op: opClaimableBalance ?? ZERO_BN, - } - } - - async claim(tokenAddresses: string[]): Promise { - const distributorContract = getGlobalContract(this.lyra, LyraGlobalContractId.MultiDistributor) - const calldata = distributorContract.interface.encodeFunctionData('claim', [tokenAddresses]) - return await buildTxWithGasEstimate( - this.lyra.provider, - this.lyra.provider.network.chainId, - distributorContract.address, - this.address, - calldata - ) - } - - // Approval - - async drip(): Promise { + drip(): PopulatedTransaction { if (this.lyra.deployment !== Deployment.Testnet) { throw new Error('Faucet is only supported on testnet contracts') } const faucet = getLyraContract(this.lyra, this.lyra.version, LyraContractId.TestFaucet) const data = faucet.interface.encodeFunctionData('drip') - const tx = await buildTxWithGasEstimate( - this.lyra.provider, - this.lyra.provider.network.chainId, - faucet.address, - this.address, - data - ) - if (!tx) { - throw new Error('Failed to estimate gas for drip transaction') - } - return tx - } - - async approveDeposit(marketAddressOrName: string, amount: BigNumber): Promise { - const market = await Market.get(this.lyra, marketAddressOrName) - const liquidityPoolContract = getLyraMarketContract( - this.lyra, - market.contractAddresses, - this.lyra.version, - LyraMarketContractId.LiquidityPool - ) - const erc20 = getERC20Contract(this.lyra.provider, market.quoteToken.address) - const data = erc20.interface.encodeFunctionData('approve', [liquidityPoolContract.address, amount]) - const tx = await buildTxWithGasEstimate( - this.lyra.provider, - this.lyra.provider.network.chainId, - erc20.address, - this.address, - data - ) - return tx - } - - async deposit( - marketAddressOrName: string, - beneficiary: string, - amountQuote: BigNumber - ): Promise { - return await LiquidityDeposit.deposit(this.lyra, marketAddressOrName, beneficiary, amountQuote) - } - - async withdraw( - marketAddressOrName: string, - beneficiary: string, - amountLiquidityTokens: BigNumber - ): Promise { - return await LiquidityWithdrawal.withdraw(this.lyra, marketAddressOrName, beneficiary, amountLiquidityTokens) - } - - async lyraStaking(): Promise { - const lyraStakingModuleContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.LyraStakingModule, - this.lyra.ethereumProvider - ) - const [block, lyraBalances, lyraAllowances, staking, accountCooldownBN] = await Promise.all([ - this.lyra.provider.getBlock('latest'), - this.lyraBalances(), - this.lyraAllowances(), - this.lyra.lyraStaking(), - lyraStakingModuleContract.stakersCooldowns(this.address), - ]) - const accountCooldown = accountCooldownBN.toNumber() - const cooldownStartTimestamp = accountCooldown > 0 ? accountCooldown : null - const cooldownEndTimestamp = accountCooldown > 0 ? accountCooldown + staking.cooldownPeriod : null - const unstakeWindowStartTimestamp = cooldownEndTimestamp - const unstakeWindowEndTimestamp = unstakeWindowStartTimestamp - ? unstakeWindowStartTimestamp + staking.unstakeWindow - : null - const isInUnstakeWindow = - !!unstakeWindowStartTimestamp && - !!unstakeWindowEndTimestamp && - block.timestamp >= unstakeWindowStartTimestamp && - block.timestamp <= unstakeWindowEndTimestamp - const isInCooldown = - !!cooldownStartTimestamp && - !!cooldownEndTimestamp && - block.timestamp >= cooldownStartTimestamp && - block.timestamp <= cooldownEndTimestamp - return { - staking, - lyraBalances, - lyraAllowances, - isInUnstakeWindow, - isInCooldown, - unstakeWindowStartTimestamp, - unstakeWindowEndTimestamp, - } - } - - async wethLyraStakingL2(): Promise { - const [gelatoPoolContract, wethLyraStakingL2RewardsContract] = await Promise.all([ - getGlobalContract(this.lyra, LyraGlobalContractId.ArrakisPoolL2, this.lyra.optimismProvider), - getGlobalContract(this.lyra, LyraGlobalContractId.WethLyraStakingRewardsL2, this.lyra.optimismProvider), - ]) - const [unstakedLPTokenBalance, allowance, stakedLPTokenBalance, rewards, latestGlobalRewardEpoch] = - await Promise.all([ - gelatoPoolContract.balanceOf(this.address), - gelatoPoolContract.allowance(this.address, wethLyraStakingL2RewardsContract.address), - wethLyraStakingL2RewardsContract.balanceOf(this.address), - wethLyraStakingL2RewardsContract.earned(this.address), - this.lyra.latestGlobalRewardEpoch(), - ]) - const accountRewardEpoch = await latestGlobalRewardEpoch?.accountRewardEpoch(this.address) - const opRewardsAmount = - accountRewardEpoch?.wethLyraStakingL2?.rewards?.find(token => token.symbol.toLowerCase() === 'op')?.amount ?? 0 - const opRewards = toBigNumber(opRewardsAmount) - return { - unstakedLPTokenBalance, - allowance, - stakedLPTokenBalance, - rewards: rewards, - opRewards: opRewards, - } - } - - async wethLyraStaking(): Promise { - const [arrakisPoolL1Contract, wethLyraStakingRewardsL1Contract] = await Promise.all([ - getGlobalContract(this.lyra, LyraGlobalContractId.ArrakisPoolL1, this.lyra.ethereumProvider), - getGlobalContract(this.lyra, LyraGlobalContractId.WethLyraStakingRewardsL1, this.lyra.ethereumProvider), - ]) - const [unstakedLPTokenBalance, allowance, stakedLPTokenBalance, rewards] = await Promise.all([ - arrakisPoolL1Contract.balanceOf(this.address), - arrakisPoolL1Contract.allowance(this.address, wethLyraStakingRewardsL1Contract.address), - wethLyraStakingRewardsL1Contract.balanceOf(this.address), - wethLyraStakingRewardsL1Contract.earned(this.address), - ]) - return { - unstakedLPTokenBalance, - allowance, - stakedLPTokenBalance, - rewards: rewards, - } - } - - async approveStake(): Promise { - return await LyraStake.approve(this.lyra, this.address) - } - - async stake(amount: BigNumber): Promise { - return await LyraStake.get(this.lyra, this.address, amount) - } - - async requestUnstake(): Promise { - return await LyraUnstake.requestUnstake(this.lyra, this.address) - } - - async unstake(amount: BigNumber): Promise { - return await LyraUnstake.get(this.lyra, this.address, amount) - } - - async claimStakedLyraRewards(): Promise { - return await LyraStaking.claimRewards(this.lyra, this.address) - } - - async claimWethLyraRewards(): Promise { - const wethLyraStakingL1RewardsContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.WethLyraStakingRewardsL1, - this.lyra.ethereumProvider - ) - const calldata = wethLyraStakingL1RewardsContract.interface.encodeFunctionData('getReward') - return await buildTxWithGasEstimate( - this.lyra.ethereumProvider ?? this.lyra.provider, - 1, - wethLyraStakingL1RewardsContract.address, - this.address, - calldata - ) - } - - async stakeWethLyra(amount: BigNumber): Promise { - const wethLyraStakingL1RewardsContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.WethLyraStakingRewardsL1, - this.lyra.ethereumProvider - ) - const calldata = wethLyraStakingL1RewardsContract.interface.encodeFunctionData('stake', [amount]) - return await buildTxWithGasEstimate( - this.lyra.ethereumProvider ?? this.lyra.provider, - 1, - wethLyraStakingL1RewardsContract.address, - this.address, - calldata - ) - } - - async unstakeWethLyraL2(amount: BigNumber) { - const wethLyraStakingL2RewardsContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.WethLyraStakingRewardsL2, - this.lyra.optimismProvider - ) - const calldata = wethLyraStakingL2RewardsContract.interface.encodeFunctionData('withdraw', [amount]) - return await buildTxWithGasEstimate( - this.lyra.optimismProvider ?? this.lyra.provider, - this.lyra.chainId, - wethLyraStakingL2RewardsContract.address, - this.address, - calldata - ) - } - - async unstakeWethLyra(amount: BigNumber) { - const wethLyraStakingL1RewardsContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.WethLyraStakingRewardsL1, - this.lyra.ethereumProvider - ) - const calldata = wethLyraStakingL1RewardsContract.interface.encodeFunctionData('withdraw', [amount]) - return await buildTxWithGasEstimate( - this.lyra.ethereumProvider ?? this.lyra.provider, - 1, - wethLyraStakingL1RewardsContract.address, - this.address, - calldata - ) - } - - async approveWethLyraTokens(): Promise { - const arrakisPoolContract = getGlobalContract(this.lyra, LyraGlobalContractId.ArrakisPoolL1) - const wethLyraStakingContract = getGlobalContract(this.lyra, LyraGlobalContractId.WethLyraStakingRewardsL1) - const calldata = arrakisPoolContract.interface.encodeFunctionData('approve', [ - wethLyraStakingContract.address, - MAX_BN, - ]) - return await buildTxWithGasEstimate( - this.lyra.ethereumProvider ?? this.lyra.provider, - 1, - arrakisPoolContract.address, - this.address, - calldata - ) - } - - async claimWethLyraRewardsL2() { - const wethLyraStakingL2RewardsContract = getGlobalContract(this.lyra, LyraGlobalContractId.WethLyraStakingRewardsL2) - const calldata = wethLyraStakingL2RewardsContract.interface.encodeFunctionData('getReward') - return await buildTxWithGasEstimate( - this.lyra.optimismProvider ?? this.lyra.provider, - this.lyra.chainId, - wethLyraStakingL2RewardsContract.address, - this.address, - calldata - ) - } - - async approveMigrateStakedLyra(): Promise { - const tokenMigratorContract = getGlobalContract(this.lyra, LyraGlobalContractId.TokenMigrator) - const erc20 = getERC20Contract(this.lyra.provider, OLD_STAKED_LYRA_OPTIMISM_ADDRESS) - const data = erc20.interface.encodeFunctionData('approve', [tokenMigratorContract.address, MAX_BN]) - const tx = await buildTxWithGasEstimate( - this.lyra.provider, - this.lyra.provider.network.chainId, - erc20.address, - this.address, - data - ) - return tx - } - - async migrateStakedLyra(): Promise { - const tokenMigratorContract = getGlobalContract( - this.lyra, - LyraGlobalContractId.TokenMigrator, - this.lyra.optimismProvider - ) - const { optimismOldStkLyra } = await this.lyraBalances() - const data = tokenMigratorContract.interface.encodeFunctionData('swap', [optimismOldStkLyra]) - const tx = await buildTxWithGasEstimate( - this.lyra.provider, - this.lyra.provider.network.chainId, - tokenMigratorContract.address, - this.address, - data - ) - return tx - } - - // Edges - - async liquidityDeposits(marketAddressOrName: string): Promise { - return await this.lyra.liquidityDeposits(marketAddressOrName, this.address) - } - - async liquidityWithdrawals(marketAddressOrName: string): Promise { - return await this.lyra.liquidityWithdrawals(marketAddressOrName, this.address) + return buildTx(this.lyra.provider, this.lyra.provider.network.chainId, faucet.address, this.address, data) } } diff --git a/sdk/src/account_reward_epoch/getDistributedTradingRewards.ts b/sdk/src/account_reward_epoch/getDistributedTradingRewards.ts new file mode 100644 index 0000000..e8d1ee6 --- /dev/null +++ b/sdk/src/account_reward_epoch/getDistributedTradingRewards.ts @@ -0,0 +1,35 @@ +import { ClaimAddedEvent, GlobalRewardEpoch, RewardEpochTokenAmount } from '..' +import fromBigNumber from '../utils/fromBigNumber' + +const CLAIM_ADDED_TRADING_TAG = 'TRADING' + +export default function getDistributedTradingRewards( + globalRewardEpoch: GlobalRewardEpoch, + claimAddedEvents: ClaimAddedEvent[] +): RewardEpochTokenAmount[] { + const tradingRewardsMap: Record = claimAddedEvents + .filter(event => { + const tags = event.tag.split('-') + return tags.includes(CLAIM_ADDED_TRADING_TAG) && event.epochTimestamp === globalRewardEpoch.startTimestamp + }) + .reduce((tradingRewardsMap, event) => { + const rewardToken = globalRewardEpoch.tradingRewardTokens.find( + t => t.address.toLowerCase() === event.rewardToken.toLowerCase() + ) + if (!rewardToken) { + // console.warn('Missing token info in global epoch config', event.rewardToken) + return tradingRewardsMap + } + + if (tradingRewardsMap[rewardToken.address]) { + tradingRewardsMap[rewardToken.address].amount += fromBigNumber(event.amount, rewardToken.decimals) + } + + return { + ...tradingRewardsMap, + [rewardToken.address]: { ...rewardToken, amount: fromBigNumber(event.amount, rewardToken.decimals) }, + } + }, {} as Record) + + return Object.values(tradingRewardsMap) +} diff --git a/sdk/src/account_reward_epoch/getDistributedVaultRewards.ts b/sdk/src/account_reward_epoch/getDistributedVaultRewards.ts new file mode 100644 index 0000000..7b6fc9c --- /dev/null +++ b/sdk/src/account_reward_epoch/getDistributedVaultRewards.ts @@ -0,0 +1,42 @@ +import { ClaimAddedEvent, GlobalRewardEpoch, Market, RewardEpochTokenAmount } from '..' +import fromBigNumber from '../utils/fromBigNumber' + +const CLAIM_ADDED_VAULTS_TAG = 'MMV' + +export default function getDistributedVaultRewards( + market: Market, + globalRewardEpoch: GlobalRewardEpoch, + claimAddedEvents: ClaimAddedEvent[] +): RewardEpochTokenAmount[] { + const vaultRewardsMap: Record = claimAddedEvents + .filter(event => { + const tags = event.tag.split('-') + const allUpperCaseTags = tags.map(tag => tag.toUpperCase()) + return ( + allUpperCaseTags.includes(CLAIM_ADDED_VAULTS_TAG) && + allUpperCaseTags.includes(market.baseToken.symbol.toUpperCase()) && + market.baseToken.symbol.toUpperCase() !== 'OP' && + event.epochTimestamp === globalRewardEpoch.startTimestamp + ) + }) + .reduce((vaultRewardsMap, event) => { + const rewardToken = globalRewardEpoch.vaultRewardTokens.find( + t => t.address.toLowerCase() === event.rewardToken.toLowerCase() + ) + if (!rewardToken) { + // console.warn('Missing token info in global epoch config', event.rewardToken) + return vaultRewardsMap + } + + if (vaultRewardsMap[rewardToken.address]) { + vaultRewardsMap[rewardToken.address].amount += fromBigNumber(event.amount, rewardToken.decimals) + } + + return { + ...vaultRewardsMap, + [rewardToken.address]: { ...rewardToken, amount: fromBigNumber(event.amount, rewardToken.decimals) }, + } + }, {} as Record) + + return Object.values(vaultRewardsMap) +} diff --git a/sdk/src/account_reward_epoch/getTotalClaimableTradingRewards.ts b/sdk/src/account_reward_epoch/getTotalClaimableTradingRewards.ts new file mode 100644 index 0000000..d768303 --- /dev/null +++ b/sdk/src/account_reward_epoch/getTotalClaimableTradingRewards.ts @@ -0,0 +1,42 @@ +import { ClaimAddedEvent, ClaimEvent, RewardEpochToken, RewardEpochTokenAmount } from '..' +import fromBigNumber from '../utils/fromBigNumber' + +const CLAIM_ADDED_TRADING_TAG = 'TRADING' + +export default function getTotalClaimableTradingRewards( + rewardTokens: RewardEpochToken[], + claimAddedEvents: ClaimAddedEvent[], + claimEvents: ClaimEvent[] +): RewardEpochTokenAmount[] { + const tradingRewardsMap: Record = claimAddedEvents + .filter(event => { + const tags = event.tag.split('-') + return tags.includes(CLAIM_ADDED_TRADING_TAG) + }) + .reduce((tradingRewardsMap, event) => { + const isClaimed = claimEvents.some( + claimEvent => claimEvent.timestamp > event.timestamp && claimEvent.rewardToken === event.rewardToken + ) + + if (isClaimed) { + return tradingRewardsMap + } + + const rewardToken = rewardTokens.find(t => t.address.toLowerCase() === event.rewardToken.toLowerCase()) + if (!rewardToken) { + console.warn('Missing token info in global epoch config', event.rewardToken) + return tradingRewardsMap + } + + if (tradingRewardsMap[rewardToken.address]) { + tradingRewardsMap[rewardToken.address].amount += fromBigNumber(event.amount, rewardToken.decimals) + } + + return { + ...tradingRewardsMap, + [rewardToken.address]: { ...rewardToken, amount: fromBigNumber(event.amount, rewardToken.decimals) }, + } + }, {} as Record) + + return Object.values(tradingRewardsMap).filter(r => r.amount > 0) +} diff --git a/sdk/src/account_reward_epoch/getTotalClaimableVaultRewards.ts b/sdk/src/account_reward_epoch/getTotalClaimableVaultRewards.ts new file mode 100644 index 0000000..77993fd --- /dev/null +++ b/sdk/src/account_reward_epoch/getTotalClaimableVaultRewards.ts @@ -0,0 +1,48 @@ +import { ClaimAddedEvent, ClaimEvent, Market, RewardEpochToken, RewardEpochTokenAmount } from '..' +import fromBigNumber from '../utils/fromBigNumber' + +const CLAIM_ADDED_VAULTS_TAG = 'MMV' + +export default function getTotalClaimableVaultRewards( + market: Market, + rewardTokens: RewardEpochToken[], + claimAddedEvents: ClaimAddedEvent[], + claimEvents: ClaimEvent[] +): RewardEpochTokenAmount[] { + const vaultRewardsMap: Record = claimAddedEvents + .filter(event => { + const tags = event.tag.split('-') + const allUpperCaseTags = tags.map(tag => tag.toUpperCase()) + return ( + allUpperCaseTags.includes(CLAIM_ADDED_VAULTS_TAG) && + market.baseToken.symbol.toUpperCase() !== 'OP' && + allUpperCaseTags.includes(market.baseToken.symbol.toUpperCase()) + ) + }) + .reduce((vaultRewardsMap, event) => { + const isClaimed = claimEvents.some( + claimEvent => claimEvent.timestamp > event.timestamp && claimEvent.rewardToken === event.rewardToken + ) + + if (isClaimed) { + return vaultRewardsMap + } + + const rewardToken = rewardTokens.find(t => t.address.toLowerCase() === event.rewardToken.toLowerCase()) + if (!rewardToken) { + console.warn('Missing token info in global epoch config', event.rewardToken) + return vaultRewardsMap + } + + if (vaultRewardsMap[rewardToken.address]) { + vaultRewardsMap[rewardToken.address].amount += fromBigNumber(event.amount, rewardToken.decimals) + } + + return { + ...vaultRewardsMap, + [rewardToken.address]: { ...rewardToken, amount: fromBigNumber(event.amount, rewardToken.decimals) }, + } + }, {} as Record) + + return Object.values(vaultRewardsMap).filter(r => r.amount > 0) +} diff --git a/sdk/src/account_reward_epoch/index.ts b/sdk/src/account_reward_epoch/index.ts index 3d80df5..369d5e0 100644 --- a/sdk/src/account_reward_epoch/index.ts +++ b/sdk/src/account_reward_epoch/index.ts @@ -1,147 +1,148 @@ -import { AccountBalances, AccountLiquidityTokenBalance, AccountLyraBalances } from '../account' +import { BigNumber, PopulatedTransaction } from 'ethers' + import { Deployment, LyraGlobalContractId } from '../constants/contracts' -import { Network } from '../constants/network' -import { ClaimAddedEvent } from '../contracts/common/typechain/MultiDistributor' -import { GlobalRewardEpoch } from '../global_reward_epoch' +import { MIN_REWARD_AMOUNT } from '../constants/rewards' +import { GlobalRewardEpoch, RewardEpochToken } from '../global_reward_epoch' import { RewardEpochTokenAmount } from '../global_reward_epoch' import Lyra from '../lyra' -import fetchAccountRewardEpochData, { - AccountArrakisRewards, - AccountRewardEpochData, -} from '../utils/fetchAccountRewardEpochData' +import buildTx from '../utils/buildTx' +import fetchAccountRewardEpochData, { AccountRewardEpochData } from '../utils/fetchAccountRewardEpochData' +import fetchClaimAddedEvents from '../utils/fetchClaimAddedEvents' +import fetchClaimEvents from '../utils/fetchClaimEvents' import findMarketX from '../utils/findMarketX' import fromBigNumber from '../utils/fromBigNumber' import getGlobalContract from '../utils/getGlobalContract' -import parseClaimAddedTags from './parseClaimAddedTags' +import getUniqueBy from '../utils/getUniqueBy' +import multicall from '../utils/multicall' +import getDistributedTradingRewards from './getDistributedTradingRewards' +import getDistributedVaultRewards from './getDistributedVaultRewards' +import getTotalClaimableTradingRewards from './getTotalClaimableTradingRewards' +import getTotalClaimableVaultRewards from './getTotalClaimableVaultRewards' + +export type ClaimAddedEvent = { + amount: BigNumber + blockNumber: number + claimer: string + epochTimestamp: number + rewardToken: string + tag: string + timestamp: number +} + +export type ClaimEvent = { + amount: BigNumber + blockNumber: number + claimer: string + rewardToken: string + timestamp: number +} export class AccountRewardEpoch { - private vaultTokenBalances: Record lyra: Lyra account: string globalEpoch: GlobalRewardEpoch accountEpoch: AccountRewardEpochData - stakedLyraBalance: number - tradingFeeRebate: number - tradingFees: number - stakingRewards: RewardEpochTokenAmount[] - isPendingRewards: boolean - stakingRewardsUnlockTimestamp: RewardEpochTokenAmount[] - totalVaultRewards: RewardEpochTokenAmount[] tradingRewards: RewardEpochTokenAmount[] - shortCollateralRewards: RewardEpochTokenAmount[] - wethLyraStakingL2: AccountArrakisRewards + isTradingRewardsDistributed: boolean + totalClaimableRewards: RewardEpochTokenAmount[] + totalClaimableTradingRewards: RewardEpochTokenAmount[] + private totalClaimableVaultRewardsMap: Record + private distributedVaultRewardsMap: Record + private calculatedVaultRewardsMap: Record + private isVaultRewardsDistributedMap: Record + constructor( lyra: Lyra, account: string, accountEpoch: AccountRewardEpochData, globalEpoch: GlobalRewardEpoch, - balances: AccountBalances[], - lyraBalances: AccountLyraBalances, - claimAddedEvents: ClaimAddedEvent[] + claimAddedEvents: ClaimAddedEvent[], + claimEvents: ClaimEvent[], + rewardTokens: RewardEpochToken[], + totalClaimableRewards: RewardEpochTokenAmount[] ) { this.lyra = lyra this.account = account this.globalEpoch = globalEpoch this.accountEpoch = accountEpoch - const avgStkLyraBalance = - this.globalEpoch.progressDays > 0 - ? this.accountEpoch.stakingRewards.stkLyraDays / this.globalEpoch.progressDays - : 0 - this.stakedLyraBalance = this.globalEpoch.isComplete - ? avgStkLyraBalance - : fromBigNumber(lyraBalances.ethereumStkLyra.add(lyraBalances.optimismStkLyra)) - this.vaultTokenBalances = balances.reduce( - (lpTokenBalances, balance) => ({ - ...lpTokenBalances, - [balance.baseAsset.symbol]: balance.liquidityToken, + + const hasNewRewards = !!accountEpoch.tradingRewards.newRewards + const oldTradingRewardTokens = accountEpoch.tradingRewards?.rewards?.trading ?? [] + const newTradingRewardTokens = accountEpoch?.tradingRewards?.newRewards?.tokens ?? [] + const tradingRewardTokens = hasNewRewards ? newTradingRewardTokens : oldTradingRewardTokens + const distributedTradingRewards = getDistributedTradingRewards(globalEpoch, claimAddedEvents) + this.isTradingRewardsDistributed = !!distributedTradingRewards.find(d => d.amount > 0) + this.tradingRewards = this.isTradingRewardsDistributed ? distributedTradingRewards : tradingRewardTokens + + this.totalClaimableRewards = totalClaimableRewards + this.totalClaimableTradingRewards = getTotalClaimableTradingRewards(rewardTokens, claimAddedEvents, claimEvents) + this.totalClaimableVaultRewardsMap = globalEpoch.markets.reduce( + (map, market) => ({ + ...map, + [market.baseToken.symbol]: getTotalClaimableVaultRewards(market, rewardTokens, claimAddedEvents, claimEvents), }), {} ) - - this.stakingRewards = this.accountEpoch.stakingRewards.rewards - this.stakingRewardsUnlockTimestamp = this.accountEpoch.stakingRewards?.rewards?.map(token => { + this.distributedVaultRewardsMap = globalEpoch.markets.reduce( + (map, market) => ({ + ...map, + [market.baseToken.symbol]: getDistributedVaultRewards(market, globalEpoch, claimAddedEvents), + }), + {} + ) + this.calculatedVaultRewardsMap = globalEpoch.markets.reduce((map, market) => { + const marketKey = market.baseToken.symbol + const mmvRewards = accountEpoch.mmvRewards ? accountEpoch.mmvRewards[marketKey] : null + const isIgnored = !!mmvRewards?.isIgnored return { - ...token, - amount: this.globalEpoch.endTimestamp, - } - }) - const marketVaultRewards = globalEpoch.markets.map(market => this.vaultRewards(market.address)).flat() - const marketVaultRewardsMap: { [tokenAddress: string]: RewardEpochTokenAmount } = {} - marketVaultRewards.forEach(vaultReward => { - if (!marketVaultRewardsMap[vaultReward.address]) { - marketVaultRewardsMap[vaultReward.address] = vaultReward - } else { - marketVaultRewardsMap[vaultReward.address].amount += vaultReward.amount + ...map, + [market.baseToken.symbol]: + mmvRewards && !isIgnored ? mmvRewards.rewards.filter(r => r.amount > MIN_REWARD_AMOUNT) : [], } - }) - this.totalVaultRewards = Object.values(marketVaultRewardsMap) - this.tradingFeeRebate = this.globalEpoch.tradingFeeRebate(this.stakedLyraBalance) - this.tradingFees = this.accountEpoch.tradingRewards.fees - this.tradingRewards = this.globalEpoch.tradingRewards(this.tradingFees, this.stakedLyraBalance) - this.shortCollateralRewards = this.globalEpoch.shortCollateralRewards( - this.accountEpoch.tradingRewards.shortCollateralRewardDollars + }, {}) + this.isVaultRewardsDistributedMap = globalEpoch.markets.reduce( + (map, market) => ({ + ...map, + [market.baseToken.symbol]: !!this.distributedVaultRewardsMap[market.baseToken.symbol]?.find(d => d.amount > 0), + }), + {} ) - const claimAddedTags = parseClaimAddedTags(claimAddedEvents) - - // TODO @dillon - refactor this later - const lyraTradingRewards = - this.tradingRewards.find(token => ['lyra', 'stklyra'].includes(token.symbol.toLowerCase()))?.amount ?? 0 - const lyraShortCollateralRewards = - this.shortCollateralRewards.find(token => ['lyra', 'stklyra'].includes(token.symbol.toLowerCase()))?.amount ?? 0 - const opTradingRewards = this.tradingRewards.find(token => ['op'].includes(token.symbol.toLowerCase()))?.amount ?? 0 - const opShortCollateralRewards = - this.shortCollateralRewards.find(token => ['op'].includes(token.symbol.toLowerCase()))?.amount ?? 0 - const isTradingPending = - (lyraTradingRewards + lyraShortCollateralRewards > 0 && !claimAddedTags.tradingRewards.LYRA) || - (opTradingRewards + opShortCollateralRewards > 0 && !claimAddedTags.tradingRewards.OP) - - // ignore lyra rewards due to 6mo lock - const isStakingPending = false - - const isVaultsPending = globalEpoch.markets.every(market => { - const vaultRewards = this.vaultRewards(market.address) - const marketKey = market.baseToken.symbol - // TODO @dillon - refactor this later - const lyraVaultRewards = - vaultRewards.find(token => ['lyra', 'stklyra'].includes(token.symbol.toLowerCase()))?.amount ?? 0 - const opVaultRewards = vaultRewards.find(token => ['op'].includes(token.symbol.toLowerCase()))?.amount ?? 0 - return ( - (lyraVaultRewards && !claimAddedTags.vaultRewards[marketKey]?.LYRA) || - (opVaultRewards && !claimAddedTags.vaultRewards[marketKey]?.OP) - ) - }) - - this.isPendingRewards = !this.globalEpoch.isComplete || isTradingPending || isStakingPending || isVaultsPending - - this.wethLyraStakingL2 = this.accountEpoch.arrakisRewards ?? { - rewards: [], - gUniTokensStaked: 0, - percentShare: 0, - } } // Getters - static async getByOwner(lyra: Lyra, address: string): Promise { + static async getByOwner(lyra: Lyra, owner: string): Promise { if (lyra.deployment !== Deployment.Mainnet) { return [] } - const distributorContract = - lyra.network === Network.Optimism - ? getGlobalContract(lyra, LyraGlobalContractId.MultiDistributor, lyra.optimismProvider) - : null - const claimAddedEvents = - lyra.network === Network.Optimism - ? (await distributorContract?.queryFilter( - distributorContract.filters.ClaimAdded(null, address, null, null, null) - )) ?? [] - : [] - const [accountEpochDatas, globalEpochs, lyraBalances, balances] = await Promise.all([ - fetchAccountRewardEpochData(lyra, address), + const [accountEpochDatas, globalEpochs, claimAddedEvents, claimEvents] = await Promise.all([ + fetchAccountRewardEpochData(lyra, owner), GlobalRewardEpoch.getAll(lyra), - lyra.account(address).lyraBalances(), - lyra.account(address).balances(), + fetchClaimAddedEvents(lyra, owner), + fetchClaimEvents(lyra, owner), ]) + + const uniqueRewardTokens = getUniqueBy( + globalEpochs.flatMap(e => e.rewardTokens), + r => r.address + ) + + const distributorContract = getGlobalContract(lyra, LyraGlobalContractId.MultiDistributor) + const { returnData } = await multicall( + lyra, + uniqueRewardTokens.map(({ address: tokenAddress }) => ({ + contract: distributorContract, + function: 'claimableBalances', + args: [owner, tokenAddress], + })) + ) + const totalClaimableBalances = (returnData as BigNumber[]) + .map((amount, idx) => ({ + ...uniqueRewardTokens[idx], + amount: fromBigNumber(amount, uniqueRewardTokens[idx].decimals), + })) + .filter(({ amount }) => amount > 0) + return accountEpochDatas .map(accountEpochData => { const globalEpoch = globalEpochs.find( @@ -152,18 +153,15 @@ export class AccountRewardEpoch { if (!globalEpoch) { throw new Error('Missing corresponding global epoch for account epoch') } - // Find claims added for or after epoch - const epochClaimAddedEvents = claimAddedEvents.filter( - claimAdded => claimAdded.args.epochTimestamp.toNumber() === globalEpoch.startTimestamp - ) return new AccountRewardEpoch( lyra, - address, + owner, accountEpochData, globalEpoch, - balances, - lyraBalances, - epochClaimAddedEvents + claimAddedEvents, + claimEvents, + uniqueRewardTokens, + totalClaimableBalances ) }) .sort((a, b) => a.globalEpoch.endTimestamp - b.globalEpoch.endTimestamp) @@ -182,62 +180,33 @@ export class AccountRewardEpoch { return epoch ?? null } - // Dynamic Fields - - vaultApy(marketAddressOrName: string): RewardEpochTokenAmount[] { - const vaultTokenBalance = this.vaultTokenBalance(marketAddressOrName) - if (vaultTokenBalance === 0) { - return this.globalEpoch.minVaultApy(marketAddressOrName) - } else { - return this.globalEpoch.vaultApy(marketAddressOrName, this.stakedLyraBalance, vaultTokenBalance) - } + static claim(lyra: Lyra, address: string, tokenAddresses: string[]): PopulatedTransaction { + const distributorContract = getGlobalContract(lyra, LyraGlobalContractId.MultiDistributor) + const calldata = distributorContract.interface.encodeFunctionData('claim', [tokenAddresses]) + return buildTx(lyra.provider, lyra.provider.network.chainId, distributorContract.address, address, calldata) } - vaultMaxBoost(marketAddressOrName: string): number { - const vaultTokenBalance = this.vaultTokenBalance(marketAddressOrName) - if (vaultTokenBalance === 0) { - return this.globalEpoch.vaultMaxBoost(marketAddressOrName, 0) - } else { - return this.globalEpoch.vaultMaxBoost(marketAddressOrName, vaultTokenBalance) - } - } + // Dynamic Fields - vaultApyMultiplier(marketAddressOrName: string): number { - const vaultTokenBalance = this.vaultTokenBalance(marketAddressOrName) - if (vaultTokenBalance === 0) { - return 1 + vaultRewards(marketAddressOrName: string): RewardEpochTokenAmount[] { + const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) + const marketKey = market.baseToken.symbol + if (this.isVaultRewardsDistributed(marketAddressOrName)) { + return this.distributedVaultRewardsMap[marketKey] } else { - return this.globalEpoch.vaultApyMultiplier(marketAddressOrName, this.stakedLyraBalance, vaultTokenBalance) + return this.calculatedVaultRewardsMap[marketKey] } } - vaultTokenBalance(marketAddressOrName: string): number { + totalClaimableVaultRewards(marketAddressOrName: string): RewardEpochTokenAmount[] { const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) const marketKey = market.baseToken.symbol - const boostedLpDays: number = this.accountEpoch.mmvRewards - ? this.accountEpoch.mmvRewards[marketKey]?.boostedLpDays ?? 0 - : 0 - const avgVaultTokenBalance = this.globalEpoch.progressDays > 0 ? boostedLpDays / this.globalEpoch.progressDays : 0 - const currVaultTokenBalance = fromBigNumber(this.vaultTokenBalances[marketKey].balance) - // Uses average for historical epochs, realtime for current epoch - const vaultTokenBalance = this.globalEpoch.isComplete ? avgVaultTokenBalance : currVaultTokenBalance - return vaultTokenBalance + return this.totalClaimableVaultRewardsMap[marketKey] } - vaultRewards(marketAddressOrName: string): RewardEpochTokenAmount[] { + isVaultRewardsDistributed(marketAddressOrName: string): boolean { const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) const marketKey = market.baseToken.symbol - const mmvRewards = this.accountEpoch.mmvRewards ? this.accountEpoch.mmvRewards[marketKey] : null - if (!mmvRewards) { - return [] - } - const isIgnored = !!mmvRewards.isIgnored - return mmvRewards.rewards.map(token => { - const amount = isIgnored ? 0 : token.amount - return { - ...token, - amount, - } - }) + return this.isVaultRewardsDistributedMap[marketKey] } } diff --git a/sdk/src/account_reward_epoch/parseClaimAddedTags.ts b/sdk/src/account_reward_epoch/parseClaimAddedTags.ts deleted file mode 100644 index 4619351..0000000 --- a/sdk/src/account_reward_epoch/parseClaimAddedTags.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ClaimAddedEvent } from '../contracts/common/typechain/MultiDistributor' - -enum ClaimAddedProgramTags { - MMV = 'MMV', - TRADING = 'TRADING', - STAKING = 'STAKING', -} -enum ClaimAddedRewardTags { - OP = 'OP', - LYRA = 'LYRA', -} - -export default function parseClaimAddedTags(claimAddedEvents: ClaimAddedEvent[]): { - vaultRewards: Record> - tradingRewards: Record - stakingRewards: Record -} { - const vaultRewards: Record> = {} - const tradingRewards: Record = { LYRA: false, OP: false } - const stakingRewards: Record = { LYRA: false, OP: false } - - claimAddedEvents.map(event => { - const tag = event.args.tag - if (tag.startsWith(ClaimAddedProgramTags.MMV)) { - const [_tag, marketKey, token] = tag.split('-') - if (!vaultRewards[marketKey]) { - vaultRewards[marketKey] = { LYRA: false, OP: false } - } - vaultRewards[marketKey][token as ClaimAddedRewardTags] = true - } else if (tag.startsWith(ClaimAddedProgramTags.TRADING)) { - const [_tag, token] = tag.split('-') - tradingRewards[token as ClaimAddedRewardTags] = true - } else if (tag.startsWith(ClaimAddedProgramTags.STAKING)) { - const [_tag, token] = tag.split('-') - stakingRewards[token as ClaimAddedRewardTags] = true - } - }) - - return { vaultRewards, tradingRewards, stakingRewards } -} diff --git a/sdk/src/admin/index.ts b/sdk/src/admin/index.ts index 0c8f03c..22941e5 100644 --- a/sdk/src/admin/index.ts +++ b/sdk/src/admin/index.ts @@ -1,10 +1,14 @@ import { BigNumber } from '@ethersproject/bignumber' import { PopulatedTransaction } from '@ethersproject/contracts' -import Lyra, { MarketContractAddresses, Version } from '..' +import Lyra, { MarketContractAddresses, Network, Version } from '..' import { LyraContractId, LyraGlobalContractId, LyraMarketContractId } from '../constants/contracts' import { LyraContractMap, LyraMarketContractMap } from '../constants/mappings' +import { GMXAdapter, NewportGMXAdapter } from '../contracts/newport/typechain/NewportGMXAdapter' +import { NewportGMXFuturesPoolHedger } from '../contracts/newport/typechain/NewportGMXFuturesPoolHedger' import { OptionGreekCache } from '../contracts/newport/typechain/NewportOptionGreekCache' +import { NewportSNXPerpsV2PoolHedger } from '../contracts/newport/typechain/NewportSNXPerpsV2PoolHedger' +import { NewportSNXPerpV2Adapter, SNXPerpV2Adapter } from '../contracts/newport/typechain/NewportSNXPerpV2Adapter' import buildTx from '../utils/buildTx' import fetchGlobalOwner from '../utils/fetchGlobalOwner' import getGlobalContract from '../utils/getGlobalContract' @@ -204,7 +208,19 @@ export type PoolHedgerParams = { hedgeCap: BigNumber } -export type FuturesPoolHedgerParams = { +export type FuturesPoolHedgerParams = GMXFuturesPoolHedgerParams | SNXFuturesPoolHedgerParams + +export type SNXFuturesPoolHedgerParams = { + targetLeverage: BigNumber + maximumFundingRate: BigNumber + deltaThreshold: BigNumber + marketDepthBuffer: BigNumber + priceDeltaBuffer: BigNumber + worstStableRate: BigNumber + maxOrderCap: BigNumber +} + +export type GMXFuturesPoolHedgerParams = { acceptableSpotSlippage: BigNumber deltaThreshold: BigNumber marketDepthBuffer: BigNumber @@ -222,6 +238,13 @@ export type AdminAdapterMarketPricingParams = { chainlinkStalenessCheck: BigNumber } +export type AdminAdapterMarketConfigurationParams = { + staticEstimationDiscount: BigNumber + snxPerpV2MarketAddress: string + pool: string + feeTier: number +} + export type AdminCircuitBreakerParams = { liquidityCBThreshold: BigNumber liquidityCBTimeout: BigNumber @@ -741,16 +764,55 @@ export class Admin { async setAdapterMarketPricingParams(marketAddressOrName: string, params: Partial) { const market = await this.lyra.market(marketAddressOrName) - if (!market.params.adapterView) { + if (!(market.params.adapterView as GMXAdapter.GMXAdapterStateStructOutput)) { throw new Error('Adapter market pricing parameters not supported on this market') } const toParams = { - ...market.params.adapterView.marketPricingParams, + ...(market.params.adapterView as GMXAdapter.GMXAdapterStateStructOutput).marketPricingParams, + ...params, + } + const exchangeAdapter = getLyraContract(this.lyra, Version.Newport, LyraContractId.ExchangeAdapter) + const owner = await exchangeAdapter.owner() + const calldata = (exchangeAdapter as NewportGMXAdapter).interface.encodeFunctionData('setMarketPricingParams', [ + market.address, + toParams, + ]) + const tx = buildTx(this.lyra.provider, this.lyra.provider.network.chainId, exchangeAdapter.address, owner, calldata) + tx.gasLimit = GAS_LIMIT + return { params: toParams, tx } + } + + async setAdapterMarketConfigurationParams( + marketAddressOrName: string, + params: Partial + ) { + const market = await this.lyra.market(marketAddressOrName) + if (!(market.params.adapterView as SNXPerpV2Adapter.MarketAdapterStateStructOutput)) { + throw new Error('Adapter market configuration parameters not supported on this market') + } + const marketAdapterConfig = (market.params.adapterView as SNXPerpV2Adapter.MarketAdapterStateStructOutput).config + const fromParamsFlat: AdminAdapterMarketConfigurationParams = { + snxPerpV2MarketAddress: marketAdapterConfig.snxPerpV2MarketAddress, + staticEstimationDiscount: marketAdapterConfig.staticEstimationDiscount, + pool: marketAdapterConfig.uniswapInfo.pool, + feeTier: marketAdapterConfig.uniswapInfo.feeTier, + } + const toParams = { + ...fromParamsFlat, ...params, } const exchangeAdapter = getLyraContract(this.lyra, Version.Newport, LyraContractId.ExchangeAdapter) const owner = await exchangeAdapter.owner() - const calldata = exchangeAdapter.interface.encodeFunctionData('setMarketPricingParams', [market.address, toParams]) + const calldata = (exchangeAdapter as NewportSNXPerpV2Adapter).interface.encodeFunctionData( + 'setMarketAdapterConfiguration', + [ + market.address, + toParams.staticEstimationDiscount, + toParams.snxPerpV2MarketAddress, + toParams.pool, + toParams.feeTier, + ] + ) const tx = buildTx(this.lyra.provider, this.lyra.provider.network.chainId, exchangeAdapter.address, owner, calldata) tx.gasLimit = GAS_LIMIT return { params: toParams, tx } @@ -784,27 +846,36 @@ export class Admin { params: Partial ): Promise> { const market = await this.lyra.market(marketAddressOrName) + if (market.lyra.version !== Version.Newport || !market.params.hedgerView) { throw new Error('Parameters not supported on version') } - const toParams = { - ...market.params.hedgerView.futuresPoolHedgerParams, - ...params, - } + const futuresPoolHedger = getLyraMarketContract( this.lyra, market.contractAddresses, market.lyra.version, LyraMarketContractId.PoolHedger ) - const owner = await market.owner() - - const calldata = futuresPoolHedger.interface.encodeFunctionData('setFuturesPoolHedgerParams', [toParams]) + const toParams = { + ...market.params.hedgerView.futuresPoolHedgerParams, + ...params, + } + const calldata = + market.lyra.network === Network.Optimism + ? (futuresPoolHedger as NewportSNXPerpsV2PoolHedger).interface.encodeFunctionData( + 'setFuturesPoolHedgerParams', + [toParams as SNXFuturesPoolHedgerParams] + ) + : (futuresPoolHedger as NewportGMXFuturesPoolHedger).interface.encodeFunctionData( + 'setFuturesPoolHedgerParams', + [toParams as GMXFuturesPoolHedgerParams] + ) const tx = buildTx( this.lyra.provider, this.lyra.provider.network.chainId, futuresPoolHedger.address, - owner, + market.params.owner, calldata ) tx.gasLimit = BigNumber.from(10_000_000) diff --git a/sdk/src/board/index.ts b/sdk/src/board/index.ts index 9404781..0f43753 100644 --- a/sdk/src/board/index.ts +++ b/sdk/src/board/index.ts @@ -90,7 +90,8 @@ export class Board { varianceGwavIv = avalonBoardView.forceCloseGwavIV forceCloseGwavIv = avalonBoardView.forceCloseGwavIV } else { - const newportBoardView = boardView as NewportOptionMarketViewer.BoardViewStructOutput + const newportBoardView: NewportOptionMarketViewer.BoardViewStructOutput = + boardView as NewportOptionMarketViewer.BoardViewStructOutput varianceGwavIv = newportBoardView.varianceGwavIv forceCloseGwavIv = newportBoardView.forceCloseGwavIv } diff --git a/sdk/src/constants/blocks.ts b/sdk/src/constants/blocks.ts deleted file mode 100644 index 7177117..0000000 --- a/sdk/src/constants/blocks.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type PartialBlock = { - number: number - timestamp: number -} diff --git a/sdk/src/constants/contracts.ts b/sdk/src/constants/contracts.ts index 9b62f8c..af3868a 100644 --- a/sdk/src/constants/contracts.ts +++ b/sdk/src/constants/contracts.ts @@ -9,14 +9,8 @@ export enum LyraContractId { } export enum LyraGlobalContractId { - LyraStakingModule = 'LyraStakingModule', MultiDistributor = 'MultiDistributor', - ArrakisPoolL2 = 'ArrakisPoolL2', - ArrakisPoolL1 = 'ArrakisPoolL1', - WethLyraStakingRewardsL1 = 'WethLyraStakingRewardsL1', - WethLyraStakingRewardsL2 = 'WethLyraStakingRewardsL2', Multicall3 = 'Multicall3', - TokenMigrator = 'TokenMigrator', } // Per-market contract name mappings @@ -96,22 +90,8 @@ export const POSITION_UPDATED_TYPES = [ PositionUpdatedType.SplitInto, ] -export const LYRA_OPTIMISM_MAINNET_ADDRESS = '0x50c5725949a6f0c72e6c4a641f24049a917db0cb' export const LYRA_ETHEREUM_MAINNET_ADDRESS = '0x01BA67AAC7f75f647D94220Cc98FB30FCc5105Bf' export const OP_OPTIMISM_MAINNET_ADDRESS = '0x4200000000000000000000000000000000000042' -export const LYRA_OPTIMISM_KOVAN_ADDRESS = '0xC9801013F0c45F836Ad07Dded1df9C475d2844FC' export const LYRA_ETHEREUM_KOVAN_ADDRESS = '0xC9801013F0c45F836Ad07Dded1df9C475d2844FC' -export const OLD_STAKED_LYRA_OPTIMISM_ADDRESS = '0xde48b1b5853cc63b1d05e507414d3e02831722f8' -export const NEW_STAKED_LYRA_OPTIMISM_ADDRESS = '0x0F5d45a7023612e9e244fe84FAc5fCf3740d1492' -export const OLD_STAKED_LYRA_OPTIMISM_KOVAN_ADDRESS = '0xd16d254c42a03ad72d77b4226d086afcc0b2e43e' -export const STAKED_LYRA_ETHEREUM_ADDRESS = '0xb9619D73C08076bC5d4f0470593e98b9eb19a219' -export const ONE_INCH_ORACLE_OPTIMISM_MAINNET_ADDRESS = '0x11DEE30E710B8d4a8630392781Cc3c0046365d4c' -export const ONE_INCH_ORACLE_ETHEREUM_MAINNET_ADDRESS = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb' -export const USDC_OPTIMISM_MAINNET_ADDRESS = '0x7F5c764cBc14f9669B88837ca1490cCa17c31607' -export const ONE_INCH_ORACLE_ARBITRUM_MAINNET_ADDRESS = '0x735247fb0a604c0adC6cab38ACE16D0DbA31295F' -export const USDC_ARBITRUM_MAINNET_ADDRESS = '0x7F5c764cBc14f9669B88837ca1490cCa17c31607' -export const USDC_ETHEREUM_MAINNET_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' -export const WETH_OPTIMISM_MAINNET_ADDRESS = '0x4200000000000000000000000000000000000006' -export const WETH_ETHEREUM_MAINNET_ADDRESS = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' -export const USDC_OPTIMISM_MAINNET_DECIMALS = 6 + export const VAULTS_UTILIZATION_THRESHOLD = 0.99 diff --git a/sdk/src/constants/events.ts b/sdk/src/constants/events.ts index 342267c..b6a6244 100644 --- a/sdk/src/constants/events.ts +++ b/sdk/src/constants/events.ts @@ -12,15 +12,16 @@ import { PositionUpdatedEvent as AvalonPositionUpdatedEvent, TransferEvent as AvalonTransferEvent, } from '../contracts/avalon/typechain/AvalonOptionToken' -import { - DepositProcessedEvent as NewportDepositProcessedEvent, - DepositQueuedEvent as NewportDepositQueuedEvent, -} from '../contracts/newport/typechain/NewportLiquidityPool' +import { TradeEvent as NewportArbitrumTradeEvent } from '../contracts/newport/arbitrum/typechain/NewportOptionMarket' +import { TradeEvent as NewportOptimismTradeEvent } from '../contracts/newport/optimism/typechain/NewportOptionMarket' import { WithdrawProcessedEvent as NewportWithdrawProcessedEvent, WithdrawQueuedEvent as NewportWithdrawQueuedEvent, } from '../contracts/newport/typechain/NewportLiquidityPool' -import { TradeEvent as NewportTradeEvent } from '../contracts/newport/typechain/NewportOptionMarket' +import { + DepositProcessedEvent as NewportDepositProcessedEvent, + DepositQueuedEvent as NewportDepositQueuedEvent, +} from '../contracts/newport/typechain/NewportLiquidityPool' import { PositionUpdatedEvent as NewportPositionUpdatedEvent, TransferEvent as NewportTransferEvent, @@ -42,7 +43,7 @@ export type PartialTradeEvent = { blockNumber: number transactionHash: string logIndex: number - args: (AvalonTradeEvent | NewportTradeEvent)['args'] + args: (AvalonTradeEvent | NewportArbitrumTradeEvent | NewportOptimismTradeEvent)['args'] } export type PartialTransferEvent = { diff --git a/sdk/src/constants/mappings.ts b/sdk/src/constants/mappings.ts index e7030c0..bc68645 100644 --- a/sdk/src/constants/mappings.ts +++ b/sdk/src/constants/mappings.ts @@ -12,15 +12,9 @@ import { AvalonSynthetixAdapter, AvalonTestFaucet, } from '../contracts/avalon/typechain' -import { - ArrakisPoolL1, - ArrakisPoolL2, - LyraStakingModule, - Multicall3, - MultiDistributor, - TokenMigrator, - WethLyraStakingRewards, -} from '../contracts/common/typechain' +import { Multicall3, MultiDistributor } from '../contracts/common/typechain' +import { NewportOptionMarket as NewportArbitrumOptionMarket } from '../contracts/newport/arbitrum/typechain' +import { NewportOptionMarket as NewportOptimismOptionMarket } from '../contracts/newport/optimism/typechain' import { NewportGMXAdapter, NewportGMXFuturesPoolHedger, @@ -28,11 +22,12 @@ import { NewportLiquidityToken, NewportLyraRegistry, NewportOptionGreekCache, - NewportOptionMarket, NewportOptionMarketPricer, NewportOptionMarketViewer, NewportOptionToken, NewportShortCollateral, + NewportSNXPerpsV2PoolHedger, + NewportSNXPerpV2Adapter, NewportTestFaucet, } from '../contracts/newport/typechain' import { Version } from '../lyra' @@ -41,7 +36,7 @@ import { LyraContractId, LyraGlobalContractId, LyraMarketContractId } from './co export type LyraNewportContractMap = { [LyraContractId.OptionMarketViewer]: NewportOptionMarketViewer [LyraContractId.TestFaucet]: NewportTestFaucet - [LyraContractId.ExchangeAdapter]: NewportGMXAdapter + [LyraContractId.ExchangeAdapter]: NewportGMXAdapter | NewportSNXPerpV2Adapter [LyraContractId.LyraRegistry]: NewportLyraRegistry } @@ -70,14 +65,14 @@ export type LyraMarketAvalonContractMap = { } export type LyraMarketNewportContractMap = { - [LyraMarketContractId.OptionMarket]: NewportOptionMarket + [LyraMarketContractId.OptionMarket]: NewportArbitrumOptionMarket | NewportOptimismOptionMarket [LyraMarketContractId.OptionMarketPricer]: NewportOptionMarketPricer [LyraMarketContractId.OptionToken]: NewportOptionToken [LyraMarketContractId.ShortCollateral]: NewportShortCollateral [LyraMarketContractId.OptionGreekCache]: NewportOptionGreekCache [LyraMarketContractId.LiquidityToken]: NewportLiquidityToken [LyraMarketContractId.LiquidityPool]: NewportLiquidityPool - [LyraMarketContractId.PoolHedger]: NewportGMXFuturesPoolHedger + [LyraMarketContractId.PoolHedger]: NewportGMXFuturesPoolHedger | NewportSNXPerpsV2PoolHedger } export type LyraMarketContractMap = V extends Version.Avalon @@ -88,11 +83,5 @@ export type LyraMarketContractMap, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "approve", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "burn", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "decimals", values?: undefined): string; - encodeFunctionData( - functionFragment: "decreaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "gelatoBalance0", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "gelatoBalance1", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getUnderlyingBalances", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "increaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "name", values?: undefined): string; - encodeFunctionData(functionFragment: "pool", values?: undefined): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined - ): string; - - 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: "gelatoBalance0", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "gelatoBalance1", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getUnderlyingBalances", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "increaseAllowance", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "pool", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike - ): Result; - - events: {}; -} - -export interface ArrakisPool extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: ArrakisPoolInterface; - - 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: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise<[number]>; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; - - gelatoBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise<[string]>; - - pool(overrides?: CallOverrides): Promise<[string]>; - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - }; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - callStatic: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber; - amount1: BigNumber; - liquidityBurned: BigNumber; - } - >; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - }; - - filters: {}; - - estimateGas: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances(overrides?: CallOverrides): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - }; - - populateTransaction: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/ArrakisPoolL1.ts b/sdk/src/contracts/common/typechain/ArrakisPoolL1.ts deleted file mode 100644 index ebeb3c5..0000000 --- a/sdk/src/contracts/common/typechain/ArrakisPoolL1.ts +++ /dev/null @@ -1,1762 +0,0 @@ -/* 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, - PromiseOrValue, -} from "./common"; - -export interface ArrakisPoolL1Interface extends utils.Interface { - functions: { - "GELATO()": FunctionFragment; - "RESTRICTED_MINT_ENABLED()": FunctionFragment; - "allowance(address,address)": FunctionFragment; - "approve(address,uint256)": FunctionFragment; - "arrakisBalance0()": FunctionFragment; - "arrakisBalance1()": FunctionFragment; - "arrakisFeeBPS()": FunctionFragment; - "arrakisTreasury()": FunctionFragment; - "balanceOf(address)": FunctionFragment; - "burn(uint256,address)": FunctionFragment; - "decimals()": FunctionFragment; - "decreaseAllowance(address,uint256)": FunctionFragment; - "executiveRebalance(int24,int24,uint160,uint256,bool)": FunctionFragment; - "gelatoRebalanceBPS()": FunctionFragment; - "gelatoSlippageBPS()": FunctionFragment; - "gelatoSlippageInterval()": FunctionFragment; - "getMintAmounts(uint256,uint256)": FunctionFragment; - "getPositionID()": FunctionFragment; - "getUnderlyingBalances()": FunctionFragment; - "getUnderlyingBalancesAtPrice(uint160)": FunctionFragment; - "increaseAllowance(address,uint256)": FunctionFragment; - "initialize(string,string,address,uint16,int24,int24,address)": FunctionFragment; - "lowerTick()": FunctionFragment; - "manager()": FunctionFragment; - "managerBalance0()": FunctionFragment; - "managerBalance1()": FunctionFragment; - "managerFeeBPS()": FunctionFragment; - "managerTreasury()": FunctionFragment; - "mint(uint256,address)": FunctionFragment; - "name()": FunctionFragment; - "pool()": FunctionFragment; - "rebalance(uint160,uint256,bool,uint256,address)": FunctionFragment; - "renounceOwnership()": FunctionFragment; - "restrictedMintToggle()": FunctionFragment; - "symbol()": FunctionFragment; - "toggleRestrictMint()": FunctionFragment; - "token0()": FunctionFragment; - "token1()": FunctionFragment; - "totalSupply()": FunctionFragment; - "transfer(address,uint256)": FunctionFragment; - "transferFrom(address,address,uint256)": FunctionFragment; - "transferOwnership(address)": FunctionFragment; - "uniswapV3MintCallback(uint256,uint256,bytes)": FunctionFragment; - "uniswapV3SwapCallback(int256,int256,bytes)": FunctionFragment; - "updateManagerParams(int16,address,int16,int16,int32)": FunctionFragment; - "upperTick()": FunctionFragment; - "version()": FunctionFragment; - "withdrawArrakisBalance()": FunctionFragment; - "withdrawManagerBalance()": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "GELATO" - | "RESTRICTED_MINT_ENABLED" - | "allowance" - | "approve" - | "arrakisBalance0" - | "arrakisBalance1" - | "arrakisFeeBPS" - | "arrakisTreasury" - | "balanceOf" - | "burn" - | "decimals" - | "decreaseAllowance" - | "executiveRebalance" - | "gelatoRebalanceBPS" - | "gelatoSlippageBPS" - | "gelatoSlippageInterval" - | "getMintAmounts" - | "getPositionID" - | "getUnderlyingBalances" - | "getUnderlyingBalancesAtPrice" - | "increaseAllowance" - | "initialize" - | "lowerTick" - | "manager" - | "managerBalance0" - | "managerBalance1" - | "managerFeeBPS" - | "managerTreasury" - | "mint" - | "name" - | "pool" - | "rebalance" - | "renounceOwnership" - | "restrictedMintToggle" - | "symbol" - | "toggleRestrictMint" - | "token0" - | "token1" - | "totalSupply" - | "transfer" - | "transferFrom" - | "transferOwnership" - | "uniswapV3MintCallback" - | "uniswapV3SwapCallback" - | "updateManagerParams" - | "upperTick" - | "version" - | "withdrawArrakisBalance" - | "withdrawManagerBalance" - ): FunctionFragment; - - encodeFunctionData(functionFragment: "GELATO", values?: undefined): string; - encodeFunctionData( - functionFragment: "RESTRICTED_MINT_ENABLED", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "allowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "approve", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "arrakisBalance0", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "arrakisBalance1", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "arrakisFeeBPS", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "arrakisTreasury", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "burn", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "decimals", values?: undefined): string; - encodeFunctionData( - functionFragment: "decreaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "executiveRebalance", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "gelatoRebalanceBPS", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "gelatoSlippageBPS", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "gelatoSlippageInterval", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getMintAmounts", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "getPositionID", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getUnderlyingBalances", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getUnderlyingBalancesAtPrice", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "increaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "initialize", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData(functionFragment: "lowerTick", values?: undefined): string; - encodeFunctionData(functionFragment: "manager", values?: undefined): string; - encodeFunctionData( - functionFragment: "managerBalance0", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "managerBalance1", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "managerFeeBPS", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "managerTreasury", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "mint", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "name", values?: undefined): string; - encodeFunctionData(functionFragment: "pool", values?: undefined): string; - encodeFunctionData( - functionFragment: "rebalance", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "renounceOwnership", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "restrictedMintToggle", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "symbol", values?: undefined): string; - encodeFunctionData( - functionFragment: "toggleRestrictMint", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "token0", values?: undefined): string; - encodeFunctionData(functionFragment: "token1", values?: undefined): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "transfer", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "transferFrom", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "transferOwnership", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "uniswapV3MintCallback", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "uniswapV3SwapCallback", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "updateManagerParams", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData(functionFragment: "upperTick", values?: undefined): string; - encodeFunctionData(functionFragment: "version", values?: undefined): string; - encodeFunctionData( - functionFragment: "withdrawArrakisBalance", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "withdrawManagerBalance", - values?: undefined - ): string; - - decodeFunctionResult(functionFragment: "GELATO", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "RESTRICTED_MINT_ENABLED", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "arrakisBalance0", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "arrakisBalance1", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "arrakisFeeBPS", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "arrakisTreasury", - 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: "executiveRebalance", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "gelatoRebalanceBPS", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "gelatoSlippageBPS", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "gelatoSlippageInterval", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getMintAmounts", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getPositionID", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getUnderlyingBalances", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getUnderlyingBalancesAtPrice", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "increaseAllowance", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "lowerTick", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "manager", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "managerBalance0", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "managerBalance1", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "managerFeeBPS", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "managerTreasury", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "pool", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "rebalance", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "renounceOwnership", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "restrictedMintToggle", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "toggleRestrictMint", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "token0", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "token1", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "transferFrom", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "transferOwnership", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "uniswapV3MintCallback", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "uniswapV3SwapCallback", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "updateManagerParams", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "upperTick", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "withdrawArrakisBalance", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "withdrawManagerBalance", - data: BytesLike - ): Result; - - events: { - "Approval(address,address,uint256)": EventFragment; - "Burned(address,uint256,uint256,uint256,uint128)": EventFragment; - "FeesEarned(uint256,uint256)": EventFragment; - "Minted(address,uint256,uint256,uint256,uint128)": EventFragment; - "OwnershipTransferred(address,address)": EventFragment; - "Rebalance(int24,int24,uint128,uint128)": EventFragment; - "Transfer(address,address,uint256)": EventFragment; - "UpdateManagerParams(uint16,address,uint16,uint16,uint32)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Burned"): EventFragment; - getEvent(nameOrSignatureOrTopic: "FeesEarned"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Minted"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Rebalance"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; - getEvent(nameOrSignatureOrTopic: "UpdateManagerParams"): EventFragment; -} - -export interface ApprovalEventObject { - owner: string; - spender: string; - value: BigNumber; -} -export type ApprovalEvent = TypedEvent< - [string, string, BigNumber], - ApprovalEventObject ->; - -export type ApprovalEventFilter = TypedEventFilter; - -export interface BurnedEventObject { - receiver: string; - burnAmount: BigNumber; - amount0Out: BigNumber; - amount1Out: BigNumber; - liquidityBurned: BigNumber; -} -export type BurnedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, BigNumber], - BurnedEventObject ->; - -export type BurnedEventFilter = TypedEventFilter; - -export interface FeesEarnedEventObject { - feesEarned0: BigNumber; - feesEarned1: BigNumber; -} -export type FeesEarnedEvent = TypedEvent< - [BigNumber, BigNumber], - FeesEarnedEventObject ->; - -export type FeesEarnedEventFilter = TypedEventFilter; - -export interface MintedEventObject { - receiver: string; - mintAmount: BigNumber; - amount0In: BigNumber; - amount1In: BigNumber; - liquidityMinted: BigNumber; -} -export type MintedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, BigNumber], - MintedEventObject ->; - -export type MintedEventFilter = TypedEventFilter; - -export interface OwnershipTransferredEventObject { - previousManager: string; - newManager: string; -} -export type OwnershipTransferredEvent = TypedEvent< - [string, string], - OwnershipTransferredEventObject ->; - -export type OwnershipTransferredEventFilter = - TypedEventFilter; - -export interface RebalanceEventObject { - lowerTick_: number; - upperTick_: number; - liquidityBefore: BigNumber; - liquidityAfter: BigNumber; -} -export type RebalanceEvent = TypedEvent< - [number, number, BigNumber, BigNumber], - RebalanceEventObject ->; - -export type RebalanceEventFilter = TypedEventFilter; - -export interface TransferEventObject { - from: string; - to: string; - value: BigNumber; -} -export type TransferEvent = TypedEvent< - [string, string, BigNumber], - TransferEventObject ->; - -export type TransferEventFilter = TypedEventFilter; - -export interface UpdateManagerParamsEventObject { - managerFeeBPS: number; - managerTreasury: string; - gelatoRebalanceBPS: number; - gelatoSlippageBPS: number; - gelatoSlippageInterval: number; -} -export type UpdateManagerParamsEvent = TypedEvent< - [number, string, number, number, number], - UpdateManagerParamsEventObject ->; - -export type UpdateManagerParamsEventFilter = - TypedEventFilter; - -export interface ArrakisPoolL1 extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: ArrakisPoolL1Interface; - - 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: { - GELATO(overrides?: CallOverrides): Promise<[string]>; - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise<[number]>; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - arrakisBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; - - arrakisBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; - - arrakisFeeBPS(overrides?: CallOverrides): Promise<[number]>; - - arrakisTreasury(overrides?: CallOverrides): Promise<[string]>; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise<[number]>; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise<[number]>; - - gelatoSlippageBPS(overrides?: CallOverrides): Promise<[number]>; - - gelatoSlippageInterval(overrides?: CallOverrides): Promise<[number]>; - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber; - amount1: BigNumber; - mintAmount: BigNumber; - } - >; - - getPositionID( - overrides?: CallOverrides - ): Promise<[string] & { positionID: string }>; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - lowerTick(overrides?: CallOverrides): Promise<[number]>; - - manager(overrides?: CallOverrides): Promise<[string]>; - - managerBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; - - managerBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; - - managerFeeBPS(overrides?: CallOverrides): Promise<[number]>; - - managerTreasury(overrides?: CallOverrides): Promise<[string]>; - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise<[string]>; - - pool(overrides?: CallOverrides): Promise<[string]>; - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - restrictedMintToggle(overrides?: CallOverrides): Promise<[number]>; - - symbol(overrides?: CallOverrides): Promise<[string]>; - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - token0(overrides?: CallOverrides): Promise<[string]>; - - token1(overrides?: CallOverrides): Promise<[string]>; - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upperTick(overrides?: CallOverrides): Promise<[number]>; - - version(overrides?: CallOverrides): Promise<[string]>; - - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - GELATO(overrides?: CallOverrides): Promise; - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - arrakisBalance0(overrides?: CallOverrides): Promise; - - arrakisBalance1(overrides?: CallOverrides): Promise; - - arrakisFeeBPS(overrides?: CallOverrides): Promise; - - arrakisTreasury(overrides?: CallOverrides): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise; - - gelatoSlippageBPS(overrides?: CallOverrides): Promise; - - gelatoSlippageInterval(overrides?: CallOverrides): Promise; - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber; - amount1: BigNumber; - mintAmount: BigNumber; - } - >; - - getPositionID(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - lowerTick(overrides?: CallOverrides): Promise; - - manager(overrides?: CallOverrides): Promise; - - managerBalance0(overrides?: CallOverrides): Promise; - - managerBalance1(overrides?: CallOverrides): Promise; - - managerFeeBPS(overrides?: CallOverrides): Promise; - - managerTreasury(overrides?: CallOverrides): Promise; - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - restrictedMintToggle(overrides?: CallOverrides): Promise; - - symbol(overrides?: CallOverrides): Promise; - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - token0(overrides?: CallOverrides): Promise; - - token1(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upperTick(overrides?: CallOverrides): Promise; - - version(overrides?: CallOverrides): Promise; - - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - callStatic: { - GELATO(overrides?: CallOverrides): Promise; - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - arrakisBalance0(overrides?: CallOverrides): Promise; - - arrakisBalance1(overrides?: CallOverrides): Promise; - - arrakisFeeBPS(overrides?: CallOverrides): Promise; - - arrakisTreasury(overrides?: CallOverrides): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber; - amount1: BigNumber; - liquidityBurned: BigNumber; - } - >; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise; - - gelatoSlippageBPS(overrides?: CallOverrides): Promise; - - gelatoSlippageInterval(overrides?: CallOverrides): Promise; - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber; - amount1: BigNumber; - mintAmount: BigNumber; - } - >; - - getPositionID(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - lowerTick(overrides?: CallOverrides): Promise; - - manager(overrides?: CallOverrides): Promise; - - managerBalance0(overrides?: CallOverrides): Promise; - - managerBalance1(overrides?: CallOverrides): Promise; - - managerFeeBPS(overrides?: CallOverrides): Promise; - - managerTreasury(overrides?: CallOverrides): Promise; - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber; - amount1: BigNumber; - liquidityMinted: BigNumber; - } - >; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - renounceOwnership(overrides?: CallOverrides): Promise; - - restrictedMintToggle(overrides?: CallOverrides): Promise; - - symbol(overrides?: CallOverrides): Promise; - - toggleRestrictMint(overrides?: CallOverrides): Promise; - - token0(overrides?: CallOverrides): Promise; - - token1(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - upperTick(overrides?: CallOverrides): Promise; - - version(overrides?: CallOverrides): Promise; - - withdrawArrakisBalance(overrides?: CallOverrides): Promise; - - withdrawManagerBalance(overrides?: CallOverrides): Promise; - }; - - filters: { - "Approval(address,address,uint256)"( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter; - Approval( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter; - - "Burned(address,uint256,uint256,uint256,uint128)"( - receiver?: null, - burnAmount?: null, - amount0Out?: null, - amount1Out?: null, - liquidityBurned?: null - ): BurnedEventFilter; - Burned( - receiver?: null, - burnAmount?: null, - amount0Out?: null, - amount1Out?: null, - liquidityBurned?: null - ): BurnedEventFilter; - - "FeesEarned(uint256,uint256)"( - feesEarned0?: null, - feesEarned1?: null - ): FeesEarnedEventFilter; - FeesEarned(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter; - - "Minted(address,uint256,uint256,uint256,uint128)"( - receiver?: null, - mintAmount?: null, - amount0In?: null, - amount1In?: null, - liquidityMinted?: null - ): MintedEventFilter; - Minted( - receiver?: null, - mintAmount?: null, - amount0In?: null, - amount1In?: null, - liquidityMinted?: null - ): MintedEventFilter; - - "OwnershipTransferred(address,address)"( - previousManager?: PromiseOrValue | null, - newManager?: PromiseOrValue | null - ): OwnershipTransferredEventFilter; - OwnershipTransferred( - previousManager?: PromiseOrValue | null, - newManager?: PromiseOrValue | null - ): OwnershipTransferredEventFilter; - - "Rebalance(int24,int24,uint128,uint128)"( - lowerTick_?: null, - upperTick_?: null, - liquidityBefore?: null, - liquidityAfter?: null - ): RebalanceEventFilter; - Rebalance( - lowerTick_?: null, - upperTick_?: null, - liquidityBefore?: null, - liquidityAfter?: null - ): RebalanceEventFilter; - - "Transfer(address,address,uint256)"( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter; - Transfer( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter; - - "UpdateManagerParams(uint16,address,uint16,uint16,uint32)"( - managerFeeBPS?: null, - managerTreasury?: null, - gelatoRebalanceBPS?: null, - gelatoSlippageBPS?: null, - gelatoSlippageInterval?: null - ): UpdateManagerParamsEventFilter; - UpdateManagerParams( - managerFeeBPS?: null, - managerTreasury?: null, - gelatoRebalanceBPS?: null, - gelatoSlippageBPS?: null, - gelatoSlippageInterval?: null - ): UpdateManagerParamsEventFilter; - }; - - estimateGas: { - GELATO(overrides?: CallOverrides): Promise; - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - arrakisBalance0(overrides?: CallOverrides): Promise; - - arrakisBalance1(overrides?: CallOverrides): Promise; - - arrakisFeeBPS(overrides?: CallOverrides): Promise; - - arrakisTreasury(overrides?: CallOverrides): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise; - - gelatoSlippageBPS(overrides?: CallOverrides): Promise; - - gelatoSlippageInterval(overrides?: CallOverrides): Promise; - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPositionID(overrides?: CallOverrides): Promise; - - getUnderlyingBalances(overrides?: CallOverrides): Promise; - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - lowerTick(overrides?: CallOverrides): Promise; - - manager(overrides?: CallOverrides): Promise; - - managerBalance0(overrides?: CallOverrides): Promise; - - managerBalance1(overrides?: CallOverrides): Promise; - - managerFeeBPS(overrides?: CallOverrides): Promise; - - managerTreasury(overrides?: CallOverrides): Promise; - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - restrictedMintToggle(overrides?: CallOverrides): Promise; - - symbol(overrides?: CallOverrides): Promise; - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - token0(overrides?: CallOverrides): Promise; - - token1(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upperTick(overrides?: CallOverrides): Promise; - - version(overrides?: CallOverrides): Promise; - - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - populateTransaction: { - GELATO(overrides?: CallOverrides): Promise; - - RESTRICTED_MINT_ENABLED( - overrides?: CallOverrides - ): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - arrakisBalance0(overrides?: CallOverrides): Promise; - - arrakisBalance1(overrides?: CallOverrides): Promise; - - arrakisFeeBPS(overrides?: CallOverrides): Promise; - - arrakisTreasury(overrides?: CallOverrides): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoRebalanceBPS( - overrides?: CallOverrides - ): Promise; - - gelatoSlippageBPS(overrides?: CallOverrides): Promise; - - gelatoSlippageInterval( - overrides?: CallOverrides - ): Promise; - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPositionID(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise; - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - lowerTick(overrides?: CallOverrides): Promise; - - manager(overrides?: CallOverrides): Promise; - - managerBalance0(overrides?: CallOverrides): Promise; - - managerBalance1(overrides?: CallOverrides): Promise; - - managerFeeBPS(overrides?: CallOverrides): Promise; - - managerTreasury(overrides?: CallOverrides): Promise; - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - restrictedMintToggle( - overrides?: CallOverrides - ): Promise; - - symbol(overrides?: CallOverrides): Promise; - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - token0(overrides?: CallOverrides): Promise; - - token1(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upperTick(overrides?: CallOverrides): Promise; - - version(overrides?: CallOverrides): Promise; - - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/ArrakisPoolL2.ts b/sdk/src/contracts/common/typechain/ArrakisPoolL2.ts deleted file mode 100644 index cabab8e..0000000 --- a/sdk/src/contracts/common/typechain/ArrakisPoolL2.ts +++ /dev/null @@ -1,448 +0,0 @@ -/* 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 } from "@ethersproject/abi"; -import type { Listener, Provider } from "@ethersproject/providers"; -import type { - TypedEventFilter, - TypedEvent, - TypedListener, - OnEvent, - PromiseOrValue, -} from "./common"; - -export interface ArrakisPoolL2Interface extends utils.Interface { - functions: { - "allowance(address,address)": FunctionFragment; - "approve(address,uint256)": FunctionFragment; - "balanceOf(address)": FunctionFragment; - "burn(uint256,address)": FunctionFragment; - "decimals()": FunctionFragment; - "decreaseAllowance(address,uint256)": FunctionFragment; - "gelatoBalance0()": FunctionFragment; - "gelatoBalance1()": FunctionFragment; - "getUnderlyingBalances()": FunctionFragment; - "increaseAllowance(address,uint256)": FunctionFragment; - "name()": FunctionFragment; - "pool()": FunctionFragment; - "totalSupply()": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "allowance" - | "approve" - | "balanceOf" - | "burn" - | "decimals" - | "decreaseAllowance" - | "gelatoBalance0" - | "gelatoBalance1" - | "getUnderlyingBalances" - | "increaseAllowance" - | "name" - | "pool" - | "totalSupply" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "allowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "approve", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "burn", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "decimals", values?: undefined): string; - encodeFunctionData( - functionFragment: "decreaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "gelatoBalance0", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "gelatoBalance1", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getUnderlyingBalances", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "increaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "name", values?: undefined): string; - encodeFunctionData(functionFragment: "pool", values?: undefined): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined - ): string; - - 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: "gelatoBalance0", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "gelatoBalance1", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getUnderlyingBalances", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "increaseAllowance", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "pool", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike - ): Result; - - events: {}; -} - -export interface ArrakisPoolL2 extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: ArrakisPoolL2Interface; - - 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: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise<[number]>; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; - - gelatoBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise<[string]>; - - pool(overrides?: CallOverrides): Promise<[string]>; - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - }; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - callStatic: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber; - amount1: BigNumber; - liquidityBurned: BigNumber; - } - >; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber; - amount1Current: BigNumber; - } - >; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - }; - - filters: {}; - - estimateGas: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances(overrides?: CallOverrides): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - }; - - populateTransaction: { - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - gelatoBalance0(overrides?: CallOverrides): Promise; - - gelatoBalance1(overrides?: CallOverrides): Promise; - - getUnderlyingBalances( - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - pool(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/LyraStakingModule.ts b/sdk/src/contracts/common/typechain/LyraStakingModule.ts deleted file mode 100644 index 2621b92..0000000 --- a/sdk/src/contracts/common/typechain/LyraStakingModule.ts +++ /dev/null @@ -1,2025 +0,0 @@ -/* 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, - PromiseOrValue, -} from "./common"; - -export declare namespace DistributionTypes { - export type AssetConfigInputStruct = { - emissionPerSecond: PromiseOrValue; - totalStaked: PromiseOrValue; - underlyingAsset: PromiseOrValue; - }; - - export type AssetConfigInputStructOutput = [BigNumber, BigNumber, string] & { - emissionPerSecond: BigNumber; - totalStaked: BigNumber; - underlyingAsset: string; - }; -} - -export interface LyraStakingModuleInterface extends utils.Interface { - functions: { - "COOLDOWN_SECONDS()": FunctionFragment; - "DELEGATE_BY_TYPE_TYPEHASH()": FunctionFragment; - "DELEGATE_TYPEHASH()": FunctionFragment; - "DISTRIBUTION_END()": FunctionFragment; - "DOMAIN_SEPARATOR()": FunctionFragment; - "EIP712_REVISION()": FunctionFragment; - "EMISSION_MANAGER()": FunctionFragment; - "PERMIT_TYPEHASH()": FunctionFragment; - "PRECISION()": FunctionFragment; - "REVISION()": FunctionFragment; - "REWARDS_VAULT()": FunctionFragment; - "REWARD_TOKEN()": FunctionFragment; - "STAKED_TOKEN()": FunctionFragment; - "UNSTAKE_WINDOW()": FunctionFragment; - "_aaveGovernance()": FunctionFragment; - "_nonces(address)": FunctionFragment; - "_votingSnapshots(address,uint256)": FunctionFragment; - "_votingSnapshotsCounts(address)": FunctionFragment; - "allowance(address,address)": FunctionFragment; - "approve(address,uint256)": FunctionFragment; - "assets(address)": FunctionFragment; - "balanceOf(address)": FunctionFragment; - "claimRewards(address,uint256)": FunctionFragment; - "configureAssets((uint128,uint256,address)[])": FunctionFragment; - "cooldown()": FunctionFragment; - "decimals()": FunctionFragment; - "decreaseAllowance(address,uint256)": FunctionFragment; - "delegate(address)": FunctionFragment; - "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; - "delegateByType(address,uint8)": FunctionFragment; - "delegateByTypeBySig(address,uint8,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; - "getDelegateeByType(address,uint8)": FunctionFragment; - "getNextCooldownTimestamp(uint256,uint256,address,uint256)": FunctionFragment; - "getPowerAtBlock(address,uint256,uint8)": FunctionFragment; - "getPowerCurrent(address,uint8)": FunctionFragment; - "getTotalRewardsBalance(address)": FunctionFragment; - "getUserAssetData(address,address)": FunctionFragment; - "increaseAllowance(address,uint256)": FunctionFragment; - "initialize(string,string,uint8)": FunctionFragment; - "name()": FunctionFragment; - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; - "redeem(address,uint256)": FunctionFragment; - "stake(address,uint256)": FunctionFragment; - "stakerRewardsToClaim(address)": FunctionFragment; - "stakersCooldowns(address)": FunctionFragment; - "symbol()": FunctionFragment; - "totalSupply()": FunctionFragment; - "totalSupplyAt(uint256)": FunctionFragment; - "transfer(address,uint256)": FunctionFragment; - "transferFrom(address,address,uint256)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "COOLDOWN_SECONDS" - | "DELEGATE_BY_TYPE_TYPEHASH" - | "DELEGATE_TYPEHASH" - | "DISTRIBUTION_END" - | "DOMAIN_SEPARATOR" - | "EIP712_REVISION" - | "EMISSION_MANAGER" - | "PERMIT_TYPEHASH" - | "PRECISION" - | "REVISION" - | "REWARDS_VAULT" - | "REWARD_TOKEN" - | "STAKED_TOKEN" - | "UNSTAKE_WINDOW" - | "_aaveGovernance" - | "_nonces" - | "_votingSnapshots" - | "_votingSnapshotsCounts" - | "allowance" - | "approve" - | "assets" - | "balanceOf" - | "claimRewards" - | "configureAssets" - | "cooldown" - | "decimals" - | "decreaseAllowance" - | "delegate" - | "delegateBySig" - | "delegateByType" - | "delegateByTypeBySig" - | "getDelegateeByType" - | "getNextCooldownTimestamp" - | "getPowerAtBlock" - | "getPowerCurrent" - | "getTotalRewardsBalance" - | "getUserAssetData" - | "increaseAllowance" - | "initialize" - | "name" - | "permit" - | "redeem" - | "stake" - | "stakerRewardsToClaim" - | "stakersCooldowns" - | "symbol" - | "totalSupply" - | "totalSupplyAt" - | "transfer" - | "transferFrom" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "COOLDOWN_SECONDS", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "DELEGATE_BY_TYPE_TYPEHASH", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "DELEGATE_TYPEHASH", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "DISTRIBUTION_END", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "DOMAIN_SEPARATOR", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "EIP712_REVISION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "EMISSION_MANAGER", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "PERMIT_TYPEHASH", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "PRECISION", values?: undefined): string; - encodeFunctionData(functionFragment: "REVISION", values?: undefined): string; - encodeFunctionData( - functionFragment: "REWARDS_VAULT", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "REWARD_TOKEN", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "STAKED_TOKEN", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "UNSTAKE_WINDOW", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "_aaveGovernance", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "_nonces", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "_votingSnapshots", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "_votingSnapshotsCounts", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "allowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "approve", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "assets", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "claimRewards", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "configureAssets", - values: [DistributionTypes.AssetConfigInputStruct[]] - ): string; - encodeFunctionData(functionFragment: "cooldown", values?: undefined): string; - encodeFunctionData(functionFragment: "decimals", values?: undefined): string; - encodeFunctionData( - functionFragment: "decreaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "delegate", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "delegateBySig", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "delegateByType", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "delegateByTypeBySig", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "getDelegateeByType", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "getNextCooldownTimestamp", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "getPowerAtBlock", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "getPowerCurrent", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "getTotalRewardsBalance", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "getUserAssetData", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "increaseAllowance", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "initialize", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData(functionFragment: "name", values?: undefined): string; - encodeFunctionData( - functionFragment: "permit", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "redeem", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "stake", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "stakerRewardsToClaim", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "stakersCooldowns", - values: [PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "symbol", values?: undefined): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "totalSupplyAt", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "transfer", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "transferFrom", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - - decodeFunctionResult( - functionFragment: "COOLDOWN_SECONDS", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "DELEGATE_BY_TYPE_TYPEHASH", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "DELEGATE_TYPEHASH", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "DISTRIBUTION_END", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "DOMAIN_SEPARATOR", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "EIP712_REVISION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "EMISSION_MANAGER", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "PERMIT_TYPEHASH", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "PRECISION", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "REVISION", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "REWARDS_VAULT", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "REWARD_TOKEN", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "STAKED_TOKEN", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "UNSTAKE_WINDOW", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "_aaveGovernance", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "_nonces", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "_votingSnapshots", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "_votingSnapshotsCounts", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "assets", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "claimRewards", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "configureAssets", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "cooldown", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "decreaseAllowance", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "delegate", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "delegateBySig", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "delegateByType", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "delegateByTypeBySig", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getDelegateeByType", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getNextCooldownTimestamp", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getPowerAtBlock", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getPowerCurrent", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getTotalRewardsBalance", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getUserAssetData", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "increaseAllowance", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "redeem", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "stake", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "stakerRewardsToClaim", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "stakersCooldowns", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "totalSupplyAt", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "transferFrom", - data: BytesLike - ): Result; - - events: { - "Approval(address,address,uint256)": EventFragment; - "AssetConfigUpdated(address,uint256)": EventFragment; - "AssetIndexUpdated(address,uint256)": EventFragment; - "Cooldown(address)": EventFragment; - "DelegateChanged(address,address,uint8)": EventFragment; - "DelegatedPowerChanged(address,uint256,uint8)": EventFragment; - "Redeem(address,address,uint256)": EventFragment; - "RewardsAccrued(address,uint256)": EventFragment; - "RewardsClaimed(address,address,uint256)": EventFragment; - "Staked(address,address,uint256)": EventFragment; - "Transfer(address,address,uint256)": EventFragment; - "UserIndexUpdated(address,address,uint256)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; - getEvent(nameOrSignatureOrTopic: "AssetConfigUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "AssetIndexUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Cooldown"): EventFragment; - getEvent(nameOrSignatureOrTopic: "DelegateChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "DelegatedPowerChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Redeem"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardsAccrued"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardsClaimed"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Staked"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; - getEvent(nameOrSignatureOrTopic: "UserIndexUpdated"): EventFragment; -} - -export interface ApprovalEventObject { - owner: string; - spender: string; - value: BigNumber; -} -export type ApprovalEvent = TypedEvent< - [string, string, BigNumber], - ApprovalEventObject ->; - -export type ApprovalEventFilter = TypedEventFilter; - -export interface AssetConfigUpdatedEventObject { - asset: string; - emission: BigNumber; -} -export type AssetConfigUpdatedEvent = TypedEvent< - [string, BigNumber], - AssetConfigUpdatedEventObject ->; - -export type AssetConfigUpdatedEventFilter = - TypedEventFilter; - -export interface AssetIndexUpdatedEventObject { - asset: string; - index: BigNumber; -} -export type AssetIndexUpdatedEvent = TypedEvent< - [string, BigNumber], - AssetIndexUpdatedEventObject ->; - -export type AssetIndexUpdatedEventFilter = - TypedEventFilter; - -export interface CooldownEventObject { - user: string; -} -export type CooldownEvent = TypedEvent<[string], CooldownEventObject>; - -export type CooldownEventFilter = TypedEventFilter; - -export interface DelegateChangedEventObject { - delegator: string; - delegatee: string; - delegationType: number; -} -export type DelegateChangedEvent = TypedEvent< - [string, string, number], - DelegateChangedEventObject ->; - -export type DelegateChangedEventFilter = TypedEventFilter; - -export interface DelegatedPowerChangedEventObject { - user: string; - amount: BigNumber; - delegationType: number; -} -export type DelegatedPowerChangedEvent = TypedEvent< - [string, BigNumber, number], - DelegatedPowerChangedEventObject ->; - -export type DelegatedPowerChangedEventFilter = - TypedEventFilter; - -export interface RedeemEventObject { - from: string; - to: string; - amount: BigNumber; -} -export type RedeemEvent = TypedEvent< - [string, string, BigNumber], - RedeemEventObject ->; - -export type RedeemEventFilter = TypedEventFilter; - -export interface RewardsAccruedEventObject { - user: string; - amount: BigNumber; -} -export type RewardsAccruedEvent = TypedEvent< - [string, BigNumber], - RewardsAccruedEventObject ->; - -export type RewardsAccruedEventFilter = TypedEventFilter; - -export interface RewardsClaimedEventObject { - from: string; - to: string; - amount: BigNumber; -} -export type RewardsClaimedEvent = TypedEvent< - [string, string, BigNumber], - RewardsClaimedEventObject ->; - -export type RewardsClaimedEventFilter = TypedEventFilter; - -export interface StakedEventObject { - from: string; - onBehalfOf: string; - amount: BigNumber; -} -export type StakedEvent = TypedEvent< - [string, string, BigNumber], - StakedEventObject ->; - -export type StakedEventFilter = TypedEventFilter; - -export interface TransferEventObject { - from: string; - to: string; - value: BigNumber; -} -export type TransferEvent = TypedEvent< - [string, string, BigNumber], - TransferEventObject ->; - -export type TransferEventFilter = TypedEventFilter; - -export interface UserIndexUpdatedEventObject { - user: string; - asset: string; - index: BigNumber; -} -export type UserIndexUpdatedEvent = TypedEvent< - [string, string, BigNumber], - UserIndexUpdatedEventObject ->; - -export type UserIndexUpdatedEventFilter = - TypedEventFilter; - -export interface LyraStakingModule extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: LyraStakingModuleInterface; - - 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: { - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise<[BigNumber]>; - - DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; - - DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; - - DISTRIBUTION_END(overrides?: CallOverrides): Promise<[BigNumber]>; - - DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<[string]>; - - EIP712_REVISION(overrides?: CallOverrides): Promise<[string]>; - - EMISSION_MANAGER(overrides?: CallOverrides): Promise<[string]>; - - PERMIT_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; - - PRECISION(overrides?: CallOverrides): Promise<[number]>; - - REVISION(overrides?: CallOverrides): Promise<[BigNumber]>; - - REWARDS_VAULT(overrides?: CallOverrides): Promise<[string]>; - - REWARD_TOKEN(overrides?: CallOverrides): Promise<[string]>; - - STAKED_TOKEN(overrides?: CallOverrides): Promise<[string]>; - - UNSTAKE_WINDOW(overrides?: CallOverrides): Promise<[BigNumber]>; - - _aaveGovernance(overrides?: CallOverrides): Promise<[string]>; - - _nonces( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - _votingSnapshots( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { blockNumber: BigNumber; value: BigNumber } - >; - - _votingSnapshotsCounts( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - assets( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - emissionPerSecond: BigNumber; - lastUpdateTimestamp: BigNumber; - index: BigNumber; - } - >; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - claimRewards( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - configureAssets( - assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - cooldown( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise<[number]>; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegate( - delegatee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateBySig( - delegatee: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByType( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByTypeBySig( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getDelegateeByType( - delegator: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]>; - - getNextCooldownTimestamp( - fromCooldownTimestamp: PromiseOrValue, - amountToReceive: PromiseOrValue, - toAddress: PromiseOrValue, - toBalance: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - getPowerAtBlock( - user: PromiseOrValue, - blockNumber: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - getPowerCurrent( - user: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - getTotalRewardsBalance( - staker: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - getUserAssetData( - user: PromiseOrValue, - asset: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - name: PromiseOrValue, - symbol: PromiseOrValue, - decimals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise<[string]>; - - permit( - owner: PromiseOrValue, - spender: PromiseOrValue, - value: PromiseOrValue, - deadline: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - redeem( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - onBehalfOf: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakerRewardsToClaim( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - stakersCooldowns( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - symbol(overrides?: CallOverrides): Promise<[string]>; - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - - totalSupplyAt( - blockNumber: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - - DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; - - DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; - - DISTRIBUTION_END(overrides?: CallOverrides): Promise; - - DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; - - EIP712_REVISION(overrides?: CallOverrides): Promise; - - EMISSION_MANAGER(overrides?: CallOverrides): Promise; - - PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; - - PRECISION(overrides?: CallOverrides): Promise; - - REVISION(overrides?: CallOverrides): Promise; - - REWARDS_VAULT(overrides?: CallOverrides): Promise; - - REWARD_TOKEN(overrides?: CallOverrides): Promise; - - STAKED_TOKEN(overrides?: CallOverrides): Promise; - - UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; - - _aaveGovernance(overrides?: CallOverrides): Promise; - - _nonces( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - _votingSnapshots( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { blockNumber: BigNumber; value: BigNumber } - >; - - _votingSnapshotsCounts( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - assets( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - emissionPerSecond: BigNumber; - lastUpdateTimestamp: BigNumber; - index: BigNumber; - } - >; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - claimRewards( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - configureAssets( - assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - cooldown( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegate( - delegatee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateBySig( - delegatee: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByType( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByTypeBySig( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getDelegateeByType( - delegator: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getNextCooldownTimestamp( - fromCooldownTimestamp: PromiseOrValue, - amountToReceive: PromiseOrValue, - toAddress: PromiseOrValue, - toBalance: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerAtBlock( - user: PromiseOrValue, - blockNumber: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerCurrent( - user: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getTotalRewardsBalance( - staker: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getUserAssetData( - user: PromiseOrValue, - asset: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - name: PromiseOrValue, - symbol: PromiseOrValue, - decimals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - permit( - owner: PromiseOrValue, - spender: PromiseOrValue, - value: PromiseOrValue, - deadline: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - redeem( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - onBehalfOf: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakerRewardsToClaim( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stakersCooldowns( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - symbol(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - totalSupplyAt( - blockNumber: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - callStatic: { - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - - DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; - - DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; - - DISTRIBUTION_END(overrides?: CallOverrides): Promise; - - DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; - - EIP712_REVISION(overrides?: CallOverrides): Promise; - - EMISSION_MANAGER(overrides?: CallOverrides): Promise; - - PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; - - PRECISION(overrides?: CallOverrides): Promise; - - REVISION(overrides?: CallOverrides): Promise; - - REWARDS_VAULT(overrides?: CallOverrides): Promise; - - REWARD_TOKEN(overrides?: CallOverrides): Promise; - - STAKED_TOKEN(overrides?: CallOverrides): Promise; - - UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; - - _aaveGovernance(overrides?: CallOverrides): Promise; - - _nonces( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - _votingSnapshots( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { blockNumber: BigNumber; value: BigNumber } - >; - - _votingSnapshotsCounts( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - assets( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - emissionPerSecond: BigNumber; - lastUpdateTimestamp: BigNumber; - index: BigNumber; - } - >; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - claimRewards( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - configureAssets( - assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], - overrides?: CallOverrides - ): Promise; - - cooldown(overrides?: CallOverrides): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - delegate( - delegatee: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - delegateBySig( - delegatee: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - delegateByType( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - delegateByTypeBySig( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getDelegateeByType( - delegator: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getNextCooldownTimestamp( - fromCooldownTimestamp: PromiseOrValue, - amountToReceive: PromiseOrValue, - toAddress: PromiseOrValue, - toBalance: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerAtBlock( - user: PromiseOrValue, - blockNumber: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerCurrent( - user: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getTotalRewardsBalance( - staker: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getUserAssetData( - user: PromiseOrValue, - asset: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - initialize( - name: PromiseOrValue, - symbol: PromiseOrValue, - decimals: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - name(overrides?: CallOverrides): Promise; - - permit( - owner: PromiseOrValue, - spender: PromiseOrValue, - value: PromiseOrValue, - deadline: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - redeem( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stake( - onBehalfOf: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stakerRewardsToClaim( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stakersCooldowns( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - symbol(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - totalSupplyAt( - blockNumber: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "Approval(address,address,uint256)"( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter; - Approval( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter; - - "AssetConfigUpdated(address,uint256)"( - asset?: PromiseOrValue | null, - emission?: null - ): AssetConfigUpdatedEventFilter; - AssetConfigUpdated( - asset?: PromiseOrValue | null, - emission?: null - ): AssetConfigUpdatedEventFilter; - - "AssetIndexUpdated(address,uint256)"( - asset?: PromiseOrValue | null, - index?: null - ): AssetIndexUpdatedEventFilter; - AssetIndexUpdated( - asset?: PromiseOrValue | null, - index?: null - ): AssetIndexUpdatedEventFilter; - - "Cooldown(address)"( - user?: PromiseOrValue | null - ): CooldownEventFilter; - Cooldown(user?: PromiseOrValue | null): CooldownEventFilter; - - "DelegateChanged(address,address,uint8)"( - delegator?: PromiseOrValue | null, - delegatee?: PromiseOrValue | null, - delegationType?: null - ): DelegateChangedEventFilter; - DelegateChanged( - delegator?: PromiseOrValue | null, - delegatee?: PromiseOrValue | null, - delegationType?: null - ): DelegateChangedEventFilter; - - "DelegatedPowerChanged(address,uint256,uint8)"( - user?: PromiseOrValue | null, - amount?: null, - delegationType?: null - ): DelegatedPowerChangedEventFilter; - DelegatedPowerChanged( - user?: PromiseOrValue | null, - amount?: null, - delegationType?: null - ): DelegatedPowerChangedEventFilter; - - "Redeem(address,address,uint256)"( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - amount?: null - ): RedeemEventFilter; - Redeem( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - amount?: null - ): RedeemEventFilter; - - "RewardsAccrued(address,uint256)"( - user?: null, - amount?: null - ): RewardsAccruedEventFilter; - RewardsAccrued(user?: null, amount?: null): RewardsAccruedEventFilter; - - "RewardsClaimed(address,address,uint256)"( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - amount?: null - ): RewardsClaimedEventFilter; - RewardsClaimed( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - amount?: null - ): RewardsClaimedEventFilter; - - "Staked(address,address,uint256)"( - from?: PromiseOrValue | null, - onBehalfOf?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter; - Staked( - from?: PromiseOrValue | null, - onBehalfOf?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter; - - "Transfer(address,address,uint256)"( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter; - Transfer( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter; - - "UserIndexUpdated(address,address,uint256)"( - user?: PromiseOrValue | null, - asset?: PromiseOrValue | null, - index?: null - ): UserIndexUpdatedEventFilter; - UserIndexUpdated( - user?: PromiseOrValue | null, - asset?: PromiseOrValue | null, - index?: null - ): UserIndexUpdatedEventFilter; - }; - - estimateGas: { - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - - DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; - - DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; - - DISTRIBUTION_END(overrides?: CallOverrides): Promise; - - DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; - - EIP712_REVISION(overrides?: CallOverrides): Promise; - - EMISSION_MANAGER(overrides?: CallOverrides): Promise; - - PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; - - PRECISION(overrides?: CallOverrides): Promise; - - REVISION(overrides?: CallOverrides): Promise; - - REWARDS_VAULT(overrides?: CallOverrides): Promise; - - REWARD_TOKEN(overrides?: CallOverrides): Promise; - - STAKED_TOKEN(overrides?: CallOverrides): Promise; - - UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; - - _aaveGovernance(overrides?: CallOverrides): Promise; - - _nonces( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - _votingSnapshots( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - _votingSnapshotsCounts( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - assets( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - claimRewards( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - configureAssets( - assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - cooldown( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegate( - delegatee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateBySig( - delegatee: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByType( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByTypeBySig( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getDelegateeByType( - delegator: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getNextCooldownTimestamp( - fromCooldownTimestamp: PromiseOrValue, - amountToReceive: PromiseOrValue, - toAddress: PromiseOrValue, - toBalance: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerAtBlock( - user: PromiseOrValue, - blockNumber: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerCurrent( - user: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getTotalRewardsBalance( - staker: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getUserAssetData( - user: PromiseOrValue, - asset: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - name: PromiseOrValue, - symbol: PromiseOrValue, - decimals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - permit( - owner: PromiseOrValue, - spender: PromiseOrValue, - value: PromiseOrValue, - deadline: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - redeem( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - onBehalfOf: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakerRewardsToClaim( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stakersCooldowns( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - symbol(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - totalSupplyAt( - blockNumber: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - populateTransaction: { - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - - DELEGATE_BY_TYPE_TYPEHASH( - overrides?: CallOverrides - ): Promise; - - DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; - - DISTRIBUTION_END(overrides?: CallOverrides): Promise; - - DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; - - EIP712_REVISION(overrides?: CallOverrides): Promise; - - EMISSION_MANAGER(overrides?: CallOverrides): Promise; - - PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; - - PRECISION(overrides?: CallOverrides): Promise; - - REVISION(overrides?: CallOverrides): Promise; - - REWARDS_VAULT(overrides?: CallOverrides): Promise; - - REWARD_TOKEN(overrides?: CallOverrides): Promise; - - STAKED_TOKEN(overrides?: CallOverrides): Promise; - - UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; - - _aaveGovernance(overrides?: CallOverrides): Promise; - - _nonces( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - _votingSnapshots( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - _votingSnapshotsCounts( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - assets( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - claimRewards( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - configureAssets( - assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - cooldown( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - decimals(overrides?: CallOverrides): Promise; - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegate( - delegatee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateBySig( - delegatee: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByType( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - delegateByTypeBySig( - delegatee: PromiseOrValue, - delegationType: PromiseOrValue, - nonce: PromiseOrValue, - expiry: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getDelegateeByType( - delegator: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getNextCooldownTimestamp( - fromCooldownTimestamp: PromiseOrValue, - amountToReceive: PromiseOrValue, - toAddress: PromiseOrValue, - toBalance: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerAtBlock( - user: PromiseOrValue, - blockNumber: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getPowerCurrent( - user: PromiseOrValue, - delegationType: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getTotalRewardsBalance( - staker: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getUserAssetData( - user: PromiseOrValue, - asset: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - initialize( - name: PromiseOrValue, - symbol: PromiseOrValue, - decimals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - name(overrides?: CallOverrides): Promise; - - permit( - owner: PromiseOrValue, - spender: PromiseOrValue, - value: PromiseOrValue, - deadline: PromiseOrValue, - v: PromiseOrValue, - r: PromiseOrValue, - s: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - redeem( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - onBehalfOf: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakerRewardsToClaim( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stakersCooldowns( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - symbol(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - totalSupplyAt( - blockNumber: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/LyraStakingModuleProxy.ts b/sdk/src/contracts/common/typechain/LyraStakingModuleProxy.ts deleted file mode 100644 index 16e3138..0000000 --- a/sdk/src/contracts/common/typechain/LyraStakingModuleProxy.ts +++ /dev/null @@ -1,364 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - 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, - PromiseOrValue, -} from "./common"; - -export interface LyraStakingModuleProxyInterface extends utils.Interface { - functions: { - "admin()": FunctionFragment; - "changeAdmin(address)": FunctionFragment; - "implementation()": FunctionFragment; - "initialize(address,address,bytes)": FunctionFragment; - "initialize(address,bytes)": FunctionFragment; - "upgradeTo(address)": FunctionFragment; - "upgradeToAndCall(address,bytes)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "admin" - | "changeAdmin" - | "implementation" - | "initialize(address,address,bytes)" - | "initialize(address,bytes)" - | "upgradeTo" - | "upgradeToAndCall" - ): FunctionFragment; - - encodeFunctionData(functionFragment: "admin", values?: undefined): string; - encodeFunctionData( - functionFragment: "changeAdmin", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "implementation", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "initialize(address,address,bytes)", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "initialize(address,bytes)", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "upgradeTo", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "upgradeToAndCall", - values: [PromiseOrValue, PromiseOrValue] - ): string; - - decodeFunctionResult(functionFragment: "admin", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "changeAdmin", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "implementation", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "initialize(address,address,bytes)", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "initialize(address,bytes)", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "upgradeTo", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "upgradeToAndCall", - data: BytesLike - ): Result; - - events: { - "AdminChanged(address,address)": EventFragment; - "Upgraded(address)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "AdminChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; -} - -export interface AdminChangedEventObject { - previousAdmin: string; - newAdmin: string; -} -export type AdminChangedEvent = TypedEvent< - [string, string], - AdminChangedEventObject ->; - -export type AdminChangedEventFilter = TypedEventFilter; - -export interface UpgradedEventObject { - implementation: string; -} -export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; - -export type UpgradedEventFilter = TypedEventFilter; - -export interface LyraStakingModuleProxy extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: LyraStakingModuleProxyInterface; - - 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: { - admin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - implementation( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,address,bytes)"( - _logic: PromiseOrValue, - _admin: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,bytes)"( - _logic: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - }; - - admin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - implementation( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,address,bytes)"( - _logic: PromiseOrValue, - _admin: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,bytes)"( - _logic: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - callStatic: { - admin(overrides?: CallOverrides): Promise; - - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - implementation(overrides?: CallOverrides): Promise; - - "initialize(address,address,bytes)"( - _logic: PromiseOrValue, - _admin: PromiseOrValue, - _data: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - "initialize(address,bytes)"( - _logic: PromiseOrValue, - _data: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "AdminChanged(address,address)"( - previousAdmin?: null, - newAdmin?: null - ): AdminChangedEventFilter; - AdminChanged( - previousAdmin?: null, - newAdmin?: null - ): AdminChangedEventFilter; - - "Upgraded(address)"( - implementation?: PromiseOrValue | null - ): UpgradedEventFilter; - Upgraded( - implementation?: PromiseOrValue | null - ): UpgradedEventFilter; - }; - - estimateGas: { - admin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - implementation( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,address,bytes)"( - _logic: PromiseOrValue, - _admin: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,bytes)"( - _logic: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - }; - - populateTransaction: { - admin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - implementation( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,address,bytes)"( - _logic: PromiseOrValue, - _admin: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - "initialize(address,bytes)"( - _logic: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/MultiDistributor.ts b/sdk/src/contracts/common/typechain/MultiDistributor.ts index 566c278..9becfd6 100644 --- a/sdk/src/contracts/common/typechain/MultiDistributor.ts +++ b/sdk/src/contracts/common/typechain/MultiDistributor.ts @@ -54,9 +54,11 @@ export interface MultiDistributorInterface extends utils.Interface { events: { "ClaimAdded(address,address,uint256,uint256,string)": EventFragment; + "Claimed(address,address,uint256)": EventFragment; }; getEvent(nameOrSignatureOrTopic: "ClaimAdded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Claimed"): EventFragment; } export interface ClaimAddedEventObject { @@ -73,6 +75,18 @@ export type ClaimAddedEvent = TypedEvent< export type ClaimAddedEventFilter = TypedEventFilter; +export interface ClaimedEventObject { + rewardToken: string; + claimer: string; + amount: BigNumber; +} +export type ClaimedEvent = TypedEvent< + [string, string, BigNumber], + ClaimedEventObject +>; + +export type ClaimedEventFilter = TypedEventFilter; + export interface MultiDistributor extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; @@ -151,6 +165,17 @@ export interface MultiDistributor extends BaseContract { epochTimestamp?: PromiseOrValue | null, tag?: null ): ClaimAddedEventFilter; + + "Claimed(address,address,uint256)"( + rewardToken?: PromiseOrValue | null, + claimer?: PromiseOrValue | null, + amount?: null + ): ClaimedEventFilter; + Claimed( + rewardToken?: PromiseOrValue | null, + claimer?: PromiseOrValue | null, + amount?: null + ): ClaimedEventFilter; }; estimateGas: { diff --git a/sdk/src/contracts/common/typechain/OneInchOffChainOracle.ts b/sdk/src/contracts/common/typechain/OneInchOffChainOracle.ts deleted file mode 100644 index 093f960..0000000 --- a/sdk/src/contracts/common/typechain/OneInchOffChainOracle.ts +++ /dev/null @@ -1,600 +0,0 @@ -/* 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, - PromiseOrValue, -} from "./common"; - -export interface OneInchOffChainOracleInterface extends utils.Interface { - functions: { - "addConnector(address)": FunctionFragment; - "addOracle(address,uint8)": FunctionFragment; - "connectors()": FunctionFragment; - "getRate(address,address,bool)": FunctionFragment; - "getRateToEth(address,bool)": FunctionFragment; - "multiWrapper()": FunctionFragment; - "oracles()": FunctionFragment; - "owner()": FunctionFragment; - "removeConnector(address)": FunctionFragment; - "removeOracle(address,uint8)": FunctionFragment; - "renounceOwnership()": FunctionFragment; - "setMultiWrapper(address)": FunctionFragment; - "transferOwnership(address)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "addConnector" - | "addOracle" - | "connectors" - | "getRate" - | "getRateToEth" - | "multiWrapper" - | "oracles" - | "owner" - | "removeConnector" - | "removeOracle" - | "renounceOwnership" - | "setMultiWrapper" - | "transferOwnership" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "addConnector", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "addOracle", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "connectors", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getRate", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - encodeFunctionData( - functionFragment: "getRateToEth", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "multiWrapper", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "oracles", values?: undefined): string; - encodeFunctionData(functionFragment: "owner", values?: undefined): string; - encodeFunctionData( - functionFragment: "removeConnector", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "removeOracle", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "renounceOwnership", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "setMultiWrapper", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "transferOwnership", - values: [PromiseOrValue] - ): string; - - decodeFunctionResult( - functionFragment: "addConnector", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "addOracle", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "connectors", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getRate", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "getRateToEth", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "multiWrapper", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "oracles", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "removeConnector", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "removeOracle", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "renounceOwnership", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setMultiWrapper", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "transferOwnership", - data: BytesLike - ): Result; - - events: { - "ConnectorAdded(address)": EventFragment; - "ConnectorRemoved(address)": EventFragment; - "MultiWrapperUpdated(address)": EventFragment; - "OracleAdded(address,uint8)": EventFragment; - "OracleRemoved(address,uint8)": EventFragment; - "OwnershipTransferred(address,address)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "ConnectorAdded"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ConnectorRemoved"): EventFragment; - getEvent(nameOrSignatureOrTopic: "MultiWrapperUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OracleAdded"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OracleRemoved"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; -} - -export interface ConnectorAddedEventObject { - connector: string; -} -export type ConnectorAddedEvent = TypedEvent< - [string], - ConnectorAddedEventObject ->; - -export type ConnectorAddedEventFilter = TypedEventFilter; - -export interface ConnectorRemovedEventObject { - connector: string; -} -export type ConnectorRemovedEvent = TypedEvent< - [string], - ConnectorRemovedEventObject ->; - -export type ConnectorRemovedEventFilter = - TypedEventFilter; - -export interface MultiWrapperUpdatedEventObject { - multiWrapper: string; -} -export type MultiWrapperUpdatedEvent = TypedEvent< - [string], - MultiWrapperUpdatedEventObject ->; - -export type MultiWrapperUpdatedEventFilter = - TypedEventFilter; - -export interface OracleAddedEventObject { - oracle: string; - oracleType: number; -} -export type OracleAddedEvent = TypedEvent< - [string, number], - OracleAddedEventObject ->; - -export type OracleAddedEventFilter = TypedEventFilter; - -export interface OracleRemovedEventObject { - oracle: string; - oracleType: number; -} -export type OracleRemovedEvent = TypedEvent< - [string, number], - OracleRemovedEventObject ->; - -export type OracleRemovedEventFilter = TypedEventFilter; - -export interface OwnershipTransferredEventObject { - previousOwner: string; - newOwner: string; -} -export type OwnershipTransferredEvent = TypedEvent< - [string, string], - OwnershipTransferredEventObject ->; - -export type OwnershipTransferredEventFilter = - TypedEventFilter; - -export interface OneInchOffChainOracle extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: OneInchOffChainOracleInterface; - - 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: { - addConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - addOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - connectors( - overrides?: CallOverrides - ): Promise<[string[]] & { allConnectors: string[] }>; - - getRate( - srcToken: PromiseOrValue, - dstToken: PromiseOrValue, - useWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { weightedRate: BigNumber }>; - - getRateToEth( - srcToken: PromiseOrValue, - useSrcWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { weightedRate: BigNumber }>; - - multiWrapper(overrides?: CallOverrides): Promise<[string]>; - - oracles( - overrides?: CallOverrides - ): Promise< - [string[], number[]] & { allOracles: string[]; oracleTypes: number[] } - >; - - owner(overrides?: CallOverrides): Promise<[string]>; - - removeConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - removeOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setMultiWrapper( - _multiWrapper: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - addConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - addOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - connectors(overrides?: CallOverrides): Promise; - - getRate( - srcToken: PromiseOrValue, - dstToken: PromiseOrValue, - useWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getRateToEth( - srcToken: PromiseOrValue, - useSrcWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - multiWrapper(overrides?: CallOverrides): Promise; - - oracles( - overrides?: CallOverrides - ): Promise< - [string[], number[]] & { allOracles: string[]; oracleTypes: number[] } - >; - - owner(overrides?: CallOverrides): Promise; - - removeConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - removeOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setMultiWrapper( - _multiWrapper: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - callStatic: { - addConnector( - connector: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - addOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - connectors(overrides?: CallOverrides): Promise; - - getRate( - srcToken: PromiseOrValue, - dstToken: PromiseOrValue, - useWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getRateToEth( - srcToken: PromiseOrValue, - useSrcWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - multiWrapper(overrides?: CallOverrides): Promise; - - oracles( - overrides?: CallOverrides - ): Promise< - [string[], number[]] & { allOracles: string[]; oracleTypes: number[] } - >; - - owner(overrides?: CallOverrides): Promise; - - removeConnector( - connector: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - removeOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - renounceOwnership(overrides?: CallOverrides): Promise; - - setMultiWrapper( - _multiWrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "ConnectorAdded(address)"(connector?: null): ConnectorAddedEventFilter; - ConnectorAdded(connector?: null): ConnectorAddedEventFilter; - - "ConnectorRemoved(address)"(connector?: null): ConnectorRemovedEventFilter; - ConnectorRemoved(connector?: null): ConnectorRemovedEventFilter; - - "MultiWrapperUpdated(address)"( - multiWrapper?: null - ): MultiWrapperUpdatedEventFilter; - MultiWrapperUpdated(multiWrapper?: null): MultiWrapperUpdatedEventFilter; - - "OracleAdded(address,uint8)"( - oracle?: null, - oracleType?: null - ): OracleAddedEventFilter; - OracleAdded(oracle?: null, oracleType?: null): OracleAddedEventFilter; - - "OracleRemoved(address,uint8)"( - oracle?: null, - oracleType?: null - ): OracleRemovedEventFilter; - OracleRemoved(oracle?: null, oracleType?: null): OracleRemovedEventFilter; - - "OwnershipTransferred(address,address)"( - previousOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter; - OwnershipTransferred( - previousOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter; - }; - - estimateGas: { - addConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - addOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - connectors(overrides?: CallOverrides): Promise; - - getRate( - srcToken: PromiseOrValue, - dstToken: PromiseOrValue, - useWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getRateToEth( - srcToken: PromiseOrValue, - useSrcWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - multiWrapper(overrides?: CallOverrides): Promise; - - oracles(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - removeConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - removeOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setMultiWrapper( - _multiWrapper: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - populateTransaction: { - addConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - addOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - connectors(overrides?: CallOverrides): Promise; - - getRate( - srcToken: PromiseOrValue, - dstToken: PromiseOrValue, - useWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - getRateToEth( - srcToken: PromiseOrValue, - useSrcWrappers: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - multiWrapper(overrides?: CallOverrides): Promise; - - oracles(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - removeConnector( - connector: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - removeOracle( - oracle: PromiseOrValue, - oracleKind: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setMultiWrapper( - _multiWrapper: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/StakingRewards.ts b/sdk/src/contracts/common/typechain/StakingRewards.ts deleted file mode 100644 index 0483e9b..0000000 --- a/sdk/src/contracts/common/typechain/StakingRewards.ts +++ /dev/null @@ -1,1032 +0,0 @@ -/* 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, - PromiseOrValue, -} from "./common"; - -export interface StakingRewardsInterface extends utils.Interface { - functions: { - "acceptOwnership()": FunctionFragment; - "balanceOf(address)": FunctionFragment; - "earned(address)": FunctionFragment; - "exit()": FunctionFragment; - "getReward()": FunctionFragment; - "getRewardForDuration()": FunctionFragment; - "lastPauseTime()": FunctionFragment; - "lastTimeRewardApplicable()": FunctionFragment; - "lastUpdateTime()": FunctionFragment; - "nominateNewOwner(address)": FunctionFragment; - "nominatedOwner()": FunctionFragment; - "notifyRewardAmount(uint256)": FunctionFragment; - "owner()": FunctionFragment; - "paused()": FunctionFragment; - "periodFinish()": FunctionFragment; - "recoverERC20(address,uint256)": FunctionFragment; - "rewardPerToken()": FunctionFragment; - "rewardPerTokenStored()": FunctionFragment; - "rewardRate()": FunctionFragment; - "rewards(address)": FunctionFragment; - "rewardsDistribution()": FunctionFragment; - "rewardsDuration()": FunctionFragment; - "rewardsToken()": FunctionFragment; - "setPaused(bool)": FunctionFragment; - "setRewardsDistribution(address)": FunctionFragment; - "setRewardsDuration(uint256)": FunctionFragment; - "stake(uint256)": FunctionFragment; - "stakingToken()": FunctionFragment; - "totalSupply()": FunctionFragment; - "userRewardPerTokenPaid(address)": FunctionFragment; - "withdraw(uint256)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "acceptOwnership" - | "balanceOf" - | "earned" - | "exit" - | "getReward" - | "getRewardForDuration" - | "lastPauseTime" - | "lastTimeRewardApplicable" - | "lastUpdateTime" - | "nominateNewOwner" - | "nominatedOwner" - | "notifyRewardAmount" - | "owner" - | "paused" - | "periodFinish" - | "recoverERC20" - | "rewardPerToken" - | "rewardPerTokenStored" - | "rewardRate" - | "rewards" - | "rewardsDistribution" - | "rewardsDuration" - | "rewardsToken" - | "setPaused" - | "setRewardsDistribution" - | "setRewardsDuration" - | "stake" - | "stakingToken" - | "totalSupply" - | "userRewardPerTokenPaid" - | "withdraw" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "acceptOwnership", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "earned", - values: [PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "exit", values?: undefined): string; - encodeFunctionData(functionFragment: "getReward", values?: undefined): string; - encodeFunctionData( - functionFragment: "getRewardForDuration", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastPauseTime", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastTimeRewardApplicable", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastUpdateTime", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "nominateNewOwner", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "nominatedOwner", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "notifyRewardAmount", - values: [PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "owner", values?: undefined): string; - encodeFunctionData(functionFragment: "paused", values?: undefined): string; - encodeFunctionData( - functionFragment: "periodFinish", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "recoverERC20", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "rewardPerToken", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardPerTokenStored", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardRate", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewards", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "rewardsDistribution", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardsDuration", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardsToken", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "setPaused", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "setRewardsDistribution", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "setRewardsDuration", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "stake", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "stakingToken", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "userRewardPerTokenPaid", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "withdraw", - values: [PromiseOrValue] - ): string; - - decodeFunctionResult( - functionFragment: "acceptOwnership", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "earned", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "exit", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getReward", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "getRewardForDuration", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastPauseTime", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastTimeRewardApplicable", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastUpdateTime", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "nominateNewOwner", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "nominatedOwner", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "notifyRewardAmount", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "periodFinish", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "recoverERC20", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardPerToken", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardPerTokenStored", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "rewardRate", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "rewards", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "rewardsDistribution", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardsDuration", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardsToken", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "setPaused", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "setRewardsDistribution", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setRewardsDuration", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "stake", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "stakingToken", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "userRewardPerTokenPaid", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; - - events: { - "OwnerChanged(address,address)": EventFragment; - "OwnerNominated(address)": EventFragment; - "PauseChanged(bool)": EventFragment; - "Recovered(address,uint256)": EventFragment; - "RewardAdded(uint256)": EventFragment; - "RewardPaid(address,uint256)": EventFragment; - "RewardsDurationUpdated(uint256)": EventFragment; - "Staked(address,uint256)": EventFragment; - "Withdrawn(address,uint256)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "PauseChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Recovered"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardAdded"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardPaid"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardsDurationUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Staked"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Withdrawn"): EventFragment; -} - -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 PauseChangedEventObject { - isPaused: boolean; -} -export type PauseChangedEvent = TypedEvent<[boolean], PauseChangedEventObject>; - -export type PauseChangedEventFilter = TypedEventFilter; - -export interface RecoveredEventObject { - token: string; - amount: BigNumber; -} -export type RecoveredEvent = TypedEvent< - [string, BigNumber], - RecoveredEventObject ->; - -export type RecoveredEventFilter = TypedEventFilter; - -export interface RewardAddedEventObject { - reward: BigNumber; -} -export type RewardAddedEvent = TypedEvent<[BigNumber], RewardAddedEventObject>; - -export type RewardAddedEventFilter = TypedEventFilter; - -export interface RewardPaidEventObject { - user: string; - reward: BigNumber; -} -export type RewardPaidEvent = TypedEvent< - [string, BigNumber], - RewardPaidEventObject ->; - -export type RewardPaidEventFilter = TypedEventFilter; - -export interface RewardsDurationUpdatedEventObject { - newDuration: BigNumber; -} -export type RewardsDurationUpdatedEvent = TypedEvent< - [BigNumber], - RewardsDurationUpdatedEventObject ->; - -export type RewardsDurationUpdatedEventFilter = - TypedEventFilter; - -export interface StakedEventObject { - user: string; - amount: BigNumber; -} -export type StakedEvent = TypedEvent<[string, BigNumber], StakedEventObject>; - -export type StakedEventFilter = TypedEventFilter; - -export interface WithdrawnEventObject { - user: string; - amount: BigNumber; -} -export type WithdrawnEvent = TypedEvent< - [string, BigNumber], - WithdrawnEventObject ->; - -export type WithdrawnEventFilter = TypedEventFilter; - -export interface StakingRewards extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: StakingRewardsInterface; - - 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?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - - lastPauseTime(overrides?: CallOverrides): Promise<[BigNumber]>; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise<[BigNumber]>; - - lastUpdateTime(overrides?: CallOverrides): Promise<[BigNumber]>; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise<[string]>; - - paused(overrides?: CallOverrides): Promise<[boolean]>; - - periodFinish(overrides?: CallOverrides): Promise<[BigNumber]>; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewardPerTokenStored(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewardRate(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - rewardsDistribution(overrides?: CallOverrides): Promise<[string]>; - - rewardsDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewardsToken(overrides?: CallOverrides): Promise<[string]>; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise<[string]>; - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored(overrides?: CallOverrides): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution(overrides?: CallOverrides): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit(overrides?: CallOverrides): Promise; - - getReward(overrides?: CallOverrides): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored(overrides?: CallOverrides): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution(overrides?: CallOverrides): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "OwnerChanged(address,address)"( - oldOwner?: null, - newOwner?: null - ): OwnerChangedEventFilter; - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - - "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; - - "PauseChanged(bool)"(isPaused?: null): PauseChangedEventFilter; - PauseChanged(isPaused?: null): PauseChangedEventFilter; - - "Recovered(address,uint256)"( - token?: null, - amount?: null - ): RecoveredEventFilter; - Recovered(token?: null, amount?: null): RecoveredEventFilter; - - "RewardAdded(uint256)"(reward?: null): RewardAddedEventFilter; - RewardAdded(reward?: null): RewardAddedEventFilter; - - "RewardPaid(address,uint256)"( - user?: PromiseOrValue | null, - reward?: null - ): RewardPaidEventFilter; - RewardPaid( - user?: PromiseOrValue | null, - reward?: null - ): RewardPaidEventFilter; - - "RewardsDurationUpdated(uint256)"( - newDuration?: null - ): RewardsDurationUpdatedEventFilter; - RewardsDurationUpdated( - newDuration?: null - ): RewardsDurationUpdatedEventFilter; - - "Staked(address,uint256)"( - user?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter; - Staked( - user?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter; - - "Withdrawn(address,uint256)"( - user?: PromiseOrValue | null, - amount?: null - ): WithdrawnEventFilter; - Withdrawn( - user?: PromiseOrValue | null, - amount?: null - ): WithdrawnEventFilter; - }; - - estimateGas: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored(overrides?: CallOverrides): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution(overrides?: CallOverrides): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration( - overrides?: CallOverrides - ): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable( - overrides?: CallOverrides - ): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored( - overrides?: CallOverrides - ): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution( - overrides?: CallOverrides - ): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/TokenMigrator.ts b/sdk/src/contracts/common/typechain/TokenMigrator.ts deleted file mode 100644 index df9e9d3..0000000 --- a/sdk/src/contracts/common/typechain/TokenMigrator.ts +++ /dev/null @@ -1,286 +0,0 @@ -/* 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, - PromiseOrValue, -} from "./common"; - -export interface TokenMigratorInterface extends utils.Interface { - functions: { - "fromToken()": FunctionFragment; - "owner()": FunctionFragment; - "renounceOwnership()": FunctionFragment; - "swap(uint256)": FunctionFragment; - "toToken()": FunctionFragment; - "transferOwnership(address)": FunctionFragment; - "withdraw(address,uint256,uint256)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "fromToken" - | "owner" - | "renounceOwnership" - | "swap" - | "toToken" - | "transferOwnership" - | "withdraw" - ): FunctionFragment; - - encodeFunctionData(functionFragment: "fromToken", values?: undefined): string; - encodeFunctionData(functionFragment: "owner", values?: undefined): string; - encodeFunctionData( - functionFragment: "renounceOwnership", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "swap", - values: [PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "toToken", values?: undefined): string; - encodeFunctionData( - functionFragment: "transferOwnership", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "withdraw", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string; - - decodeFunctionResult(functionFragment: "fromToken", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "renounceOwnership", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "swap", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "toToken", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "transferOwnership", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; - - events: { - "OwnershipTransferred(address,address)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; -} - -export interface OwnershipTransferredEventObject { - previousOwner: string; - newOwner: string; -} -export type OwnershipTransferredEvent = TypedEvent< - [string, string], - OwnershipTransferredEventObject ->; - -export type OwnershipTransferredEventFilter = - TypedEventFilter; - -export interface TokenMigrator extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: TokenMigratorInterface; - - 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: { - fromToken(overrides?: CallOverrides): Promise<[string]>; - - owner(overrides?: CallOverrides): Promise<[string]>; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - swap( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - toToken(overrides?: CallOverrides): Promise<[string]>; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdraw( - recipient: PromiseOrValue, - fromTokenAmt: PromiseOrValue, - toTokenAmt: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - fromToken(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - swap( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - toToken(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdraw( - recipient: PromiseOrValue, - fromTokenAmt: PromiseOrValue, - toTokenAmt: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - callStatic: { - fromToken(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - renounceOwnership(overrides?: CallOverrides): Promise; - - swap( - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - toToken(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - recipient: PromiseOrValue, - fromTokenAmt: PromiseOrValue, - toTokenAmt: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "OwnershipTransferred(address,address)"( - previousOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter; - OwnershipTransferred( - previousOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter; - }; - - estimateGas: { - fromToken(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - swap( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - toToken(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdraw( - recipient: PromiseOrValue, - fromTokenAmt: PromiseOrValue, - toTokenAmt: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - populateTransaction: { - fromToken(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - swap( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - toToken(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - withdraw( - recipient: PromiseOrValue, - fromTokenAmt: PromiseOrValue, - toTokenAmt: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/WethLyraStakingRewards.ts b/sdk/src/contracts/common/typechain/WethLyraStakingRewards.ts deleted file mode 100644 index 7b389ce..0000000 --- a/sdk/src/contracts/common/typechain/WethLyraStakingRewards.ts +++ /dev/null @@ -1,1032 +0,0 @@ -/* 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, - PromiseOrValue, -} from "./common"; - -export interface WethLyraStakingRewardsInterface extends utils.Interface { - functions: { - "acceptOwnership()": FunctionFragment; - "balanceOf(address)": FunctionFragment; - "earned(address)": FunctionFragment; - "exit()": FunctionFragment; - "getReward()": FunctionFragment; - "getRewardForDuration()": FunctionFragment; - "lastPauseTime()": FunctionFragment; - "lastTimeRewardApplicable()": FunctionFragment; - "lastUpdateTime()": FunctionFragment; - "nominateNewOwner(address)": FunctionFragment; - "nominatedOwner()": FunctionFragment; - "notifyRewardAmount(uint256)": FunctionFragment; - "owner()": FunctionFragment; - "paused()": FunctionFragment; - "periodFinish()": FunctionFragment; - "recoverERC20(address,uint256)": FunctionFragment; - "rewardPerToken()": FunctionFragment; - "rewardPerTokenStored()": FunctionFragment; - "rewardRate()": FunctionFragment; - "rewards(address)": FunctionFragment; - "rewardsDistribution()": FunctionFragment; - "rewardsDuration()": FunctionFragment; - "rewardsToken()": FunctionFragment; - "setPaused(bool)": FunctionFragment; - "setRewardsDistribution(address)": FunctionFragment; - "setRewardsDuration(uint256)": FunctionFragment; - "stake(uint256)": FunctionFragment; - "stakingToken()": FunctionFragment; - "totalSupply()": FunctionFragment; - "userRewardPerTokenPaid(address)": FunctionFragment; - "withdraw(uint256)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "acceptOwnership" - | "balanceOf" - | "earned" - | "exit" - | "getReward" - | "getRewardForDuration" - | "lastPauseTime" - | "lastTimeRewardApplicable" - | "lastUpdateTime" - | "nominateNewOwner" - | "nominatedOwner" - | "notifyRewardAmount" - | "owner" - | "paused" - | "periodFinish" - | "recoverERC20" - | "rewardPerToken" - | "rewardPerTokenStored" - | "rewardRate" - | "rewards" - | "rewardsDistribution" - | "rewardsDuration" - | "rewardsToken" - | "setPaused" - | "setRewardsDistribution" - | "setRewardsDuration" - | "stake" - | "stakingToken" - | "totalSupply" - | "userRewardPerTokenPaid" - | "withdraw" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "acceptOwnership", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "earned", - values: [PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "exit", values?: undefined): string; - encodeFunctionData(functionFragment: "getReward", values?: undefined): string; - encodeFunctionData( - functionFragment: "getRewardForDuration", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastPauseTime", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastTimeRewardApplicable", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastUpdateTime", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "nominateNewOwner", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "nominatedOwner", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "notifyRewardAmount", - values: [PromiseOrValue] - ): string; - encodeFunctionData(functionFragment: "owner", values?: undefined): string; - encodeFunctionData(functionFragment: "paused", values?: undefined): string; - encodeFunctionData( - functionFragment: "periodFinish", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "recoverERC20", - values: [PromiseOrValue, PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "rewardPerToken", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardPerTokenStored", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardRate", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewards", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "rewardsDistribution", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardsDuration", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rewardsToken", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "setPaused", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "setRewardsDistribution", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "setRewardsDuration", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "stake", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "stakingToken", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "userRewardPerTokenPaid", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "withdraw", - values: [PromiseOrValue] - ): string; - - decodeFunctionResult( - functionFragment: "acceptOwnership", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "earned", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "exit", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getReward", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "getRewardForDuration", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastPauseTime", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastTimeRewardApplicable", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastUpdateTime", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "nominateNewOwner", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "nominatedOwner", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "notifyRewardAmount", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "periodFinish", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "recoverERC20", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardPerToken", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardPerTokenStored", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "rewardRate", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "rewards", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "rewardsDistribution", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardsDuration", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rewardsToken", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "setPaused", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "setRewardsDistribution", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setRewardsDuration", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "stake", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "stakingToken", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "userRewardPerTokenPaid", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; - - events: { - "OwnerChanged(address,address)": EventFragment; - "OwnerNominated(address)": EventFragment; - "PauseChanged(bool)": EventFragment; - "Recovered(address,uint256)": EventFragment; - "RewardAdded(uint256)": EventFragment; - "RewardPaid(address,uint256)": EventFragment; - "RewardsDurationUpdated(uint256)": EventFragment; - "Staked(address,uint256)": EventFragment; - "Withdrawn(address,uint256)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "PauseChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Recovered"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardAdded"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardPaid"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardsDurationUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Staked"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Withdrawn"): EventFragment; -} - -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 PauseChangedEventObject { - isPaused: boolean; -} -export type PauseChangedEvent = TypedEvent<[boolean], PauseChangedEventObject>; - -export type PauseChangedEventFilter = TypedEventFilter; - -export interface RecoveredEventObject { - token: string; - amount: BigNumber; -} -export type RecoveredEvent = TypedEvent< - [string, BigNumber], - RecoveredEventObject ->; - -export type RecoveredEventFilter = TypedEventFilter; - -export interface RewardAddedEventObject { - reward: BigNumber; -} -export type RewardAddedEvent = TypedEvent<[BigNumber], RewardAddedEventObject>; - -export type RewardAddedEventFilter = TypedEventFilter; - -export interface RewardPaidEventObject { - user: string; - reward: BigNumber; -} -export type RewardPaidEvent = TypedEvent< - [string, BigNumber], - RewardPaidEventObject ->; - -export type RewardPaidEventFilter = TypedEventFilter; - -export interface RewardsDurationUpdatedEventObject { - newDuration: BigNumber; -} -export type RewardsDurationUpdatedEvent = TypedEvent< - [BigNumber], - RewardsDurationUpdatedEventObject ->; - -export type RewardsDurationUpdatedEventFilter = - TypedEventFilter; - -export interface StakedEventObject { - user: string; - amount: BigNumber; -} -export type StakedEvent = TypedEvent<[string, BigNumber], StakedEventObject>; - -export type StakedEventFilter = TypedEventFilter; - -export interface WithdrawnEventObject { - user: string; - amount: BigNumber; -} -export type WithdrawnEvent = TypedEvent< - [string, BigNumber], - WithdrawnEventObject ->; - -export type WithdrawnEventFilter = TypedEventFilter; - -export interface WethLyraStakingRewards extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: WethLyraStakingRewardsInterface; - - 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?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - - lastPauseTime(overrides?: CallOverrides): Promise<[BigNumber]>; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise<[BigNumber]>; - - lastUpdateTime(overrides?: CallOverrides): Promise<[BigNumber]>; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise<[string]>; - - paused(overrides?: CallOverrides): Promise<[boolean]>; - - periodFinish(overrides?: CallOverrides): Promise<[BigNumber]>; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewardPerTokenStored(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewardRate(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - rewardsDistribution(overrides?: CallOverrides): Promise<[string]>; - - rewardsDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - - rewardsToken(overrides?: CallOverrides): Promise<[string]>; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise<[string]>; - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored(overrides?: CallOverrides): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution(overrides?: CallOverrides): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit(overrides?: CallOverrides): Promise; - - getReward(overrides?: CallOverrides): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored(overrides?: CallOverrides): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution(overrides?: CallOverrides): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "OwnerChanged(address,address)"( - oldOwner?: null, - newOwner?: null - ): OwnerChangedEventFilter; - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - - "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; - - "PauseChanged(bool)"(isPaused?: null): PauseChangedEventFilter; - PauseChanged(isPaused?: null): PauseChangedEventFilter; - - "Recovered(address,uint256)"( - token?: null, - amount?: null - ): RecoveredEventFilter; - Recovered(token?: null, amount?: null): RecoveredEventFilter; - - "RewardAdded(uint256)"(reward?: null): RewardAddedEventFilter; - RewardAdded(reward?: null): RewardAddedEventFilter; - - "RewardPaid(address,uint256)"( - user?: PromiseOrValue | null, - reward?: null - ): RewardPaidEventFilter; - RewardPaid( - user?: PromiseOrValue | null, - reward?: null - ): RewardPaidEventFilter; - - "RewardsDurationUpdated(uint256)"( - newDuration?: null - ): RewardsDurationUpdatedEventFilter; - RewardsDurationUpdated( - newDuration?: null - ): RewardsDurationUpdatedEventFilter; - - "Staked(address,uint256)"( - user?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter; - Staked( - user?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter; - - "Withdrawn(address,uint256)"( - user?: PromiseOrValue | null, - amount?: null - ): WithdrawnEventFilter; - Withdrawn( - user?: PromiseOrValue | null, - amount?: null - ): WithdrawnEventFilter; - }; - - estimateGas: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration(overrides?: CallOverrides): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored(overrides?: CallOverrides): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution(overrides?: CallOverrides): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; - - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - exit( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - getRewardForDuration( - overrides?: CallOverrides - ): Promise; - - lastPauseTime(overrides?: CallOverrides): Promise; - - lastTimeRewardApplicable( - overrides?: CallOverrides - ): Promise; - - lastUpdateTime(overrides?: CallOverrides): Promise; - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - nominatedOwner(overrides?: CallOverrides): Promise; - - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - owner(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - periodFinish(overrides?: CallOverrides): Promise; - - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - rewardPerToken(overrides?: CallOverrides): Promise; - - rewardPerTokenStored( - overrides?: CallOverrides - ): Promise; - - rewardRate(overrides?: CallOverrides): Promise; - - rewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - rewardsDistribution( - overrides?: CallOverrides - ): Promise; - - rewardsDuration(overrides?: CallOverrides): Promise; - - rewardsToken(overrides?: CallOverrides): Promise; - - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - - stakingToken(overrides?: CallOverrides): Promise; - - totalSupply(overrides?: CallOverrides): Promise; - - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; -} diff --git a/sdk/src/contracts/common/typechain/factories/ArrakisPoolL1__factory.ts b/sdk/src/contracts/common/typechain/factories/ArrakisPoolL1__factory.ts deleted file mode 100644 index c128a8c..0000000 --- a/sdk/src/contracts/common/typechain/factories/ArrakisPoolL1__factory.ts +++ /dev/null @@ -1,1148 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { ArrakisPoolL1, ArrakisPoolL1Interface } from "../ArrakisPoolL1"; - -const _abi = [ - { - inputs: [ - { - internalType: "address payable", - name: "_gelato", - type: "address", - }, - { - internalType: "address", - name: "_arrakisTreasury", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - 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: "receiver", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "burnAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount0Out", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount1Out", - type: "uint256", - }, - { - indexed: false, - internalType: "uint128", - name: "liquidityBurned", - type: "uint128", - }, - ], - name: "Burned", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "feesEarned0", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "feesEarned1", - type: "uint256", - }, - ], - name: "FeesEarned", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "receiver", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "mintAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount0In", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount1In", - type: "uint256", - }, - { - indexed: false, - internalType: "uint128", - name: "liquidityMinted", - type: "uint128", - }, - ], - name: "Minted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousManager", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newManager", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "int24", - name: "lowerTick_", - type: "int24", - }, - { - indexed: false, - internalType: "int24", - name: "upperTick_", - type: "int24", - }, - { - indexed: false, - internalType: "uint128", - name: "liquidityBefore", - type: "uint128", - }, - { - indexed: false, - internalType: "uint128", - name: "liquidityAfter", - type: "uint128", - }, - ], - name: "Rebalance", - 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", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint16", - name: "managerFeeBPS", - type: "uint16", - }, - { - indexed: false, - internalType: "address", - name: "managerTreasury", - type: "address", - }, - { - indexed: false, - internalType: "uint16", - name: "gelatoRebalanceBPS", - type: "uint16", - }, - { - indexed: false, - internalType: "uint16", - name: "gelatoSlippageBPS", - type: "uint16", - }, - { - indexed: false, - internalType: "uint32", - name: "gelatoSlippageInterval", - type: "uint32", - }, - ], - name: "UpdateManagerParams", - type: "event", - }, - { - inputs: [], - name: "GELATO", - outputs: [ - { - internalType: "address payable", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "RESTRICTED_MINT_ENABLED", - outputs: [ - { - internalType: "uint16", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - 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: [], - name: "arrakisBalance0", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "arrakisBalance1", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "arrakisFeeBPS", - outputs: [ - { - internalType: "uint16", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "arrakisTreasury", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "burnAmount", - type: "uint256", - }, - { - internalType: "address", - name: "receiver", - type: "address", - }, - ], - name: "burn", - outputs: [ - { - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - { - internalType: "uint128", - name: "liquidityBurned", - type: "uint128", - }, - ], - 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: "int24", - name: "newLowerTick", - type: "int24", - }, - { - internalType: "int24", - name: "newUpperTick", - type: "int24", - }, - { - internalType: "uint160", - name: "swapThresholdPrice", - type: "uint160", - }, - { - internalType: "uint256", - name: "swapAmountBPS", - type: "uint256", - }, - { - internalType: "bool", - name: "zeroForOne", - type: "bool", - }, - ], - name: "executiveRebalance", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "gelatoRebalanceBPS", - outputs: [ - { - internalType: "uint16", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "gelatoSlippageBPS", - outputs: [ - { - internalType: "uint16", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "gelatoSlippageInterval", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amount0Max", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1Max", - type: "uint256", - }, - ], - name: "getMintAmounts", - outputs: [ - { - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - { - internalType: "uint256", - name: "mintAmount", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getPositionID", - outputs: [ - { - internalType: "bytes32", - name: "positionID", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getUnderlyingBalances", - outputs: [ - { - internalType: "uint256", - name: "amount0Current", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1Current", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint160", - name: "sqrtRatioX96", - type: "uint160", - }, - ], - name: "getUnderlyingBalancesAtPrice", - outputs: [ - { - internalType: "uint256", - name: "amount0Current", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1Current", - type: "uint256", - }, - ], - stateMutability: "view", - 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: "string", - name: "_name", - type: "string", - }, - { - internalType: "string", - name: "_symbol", - type: "string", - }, - { - internalType: "address", - name: "_pool", - type: "address", - }, - { - internalType: "uint16", - name: "_managerFeeBPS", - type: "uint16", - }, - { - internalType: "int24", - name: "_lowerTick", - type: "int24", - }, - { - internalType: "int24", - name: "_upperTick", - type: "int24", - }, - { - internalType: "address", - name: "_manager_", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "lowerTick", - outputs: [ - { - internalType: "int24", - name: "", - type: "int24", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "manager", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "managerBalance0", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "managerBalance1", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "managerFeeBPS", - outputs: [ - { - internalType: "uint16", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "managerTreasury", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "mintAmount", - type: "uint256", - }, - { - internalType: "address", - name: "receiver", - type: "address", - }, - ], - name: "mint", - outputs: [ - { - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - { - internalType: "uint128", - name: "liquidityMinted", - type: "uint128", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "name", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pool", - outputs: [ - { - internalType: "contract IUniswapV3Pool", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint160", - name: "swapThresholdPrice", - type: "uint160", - }, - { - internalType: "uint256", - name: "swapAmountBPS", - type: "uint256", - }, - { - internalType: "bool", - name: "zeroForOne", - type: "bool", - }, - { - internalType: "uint256", - name: "feeAmount", - type: "uint256", - }, - { - internalType: "address", - name: "paymentToken", - type: "address", - }, - ], - name: "rebalance", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "restrictedMintToggle", - outputs: [ - { - internalType: "uint16", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "symbol", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "toggleRestrictMint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "token0", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "token1", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - 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", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amount0Owed", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1Owed", - type: "uint256", - }, - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - name: "uniswapV3MintCallback", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "int256", - name: "amount0Delta", - type: "int256", - }, - { - internalType: "int256", - name: "amount1Delta", - type: "int256", - }, - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - name: "uniswapV3SwapCallback", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "int16", - name: "newManagerFeeBPS", - type: "int16", - }, - { - internalType: "address", - name: "newManagerTreasury", - type: "address", - }, - { - internalType: "int16", - name: "newRebalanceBPS", - type: "int16", - }, - { - internalType: "int16", - name: "newSlippageBPS", - type: "int16", - }, - { - internalType: "int32", - name: "newSlippageInterval", - type: "int32", - }, - ], - name: "updateManagerParams", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "upperTick", - outputs: [ - { - internalType: "int24", - name: "", - type: "int24", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "version", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "withdrawArrakisBalance", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "withdrawManagerBalance", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; - -export class ArrakisPoolL1__factory { - static readonly abi = _abi; - static createInterface(): ArrakisPoolL1Interface { - return new utils.Interface(_abi) as ArrakisPoolL1Interface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): ArrakisPoolL1 { - return new Contract(address, _abi, signerOrProvider) as ArrakisPoolL1; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/ArrakisPoolL2__factory.ts b/sdk/src/contracts/common/typechain/factories/ArrakisPoolL2__factory.ts deleted file mode 100644 index bcaef3f..0000000 --- a/sdk/src/contracts/common/typechain/factories/ArrakisPoolL2__factory.ts +++ /dev/null @@ -1,268 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { ArrakisPoolL2, ArrakisPoolL2Interface } from "../ArrakisPoolL2"; - -const _abi = [ - { - 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: "uint256", - name: "burnAmount", - type: "uint256", - }, - { - internalType: "address", - name: "receiver", - type: "address", - }, - ], - name: "burn", - outputs: [ - { - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - { - internalType: "uint128", - name: "liquidityBurned", - type: "uint128", - }, - ], - 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: [], - name: "gelatoBalance0", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "gelatoBalance1", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getUnderlyingBalances", - outputs: [ - { - internalType: "uint256", - name: "amount0Current", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1Current", - type: "uint256", - }, - ], - stateMutability: "view", - 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: [], - name: "name", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pool", - outputs: [ - { - internalType: "contract IUniswapV3Pool", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, -]; - -export class ArrakisPoolL2__factory { - static readonly abi = _abi; - static createInterface(): ArrakisPoolL2Interface { - return new utils.Interface(_abi) as ArrakisPoolL2Interface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): ArrakisPoolL2 { - return new Contract(address, _abi, signerOrProvider) as ArrakisPoolL2; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/ArrakisPool__factory.ts b/sdk/src/contracts/common/typechain/factories/ArrakisPool__factory.ts deleted file mode 100644 index c81e976..0000000 --- a/sdk/src/contracts/common/typechain/factories/ArrakisPool__factory.ts +++ /dev/null @@ -1,268 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { ArrakisPool, ArrakisPoolInterface } from "../ArrakisPool"; - -const _abi = [ - { - 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: "uint256", - name: "burnAmount", - type: "uint256", - }, - { - internalType: "address", - name: "receiver", - type: "address", - }, - ], - name: "burn", - outputs: [ - { - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - { - internalType: "uint128", - name: "liquidityBurned", - type: "uint128", - }, - ], - 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: [], - name: "gelatoBalance0", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "gelatoBalance1", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getUnderlyingBalances", - outputs: [ - { - internalType: "uint256", - name: "amount0Current", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1Current", - type: "uint256", - }, - ], - stateMutability: "view", - 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: [], - name: "name", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pool", - outputs: [ - { - internalType: "contract IUniswapV3Pool", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, -]; - -export class ArrakisPool__factory { - static readonly abi = _abi; - static createInterface(): ArrakisPoolInterface { - return new utils.Interface(_abi) as ArrakisPoolInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): ArrakisPool { - return new Contract(address, _abi, signerOrProvider) as ArrakisPool; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/LyraStakingModuleProxy__factory.ts b/sdk/src/contracts/common/typechain/factories/LyraStakingModuleProxy__factory.ts deleted file mode 100644 index 8afcad4..0000000 --- a/sdk/src/contracts/common/typechain/factories/LyraStakingModuleProxy__factory.ts +++ /dev/null @@ -1,177 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { - LyraStakingModuleProxy, - LyraStakingModuleProxyInterface, -} from "../LyraStakingModuleProxy"; - -const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "previousAdmin", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newAdmin", - type: "address", - }, - ], - name: "AdminChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "Upgraded", - type: "event", - }, - { - stateMutability: "payable", - type: "fallback", - }, - { - inputs: [], - name: "admin", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newAdmin", - type: "address", - }, - ], - name: "changeAdmin", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "implementation", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_logic", - type: "address", - }, - { - internalType: "address", - name: "_admin", - type: "address", - }, - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_logic", - type: "address", - }, - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - ], - name: "upgradeTo", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", - type: "function", - }, -]; - -export class LyraStakingModuleProxy__factory { - static readonly abi = _abi; - static createInterface(): LyraStakingModuleProxyInterface { - return new utils.Interface(_abi) as LyraStakingModuleProxyInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): LyraStakingModuleProxy { - return new Contract( - address, - _abi, - signerOrProvider - ) as LyraStakingModuleProxy; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/MultiDistributor__factory.ts b/sdk/src/contracts/common/typechain/factories/MultiDistributor__factory.ts index 6a8f7b2..4a0a27c 100644 --- a/sdk/src/contracts/common/typechain/factories/MultiDistributor__factory.ts +++ b/sdk/src/contracts/common/typechain/factories/MultiDistributor__factory.ts @@ -47,6 +47,31 @@ const _abi = [ name: "ClaimAdded", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract IERC20", + name: "rewardToken", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "claimer", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Claimed", + type: "event", + }, { inputs: [ { diff --git a/sdk/src/contracts/common/typechain/factories/OneInchOffChainOracle__factory.ts b/sdk/src/contracts/common/typechain/factories/OneInchOffChainOracle__factory.ts deleted file mode 100644 index 98197ff..0000000 --- a/sdk/src/contracts/common/typechain/factories/OneInchOffChainOracle__factory.ts +++ /dev/null @@ -1,362 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { - OneInchOffChainOracle, - OneInchOffChainOracleInterface, -} from "../OneInchOffChainOracle"; - -const _abi = [ - { - inputs: [ - { - internalType: "contract MultiWrapper", - name: "_multiWrapper", - type: "address", - }, - { - internalType: "contract IOracle[]", - name: "existingOracles", - type: "address[]", - }, - { - internalType: "enum OffchainOracle.OracleType[]", - name: "oracleTypes", - type: "uint8[]", - }, - { - internalType: "contract IERC20[]", - name: "existingConnectors", - type: "address[]", - }, - { - internalType: "contract IERC20", - name: "wBase", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "contract IERC20", - name: "connector", - type: "address", - }, - ], - name: "ConnectorAdded", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "contract IERC20", - name: "connector", - type: "address", - }, - ], - name: "ConnectorRemoved", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "contract MultiWrapper", - name: "multiWrapper", - type: "address", - }, - ], - name: "MultiWrapperUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "contract IOracle", - name: "oracle", - type: "address", - }, - { - indexed: false, - internalType: "enum OffchainOracle.OracleType", - name: "oracleType", - type: "uint8", - }, - ], - name: "OracleAdded", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "contract IOracle", - name: "oracle", - type: "address", - }, - { - indexed: false, - internalType: "enum OffchainOracle.OracleType", - name: "oracleType", - type: "uint8", - }, - ], - name: "OracleRemoved", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - inputs: [ - { - internalType: "contract IERC20", - name: "connector", - type: "address", - }, - ], - name: "addConnector", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IOracle", - name: "oracle", - type: "address", - }, - { - internalType: "enum OffchainOracle.OracleType", - name: "oracleKind", - type: "uint8", - }, - ], - name: "addOracle", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "connectors", - outputs: [ - { - internalType: "contract IERC20[]", - name: "allConnectors", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20", - name: "srcToken", - type: "address", - }, - { - internalType: "contract IERC20", - name: "dstToken", - type: "address", - }, - { - internalType: "bool", - name: "useWrappers", - type: "bool", - }, - ], - name: "getRate", - outputs: [ - { - internalType: "uint256", - name: "weightedRate", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20", - name: "srcToken", - type: "address", - }, - { - internalType: "bool", - name: "useSrcWrappers", - type: "bool", - }, - ], - name: "getRateToEth", - outputs: [ - { - internalType: "uint256", - name: "weightedRate", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "multiWrapper", - outputs: [ - { - internalType: "contract MultiWrapper", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "oracles", - outputs: [ - { - internalType: "contract IOracle[]", - name: "allOracles", - type: "address[]", - }, - { - internalType: "enum OffchainOracle.OracleType[]", - name: "oracleTypes", - type: "uint8[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20", - name: "connector", - type: "address", - }, - ], - name: "removeConnector", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IOracle", - name: "oracle", - type: "address", - }, - { - internalType: "enum OffchainOracle.OracleType", - name: "oracleKind", - type: "uint8", - }, - ], - name: "removeOracle", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract MultiWrapper", - name: "_multiWrapper", - type: "address", - }, - ], - name: "setMultiWrapper", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; - -export class OneInchOffChainOracle__factory { - static readonly abi = _abi; - static createInterface(): OneInchOffChainOracleInterface { - return new utils.Interface(_abi) as OneInchOffChainOracleInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): OneInchOffChainOracle { - return new Contract( - address, - _abi, - signerOrProvider - ) as OneInchOffChainOracle; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/StakingRewards__factory.ts b/sdk/src/contracts/common/typechain/factories/StakingRewards__factory.ts deleted file mode 100644 index 6508795..0000000 --- a/sdk/src/contracts/common/typechain/factories/StakingRewards__factory.ts +++ /dev/null @@ -1,676 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { - StakingRewards, - StakingRewardsInterface, -} from "../StakingRewards"; - -const _abi = [ - { - inputs: [ - { - internalType: "address", - name: "_owner", - type: "address", - }, - { - internalType: "address", - name: "_rewardsDistribution", - type: "address", - }, - { - internalType: "address", - name: "_rewardsToken", - type: "address", - }, - { - internalType: "address", - name: "_stakingToken", - type: "address", - }, - ], - payable: false, - stateMutability: "nonpayable", - type: "constructor", - }, - { - 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: "bool", - name: "isPaused", - type: "bool", - }, - ], - name: "PauseChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Recovered", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "reward", - type: "uint256", - }, - ], - name: "RewardAdded", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "reward", - type: "uint256", - }, - ], - name: "RewardPaid", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "newDuration", - type: "uint256", - }, - ], - name: "RewardsDurationUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Staked", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Withdrawn", - type: "event", - }, - { - constant: false, - inputs: [], - name: "acceptOwnership", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "earned", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [], - name: "exit", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [], - name: "getReward", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "getRewardForDuration", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "lastPauseTime", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "lastTimeRewardApplicable", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "lastUpdateTime", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "address", - name: "_owner", - type: "address", - }, - ], - name: "nominateNewOwner", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "nominatedOwner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "reward", - type: "uint256", - }, - ], - name: "notifyRewardAmount", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "paused", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "periodFinish", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "address", - name: "tokenAddress", - type: "address", - }, - { - internalType: "uint256", - name: "tokenAmount", - type: "uint256", - }, - ], - name: "recoverERC20", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardPerToken", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardPerTokenStored", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardRate", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "rewards", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardsDistribution", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardsDuration", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardsToken", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "bool", - name: "_paused", - type: "bool", - }, - ], - name: "setPaused", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "address", - name: "_rewardsDistribution", - type: "address", - }, - ], - name: "setRewardsDistribution", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "_rewardsDuration", - type: "uint256", - }, - ], - name: "setRewardsDuration", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "stake", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "stakingToken", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "userRewardPerTokenPaid", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "withdraw", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, -]; - -export class StakingRewards__factory { - static readonly abi = _abi; - static createInterface(): StakingRewardsInterface { - return new utils.Interface(_abi) as StakingRewardsInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): StakingRewards { - return new Contract(address, _abi, signerOrProvider) as StakingRewards; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/TokenMigrator__factory.ts b/sdk/src/contracts/common/typechain/factories/TokenMigrator__factory.ts deleted file mode 100644 index 78c1a33..0000000 --- a/sdk/src/contracts/common/typechain/factories/TokenMigrator__factory.ts +++ /dev/null @@ -1,153 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { TokenMigrator, TokenMigratorInterface } from "../TokenMigrator"; - -const _abi = [ - { - inputs: [ - { - internalType: "contract IERC20", - name: "_fromToken", - type: "address", - }, - { - internalType: "contract IERC20", - name: "_toToken", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - inputs: [], - name: "fromToken", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "swap", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "toToken", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "fromTokenAmt", - type: "uint256", - }, - { - internalType: "uint256", - name: "toTokenAmt", - type: "uint256", - }, - ], - name: "withdraw", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; - -export class TokenMigrator__factory { - static readonly abi = _abi; - static createInterface(): TokenMigratorInterface { - return new utils.Interface(_abi) as TokenMigratorInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): TokenMigrator { - return new Contract(address, _abi, signerOrProvider) as TokenMigrator; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/WethLyraStakingRewards__factory.ts b/sdk/src/contracts/common/typechain/factories/WethLyraStakingRewards__factory.ts deleted file mode 100644 index 785e06c..0000000 --- a/sdk/src/contracts/common/typechain/factories/WethLyraStakingRewards__factory.ts +++ /dev/null @@ -1,680 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { - WethLyraStakingRewards, - WethLyraStakingRewardsInterface, -} from "../WethLyraStakingRewards"; - -const _abi = [ - { - inputs: [ - { - internalType: "address", - name: "_owner", - type: "address", - }, - { - internalType: "address", - name: "_rewardsDistribution", - type: "address", - }, - { - internalType: "address", - name: "_rewardsToken", - type: "address", - }, - { - internalType: "address", - name: "_stakingToken", - type: "address", - }, - ], - payable: false, - stateMutability: "nonpayable", - type: "constructor", - }, - { - 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: "bool", - name: "isPaused", - type: "bool", - }, - ], - name: "PauseChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Recovered", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "reward", - type: "uint256", - }, - ], - name: "RewardAdded", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "reward", - type: "uint256", - }, - ], - name: "RewardPaid", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "newDuration", - type: "uint256", - }, - ], - name: "RewardsDurationUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Staked", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Withdrawn", - type: "event", - }, - { - constant: false, - inputs: [], - name: "acceptOwnership", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "earned", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [], - name: "exit", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [], - name: "getReward", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "getRewardForDuration", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "lastPauseTime", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "lastTimeRewardApplicable", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "lastUpdateTime", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "address", - name: "_owner", - type: "address", - }, - ], - name: "nominateNewOwner", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "nominatedOwner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "reward", - type: "uint256", - }, - ], - name: "notifyRewardAmount", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "paused", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "periodFinish", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "address", - name: "tokenAddress", - type: "address", - }, - { - internalType: "uint256", - name: "tokenAmount", - type: "uint256", - }, - ], - name: "recoverERC20", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardPerToken", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardPerTokenStored", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardRate", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "rewards", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardsDistribution", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardsDuration", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "rewardsToken", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "bool", - name: "_paused", - type: "bool", - }, - ], - name: "setPaused", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "address", - name: "_rewardsDistribution", - type: "address", - }, - ], - name: "setRewardsDistribution", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "_rewardsDuration", - type: "uint256", - }, - ], - name: "setRewardsDuration", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "stake", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "stakingToken", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "userRewardPerTokenPaid", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "withdraw", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, -]; - -export class WethLyraStakingRewards__factory { - static readonly abi = _abi; - static createInterface(): WethLyraStakingRewardsInterface { - return new utils.Interface(_abi) as WethLyraStakingRewardsInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): WethLyraStakingRewards { - return new Contract( - address, - _abi, - signerOrProvider - ) as WethLyraStakingRewards; - } -} diff --git a/sdk/src/contracts/common/typechain/factories/index.ts b/sdk/src/contracts/common/typechain/factories/index.ts index b998a97..82b247f 100644 --- a/sdk/src/contracts/common/typechain/factories/index.ts +++ b/sdk/src/contracts/common/typechain/factories/index.ts @@ -1,13 +1,6 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -export { ArrakisPoolL1__factory } from "./ArrakisPoolL1__factory"; -export { ArrakisPoolL2__factory } from "./ArrakisPoolL2__factory"; export { ERC20__factory } from "./ERC20__factory"; -export { LyraStakingModule__factory } from "./LyraStakingModule__factory"; -export { LyraStakingModuleProxy__factory } from "./LyraStakingModuleProxy__factory"; export { MultiDistributor__factory } from "./MultiDistributor__factory"; export { Multicall3__factory } from "./Multicall3__factory"; -export { OneInchOffChainOracle__factory } from "./OneInchOffChainOracle__factory"; -export { TokenMigrator__factory } from "./TokenMigrator__factory"; -export { WethLyraStakingRewards__factory } from "./WethLyraStakingRewards__factory"; diff --git a/sdk/src/contracts/common/typechain/index.ts b/sdk/src/contracts/common/typechain/index.ts index f7d593f..2c1b237 100644 --- a/sdk/src/contracts/common/typechain/index.ts +++ b/sdk/src/contracts/common/typechain/index.ts @@ -1,24 +1,10 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -export type { ArrakisPoolL1 } from "./ArrakisPoolL1"; -export type { ArrakisPoolL2 } from "./ArrakisPoolL2"; export type { ERC20 } from "./ERC20"; -export type { LyraStakingModule } from "./LyraStakingModule"; -export type { LyraStakingModuleProxy } from "./LyraStakingModuleProxy"; export type { MultiDistributor } from "./MultiDistributor"; export type { Multicall3 } from "./Multicall3"; -export type { OneInchOffChainOracle } from "./OneInchOffChainOracle"; -export type { TokenMigrator } from "./TokenMigrator"; -export type { WethLyraStakingRewards } from "./WethLyraStakingRewards"; export * as factories from "./factories"; -export { ArrakisPoolL1__factory } from "./factories/ArrakisPoolL1__factory"; -export { ArrakisPoolL2__factory } from "./factories/ArrakisPoolL2__factory"; export { ERC20__factory } from "./factories/ERC20__factory"; -export { LyraStakingModule__factory } from "./factories/LyraStakingModule__factory"; -export { LyraStakingModuleProxy__factory } from "./factories/LyraStakingModuleProxy__factory"; export { Multicall3__factory } from "./factories/Multicall3__factory"; export { MultiDistributor__factory } from "./factories/MultiDistributor__factory"; -export { OneInchOffChainOracle__factory } from "./factories/OneInchOffChainOracle__factory"; -export { TokenMigrator__factory } from "./factories/TokenMigrator__factory"; -export { WethLyraStakingRewards__factory } from "./factories/WethLyraStakingRewards__factory"; diff --git a/sdk/src/contracts/newport/abis/NewportLiquidityPool.json b/sdk/src/contracts/newport/abis/NewportLiquidityPool.json index d8a8440..d78ea93 100644 --- a/sdk/src/contracts/newport/abis/NewportLiquidityPool.json +++ b/sdk/src/contracts/newport/abis/NewportLiquidityPool.json @@ -1,55 +1,143 @@ [ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "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": "approvee", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "approvee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "BaseApprovalFailure", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "realAmount", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "realAmount", + "type": "uint256" + } ], "name": "BaseTransferFailed", "type": "error" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "CannotRecoverQuoteBase", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "beneficiary", "type": "address" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } ], "name": "InvalidBeneficiaryAddress", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, { "components": [ - { "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": "uint256", "name": "boardSettlementCBTimeout", "type": "uint256" }, - { "internalType": "uint256", "name": "contractAdjustmentCBTimeout", "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": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "contractAdjustmentCBTimeout", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.CircuitBreakerParameters", "name": "cbParams", @@ -61,18 +149,58 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, + { + "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": "address", "name": "guardianMultisig", "type": "address" }, - { "internalType": "uint256", "name": "guardianDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "adjustmentNetScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "callCollatScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "putCollatScalingFactor", "type": "uint256" } + { + "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": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustmentNetScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callCollatScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "putCollatScalingFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.LiquidityPoolParameters", "name": "lpParams", @@ -84,13 +212,33 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "quoteToLock", "type": "uint256" }, - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, + { + "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": "uint256", + "name": "quote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "base", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Collateral", "name": "lockedCollateral", @@ -102,43 +250,111 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "amountQuote", "type": "uint256" }, - { "internalType": "uint256", "name": "minDeposit", "type": "uint256" } + { + "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": "amountQuote", "type": "uint256" }, - { "internalType": "uint256", "name": "minWithdraw", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minWithdraw", + "type": "uint256" + } ], "name": "MinimumWithdrawNotMet", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "int256", "name": "totalAssetValue", "type": "int256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "int256", + "name": "totalAssetValue", + "type": "int256" + } ], "name": "NegativeTotalAssetValue", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "amountQuote", "type": "uint256" }, + { + "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": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -150,92 +366,225 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "caller", "type": "address" }, - { "internalType": "address", "name": "nominatedOwner", "type": "address" } + { + "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" } + { + "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" } + { + "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" } + { + "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" } + { + "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" } + { + "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": "approvee", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "approvee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "QuoteApprovalFailure", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "realAmount", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "realAmount", + "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" } + { + "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" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "amountOptions", "type": "uint256" }, - { "internalType": "bool", "name": "increasesDelta", "type": "bool" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOptions", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "increasesDelta", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } ], "name": "UnableToHedgeDelta", "type": "error" @@ -243,8 +592,18 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "quoteSpent", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "baseReceived", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "quoteSpent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseReceived", + "type": "uint256" + } ], "name": "BasePurchased", "type": "event" @@ -252,8 +611,18 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "amountBase", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "quoteReceived", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteReceived", + "type": "uint256" + } ], "name": "BaseSold", "type": "event" @@ -261,24 +630,56 @@ { "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" } + { + "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" }], + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newTimestamp", + "type": "uint256" + } + ], "name": "BoardSettlementCircuitBreakerUpdated", "type": "event" }, { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "baseFreed", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lockedCollateralBase", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "baseFreed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralBase", + "type": "uint256" + } ], "name": "CallCollateralFreed", "type": "event" @@ -286,8 +687,18 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "baseLocked", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lockedCollateralBase", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "baseLocked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralBase", + "type": "uint256" + } ], "name": "CallCollateralLocked", "type": "event" @@ -295,11 +706,36 @@ { "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" } + { + "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" @@ -309,14 +745,46 @@ "inputs": [ { "components": [ - { "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": "uint256", "name": "boardSettlementCBTimeout", "type": "uint256" }, - { "internalType": "uint256", "name": "contractAdjustmentCBTimeout", "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": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "contractAdjustmentCBTimeout", + "type": "uint256" + } ], "indexed": false, "internalType": "struct LiquidityPool.CircuitBreakerParameters", @@ -330,11 +798,36 @@ { "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" }, - { "indexed": false, "internalType": "bool", "name": "contractAdjustmentEvent", "type": "bool" } + { + "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" + }, + { + "indexed": false, + "internalType": "bool", + "name": "contractAdjustmentEvent", + "type": "bool" + } ], "name": "CircuitBreakerUpdated", "type": "event" @@ -342,13 +835,48 @@ { "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" } + { + "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" @@ -356,12 +884,42 @@ { "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" } + { + "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" @@ -369,8 +927,18 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "amountQuoteAdded", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "totalInsolventSettlementAmount", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "amountQuoteAdded", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalInsolventSettlementAmount", + "type": "uint256" + } ], "name": "InsolventSettlementAmountUpdated", "type": "event" @@ -380,15 +948,51 @@ "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": "address", "name": "guardianMultisig", "type": "address" }, - { "internalType": "uint256", "name": "guardianDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "adjustmentNetScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "callCollatScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "putCollatScalingFactor", "type": "uint256" } + { + "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": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustmentNetScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callCollatScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "putCollatScalingFactor", + "type": "uint256" + } ], "indexed": false, "internalType": "struct LiquidityPool.LiquidityPoolParameters", @@ -402,9 +1006,24 @@ { "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" } + { + "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" @@ -412,30 +1031,69 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + { + "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" }], + "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" }], + "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" } + { + "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" @@ -443,8 +1101,18 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "quoteFreed", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lockedCollateralQuote", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "quoteFreed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralQuote", + "type": "uint256" + } ], "name": "PutCollateralFreed", "type": "event" @@ -452,29 +1120,86 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "quoteLocked", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lockedCollateralQuote", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "quoteLocked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCollateralQuote", + "type": "uint256" + } ], "name": "PutCollateralLocked", "type": "event" }, { "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "amountQuote", "type": "uint256" }], + "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" } + { + "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" @@ -482,14 +1207,54 @@ { "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" } + { + "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" @@ -497,12 +1262,42 @@ { "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" } + { + "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" @@ -510,13 +1305,48 @@ { "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": "tokenPrice", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "totalQueuedWithdrawals", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "tokensReturned", "type": "uint256" } + { + "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": "tokenPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalQueuedWithdrawals", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReturned", + "type": "uint256" + } ], "name": "WithdrawReverted", "type": "event" @@ -524,20 +1354,54 @@ { "inputs": [], "name": "CBTimestamp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "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" } + { + "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": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -545,26 +1409,84 @@ "inputs": [], "name": "cbParams", "outputs": [ - { "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": "uint256", "name": "boardSettlementCBTimeout", "type": "uint256" }, - { "internalType": "uint256", "name": "contractAdjustmentCBTimeout", "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": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "contractAdjustmentCBTimeout", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "exchangeBase", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "exchangeBase", + "outputs": [], + "stateMutability": "nonpayable", + "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" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "name": "freeCallCollateralAndSendPremium", "outputs": [], @@ -573,11 +1495,31 @@ }, { "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" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "amountQuoteFreed", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalCost", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "name": "freePutCollateralAndSendPremium", "outputs": [], @@ -590,14 +1532,46 @@ "outputs": [ { "components": [ - { "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": "uint256", "name": "boardSettlementCBTimeout", "type": "uint256" }, - { "internalType": "uint256", "name": "contractAdjustmentCBTimeout", "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": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "contractAdjustmentCBTimeout", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.CircuitBreakerParameters", "name": "", @@ -613,13 +1587,41 @@ "outputs": [ { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "", @@ -635,15 +1637,51 @@ "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": "address", "name": "guardianMultisig", "type": "address" }, - { "internalType": "uint256", "name": "guardianDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "adjustmentNetScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "callCollatScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "putCollatScalingFactor", "type": "uint256" } + { + "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": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustmentNetScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callCollatScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "putCollatScalingFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.LiquidityPoolParameters", "name": "", @@ -656,7 +1694,13 @@ { "inputs": [], "name": "getTokenPrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, @@ -664,9 +1708,21 @@ "inputs": [], "name": "getTokenPriceWithCheck", "outputs": [ - { "internalType": "uint256", "name": "tokenPrice", "type": "uint256" }, - { "internalType": "bool", "name": "isStale", "type": "bool" }, - { "internalType": "uint256", "name": "circuitBreakerExpiry", "type": "uint256" } + { + "internalType": "uint256", + "name": "tokenPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isStale", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "circuitBreakerExpiry", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" @@ -674,27 +1730,71 @@ { "inputs": [], "name": "getTotalPoolValueQuote", - "outputs": [{ "internalType": "uint256", "name": "totalPoolValue", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "totalPoolValue", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getTotalTokenSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "contract BaseExchangeAdapter", "name": "_exchangeAdapter", "type": "address" }, - { "internalType": "contract OptionMarket", "name": "_optionMarket", "type": "address" }, - { "internalType": "contract LiquidityToken", "name": "_liquidityToken", "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 IERC20Decimals", "name": "_quoteAsset", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "_baseAsset", "type": "address" } + { + "internalType": "contract BaseExchangeAdapter", + "name": "_exchangeAdapter", + "type": "address" + }, + { + "internalType": "contract OptionMarket", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract LiquidityToken", + "name": "_liquidityToken", + "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 IERC20Decimals", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "_baseAsset", + "type": "address" + } ], "name": "init", "outputs": [], @@ -703,8 +1803,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "beneficiary", "type": "address" }, - { "internalType": "uint256", "name": "amountQuote", "type": "uint256" } + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } ], "name": "initiateDeposit", "outputs": [], @@ -713,8 +1821,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "beneficiary", "type": "address" }, - { "internalType": "uint256", "name": "amountLiquidityToken", "type": "uint256" } + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountLiquidityToken", + "type": "uint256" + } ], "name": "initiateWithdraw", "outputs": [], @@ -724,22 +1840,51 @@ { "inputs": [], "name": "insolventSettlementAmount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "liquidationInsolventAmount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } ], "name": "lockCallCollateral", "outputs": [], @@ -748,8 +1893,21 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } ], "name": "lockPutCollateral", "outputs": [], @@ -760,8 +1918,16 @@ "inputs": [], "name": "lockedCollateral", "outputs": [ - { "internalType": "uint256", "name": "quote", "type": "uint256" }, - { "internalType": "uint256", "name": "base", "type": "uint256" } + { + "internalType": "uint256", + "name": "quote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "base", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" @@ -770,15 +1936,51 @@ "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": "address", "name": "guardianMultisig", "type": "address" }, - { "internalType": "uint256", "name": "guardianDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "adjustmentNetScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "callCollatScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "putCollatScalingFactor", "type": "uint256" } + { + "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": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustmentNetScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callCollatScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "putCollatScalingFactor", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" @@ -786,19 +1988,37 @@ { "inputs": [], "name": "nextQueuedDepositId", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "nextQueuedWithdrawalId", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], "name": "nominateNewOwner", "outputs": [], "stateMutability": "nonpayable", @@ -807,33 +2027,63 @@ { "inputs": [], "name": "nominatedOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "poolHedger", - "outputs": [{ "internalType": "contract PoolHedger", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract PoolHedger", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "limit", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], "name": "processDepositQueue", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "limit", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], "name": "processWithdrawalQueue", "outputs": [], "stateMutability": "nonpayable", @@ -842,26 +2092,64 @@ { "inputs": [], "name": "protectedQuote", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "queuedDepositHead", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "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" } + { + "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" @@ -869,19 +2157,51 @@ { "inputs": [], "name": "queuedWithdrawalHead", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "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" } + { + "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" @@ -889,19 +2209,37 @@ { "inputs": [], "name": "quoteAsset", - "outputs": [{ "internalType": "contract IERC20Decimals", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "amountBase", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + } + ], "name": "reclaimInsolventBase", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "amountQuote", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } + ], "name": "reclaimInsolventQuote", "outputs": [], "stateMutability": "nonpayable", @@ -909,8 +2247,16 @@ }, { "inputs": [ - { "internalType": "contract IERC20Decimals", "name": "token", "type": "address" }, - { "internalType": "address", "name": "recipient", "type": "address" } + { + "internalType": "contract IERC20Decimals", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } ], "name": "recoverFunds", "outputs": [], @@ -919,8 +2265,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "user", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "sendSettlementValue", "outputs": [], @@ -929,12 +2283,41 @@ }, { "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amountContracts", "type": "uint256" }, - { "internalType": "uint256", "name": "premium", "type": "uint256" }, - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedFee", "type": "uint256" }, - { "internalType": "bool", "name": "isCall", "type": "bool" } + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountContracts", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedFee", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isCall", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } ], "name": "sendShortPremium", "outputs": [], @@ -945,14 +2328,46 @@ "inputs": [ { "components": [ - { "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": "uint256", "name": "boardSettlementCBTimeout", "type": "uint256" }, - { "internalType": "uint256", "name": "contractAdjustmentCBTimeout", "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": "uint256", + "name": "boardSettlementCBTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "contractAdjustmentCBTimeout", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.CircuitBreakerParameters", "name": "_cbParams", @@ -968,15 +2383,51 @@ "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": "address", "name": "guardianMultisig", "type": "address" }, - { "internalType": "uint256", "name": "guardianDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "adjustmentNetScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "callCollatScalingFactor", "type": "uint256" }, - { "internalType": "uint256", "name": "putCollatScalingFactor", "type": "uint256" } + { + "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": "address", + "name": "guardianMultisig", + "type": "address" + }, + { + "internalType": "uint256", + "name": "guardianDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustmentNetScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callCollatScalingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "putCollatScalingFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.LiquidityPoolParameters", "name": "_lpParams", @@ -989,7 +2440,13 @@ "type": "function" }, { - "inputs": [{ "internalType": "contract PoolHedger", "name": "newPoolHedger", "type": "address" }], + "inputs": [ + { + "internalType": "contract PoolHedger", + "name": "newPoolHedger", + "type": "address" + } + ], "name": "setPoolHedger", "outputs": [], "stateMutability": "nonpayable", @@ -998,34 +2455,76 @@ { "inputs": [], "name": "totalOutstandingSettlements", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalQueuedDeposits", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalQueuedWithdrawals", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], "name": "transferQuoteToHedge", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "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" }], + "inputs": [], + "name": "updateCBs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "insolvencyAmountInQuote", + "type": "uint256" + } + ], "name": "updateLiquidationInsolvency", "outputs": [], "stateMutability": "nonpayable", diff --git a/sdk/src/contracts/newport/abis/NewportLiquidityToken.json b/sdk/src/contracts/newport/abis/NewportLiquidityToken.json index 6499916..e0d316b 100644 --- a/sdk/src/contracts/newport/abis/NewportLiquidityToken.json +++ b/sdk/src/contracts/newport/abis/NewportLiquidityToken.json @@ -1,40 +1,90 @@ [ { "inputs": [ - { "internalType": "string", "name": "name_", "type": "string" }, - { "internalType": "string", "name": "symbol_", "type": "string" } + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } ], "stateMutability": "nonpayable", "type": "constructor" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "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" } + { + "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" } + { + "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" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } ], "name": "OnlyOwner", "type": "error" @@ -42,9 +92,24 @@ { "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" } + { + "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" @@ -52,7 +117,12 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "contract ILiquidityTracker", "name": "liquidityTracker", "type": "address" } + { + "indexed": false, + "internalType": "contract ILiquidityTracker", + "name": "liquidityTracker", + "type": "address" + } ], "name": "LiquidityTrackerSet", "type": "event" @@ -60,60 +130,146 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + { + "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" }], + "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" } + { + "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": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } ], "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" } + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } ], "name": "burn", "outputs": [], @@ -123,32 +279,72 @@ { "inputs": [], "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } ], "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } ], "name": "increaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "_liquidityPool", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "_liquidityPool", + "type": "address" + } + ], "name": "init", "outputs": [], "stateMutability": "nonpayable", @@ -157,21 +353,41 @@ { "inputs": [], "name": "liquidityPool", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "liquidityTracker", - "outputs": [{ "internalType": "contract ILiquidityTracker", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract ILiquidityTracker", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" } + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } ], "name": "mint", "outputs": [], @@ -181,12 +397,24 @@ { "inputs": [], "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], "name": "nominateNewOwner", "outputs": [], "stateMutability": "nonpayable", @@ -195,19 +423,37 @@ { "inputs": [], "name": "nominatedOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "contract ILiquidityTracker", "name": "_liquidityTracker", "type": "address" }], + "inputs": [ + { + "internalType": "contract ILiquidityTracker", + "name": "_liquidityTracker", + "type": "address" + } + ], "name": "setLiquidityTracker", "outputs": [], "stateMutability": "nonpayable", @@ -216,36 +462,80 @@ { "inputs": [], "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "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" } + { + "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" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" } -] +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/abis/NewportOptionMarket.json b/sdk/src/contracts/newport/abis/NewportOptionMarket.json deleted file mode 100644 index 0f3eef4..0000000 --- a/sdk/src/contracts/newport/abis/NewportOptionMarket.json +++ /dev/null @@ -1,854 +0,0 @@ -[ - { "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" }], - "name": "CannotRecoverQuote", - "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": "uint256", "name": "staticBaseSettlementFee", "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" }, - { "indexed": false, "internalType": "uint256", "name": "longScaleFactor", "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" }, - { "internalType": "uint256", "name": "staticBaseSettlementFee", "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" } - ], - "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": "positionId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "referrer", "type": "address" }, - { - "components": [ - { "internalType": "uint256", "name": "strikeId", "type": "uint256" }, - { "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": "longScaleFactor", "type": "uint256" }, - { "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": [], - "name": "baseAsset", - "outputs": [{ "internalType": "contract IERC20Decimals", "name": "", "type": "address" }], - "stateMutability": "view", - "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": "address", "name": "referrer", "type": "address" } - ], - "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": "boardId", "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": "address", "name": "referrer", "type": "address" } - ], - "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" }, - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "boardId", "type": "uint256" }], - "name": "getBoardStrikes", - "outputs": [{ "internalType": "uint256[]", "name": "strikeIds", "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": [], - "name": "getOptionMarketParams", - "outputs": [ - { - "components": [ - { "internalType": "uint256", "name": "maxBoardExpiry", "type": "uint256" }, - { "internalType": "address", "name": "securityModule", "type": "address" }, - { "internalType": "uint256", "name": "feePortionReserved", "type": "uint256" }, - { "internalType": "uint256", "name": "staticBaseSettlementFee", "type": "uint256" } - ], - "internalType": "struct OptionMarket.OptionMarketParameters", - "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" }, - { "internalType": "uint256", "name": "longScaleFactor", "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 BaseExchangeAdapter", "name": "_exchangeAdapter", "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 IERC20Decimals", "name": "_quoteAsset", "type": "address" }, - { "internalType": "contract IERC20Decimals", "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": "address", "name": "referrer", "type": "address" } - ], - "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": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "quoteAsset", - "outputs": [{ "internalType": "contract IERC20Decimals", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "contract IERC20Decimals", "name": "token", "type": "address" }, - { "internalType": "address", "name": "recipient", "type": "address" } - ], - "name": "recoverFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "scaledLongsForBoard", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "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": "uint256", "name": "staticBaseSettlementFee", "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" } -] diff --git a/sdk/src/contracts/newport/abis/NewportOptionMarketPricer.json b/sdk/src/contracts/newport/abis/NewportOptionMarketPricer.json index 4491186..8873ec9 100644 --- a/sdk/src/contracts/newport/abis/NewportOptionMarketPricer.json +++ b/sdk/src/contracts/newport/abis/NewportOptionMarketPricer.json @@ -1,45 +1,131 @@ [ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "AlreadyInitialised", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "int256", "name": "strikeCallDelta", "type": "int256" }, - { "internalType": "int256", "name": "minDelta", "type": "int256" }, - { "internalType": "int256", "name": "maxDelta", "type": "int256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "int256", + "name": "strikeCallDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "maxDelta", + "type": "int256" + } ], "name": "ForceCloseDeltaOutOfRange", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "bool", "name": "isBuy", "type": "bool" }, - { "internalType": "uint256", "name": "newSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "maxSkew", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuy", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "newSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSkew", + "type": "uint256" + } ], "name": "ForceCloseSkewOutOfRange", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, { "components": [ - { "internalType": "uint256", "name": "optionPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "standardSize", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "standardSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentFactor", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.PricingParameters", "name": "pricingParams", @@ -51,21 +137,73 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, { "components": [ - { "internalType": "int256", "name": "minDelta", "type": "int256" }, - { "internalType": "int256", "name": "minForceCloseDelta", "type": "int256" }, - { "internalType": "uint256", "name": "tradingCutoff", "type": "uint256" }, - { "internalType": "uint256", "name": "minBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "maxBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "minSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "maxSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minVol", "type": "uint256" }, - { "internalType": "uint256", "name": "maxVol", "type": "uint256" }, - { "internalType": "uint256", "name": "absMinSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "absMaxSkew", "type": "uint256" }, - { "internalType": "bool", "name": "capSkewsToAbs", "type": "bool" } + { + "internalType": "int256", + "name": "minDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minForceCloseDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "tradingCutoff", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMinSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMaxSkew", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "capSkewsToAbs", + "type": "bool" + } ], "internalType": "struct OptionMarketPricer.TradeLimitParameters", "name": "tradeLimitParams", @@ -77,60 +215,148 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "caller", "type": "address" }, - { "internalType": "address", "name": "nominatedOwner", "type": "address" } + { + "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" } + { + "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" } + { + "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": "int256", "name": "strikeCallDelta", "type": "int256" }, - { "internalType": "int256", "name": "minDelta", "type": "int256" }, - { "internalType": "int256", "name": "maxDelta", "type": "int256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "int256", + "name": "strikeCallDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "maxDelta", + "type": "int256" + } ], "name": "TradeDeltaOutOfRange", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "tradingCutoff", "type": "uint256" }, - { "internalType": "uint256", "name": "boardExpiry", "type": "uint256" }, - { "internalType": "uint256", "name": "currentTime", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tradingCutoff", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardExpiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentTime", + "type": "uint256" + } ], "name": "TradingCutoffReached", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "bool", "name": "isBuy", "type": "bool" }, + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuy", + "type": "bool" + }, { "components": [ - { "internalType": "uint256", "name": "vol", "type": "uint256" }, - { "internalType": "uint256", "name": "baseIv", "type": "uint256" }, - { "internalType": "uint256", "name": "skew", "type": "uint256" } + { + "internalType": "uint256", + "name": "vol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.VolComponents", "name": "currentVol", @@ -138,9 +364,21 @@ }, { "components": [ - { "internalType": "uint256", "name": "vol", "type": "uint256" }, - { "internalType": "uint256", "name": "baseIv", "type": "uint256" }, - { "internalType": "uint256", "name": "skew", "type": "uint256" } + { + "internalType": "uint256", + "name": "vol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.VolComponents", "name": "newVol", @@ -148,9 +386,21 @@ }, { "components": [ - { "internalType": "uint256", "name": "vol", "type": "uint256" }, - { "internalType": "uint256", "name": "baseIv", "type": "uint256" }, - { "internalType": "uint256", "name": "skew", "type": "uint256" } + { + "internalType": "uint256", + "name": "vol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.VolComponents", "name": "tradeBounds", @@ -163,15 +413,32 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + { + "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" }], + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], "name": "OwnerNominated", "type": "event" }, @@ -180,15 +447,51 @@ "inputs": [ { "components": [ - { "internalType": "uint256", "name": "optionPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "standardSize", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "standardSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentFactor", + "type": "uint256" + } ], "indexed": false, "internalType": "struct OptionMarketPricer.PricingParameters", @@ -204,18 +507,66 @@ "inputs": [ { "components": [ - { "internalType": "int256", "name": "minDelta", "type": "int256" }, - { "internalType": "int256", "name": "minForceCloseDelta", "type": "int256" }, - { "internalType": "uint256", "name": "tradingCutoff", "type": "uint256" }, - { "internalType": "uint256", "name": "minBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "maxBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "minSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "maxSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minVol", "type": "uint256" }, - { "internalType": "uint256", "name": "maxVol", "type": "uint256" }, - { "internalType": "uint256", "name": "absMinSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "absMaxSkew", "type": "uint256" }, - { "internalType": "bool", "name": "capSkewsToAbs", "type": "bool" } + { + "internalType": "int256", + "name": "minDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minForceCloseDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "tradingCutoff", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMinSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMaxSkew", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "capSkewsToAbs", + "type": "bool" + } ], "indexed": false, "internalType": "struct OptionMarketPricer.TradeLimitParameters", @@ -231,15 +582,51 @@ "inputs": [ { "components": [ - { "internalType": "uint256", "name": "defaultVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "forceCloseVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "referenceSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticSkewAdjustment", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticVega", "type": "uint256" }, - { "internalType": "uint256", "name": "ivVarianceCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticIvVariance", "type": "uint256" } + { + "internalType": "uint256", + "name": "defaultVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forceCloseVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "referenceSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticSkewAdjustment", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticVega", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticIvVariance", + "type": "uint256" + } ], "indexed": false, "internalType": "struct OptionMarketPricer.VarianceFeeParameters", @@ -250,22 +637,64 @@ "name": "VarianceFeeParametersSet", "type": "event" }, - { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "getPricingParams", "outputs": [ { "components": [ - { "internalType": "uint256", "name": "optionPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "standardSize", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "standardSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentFactor", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.PricingParameters", "name": "pricingParameters", @@ -277,13 +706,35 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "expiry", "type": "uint256" }, - { "internalType": "uint256", "name": "pointA", "type": "uint256" }, - { "internalType": "uint256", "name": "pointB", "type": "uint256" }, - { "internalType": "uint256", "name": "coefficient", "type": "uint256" } + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pointA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pointB", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "coefficient", + "type": "uint256" + } ], "name": "getTimeWeightedFee", - "outputs": [{ "internalType": "uint256", "name": "timeWeightedFee", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "timeWeightedFee", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, @@ -293,18 +744,66 @@ "outputs": [ { "components": [ - { "internalType": "int256", "name": "minDelta", "type": "int256" }, - { "internalType": "int256", "name": "minForceCloseDelta", "type": "int256" }, - { "internalType": "uint256", "name": "tradingCutoff", "type": "uint256" }, - { "internalType": "uint256", "name": "minBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "maxBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "minSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "maxSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minVol", "type": "uint256" }, - { "internalType": "uint256", "name": "maxVol", "type": "uint256" }, - { "internalType": "uint256", "name": "absMinSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "absMaxSkew", "type": "uint256" }, - { "internalType": "bool", "name": "capSkewsToAbs", "type": "bool" } + { + "internalType": "int256", + "name": "minDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minForceCloseDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "tradingCutoff", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMinSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMaxSkew", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "capSkewsToAbs", + "type": "bool" + } ], "internalType": "struct OptionMarketPricer.TradeLimitParameters", "name": "tradeLimitParameters", @@ -318,23 +817,83 @@ "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" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, + { + "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" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -347,37 +906,113 @@ }, { "components": [ - { "internalType": "uint256", "name": "optionPrice", "type": "uint256" }, - { "internalType": "int256", "name": "preTradeAmmNetStdVega", "type": "int256" }, - { "internalType": "int256", "name": "postTradeAmmNetStdVega", "type": "int256" }, - { "internalType": "int256", "name": "callDelta", "type": "int256" }, - { "internalType": "uint256", "name": "volTraded", "type": "uint256" }, - { "internalType": "uint256", "name": "ivVariance", "type": "uint256" }, - { "internalType": "uint256", "name": "vega", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPrice", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "preTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "int256", + "name": "postTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "int256", + "name": "callDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "volTraded", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVariance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vega", + "type": "uint256" + } ], "internalType": "struct OptionGreekCache.TradePricing", "name": "pricing", "type": "tuple" }, - { "internalType": "uint256", "name": "newBaseIv", "type": "uint256" }, - { "internalType": "uint256", "name": "newSkew", "type": "uint256" } + { + "internalType": "uint256", + "name": "newBaseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newSkew", + "type": "uint256" + } ], "name": "getTradeResult", "outputs": [ { "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" }, + { + "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": "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", @@ -385,24 +1020,76 @@ }, { "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": "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" } + { + "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" + } ], "internalType": "struct OptionMarketPricer.TradeResult", "name": "tradeResult", @@ -416,23 +1103,83 @@ "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" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, + { + "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" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -445,32 +1192,96 @@ }, { "components": [ - { "internalType": "uint256", "name": "optionPrice", "type": "uint256" }, - { "internalType": "int256", "name": "preTradeAmmNetStdVega", "type": "int256" }, - { "internalType": "int256", "name": "postTradeAmmNetStdVega", "type": "int256" }, - { "internalType": "int256", "name": "callDelta", "type": "int256" }, - { "internalType": "uint256", "name": "volTraded", "type": "uint256" }, - { "internalType": "uint256", "name": "ivVariance", "type": "uint256" }, - { "internalType": "uint256", "name": "vega", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPrice", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "preTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "int256", + "name": "postTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "int256", + "name": "callDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "volTraded", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVariance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vega", + "type": "uint256" + } ], "internalType": "struct OptionGreekCache.TradePricing", "name": "pricing", "type": "tuple" }, - { "internalType": "uint256", "name": "skew", "type": "uint256" } + { + "internalType": "uint256", + "name": "skew", + "type": "uint256" + } ], "name": "getVarianceFee", "outputs": [ { "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": "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": "varianceFeeComponents", @@ -486,15 +1297,51 @@ "outputs": [ { "components": [ - { "internalType": "uint256", "name": "defaultVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "forceCloseVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "referenceSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticSkewAdjustment", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticVega", "type": "uint256" }, - { "internalType": "uint256", "name": "ivVarianceCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticIvVariance", "type": "uint256" } + { + "internalType": "uint256", + "name": "defaultVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forceCloseVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "referenceSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticSkewAdjustment", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticVega", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticIvVariance", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.VarianceFeeParameters", "name": "varianceFeeParameters", @@ -508,23 +1355,83 @@ "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" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, + { + "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" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -537,13 +1444,41 @@ }, { "components": [ - { "internalType": "uint256", "name": "optionPrice", "type": "uint256" }, - { "internalType": "int256", "name": "preTradeAmmNetStdVega", "type": "int256" }, - { "internalType": "int256", "name": "postTradeAmmNetStdVega", "type": "int256" }, - { "internalType": "int256", "name": "callDelta", "type": "int256" }, - { "internalType": "uint256", "name": "volTraded", "type": "uint256" }, - { "internalType": "uint256", "name": "ivVariance", "type": "uint256" }, - { "internalType": "uint256", "name": "vega", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPrice", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "preTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "int256", + "name": "postTradeAmmNetStdVega", + "type": "int256" + }, + { + "internalType": "int256", + "name": "callDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "volTraded", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVariance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vega", + "type": "uint256" + } ], "internalType": "struct OptionGreekCache.TradePricing", "name": "pricing", @@ -554,12 +1489,36 @@ "outputs": [ { "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": "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": "vegaUtilFeeComponents", @@ -571,8 +1530,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "_optionMarket", "type": "address" }, - { "internalType": "contract OptionGreekCache", "name": "_greekCache", "type": "address" } + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "_greekCache", + "type": "address" + } ], "name": "init", "outputs": [], @@ -583,23 +1550,83 @@ "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" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, + { + "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" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -610,19 +1637,41 @@ "name": "trade", "type": "tuple" }, - { "internalType": "uint256", "name": "boardBaseIv", "type": "uint256" }, - { "internalType": "uint256", "name": "strikeSkew", "type": "uint256" } + { + "internalType": "uint256", + "name": "boardBaseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "strikeSkew", + "type": "uint256" + } ], "name": "ivImpactForTrade", "outputs": [ - { "internalType": "uint256", "name": "newBaseIv", "type": "uint256" }, - { "internalType": "uint256", "name": "newSkew", "type": "uint256" } + { + "internalType": "uint256", + "name": "newBaseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newSkew", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], "name": "nominateNewOwner", "outputs": [], "stateMutability": "nonpayable", @@ -631,14 +1680,26 @@ { "inputs": [], "name": "nominatedOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -646,15 +1707,51 @@ "inputs": [], "name": "pricingParams", "outputs": [ - { "internalType": "uint256", "name": "optionPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "standardSize", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "standardSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentFactor", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" @@ -663,15 +1760,51 @@ "inputs": [ { "components": [ - { "internalType": "uint256", "name": "optionPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "optionPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee1xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPriceFee2xPoint", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "standardSize", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "optionPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "optionPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee1xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceFee2xPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "standardSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentFactor", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.PricingParameters", "name": "_pricingParams", @@ -687,18 +1820,66 @@ "inputs": [ { "components": [ - { "internalType": "int256", "name": "minDelta", "type": "int256" }, - { "internalType": "int256", "name": "minForceCloseDelta", "type": "int256" }, - { "internalType": "uint256", "name": "tradingCutoff", "type": "uint256" }, - { "internalType": "uint256", "name": "minBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "maxBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "minSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "maxSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minVol", "type": "uint256" }, - { "internalType": "uint256", "name": "maxVol", "type": "uint256" }, - { "internalType": "uint256", "name": "absMinSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "absMaxSkew", "type": "uint256" }, - { "internalType": "bool", "name": "capSkewsToAbs", "type": "bool" } + { + "internalType": "int256", + "name": "minDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minForceCloseDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "tradingCutoff", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMinSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMaxSkew", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "capSkewsToAbs", + "type": "bool" + } ], "internalType": "struct OptionMarketPricer.TradeLimitParameters", "name": "_tradeLimitParams", @@ -714,15 +1895,51 @@ "inputs": [ { "components": [ - { "internalType": "uint256", "name": "defaultVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "forceCloseVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "referenceSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticSkewAdjustment", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticVega", "type": "uint256" }, - { "internalType": "uint256", "name": "ivVarianceCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticIvVariance", "type": "uint256" } + { + "internalType": "uint256", + "name": "defaultVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forceCloseVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "referenceSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticSkewAdjustment", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticVega", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticIvVariance", + "type": "uint256" + } ], "internalType": "struct OptionMarketPricer.VarianceFeeParameters", "name": "_varianceFeeParams", @@ -738,18 +1955,66 @@ "inputs": [], "name": "tradeLimitParams", "outputs": [ - { "internalType": "int256", "name": "minDelta", "type": "int256" }, - { "internalType": "int256", "name": "minForceCloseDelta", "type": "int256" }, - { "internalType": "uint256", "name": "tradingCutoff", "type": "uint256" }, - { "internalType": "uint256", "name": "minBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "maxBaseIV", "type": "uint256" }, - { "internalType": "uint256", "name": "minSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "maxSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minVol", "type": "uint256" }, - { "internalType": "uint256", "name": "maxVol", "type": "uint256" }, - { "internalType": "uint256", "name": "absMinSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "absMaxSkew", "type": "uint256" }, - { "internalType": "bool", "name": "capSkewsToAbs", "type": "bool" } + { + "internalType": "int256", + "name": "minDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minForceCloseDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "tradingCutoff", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBaseIV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVol", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMinSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "absMaxSkew", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "capSkewsToAbs", + "type": "bool" + } ], "stateMutability": "view", "type": "function" @@ -758,15 +2023,51 @@ "inputs": [ { "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": "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": "strike", @@ -774,23 +2075,83 @@ }, { "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" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, + { + "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" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -801,25 +2162,73 @@ "name": "trade", "type": "tuple" }, - { "internalType": "uint256", "name": "boardBaseIv", "type": "uint256" }, - { "internalType": "uint256", "name": "boardExpiry", "type": "uint256" } + { + "internalType": "uint256", + "name": "boardBaseIv", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "boardExpiry", + "type": "uint256" + } ], "name": "updateCacheAndGetTradeResult", "outputs": [ { "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" }, + { + "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": "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", @@ -827,24 +2236,76 @@ }, { "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": "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" } + { + "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" + } ], "internalType": "struct OptionMarketPricer.TradeResult", "name": "tradeResult", @@ -858,17 +2319,53 @@ "inputs": [], "name": "varianceFeeParams", "outputs": [ - { "internalType": "uint256", "name": "defaultVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "forceCloseVarianceFeeCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "skewAdjustmentCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "referenceSkew", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticSkewAdjustment", "type": "uint256" }, - { "internalType": "uint256", "name": "vegaCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticVega", "type": "uint256" }, - { "internalType": "uint256", "name": "ivVarianceCoefficient", "type": "uint256" }, - { "internalType": "uint256", "name": "minimumStaticIvVariance", "type": "uint256" } + { + "internalType": "uint256", + "name": "defaultVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forceCloseVarianceFeeCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "skewAdjustmentCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "referenceSkew", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticSkewAdjustment", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vegaCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticVega", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ivVarianceCoefficient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumStaticIvVariance", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" } -] +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/abis/NewportOptionToken.json b/sdk/src/contracts/newport/abis/NewportOptionToken.json index 4eb2e87..cf19b3b 100644 --- a/sdk/src/contracts/newport/abis/NewportOptionToken.json +++ b/sdk/src/contracts/newport/abis/NewportOptionToken.json @@ -1,89 +1,223 @@ [ { "inputs": [ - { "internalType": "string", "name": "name_", "type": "string" }, - { "internalType": "string", "name": "symbol_", "type": "string" } + { + "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" } + { + "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" }, + { + "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": "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" } + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } ], "name": "AdjustmentResultsInMinimumCollateralNotBeingMet", "type": "error" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "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" } + { + "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" }], + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "CannotClosePositionZero", "type": "error" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "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" } + { + "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" }, + { + "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": "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", @@ -95,84 +229,206 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "originalPositionAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "splitAmount", "type": "uint256" } + { + "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" } + { + "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" }], + "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" } + { + "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" } + { + "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" } + { + "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" } + { + "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" } + { + "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" }, + { + "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": "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", @@ -180,101 +436,257 @@ }, { "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": "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" } + { + "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" }, + { + "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": "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" } + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } ], "name": "PositionNotLiquidatable", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, + { + "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": "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" } + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } ], "name": "ResultingNewPositionLiquidatable", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, + { + "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": "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" } + { + "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" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + } ], "name": "SplittingUnapprovedPosition", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "strikeId", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + } ], "name": "StrikeIsSettled", "type": "error" @@ -282,9 +694,24 @@ { "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" } + { + "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" @@ -292,9 +719,24 @@ { "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" } + { + "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" @@ -302,15 +744,32 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + { + "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" }], + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], "name": "OwnerNominated", "type": "event" }, @@ -319,10 +778,26 @@ "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": "uint256", + "name": "penaltyRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLiquidationFee", + "type": "uint256" + } ], "indexed": false, "internalType": "struct OptionToken.PartialCollateralParameters", @@ -336,8 +811,18 @@ { "anonymous": false, "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "positionId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { + "indexed": true, + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, { "indexed": true, "internalType": "enum OptionToken.PositionUpdatedType", @@ -346,19 +831,48 @@ }, { "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": "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" } + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } ], "name": "PositionUpdated", "type": "event" @@ -366,27 +880,69 @@ { "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" } + { + "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" }, { "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "string", "name": "URI", "type": "string" }], + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "URI", + "type": "string" + } + ], "name": "URISet", "type": "event" }, - { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ - { "internalType": "uint256", "name": "positionId", "type": "uint256" }, - { "internalType": "uint256", "name": "amountCollateral", "type": "uint256" } + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountCollateral", + "type": "uint256" + } ], "name": "addCollateral", - "outputs": [{ "internalType": "enum OptionMarket.OptionType", "name": "optionType", "type": "uint8" }], + "outputs": [ + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -394,23 +950,83 @@ "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" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, + { + "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" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -421,25 +1037,65 @@ "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" } + { + "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" } + { + "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" } + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } ], "name": "approve", "outputs": [], @@ -447,16 +1103,34 @@ "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, @@ -464,50 +1138,144 @@ "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": "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" } + { + "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" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], "name": "getApproved", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "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" } + { + "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": "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", @@ -518,17 +1286,47 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "positionId", "type": "uint256" }], + "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": "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": "", @@ -539,17 +1337,47 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256[]", "name": "positionIds", "type": "uint256[]" }], + "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": "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": "", @@ -560,17 +1388,47 @@ "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], + "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": "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": "", @@ -586,10 +1444,26 @@ "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": "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": "", @@ -600,25 +1474,71 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "positionId", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + } + ], "name": "getPositionState", - "outputs": [{ "internalType": "enum OptionToken.PositionState", "name": "", "type": "uint8" }], + "outputs": [ + { + "internalType": "enum OptionToken.PositionState", + "name": "", + "type": "uint8" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "positionId", "type": "uint256" }], + "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": "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": "", @@ -629,18 +1549,52 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256[]", "name": "positionIds", "type": "uint256[]" }], + "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": "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": "", @@ -652,10 +1606,26 @@ }, { "inputs": [ - { "internalType": "contract OptionMarket", "name": "_optionMarket", "type": "address" }, - { "internalType": "contract OptionGreekCache", "name": "_greekCache", "type": "address" }, - { "internalType": "address", "name": "_shortCollateral", "type": "address" }, - { "internalType": "contract BaseExchangeAdapter", "name": "_exchangeAdapter", "type": "address" } + { + "internalType": "contract OptionMarket", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "_greekCache", + "type": "address" + }, + { + "internalType": "address", + "name": "_shortCollateral", + "type": "address" + }, + { + "internalType": "contract BaseExchangeAdapter", + "name": "_exchangeAdapter", + "type": "address" + } ], "name": "init", "outputs": [], @@ -664,36 +1634,114 @@ }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "operator", "type": "address" } + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } ], "name": "isApprovedForAll", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "positionId", "type": "uint256" }, + { + "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" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, + { + "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" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "freeLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "burnableLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "reservedCollatLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "NAV", "type": "uint256" }, - { "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "internalType": "uint256", + "name": "freeLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burnableLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservedCollatLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "NAV", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "internalType": "struct LiquidityPool.Liquidity", "name": "liquidity", @@ -704,18 +1752,46 @@ "name": "trade", "type": "tuple" }, - { "internalType": "uint256", "name": "totalCost", "type": "uint256" } + { + "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": "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", @@ -726,7 +1802,13 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256[]", "name": "positionIds", "type": "uint256[]" }], + "inputs": [ + { + "internalType": "uint256[]", + "name": "positionIds", + "type": "uint256[]" + } + ], "name": "merge", "outputs": [], "stateMutability": "nonpayable", @@ -735,19 +1817,37 @@ { "inputs": [], "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "nextId", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], "name": "nominateNewOwner", "outputs": [], "stateMutability": "nonpayable", @@ -756,21 +1856,45 @@ { "inputs": [], "name": "nominatedOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], "name": "ownerOf", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -778,33 +1902,91 @@ "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" } + { + "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" }], + "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" } + { + "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" } + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } ], "name": "safeTransferFrom", "outputs": [], @@ -813,10 +1995,26 @@ }, { "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" } + { + "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": [], @@ -825,8 +2023,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "operator", "type": "address" }, - { "internalType": "bool", "name": "approved", "type": "bool" } + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } ], "name": "setApprovalForAll", "outputs": [], @@ -837,10 +2043,26 @@ "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": "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", @@ -853,14 +2075,26 @@ "type": "function" }, { - "inputs": [{ "internalType": "string", "name": "newURI", "type": "string" }], + "inputs": [ + { + "internalType": "string", + "name": "newURI", + "type": "string" + } + ], "name": "setURI", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "uint256[]", "name": "positionIds", "type": "uint256[]" }], + "inputs": [ + { + "internalType": "uint256[]", + "name": "positionIds", + "type": "uint256[]" + } + ], "name": "settlePositions", "outputs": [], "stateMutability": "nonpayable", @@ -868,70 +2102,166 @@ }, { "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" } + { + "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" }], + "outputs": [ + { + "internalType": "uint256", + "name": "newPositionId", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], "name": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], "name": "tokenByIndex", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "uint256", "name": "index", "type": "uint256" } + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } ], "name": "tokenOfOwnerByIndex", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], "name": "tokenURI", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "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" } + { + "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" } -] +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/abis/NewportPoolHedger.json b/sdk/src/contracts/newport/abis/NewportPoolHedger.json index 3e1a7da..1863568 100644 --- a/sdk/src/contracts/newport/abis/NewportPoolHedger.json +++ b/sdk/src/contracts/newport/abis/NewportPoolHedger.json @@ -1,67 +1,175 @@ [ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "AlreadyInitialised", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "asset", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "address", "name": "recipient", "type": "address" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } ], "name": "AssetTransferFailed", "type": "error" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "CancellationDelayNotPassed", "type": "error" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "CannotRecoverRestrictedToken", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "balance", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } ], "name": "EthTransferFailure", "type": "error" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "GetGMXVaultError", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "lastInteraction", "type": "uint256" }, - { "internalType": "uint256", "name": "interactionDelta", "type": "uint256" }, - { "internalType": "uint256", "name": "currentTime", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "lastInteraction", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "interactionDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentTime", + "type": "uint256" + } ], "name": "InteractionDelayNotExpired", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, { "components": [ - { "internalType": "uint256", "name": "acceptableSpotSlippage", "type": "uint256" }, - { "internalType": "uint256", "name": "deltaThreshold", "type": "uint256" }, - { "internalType": "uint256", "name": "marketDepthBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "targetLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "maxLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "leverageBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "minCancelDelay", "type": "uint256" }, - { "internalType": "bool", "name": "vaultLiquidityCheckEnabled", "type": "bool" } + { + "internalType": "uint256", + "name": "acceptableSpotSlippage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverageBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minCancelDelay", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "vaultLiquidityCheckEnabled", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.FuturesPoolHedgerParameters", "name": "futuresPoolHedgerParams", @@ -73,18 +181,58 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "finalSize", "type": "uint256" }, - { "internalType": "uint256", "name": "finalCollat", "type": "uint256" }, + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "finalSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "finalCollat", + "type": "uint256" + }, { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "currentPos", @@ -95,83 +243,187 @@ "type": "error" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], "name": "NoQuoteReceivedFromLP", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "quoteReceived", "type": "uint256" }, - { "internalType": "uint256", "name": "minCollateral", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteReceived", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minCollateral", + "type": "uint256" + } ], "name": "NotEnoughQuoteForMinCollateral", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "caller", "type": "address" }, - { "internalType": "address", "name": "liquidityPool", "type": "address" } + { + "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" } + { + "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" } + { + "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": "bytes32", "name": "pendingOrderKey", "type": "bytes32" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pendingOrderKey", + "type": "bytes32" + } ], "name": "OrderCancellationFailure", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "bytes32", "name": "key", "type": "bytes32" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } ], "name": "PositionRequestPending", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "approvee", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "approvee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "QuoteApprovalFailure", "type": "error" }, { "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "amountBase", "type": "uint256" }], + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + } + ], "name": "BaseReturnedToLP", "type": "event" }, { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "bytes32", "name": "positionKey", "type": "bytes32" }, - { "indexed": false, "internalType": "bool", "name": "isLong", "type": "bool" }, - { "indexed": false, "internalType": "int256", "name": "collateralDelta", "type": "int256" } + { + "indexed": false, + "internalType": "bytes32", + "name": "positionKey", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "int256", + "name": "collateralDelta", + "type": "int256" + } ], "name": "CollateralOrderPosted", "type": "event" @@ -181,14 +433,46 @@ "inputs": [ { "components": [ - { "internalType": "uint256", "name": "acceptableSpotSlippage", "type": "uint256" }, - { "internalType": "uint256", "name": "deltaThreshold", "type": "uint256" }, - { "internalType": "uint256", "name": "marketDepthBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "targetLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "maxLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "leverageBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "minCancelDelay", "type": "uint256" }, - { "internalType": "bool", "name": "vaultLiquidityCheckEnabled", "type": "bool" } + { + "internalType": "uint256", + "name": "acceptableSpotSlippage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverageBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minCancelDelay", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "vaultLiquidityCheckEnabled", + "type": "bool" + } ], "indexed": false, "internalType": "struct GMXFuturesPoolHedger.FuturesPoolHedgerParameters", @@ -202,20 +486,63 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "bytes32", "name": "positionKey", "type": "bytes32" }, - { "indexed": false, "internalType": "bool", "name": "isExecuted", "type": "bool" }, - { "indexed": false, "internalType": "bool", "name": "isIncrease", "type": "bool" }, + { + "indexed": false, + "internalType": "bytes32", + "name": "positionKey", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isExecuted", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isIncrease", + "type": "bool" + }, { "components": [ { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "longPosition", @@ -223,20 +550,56 @@ }, { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "shortPosition", "type": "tuple" }, - { "internalType": "uint256", "name": "amountOpen", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "amountOpen", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "indexed": false, "internalType": "struct GMXFuturesPoolHedger.CurrentPositions", @@ -254,13 +617,41 @@ "components": [ { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "longPosition", @@ -268,20 +659,56 @@ }, { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "shortPosition", "type": "tuple" }, - { "internalType": "uint256", "name": "amountOpen", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "amountOpen", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "indexed": false, "internalType": "struct GMXFuturesPoolHedger.CurrentPositions", @@ -295,8 +722,18 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "bytes32", "name": "pendingOrderKey", "type": "bytes32" }, - { "indexed": false, "internalType": "bool", "name": "success", "type": "bool" } + { + "indexed": false, + "internalType": "bytes32", + "name": "pendingOrderKey", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "success", + "type": "bool" + } ], "name": "OrderCanceled", "type": "event" @@ -304,11 +741,36 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "bytes32", "name": "positionKey", "type": "bytes32" }, - { "indexed": false, "internalType": "uint256", "name": "collateralDelta", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "sizeDelta", "type": "uint256" }, - { "indexed": false, "internalType": "bool", "name": "isLong", "type": "bool" }, - { "indexed": false, "internalType": "bool", "name": "isIncrease", "type": "bool" } + { + "indexed": false, + "internalType": "bytes32", + "name": "positionKey", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isIncrease", + "type": "bool" + } ], "name": "OrderPosted", "type": "event" @@ -316,15 +778,32 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + { + "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" }], + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], "name": "OwnerNominated", "type": "event" }, @@ -333,8 +812,16 @@ "inputs": [ { "components": [ - { "internalType": "uint256", "name": "interactionDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "hedgeCap", "type": "uint256" } + { + "internalType": "uint256", + "name": "interactionDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgeCap", + "type": "uint256" + } ], "indexed": false, "internalType": "struct PoolHedger.PoolHedgerParameters", @@ -348,7 +835,12 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "contract IPositionRouter", "name": "positionRouter", "type": "address" } + { + "indexed": false, + "internalType": "contract IPositionRouter", + "name": "positionRouter", + "type": "address" + } ], "name": "PositionRouterSet", "type": "event" @@ -356,26 +848,68 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "address", "name": "thrower", "type": "address" }, - { "indexed": false, "internalType": "int256", "name": "currentNetDelta", "type": "int256" }, - { "indexed": false, "internalType": "int256", "name": "expectedNetDelta", "type": "int256" }, - { "indexed": false, "internalType": "uint256", "name": "modifiedDelta", "type": "uint256" }, - { "indexed": false, "internalType": "bool", "name": "isIncrease", "type": "bool" } + { + "indexed": false, + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "currentNetDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "expectedNetDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "modifiedDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isIncrease", + "type": "bool" + } ], "name": "PositionUpdated", "type": "event" }, { "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "amountQuote", "type": "uint256" }], + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } + ], "name": "QuoteReturnedToLP", "type": "event" }, { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "amountWeth", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "quoteReceived", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "amountWeth", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteReceived", + "type": "uint256" + } ], "name": "WETHSold", "type": "event" @@ -383,40 +917,90 @@ { "inputs": [], "name": "BASIS_POINTS_DIVISOR", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "GMX_PRICE_PRECISION", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "baseAsset", - "outputs": [{ "internalType": "contract IERC20Decimals", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "bool", "name": "increasesPoolDelta", "type": "bool" } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "increasesPoolDelta", + "type": "bool" + } ], "name": "canHedge", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "cancelPendingOrder", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "cancelPendingOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "exchangeAdapter", - "outputs": [{ "internalType": "contract BaseExchangeAdapter", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract BaseExchangeAdapter", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -424,14 +1008,46 @@ "inputs": [], "name": "futuresPoolHedgerParams", "outputs": [ - { "internalType": "uint256", "name": "acceptableSpotSlippage", "type": "uint256" }, - { "internalType": "uint256", "name": "deltaThreshold", "type": "uint256" }, - { "internalType": "uint256", "name": "marketDepthBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "targetLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "maxLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "leverageBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "minCancelDelay", "type": "uint256" }, - { "internalType": "bool", "name": "vaultLiquidityCheckEnabled", "type": "bool" } + { + "internalType": "uint256", + "name": "acceptableSpotSlippage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverageBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minCancelDelay", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "vaultLiquidityCheckEnabled", + "type": "bool" + } ], "stateMutability": "view", "type": "function" @@ -439,21 +1055,39 @@ { "inputs": [], "name": "getAllPositionsValue", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCappedExpectedHedge", - "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCurrentHedgedNetDelta", - "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], "stateMutability": "view", "type": "function" }, @@ -461,10 +1095,26 @@ "inputs": [], "name": "getCurrentLeverage", "outputs": [ - { "internalType": "uint256", "name": "leverage", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" }, - { "internalType": "bool", "name": "needUpdate", "type": "bool" }, - { "internalType": "int256", "name": "collateralDelta", "type": "int256" } + { + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "needUpdate", + "type": "bool" + }, + { + "internalType": "int256", + "name": "collateralDelta", + "type": "int256" + } ], "stateMutability": "view", "type": "function" @@ -479,13 +1129,41 @@ "components": [ { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "longPosition", @@ -493,20 +1171,56 @@ }, { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "shortPosition", "type": "tuple" }, - { "internalType": "uint256", "name": "amountOpen", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "amountOpen", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.CurrentPositions", "name": "currentPositions", @@ -514,14 +1228,46 @@ }, { "components": [ - { "internalType": "uint256", "name": "acceptableSpotSlippage", "type": "uint256" }, - { "internalType": "uint256", "name": "deltaThreshold", "type": "uint256" }, - { "internalType": "uint256", "name": "marketDepthBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "targetLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "maxLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "leverageBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "minCancelDelay", "type": "uint256" }, - { "internalType": "bool", "name": "vaultLiquidityCheckEnabled", "type": "bool" } + { + "internalType": "uint256", + "name": "acceptableSpotSlippage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverageBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minCancelDelay", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "vaultLiquidityCheckEnabled", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.FuturesPoolHedgerParameters", "name": "futuresPoolHedgerParams", @@ -529,12 +1275,36 @@ }, { "components": [ - { "internalType": "contract IRouter", "name": "router", "type": "address" }, - { "internalType": "contract IPositionRouter", "name": "positionRouter", "type": "address" }, - { "internalType": "contract IVault", "name": "vault", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "quoteAsset", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "baseAsset", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "weth", "type": "address" } + { + "internalType": "contract IRouter", + "name": "router", + "type": "address" + }, + { + "internalType": "contract IPositionRouter", + "name": "positionRouter", + "type": "address" + }, + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "baseAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "weth", + "type": "address" + } ], "internalType": "struct GMXFuturesPoolHedger.HedgerAddresses", "name": "hedgerAddresses", @@ -542,27 +1312,91 @@ }, { "components": [ - { "internalType": "uint256", "name": "basePoolAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "baseReservedAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "quotePoolAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "quoteReservedAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "minExecutionFee", "type": "uint256" } + { + "internalType": "uint256", + "name": "basePoolAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseReservedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotePoolAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteReservedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minExecutionFee", + "type": "uint256" + } ], "internalType": "struct GMXFuturesPoolHedger.GMXView", "name": "gmxView", "type": "tuple" }, - { "internalType": "bytes32", "name": "referralCode", "type": "bytes32" }, - { "internalType": "bytes32", "name": "pendingOrderKey", "type": "bytes32" }, - { "internalType": "uint256", "name": "lastOrderTimestamp", "type": "uint256" }, - { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }, - { "internalType": "int256", "name": "expectedHedge", "type": "int256" }, - { "internalType": "int256", "name": "currentHedge", "type": "int256" }, - { "internalType": "uint256", "name": "currentLeverage", "type": "uint256" }, - { "internalType": "int256", "name": "pendingCollateralDelta", "type": "int256" }, - { "internalType": "uint256", "name": "baseBal", "type": "uint256" }, - { "internalType": "uint256", "name": "quoteBal", "type": "uint256" }, - { "internalType": "uint256", "name": "wethBal", "type": "uint256" } + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "pendingOrderKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastOrderTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "expectedHedge", + "type": "int256" + }, + { + "internalType": "int256", + "name": "currentHedge", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "currentLeverage", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "pendingCollateralDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "baseBal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteBal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "wethBal", + "type": "uint256" + } ], "internalType": "struct GMXFuturesPoolHedger.GMXFuturesPoolHedgerView", "name": "", @@ -573,11 +1407,25 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "spotPrice", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], "name": "getHedgingLiquidity", "outputs": [ - { "internalType": "uint256", "name": "pendingDeltaLiquidity", "type": "uint256" }, - { "internalType": "uint256", "name": "usedDeltaLiquidity", "type": "uint256" } + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" @@ -588,8 +1436,16 @@ "outputs": [ { "components": [ - { "internalType": "uint256", "name": "interactionDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "hedgeCap", "type": "uint256" } + { + "internalType": "uint256", + "name": "interactionDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgeCap", + "type": "uint256" + } ], "internalType": "struct PoolHedger.PoolHedgerParameters", "name": "", @@ -607,13 +1463,41 @@ "components": [ { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "longPosition", @@ -621,20 +1505,56 @@ }, { "components": [ - { "internalType": "uint256", "name": "size", "type": "uint256" }, - { "internalType": "uint256", "name": "collateral", "type": "uint256" }, - { "internalType": "uint256", "name": "averagePrice", "type": "uint256" }, - { "internalType": "uint256", "name": "entryFundingRate", "type": "uint256" }, - { "internalType": "int256", "name": "unrealisedPnl", "type": "int256" }, - { "internalType": "uint256", "name": "lastIncreasedTime", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "unrealisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.PositionDetails", "name": "shortPosition", "type": "tuple" }, - { "internalType": "uint256", "name": "amountOpen", "type": "uint256" }, - { "internalType": "bool", "name": "isLong", "type": "bool" } + { + "internalType": "uint256", + "name": "amountOpen", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.CurrentPositions", "name": "positions", @@ -646,20 +1566,50 @@ }, { "inputs": [ - { "internalType": "bool", "name": "isLong", "type": "bool" }, - { "internalType": "bool", "name": "isIncrease", "type": "bool" }, - { "internalType": "uint256", "name": "amountIn18", "type": "uint256" } + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isIncrease", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "amountIn18", + "type": "uint256" + } ], "name": "getSwapFeeBP", - "outputs": [{ "internalType": "uint256", "name": "feeBP", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "feeBP", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "bytes32", "name": "positionKey", "type": "bytes32" }, - { "internalType": "bool", "name": "isExecuted", "type": "bool" }, - { "internalType": "bool", "name": "isIncrease", "type": "bool" } + { + "internalType": "bytes32", + "name": "positionKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "isExecuted", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isIncrease", + "type": "bool" + } ], "name": "gmxPositionCallback", "outputs": [], @@ -669,36 +1619,96 @@ { "inputs": [], "name": "greekCache", - "outputs": [{ "internalType": "contract OptionGreekCache", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract OptionGreekCache", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "hasPendingDecrease", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "hasPendingIncrease", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "hedgeDelta", "outputs": [], "stateMutability": "payable", "type": "function" }, + { + "inputs": [], + "name": "hedgeDelta", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ - { "internalType": "contract LiquidityPool", "name": "_liquidityPool", "type": "address" }, - { "internalType": "address", "name": "_optionMarket", "type": "address" }, - { "internalType": "contract OptionGreekCache", "name": "_greekCache", "type": "address" }, - { "internalType": "contract BaseExchangeAdapter", "name": "_exchangeAdapter", "type": "address" }, - { "internalType": "contract IPositionRouter", "name": "_positionRouter", "type": "address" }, - { "internalType": "contract IRouter", "name": "_router", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "_quoteAsset", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "_baseAsset", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "_weth", "type": "address" } + { + "internalType": "contract LiquidityPool", + "name": "_liquidityPool", + "type": "address" + }, + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "_greekCache", + "type": "address" + }, + { + "internalType": "contract BaseExchangeAdapter", + "name": "_exchangeAdapter", + "type": "address" + }, + { + "internalType": "contract IPositionRouter", + "name": "_positionRouter", + "type": "address" + }, + { + "internalType": "contract IRouter", + "name": "_router", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "_baseAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "_weth", + "type": "address" + } ], "name": "init", "outputs": [], @@ -708,19 +1718,37 @@ { "inputs": [], "name": "lastInteraction", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastOrderTimestamp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], "name": "nominateNewOwner", "outputs": [], "stateMutability": "nonpayable", @@ -729,47 +1757,89 @@ { "inputs": [], "name": "nominatedOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "optionMarket", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingOrderKey", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "positionRouter", - "outputs": [{ "internalType": "contract IPositionRouter", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract IPositionRouter", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "quoteAsset", - "outputs": [{ "internalType": "contract IERC20Decimals", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address payable", "name": "receiver", "type": "address" }], + "inputs": [ + { + "internalType": "address payable", + "name": "receiver", + "type": "address" + } + ], "name": "recoverEth", "outputs": [], "stateMutability": "nonpayable", @@ -777,8 +1847,16 @@ }, { "inputs": [ - { "internalType": "contract IERC20Decimals", "name": "token", "type": "address" }, - { "internalType": "address", "name": "recipient", "type": "address" } + { + "internalType": "contract IERC20Decimals", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } ], "name": "recoverFunds", "outputs": [], @@ -788,31 +1866,87 @@ { "inputs": [], "name": "referralCode", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "resetInteractionDelay", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "resetInteractionDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "router", - "outputs": [{ "internalType": "contract IRouter", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract IRouter", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "sendAllFundsToLP", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "sendAllFundsToLP", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "components": [ - { "internalType": "uint256", "name": "acceptableSpotSlippage", "type": "uint256" }, - { "internalType": "uint256", "name": "deltaThreshold", "type": "uint256" }, - { "internalType": "uint256", "name": "marketDepthBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "targetLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "maxLeverage", "type": "uint256" }, - { "internalType": "uint256", "name": "leverageBuffer", "type": "uint256" }, - { "internalType": "uint256", "name": "minCancelDelay", "type": "uint256" }, - { "internalType": "bool", "name": "vaultLiquidityCheckEnabled", "type": "bool" } + { + "internalType": "uint256", + "name": "acceptableSpotSlippage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverageBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minCancelDelay", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "vaultLiquidityCheckEnabled", + "type": "bool" + } ], "internalType": "struct GMXFuturesPoolHedger.FuturesPoolHedgerParameters", "name": "_futuresPoolHedgerParams", @@ -828,8 +1962,16 @@ "inputs": [ { "components": [ - { "internalType": "uint256", "name": "interactionDelay", "type": "uint256" }, - { "internalType": "uint256", "name": "hedgeCap", "type": "uint256" } + { + "internalType": "uint256", + "name": "interactionDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgeCap", + "type": "uint256" + } ], "internalType": "struct PoolHedger.PoolHedgerParameters", "name": "_poolHedgerParams", @@ -842,33 +1984,66 @@ "type": "function" }, { - "inputs": [{ "internalType": "contract IPositionRouter", "name": "_positionRouter", "type": "address" }], + "inputs": [ + { + "internalType": "contract IPositionRouter", + "name": "_positionRouter", + "type": "address" + } + ], "name": "setPositionRouter", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [{ "internalType": "bytes32", "name": "_referralCode", "type": "bytes32" }], + "inputs": [ + { + "internalType": "bytes32", + "name": "_referralCode", + "type": "bytes32" + } + ], "name": "setReferralCode", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { "inputs": [], "name": "updateCollateral", "outputs": [], "stateMutability": "payable", "type": "function" }, + { + "inputs": [], + "name": "updateCollateral", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "vault", - "outputs": [{ "internalType": "contract IVault", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "weth", - "outputs": [{ "internalType": "contract IERC20Decimals", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, - { "stateMutability": "payable", "type": "receive" } -] + { + "stateMutability": "payable", + "type": "receive" + } +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/abis/NewportSNXPerpV2Adapter.json b/sdk/src/contracts/newport/abis/NewportSNXPerpV2Adapter.json new file mode 100644 index 0000000..d4eacb9 --- /dev/null +++ b/sdk/src/contracts/newport/abis/NewportSNXPerpV2Adapter.json @@ -0,0 +1,1330 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "AllMarketsPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetTransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountQuoteRequested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseToSpend", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + } + ], + "name": "BaseQuoteExchangeExceedsLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAcceptedOut", + "type": "uint256" + }, + { + "internalType": "contract IERC20Decimals", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "InsufficientSwap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "inputAddress", + "type": "address" + } + ], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRiskFreeRate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSNXPerpV2Price", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidStaticEstimationDiscount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "address", + "name": "marketAddress", + "type": "address" + } + ], + "name": "MarketIsPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "NotImplemented", + "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": "uint256", + "name": "amountBaseRequested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteToSpend", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "quoteKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + } + ], + "name": "QuoteBaseExchangeExceedsLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "internalType": "uint248", + "name": "reason", + "type": "uint248" + } + ], + "name": "SNXPerpV2MarketSuspended", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TransferFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "addressResolver", + "type": "address" + } + ], + "name": "AddressResolverUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "marketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "exchanger", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseSwapped", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteReceived", + "type": "uint256" + } + ], + "name": "BaseSwappedForQuote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteSpentD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseAssetinD18", + "type": "uint256" + } + ], + "name": "ExchangeToExactBaseWithLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteSpentD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseAssetinD18", + "type": "uint256" + } + ], + "name": "ExchangedFromExactBase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "GlobalPausedSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "staticEstimationDiscount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "snxPerpV2Market", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "uniswapPool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeTier", + "type": "uint256" + } + ], + "name": "MarketAdapterConfigurationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "MarketPausedSet", + "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": "marketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "exchanger", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quoteSwapped", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseReceived", + "type": "uint256" + } + ], + "name": "QuoteSwappedForBase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "riskFreeRate", + "type": "int256" + } + ], + "name": "RiskFreeRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "uniswapRouter", + "type": "address" + } + ], + "name": "RouterApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "synthetixSystemStatus", + "type": "address" + } + ], + "name": "SynthetixSystemStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "deviation", + "type": "uint256" + } + ], + "name": "UniDeviationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "uniswapRouter", + "type": "address" + } + ], + "name": "UniswapRouterUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressResolver", + "outputs": [ + { + "internalType": "contract IAddressResolver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "asset", + "type": "address" + } + ], + "name": "approveRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountBaseD18", + "type": "uint256" + } + ], + "name": "estimateExchangeToExactBase", + "outputs": [ + { + "internalType": "uint256", + "name": "quoteNeededD18", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountQuoteD18", + "type": "uint256" + } + ], + "name": "estimateExchangeToExactQuote", + "outputs": [ + { + "internalType": "uint256", + "name": "baseNeededD18", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountBaseD18", + "type": "uint256" + } + ], + "name": "exchangeFromExactBase", + "outputs": [ + { + "internalType": "uint256", + "name": "quoteReceivedD18", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "exchangeFromExactQuote", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "exchangeToExactBase", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountBaseD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quoteLimitD18", + "type": "uint256" + } + ], + "name": "exchangeToExactBaseWithLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "quoteSpentD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseReceivedD18", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "exchangeToExactQuote", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "exchangeToExactQuoteWithLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + } + ], + "name": "getAdapterState", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "staticEstimationDiscount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "snxPerpV2MarketAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint24", + "name": "feeTier", + "type": "uint24" + } + ], + "internalType": "struct SNXPerpV2Adapter.UniswapPoolInfo", + "name": "uniswapInfo", + "type": "tuple" + } + ], + "internalType": "struct SNXPerpV2Adapter.MarketAdapterConfiguration", + "name": "config", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "snxPrice", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "riskFreeRate", + "type": "int256" + } + ], + "internalType": "struct SNXPerpV2Adapter.MarketAdapterState", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + } + ], + "name": "getPrices", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "getSettlementPriceForMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "internalType": "enum BaseExchangeAdapter.PriceType", + "name": "pricing", + "type": "uint8" + } + ], + "name": "getSpotPriceForMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isGlobalPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMarketPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "marketConfigurations", + "outputs": [ + { + "internalType": "uint256", + "name": "staticEstimationDiscount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "snxPerpV2MarketAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint24", + "name": "feeTier", + "type": "uint24" + } + ], + "internalType": "struct SNXPerpV2Adapter.UniswapPoolInfo", + "name": "uniswapInfo", + "type": "tuple" + } + ], + "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": "address", + "name": "", + "type": "address" + } + ], + "name": "rateAndCarry", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "requireNotGlobalPaused", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + } + ], + "name": "requireNotMarketPaused", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAddressResolver", + "name": "_addressResolver", + "type": "address" + } + ], + "name": "setAddressResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "setGlobalPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_staticEstimationDiscount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_snxPerpV2MarketAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_uniswapPool", + "type": "address" + }, + { + "internalType": "uint24", + "name": "_uniswapFeeTier", + "type": "uint24" + } + ], + "name": "setMarketAdapterConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "setMarketPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "int256", + "name": "_rate", + "type": "int256" + } + ], + "name": "setRiskFreeRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_deviation", + "type": "uint256" + } + ], + "name": "setUniSwapDeviation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISwapRouter", + "name": "_swapRouter", + "type": "address" + } + ], + "name": "setUniswapRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapRouter", + "outputs": [ + { + "internalType": "contract ISwapRouter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "systemStatus", + "outputs": [ + { + "internalType": "contract ISystemStatus", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "uniDeviation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "updateSynthetixAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/abis/NewportSNXPerpsV2PoolHedger.json b/sdk/src/contracts/newport/abis/NewportSNXPerpsV2PoolHedger.json new file mode 100644 index 0000000..c86f7ad --- /dev/null +++ b/sdk/src/contracts/newport/abis/NewportSNXPerpsV2PoolHedger.json @@ -0,0 +1,1135 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + } + ], + "name": "AlreadyInitialised", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "lastInteraction", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "interactionDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentTime", + "type": "uint256" + } + ], + "name": "InteractionDelayNotExpired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maximumFundingRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeltaBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "worstStableRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOrderCap", + "type": "uint256" + } + ], + "internalType": "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + "name": "params", + "type": "tuple" + } + ], + "name": "InvalidFuturesPoolHedgerParams", + "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" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "pendingDelta", + "type": "int256" + } + ], + "name": "PendingOrderDeltaError", + "type": "error" + }, + { + "inputs": [], + "name": "PerpMarketReturnedInvalid", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollat", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollat", + "type": "uint256" + } + ], + "name": "CollateralUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maximumFundingRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeltaBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "worstStableRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOrderCap", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + "name": "params", + "type": "tuple" + } + ], + "name": "FuturesPoolHedgerParamsSet", + "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": [ + { + "components": [ + { + "internalType": "uint256", + "name": "interactionDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgeCap", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct PoolHedger.PoolHedgerParameters", + "name": "poolHedgerParams", + "type": "tuple" + } + ], + "name": "PoolHedgerParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256", + "name": "oldNetDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "currentNetDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "expectedNetDelta", + "type": "int256" + } + ], + "name": "PositionUpdateSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } + ], + "name": "QuoteReturnedToLP", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "quoteAsset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sUSD", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curve_rate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxSlippage", + "type": "uint256" + } + ], + "name": "SlippageOutOfBounds", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + } + ], + "name": "TrackingCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "quoteAsset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sUSD", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "USDCCollateralSwapForMargin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "quoteAsset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sUSD", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "sUSDCollateralSwap", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressResolver", + "outputs": [ + { + "internalType": "contract IAddressResolver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "deltaIncrease", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "canHedge", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curveSwap", + "outputs": [ + { + "internalType": "contract ICurve", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeAdapter", + "outputs": [ + { + "internalType": "contract BaseExchangeAdapter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "futuresPoolHedgerParams", + "outputs": [ + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maximumFundingRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeltaBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "worstStableRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOrderCap", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCappedExpectedHedge", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentHedgedNetDelta", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentPositionMargin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getHedgerState", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "lastInteraction", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "hedgedDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "margin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgerQuoteBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgerMarginQuoteBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "canHedgeDeltaIncrease", + "type": "bool" + }, + { + "internalType": "bool", + "name": "canHedgeDeltaDecrease", + "type": "bool" + }, + { + "internalType": "int256", + "name": "cappedExpectedHedge", + "type": "int256" + }, + { + "internalType": "bool", + "name": "snxHasEnoughMarketDepth", + "type": "bool" + }, + { + "internalType": "bool", + "name": "marketSuspended", + "type": "bool" + }, + { + "internalType": "bool", + "name": "curveRateStable", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "pendingDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "longInterest", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortInterest", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalMarketSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingMargin", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "fundingRate", + "type": "int256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "optionMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "perpsMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "curveSwap", + "type": "address" + }, + { + "internalType": "address", + "name": "quoteAsset", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maximumFundingRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeltaBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "worstStableRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOrderCap", + "type": "uint256" + } + ], + "internalType": "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + "name": "futuresPoolHedgerParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "interactionDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgeCap", + "type": "uint256" + } + ], + "internalType": "struct PoolHedger.PoolHedgerParameters", + "name": "poolHedgerParams", + "type": "tuple" + } + ], + "internalType": "struct SNXPerpsV2PoolHedger.HedgerState", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "name": "getHedgingLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "pendingDeltaLiquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usedDeltaLiquidity", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolHedgerParams", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "interactionDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgeCap", + "type": "uint256" + } + ], + "internalType": "struct PoolHedger.PoolHedgerParameters", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hedgeDelta", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAddressResolver", + "name": "_addressResolver", + "type": "address" + }, + { + "internalType": "contract BaseExchangeAdapter", + "name": "_exchangeAdapter", + "type": "address" + }, + { + "internalType": "contract OptionMarket", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract OptionGreekCache", + "name": "_optionGreekCache", + "type": "address" + }, + { + "internalType": "contract LiquidityPool", + "name": "_liquidityPool", + "type": "address" + }, + { + "internalType": "contract IPerpsV2MarketConsolidated", + "name": "_perpMarketProxy", + "type": "address" + }, + { + "internalType": "contract ERC20", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract ERC20", + "name": "_sUSD", + "type": "address" + }, + { + "internalType": "contract ICurve", + "name": "_curveSwap", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lastInteraction", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "marketKey", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "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": "perpsMarket", + "outputs": [ + { + "internalType": "contract IPerpsV2MarketConsolidated", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "resetInteractionDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "targetLeverage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maximumFundingRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deltaThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketDepthBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeltaBuffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "worstStableRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOrderCap", + "type": "uint256" + } + ], + "internalType": "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + "name": "_futuresPoolHedgerParams", + "type": "tuple" + } + ], + "name": "setFuturesPoolHedgerParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "interactionDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hedgeCap", + "type": "uint256" + } + ], + "internalType": "struct PoolHedger.PoolHedgerParameters", + "name": "_poolHedgerParams", + "type": "tuple" + } + ], + "name": "setPoolHedgerParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_trackingCode", + "type": "bytes32" + } + ], + "name": "setTrackingCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trackingCode", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "updateCollateral", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/abis/NewportShortCollateral.json b/sdk/src/contracts/newport/abis/NewportShortCollateral.json index 67c27bf..c997c99 100644 --- a/sdk/src/contracts/newport/abis/NewportShortCollateral.json +++ b/sdk/src/contracts/newport/abis/NewportShortCollateral.json @@ -1,32 +1,90 @@ [ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { - "inputs": [{ "internalType": "address", "name": "thrower", "type": "address" }], + "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" } + { + "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": "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": "address", "name": "owner", "type": "address" } + { + "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": "position", @@ -38,55 +96,131 @@ }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "address", "name": "caller", "type": "address" }, - { "internalType": "address", "name": "nominatedOwner", "type": "address" } + { + "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" } + { + "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" } + { + "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": "balance", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "OutOfBaseCollateralForTransfer", "type": "error" }, { "inputs": [ - { "internalType": "address", "name": "thrower", "type": "address" }, - { "internalType": "uint256", "name": "balance", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "thrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "OutOfQuoteCollateralForTransfer", "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" } + { + "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" @@ -94,8 +228,18 @@ { "anonymous": false, "inputs": [ - { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "nativeAmount", "type": "uint256" } + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nativeAmount", + "type": "uint256" + } ], "name": "BaseSent", "type": "event" @@ -103,12 +247,42 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "amountBaseSent", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amountQuoteSent", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lpBaseInsolvency", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lpQuoteInsolvency", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "LPBaseExcess", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "LPQuoteExcess", "type": "uint256" } + { + "indexed": false, + "internalType": "uint256", + "name": "amountBaseSent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountQuoteSent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lpBaseInsolvency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lpQuoteInsolvency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "LPBaseExcess", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "LPQuoteExcess", + "type": "uint256" + } ], "name": "BoardSettlementCollateralSent", "type": "event" @@ -116,31 +290,98 @@ { "anonymous": false, "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + { + "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" }], + "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": "settler", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "optionOwner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "strikePrice", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "priceAtExpiry", "type": "uint256" }, - { "indexed": false, "internalType": "enum OptionMarket.OptionType", "name": "optionType", "type": "uint8" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "settlementAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "insolventAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "longScaleFactor", "type": "uint256" } + { + "indexed": true, + "internalType": "uint256", + "name": "positionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "settler", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "optionOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "strikePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "priceAtExpiry", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "settlementAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "insolventAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "longScaleFactor", + "type": "uint256" + } ], "name": "PositionSettled", "type": "event" @@ -148,8 +389,18 @@ { "anonymous": false, "inputs": [ - { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "nativeAmount", "type": "uint256" } + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nativeAmount", + "type": "uint256" + } ], "name": "QuoteSent", "type": "event" @@ -157,39 +408,97 @@ { "inputs": [], "name": "LPBaseExcess", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "LPQuoteExcess", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, - { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ - { "internalType": "uint256", "name": "amountBase", "type": "uint256" }, - { "internalType": "uint256", "name": "amountQuote", "type": "uint256" } + { + "internalType": "uint256", + "name": "amountBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountQuote", + "type": "uint256" + } ], "name": "boardSettlement", "outputs": [ - { "internalType": "uint256", "name": "lpBaseInsolvency", "type": "uint256" }, - { "internalType": "uint256", "name": "lpQuoteInsolvency", "type": "uint256" } + { + "internalType": "uint256", + "name": "lpBaseInsolvency", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lpQuoteInsolvency", + "type": "uint256" + } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "contract OptionMarket", "name": "_optionMarket", "type": "address" }, - { "internalType": "contract LiquidityPool", "name": "_liquidityPool", "type": "address" }, - { "internalType": "contract OptionToken", "name": "_optionToken", "type": "address" }, - { "internalType": "contract BaseExchangeAdapter", "name": "_exchangeAdapter", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "_quoteAsset", "type": "address" }, - { "internalType": "contract IERC20Decimals", "name": "_baseAsset", "type": "address" } + { + "internalType": "contract OptionMarket", + "name": "_optionMarket", + "type": "address" + }, + { + "internalType": "contract LiquidityPool", + "name": "_liquidityPool", + "type": "address" + }, + { + "internalType": "contract OptionToken", + "name": "_optionToken", + "type": "address" + }, + { + "internalType": "contract BaseExchangeAdapter", + "name": "_exchangeAdapter", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "name": "_baseAsset", + "type": "address" + } ], "name": "init", "outputs": [], @@ -197,7 +506,13 @@ "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], "name": "nominateNewOwner", "outputs": [], "stateMutability": "nonpayable", @@ -206,30 +521,78 @@ { "inputs": [], "name": "nominatedOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "trader", "type": "address" }, - { "internalType": "address", "name": "liquidator", "type": "address" }, - { "internalType": "enum OptionMarket.OptionType", "name": "optionType", "type": "uint8" }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "enum OptionMarket.OptionType", + "name": "optionType", + "type": "uint8" + }, { "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": "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", @@ -243,8 +606,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "sendBaseCollateral", "outputs": [], @@ -253,8 +624,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "sendQuoteCollateral", "outputs": [], @@ -262,7 +641,13 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256[]", "name": "positionIds", "type": "uint256[]" }], + "inputs": [ + { + "internalType": "uint256[]", + "name": "positionIds", + "type": "uint256[]" + } + ], "name": "settleOptions", "outputs": [], "stateMutability": "nonpayable", diff --git a/sdk/src/contracts/newport/addresses/arbitrum-goerli.addresses.json b/sdk/src/contracts/newport/addresses/arbitrum-goerli.addresses.json index 636994c..015c8da 100644 --- a/sdk/src/contracts/newport/addresses/arbitrum-goerli.addresses.json +++ b/sdk/src/contracts/newport/addresses/arbitrum-goerli.addresses.json @@ -1,6 +1,6 @@ { - "OptionMarketViewer": "0x80998Ae17068841A03E9841A5D8aec2591e8206a", - "ExchangeAdapter": "0x6840315B675bfEF92F490AFB7248fF5343F3f4F4", - "LyraRegistry": "0x79030ef9c483cb44Df17BC372794E58f8E964Df7", - "TestFaucet": "0xDDf921266457A450468881D2b3EB1F9C06619071" + "OptionMarketViewer": "0xB582CC9483ee1F862364C92C22CFD57f0fb607bc", + "ExchangeAdapter": "0xD7A69233b82F53b416c839ff1fB6C51bA59180d2", + "LyraRegistry": "0x1034C04bC515F18e5D1dFe5a94de6e65e7277fF7", + "TestFaucet": "0xF2eDd52E32f8fE2eC76055C1A61958f1EFecb592" } diff --git a/sdk/src/contracts/newport/addresses/optimism-goerli.addresses.json b/sdk/src/contracts/newport/addresses/optimism-goerli.addresses.json index b7086b5..9c3c2c8 100644 --- a/sdk/src/contracts/newport/addresses/optimism-goerli.addresses.json +++ b/sdk/src/contracts/newport/addresses/optimism-goerli.addresses.json @@ -1,6 +1,6 @@ { - "OptionMarketViewer": "0xB1A73f15121E8833bc3063dF86A5682E818F3dde", - "ExchangeAdapter": "0x5D0216fB4Cfb86ae8F1890aBC8dE0950E309E769", - "LyraRegistry": "0x79030ef9c483cb44Df17BC372794E58f8E964Df7", - "TestFaucet": "0xf0a0d60Eb0293161394bCDe7aa917B4b786b3224" + "OptionMarketViewer": "0x4D0EB92F4CFcB6b4Cc9A88baF1f6Ad9E9C92380A", + "ExchangeAdapter": "0x46CeCCaf391aFF578963042790C2ee1F88661DDf", + "LyraRegistry": "0xB13E26A28979b32F157F030dC795DDAbF59fEac4", + "TestFaucet": "" } diff --git a/sdk/src/contracts/newport/addresses/optimism.addresses.json b/sdk/src/contracts/newport/addresses/optimism.addresses.json index 1b98a07..f862567 100644 --- a/sdk/src/contracts/newport/addresses/optimism.addresses.json +++ b/sdk/src/contracts/newport/addresses/optimism.addresses.json @@ -1,6 +1,6 @@ { - "OptionMarketViewer": "0x1c724a471d8ECC380C718a381D2f776813199A0E", - "ExchangeAdapter": "0x377337cD6B4aE0BeB898Dd690bB032D0507E65A6", - "LyraRegistry": "0x8D2e93c726D1e35adc8C81beE688ECBFEB62FD97", + "OptionMarketViewer": "0x136d92f1d103BA5267c85555b28787AE53Ee3CEF", + "ExchangeAdapter": "0x2b1dF9A55Ceb1bba7D830C1a6731ff37383c4A53", + "LyraRegistry": "0x0FEd189bCD4A680e05B153dC7c3dC87004e162fb", "TestFaucet": "" } \ No newline at end of file diff --git a/sdk/src/contracts/newport/arbitrum/abis/NewportOptionMarket.json b/sdk/src/contracts/newport/arbitrum/abis/NewportOptionMarket.json new file mode 100644 index 0000000..fbc08ef --- /dev/null +++ b/sdk/src/contracts/newport/arbitrum/abis/NewportOptionMarket.json @@ -0,0 +1,2081 @@ +[ + { + "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" + } + ], + "name": "CannotRecoverQuote", + "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": "uint256", + "name": "staticBaseSettlementFee", + "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" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "longScaleFactor", + "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" + }, + { + "internalType": "uint256", + "name": "staticBaseSettlementFee", + "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" + } + ], + "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": "positionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "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": "longScaleFactor", + "type": "uint256" + }, + { + "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": [], + "name": "baseAsset", + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "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": "address", + "name": "referrer", + "type": "address" + } + ], + "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": "boardId", + "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": "address", + "name": "referrer", + "type": "address" + } + ], + "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" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "getBoardStrikes", + "outputs": [ + { + "internalType": "uint256[]", + "name": "strikeIds", + "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": [], + "name": "getOptionMarketParams", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "maxBoardExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "securityModule", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feePortionReserved", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "staticBaseSettlementFee", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.OptionMarketParameters", + "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" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "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 BaseExchangeAdapter", + "name": "_exchangeAdapter", + "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 IERC20Decimals", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "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": "address", + "name": "referrer", + "type": "address" + } + ], + "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": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quoteAsset", + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "recoverFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "scaledLongsForBoard", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "uint256", + "name": "staticBaseSettlementFee", + "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" + } +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/typechain/NewportOptionMarket.ts b/sdk/src/contracts/newport/arbitrum/typechain/NewportOptionMarket.ts similarity index 100% rename from sdk/src/contracts/newport/typechain/NewportOptionMarket.ts rename to sdk/src/contracts/newport/arbitrum/typechain/NewportOptionMarket.ts diff --git a/sdk/src/contracts/newport/arbitrum/typechain/common.ts b/sdk/src/contracts/newport/arbitrum/typechain/common.ts new file mode 100644 index 0000000..4c90b08 --- /dev/null +++ b/sdk/src/contracts/newport/arbitrum/typechain/common.ts @@ -0,0 +1,46 @@ +/* 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< + TArgsArray extends Array = 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< + infer C, + any +> + ? C + : never; + +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never; + +export type PromiseOrValue = T | Promise; diff --git a/sdk/src/contracts/newport/typechain/factories/NewportOptionMarket__factory.ts b/sdk/src/contracts/newport/arbitrum/typechain/factories/NewportOptionMarket__factory.ts similarity index 100% rename from sdk/src/contracts/newport/typechain/factories/NewportOptionMarket__factory.ts rename to sdk/src/contracts/newport/arbitrum/typechain/factories/NewportOptionMarket__factory.ts diff --git a/sdk/src/contracts/newport/arbitrum/typechain/factories/index.ts b/sdk/src/contracts/newport/arbitrum/typechain/factories/index.ts new file mode 100644 index 0000000..fffe630 --- /dev/null +++ b/sdk/src/contracts/newport/arbitrum/typechain/factories/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { NewportOptionMarket__factory } from "./NewportOptionMarket__factory"; diff --git a/sdk/src/contracts/newport/arbitrum/typechain/index.ts b/sdk/src/contracts/newport/arbitrum/typechain/index.ts new file mode 100644 index 0000000..4ec318d --- /dev/null +++ b/sdk/src/contracts/newport/arbitrum/typechain/index.ts @@ -0,0 +1,6 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { NewportOptionMarket } from "./NewportOptionMarket"; +export * as factories from "./factories"; +export { NewportOptionMarket__factory } from "./factories/NewportOptionMarket__factory"; diff --git a/sdk/src/contracts/newport/optimism/abis/NewportOptionMarket.json b/sdk/src/contracts/newport/optimism/abis/NewportOptionMarket.json new file mode 100644 index 0000000..05e1318 --- /dev/null +++ b/sdk/src/contracts/newport/optimism/abis/NewportOptionMarket.json @@ -0,0 +1,2151 @@ +[ + { + "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": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "shortCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shortCollateralBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingCollateral", + "type": "uint256" + } + ], + "name": "BaseLimitExceeded", + "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" + } + ], + "name": "CannotRecoverQuote", + "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": "uint256", + "name": "staticBaseSettlementFee", + "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": false, + "internalType": "uint256", + "name": "baseLimit", + "type": "uint256" + } + ], + "name": "BaseLimitSet", + "type": "event" + }, + { + "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" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "longScaleFactor", + "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" + }, + { + "internalType": "uint256", + "name": "staticBaseSettlementFee", + "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" + } + ], + "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": "positionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "strikeId", + "type": "uint256" + }, + { + "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": "longScaleFactor", + "type": "uint256" + }, + { + "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": [], + "name": "baseAsset", + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": "address", + "name": "referrer", + "type": "address" + } + ], + "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": "boardId", + "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": "address", + "name": "referrer", + "type": "address" + } + ], + "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" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "boardId", + "type": "uint256" + } + ], + "name": "getBoardStrikes", + "outputs": [ + { + "internalType": "uint256[]", + "name": "strikeIds", + "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": [], + "name": "getOptionMarketParams", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "maxBoardExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "securityModule", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feePortionReserved", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "staticBaseSettlementFee", + "type": "uint256" + } + ], + "internalType": "struct OptionMarket.OptionMarketParameters", + "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" + }, + { + "internalType": "uint256", + "name": "longScaleFactor", + "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 BaseExchangeAdapter", + "name": "_exchangeAdapter", + "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 IERC20Decimals", + "name": "_quoteAsset", + "type": "address" + }, + { + "internalType": "contract IERC20Decimals", + "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": "address", + "name": "referrer", + "type": "address" + } + ], + "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": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quoteAsset", + "outputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Decimals", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "recoverFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "scaledLongsForBoard", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_baseLimit", + "type": "uint256" + } + ], + "name": "setBaseLimit", + "outputs": [], + "stateMutability": "nonpayable", + "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": "uint256", + "name": "staticBaseSettlementFee", + "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" + } +] \ No newline at end of file diff --git a/sdk/src/contracts/newport/optimism/typechain/NewportOptionMarket.ts b/sdk/src/contracts/newport/optimism/typechain/NewportOptionMarket.ts new file mode 100644 index 0000000..dd010b8 --- /dev/null +++ b/sdk/src/contracts/newport/optimism/typechain/NewportOptionMarket.ts @@ -0,0 +1,1960 @@ +/* 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, + PromiseOrValue, +} from "./common"; + +export declare namespace OptionMarket { + export type OptionMarketParametersStruct = { + maxBoardExpiry: PromiseOrValue; + securityModule: PromiseOrValue; + feePortionReserved: PromiseOrValue; + staticBaseSettlementFee: PromiseOrValue; + }; + + export type OptionMarketParametersStructOutput = [ + BigNumber, + string, + BigNumber, + BigNumber + ] & { + maxBoardExpiry: BigNumber; + securityModule: string; + feePortionReserved: BigNumber; + staticBaseSettlementFee: BigNumber; + }; + + export type TradeEventDataStruct = { + strikeId: PromiseOrValue; + expiry: PromiseOrValue; + strikePrice: PromiseOrValue; + optionType: PromiseOrValue; + tradeDirection: PromiseOrValue; + amount: PromiseOrValue; + setCollateralTo: PromiseOrValue; + isForceClose: PromiseOrValue; + spotPrice: PromiseOrValue; + reservedFee: PromiseOrValue; + totalCost: PromiseOrValue; + }; + + export type TradeEventDataStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + number, + number, + BigNumber, + BigNumber, + boolean, + BigNumber, + BigNumber, + BigNumber + ] & { + strikeId: 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: PromiseOrValue; + caller: PromiseOrValue; + returnCollateral: PromiseOrValue; + lpPremiums: PromiseOrValue; + lpFee: PromiseOrValue; + liquidatorFee: PromiseOrValue; + smFee: PromiseOrValue; + insolventAmount: PromiseOrValue; + }; + + 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: PromiseOrValue; + positionId: PromiseOrValue; + iterations: PromiseOrValue; + optionType: PromiseOrValue; + amount: PromiseOrValue; + setCollateralTo: PromiseOrValue; + minTotalCost: PromiseOrValue; + maxTotalCost: PromiseOrValue; + referrer: PromiseOrValue; + }; + + export type TradeInputParametersStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + number, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string + ] & { + strikeId: BigNumber; + positionId: BigNumber; + iterations: BigNumber; + optionType: number; + amount: BigNumber; + setCollateralTo: BigNumber; + minTotalCost: BigNumber; + maxTotalCost: BigNumber; + referrer: string; + }; + + export type ResultStruct = { + positionId: PromiseOrValue; + totalCost: PromiseOrValue; + totalFee: PromiseOrValue; + }; + + export type ResultStructOutput = [BigNumber, BigNumber, BigNumber] & { + positionId: BigNumber; + totalCost: BigNumber; + totalFee: BigNumber; + }; + + export type OptionBoardStruct = { + id: PromiseOrValue; + expiry: PromiseOrValue; + iv: PromiseOrValue; + frozen: PromiseOrValue; + strikeIds: PromiseOrValue[]; + }; + + export type OptionBoardStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + boolean, + BigNumber[] + ] & { + id: BigNumber; + expiry: BigNumber; + iv: BigNumber; + frozen: boolean; + strikeIds: BigNumber[]; + }; + + export type StrikeStruct = { + id: PromiseOrValue; + strikePrice: PromiseOrValue; + skew: PromiseOrValue; + longCall: PromiseOrValue; + shortCallBase: PromiseOrValue; + shortCallQuote: PromiseOrValue; + longPut: PromiseOrValue; + shortPut: PromiseOrValue; + boardId: PromiseOrValue; + }; + + 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: PromiseOrValue; + postTradeAmmNetStdVega: PromiseOrValue; + vegaUtil: PromiseOrValue; + volTraded: PromiseOrValue; + NAV: PromiseOrValue; + vegaUtilFee: PromiseOrValue; + }; + + 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: PromiseOrValue; + vega: PromiseOrValue; + vegaCoefficient: PromiseOrValue; + skew: PromiseOrValue; + skewCoefficient: PromiseOrValue; + ivVariance: PromiseOrValue; + ivVarianceCoefficient: PromiseOrValue; + varianceFee: PromiseOrValue; + }; + + 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: PromiseOrValue; + premium: PromiseOrValue; + optionPriceFee: PromiseOrValue; + spotPriceFee: PromiseOrValue; + vegaUtilFee: OptionMarketPricer.VegaUtilFeeComponentsStruct; + varianceFee: OptionMarketPricer.VarianceFeeComponentsStruct; + totalFee: PromiseOrValue; + totalCost: PromiseOrValue; + volTraded: PromiseOrValue; + newBaseIv: PromiseOrValue; + newSkew: PromiseOrValue; + }; + + 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 NewportOptionMarketInterface extends utils.Interface { + functions: { + "acceptOwnership()": FunctionFragment; + "addCollateral(uint256,uint256)": FunctionFragment; + "addStrikeToBoard(uint256,uint256,uint256)": FunctionFragment; + "baseAsset()": FunctionFragment; + "baseLimit()": FunctionFragment; + "boardToPriceAtExpiry(uint256)": FunctionFragment; + "closePosition((uint256,uint256,uint256,uint8,uint256,uint256,uint256,uint256,address))": FunctionFragment; + "createOptionBoard(uint256,uint256,uint256[],uint256[],bool)": FunctionFragment; + "forceClosePosition((uint256,uint256,uint256,uint8,uint256,uint256,uint256,uint256,address))": FunctionFragment; + "forceSettleBoard(uint256)": FunctionFragment; + "getBoardAndStrikeDetails(uint256)": FunctionFragment; + "getBoardStrikes(uint256)": FunctionFragment; + "getLiveBoards()": FunctionFragment; + "getNumLiveBoards()": FunctionFragment; + "getOptionBoard(uint256)": FunctionFragment; + "getOptionMarketParams()": 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,address))": FunctionFragment; + "owner()": FunctionFragment; + "quoteAsset()": FunctionFragment; + "recoverFunds(address,address)": FunctionFragment; + "scaledLongsForBoard(uint256)": FunctionFragment; + "setBaseLimit(uint256)": FunctionFragment; + "setBoardBaseIv(uint256,uint256)": FunctionFragment; + "setBoardFrozen(uint256,bool)": FunctionFragment; + "setOptionMarketParams((uint256,address,uint256,uint256))": FunctionFragment; + "setStrikeSkew(uint256,uint256)": FunctionFragment; + "settleExpiredBoard(uint256)": FunctionFragment; + "smClaim()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "addCollateral" + | "addStrikeToBoard" + | "baseAsset" + | "baseLimit" + | "boardToPriceAtExpiry" + | "closePosition" + | "createOptionBoard" + | "forceClosePosition" + | "forceSettleBoard" + | "getBoardAndStrikeDetails" + | "getBoardStrikes" + | "getLiveBoards" + | "getNumLiveBoards" + | "getOptionBoard" + | "getOptionMarketParams" + | "getSettlementParameters" + | "getStrike" + | "getStrikeAndBoard" + | "getStrikeAndExpiry" + | "init" + | "liquidatePosition" + | "nominateNewOwner" + | "nominatedOwner" + | "openPosition" + | "owner" + | "quoteAsset" + | "recoverFunds" + | "scaledLongsForBoard" + | "setBaseLimit" + | "setBoardBaseIv" + | "setBoardFrozen" + | "setOptionMarketParams" + | "setStrikeSkew" + | "settleExpiredBoard" + | "smClaim" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "addCollateral", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "addStrikeToBoard", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData(functionFragment: "baseAsset", values?: undefined): string; + encodeFunctionData(functionFragment: "baseLimit", values?: undefined): string; + encodeFunctionData( + functionFragment: "boardToPriceAtExpiry", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "closePosition", + values: [OptionMarket.TradeInputParametersStruct] + ): string; + encodeFunctionData( + functionFragment: "createOptionBoard", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue[], + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "forceClosePosition", + values: [OptionMarket.TradeInputParametersStruct] + ): string; + encodeFunctionData( + functionFragment: "forceSettleBoard", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getBoardAndStrikeDetails", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getBoardStrikes", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getLiveBoards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getNumLiveBoards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getOptionBoard", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getOptionMarketParams", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getSettlementParameters", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getStrike", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getStrikeAndBoard", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getStrikeAndExpiry", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "init", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "liquidatePosition", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "openPosition", + values: [OptionMarket.TradeInputParametersStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "quoteAsset", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "recoverFunds", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "scaledLongsForBoard", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setBaseLimit", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setBoardBaseIv", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setBoardFrozen", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setOptionMarketParams", + values: [OptionMarket.OptionMarketParametersStruct] + ): string; + encodeFunctionData( + functionFragment: "setStrikeSkew", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "settleExpiredBoard", + values: [PromiseOrValue] + ): string; + encodeFunctionData(functionFragment: "smClaim", values?: undefined): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addCollateral", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addStrikeToBoard", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "baseAsset", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "baseLimit", 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: "getOptionMarketParams", + 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: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "quoteAsset", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recoverFunds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "scaledLongsForBoard", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setBaseLimit", + 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; + + events: { + "BaseLimitSet(uint256)": EventFragment; + "BoardBaseIvSet(uint256,uint256)": EventFragment; + "BoardCreated(uint256,uint256,uint256,bool)": EventFragment; + "BoardFrozen(uint256,bool)": EventFragment; + "BoardSettled(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)": EventFragment; + "OptionMarketParamsSet(tuple)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "SMClaimed(address,uint256)": EventFragment; + "StrikeAdded(uint256,uint256,uint256,uint256)": EventFragment; + "StrikeSkewSet(uint256,uint256)": EventFragment; + "Trade(address,uint256,address,tuple,tuple[],tuple,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "BaseLimitSet"): 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 BaseLimitSetEventObject { + baseLimit: BigNumber; +} +export type BaseLimitSetEvent = TypedEvent< + [BigNumber], + BaseLimitSetEventObject +>; + +export type BaseLimitSetEventFilter = TypedEventFilter; + +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; + longScaleFactor: BigNumber; +} +export type BoardSettledEvent = TypedEvent< + [ + BigNumber, + 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; +} +export type SMClaimedEvent = TypedEvent< + [string, 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; + positionId: BigNumber; + referrer: string; + trade: OptionMarket.TradeEventDataStructOutput; + tradeResults: OptionMarketPricer.TradeResultStructOutput[]; + liquidation: OptionMarket.LiquidationEventDataStructOutput; + longScaleFactor: BigNumber; + timestamp: BigNumber; +} +export type TradeEvent = TypedEvent< + [ + string, + BigNumber, + string, + OptionMarket.TradeEventDataStructOutput, + OptionMarketPricer.TradeResultStructOutput[], + OptionMarket.LiquidationEventDataStructOutput, + BigNumber, + BigNumber + ], + TradeEventObject +>; + +export type TradeEventFilter = TypedEventFilter; + +export interface NewportOptionMarket extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: NewportOptionMarketInterface; + + 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?: PromiseOrValue } + ): Promise; + + addCollateral( + positionId: PromiseOrValue, + amountCollateral: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addStrikeToBoard( + boardId: PromiseOrValue, + strikePrice: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + baseAsset(overrides?: CallOverrides): Promise<[string]>; + + baseLimit(overrides?: CallOverrides): Promise<[BigNumber]>; + + boardToPriceAtExpiry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createOptionBoard( + expiry: PromiseOrValue, + baseIV: PromiseOrValue, + strikePrices: PromiseOrValue[], + skews: PromiseOrValue[], + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceSettleBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getBoardAndStrikeDetails( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [ + OptionMarket.OptionBoardStructOutput, + OptionMarket.StrikeStructOutput[], + BigNumber[], + BigNumber, + BigNumber + ] + >; + + getBoardStrikes( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber[]] & { strikeIds: BigNumber[] }>; + + getLiveBoards( + overrides?: CallOverrides + ): Promise<[BigNumber[]] & { _liveBoards: BigNumber[] }>; + + getNumLiveBoards( + overrides?: CallOverrides + ): Promise<[BigNumber] & { numLiveBoards: BigNumber }>; + + getOptionBoard( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[OptionMarket.OptionBoardStructOutput]>; + + getOptionMarketParams( + overrides?: CallOverrides + ): Promise<[OptionMarket.OptionMarketParametersStructOutput]>; + + getSettlementParameters( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + strikePrice: BigNumber; + priceAtExpiry: BigNumber; + strikeToBaseReturned: BigNumber; + longScaleFactor: BigNumber; + } + >; + + getStrike( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[OptionMarket.StrikeStructOutput]>; + + getStrikeAndBoard( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [OptionMarket.StrikeStructOutput, OptionMarket.OptionBoardStructOutput] + >; + + getStrikeAndExpiry( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { strikePrice: BigNumber; expiry: BigNumber } + >; + + init( + _exchangeAdapter: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _optionPricer: PromiseOrValue, + _greekCache: PromiseOrValue, + _shortCollateral: PromiseOrValue, + _optionToken: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _baseAsset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + liquidatePosition( + positionId: PromiseOrValue, + rewardBeneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + owner(overrides?: CallOverrides): Promise<[string]>; + + quoteAsset(overrides?: CallOverrides): Promise<[string]>; + + recoverFunds( + token: PromiseOrValue, + recipient: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + scaledLongsForBoard( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + setBaseLimit( + _baseLimit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardBaseIv( + boardId: PromiseOrValue, + baseIv: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardFrozen( + boardId: PromiseOrValue, + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setStrikeSkew( + strikeId: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + settleExpiredBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + smClaim( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addCollateral( + positionId: PromiseOrValue, + amountCollateral: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addStrikeToBoard( + boardId: PromiseOrValue, + strikePrice: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + baseAsset(overrides?: CallOverrides): Promise; + + baseLimit(overrides?: CallOverrides): Promise; + + boardToPriceAtExpiry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createOptionBoard( + expiry: PromiseOrValue, + baseIV: PromiseOrValue, + strikePrices: PromiseOrValue[], + skews: PromiseOrValue[], + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceSettleBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getBoardAndStrikeDetails( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [ + OptionMarket.OptionBoardStructOutput, + OptionMarket.StrikeStructOutput[], + BigNumber[], + BigNumber, + BigNumber + ] + >; + + getBoardStrikes( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getOptionMarketParams( + overrides?: CallOverrides + ): Promise; + + getSettlementParameters( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + strikePrice: BigNumber; + priceAtExpiry: BigNumber; + strikeToBaseReturned: BigNumber; + longScaleFactor: BigNumber; + } + >; + + getStrike( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrikeAndBoard( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [OptionMarket.StrikeStructOutput, OptionMarket.OptionBoardStructOutput] + >; + + getStrikeAndExpiry( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { strikePrice: BigNumber; expiry: BigNumber } + >; + + init( + _exchangeAdapter: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _optionPricer: PromiseOrValue, + _greekCache: PromiseOrValue, + _shortCollateral: PromiseOrValue, + _optionToken: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _baseAsset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + liquidatePosition( + positionId: PromiseOrValue, + rewardBeneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + quoteAsset(overrides?: CallOverrides): Promise; + + recoverFunds( + token: PromiseOrValue, + recipient: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + scaledLongsForBoard( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setBaseLimit( + _baseLimit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardBaseIv( + boardId: PromiseOrValue, + baseIv: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardFrozen( + boardId: PromiseOrValue, + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setStrikeSkew( + strikeId: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + settleExpiredBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + smClaim( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + addCollateral( + positionId: PromiseOrValue, + amountCollateral: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + addStrikeToBoard( + boardId: PromiseOrValue, + strikePrice: PromiseOrValue, + skew: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + baseAsset(overrides?: CallOverrides): Promise; + + baseLimit(overrides?: CallOverrides): Promise; + + boardToPriceAtExpiry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: CallOverrides + ): Promise; + + createOptionBoard( + expiry: PromiseOrValue, + baseIV: PromiseOrValue, + strikePrices: PromiseOrValue[], + skews: PromiseOrValue[], + frozen: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: CallOverrides + ): Promise; + + forceSettleBoard( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getBoardAndStrikeDetails( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [ + OptionMarket.OptionBoardStructOutput, + OptionMarket.StrikeStructOutput[], + BigNumber[], + BigNumber, + BigNumber + ] + >; + + getBoardStrikes( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getOptionMarketParams( + overrides?: CallOverrides + ): Promise; + + getSettlementParameters( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + strikePrice: BigNumber; + priceAtExpiry: BigNumber; + strikeToBaseReturned: BigNumber; + longScaleFactor: BigNumber; + } + >; + + getStrike( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrikeAndBoard( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [OptionMarket.StrikeStructOutput, OptionMarket.OptionBoardStructOutput] + >; + + getStrikeAndExpiry( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { strikePrice: BigNumber; expiry: BigNumber } + >; + + init( + _exchangeAdapter: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _optionPricer: PromiseOrValue, + _greekCache: PromiseOrValue, + _shortCollateral: PromiseOrValue, + _optionToken: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _baseAsset: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + liquidatePosition( + positionId: PromiseOrValue, + rewardBeneficiary: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + quoteAsset(overrides?: CallOverrides): Promise; + + recoverFunds( + token: PromiseOrValue, + recipient: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + scaledLongsForBoard( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setBaseLimit( + _baseLimit: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setBoardBaseIv( + boardId: PromiseOrValue, + baseIv: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setBoardFrozen( + boardId: PromiseOrValue, + frozen: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: CallOverrides + ): Promise; + + setStrikeSkew( + strikeId: PromiseOrValue, + skew: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + settleExpiredBoard( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + smClaim(overrides?: CallOverrides): Promise; + }; + + filters: { + "BaseLimitSet(uint256)"(baseLimit?: null): BaseLimitSetEventFilter; + BaseLimitSet(baseLimit?: null): BaseLimitSetEventFilter; + + "BoardBaseIvSet(uint256,uint256)"( + boardId?: PromiseOrValue | null, + baseIv?: null + ): BoardBaseIvSetEventFilter; + BoardBaseIvSet( + boardId?: PromiseOrValue | null, + baseIv?: null + ): BoardBaseIvSetEventFilter; + + "BoardCreated(uint256,uint256,uint256,bool)"( + boardId?: PromiseOrValue | null, + expiry?: null, + baseIv?: null, + frozen?: null + ): BoardCreatedEventFilter; + BoardCreated( + boardId?: PromiseOrValue | null, + expiry?: null, + baseIv?: null, + frozen?: null + ): BoardCreatedEventFilter; + + "BoardFrozen(uint256,bool)"( + boardId?: PromiseOrValue | null, + frozen?: null + ): BoardFrozenEventFilter; + BoardFrozen( + boardId?: PromiseOrValue | null, + frozen?: null + ): BoardFrozenEventFilter; + + "BoardSettled(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)"( + boardId?: PromiseOrValue | null, + spotPriceAtExpiry?: null, + totalUserLongProfitQuote?: null, + totalBoardLongCallCollateral?: null, + totalBoardLongPutCollateral?: null, + totalAMMShortCallProfitBase?: null, + totalAMMShortCallProfitQuote?: null, + totalAMMShortPutProfitQuote?: null, + longScaleFactor?: null + ): BoardSettledEventFilter; + BoardSettled( + boardId?: PromiseOrValue | null, + spotPriceAtExpiry?: null, + totalUserLongProfitQuote?: null, + totalBoardLongCallCollateral?: null, + totalBoardLongPutCollateral?: null, + totalAMMShortCallProfitBase?: null, + totalAMMShortCallProfitQuote?: null, + totalAMMShortPutProfitQuote?: null, + longScaleFactor?: 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)"( + securityModule?: null, + quoteAmount?: null + ): SMClaimedEventFilter; + SMClaimed(securityModule?: null, quoteAmount?: null): SMClaimedEventFilter; + + "StrikeAdded(uint256,uint256,uint256,uint256)"( + boardId?: PromiseOrValue | null, + strikeId?: PromiseOrValue | null, + strikePrice?: null, + skew?: null + ): StrikeAddedEventFilter; + StrikeAdded( + boardId?: PromiseOrValue | null, + strikeId?: PromiseOrValue | null, + strikePrice?: null, + skew?: null + ): StrikeAddedEventFilter; + + "StrikeSkewSet(uint256,uint256)"( + strikeId?: PromiseOrValue | null, + skew?: null + ): StrikeSkewSetEventFilter; + StrikeSkewSet( + strikeId?: PromiseOrValue | null, + skew?: null + ): StrikeSkewSetEventFilter; + + "Trade(address,uint256,address,tuple,tuple[],tuple,uint256,uint256)"( + trader?: PromiseOrValue | null, + positionId?: PromiseOrValue | null, + referrer?: PromiseOrValue | null, + trade?: null, + tradeResults?: null, + liquidation?: null, + longScaleFactor?: null, + timestamp?: null + ): TradeEventFilter; + Trade( + trader?: PromiseOrValue | null, + positionId?: PromiseOrValue | null, + referrer?: PromiseOrValue | null, + trade?: null, + tradeResults?: null, + liquidation?: null, + longScaleFactor?: null, + timestamp?: null + ): TradeEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addCollateral( + positionId: PromiseOrValue, + amountCollateral: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addStrikeToBoard( + boardId: PromiseOrValue, + strikePrice: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + baseAsset(overrides?: CallOverrides): Promise; + + baseLimit(overrides?: CallOverrides): Promise; + + boardToPriceAtExpiry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createOptionBoard( + expiry: PromiseOrValue, + baseIV: PromiseOrValue, + strikePrices: PromiseOrValue[], + skews: PromiseOrValue[], + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceSettleBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getBoardAndStrikeDetails( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getBoardStrikes( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getOptionMarketParams(overrides?: CallOverrides): Promise; + + getSettlementParameters( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrike( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrikeAndBoard( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrikeAndExpiry( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + init( + _exchangeAdapter: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _optionPricer: PromiseOrValue, + _greekCache: PromiseOrValue, + _shortCollateral: PromiseOrValue, + _optionToken: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _baseAsset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + liquidatePosition( + positionId: PromiseOrValue, + rewardBeneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + quoteAsset(overrides?: CallOverrides): Promise; + + recoverFunds( + token: PromiseOrValue, + recipient: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + scaledLongsForBoard( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setBaseLimit( + _baseLimit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardBaseIv( + boardId: PromiseOrValue, + baseIv: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardFrozen( + boardId: PromiseOrValue, + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setStrikeSkew( + strikeId: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + settleExpiredBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + smClaim( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addCollateral( + positionId: PromiseOrValue, + amountCollateral: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addStrikeToBoard( + boardId: PromiseOrValue, + strikePrice: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + baseAsset(overrides?: CallOverrides): Promise; + + baseLimit(overrides?: CallOverrides): Promise; + + boardToPriceAtExpiry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + closePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createOptionBoard( + expiry: PromiseOrValue, + baseIV: PromiseOrValue, + strikePrices: PromiseOrValue[], + skews: PromiseOrValue[], + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceClosePosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceSettleBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getBoardAndStrikeDetails( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getBoardStrikes( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getLiveBoards(overrides?: CallOverrides): Promise; + + getNumLiveBoards(overrides?: CallOverrides): Promise; + + getOptionBoard( + boardId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getOptionMarketParams( + overrides?: CallOverrides + ): Promise; + + getSettlementParameters( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrike( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrikeAndBoard( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStrikeAndExpiry( + strikeId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + init( + _exchangeAdapter: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _optionPricer: PromiseOrValue, + _greekCache: PromiseOrValue, + _shortCollateral: PromiseOrValue, + _optionToken: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _baseAsset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + liquidatePosition( + positionId: PromiseOrValue, + rewardBeneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + openPosition( + params: OptionMarket.TradeInputParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + quoteAsset(overrides?: CallOverrides): Promise; + + recoverFunds( + token: PromiseOrValue, + recipient: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + scaledLongsForBoard( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setBaseLimit( + _baseLimit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardBaseIv( + boardId: PromiseOrValue, + baseIv: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setBoardFrozen( + boardId: PromiseOrValue, + frozen: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setOptionMarketParams( + _optionMarketParams: OptionMarket.OptionMarketParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setStrikeSkew( + strikeId: PromiseOrValue, + skew: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + settleExpiredBoard( + boardId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + smClaim( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/sdk/src/contracts/newport/optimism/typechain/common.ts b/sdk/src/contracts/newport/optimism/typechain/common.ts new file mode 100644 index 0000000..4c90b08 --- /dev/null +++ b/sdk/src/contracts/newport/optimism/typechain/common.ts @@ -0,0 +1,46 @@ +/* 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< + TArgsArray extends Array = 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< + infer C, + any +> + ? C + : never; + +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never; + +export type PromiseOrValue = T | Promise; diff --git a/sdk/src/contracts/newport/optimism/typechain/factories/NewportOptionMarket__factory.ts b/sdk/src/contracts/newport/optimism/typechain/factories/NewportOptionMarket__factory.ts new file mode 100644 index 0000000..f529f42 --- /dev/null +++ b/sdk/src/contracts/newport/optimism/typechain/factories/NewportOptionMarket__factory.ts @@ -0,0 +1,2175 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + NewportOptionMarket, + NewportOptionMarketInterface, +} from "../NewportOptionMarket"; + +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: "trader", + type: "address", + }, + { + internalType: "address", + name: "shortCollateral", + type: "address", + }, + { + internalType: "uint256", + name: "shortCollateralBalance", + type: "uint256", + }, + { + internalType: "uint256", + name: "pendingCollateral", + type: "uint256", + }, + ], + name: "BaseLimitExceeded", + 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", + }, + ], + name: "CannotRecoverQuote", + 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: "uint256", + name: "staticBaseSettlementFee", + 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: false, + internalType: "uint256", + name: "baseLimit", + type: "uint256", + }, + ], + name: "BaseLimitSet", + type: "event", + }, + { + 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", + }, + { + indexed: false, + internalType: "uint256", + name: "longScaleFactor", + 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", + }, + { + internalType: "uint256", + name: "staticBaseSettlementFee", + 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", + }, + ], + 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: "positionId", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "referrer", + type: "address", + }, + { + components: [ + { + internalType: "uint256", + name: "strikeId", + type: "uint256", + }, + { + 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: "longScaleFactor", + type: "uint256", + }, + { + 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: [], + name: "baseAsset", + outputs: [ + { + internalType: "contract IERC20Decimals", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "baseLimit", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + 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: "address", + name: "referrer", + type: "address", + }, + ], + 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: "boardId", + 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: "address", + name: "referrer", + type: "address", + }, + ], + 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", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "boardId", + type: "uint256", + }, + ], + name: "getBoardStrikes", + outputs: [ + { + internalType: "uint256[]", + name: "strikeIds", + 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: [], + name: "getOptionMarketParams", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "maxBoardExpiry", + type: "uint256", + }, + { + internalType: "address", + name: "securityModule", + type: "address", + }, + { + internalType: "uint256", + name: "feePortionReserved", + type: "uint256", + }, + { + internalType: "uint256", + name: "staticBaseSettlementFee", + type: "uint256", + }, + ], + internalType: "struct OptionMarket.OptionMarketParameters", + 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", + }, + { + internalType: "uint256", + name: "longScaleFactor", + 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 BaseExchangeAdapter", + name: "_exchangeAdapter", + 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 IERC20Decimals", + name: "_quoteAsset", + type: "address", + }, + { + internalType: "contract IERC20Decimals", + 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: "address", + name: "referrer", + type: "address", + }, + ], + 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: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "quoteAsset", + outputs: [ + { + internalType: "contract IERC20Decimals", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IERC20Decimals", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + ], + name: "recoverFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "scaledLongsForBoard", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_baseLimit", + type: "uint256", + }, + ], + name: "setBaseLimit", + outputs: [], + stateMutability: "nonpayable", + 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: "uint256", + name: "staticBaseSettlementFee", + 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", + }, +]; + +export class NewportOptionMarket__factory { + static readonly abi = _abi; + static createInterface(): NewportOptionMarketInterface { + return new utils.Interface(_abi) as NewportOptionMarketInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): NewportOptionMarket { + return new Contract(address, _abi, signerOrProvider) as NewportOptionMarket; + } +} diff --git a/sdk/src/contracts/newport/optimism/typechain/factories/index.ts b/sdk/src/contracts/newport/optimism/typechain/factories/index.ts new file mode 100644 index 0000000..fffe630 --- /dev/null +++ b/sdk/src/contracts/newport/optimism/typechain/factories/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { NewportOptionMarket__factory } from "./NewportOptionMarket__factory"; diff --git a/sdk/src/contracts/newport/optimism/typechain/index.ts b/sdk/src/contracts/newport/optimism/typechain/index.ts new file mode 100644 index 0000000..4ec318d --- /dev/null +++ b/sdk/src/contracts/newport/optimism/typechain/index.ts @@ -0,0 +1,6 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { NewportOptionMarket } from "./NewportOptionMarket"; +export * as factories from "./factories"; +export { NewportOptionMarket__factory } from "./factories/NewportOptionMarket__factory"; diff --git a/sdk/src/contracts/newport/typechain/NewportLiquidityPool.ts b/sdk/src/contracts/newport/typechain/NewportLiquidityPool.ts index c4bde84..0d452b4 100644 --- a/sdk/src/contracts/newport/typechain/NewportLiquidityPool.ts +++ b/sdk/src/contracts/newport/typechain/NewportLiquidityPool.ts @@ -143,8 +143,8 @@ export interface NewportLiquidityPoolInterface extends utils.Interface { "initiateWithdraw(address,uint256)": FunctionFragment; "insolventSettlementAmount()": FunctionFragment; "liquidationInsolventAmount()": FunctionFragment; - "lockCallCollateral(uint256,uint256,uint256)": FunctionFragment; - "lockPutCollateral(uint256,uint256)": FunctionFragment; + "lockCallCollateral(uint256,uint256,uint256,uint256)": FunctionFragment; + "lockPutCollateral(uint256,uint256,uint256)": FunctionFragment; "lockedCollateral()": FunctionFragment; "lpParams()": FunctionFragment; "nextQueuedDepositId()": FunctionFragment; @@ -165,7 +165,7 @@ export interface NewportLiquidityPoolInterface extends utils.Interface { "reclaimInsolventQuote(uint256)": FunctionFragment; "recoverFunds(address,address)": FunctionFragment; "sendSettlementValue(address,uint256)": FunctionFragment; - "sendShortPremium(address,uint256,uint256,uint256,uint256,bool)": FunctionFragment; + "sendShortPremium(address,uint256,uint256,uint256,uint256,bool,uint256)": FunctionFragment; "setCircuitBreakerParameters((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))": FunctionFragment; "setLiquidityPoolParameters((uint256,uint256,uint256,uint256,address,uint256,uint256,uint256,uint256))": FunctionFragment; "setPoolHedger(address)": FunctionFragment; @@ -334,6 +334,7 @@ export interface NewportLiquidityPoolInterface extends utils.Interface { encodeFunctionData( functionFragment: "lockCallCollateral", values: [ + PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue @@ -341,7 +342,11 @@ export interface NewportLiquidityPoolInterface extends utils.Interface { ): string; encodeFunctionData( functionFragment: "lockPutCollateral", - values: [PromiseOrValue, PromiseOrValue] + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] ): string; encodeFunctionData( functionFragment: "lockedCollateral", @@ -425,7 +430,8 @@ export interface NewportLiquidityPoolInterface extends utils.Interface { PromiseOrValue, PromiseOrValue, PromiseOrValue, - PromiseOrValue + PromiseOrValue, + PromiseOrValue ] ): string; encodeFunctionData( @@ -1204,12 +1210,14 @@ export interface NewportLiquidityPool extends BaseContract { amount: PromiseOrValue, spotPrice: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; lockPutCollateral( amount: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1331,6 +1339,7 @@ export interface NewportLiquidityPool extends BaseContract { freeLiquidity: PromiseOrValue, reservedFee: PromiseOrValue, isCall: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1492,12 +1501,14 @@ export interface NewportLiquidityPool extends BaseContract { amount: PromiseOrValue, spotPrice: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; lockPutCollateral( amount: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1619,6 +1630,7 @@ export interface NewportLiquidityPool extends BaseContract { freeLiquidity: PromiseOrValue, reservedFee: PromiseOrValue, isCall: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1774,12 +1786,14 @@ export interface NewportLiquidityPool extends BaseContract { amount: PromiseOrValue, spotPrice: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: CallOverrides ): Promise; lockPutCollateral( amount: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: CallOverrides ): Promise; @@ -1901,6 +1915,7 @@ export interface NewportLiquidityPool extends BaseContract { freeLiquidity: PromiseOrValue, reservedFee: PromiseOrValue, isCall: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: CallOverrides ): Promise; @@ -2304,12 +2319,14 @@ export interface NewportLiquidityPool extends BaseContract { amount: PromiseOrValue, spotPrice: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; lockPutCollateral( amount: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -2389,6 +2406,7 @@ export interface NewportLiquidityPool extends BaseContract { freeLiquidity: PromiseOrValue, reservedFee: PromiseOrValue, isCall: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -2523,12 +2541,14 @@ export interface NewportLiquidityPool extends BaseContract { amount: PromiseOrValue, spotPrice: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; lockPutCollateral( amount: PromiseOrValue, freeLiquidity: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -2614,6 +2634,7 @@ export interface NewportLiquidityPool extends BaseContract { freeLiquidity: PromiseOrValue, reservedFee: PromiseOrValue, isCall: PromiseOrValue, + strikeId: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; diff --git a/sdk/src/contracts/newport/typechain/NewportSNXPerpV2Adapter.ts b/sdk/src/contracts/newport/typechain/NewportSNXPerpV2Adapter.ts new file mode 100644 index 0000000..54c25eb --- /dev/null +++ b/sdk/src/contracts/newport/typechain/NewportSNXPerpV2Adapter.ts @@ -0,0 +1,1710 @@ +/* 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, + PromiseOrValue, +} from "./common"; + +export declare namespace SNXPerpV2Adapter { + export type UniswapPoolInfoStruct = { + pool: PromiseOrValue; + feeTier: PromiseOrValue; + }; + + export type UniswapPoolInfoStructOutput = [string, number] & { + pool: string; + feeTier: number; + }; + + export type MarketAdapterConfigurationStruct = { + staticEstimationDiscount: PromiseOrValue; + snxPerpV2MarketAddress: PromiseOrValue; + uniswapInfo: SNXPerpV2Adapter.UniswapPoolInfoStruct; + }; + + export type MarketAdapterConfigurationStructOutput = [ + BigNumber, + string, + SNXPerpV2Adapter.UniswapPoolInfoStructOutput + ] & { + staticEstimationDiscount: BigNumber; + snxPerpV2MarketAddress: string; + uniswapInfo: SNXPerpV2Adapter.UniswapPoolInfoStructOutput; + }; + + export type MarketAdapterStateStruct = { + config: SNXPerpV2Adapter.MarketAdapterConfigurationStruct; + snxPrice: PromiseOrValue; + riskFreeRate: PromiseOrValue; + }; + + export type MarketAdapterStateStructOutput = [ + SNXPerpV2Adapter.MarketAdapterConfigurationStructOutput, + BigNumber, + BigNumber + ] & { + config: SNXPerpV2Adapter.MarketAdapterConfigurationStructOutput; + snxPrice: BigNumber; + riskFreeRate: BigNumber; + }; +} + +export interface NewportSNXPerpV2AdapterInterface extends utils.Interface { + functions: { + "acceptOwnership()": FunctionFragment; + "addressResolver()": FunctionFragment; + "approveRouter(address)": FunctionFragment; + "estimateExchangeToExactBase(address,uint256)": FunctionFragment; + "estimateExchangeToExactQuote(address,uint256)": FunctionFragment; + "exchangeFromExactBase(address,uint256)": FunctionFragment; + "exchangeFromExactQuote(address,uint256)": FunctionFragment; + "exchangeToExactBase(address,uint256)": FunctionFragment; + "exchangeToExactBaseWithLimit(address,uint256,uint256)": FunctionFragment; + "exchangeToExactQuote(address,uint256)": FunctionFragment; + "exchangeToExactQuoteWithLimit(address,uint256,uint256)": FunctionFragment; + "getAdapterState(address)": FunctionFragment; + "getPrices(address)": FunctionFragment; + "getSettlementPriceForMarket(address,uint256)": FunctionFragment; + "getSpotPriceForMarket(address,uint8)": FunctionFragment; + "initialize()": FunctionFragment; + "isGlobalPaused()": FunctionFragment; + "isMarketPaused(address)": FunctionFragment; + "marketConfigurations(address)": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "rateAndCarry(address)": FunctionFragment; + "requireNotGlobalPaused(address)": FunctionFragment; + "requireNotMarketPaused(address)": FunctionFragment; + "setAddressResolver(address)": FunctionFragment; + "setGlobalPaused(bool)": FunctionFragment; + "setMarketAdapterConfiguration(address,uint256,address,address,uint24)": FunctionFragment; + "setMarketPaused(address,bool)": FunctionFragment; + "setRiskFreeRate(address,int256)": FunctionFragment; + "setUniSwapDeviation(uint256)": FunctionFragment; + "setUniswapRouter(address)": FunctionFragment; + "swapRouter()": FunctionFragment; + "systemStatus()": FunctionFragment; + "uniDeviation()": FunctionFragment; + "updateSynthetixAddresses()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "addressResolver" + | "approveRouter" + | "estimateExchangeToExactBase" + | "estimateExchangeToExactQuote" + | "exchangeFromExactBase" + | "exchangeFromExactQuote" + | "exchangeToExactBase" + | "exchangeToExactBaseWithLimit" + | "exchangeToExactQuote" + | "exchangeToExactQuoteWithLimit" + | "getAdapterState" + | "getPrices" + | "getSettlementPriceForMarket" + | "getSpotPriceForMarket" + | "initialize" + | "isGlobalPaused" + | "isMarketPaused" + | "marketConfigurations" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "rateAndCarry" + | "requireNotGlobalPaused" + | "requireNotMarketPaused" + | "setAddressResolver" + | "setGlobalPaused" + | "setMarketAdapterConfiguration" + | "setMarketPaused" + | "setRiskFreeRate" + | "setUniSwapDeviation" + | "setUniswapRouter" + | "swapRouter" + | "systemStatus" + | "uniDeviation" + | "updateSynthetixAddresses" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "addressResolver", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "approveRouter", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "estimateExchangeToExactBase", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "estimateExchangeToExactQuote", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "exchangeFromExactBase", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "exchangeFromExactQuote", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "exchangeToExactBase", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "exchangeToExactBaseWithLimit", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "exchangeToExactQuote", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "exchangeToExactQuoteWithLimit", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "getAdapterState", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getPrices", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getSettlementPriceForMarket", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getSpotPriceForMarket", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "initialize", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isGlobalPaused", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isMarketPaused", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "marketConfigurations", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "rateAndCarry", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "requireNotGlobalPaused", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "requireNotMarketPaused", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setAddressResolver", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setGlobalPaused", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setMarketAdapterConfiguration", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "setMarketPaused", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setRiskFreeRate", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setUniSwapDeviation", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setUniswapRouter", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "swapRouter", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "systemStatus", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "uniDeviation", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "updateSynthetixAddresses", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addressResolver", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "approveRouter", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "estimateExchangeToExactBase", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "estimateExchangeToExactQuote", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeFromExactBase", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeFromExactQuote", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeToExactBase", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeToExactBaseWithLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeToExactQuote", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeToExactQuoteWithLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAdapterState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getPrices", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getSettlementPriceForMarket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSpotPriceForMarket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isGlobalPaused", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isMarketPaused", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "marketConfigurations", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rateAndCarry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireNotGlobalPaused", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireNotMarketPaused", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAddressResolver", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setGlobalPaused", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMarketAdapterConfiguration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMarketPaused", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setRiskFreeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setUniSwapDeviation", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setUniswapRouter", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "swapRouter", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "systemStatus", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniDeviation", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateSynthetixAddresses", + data: BytesLike + ): Result; + + events: { + "AddressResolverUpdated(address)": EventFragment; + "BaseSwappedForQuote(address,address,uint256,uint256)": EventFragment; + "ExchangeToExactBaseWithLimit(address,uint256,uint256)": EventFragment; + "ExchangedFromExactBase(address,uint256,uint256)": EventFragment; + "GlobalPausedSet(bool)": EventFragment; + "MarketAdapterConfigurationUpdated(address,uint256,address,address,uint256)": EventFragment; + "MarketPausedSet(address,bool)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "QuoteSwappedForBase(address,address,uint256,uint256)": EventFragment; + "RiskFreeRateUpdated(address,int256)": EventFragment; + "RouterApproved(address,address)": EventFragment; + "SynthetixSystemStatusUpdated(address)": EventFragment; + "UniDeviationUpdated(uint256)": EventFragment; + "UniswapRouterUpdated(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AddressResolverUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "BaseSwappedForQuote"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "ExchangeToExactBaseWithLimit" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangedFromExactBase"): EventFragment; + getEvent(nameOrSignatureOrTopic: "GlobalPausedSet"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "MarketAdapterConfigurationUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "MarketPausedSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "QuoteSwappedForBase"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RiskFreeRateUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RouterApproved"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "SynthetixSystemStatusUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "UniDeviationUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "UniswapRouterUpdated"): EventFragment; +} + +export interface AddressResolverUpdatedEventObject { + addressResolver: string; +} +export type AddressResolverUpdatedEvent = TypedEvent< + [string], + AddressResolverUpdatedEventObject +>; + +export type AddressResolverUpdatedEventFilter = + TypedEventFilter; + +export interface BaseSwappedForQuoteEventObject { + marketAddress: string; + exchanger: string; + baseSwapped: BigNumber; + quoteReceived: BigNumber; +} +export type BaseSwappedForQuoteEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + BaseSwappedForQuoteEventObject +>; + +export type BaseSwappedForQuoteEventFilter = + TypedEventFilter; + +export interface ExchangeToExactBaseWithLimitEventObject { + optionMarket: string; + quoteSpentD18: BigNumber; + baseAssetinD18: BigNumber; +} +export type ExchangeToExactBaseWithLimitEvent = TypedEvent< + [string, BigNumber, BigNumber], + ExchangeToExactBaseWithLimitEventObject +>; + +export type ExchangeToExactBaseWithLimitEventFilter = + TypedEventFilter; + +export interface ExchangedFromExactBaseEventObject { + optionMarket: string; + quoteSpentD18: BigNumber; + baseAssetinD18: BigNumber; +} +export type ExchangedFromExactBaseEvent = TypedEvent< + [string, BigNumber, BigNumber], + ExchangedFromExactBaseEventObject +>; + +export type ExchangedFromExactBaseEventFilter = + TypedEventFilter; + +export interface GlobalPausedSetEventObject { + isPaused: boolean; +} +export type GlobalPausedSetEvent = TypedEvent< + [boolean], + GlobalPausedSetEventObject +>; + +export type GlobalPausedSetEventFilter = TypedEventFilter; + +export interface MarketAdapterConfigurationUpdatedEventObject { + optionMarket: string; + staticEstimationDiscount: BigNumber; + snxPerpV2Market: string; + uniswapPool: string; + feeTier: BigNumber; +} +export type MarketAdapterConfigurationUpdatedEvent = TypedEvent< + [string, BigNumber, string, string, BigNumber], + MarketAdapterConfigurationUpdatedEventObject +>; + +export type MarketAdapterConfigurationUpdatedEventFilter = + TypedEventFilter; + +export interface MarketPausedSetEventObject { + contractAddress: string; + isPaused: boolean; +} +export type MarketPausedSetEvent = TypedEvent< + [string, boolean], + MarketPausedSetEventObject +>; + +export type MarketPausedSetEventFilter = 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 QuoteSwappedForBaseEventObject { + marketAddress: string; + exchanger: string; + quoteSwapped: BigNumber; + baseReceived: BigNumber; +} +export type QuoteSwappedForBaseEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + QuoteSwappedForBaseEventObject +>; + +export type QuoteSwappedForBaseEventFilter = + TypedEventFilter; + +export interface RiskFreeRateUpdatedEventObject { + optionMarket: string; + riskFreeRate: BigNumber; +} +export type RiskFreeRateUpdatedEvent = TypedEvent< + [string, BigNumber], + RiskFreeRateUpdatedEventObject +>; + +export type RiskFreeRateUpdatedEventFilter = + TypedEventFilter; + +export interface RouterApprovedEventObject { + asset: string; + uniswapRouter: string; +} +export type RouterApprovedEvent = TypedEvent< + [string, string], + RouterApprovedEventObject +>; + +export type RouterApprovedEventFilter = TypedEventFilter; + +export interface SynthetixSystemStatusUpdatedEventObject { + synthetixSystemStatus: string; +} +export type SynthetixSystemStatusUpdatedEvent = TypedEvent< + [string], + SynthetixSystemStatusUpdatedEventObject +>; + +export type SynthetixSystemStatusUpdatedEventFilter = + TypedEventFilter; + +export interface UniDeviationUpdatedEventObject { + deviation: BigNumber; +} +export type UniDeviationUpdatedEvent = TypedEvent< + [BigNumber], + UniDeviationUpdatedEventObject +>; + +export type UniDeviationUpdatedEventFilter = + TypedEventFilter; + +export interface UniswapRouterUpdatedEventObject { + uniswapRouter: string; +} +export type UniswapRouterUpdatedEvent = TypedEvent< + [string], + UniswapRouterUpdatedEventObject +>; + +export type UniswapRouterUpdatedEventFilter = + TypedEventFilter; + +export interface NewportSNXPerpV2Adapter extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: NewportSNXPerpV2AdapterInterface; + + 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?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise<[string]>; + + approveRouter( + asset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + estimateExchangeToExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber] & { quoteNeededD18: BigNumber }>; + + estimateExchangeToExactQuote( + _optionMarket: PromiseOrValue, + _amountQuoteD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber] & { baseNeededD18: BigNumber }>; + + exchangeFromExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeFromExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBase( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBaseWithLimit( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + _quoteLimitD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuoteWithLimit( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getAdapterState( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[SNXPerpV2Adapter.MarketAdapterStateStructOutput]>; + + getPrices( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getSettlementPriceForMarket( + _optionMarket: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber] & { spotPrice: BigNumber }>; + + getSpotPriceForMarket( + optionMarket: PromiseOrValue, + pricing: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber] & { spotPrice: BigNumber }>; + + initialize( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isGlobalPaused(overrides?: CallOverrides): Promise<[boolean]>; + + isMarketPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + + marketConfigurations( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, string, SNXPerpV2Adapter.UniswapPoolInfoStructOutput] & { + staticEstimationDiscount: BigNumber; + snxPerpV2MarketAddress: string; + uniswapInfo: SNXPerpV2Adapter.UniswapPoolInfoStructOutput; + } + >; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + rateAndCarry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + requireNotGlobalPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[void]>; + + requireNotMarketPaused( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[void]>; + + setAddressResolver( + _addressResolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGlobalPaused( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketAdapterConfiguration( + _optionMarket: PromiseOrValue, + _staticEstimationDiscount: PromiseOrValue, + _snxPerpV2MarketAddress: PromiseOrValue, + _uniswapPool: PromiseOrValue, + _uniswapFeeTier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketPaused( + optionMarket: PromiseOrValue, + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setRiskFreeRate( + _optionMarket: PromiseOrValue, + _rate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniSwapDeviation( + _deviation: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniswapRouter( + _swapRouter: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + swapRouter(overrides?: CallOverrides): Promise<[string]>; + + systemStatus(overrides?: CallOverrides): Promise<[string]>; + + uniDeviation(overrides?: CallOverrides): Promise<[BigNumber]>; + + updateSynthetixAddresses( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + approveRouter( + asset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + estimateExchangeToExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + estimateExchangeToExactQuote( + _optionMarket: PromiseOrValue, + _amountQuoteD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + exchangeFromExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeFromExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBase( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBaseWithLimit( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + _quoteLimitD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuoteWithLimit( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getAdapterState( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPrices( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSettlementPriceForMarket( + _optionMarket: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSpotPriceForMarket( + optionMarket: PromiseOrValue, + pricing: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + initialize( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isGlobalPaused(overrides?: CallOverrides): Promise; + + isMarketPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + marketConfigurations( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, string, SNXPerpV2Adapter.UniswapPoolInfoStructOutput] & { + staticEstimationDiscount: BigNumber; + snxPerpV2MarketAddress: string; + uniswapInfo: SNXPerpV2Adapter.UniswapPoolInfoStructOutput; + } + >; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndCarry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotGlobalPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotMarketPaused( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setAddressResolver( + _addressResolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGlobalPaused( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketAdapterConfiguration( + _optionMarket: PromiseOrValue, + _staticEstimationDiscount: PromiseOrValue, + _snxPerpV2MarketAddress: PromiseOrValue, + _uniswapPool: PromiseOrValue, + _uniswapFeeTier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketPaused( + optionMarket: PromiseOrValue, + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setRiskFreeRate( + _optionMarket: PromiseOrValue, + _rate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniSwapDeviation( + _deviation: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniswapRouter( + _swapRouter: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + swapRouter(overrides?: CallOverrides): Promise; + + systemStatus(overrides?: CallOverrides): Promise; + + uniDeviation(overrides?: CallOverrides): Promise; + + updateSynthetixAddresses( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + approveRouter( + asset: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + estimateExchangeToExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + estimateExchangeToExactQuote( + _optionMarket: PromiseOrValue, + _amountQuoteD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + exchangeFromExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + exchangeFromExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + exchangeToExactBase( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber]>; + + exchangeToExactBaseWithLimit( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + _quoteLimitD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + quoteSpentD18: BigNumber; + baseReceivedD18: BigNumber; + } + >; + + exchangeToExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber]>; + + exchangeToExactQuoteWithLimit( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber]>; + + getAdapterState( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPrices( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSettlementPriceForMarket( + _optionMarket: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSpotPriceForMarket( + optionMarket: PromiseOrValue, + pricing: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + initialize(overrides?: CallOverrides): Promise; + + isGlobalPaused(overrides?: CallOverrides): Promise; + + isMarketPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + marketConfigurations( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, string, SNXPerpV2Adapter.UniswapPoolInfoStructOutput] & { + staticEstimationDiscount: BigNumber; + snxPerpV2MarketAddress: string; + uniswapInfo: SNXPerpV2Adapter.UniswapPoolInfoStructOutput; + } + >; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndCarry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotGlobalPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotMarketPaused( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setAddressResolver( + _addressResolver: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setGlobalPaused( + isPaused: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setMarketAdapterConfiguration( + _optionMarket: PromiseOrValue, + _staticEstimationDiscount: PromiseOrValue, + _snxPerpV2MarketAddress: PromiseOrValue, + _uniswapPool: PromiseOrValue, + _uniswapFeeTier: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setMarketPaused( + optionMarket: PromiseOrValue, + isPaused: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setRiskFreeRate( + _optionMarket: PromiseOrValue, + _rate: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setUniSwapDeviation( + _deviation: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setUniswapRouter( + _swapRouter: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + swapRouter(overrides?: CallOverrides): Promise; + + systemStatus(overrides?: CallOverrides): Promise; + + uniDeviation(overrides?: CallOverrides): Promise; + + updateSynthetixAddresses(overrides?: CallOverrides): Promise; + }; + + filters: { + "AddressResolverUpdated(address)"( + addressResolver?: null + ): AddressResolverUpdatedEventFilter; + AddressResolverUpdated( + addressResolver?: null + ): AddressResolverUpdatedEventFilter; + + "BaseSwappedForQuote(address,address,uint256,uint256)"( + marketAddress?: PromiseOrValue | null, + exchanger?: PromiseOrValue | null, + baseSwapped?: null, + quoteReceived?: null + ): BaseSwappedForQuoteEventFilter; + BaseSwappedForQuote( + marketAddress?: PromiseOrValue | null, + exchanger?: PromiseOrValue | null, + baseSwapped?: null, + quoteReceived?: null + ): BaseSwappedForQuoteEventFilter; + + "ExchangeToExactBaseWithLimit(address,uint256,uint256)"( + optionMarket?: PromiseOrValue | null, + quoteSpentD18?: null, + baseAssetinD18?: null + ): ExchangeToExactBaseWithLimitEventFilter; + ExchangeToExactBaseWithLimit( + optionMarket?: PromiseOrValue | null, + quoteSpentD18?: null, + baseAssetinD18?: null + ): ExchangeToExactBaseWithLimitEventFilter; + + "ExchangedFromExactBase(address,uint256,uint256)"( + optionMarket?: PromiseOrValue | null, + quoteSpentD18?: null, + baseAssetinD18?: null + ): ExchangedFromExactBaseEventFilter; + ExchangedFromExactBase( + optionMarket?: PromiseOrValue | null, + quoteSpentD18?: null, + baseAssetinD18?: null + ): ExchangedFromExactBaseEventFilter; + + "GlobalPausedSet(bool)"(isPaused?: null): GlobalPausedSetEventFilter; + GlobalPausedSet(isPaused?: null): GlobalPausedSetEventFilter; + + "MarketAdapterConfigurationUpdated(address,uint256,address,address,uint256)"( + optionMarket?: PromiseOrValue | null, + staticEstimationDiscount?: null, + snxPerpV2Market?: null, + uniswapPool?: null, + feeTier?: null + ): MarketAdapterConfigurationUpdatedEventFilter; + MarketAdapterConfigurationUpdated( + optionMarket?: PromiseOrValue | null, + staticEstimationDiscount?: null, + snxPerpV2Market?: null, + uniswapPool?: null, + feeTier?: null + ): MarketAdapterConfigurationUpdatedEventFilter; + + "MarketPausedSet(address,bool)"( + contractAddress?: PromiseOrValue | null, + isPaused?: null + ): MarketPausedSetEventFilter; + MarketPausedSet( + contractAddress?: PromiseOrValue | null, + isPaused?: null + ): MarketPausedSetEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "QuoteSwappedForBase(address,address,uint256,uint256)"( + marketAddress?: PromiseOrValue | null, + exchanger?: PromiseOrValue | null, + quoteSwapped?: null, + baseReceived?: null + ): QuoteSwappedForBaseEventFilter; + QuoteSwappedForBase( + marketAddress?: PromiseOrValue | null, + exchanger?: PromiseOrValue | null, + quoteSwapped?: null, + baseReceived?: null + ): QuoteSwappedForBaseEventFilter; + + "RiskFreeRateUpdated(address,int256)"( + optionMarket?: PromiseOrValue | null, + riskFreeRate?: null + ): RiskFreeRateUpdatedEventFilter; + RiskFreeRateUpdated( + optionMarket?: PromiseOrValue | null, + riskFreeRate?: null + ): RiskFreeRateUpdatedEventFilter; + + "RouterApproved(address,address)"( + asset?: PromiseOrValue | null, + uniswapRouter?: null + ): RouterApprovedEventFilter; + RouterApproved( + asset?: PromiseOrValue | null, + uniswapRouter?: null + ): RouterApprovedEventFilter; + + "SynthetixSystemStatusUpdated(address)"( + synthetixSystemStatus?: null + ): SynthetixSystemStatusUpdatedEventFilter; + SynthetixSystemStatusUpdated( + synthetixSystemStatus?: null + ): SynthetixSystemStatusUpdatedEventFilter; + + "UniDeviationUpdated(uint256)"( + deviation?: null + ): UniDeviationUpdatedEventFilter; + UniDeviationUpdated(deviation?: null): UniDeviationUpdatedEventFilter; + + "UniswapRouterUpdated(address)"( + uniswapRouter?: null + ): UniswapRouterUpdatedEventFilter; + UniswapRouterUpdated(uniswapRouter?: null): UniswapRouterUpdatedEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + approveRouter( + asset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + estimateExchangeToExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + estimateExchangeToExactQuote( + _optionMarket: PromiseOrValue, + _amountQuoteD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + exchangeFromExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeFromExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBase( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBaseWithLimit( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + _quoteLimitD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuoteWithLimit( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getAdapterState( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPrices( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSettlementPriceForMarket( + _optionMarket: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSpotPriceForMarket( + optionMarket: PromiseOrValue, + pricing: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + initialize( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isGlobalPaused(overrides?: CallOverrides): Promise; + + isMarketPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + marketConfigurations( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndCarry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotGlobalPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotMarketPaused( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setAddressResolver( + _addressResolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGlobalPaused( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketAdapterConfiguration( + _optionMarket: PromiseOrValue, + _staticEstimationDiscount: PromiseOrValue, + _snxPerpV2MarketAddress: PromiseOrValue, + _uniswapPool: PromiseOrValue, + _uniswapFeeTier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketPaused( + optionMarket: PromiseOrValue, + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setRiskFreeRate( + _optionMarket: PromiseOrValue, + _rate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniSwapDeviation( + _deviation: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniswapRouter( + _swapRouter: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + swapRouter(overrides?: CallOverrides): Promise; + + systemStatus(overrides?: CallOverrides): Promise; + + uniDeviation(overrides?: CallOverrides): Promise; + + updateSynthetixAddresses( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + approveRouter( + asset: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + estimateExchangeToExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + estimateExchangeToExactQuote( + _optionMarket: PromiseOrValue, + _amountQuoteD18: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + exchangeFromExactBase( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeFromExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBase( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactBaseWithLimit( + _optionMarket: PromiseOrValue, + _amountBaseD18: PromiseOrValue, + _quoteLimitD18: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuote( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + exchangeToExactQuoteWithLimit( + arg0: PromiseOrValue, + arg1: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + getAdapterState( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPrices( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSettlementPriceForMarket( + _optionMarket: PromiseOrValue, + arg1: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getSpotPriceForMarket( + optionMarket: PromiseOrValue, + pricing: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + initialize( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isGlobalPaused(overrides?: CallOverrides): Promise; + + isMarketPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + marketConfigurations( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndCarry( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotGlobalPaused( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + requireNotMarketPaused( + optionMarket: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setAddressResolver( + _addressResolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGlobalPaused( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketAdapterConfiguration( + _optionMarket: PromiseOrValue, + _staticEstimationDiscount: PromiseOrValue, + _snxPerpV2MarketAddress: PromiseOrValue, + _uniswapPool: PromiseOrValue, + _uniswapFeeTier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMarketPaused( + optionMarket: PromiseOrValue, + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setRiskFreeRate( + _optionMarket: PromiseOrValue, + _rate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniSwapDeviation( + _deviation: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setUniswapRouter( + _swapRouter: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + swapRouter(overrides?: CallOverrides): Promise; + + systemStatus(overrides?: CallOverrides): Promise; + + uniDeviation(overrides?: CallOverrides): Promise; + + updateSynthetixAddresses( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/sdk/src/contracts/newport/typechain/NewportSNXPerpsV2PoolHedger.ts b/sdk/src/contracts/newport/typechain/NewportSNXPerpsV2PoolHedger.ts new file mode 100644 index 0000000..4dcba3f --- /dev/null +++ b/sdk/src/contracts/newport/typechain/NewportSNXPerpsV2PoolHedger.ts @@ -0,0 +1,1253 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + 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, + PromiseOrValue, +} from "./common"; + +export declare namespace SNXPerpsV2PoolHedger { + export type SNXPerpsV2PoolHedgerParametersStruct = { + targetLeverage: PromiseOrValue; + maximumFundingRate: PromiseOrValue; + deltaThreshold: PromiseOrValue; + marketDepthBuffer: PromiseOrValue; + priceDeltaBuffer: PromiseOrValue; + worstStableRate: PromiseOrValue; + maxOrderCap: PromiseOrValue; + }; + + export type SNXPerpsV2PoolHedgerParametersStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + targetLeverage: BigNumber; + maximumFundingRate: BigNumber; + deltaThreshold: BigNumber; + marketDepthBuffer: BigNumber; + priceDeltaBuffer: BigNumber; + worstStableRate: BigNumber; + maxOrderCap: BigNumber; + }; + + export type HedgerStateStruct = { + lastInteraction: PromiseOrValue; + hedgedDelta: PromiseOrValue; + margin: PromiseOrValue; + leverage: PromiseOrValue; + hedgerQuoteBalance: PromiseOrValue; + hedgerMarginQuoteBalance: PromiseOrValue; + canHedgeDeltaIncrease: PromiseOrValue; + canHedgeDeltaDecrease: PromiseOrValue; + cappedExpectedHedge: PromiseOrValue; + snxHasEnoughMarketDepth: PromiseOrValue; + marketSuspended: PromiseOrValue; + curveRateStable: PromiseOrValue; + pendingDeltaLiquidity: PromiseOrValue; + usedDeltaLiquidity: PromiseOrValue; + pendingDelta: PromiseOrValue; + longInterest: PromiseOrValue; + shortInterest: PromiseOrValue; + maxTotalMarketSize: PromiseOrValue; + pendingMargin: PromiseOrValue; + fundingRate: PromiseOrValue; + trackingCode: PromiseOrValue; + optionMarket: PromiseOrValue; + perpsMarket: PromiseOrValue; + curveSwap: PromiseOrValue; + quoteAsset: PromiseOrValue; + futuresPoolHedgerParams: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStruct; + poolHedgerParams: PoolHedger.PoolHedgerParametersStruct; + }; + + export type HedgerStateStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + boolean, + boolean, + BigNumber, + boolean, + boolean, + boolean, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + string, + string, + string, + string, + SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStructOutput, + PoolHedger.PoolHedgerParametersStructOutput + ] & { + lastInteraction: BigNumber; + hedgedDelta: BigNumber; + margin: BigNumber; + leverage: BigNumber; + hedgerQuoteBalance: BigNumber; + hedgerMarginQuoteBalance: BigNumber; + canHedgeDeltaIncrease: boolean; + canHedgeDeltaDecrease: boolean; + cappedExpectedHedge: BigNumber; + snxHasEnoughMarketDepth: boolean; + marketSuspended: boolean; + curveRateStable: boolean; + pendingDeltaLiquidity: BigNumber; + usedDeltaLiquidity: BigNumber; + pendingDelta: BigNumber; + longInterest: BigNumber; + shortInterest: BigNumber; + maxTotalMarketSize: BigNumber; + pendingMargin: BigNumber; + fundingRate: BigNumber; + trackingCode: string; + optionMarket: string; + perpsMarket: string; + curveSwap: string; + quoteAsset: string; + futuresPoolHedgerParams: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStructOutput; + poolHedgerParams: PoolHedger.PoolHedgerParametersStructOutput; + }; +} + +export declare namespace PoolHedger { + export type PoolHedgerParametersStruct = { + interactionDelay: PromiseOrValue; + hedgeCap: PromiseOrValue; + }; + + export type PoolHedgerParametersStructOutput = [BigNumber, BigNumber] & { + interactionDelay: BigNumber; + hedgeCap: BigNumber; + }; +} + +export interface NewportSNXPerpsV2PoolHedgerInterface extends utils.Interface { + functions: { + "acceptOwnership()": FunctionFragment; + "addressResolver()": FunctionFragment; + "canHedge(uint256,bool,uint256)": FunctionFragment; + "curveSwap()": FunctionFragment; + "exchangeAdapter()": FunctionFragment; + "futuresPoolHedgerParams()": FunctionFragment; + "getCappedExpectedHedge()": FunctionFragment; + "getCurrentHedgedNetDelta()": FunctionFragment; + "getCurrentPositionMargin()": FunctionFragment; + "getHedgerState()": FunctionFragment; + "getHedgingLiquidity(uint256)": FunctionFragment; + "getPoolHedgerParams()": FunctionFragment; + "hedgeDelta()": FunctionFragment; + "init(address,address,address,address,address,address,address,address,address,bytes32)": FunctionFragment; + "lastInteraction()": FunctionFragment; + "marketKey()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "perpsMarket()": FunctionFragment; + "resetInteractionDelay()": FunctionFragment; + "setFuturesPoolHedgerParams((uint256,uint256,uint256,uint256,uint256,uint256,uint256))": FunctionFragment; + "setPoolHedgerParams((uint256,uint256))": FunctionFragment; + "setTrackingCode(bytes32)": FunctionFragment; + "trackingCode()": FunctionFragment; + "updateCollateral()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "addressResolver" + | "canHedge" + | "curveSwap" + | "exchangeAdapter" + | "futuresPoolHedgerParams" + | "getCappedExpectedHedge" + | "getCurrentHedgedNetDelta" + | "getCurrentPositionMargin" + | "getHedgerState" + | "getHedgingLiquidity" + | "getPoolHedgerParams" + | "hedgeDelta" + | "init" + | "lastInteraction" + | "marketKey" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "perpsMarket" + | "resetInteractionDelay" + | "setFuturesPoolHedgerParams" + | "setPoolHedgerParams" + | "setTrackingCode" + | "trackingCode" + | "updateCollateral" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "addressResolver", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "canHedge", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData(functionFragment: "curveSwap", values?: undefined): string; + encodeFunctionData( + functionFragment: "exchangeAdapter", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "futuresPoolHedgerParams", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getCappedExpectedHedge", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getCurrentHedgedNetDelta", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getCurrentPositionMargin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getHedgerState", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getHedgingLiquidity", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getPoolHedgerParams", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "hedgeDelta", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "init", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "lastInteraction", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "marketKey", values?: undefined): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "perpsMarket", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "resetInteractionDelay", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setFuturesPoolHedgerParams", + values: [SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStruct] + ): string; + encodeFunctionData( + functionFragment: "setPoolHedgerParams", + values: [PoolHedger.PoolHedgerParametersStruct] + ): string; + encodeFunctionData( + functionFragment: "setTrackingCode", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "trackingCode", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "updateCollateral", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addressResolver", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "canHedge", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "curveSwap", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "exchangeAdapter", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "futuresPoolHedgerParams", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getCappedExpectedHedge", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getCurrentHedgedNetDelta", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getCurrentPositionMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getHedgerState", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getHedgingLiquidity", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPoolHedgerParams", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "hedgeDelta", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "init", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "lastInteraction", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "marketKey", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "perpsMarket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resetInteractionDelay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setFuturesPoolHedgerParams", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setPoolHedgerParams", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTrackingCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "trackingCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateCollateral", + data: BytesLike + ): Result; + + events: { + "CollateralUpdated(uint256,uint256)": EventFragment; + "FuturesPoolHedgerParamsSet(tuple)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "PoolHedgerParametersSet(tuple)": EventFragment; + "PositionUpdateSubmitted(int256,int256,int256)": EventFragment; + "QuoteReturnedToLP(uint256)": EventFragment; + "SlippageOutOfBounds(address,address,uint256,uint256)": EventFragment; + "TrackingCodeSet(bytes32)": EventFragment; + "USDCCollateralSwapForMargin(address,address,uint256,uint256)": EventFragment; + "sUSDCollateralSwap(address,address,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "CollateralUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FuturesPoolHedgerParamsSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PoolHedgerParametersSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionUpdateSubmitted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "QuoteReturnedToLP"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SlippageOutOfBounds"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TrackingCodeSet"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "USDCCollateralSwapForMargin" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "sUSDCollateralSwap"): EventFragment; +} + +export interface CollateralUpdatedEventObject { + oldCollat: BigNumber; + newCollat: BigNumber; +} +export type CollateralUpdatedEvent = TypedEvent< + [BigNumber, BigNumber], + CollateralUpdatedEventObject +>; + +export type CollateralUpdatedEventFilter = + TypedEventFilter; + +export interface FuturesPoolHedgerParamsSetEventObject { + params: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStructOutput; +} +export type FuturesPoolHedgerParamsSetEvent = TypedEvent< + [SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStructOutput], + FuturesPoolHedgerParamsSetEventObject +>; + +export type FuturesPoolHedgerParamsSetEventFilter = + 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 PoolHedgerParametersSetEventObject { + poolHedgerParams: PoolHedger.PoolHedgerParametersStructOutput; +} +export type PoolHedgerParametersSetEvent = TypedEvent< + [PoolHedger.PoolHedgerParametersStructOutput], + PoolHedgerParametersSetEventObject +>; + +export type PoolHedgerParametersSetEventFilter = + TypedEventFilter; + +export interface PositionUpdateSubmittedEventObject { + oldNetDelta: BigNumber; + currentNetDelta: BigNumber; + expectedNetDelta: BigNumber; +} +export type PositionUpdateSubmittedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber], + PositionUpdateSubmittedEventObject +>; + +export type PositionUpdateSubmittedEventFilter = + TypedEventFilter; + +export interface QuoteReturnedToLPEventObject { + amountQuote: BigNumber; +} +export type QuoteReturnedToLPEvent = TypedEvent< + [BigNumber], + QuoteReturnedToLPEventObject +>; + +export type QuoteReturnedToLPEventFilter = + TypedEventFilter; + +export interface SlippageOutOfBoundsEventObject { + quoteAsset: string; + sUSD: string; + curve_rate: BigNumber; + maxSlippage: BigNumber; +} +export type SlippageOutOfBoundsEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + SlippageOutOfBoundsEventObject +>; + +export type SlippageOutOfBoundsEventFilter = + TypedEventFilter; + +export interface TrackingCodeSetEventObject { + trackingCode: string; +} +export type TrackingCodeSetEvent = TypedEvent< + [string], + TrackingCodeSetEventObject +>; + +export type TrackingCodeSetEventFilter = TypedEventFilter; + +export interface USDCCollateralSwapForMarginEventObject { + quoteAsset: string; + sUSD: string; + amountIn: BigNumber; + amountOut: BigNumber; +} +export type USDCCollateralSwapForMarginEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + USDCCollateralSwapForMarginEventObject +>; + +export type USDCCollateralSwapForMarginEventFilter = + TypedEventFilter; + +export interface sUSDCollateralSwapEventObject { + quoteAsset: string; + sUSD: string; + amountIn: BigNumber; + amountOut: BigNumber; +} +export type sUSDCollateralSwapEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + sUSDCollateralSwapEventObject +>; + +export type sUSDCollateralSwapEventFilter = + TypedEventFilter; + +export interface NewportSNXPerpsV2PoolHedger extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: NewportSNXPerpsV2PoolHedgerInterface; + + 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?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise<[string]>; + + canHedge( + arg0: PromiseOrValue, + deltaIncrease: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + + curveSwap(overrides?: CallOverrides): Promise<[string]>; + + exchangeAdapter(overrides?: CallOverrides): Promise<[string]>; + + futuresPoolHedgerParams( + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + targetLeverage: BigNumber; + maximumFundingRate: BigNumber; + deltaThreshold: BigNumber; + marketDepthBuffer: BigNumber; + priceDeltaBuffer: BigNumber; + worstStableRate: BigNumber; + maxOrderCap: BigNumber; + } + >; + + getCappedExpectedHedge(overrides?: CallOverrides): Promise<[BigNumber]>; + + getCurrentHedgedNetDelta(overrides?: CallOverrides): Promise<[BigNumber]>; + + getCurrentPositionMargin(overrides?: CallOverrides): Promise<[BigNumber]>; + + getHedgerState( + overrides?: CallOverrides + ): Promise<[SNXPerpsV2PoolHedger.HedgerStateStructOutput]>; + + getHedgingLiquidity( + spotPrice: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + pendingDeltaLiquidity: BigNumber; + usedDeltaLiquidity: BigNumber; + } + >; + + getPoolHedgerParams( + overrides?: CallOverrides + ): Promise<[PoolHedger.PoolHedgerParametersStructOutput]>; + + hedgeDelta( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + init( + _addressResolver: PromiseOrValue, + _exchangeAdapter: PromiseOrValue, + _optionMarket: PromiseOrValue, + _optionGreekCache: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _perpMarketProxy: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _sUSD: PromiseOrValue, + _curveSwap: PromiseOrValue, + _marketKey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + lastInteraction(overrides?: CallOverrides): Promise<[BigNumber]>; + + marketKey(overrides?: CallOverrides): Promise<[string]>; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + perpsMarket(overrides?: CallOverrides): Promise<[string]>; + + resetInteractionDelay( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setFuturesPoolHedgerParams( + _futuresPoolHedgerParams: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPoolHedgerParams( + _poolHedgerParams: PoolHedger.PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setTrackingCode( + _trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + trackingCode(overrides?: CallOverrides): Promise<[string]>; + + updateCollateral( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + }; + + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + canHedge( + arg0: PromiseOrValue, + deltaIncrease: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + curveSwap(overrides?: CallOverrides): Promise; + + exchangeAdapter(overrides?: CallOverrides): Promise; + + futuresPoolHedgerParams( + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + targetLeverage: BigNumber; + maximumFundingRate: BigNumber; + deltaThreshold: BigNumber; + marketDepthBuffer: BigNumber; + priceDeltaBuffer: BigNumber; + worstStableRate: BigNumber; + maxOrderCap: BigNumber; + } + >; + + getCappedExpectedHedge(overrides?: CallOverrides): Promise; + + getCurrentHedgedNetDelta(overrides?: CallOverrides): Promise; + + getCurrentPositionMargin(overrides?: CallOverrides): Promise; + + getHedgerState( + overrides?: CallOverrides + ): Promise; + + getHedgingLiquidity( + spotPrice: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + pendingDeltaLiquidity: BigNumber; + usedDeltaLiquidity: BigNumber; + } + >; + + getPoolHedgerParams( + overrides?: CallOverrides + ): Promise; + + hedgeDelta( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + init( + _addressResolver: PromiseOrValue, + _exchangeAdapter: PromiseOrValue, + _optionMarket: PromiseOrValue, + _optionGreekCache: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _perpMarketProxy: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _sUSD: PromiseOrValue, + _curveSwap: PromiseOrValue, + _marketKey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + lastInteraction(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + perpsMarket(overrides?: CallOverrides): Promise; + + resetInteractionDelay( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setFuturesPoolHedgerParams( + _futuresPoolHedgerParams: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPoolHedgerParams( + _poolHedgerParams: PoolHedger.PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setTrackingCode( + _trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + trackingCode(overrides?: CallOverrides): Promise; + + updateCollateral( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + canHedge( + arg0: PromiseOrValue, + deltaIncrease: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + curveSwap(overrides?: CallOverrides): Promise; + + exchangeAdapter(overrides?: CallOverrides): Promise; + + futuresPoolHedgerParams( + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + targetLeverage: BigNumber; + maximumFundingRate: BigNumber; + deltaThreshold: BigNumber; + marketDepthBuffer: BigNumber; + priceDeltaBuffer: BigNumber; + worstStableRate: BigNumber; + maxOrderCap: BigNumber; + } + >; + + getCappedExpectedHedge(overrides?: CallOverrides): Promise; + + getCurrentHedgedNetDelta(overrides?: CallOverrides): Promise; + + getCurrentPositionMargin(overrides?: CallOverrides): Promise; + + getHedgerState( + overrides?: CallOverrides + ): Promise; + + getHedgingLiquidity( + spotPrice: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + pendingDeltaLiquidity: BigNumber; + usedDeltaLiquidity: BigNumber; + } + >; + + getPoolHedgerParams( + overrides?: CallOverrides + ): Promise; + + hedgeDelta(overrides?: CallOverrides): Promise; + + init( + _addressResolver: PromiseOrValue, + _exchangeAdapter: PromiseOrValue, + _optionMarket: PromiseOrValue, + _optionGreekCache: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _perpMarketProxy: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _sUSD: PromiseOrValue, + _curveSwap: PromiseOrValue, + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + lastInteraction(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + perpsMarket(overrides?: CallOverrides): Promise; + + resetInteractionDelay(overrides?: CallOverrides): Promise; + + setFuturesPoolHedgerParams( + _futuresPoolHedgerParams: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStruct, + overrides?: CallOverrides + ): Promise; + + setPoolHedgerParams( + _poolHedgerParams: PoolHedger.PoolHedgerParametersStruct, + overrides?: CallOverrides + ): Promise; + + setTrackingCode( + _trackingCode: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + trackingCode(overrides?: CallOverrides): Promise; + + updateCollateral(overrides?: CallOverrides): Promise; + }; + + filters: { + "CollateralUpdated(uint256,uint256)"( + oldCollat?: null, + newCollat?: null + ): CollateralUpdatedEventFilter; + CollateralUpdated( + oldCollat?: null, + newCollat?: null + ): CollateralUpdatedEventFilter; + + "FuturesPoolHedgerParamsSet(tuple)"( + params?: null + ): FuturesPoolHedgerParamsSetEventFilter; + FuturesPoolHedgerParamsSet( + params?: null + ): FuturesPoolHedgerParamsSetEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "PoolHedgerParametersSet(tuple)"( + poolHedgerParams?: null + ): PoolHedgerParametersSetEventFilter; + PoolHedgerParametersSet( + poolHedgerParams?: null + ): PoolHedgerParametersSetEventFilter; + + "PositionUpdateSubmitted(int256,int256,int256)"( + oldNetDelta?: null, + currentNetDelta?: null, + expectedNetDelta?: null + ): PositionUpdateSubmittedEventFilter; + PositionUpdateSubmitted( + oldNetDelta?: null, + currentNetDelta?: null, + expectedNetDelta?: null + ): PositionUpdateSubmittedEventFilter; + + "QuoteReturnedToLP(uint256)"( + amountQuote?: null + ): QuoteReturnedToLPEventFilter; + QuoteReturnedToLP(amountQuote?: null): QuoteReturnedToLPEventFilter; + + "SlippageOutOfBounds(address,address,uint256,uint256)"( + quoteAsset?: null, + sUSD?: null, + curve_rate?: null, + maxSlippage?: null + ): SlippageOutOfBoundsEventFilter; + SlippageOutOfBounds( + quoteAsset?: null, + sUSD?: null, + curve_rate?: null, + maxSlippage?: null + ): SlippageOutOfBoundsEventFilter; + + "TrackingCodeSet(bytes32)"(trackingCode?: null): TrackingCodeSetEventFilter; + TrackingCodeSet(trackingCode?: null): TrackingCodeSetEventFilter; + + "USDCCollateralSwapForMargin(address,address,uint256,uint256)"( + quoteAsset?: null, + sUSD?: null, + amountIn?: null, + amountOut?: null + ): USDCCollateralSwapForMarginEventFilter; + USDCCollateralSwapForMargin( + quoteAsset?: null, + sUSD?: null, + amountIn?: null, + amountOut?: null + ): USDCCollateralSwapForMarginEventFilter; + + "sUSDCollateralSwap(address,address,uint256,uint256)"( + quoteAsset?: null, + sUSD?: null, + amountIn?: null, + amountOut?: null + ): sUSDCollateralSwapEventFilter; + sUSDCollateralSwap( + quoteAsset?: null, + sUSD?: null, + amountIn?: null, + amountOut?: null + ): sUSDCollateralSwapEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + canHedge( + arg0: PromiseOrValue, + deltaIncrease: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + curveSwap(overrides?: CallOverrides): Promise; + + exchangeAdapter(overrides?: CallOverrides): Promise; + + futuresPoolHedgerParams(overrides?: CallOverrides): Promise; + + getCappedExpectedHedge(overrides?: CallOverrides): Promise; + + getCurrentHedgedNetDelta(overrides?: CallOverrides): Promise; + + getCurrentPositionMargin(overrides?: CallOverrides): Promise; + + getHedgerState(overrides?: CallOverrides): Promise; + + getHedgingLiquidity( + spotPrice: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPoolHedgerParams(overrides?: CallOverrides): Promise; + + hedgeDelta( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + init( + _addressResolver: PromiseOrValue, + _exchangeAdapter: PromiseOrValue, + _optionMarket: PromiseOrValue, + _optionGreekCache: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _perpMarketProxy: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _sUSD: PromiseOrValue, + _curveSwap: PromiseOrValue, + _marketKey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + lastInteraction(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + perpsMarket(overrides?: CallOverrides): Promise; + + resetInteractionDelay( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setFuturesPoolHedgerParams( + _futuresPoolHedgerParams: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPoolHedgerParams( + _poolHedgerParams: PoolHedger.PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setTrackingCode( + _trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + trackingCode(overrides?: CallOverrides): Promise; + + updateCollateral( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + addressResolver(overrides?: CallOverrides): Promise; + + canHedge( + arg0: PromiseOrValue, + deltaIncrease: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + curveSwap(overrides?: CallOverrides): Promise; + + exchangeAdapter(overrides?: CallOverrides): Promise; + + futuresPoolHedgerParams( + overrides?: CallOverrides + ): Promise; + + getCappedExpectedHedge( + overrides?: CallOverrides + ): Promise; + + getCurrentHedgedNetDelta( + overrides?: CallOverrides + ): Promise; + + getCurrentPositionMargin( + overrides?: CallOverrides + ): Promise; + + getHedgerState(overrides?: CallOverrides): Promise; + + getHedgingLiquidity( + spotPrice: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPoolHedgerParams( + overrides?: CallOverrides + ): Promise; + + hedgeDelta( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + init( + _addressResolver: PromiseOrValue, + _exchangeAdapter: PromiseOrValue, + _optionMarket: PromiseOrValue, + _optionGreekCache: PromiseOrValue, + _liquidityPool: PromiseOrValue, + _perpMarketProxy: PromiseOrValue, + _quoteAsset: PromiseOrValue, + _sUSD: PromiseOrValue, + _curveSwap: PromiseOrValue, + _marketKey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + lastInteraction(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + perpsMarket(overrides?: CallOverrides): Promise; + + resetInteractionDelay( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setFuturesPoolHedgerParams( + _futuresPoolHedgerParams: SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPoolHedgerParams( + _poolHedgerParams: PoolHedger.PoolHedgerParametersStruct, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setTrackingCode( + _trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + trackingCode(overrides?: CallOverrides): Promise; + + updateCollateral( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/sdk/src/contracts/newport/typechain/factories/NewportLiquidityPool__factory.ts b/sdk/src/contracts/newport/typechain/factories/NewportLiquidityPool__factory.ts index 79b14be..2c010f7 100644 --- a/sdk/src/contracts/newport/typechain/factories/NewportLiquidityPool__factory.ts +++ b/sdk/src/contracts/newport/typechain/factories/NewportLiquidityPool__factory.ts @@ -591,6 +591,11 @@ const _abi = [ name: "increasesDelta", type: "bool", }, + { + internalType: "uint256", + name: "strikeId", + type: "uint256", + }, ], name: "UnableToHedgeDelta", type: "error", @@ -1886,6 +1891,11 @@ const _abi = [ name: "freeLiquidity", type: "uint256", }, + { + internalType: "uint256", + name: "strikeId", + type: "uint256", + }, ], name: "lockCallCollateral", outputs: [], @@ -1904,6 +1914,11 @@ const _abi = [ name: "freeLiquidity", type: "uint256", }, + { + internalType: "uint256", + name: "strikeId", + type: "uint256", + }, ], name: "lockPutCollateral", outputs: [], @@ -2309,6 +2324,11 @@ const _abi = [ name: "isCall", type: "bool", }, + { + internalType: "uint256", + name: "strikeId", + type: "uint256", + }, ], name: "sendShortPremium", outputs: [], diff --git a/sdk/src/contracts/common/typechain/factories/LyraStakingModule__factory.ts b/sdk/src/contracts/newport/typechain/factories/NewportSNXPerpV2Adapter__factory.ts similarity index 61% rename from sdk/src/contracts/common/typechain/factories/LyraStakingModule__factory.ts rename to sdk/src/contracts/newport/typechain/factories/NewportSNXPerpV2Adapter__factory.ts index 6008381..55d0c68 100644 --- a/sdk/src/contracts/common/typechain/factories/LyraStakingModule__factory.ts +++ b/sdk/src/contracts/newport/typechain/factories/NewportSNXPerpV2Adapter__factory.ts @@ -5,820 +5,723 @@ import { Contract, Signer, utils } from "ethers"; import type { Provider } from "@ethersproject/providers"; import type { - LyraStakingModule, - LyraStakingModuleInterface, -} from "../LyraStakingModule"; + NewportSNXPerpV2Adapter, + NewportSNXPerpV2AdapterInterface, +} from "../NewportSNXPerpV2Adapter"; const _abi = [ { inputs: [ { - internalType: "contract IERC20", - name: "stakedToken", + internalType: "address", + name: "thrower", type: "address", }, + ], + name: "AllMarketsPaused", + type: "error", + }, + { + inputs: [ { - internalType: "contract IERC20", - name: "rewardToken", + internalType: "address", + name: "thrower", type: "address", }, { - internalType: "uint256", - name: "cooldownSeconds", - type: "uint256", - }, - { - internalType: "uint256", - name: "unstakeWindow", - type: "uint256", + internalType: "contract IERC20Decimals", + name: "asset", + type: "address", }, { internalType: "address", - name: "rewardsVault", + name: "sender", type: "address", }, { internalType: "address", - name: "emissionManager", + name: "receiver", type: "address", }, { - internalType: "uint128", - name: "distributionDuration", - type: "uint128", + internalType: "uint256", + name: "amount", + type: "uint256", }, ], - stateMutability: "nonpayable", - type: "constructor", + name: "AssetTransferFailed", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "owner", + name: "thrower", type: "address", }, { - indexed: true, - internalType: "address", - name: "spender", - type: "address", + internalType: "uint256", + name: "amountQuoteRequested", + type: "uint256", }, { - indexed: false, internalType: "uint256", - name: "value", + name: "baseToSpend", type: "uint256", }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ { - indexed: true, - internalType: "address", - name: "asset", - type: "address", + internalType: "uint256", + name: "baseLimit", + type: "uint256", }, { - indexed: false, internalType: "uint256", - name: "emission", + name: "spotPrice", type: "uint256", }, + { + internalType: "bytes32", + name: "baseKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "quoteKey", + type: "bytes32", + }, ], - name: "AssetConfigUpdated", - type: "event", + name: "BaseQuoteExchangeExceedsLimit", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "asset", + name: "thrower", type: "address", }, { - indexed: false, internalType: "uint256", - name: "index", + name: "amountOut", type: "uint256", }, - ], - name: "AssetIndexUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ { - indexed: true, - internalType: "address", - name: "user", - type: "address", + internalType: "uint256", + name: "minAcceptedOut", + type: "uint256", }, - ], - name: "Cooldown", - type: "event", - }, - { - anonymous: false, - inputs: [ { - indexed: true, - internalType: "address", - name: "delegator", + internalType: "contract IERC20Decimals", + name: "tokenIn", type: "address", }, { - indexed: true, - internalType: "address", - name: "delegatee", + internalType: "contract IERC20Decimals", + name: "tokenOut", type: "address", }, { - indexed: false, - internalType: "enum IGovernancePowerDelegationToken.DelegationType", - name: "delegationType", - type: "uint8", + internalType: "address", + name: "receiver", + type: "address", }, ], - name: "DelegateChanged", - type: "event", + name: "InsufficientSwap", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "user", + name: "thrower", type: "address", }, { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "enum IGovernancePowerDelegationToken.DelegationType", - name: "delegationType", - type: "uint8", + internalType: "address", + name: "inputAddress", + type: "address", }, ], - name: "DelegatedPowerChanged", - type: "event", + name: "InvalidAddress", + type: "error", + }, + { + inputs: [], + name: "InvalidRiskFreeRate", + type: "error", + }, + { + inputs: [], + name: "InvalidSNXPerpV2Price", + type: "error", + }, + { + inputs: [], + name: "InvalidStaticEstimationDiscount", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "from", + name: "thrower", type: "address", }, { - indexed: true, internalType: "address", - name: "to", + name: "marketAddress", type: "address", }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, ], - name: "Redeem", - type: "event", + name: "MarketIsPaused", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: false, internalType: "address", - name: "user", + name: "thrower", type: "address", }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, ], - name: "RewardsAccrued", - type: "event", + name: "NotImplemented", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "from", + name: "thrower", type: "address", }, { - indexed: true, internalType: "address", - name: "to", + name: "caller", type: "address", }, { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", + internalType: "address", + name: "nominatedOwner", + type: "address", }, ], - name: "RewardsClaimed", - type: "event", + name: "OnlyNominatedOwner", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "from", + name: "thrower", type: "address", }, { - indexed: true, internalType: "address", - name: "onBehalfOf", + name: "caller", type: "address", }, { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", + internalType: "address", + name: "owner", + type: "address", }, ], - name: "Staked", - type: "event", + name: "OnlyOwner", + type: "error", }, { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "from", + name: "thrower", type: "address", }, { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, internalType: "uint256", - name: "value", + name: "amountBaseRequested", type: "uint256", }, - ], - name: "Transfer", - type: "event", - }, - { - anonymous: false, - inputs: [ { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "asset", - type: "address", + internalType: "uint256", + name: "quoteToSpend", + type: "uint256", }, { - indexed: false, internalType: "uint256", - name: "index", + name: "quoteLimit", type: "uint256", }, - ], - name: "UserIndexUpdated", - type: "event", - }, - { - inputs: [], - name: "COOLDOWN_SECONDS", - outputs: [ { internalType: "uint256", - name: "", + name: "spotPrice", type: "uint256", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DELEGATE_BY_TYPE_TYPEHASH", - outputs: [ { internalType: "bytes32", - name: "", + name: "quoteKey", type: "bytes32", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DELEGATE_TYPEHASH", - outputs: [ { internalType: "bytes32", - name: "", + name: "baseKey", type: "bytes32", }, ], - stateMutability: "view", - type: "function", + name: "QuoteBaseExchangeExceedsLimit", + type: "error", }, { - inputs: [], - name: "DISTRIBUTION_END", - outputs: [ + inputs: [ { - internalType: "uint256", - name: "", - type: "uint256", + internalType: "address", + name: "optionMarket", + type: "address", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DOMAIN_SEPARATOR", - outputs: [ { - internalType: "bytes32", - name: "", - type: "bytes32", + internalType: "uint248", + name: "reason", + type: "uint248", }, ], - stateMutability: "view", - type: "function", + name: "SNXPerpV2MarketSuspended", + type: "error", }, { - inputs: [], - name: "EIP712_REVISION", - outputs: [ + inputs: [ { - internalType: "bytes", - name: "", - type: "bytes", + internalType: "address", + name: "thrower", + type: "address", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "EMISSION_MANAGER", - outputs: [ { - internalType: "address", - name: "", + internalType: "contract IERC20Decimals", + name: "asset", type: "address", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "PERMIT_TYPEHASH", - outputs: [ { - internalType: "bytes32", - name: "", - type: "bytes32", + internalType: "address", + name: "from", + type: "address", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "PRECISION", - outputs: [ { - internalType: "uint8", - name: "", - type: "uint8", + internalType: "address", + name: "to", + type: "address", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "REVISION", - outputs: [ { internalType: "uint256", - name: "", + name: "amount", type: "uint256", }, ], - stateMutability: "view", - type: "function", + name: "TransferFailed", + type: "error", }, { - inputs: [], - name: "REWARDS_VAULT", - outputs: [ + anonymous: false, + inputs: [ { + indexed: false, internalType: "address", - name: "", + name: "addressResolver", type: "address", }, ], - stateMutability: "view", - type: "function", + name: "AddressResolverUpdated", + type: "event", }, { - inputs: [], - name: "REWARD_TOKEN", - outputs: [ + anonymous: false, + inputs: [ { - internalType: "contract IERC20", - name: "", + indexed: true, + internalType: "address", + name: "marketAddress", type: "address", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "STAKED_TOKEN", - outputs: [ { - internalType: "contract IERC20", - name: "", + indexed: true, + internalType: "address", + name: "exchanger", type: "address", }, + { + indexed: false, + internalType: "uint256", + name: "baseSwapped", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "quoteReceived", + type: "uint256", + }, ], - stateMutability: "view", - type: "function", + name: "BaseSwappedForQuote", + type: "event", }, { - inputs: [], - name: "UNSTAKE_WINDOW", - outputs: [ + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "optionMarket", + type: "address", + }, { + indexed: false, internalType: "uint256", - name: "", + name: "quoteSpentD18", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "baseAssetinD18", type: "uint256", }, ], - stateMutability: "view", - type: "function", + name: "ExchangeToExactBaseWithLimit", + type: "event", }, { - inputs: [], - name: "_aaveGovernance", - outputs: [ + anonymous: false, + inputs: [ { - internalType: "contract ITransferHook", - name: "", + indexed: true, + internalType: "address", + name: "optionMarket", type: "address", }, + { + indexed: false, + internalType: "uint256", + name: "quoteSpentD18", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "baseAssetinD18", + type: "uint256", + }, ], - stateMutability: "view", - type: "function", + name: "ExchangedFromExactBase", + type: "event", }, { + anonymous: false, inputs: [ { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "_nonces", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", + indexed: false, + internalType: "bool", + name: "isPaused", + type: "bool", }, ], - stateMutability: "view", - type: "function", + name: "GlobalPausedSet", + type: "event", }, { + anonymous: false, inputs: [ { + indexed: true, internalType: "address", - name: "", + name: "optionMarket", type: "address", }, { + indexed: false, internalType: "uint256", - name: "", + name: "staticEstimationDiscount", type: "uint256", }, - ], - name: "_votingSnapshots", - outputs: [ { - internalType: "uint128", - name: "blockNumber", - type: "uint128", + indexed: false, + internalType: "address", + name: "snxPerpV2Market", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "uniswapPool", + type: "address", }, { - internalType: "uint128", - name: "value", - type: "uint128", + indexed: false, + internalType: "uint256", + name: "feeTier", + type: "uint256", }, ], - stateMutability: "view", - type: "function", + name: "MarketAdapterConfigurationUpdated", + type: "event", }, { + anonymous: false, inputs: [ { + indexed: true, internalType: "address", - name: "", + name: "contractAddress", type: "address", }, - ], - name: "_votingSnapshotsCounts", - outputs: [ { - internalType: "uint256", - name: "", - type: "uint256", + indexed: false, + internalType: "bool", + name: "isPaused", + type: "bool", }, ], - stateMutability: "view", - type: "function", + name: "MarketPausedSet", + type: "event", }, { + anonymous: false, inputs: [ { + indexed: false, internalType: "address", - name: "owner", + name: "oldOwner", type: "address", }, { + indexed: false, internalType: "address", - name: "spender", + name: "newOwner", type: "address", }, ], - name: "allowance", - outputs: [ + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ { - internalType: "uint256", - name: "", - type: "uint256", + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", }, ], - stateMutability: "view", - type: "function", + name: "OwnerNominated", + type: "event", }, { + anonymous: false, inputs: [ { + indexed: true, + internalType: "address", + name: "marketAddress", + type: "address", + }, + { + indexed: true, internalType: "address", - name: "spender", + name: "exchanger", type: "address", }, { + indexed: false, internalType: "uint256", - name: "amount", + name: "quoteSwapped", type: "uint256", }, - ], - name: "approve", - outputs: [ { - internalType: "bool", - name: "", - type: "bool", + indexed: false, + internalType: "uint256", + name: "baseReceived", + type: "uint256", }, ], - stateMutability: "nonpayable", - type: "function", + name: "QuoteSwappedForBase", + type: "event", }, { + anonymous: false, inputs: [ { + indexed: true, internalType: "address", - name: "", + name: "optionMarket", type: "address", }, - ], - name: "assets", - outputs: [ - { - internalType: "uint128", - name: "emissionPerSecond", - type: "uint128", - }, - { - internalType: "uint128", - name: "lastUpdateTimestamp", - type: "uint128", - }, { - internalType: "uint256", - name: "index", - type: "uint256", + indexed: false, + internalType: "int256", + name: "riskFreeRate", + type: "int256", }, ], - stateMutability: "view", - type: "function", + name: "RiskFreeRateUpdated", + type: "event", }, { + anonymous: false, inputs: [ { + indexed: true, internalType: "address", - name: "account", + name: "asset", type: "address", }, - ], - name: "balanceOf", - outputs: [ { - internalType: "uint256", - name: "", - type: "uint256", + indexed: false, + internalType: "address", + name: "uniswapRouter", + type: "address", }, ], - stateMutability: "view", - type: "function", + name: "RouterApproved", + type: "event", }, { + anonymous: false, inputs: [ { + indexed: false, internalType: "address", - name: "to", + name: "synthetixSystemStatus", type: "address", }, + ], + name: "SynthetixSystemStatusUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ { + indexed: false, internalType: "uint256", - name: "amount", + name: "deviation", type: "uint256", }, ], - name: "claimRewards", - outputs: [], - stateMutability: "nonpayable", - type: "function", + name: "UniDeviationUpdated", + type: "event", }, { + anonymous: false, inputs: [ { - components: [ - { - internalType: "uint128", - name: "emissionPerSecond", - type: "uint128", - }, - { - internalType: "uint256", - name: "totalStaked", - type: "uint256", - }, - { - internalType: "address", - name: "underlyingAsset", - type: "address", - }, - ], - internalType: "struct DistributionTypes.AssetConfigInput[]", - name: "assetsConfigInput", - type: "tuple[]", + indexed: false, + internalType: "address", + name: "uniswapRouter", + type: "address", }, ], - name: "configureAssets", - outputs: [], - stateMutability: "nonpayable", - type: "function", + name: "UniswapRouterUpdated", + type: "event", }, { inputs: [], - name: "cooldown", + name: "acceptOwnership", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], - name: "decimals", + name: "addressResolver", outputs: [ { - internalType: "uint8", + internalType: "contract IAddressResolver", name: "", - type: "uint8", + type: "address", }, ], stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "contract IERC20Decimals", + name: "asset", + type: "address", + }, + ], + name: "approveRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { internalType: "address", - name: "spender", + name: "_optionMarket", type: "address", }, { internalType: "uint256", - name: "subtractedValue", + name: "_amountBaseD18", type: "uint256", }, ], - name: "decreaseAllowance", + name: "estimateExchangeToExactBase", outputs: [ { - internalType: "bool", - name: "", - type: "bool", + internalType: "uint256", + name: "quoteNeededD18", + type: "uint256", }, ], - stateMutability: "nonpayable", + stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", - name: "delegatee", + name: "_optionMarket", type: "address", }, + { + internalType: "uint256", + name: "_amountQuoteD18", + type: "uint256", + }, ], - name: "delegate", - outputs: [], - stateMutability: "nonpayable", + name: "estimateExchangeToExactQuote", + outputs: [ + { + internalType: "uint256", + name: "baseNeededD18", + type: "uint256", + }, + ], + stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", - name: "delegatee", + name: "_optionMarket", type: "address", }, { internalType: "uint256", - name: "nonce", + name: "_amountBaseD18", type: "uint256", }, + ], + name: "exchangeFromExactBase", + outputs: [ { internalType: "uint256", - name: "expiry", + name: "quoteReceivedD18", type: "uint256", }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, ], - name: "delegateBySig", - outputs: [], stateMutability: "nonpayable", type: "function", }, @@ -826,17 +729,23 @@ const _abi = [ inputs: [ { internalType: "address", - name: "delegatee", + name: "", type: "address", }, { - internalType: "enum IGovernancePowerDelegationToken.DelegationType", - name: "delegationType", - type: "uint8", + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "exchangeFromExactQuote", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", }, ], - name: "delegateByType", - outputs: [], stateMutability: "nonpayable", type: "function", }, @@ -844,42 +753,28 @@ const _abi = [ inputs: [ { internalType: "address", - name: "delegatee", + name: "", type: "address", }, - { - internalType: "enum IGovernancePowerDelegationToken.DelegationType", - name: "delegationType", - type: "uint8", - }, { internalType: "uint256", - name: "nonce", + name: "", type: "uint256", }, + ], + name: "exchangeToExactBase", + outputs: [ { internalType: "uint256", - name: "expiry", + name: "", type: "uint256", }, { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", + internalType: "uint256", + name: "", + type: "uint256", }, ], - name: "delegateByTypeBySig", - outputs: [], stateMutability: "nonpayable", type: "function", }, @@ -887,108 +782,159 @@ const _abi = [ inputs: [ { internalType: "address", - name: "delegator", + name: "_optionMarket", type: "address", }, { - internalType: "enum IGovernancePowerDelegationToken.DelegationType", - name: "delegationType", - type: "uint8", + internalType: "uint256", + name: "_amountBaseD18", + type: "uint256", }, - ], - name: "getDelegateeByType", - outputs: [ { - internalType: "address", - name: "", - type: "address", + internalType: "uint256", + name: "_quoteLimitD18", + type: "uint256", }, ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ + name: "exchangeToExactBaseWithLimit", + outputs: [ { internalType: "uint256", - name: "fromCooldownTimestamp", + name: "quoteSpentD18", type: "uint256", }, { internalType: "uint256", - name: "amountToReceive", + name: "baseReceivedD18", type: "uint256", }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ { internalType: "address", - name: "toAddress", + name: "", type: "address", }, { internalType: "uint256", - name: "toBalance", + name: "", type: "uint256", }, ], - name: "getNextCooldownTimestamp", + name: "exchangeToExactQuote", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, ], - stateMutability: "view", + stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", - name: "user", + name: "", type: "address", }, { internalType: "uint256", - name: "blockNumber", + name: "", type: "uint256", }, { - internalType: "enum IGovernancePowerDelegationToken.DelegationType", - name: "delegationType", - type: "uint8", + internalType: "uint256", + name: "", + type: "uint256", }, ], - name: "getPowerAtBlock", + name: "exchangeToExactQuoteWithLimit", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, ], - stateMutability: "view", + stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", - name: "user", + name: "optionMarket", type: "address", }, - { - internalType: "enum IGovernancePowerDelegationToken.DelegationType", - name: "delegationType", - type: "uint8", - }, ], - name: "getPowerCurrent", + name: "getAdapterState", outputs: [ { - internalType: "uint256", + components: [ + { + components: [ + { + internalType: "uint256", + name: "staticEstimationDiscount", + type: "uint256", + }, + { + internalType: "address", + name: "snxPerpV2MarketAddress", + type: "address", + }, + { + components: [ + { + internalType: "address", + name: "pool", + type: "address", + }, + { + internalType: "uint24", + name: "feeTier", + type: "uint24", + }, + ], + internalType: "struct SNXPerpV2Adapter.UniswapPoolInfo", + name: "uniswapInfo", + type: "tuple", + }, + ], + internalType: "struct SNXPerpV2Adapter.MarketAdapterConfiguration", + name: "config", + type: "tuple", + }, + { + internalType: "uint256", + name: "snxPrice", + type: "uint256", + }, + { + internalType: "int256", + name: "riskFreeRate", + type: "int256", + }, + ], + internalType: "struct SNXPerpV2Adapter.MarketAdapterState", name: "", - type: "uint256", + type: "tuple", }, ], stateMutability: "view", @@ -998,11 +944,11 @@ const _abi = [ inputs: [ { internalType: "address", - name: "staker", + name: "optionMarket", type: "address", }, ], - name: "getTotalRewardsBalance", + name: "getPrices", outputs: [ { internalType: "uint256", @@ -1017,20 +963,20 @@ const _abi = [ inputs: [ { internalType: "address", - name: "user", + name: "_optionMarket", type: "address", }, { - internalType: "address", - name: "asset", - type: "address", + internalType: "uint256", + name: "", + type: "uint256", }, ], - name: "getUserAssetData", + name: "getSettlementPriceForMarket", outputs: [ { internalType: "uint256", - name: "", + name: "spotPrice", type: "uint256", }, ], @@ -1041,44 +987,28 @@ const _abi = [ inputs: [ { internalType: "address", - name: "spender", + name: "optionMarket", type: "address", }, { - internalType: "uint256", - name: "addedValue", - type: "uint256", + internalType: "enum BaseExchangeAdapter.PriceType", + name: "pricing", + type: "uint8", }, ], - name: "increaseAllowance", + name: "getSpotPriceForMarket", outputs: [ { - internalType: "bool", - name: "", - type: "bool", + internalType: "uint256", + name: "spotPrice", + type: "uint256", }, ], - stateMutability: "nonpayable", + stateMutability: "view", type: "function", }, { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "symbol", - type: "string", - }, - { - internalType: "uint8", - name: "decimals", - type: "uint8", - }, - ], + inputs: [], name: "initialize", outputs: [], stateMutability: "nonpayable", @@ -1086,12 +1016,12 @@ const _abi = [ }, { inputs: [], - name: "name", + name: "isGlobalPaused", outputs: [ { - internalType: "string", + internalType: "bool", name: "", - type: "string", + type: "bool", }, ], stateMutability: "view", @@ -1101,95 +1031,96 @@ const _abi = [ inputs: [ { internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "spender", + name: "", type: "address", }, + ], + name: "isMarketPaused", + outputs: [ { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", + internalType: "bool", + name: "", + type: "bool", }, ], - name: "permit", - outputs: [], - stateMutability: "nonpayable", + stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", - name: "to", + name: "", type: "address", }, + ], + name: "marketConfigurations", + outputs: [ { internalType: "uint256", - name: "amount", + name: "staticEstimationDiscount", type: "uint256", }, + { + internalType: "address", + name: "snxPerpV2MarketAddress", + type: "address", + }, + { + components: [ + { + internalType: "address", + name: "pool", + type: "address", + }, + { + internalType: "uint24", + name: "feeTier", + type: "uint24", + }, + ], + internalType: "struct SNXPerpV2Adapter.UniswapPoolInfo", + name: "uniswapInfo", + type: "tuple", + }, ], - name: "redeem", - outputs: [], - stateMutability: "nonpayable", + stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", - name: "onBehalfOf", + name: "_owner", type: "address", }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, ], - name: "stake", + name: "nominateNewOwner", outputs: [], stateMutability: "nonpayable", type: "function", }, { - inputs: [ + inputs: [], + name: "nominatedOwner", + outputs: [ { internalType: "address", name: "", type: "address", }, ], - name: "stakerRewardsToClaim", + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", outputs: [ { - internalType: "uint256", + internalType: "address", name: "", - type: "uint256", + type: "address", }, ], stateMutability: "view", @@ -1203,83 +1134,117 @@ const _abi = [ type: "address", }, ], - name: "stakersCooldowns", + name: "rateAndCarry", outputs: [ { - internalType: "uint256", + internalType: "int256", name: "", - type: "uint256", + type: "int256", }, ], stateMutability: "view", type: "function", }, { - inputs: [], - name: "symbol", - outputs: [ + inputs: [ { - internalType: "string", + internalType: "address", name: "", - type: "string", + type: "address", }, ], + name: "requireNotGlobalPaused", + outputs: [], stateMutability: "view", type: "function", }, { - inputs: [], - name: "totalSupply", - outputs: [ + inputs: [ { - internalType: "uint256", - name: "", - type: "uint256", + internalType: "address", + name: "optionMarket", + type: "address", }, ], + name: "requireNotMarketPaused", + outputs: [], stateMutability: "view", type: "function", }, { inputs: [ { - internalType: "uint256", - name: "blockNumber", - type: "uint256", + internalType: "contract IAddressResolver", + name: "_addressResolver", + type: "address", }, ], - name: "totalSupplyAt", - outputs: [ + name: "setAddressResolver", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ { - internalType: "uint256", - name: "", - type: "uint256", + internalType: "bool", + name: "isPaused", + type: "bool", }, ], - stateMutability: "view", + name: "setGlobalPaused", + outputs: [], + stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", - name: "recipient", + name: "_optionMarket", type: "address", }, { internalType: "uint256", - name: "amount", + name: "_staticEstimationDiscount", type: "uint256", }, + { + internalType: "address", + name: "_snxPerpV2MarketAddress", + type: "address", + }, + { + internalType: "address", + name: "_uniswapPool", + type: "address", + }, + { + internalType: "uint24", + name: "_uniswapFeeTier", + type: "uint24", + }, ], - name: "transfer", - outputs: [ + name: "setMarketAdapterConfiguration", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "optionMarket", + type: "address", + }, { internalType: "bool", - name: "", + name: "isPaused", type: "bool", }, ], + name: "setMarketPaused", + outputs: [], stateMutability: "nonpayable", type: "function", }, @@ -1287,42 +1252,107 @@ const _abi = [ inputs: [ { internalType: "address", - name: "sender", + name: "_optionMarket", type: "address", }, { - internalType: "address", - name: "recipient", - type: "address", + internalType: "int256", + name: "_rate", + type: "int256", }, + ], + name: "setRiskFreeRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ { internalType: "uint256", - name: "amount", + name: "_deviation", type: "uint256", }, ], - name: "transferFrom", + name: "setUniSwapDeviation", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract ISwapRouter", + name: "_swapRouter", + type: "address", + }, + ], + name: "setUniswapRouter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "swapRouter", + outputs: [ + { + internalType: "contract ISwapRouter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "systemStatus", outputs: [ { - internalType: "bool", + internalType: "contract ISystemStatus", name: "", - type: "bool", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "uniDeviation", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", }, ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "updateSynthetixAddresses", + outputs: [], stateMutability: "nonpayable", type: "function", }, ]; -export class LyraStakingModule__factory { +export class NewportSNXPerpV2Adapter__factory { static readonly abi = _abi; - static createInterface(): LyraStakingModuleInterface { - return new utils.Interface(_abi) as LyraStakingModuleInterface; + static createInterface(): NewportSNXPerpV2AdapterInterface { + return new utils.Interface(_abi) as NewportSNXPerpV2AdapterInterface; } static connect( address: string, signerOrProvider: Signer | Provider - ): LyraStakingModule { - return new Contract(address, _abi, signerOrProvider) as LyraStakingModule; + ): NewportSNXPerpV2Adapter { + return new Contract( + address, + _abi, + signerOrProvider + ) as NewportSNXPerpV2Adapter; } } diff --git a/sdk/src/contracts/newport/typechain/factories/NewportSNXPerpsV2PoolHedger__factory.ts b/sdk/src/contracts/newport/typechain/factories/NewportSNXPerpsV2PoolHedger__factory.ts new file mode 100644 index 0000000..d0d3a9d --- /dev/null +++ b/sdk/src/contracts/newport/typechain/factories/NewportSNXPerpsV2PoolHedger__factory.ts @@ -0,0 +1,1167 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + NewportSNXPerpsV2PoolHedger, + NewportSNXPerpsV2PoolHedgerInterface, +} from "../NewportSNXPerpsV2PoolHedger"; + +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: "uint256", + name: "lastInteraction", + type: "uint256", + }, + { + internalType: "uint256", + name: "interactionDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "currentTime", + type: "uint256", + }, + ], + name: "InteractionDelayNotExpired", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "thrower", + type: "address", + }, + { + components: [ + { + internalType: "uint256", + name: "targetLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maximumFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "deltaThreshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketDepthBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeltaBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "worstStableRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxOrderCap", + type: "uint256", + }, + ], + internalType: + "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + name: "params", + type: "tuple", + }, + ], + name: "InvalidFuturesPoolHedgerParams", + 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", + }, + { + inputs: [ + { + internalType: "int256", + name: "pendingDelta", + type: "int256", + }, + ], + name: "PendingOrderDeltaError", + type: "error", + }, + { + inputs: [], + name: "PerpMarketReturnedInvalid", + 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", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "oldCollat", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "newCollat", + type: "uint256", + }, + ], + name: "CollateralUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "targetLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maximumFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "deltaThreshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketDepthBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeltaBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "worstStableRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxOrderCap", + type: "uint256", + }, + ], + indexed: false, + internalType: + "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + name: "params", + type: "tuple", + }, + ], + name: "FuturesPoolHedgerParamsSet", + 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: [ + { + components: [ + { + internalType: "uint256", + name: "interactionDelay", + type: "uint256", + }, + { + internalType: "uint256", + name: "hedgeCap", + type: "uint256", + }, + ], + indexed: false, + internalType: "struct PoolHedger.PoolHedgerParameters", + name: "poolHedgerParams", + type: "tuple", + }, + ], + name: "PoolHedgerParametersSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "int256", + name: "oldNetDelta", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "currentNetDelta", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "expectedNetDelta", + type: "int256", + }, + ], + name: "PositionUpdateSubmitted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "amountQuote", + type: "uint256", + }, + ], + name: "QuoteReturnedToLP", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "quoteAsset", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sUSD", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "curve_rate", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "maxSlippage", + type: "uint256", + }, + ], + name: "SlippageOutOfBounds", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "TrackingCodeSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "quoteAsset", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sUSD", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + ], + name: "USDCCollateralSwapForMargin", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "quoteAsset", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sUSD", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + ], + name: "sUSDCollateralSwap", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "addressResolver", + outputs: [ + { + internalType: "contract IAddressResolver", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "bool", + name: "deltaIncrease", + type: "bool", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "canHedge", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "curveSwap", + outputs: [ + { + internalType: "contract ICurve", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "exchangeAdapter", + outputs: [ + { + internalType: "contract BaseExchangeAdapter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "futuresPoolHedgerParams", + outputs: [ + { + internalType: "uint256", + name: "targetLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maximumFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "deltaThreshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketDepthBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeltaBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "worstStableRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxOrderCap", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCappedExpectedHedge", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentHedgedNetDelta", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentPositionMargin", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getHedgerState", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "lastInteraction", + type: "uint256", + }, + { + internalType: "int256", + name: "hedgedDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "margin", + type: "uint256", + }, + { + internalType: "uint256", + name: "leverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "hedgerQuoteBalance", + type: "uint256", + }, + { + internalType: "uint256", + name: "hedgerMarginQuoteBalance", + type: "uint256", + }, + { + internalType: "bool", + name: "canHedgeDeltaIncrease", + type: "bool", + }, + { + internalType: "bool", + name: "canHedgeDeltaDecrease", + type: "bool", + }, + { + internalType: "int256", + name: "cappedExpectedHedge", + type: "int256", + }, + { + internalType: "bool", + name: "snxHasEnoughMarketDepth", + type: "bool", + }, + { + internalType: "bool", + name: "marketSuspended", + type: "bool", + }, + { + internalType: "bool", + name: "curveRateStable", + type: "bool", + }, + { + internalType: "uint256", + name: "pendingDeltaLiquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "usedDeltaLiquidity", + type: "uint256", + }, + { + internalType: "int256", + name: "pendingDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "longInterest", + type: "uint256", + }, + { + internalType: "uint256", + name: "shortInterest", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxTotalMarketSize", + type: "uint256", + }, + { + internalType: "uint256", + name: "pendingMargin", + type: "uint256", + }, + { + internalType: "int256", + name: "fundingRate", + type: "int256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + internalType: "address", + name: "optionMarket", + type: "address", + }, + { + internalType: "address", + name: "perpsMarket", + type: "address", + }, + { + internalType: "address", + name: "curveSwap", + type: "address", + }, + { + internalType: "address", + name: "quoteAsset", + type: "address", + }, + { + components: [ + { + internalType: "uint256", + name: "targetLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maximumFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "deltaThreshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketDepthBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeltaBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "worstStableRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxOrderCap", + type: "uint256", + }, + ], + internalType: + "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + name: "futuresPoolHedgerParams", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "interactionDelay", + type: "uint256", + }, + { + internalType: "uint256", + name: "hedgeCap", + type: "uint256", + }, + ], + internalType: "struct PoolHedger.PoolHedgerParameters", + name: "poolHedgerParams", + type: "tuple", + }, + ], + internalType: "struct SNXPerpsV2PoolHedger.HedgerState", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "spotPrice", + type: "uint256", + }, + ], + name: "getHedgingLiquidity", + outputs: [ + { + internalType: "uint256", + name: "pendingDeltaLiquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "usedDeltaLiquidity", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolHedgerParams", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "interactionDelay", + type: "uint256", + }, + { + internalType: "uint256", + name: "hedgeCap", + type: "uint256", + }, + ], + internalType: "struct PoolHedger.PoolHedgerParameters", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hedgeDelta", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IAddressResolver", + name: "_addressResolver", + type: "address", + }, + { + internalType: "contract BaseExchangeAdapter", + name: "_exchangeAdapter", + type: "address", + }, + { + internalType: "contract OptionMarket", + name: "_optionMarket", + type: "address", + }, + { + internalType: "contract OptionGreekCache", + name: "_optionGreekCache", + type: "address", + }, + { + internalType: "contract LiquidityPool", + name: "_liquidityPool", + type: "address", + }, + { + internalType: "contract IPerpsV2MarketConsolidated", + name: "_perpMarketProxy", + type: "address", + }, + { + internalType: "contract ERC20", + name: "_quoteAsset", + type: "address", + }, + { + internalType: "contract ERC20", + name: "_sUSD", + type: "address", + }, + { + internalType: "contract ICurve", + name: "_curveSwap", + type: "address", + }, + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "init", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "lastInteraction", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "marketKey", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + 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: "perpsMarket", + outputs: [ + { + internalType: "contract IPerpsV2MarketConsolidated", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "resetInteractionDelay", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "targetLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maximumFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "deltaThreshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketDepthBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeltaBuffer", + type: "uint256", + }, + { + internalType: "uint256", + name: "worstStableRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxOrderCap", + type: "uint256", + }, + ], + internalType: + "struct SNXPerpsV2PoolHedger.SNXPerpsV2PoolHedgerParameters", + name: "_futuresPoolHedgerParams", + type: "tuple", + }, + ], + name: "setFuturesPoolHedgerParams", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "interactionDelay", + type: "uint256", + }, + { + internalType: "uint256", + name: "hedgeCap", + type: "uint256", + }, + ], + internalType: "struct PoolHedger.PoolHedgerParameters", + name: "_poolHedgerParams", + type: "tuple", + }, + ], + name: "setPoolHedgerParams", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_trackingCode", + type: "bytes32", + }, + ], + name: "setTrackingCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "trackingCode", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "updateCollateral", + outputs: [], + stateMutability: "payable", + type: "function", + }, +]; + +export class NewportSNXPerpsV2PoolHedger__factory { + static readonly abi = _abi; + static createInterface(): NewportSNXPerpsV2PoolHedgerInterface { + return new utils.Interface(_abi) as NewportSNXPerpsV2PoolHedgerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): NewportSNXPerpsV2PoolHedger { + return new Contract( + address, + _abi, + signerOrProvider + ) as NewportSNXPerpsV2PoolHedger; + } +} diff --git a/sdk/src/contracts/newport/typechain/factories/index.ts b/sdk/src/contracts/newport/typechain/factories/index.ts index 34498ac..4b17e55 100644 --- a/sdk/src/contracts/newport/typechain/factories/index.ts +++ b/sdk/src/contracts/newport/typechain/factories/index.ts @@ -8,10 +8,11 @@ export { NewportLiquidityPool__factory } from "./NewportLiquidityPool__factory"; export { NewportLiquidityToken__factory } from "./NewportLiquidityToken__factory"; export { NewportLyraRegistry__factory } from "./NewportLyraRegistry__factory"; export { NewportOptionGreekCache__factory } from "./NewportOptionGreekCache__factory"; -export { NewportOptionMarket__factory } from "./NewportOptionMarket__factory"; export { NewportOptionMarketPricer__factory } from "./NewportOptionMarketPricer__factory"; export { NewportOptionMarketViewer__factory } from "./NewportOptionMarketViewer__factory"; export { NewportOptionToken__factory } from "./NewportOptionToken__factory"; export { NewportPoolHedger__factory } from "./NewportPoolHedger__factory"; +export { NewportSNXPerpV2Adapter__factory } from "./NewportSNXPerpV2Adapter__factory"; +export { NewportSNXPerpsV2PoolHedger__factory } from "./NewportSNXPerpsV2PoolHedger__factory"; export { NewportShortCollateral__factory } from "./NewportShortCollateral__factory"; export { NewportTestFaucet__factory } from "./NewportTestFaucet__factory"; diff --git a/sdk/src/contracts/newport/typechain/index.ts b/sdk/src/contracts/newport/typechain/index.ts index de53a27..ac94cf5 100644 --- a/sdk/src/contracts/newport/typechain/index.ts +++ b/sdk/src/contracts/newport/typechain/index.ts @@ -8,11 +8,12 @@ export type { NewportLiquidityPool } from "./NewportLiquidityPool"; export type { NewportLiquidityToken } from "./NewportLiquidityToken"; export type { NewportLyraRegistry } from "./NewportLyraRegistry"; export type { NewportOptionGreekCache } from "./NewportOptionGreekCache"; -export type { NewportOptionMarket } from "./NewportOptionMarket"; export type { NewportOptionMarketPricer } from "./NewportOptionMarketPricer"; export type { NewportOptionMarketViewer } from "./NewportOptionMarketViewer"; export type { NewportOptionToken } from "./NewportOptionToken"; export type { NewportPoolHedger } from "./NewportPoolHedger"; +export type { NewportSNXPerpV2Adapter } from "./NewportSNXPerpV2Adapter"; +export type { NewportSNXPerpsV2PoolHedger } from "./NewportSNXPerpsV2PoolHedger"; export type { NewportShortCollateral } from "./NewportShortCollateral"; export type { NewportTestFaucet } from "./NewportTestFaucet"; export * as factories from "./factories"; @@ -23,10 +24,11 @@ export { NewportLiquidityPool__factory } from "./factories/NewportLiquidityPool_ export { NewportLiquidityToken__factory } from "./factories/NewportLiquidityToken__factory"; export { NewportLyraRegistry__factory } from "./factories/NewportLyraRegistry__factory"; export { NewportOptionGreekCache__factory } from "./factories/NewportOptionGreekCache__factory"; -export { NewportOptionMarket__factory } from "./factories/NewportOptionMarket__factory"; export { NewportOptionMarketPricer__factory } from "./factories/NewportOptionMarketPricer__factory"; export { NewportOptionMarketViewer__factory } from "./factories/NewportOptionMarketViewer__factory"; export { NewportOptionToken__factory } from "./factories/NewportOptionToken__factory"; export { NewportPoolHedger__factory } from "./factories/NewportPoolHedger__factory"; export { NewportShortCollateral__factory } from "./factories/NewportShortCollateral__factory"; +export { NewportSNXPerpsV2PoolHedger__factory } from "./factories/NewportSNXPerpsV2PoolHedger__factory"; +export { NewportSNXPerpV2Adapter__factory } from "./factories/NewportSNXPerpV2Adapter__factory"; export { NewportTestFaucet__factory } from "./factories/NewportTestFaucet__factory"; diff --git a/sdk/src/contracts/generate-types.ts b/sdk/src/contracts/typegen.ts similarity index 100% rename from sdk/src/contracts/generate-types.ts rename to sdk/src/contracts/typegen.ts diff --git a/sdk/src/global_reward_epoch/index.ts b/sdk/src/global_reward_epoch/index.ts index 156f75d..33c98b9 100644 --- a/sdk/src/global_reward_epoch/index.ts +++ b/sdk/src/global_reward_epoch/index.ts @@ -2,20 +2,21 @@ import { Block } from '@ethersproject/providers' import { Deployment, Market, MarketLiquiditySnapshot } from '..' import { AccountRewardEpoch } from '../account_reward_epoch' -import { SECONDS_IN_DAY, SECONDS_IN_WEEK, SECONDS_IN_YEAR } from '../constants/time' +import { SECONDS_IN_DAY, SECONDS_IN_YEAR } from '../constants/time' import Lyra from '../lyra' -import { LyraStaking } from '../lyra_staking' import fetchGlobalRewardEpochData, { GlobalRewardEpochData } from '../utils/fetchGlobalRewardEpochData' -import fetchLyraTokenSpotPrice from '../utils/fetchLyraTokenSpotPrice' -import fetchOpTokenSpotPrice from '../utils/fetchOpTokenSpotPrice' import findMarketX from '../utils/findMarketX' import fromBigNumber from '../utils/fromBigNumber' import getEffectiveLiquidityTokens, { getMinimumStakedLyra } from '../utils/getEffectiveLiquidityTokens' -import getEffectiveTradingFeeRebate from '../utils/getEffectiveTradingFeeRebate' - -export type GlobalRewardEpochTradingFeeRebateTier = { - stakedLyraCutoff: number - feeRebate: number +import getUniqueBy from '../utils/getUniqueBy' +import isMarketEqual from '../utils/isMarketEqual' + +export type GlobalRewardEpochTradingBoostTier = { + stakingCutoff: number + tradingCutoff: number + isReferred: boolean + label: string + boost: number } export type RewardEpochToken = { @@ -24,27 +25,28 @@ export type RewardEpochToken = { decimals: number } -export type RewardEpochTokenAmount = { - address: string - symbol: string - decimals: number +export type RewardEpochTokenAmount = RewardEpochToken & { amount: number } +export type RewardEpochTokenPrice = RewardEpochToken & { + price: number +} + export type RewardEpochTokenConfig = RewardEpochToken & { amount: number } export class GlobalRewardEpoch { - private lyra: Lyra - private epoch: GlobalRewardEpochData + lyra: Lyra + epoch: GlobalRewardEpochData id: number progressDays: number markets: Market[] marketsLiquidity: MarketLiquiditySnapshot[] - staking: LyraStaking blockTimestamp: number startTimestamp: number + distributionTimestamp: number startEarningTimestamp?: number endTimestamp: number isDepositPeriod?: boolean @@ -53,94 +55,78 @@ export class GlobalRewardEpoch { isCurrent: boolean isComplete: boolean totalAverageStakedLyra: number - minTradingFeeRebate: number - maxTradingFeeRebate: number - stakingApy: RewardEpochTokenAmount[] - totalStakingRewards: RewardEpochTokenAmount[] tradingRewardsCap: RewardEpochTokenAmount[] - prices: RewardEpochTokenAmount[] - tradingFeeRebateTiers: GlobalRewardEpochTradingFeeRebateTier[] - wethLyraStakingL2: RewardEpochTokenAmount[] + tradingBoostTiers: GlobalRewardEpochTradingBoostTier[] + vaultRewardTokens: RewardEpochToken[] + tradingRewardTokens: RewardEpochToken[] + rewardTokens: RewardEpochToken[] + + private tokenPriceMap: Record + constructor( lyra: Lyra, id: number, epoch: GlobalRewardEpochData, - prices: RewardEpochTokenAmount[], markets: Market[], marketsLiquidity: MarketLiquiditySnapshot[], - staking: LyraStaking, block: Block ) { this.lyra = lyra this.id = id this.epoch = epoch - this.prices = prices - this.tradingFeeRebateTiers = epoch.tradingRewardConfig?.rebateRateTable?.map(tier => { - return { - stakedLyraCutoff: tier?.cutoff ?? 0, - feeRebate: tier?.returnRate ?? 0, - } - }) + this.markets = markets + this.marketsLiquidity = marketsLiquidity + this.tradingBoostTiers = epoch.tradingRewardConfig?.boostRateTable?.map(tier => ({ + stakingCutoff: tier.stakingCutoff, + tradingCutoff: tier.tradingCutoff, + isReferred: tier.isReferred, + label: tier.label, + boost: tier.boostRate, + })) + this.blockTimestamp = block.timestamp this.startTimestamp = epoch.startTimestamp this.lastUpdatedTimestamp = epoch.lastUpdated this.endTimestamp = epoch.endTimestamp + this.distributionTimestamp = epoch.distributionTimestamp ?? epoch.endTimestamp this.isDepositPeriod = epoch.isDepositPeriod this.startEarningTimestamp = epoch.startEarningTimestamp this.isCurrent = this.blockTimestamp >= this.startTimestamp && this.blockTimestamp <= this.endTimestamp this.isComplete = this.blockTimestamp > this.endTimestamp - this.markets = markets - this.staking = staking - this.marketsLiquidity = marketsLiquidity const durationSeconds = Math.max(0, this.endTimestamp - this.startTimestamp) - this.duration = durationSeconds const progressSeconds = durationSeconds - Math.max(0, this.endTimestamp - this.blockTimestamp) + this.duration = durationSeconds this.progressDays = progressSeconds / SECONDS_IN_DAY this.totalAverageStakedLyra = this.progressDays ? epoch.totalStkLyraDays / this.progressDays : 0 - // Staking - const stkLyraPrice = - this.prices.find(token => ['lyra', 'stklyra'].includes(token.symbol.toLowerCase()))?.amount ?? 0 // TODO: @dillon refactor later - const stkLyraPerDollar = stkLyraPrice > 0 ? 1 / stkLyraPrice : 0 - const totalStkLyra = this.isComplete ? this.totalAverageStakedLyra : fromBigNumber(staking.totalSupply) - const pctSharePerDollar = totalStkLyra > 0 ? stkLyraPerDollar / totalStkLyra : 0 - - this.stakingApy = this.epoch.stakingRewardConfig.map(tokenReward => { - const rewardAmount = tokenReward.amount - const perDollarPerSecond = durationSeconds > 0 ? (pctSharePerDollar * rewardAmount) / durationSeconds : 0 - const price = this.findTokenPrice(tokenReward.address) - const apy = perDollarPerSecond * price * SECONDS_IN_YEAR - return { - address: tokenReward.address, - symbol: tokenReward.symbol, - decimals: tokenReward.decimals, - amount: apy, - } - }) + // Trading + this.tradingRewardsCap = epoch.tradingRewardConfig.tokens.map(token => ({ + address: token.address, + symbol: token.symbol, + decimals: token.decimals, + amount: token.cap, + })) + + this.tradingRewardTokens = getUniqueBy( + epoch.tradingRewardConfig.tokens.filter(t => t.cap > 0), + token => token.address.toLowerCase() + ) - this.totalStakingRewards = this.epoch.stakingRewardConfig.map(tokenReward => { - return { - address: tokenReward.address, - symbol: tokenReward.symbol, - decimals: tokenReward.decimals, - amount: tokenReward.amount, - } - }) + this.vaultRewardTokens = getUniqueBy( + Object.values(epoch.MMVConfig) + .flatMap(e => e.tokens) + .filter(t => t.amount > 0), + token => token.address.toLowerCase() + ) - this.minTradingFeeRebate = this.tradingFeeRebate(0) - this.maxTradingFeeRebate = this.tradingFeeRebate(totalStkLyra) + this.rewardTokens = getUniqueBy([...this.tradingRewardTokens, ...this.vaultRewardTokens], r => r.address) - this.tradingRewardsCap = this.epoch.tradingRewardConfig.tokens.map(token => { - return { - address: token.address, - symbol: token.symbol, - decimals: token.decimals, - amount: token.cap, - } - }) - - this.wethLyraStakingL2 = this.epoch?.wethLyraStakingL2RewardConfig ?? [] + this.tokenPriceMap = + epoch.tokenPrices?.reduce( + (tokenPriceMap, tokenPrice) => ({ ...tokenPriceMap, [tokenPrice.address]: tokenPrice }), + {} as Record + ) ?? {} } // Getters @@ -149,73 +135,16 @@ export class GlobalRewardEpoch { if (lyra.deployment !== Deployment.Mainnet) { return [] } - const [epochs, lyraPrice, opPrice, markets, staking, block] = await Promise.all([ + + const [epochs, markets, block] = await Promise.all([ fetchGlobalRewardEpochData(lyra), - fetchLyraTokenSpotPrice(lyra), - fetchOpTokenSpotPrice(lyra), // TODO: @dillon refactor later to map through tokens lyra.markets(), - lyra.lyraStaking(), lyra.provider.getBlock('latest'), ]) - const marketsLiquidity = await Promise.all(markets.map(market => market.liquidity())) - // TODO @dillon - come back think of better solution - const prices: { [address: string]: RewardEpochTokenAmount } = {} - epochs.forEach(epoch => { - const stakingRewardTokens: RewardEpochToken[] = - epoch?.globalStakingRewards.map(reward => { - return { - address: reward.address, - decimals: reward.decimals, - symbol: reward.symbol, - } - }) ?? [] - const mmvRewardTokens: RewardEpochToken[] = Object.values(epoch?.globalMMVRewards) - .map(rewardTokens => { - return rewardTokens.map(reward => { - return { - address: reward.address, - decimals: reward.decimals, - symbol: reward.symbol, - } - }) - }) - .flat() - const tradingRewardTokens: RewardEpochToken[] = - epoch.globalTradingRewards?.totalRewards?.map(reward => { - return { - address: reward.address, - decimals: reward.decimals, - symbol: reward.symbol, - } - }) ?? [] - const tokens = [...stakingRewardTokens, ...mmvRewardTokens, ...tradingRewardTokens] - tokens.forEach(token => { - if (['lyra', 'stklyra'].includes(token.symbol.toLowerCase())) { - prices[token.address] = { - amount: lyraPrice, - address: token.address, - decimals: token.decimals, - symbol: token.symbol, - } - } - if (['op'].includes(token.symbol.toLowerCase())) { - prices[token.address] = { - amount: opPrice, - address: token.address, - decimals: token.decimals, - symbol: token.symbol, - } - } - }) - }) - return epochs - .map( - (epoch, idx) => - new GlobalRewardEpoch(lyra, idx + 1, epoch, Object.values(prices), markets, marketsLiquidity, staking, block) - ) + .map((epoch, idx) => new GlobalRewardEpoch(lyra, idx + 1, epoch, markets, marketsLiquidity, block)) .sort((a, b) => a.endTimestamp - b.endTimestamp) } @@ -242,13 +171,12 @@ export class GlobalRewardEpoch { vaultApy( marketAddressOrName: string, stakedLyraBalance: number, - _vaultTokenBalance: number + vaultTokenBalance: number ): RewardEpochTokenAmount[] { - const market = findMarketX(this.markets, marketAddressOrName) + const marketIdx = this.markets.findIndex(m => isMarketEqual(m, marketAddressOrName)) + const market = this.markets[marketIdx] const marketKey = market.baseToken.symbol - const vaultTokenBalance = _vaultTokenBalance - const totalAvgVaultTokens = this.totalAverageVaultTokens(marketAddressOrName) const mmvConfig = this.epoch.MMVConfig[marketKey] const scaledStkLyraDays = this.epoch.scaledStkLyraDays[marketKey] @@ -256,7 +184,6 @@ export class GlobalRewardEpoch { return [] } - const x = mmvConfig.x const totalAvgScaledStkLyra = this.progressDays ? scaledStkLyraDays / this.progressDays : 0 const effectiveLpTokensPerLpToken = getEffectiveLiquidityTokens( @@ -264,32 +191,25 @@ export class GlobalRewardEpoch { totalAvgVaultTokens, stakedLyraBalance, totalAvgScaledStkLyra, - x + mmvConfig.x ) - const totalAvgBoostedVaultTokens = this.totalAverageBoostedVaultTokens(marketAddressOrName) - const boostedPortionOfLiquidity = - totalAvgBoostedVaultTokens > 0 ? effectiveLpTokensPerLpToken / totalAvgBoostedVaultTokens : 0 - const basePortionOfLiquidity = totalAvgVaultTokens > 0 ? vaultTokenBalance / totalAvgVaultTokens : 0 - // This ratio is for no staking -> staking w/ stkLyraBalance (noStakingMultiplier) // Vs UI apy multiplier is from zero staking -> staking w/ stkLyraBalance (vaultApyMultiplier) - const apyMultiplier = basePortionOfLiquidity > 0 ? boostedPortionOfLiquidity / basePortionOfLiquidity : 0 - + const apyMultiplier = (effectiveLpTokensPerLpToken / vaultTokenBalance) * 2 + // const apyMultiplier = basePortionOfLiquidity > 0 ? boostedPortionOfLiquidity / basePortionOfLiquidity : 0 // Calculate total vault token balance, including pending deposits - const marketIdx = this.markets.findIndex(m => m.address === market.address) const tokenPrice = fromBigNumber(this.marketsLiquidity[marketIdx].tokenPrice) const totalQueuedVaultTokens = tokenPrice > 0 ? fromBigNumber(this.marketsLiquidity[marketIdx].pendingDeposits) / tokenPrice : 0 const totalAvgAndQueuedVaultTokens = totalAvgVaultTokens + totalQueuedVaultTokens - const vaultTokensPerDollar = tokenPrice > 0 ? 1 / tokenPrice : 0 const pctSharePerDollar = totalAvgAndQueuedVaultTokens > 0 ? vaultTokensPerDollar / totalAvgAndQueuedVaultTokens : 0 return mmvConfig.tokens.map(token => { const rewards = token.amount const perDollarPerSecond = this.duration > 0 ? (pctSharePerDollar * rewards) / this.duration : 0 - const price = this.findTokenPrice(token.address) + const price = this.tokenPriceMap[token.address]?.price ?? 0 const apy = perDollarPerSecond * price * SECONDS_IN_YEAR * apyMultiplier return { amount: apy, @@ -340,14 +260,16 @@ export class GlobalRewardEpoch { totalVaultRewards(marketAddressOrName: string): RewardEpochTokenAmount[] { const market = findMarketX(this.markets, marketAddressOrName) const marketKey = market.baseToken.symbol - this.epoch.globalMMVRewards[marketKey] - return this.epoch.globalMMVRewards[marketKey] + return this.epoch.globalMMVRewards[marketKey] ?? [] } totalAverageVaultTokens(marketAddressOrName: string): number { const market = findMarketX(this.markets, marketAddressOrName) const marketKey = market.baseToken.symbol - return this.progressDays ? (this.epoch.totalLpTokenDays[marketKey] ?? 0) / this.progressDays : 0 + return fromBigNumber(market.params.NAV) + // const test = await market.liquidity() + // test. + // return this.progressDays ? (this.epoch.totalLpTokenDays[marketKey] ?? 0) / this.progressDays : 0 } totalAverageBoostedVaultTokens(marketAddressOrName: string): number { @@ -356,105 +278,6 @@ export class GlobalRewardEpoch { return this.progressDays ? (this.epoch.totalBoostedLpTokenDays[marketKey] ?? 0) / this.progressDays : 0 } - tradingFeeRebate(stakedLyraBalance: number): number { - const { - useRebateTable, - rebateRateTable, - maxRebatePercentage, - netVerticalStretch, - verticalShift, - vertIntercept, - stretchiness, - } = this.epoch.tradingRewardConfig - return getEffectiveTradingFeeRebate( - stakedLyraBalance, - useRebateTable, - rebateRateTable, - maxRebatePercentage, - netVerticalStretch, - verticalShift, - vertIntercept, - stretchiness - ) - } - - tradingRewards(tradingFees: number, stakedLyraBalance: number): RewardEpochTokenAmount[] { - return this.epoch.tradingRewardConfig.tokens.map(token => { - const currentPrice = this.findTokenPrice(token.address) - const price = this.isComplete ? token.fixedPrice : Math.max(currentPrice, token.floorTokenPrice) - const feeRebate = this.tradingFeeRebate(stakedLyraBalance) - const feesRebated = feeRebate * tradingFees - const rewardAmount = (feesRebated * token.portion) / price - return { - amount: rewardAmount, - address: token.address, - decimals: token.decimals, - symbol: token.symbol, - } - }) - } - - shortCollateralRewards(shortCollateralRebate: number): RewardEpochTokenAmount[] { - return this.epoch.tradingRewardConfig.tokens.map(token => { - const currentPrice = this.findTokenPrice(token.address) - const price = this.isComplete ? token.fixedPrice : Math.max(currentPrice, token.floorTokenPrice) - const rewardAmount = (shortCollateralRebate * token.portion) / price - return { - amount: rewardAmount, - address: token.address, - decimals: token.decimals, - symbol: token.symbol, - } - }) - } - - shortCollateralYieldPerDay( - contracts: number, - delta: number, - expiryTimestamp: number, - marketBaseSymbol: string - ): RewardEpochTokenAmount[] { - const timeToExpiry = Math.max(0, expiryTimestamp - this.blockTimestamp) - const absDelta = Math.abs(delta) - if ( - !this.epoch.tradingRewardConfig.shortCollateralRewards || - !this.epoch.tradingRewardConfig.shortCollateralRewards[marketBaseSymbol] || - absDelta < 0.1 || - absDelta > 0.9 || - this.isComplete - ) { - return [] - } - - const { longDatedPenalty, tenDeltaRebatePerOptionDay, ninetyDeltaRebatePerOptionDay } = - this.epoch.tradingRewardConfig.shortCollateralRewards[marketBaseSymbol] - const timeDiscount = timeToExpiry >= SECONDS_IN_WEEK * 4 ? longDatedPenalty : 1 - - const rebatePerDay = - (tenDeltaRebatePerOptionDay + - (ninetyDeltaRebatePerOptionDay - tenDeltaRebatePerOptionDay) * - ((absDelta - 0.1) / (0.9 - 0.1)) * - timeDiscount) * - contracts - - return this.epoch.tradingRewardConfig.tokens.map(token => { - const currentPrice = this.findTokenPrice(token.address) - const price = Math.max(currentPrice, token.floorTokenPrice) - const tokenRebatePerDay = token.portion * rebatePerDay - const rewardAmount = price > 0 ? tokenRebatePerDay / price : 0 - return { - amount: rewardAmount, - address: token.address, - decimals: token.decimals, - symbol: token.symbol, - } - }) - } - - findTokenPrice(address: string): number { - return this.prices.find(tokenPrice => tokenPrice.address.toLowerCase() === address.toLowerCase())?.amount ?? 0 - } - // Edge async accountRewardEpoch(address: string): Promise { diff --git a/sdk/src/index.ts b/sdk/src/index.ts index fc21681..f46bf7e 100644 --- a/sdk/src/index.ts +++ b/sdk/src/index.ts @@ -13,17 +13,21 @@ export * from './trade_event' export * from './liquidity_deposit' export * from './liquidity_withdrawal' export * from './admin' -export * from './lyra_staking' -export * from './weth_lyra_staking' -export * from './lyra_stake' -export * from './lyra_unstake' export * from './global_reward_epoch' export * from './account_reward_epoch' export * from './constants/contracts' export * from './constants/queries' export * from './constants/network' export * from './constants/chain' +export * from './utils/getGlobalContract' +export * from './utils/getLyraContract' +export * from './utils/getLyraMarketContract' export * from './contracts/common/typechain' +//export * from './contracts/common/typechain/factories/ERC20__factory' +// export { +// factories as NewportOptionMarket_Factories, +// NewportOptionMarket__factory, +// } from './contracts/newport/arbitrum/typechain' export { factories as AvalonFactories, AvalonLiquidityPool__factory, @@ -39,6 +43,7 @@ export { AvalonSynthetixAdapter__factory, AvalonTestFaucet__factory, } from './contracts/avalon/typechain' + export { factories as NewportFactories, NewportExchangeAdapter__factory, @@ -48,7 +53,6 @@ export { NewportLiquidityToken__factory, NewportLyraRegistry__factory, NewportOptionGreekCache__factory, - NewportOptionMarket__factory, NewportOptionMarketPricer__factory, NewportOptionMarketViewer__factory, NewportOptionToken__factory, diff --git a/sdk/src/liquidity_deposit/index.ts b/sdk/src/liquidity_deposit/index.ts index 2a96a94..cf94d37 100644 --- a/sdk/src/liquidity_deposit/index.ts +++ b/sdk/src/liquidity_deposit/index.ts @@ -4,9 +4,9 @@ import { PopulatedTransaction } from '@ethersproject/contracts' import { LyraMarketContractId } from '../constants/contracts' import Lyra from '../lyra' import { Market, MarketLiquiditySnapshot } from '../market' -import buildTxWithGasEstimate from '../utils/buildTxWithGasEstimate' +import buildTx from '../utils/buildTx' import fetchLiquidityDepositEventDataByOwner from '../utils/fetchLiquidityDepositEventDataByOwner' -import getLiquidityDelayReason from '../utils/getLiquidityDelayReason' +import getERC20Contract from '../utils/getERC20Contract' import getLyraMarketContract from '../utils/getLyraMarketContract' export enum LiquidityDelayReason { @@ -19,38 +19,55 @@ export type LiquidityDepositFilter = { user: string } -export type DepositQueuedOrProcessedEvent = { - queued?: LiquidityDepositQueuedEvent - processed?: LiquidityDepositProcessedEvent +export type LiquidityDepositEvents = + | { + isInstant: false + isProcessed: false + queued: LiquidityDepositQueuedEvent + } + | { + isInstant: true + isProcessed: true + processed: LiquidityDepositProcessedEvent + } + | { + isInstant: false + isProcessed: true + queued: LiquidityDepositQueuedEvent + processed: LiquidityDepositProcessedEvent + } + +export type LiquidityCircuitBreaker = { + timestamp: number + reason: LiquidityDelayReason } export type LiquidityDepositQueuedEvent = { depositor: string beneficiary: string - depositQueueId: BigNumber + queueId: number amountDeposited: BigNumber totalQueuedDeposits: BigNumber - timestamp: BigNumber + timestamp: number transactionHash: string } export type LiquidityDepositProcessedEvent = { caller: string beneficiary: string - depositQueueId: BigNumber + queueId: number amountDeposited: BigNumber tokenPrice: BigNumber tokensReceived: BigNumber - timestamp: BigNumber + timestamp: number transactionHash: string } export class LiquidityDeposit { lyra: Lyra - __queued?: LiquidityDepositQueuedEvent - __processed?: LiquidityDepositProcessedEvent + __events: LiquidityDepositEvents __market: Market - queueId?: number + queueId: number beneficiary: string value: BigNumber tokenPriceAtDeposit?: BigNumber @@ -59,101 +76,100 @@ export class LiquidityDeposit { depositRequestedTimestamp: number depositTimestamp: number timeToDeposit: number + transactionHash: string delayReason: LiquidityDelayReason | null constructor( lyra: Lyra, - market: Market, data: { - queued?: LiquidityDepositQueuedEvent - processed?: LiquidityDepositProcessedEvent - cbTimestamp: BigNumber + market: Market + events: LiquidityDepositEvents + circuitBreaker: LiquidityCircuitBreaker | null marketLiquidity: MarketLiquiditySnapshot } ) { // Data this.lyra = lyra - this.__market = market - this.__queued = data.queued - this.__processed = data.processed + this.__market = data.market + this.__events = data.events // Fields - const queued = data.queued - const processed = data.processed - const queuedOrProcessed = queued ?? processed - if (!queuedOrProcessed) { - throw new Error('No queued or processed event for LiquidityDeposit') - } - this.queueId = queuedOrProcessed.depositQueueId.toNumber() + const queued = !data.events.isInstant ? data.events.queued : null + const processed = data.events.isProcessed ? data.events.processed : null + const queuedOrProcessed = (data.events.isInstant ? processed : data.events.queued) as + | LiquidityDepositQueuedEvent + | LiquidityDepositProcessedEvent + this.transactionHash = queuedOrProcessed.transactionHash + this.queueId = queuedOrProcessed.queueId this.beneficiary = queuedOrProcessed.beneficiary this.value = queuedOrProcessed.amountDeposited this.tokenPriceAtDeposit = processed?.tokenPrice this.balance = processed?.tokensReceived this.isPending = !processed - this.depositRequestedTimestamp = queuedOrProcessed.timestamp.toNumber() + this.depositRequestedTimestamp = queuedOrProcessed.timestamp this.depositTimestamp = processed - ? processed.timestamp.toNumber() + ? processed.timestamp : queued - ? queued.timestamp.add(market.params.depositDelay).toNumber() + ? queued.timestamp + data.market.params.depositDelay : // Should never happen 0 - this.timeToDeposit = Math.max(0, this.depositTimestamp - market.block.timestamp) + this.timeToDeposit = Math.max(0, this.depositTimestamp - data.market.block.timestamp) this.delayReason = - this.timeToDeposit === 0 && this.isPending - ? getLiquidityDelayReason(market, data.cbTimestamp, data.marketLiquidity) + this.timeToDeposit === 0 && + this.isPending && + data.circuitBreaker && + data.circuitBreaker.timestamp > data.market.block.timestamp + ? data.circuitBreaker.reason : null } // Getters - static async getByOwner(lyra: Lyra, marketAddress: string, owner: string): Promise { - const market = await Market.get(lyra, marketAddress) - const liquidityPoolContract = getLyraMarketContract( - lyra, - market.contractAddresses, - lyra.version, - LyraMarketContractId.LiquidityPool - ) - const [{ events }, cbTimestamp, marketLiquidity] = await Promise.all([ + static async getByOwner(lyra: Lyra, market: Market, owner: string): Promise { + const [{ events, circuitBreaker }, marketLiquidity] = await Promise.all([ fetchLiquidityDepositEventDataByOwner(lyra, owner, market), - liquidityPoolContract.CBTimestamp(), market.liquidity(), ]) - const liquidityDeposits: LiquidityDeposit[] = await Promise.all( - events.map(async event => { - return new LiquidityDeposit(lyra, market, { - ...event, - cbTimestamp, + const liquidityDeposits = events.map( + events => + new LiquidityDeposit(lyra, { + market, + events, + circuitBreaker, marketLiquidity, }) - }) ) return liquidityDeposits } - // Initiate Deposit + // Transactions - static async deposit( - lyra: Lyra, - marketAddressOrName: string, - beneficiary: string, - amountQuote: BigNumber - ): Promise { - const market = await Market.get(lyra, marketAddressOrName) + static approve(market: Market, owner: string, amountQuote: BigNumber) { + const liquidityPoolContract = getLyraMarketContract( + market.lyra, + market.contractAddresses, + market.lyra.version, + LyraMarketContractId.LiquidityPool + ) + const erc20 = getERC20Contract(market.lyra.provider, market.quoteToken.address) + const data = erc20.interface.encodeFunctionData('approve', [liquidityPoolContract.address, amountQuote]) + return buildTx(market.lyra.provider, market.lyra.provider.network.chainId, erc20.address, owner, data) + } + + static initiateDeposit(market: Market, beneficiary: string, amountQuote: BigNumber): PopulatedTransaction { const liquidityPoolContract = getLyraMarketContract( - lyra, + market.lyra, market.contractAddresses, - lyra.version, + market.lyra.version, LyraMarketContractId.LiquidityPool ) const data = liquidityPoolContract.interface.encodeFunctionData('initiateDeposit', [beneficiary, amountQuote]) - const tx = await buildTxWithGasEstimate( - lyra.provider, - lyra.provider.network.chainId, + return buildTx( + market.lyra.provider, + market.lyra.provider.network.chainId, liquidityPoolContract.address, beneficiary, data ) - return tx } // Edges diff --git a/sdk/src/liquidity_withdrawal/index.ts b/sdk/src/liquidity_withdrawal/index.ts index a221514..5393c88 100644 --- a/sdk/src/liquidity_withdrawal/index.ts +++ b/sdk/src/liquidity_withdrawal/index.ts @@ -1,44 +1,52 @@ import { BigNumber } from '@ethersproject/bignumber' import { PopulatedTransaction } from '@ethersproject/contracts' -import { LiquidityDelayReason } from '..' +import { LiquidityCircuitBreaker, LiquidityDelayReason } from '..' import { ZERO_BN } from '../constants/bn' import { LyraMarketContractId } from '../constants/contracts' import Lyra from '../lyra' import { Market, MarketLiquiditySnapshot } from '../market' -import buildTxWithGasEstimate from '../utils/buildTxWithGasEstimate' +import buildTx from '../utils/buildTx' import fetchLiquidityWithdrawalEventDataByOwner from '../utils/fetchLiquidityWithdrawalEventDataByOwner' -import getLiquidityDelayReason from '../utils/getLiquidityDelayReason' import getLyraMarketContract from '../utils/getLyraMarketContract' -export type LiquidityWithdrawalFilter = { - user: string -} - -export type WithdrawalQueuedOrProcessedEvent = { - queued?: LiquidityWithdrawalQueuedEvent - processed?: LiquidityWithdrawalProcessedEvent -} +export type LiquidityWithdrawalEvents = + | { + isInstant: false + isProcessed: false + queued: LiquidityWithdrawalQueuedEvent + } + | { + isInstant: true + isProcessed: true + processed: LiquidityWithdrawalProcessedEvent + } + | { + isInstant: false + isProcessed: true + queued: LiquidityWithdrawalQueuedEvent + processed: LiquidityWithdrawalProcessedEvent + } export type LiquidityWithdrawalQueuedEvent = { withdrawer: string beneficiary: string - withdrawalQueueId: BigNumber + queueId: number amountWithdrawn: BigNumber totalQueuedWithdrawals: BigNumber - timestamp: BigNumber + timestamp: number transactionHash: string } export type LiquidityWithdrawalProcessedEvent = { caller: string beneficiary: string - withdrawalQueueId: BigNumber + queueId: number amountWithdrawn: BigNumber tokenPrice: BigNumber quoteReceived: BigNumber totalQueuedWithdrawals: BigNumber - timestamp: BigNumber + timestamp: number transactionHash: string } @@ -59,99 +67,86 @@ export class LiquidityWithdrawal { delayReason: LiquidityDelayReason | null constructor( lyra: Lyra, - market: Market, data: { - queued?: LiquidityWithdrawalQueuedEvent - processed?: LiquidityWithdrawalProcessedEvent - cbTimestamp: BigNumber + events: LiquidityWithdrawalEvents + market: Market + circuitBreaker: LiquidityCircuitBreaker | null marketLiquidity: MarketLiquiditySnapshot } ) { // Data this.lyra = lyra - this.__market = market - this.__queued = data.queued - this.__processed = data.processed + this.__market = data.market // Fields - const queued = data.queued - const processed = data.processed + const queued = !data.events.isInstant ? data.events.queued : null + const processed = data.events.isProcessed ? data.events.processed : null const queuedOrProcessed = queued ?? processed if (!queuedOrProcessed) { throw new Error('No queued or processed event for LiquidityWithdrawal') } - this.queueId = queuedOrProcessed.withdrawalQueueId.toNumber() + this.queueId = queuedOrProcessed.queueId this.beneficiary = queuedOrProcessed.beneficiary this.balance = queued?.amountWithdrawn ?? ZERO_BN this.tokenPriceAtWithdraw = processed?.tokenPrice this.value = processed?.amountWithdrawn this.isPending = !processed - this.withdrawalRequestedTimestamp = queuedOrProcessed.timestamp.toNumber() + this.withdrawalRequestedTimestamp = queuedOrProcessed.timestamp this.withdrawalTimestamp = processed - ? processed.timestamp.toNumber() + ? processed.timestamp : queued - ? queued.timestamp.add(market.params.withdrawalDelay).toNumber() + ? queued.timestamp + data.market.params.withdrawalDelay : // Should never happen 0 - this.timeToWithdrawal = Math.max(0, this.withdrawalTimestamp - market.block.timestamp) + this.timeToWithdrawal = Math.max(0, this.withdrawalTimestamp - data.market.block.timestamp) this.delayReason = - this.timeToWithdrawal === 0 && this.isPending - ? getLiquidityDelayReason(market, data.cbTimestamp, data.marketLiquidity) + this.timeToWithdrawal === 0 && + this.isPending && + data.circuitBreaker && + data.circuitBreaker.timestamp > data.market.block.timestamp + ? data.circuitBreaker.reason : null } // Getters - static async getByOwner(lyra: Lyra, marketAddress: string, owner: string): Promise { - const market = await Market.get(lyra, marketAddress) - const liquidityPoolContract = getLyraMarketContract( - lyra, - market.contractAddresses, - lyra.version, - LyraMarketContractId.LiquidityPool - ) - const [{ events }, cbTimestamp, marketLiquidity] = await Promise.all([ + static async getByOwner(lyra: Lyra, market: Market, owner: string): Promise { + const [{ events, circuitBreaker }, marketLiquidity] = await Promise.all([ fetchLiquidityWithdrawalEventDataByOwner(lyra, owner, market), - liquidityPoolContract.CBTimestamp(), market.liquidity(), ]) - return events.map( - event => - new LiquidityWithdrawal(lyra, market, { - ...event, - cbTimestamp, + const liquidityDeposits = events.map( + events => + new LiquidityWithdrawal(lyra, { + market, + events, + circuitBreaker, marketLiquidity, }) ) + return liquidityDeposits } - // Initiate Withdraw + // Transactions - static async withdraw( - lyra: Lyra, - marketAddressOrName: string, - beneficiary: string, - amountLiquidityTokens: BigNumber - ): Promise { - const market = await Market.get(lyra, marketAddressOrName) + static initiateWithdraw(market: Market, beneficiary: string, amountLiquidityTokens: BigNumber): PopulatedTransaction { const liquidityPoolContract = getLyraMarketContract( - lyra, + market.lyra, market.contractAddresses, - lyra.version, + market.lyra.version, LyraMarketContractId.LiquidityPool ) const data = liquidityPoolContract.interface.encodeFunctionData('initiateWithdraw', [ beneficiary, amountLiquidityTokens, ]) - const tx = await buildTxWithGasEstimate( - lyra.provider, - lyra.provider.network.chainId, + return buildTx( + market.lyra.provider, + market.lyra.provider.network.chainId, liquidityPoolContract.address, beneficiary, data ) - return tx } // Edges diff --git a/sdk/src/lyra.ts b/sdk/src/lyra.ts index 5b21c34..bd93906 100644 --- a/sdk/src/lyra.ts +++ b/sdk/src/lyra.ts @@ -11,39 +11,37 @@ import { Board, BoardQuotes } from './board' import { CollateralUpdateEvent } from './collateral_update_event' import { Chain } from './constants/chain' import { Deployment } from './constants/contracts' +import { LYRA_API_URL } from './constants/links' import { Network } from './constants/network' import { GlobalRewardEpoch } from './global_reward_epoch' import { LiquidityDeposit } from './liquidity_deposit' import { LiquidityWithdrawal } from './liquidity_withdrawal' -import { LyraStake } from './lyra_stake' -import { LyraStaking } from './lyra_staking' -import { LyraUnstake } from './lyra_unstake' import { Market, MarketContractAddresses, MarketQuotes, MarketTradeOptions } from './market' import { Option, OptionQuotes } from './option' -import { Position, PositionFilter, PositionLeaderboard, PositionLeaderboardFilter } from './position' +import { Position } from './position' import { Quote, QuoteOptions } from './quote' import { SettleEvent } from './settle_event' import { Strike, StrikeQuotes } from './strike' import { Trade } from './trade' import { TradeEvent, TradeEventListener, TradeEventListenerCallback, TradeEventListenerOptions } from './trade_event' import { TransferEvent } from './transfer_event' -import fetchLeaderboard from './utils/fetchLeaderboard' import fetchMarketAddresses from './utils/fetchMarketAddresses' import fetchPositionEventDataByHash from './utils/fetchPositionEventDataByHash' +import getDefaultVersionForChain from './utils/getDefaultVersionForChain' import getLyraChainForChainId from './utils/getLyraChainForChainId' import getLyraChainIdForChain from './utils/getLyraChainIdForChain' import getLyraDeploymentForChain from './utils/getLyraDeploymentForChain' import getLyraDeploymentProvider from './utils/getLyraDeploymentProvider' import getLyraDeploymentSubgraphURI from './utils/getLyraDeploymentSubgraphURI' +import getLyraGovernanceSubgraphURI from './utils/getLyraGovernanceSubgraphURI' import getNetworkForChain from './utils/getLyraNetworkForChain' -import getVersionForChain from './utils/getVersionForChain' -import { WethLyraStaking } from './weth_lyra_staking' export type LyraConfig = { provider: JsonRpcProvider - optimismProvider?: JsonRpcProvider - ethereumProvider?: JsonRpcProvider subgraphUri?: string + govSubgraphUri?: string + apiUri?: string + version?: Version } export enum Version { @@ -57,10 +55,11 @@ export default class Lyra { chain: Chain chainId: number provider: JsonRpcProvider - optimismProvider?: JsonRpcProvider - ethereumProvider?: JsonRpcProvider subgraphUri: string subgraphClient: ApolloClient + govSubgraphUri: string + govSubgraphClient: ApolloClient + apiUri: string deployment: Deployment network: Network version: Version @@ -69,30 +68,40 @@ export default class Lyra { // Config const configObj = config as LyraConfig this.provider = config.provider - this.optimismProvider = config.optimismProvider - this.ethereumProvider = config.ethereumProvider this.chain = getLyraChainForChainId(this.provider.network.chainId) - this.subgraphUri = configObj?.subgraphUri ?? getLyraDeploymentSubgraphURI(this.chain) + this.apiUri = configObj.apiUri ?? LYRA_API_URL + this.version = config.version ?? getDefaultVersionForChain(this.chain) + this.subgraphUri = configObj?.subgraphUri ?? getLyraDeploymentSubgraphURI(this.chain, this.version) + this.govSubgraphUri = configObj?.govSubgraphUri ?? getLyraGovernanceSubgraphURI(this.chain) } else if (typeof config === 'number') { // Chain ID this.chain = getLyraChainForChainId(config) this.provider = getLyraDeploymentProvider(this.chain) - this.subgraphUri = getLyraDeploymentSubgraphURI(this.chain) + this.version = getDefaultVersionForChain(this.chain) + this.subgraphUri = getLyraDeploymentSubgraphURI(this.chain, this.version) + this.govSubgraphUri = getLyraGovernanceSubgraphURI(this.chain) } else { // String this.chain = config this.provider = getLyraDeploymentProvider(this.chain) - this.subgraphUri = getLyraDeploymentSubgraphURI(this.chain) + this.version = getDefaultVersionForChain(this.chain) + this.subgraphUri = getLyraDeploymentSubgraphURI(this.chain, this.version) + this.govSubgraphUri = getLyraGovernanceSubgraphURI(this.chain) } - this.subgraphClient = new ApolloClient({ + connectToDevTools: true, link: new HttpLink({ uri: this.subgraphUri, fetch }), cache: new InMemoryCache(), }) + this.govSubgraphClient = new ApolloClient({ + connectToDevTools: true, + link: new HttpLink({ uri: this.govSubgraphUri, fetch }), + cache: new InMemoryCache(), + }) + this.network = getNetworkForChain(this.chain) + this.apiUri = LYRA_API_URL this.chainId = getLyraChainIdForChain(this.chain) this.deployment = getLyraDeploymentForChain(this.chain) - this.network = getNetworkForChain(this.chain) - this.version = getVersionForChain(this.network) } // Quote @@ -147,6 +156,24 @@ export default class Lyra { // Trade + async approveTradeQuote( + marketAddressOrName: string, + owner: string, + amountQuote: BigNumber + ): Promise { + const market = await this.market(marketAddressOrName) + return market.approveTradeQuote(owner, amountQuote) + } + + async approveTradeBase( + marketAddressOrName: string, + owner: string, + amountBase: BigNumber + ): Promise { + const market = await this.market(marketAddressOrName) + return market.approveTradeBase(owner, amountBase) + } + async trade( owner: string, marketAddressOrName: string, @@ -205,10 +232,6 @@ export default class Lyra { return await Position.getByOwner(this, owner) } - async allPositions(options?: PositionFilter): Promise { - return await Position.getAll(this, options) - } - async position(marketAddressOrName: string, positionId: number): Promise { return await Position.get(this, marketAddressOrName, positionId) } @@ -222,47 +245,56 @@ export default class Lyra { return await fetchPositionEventDataByHash(this, transactionHashOrReceipt) } - async leaderboard(options?: PositionLeaderboardFilter): Promise { - return await fetchLeaderboard(this, options) - } - // Account account(address: string): Account { return Account.get(this, address) } - async drip(owner: string): Promise { + drip(owner: string): PopulatedTransaction { const account = Account.get(this, owner) - return await account.drip() + return account.drip() } - // Liquidity Deposits + // Deposits - async liquidityDeposits(marketAddressOrName: string, owner: string): Promise { - return await LiquidityDeposit.getByOwner(this, marketAddressOrName, owner) + async deposits(marketAddressOrName: string, owner: string): Promise { + const market = await this.market(marketAddressOrName) + return await LiquidityDeposit.getByOwner(this, market, owner) } - async deposit( - beneficiary: string, + async approveDeposit( marketAddressOrName: string, + address: string, amountQuote: BigNumber ): Promise { - return await LiquidityDeposit.deposit(this, marketAddressOrName, beneficiary, amountQuote) + const market = await this.market(marketAddressOrName) + return market.approveDeposit(address, amountQuote) } - // Liquidity Withdrawals + async initiateDeposit( + marketAddressOrName: string, + beneficiary: string, + amountQuote: BigNumber + ): Promise { + const market = await this.market(marketAddressOrName) + return market.initiateDeposit(beneficiary, amountQuote) + } + + // Withdrawals - async liquidityWithdrawals(marketAddressOrName: string, owner: string): Promise { - return await LiquidityWithdrawal.getByOwner(this, marketAddressOrName, owner) + async withdrawals(marketAddressOrName: string, owner: string): Promise { + const market = await this.market(marketAddressOrName) + return await LiquidityWithdrawal.getByOwner(this, market, owner) } - async withdraw( - beneficiary: string, + async initiateWithdraw( marketAddressOrName: string, + beneficiary: string, amountLiquidityTokens: BigNumber ): Promise { - return await LiquidityWithdrawal.withdraw(this, marketAddressOrName, beneficiary, amountLiquidityTokens) + const market = await this.market(marketAddressOrName) + return market.initiateWithdraw(beneficiary, amountLiquidityTokens) } // Admin @@ -273,36 +305,15 @@ export default class Lyra { // Rewards - async lyraStaking(): Promise { - return await LyraStaking.get(this) - } - - async stake(address: string, amount: BigNumber): Promise { - return await LyraStake.get(this, address, amount) - } - - async requestUnstake(address: string): Promise { - const account = this.account(address) - return await account.requestUnstake() - } - - async unstake(address: string, amount: BigNumber): Promise { - return await LyraUnstake.get(this, address, amount) + async claimRewards(owner: string, tokenAddresses: string[]) { + return await AccountRewardEpoch.claim(this, owner, tokenAddresses) } async globalRewardEpochs(): Promise { return await GlobalRewardEpoch.getAll(this) } - async latestGlobalRewardEpoch(): Promise { - return await GlobalRewardEpoch.getLatest(this) - } - - async accountRewardEpochs(address: string): Promise { - return await AccountRewardEpoch.getByOwner(this, address) - } - - async wethLyraStaking(): Promise { - return await WethLyraStaking.get(this) + async accountRewardEpochs(owner: string): Promise { + return await AccountRewardEpoch.getByOwner(this, owner) } } diff --git a/sdk/src/lyra_stake/index.ts b/sdk/src/lyra_stake/index.ts deleted file mode 100644 index 9220695..0000000 --- a/sdk/src/lyra_stake/index.ts +++ /dev/null @@ -1,244 +0,0 @@ -import { BigNumber } from '@ethersproject/bignumber' -import { PopulatedTransaction } from '@ethersproject/contracts' - -import { Account, AccountBalances, AccountLiquidityTokenBalance, AccountLyraStaking } from '..' -import { MAX_BN, ZERO_BN } from '../constants/bn' -import { - LYRA_ETHEREUM_KOVAN_ADDRESS, - LYRA_ETHEREUM_MAINNET_ADDRESS, - LyraGlobalContractId, -} from '../constants/contracts' -import { SECONDS_IN_DAY } from '../constants/time' -import { GlobalRewardEpoch, RewardEpochTokenAmount } from '../global_reward_epoch' -import Lyra, { Deployment } from '../lyra' -import buildTx from '../utils/buildTx' -import buildTxWithGasEstimate from '../utils/buildTxWithGasEstimate' -import findMarketX from '../utils/findMarketX' -import fromBigNumber from '../utils/fromBigNumber' -import getERC20Contract from '../utils/getERC20Contract' -import getGlobalContract from '../utils/getGlobalContract' -import insertTxGasEstimate from '../utils/insertTxGasEstimate' - -type StakeData = { - account: Account - accountStaking: AccountLyraStaking - globalEpoch: GlobalRewardEpoch | null - accountBalances: AccountBalances[] - amount: BigNumber -} - -export enum StakeDisabledReason { - InsufficientBalance = 'InsufficientBalance', - InsufficientAllowance = 'InsufficientAllowance', - ZeroAmount = 'ZeroAmount', -} - -export class LyraStake { - lyra: Lyra - private vaultTokenBalances: Record - globalEpoch: GlobalRewardEpoch | null - accountStaking: AccountLyraStaking - account: Account - amount: BigNumber - lyraBalance: BigNumber - stakedLyraBalance: BigNumber - allowance: BigNumber - // Derived - newStakedLyraBalance: BigNumber - newStakingYieldPerDay: RewardEpochTokenAmount[] - stakingYieldPerDay: RewardEpochTokenAmount[] - tradingFeeRebate: number - newTradingFeeRebate: number - disabledReason: StakeDisabledReason | null - tx: PopulatedTransaction | null - - constructor(lyra: Lyra, data: StakeData) { - this.lyra = lyra - this.globalEpoch = data.globalEpoch - this.accountStaking = data.accountStaking - this.account = data.account - this.amount = data.amount - this.lyraBalance = data.accountStaking.lyraBalances.ethereumLyra - this.stakedLyraBalance = data.accountStaking.lyraBalances.ethereumStkLyra - this.newStakedLyraBalance = this.stakedLyraBalance.add(this.amount) - this.allowance = data.accountStaking.lyraAllowances.stakingAllowance - - this.vaultTokenBalances = data.accountBalances.reduce( - (lpTokenBalances, accountBalance) => ({ - ...lpTokenBalances, - [accountBalance.baseAsset.symbol]: accountBalance.liquidityToken, - }), - {} - ) - - const totalStakedLyraSupply = fromBigNumber(this.accountStaking.staking.totalSupply) - const stakedLyraPctShare = - totalStakedLyraSupply > 0 ? fromBigNumber(this.stakedLyraBalance) / totalStakedLyraSupply : 0 - const newStakedLyraPctShare = - totalStakedLyraSupply > 0 ? fromBigNumber(this.newStakedLyraBalance) / totalStakedLyraSupply : 0 - - this.stakingYieldPerDay = - this.globalEpoch?.totalStakingRewards.map(token => { - const totalTokensPerDay = - this.globalEpoch && this.globalEpoch.duration > 0 - ? (token.amount / this.globalEpoch.duration) * SECONDS_IN_DAY - : 0 - return { - ...token, - amount: totalTokensPerDay * stakedLyraPctShare, - } - }) ?? [] - - this.newStakingYieldPerDay = - this.globalEpoch?.totalStakingRewards.map(token => { - const totalTokensPerDay = - this.globalEpoch && this.globalEpoch.duration > 0 - ? (token.amount / this.globalEpoch.duration) * SECONDS_IN_DAY - : 0 - return { - ...token, - amount: totalTokensPerDay * newStakedLyraPctShare, - } - }) ?? [] - - this.tradingFeeRebate = this.globalEpoch?.tradingFeeRebate(fromBigNumber(this.stakedLyraBalance)) ?? 0 - this.newTradingFeeRebate = this.globalEpoch?.tradingFeeRebate(fromBigNumber(this.newStakedLyraBalance)) ?? 0 - - // Determine disabled reason - if (this.amount.gt(this.lyraBalance)) { - this.disabledReason = StakeDisabledReason.InsufficientBalance - } else if (this.amount.gt(this.allowance)) { - this.disabledReason = StakeDisabledReason.InsufficientAllowance - } else if (this.amount.eq(ZERO_BN)) { - this.disabledReason = StakeDisabledReason.ZeroAmount - } else { - this.disabledReason = null - } - - // Build transaction - if (!this.disabledReason) { - const lyraStakingModuleProxyContract = getGlobalContract( - lyra, - LyraGlobalContractId.LyraStakingModule, - lyra.ethereumProvider - ) - const txData = lyraStakingModuleProxyContract.interface.encodeFunctionData('stake', [ - this.account.address, - this.amount, - ]) - this.tx = buildTx( - lyra.ethereumProvider ?? lyra.provider, - 1, - lyraStakingModuleProxyContract.address, - this.account.address, - txData - ) - } else { - this.tx = null - } - } - - // Getters - - static async get(lyra: Lyra, address: string, amount: BigNumber): Promise { - const account = Account.get(lyra, address) - const [accountStaking, globalEpoch, balances] = await Promise.all([ - account.lyraStaking(), - lyra.latestGlobalRewardEpoch(), - lyra.account(address).balances(), - ]) - const stake = new LyraStake(lyra, { - account, - globalEpoch, - amount, - accountStaking, - accountBalances: balances, - }) - if (stake?.tx) { - stake.tx = await insertTxGasEstimate(lyra.ethereumProvider ?? lyra.provider, stake.tx) - } - return stake - } - - // Transactions - - static async approve(lyra: Lyra, account: string): Promise { - const proxyContract = getGlobalContract(lyra, LyraGlobalContractId.LyraStakingModule, lyra.ethereumProvider) - - const lyraContract = getERC20Contract( - lyra.ethereumProvider ?? lyra.provider, - lyra.deployment === Deployment.Mainnet ? LYRA_ETHEREUM_MAINNET_ADDRESS : LYRA_ETHEREUM_KOVAN_ADDRESS - ) - const data = lyraContract.interface.encodeFunctionData('approve', [proxyContract.address, MAX_BN]) - const tx = await buildTxWithGasEstimate( - lyra.ethereumProvider ?? lyra.provider, - 1, - lyraContract.address, - account, - data - ) - return tx - } - - // Dynamic Fields - - vaultApy(marketAddressOrName: string): RewardEpochTokenAmount[] { - if (!this.globalEpoch) { - return [] - } - const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) - const marketKey = market.baseToken.symbol - const currStakedLyraBalance = fromBigNumber(this.stakedLyraBalance) - const currVaultTokenBalance = fromBigNumber(this.vaultTokenBalances[marketKey].balance) - if (currVaultTokenBalance === 0) { - return this.globalEpoch.minVaultApy(marketAddressOrName) - } else { - return this.globalEpoch.vaultApy(marketAddressOrName, currStakedLyraBalance, currVaultTokenBalance) - } - } - - vaultApyMultiplier(marketAddressOrName: string): number { - if (!this.globalEpoch) { - return 1 - } - const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) - const marketKey = market.baseToken.symbol - const currStakedLyraBalance = fromBigNumber(this.stakedLyraBalance) - const currVaultTokenBalance = fromBigNumber(this.vaultTokenBalances[marketKey].balance) - if (currVaultTokenBalance === 0) { - return 1 - } else { - return this.globalEpoch.vaultApyMultiplier(marketAddressOrName, currStakedLyraBalance, currVaultTokenBalance) - } - } - - newVaultApy(marketAddressOrName: string): RewardEpochTokenAmount[] { - if (!this.globalEpoch) { - return [] - } - const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) - const marketKey = market.baseToken.symbol - const newStakedLyraBalance = fromBigNumber(this.newStakedLyraBalance) - const currVaultTokenBalance = fromBigNumber(this.vaultTokenBalances[marketKey].balance) - if (currVaultTokenBalance === 0) { - return this.globalEpoch.minVaultApy(marketAddressOrName) - } else { - return this.globalEpoch.vaultApy(marketAddressOrName, newStakedLyraBalance, currVaultTokenBalance) - } - } - - newVaultApyMultiplier(marketAddressOrName: string): number { - if (!this.globalEpoch) { - return 1 - } - const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) - const marketKey = market.baseToken.symbol - const newStakedLyraBalance = fromBigNumber(this.newStakedLyraBalance) - const currVaultTokenBalance = fromBigNumber(this.vaultTokenBalances[marketKey].balance) - if (currVaultTokenBalance === 0) { - return 1 - } else { - return this.globalEpoch.vaultApyMultiplier(marketAddressOrName, newStakedLyraBalance, currVaultTokenBalance) - } - } -} diff --git a/sdk/src/lyra_staking/index.ts b/sdk/src/lyra_staking/index.ts deleted file mode 100644 index 2845608..0000000 --- a/sdk/src/lyra_staking/index.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { BigNumber } from '@ethersproject/bignumber' -import { PopulatedTransaction } from '@ethersproject/contracts' - -import { ZERO_BN } from '../constants/bn' -import { LyraGlobalContractId } from '../constants/contracts' -import { SECONDS_IN_YEAR } from '../constants/time' -import Lyra from '../lyra' -import buildTxWithGasEstimate from '../utils/buildTxWithGasEstimate' -import callContractWithMulticall from '../utils/callContractWithMulticall' -import fetchLyraTokenSpotPrice from '../utils/fetchLyraTokenSpotPrice' -import fromBigNumber from '../utils/fromBigNumber' -import getGlobalContract from '../utils/getGlobalContract' -import toBigNumber from '../utils/toBigNumber' - -type StakingData = { - cooldownPeriod: number - unstakeWindow: number - lyraPrice: number - totalSupply: BigNumber -} - -export class LyraStaking { - lyra: Lyra - cooldownPeriod: number - unstakeWindow: number - lyraPrice: number - totalSupply: BigNumber - constructor(lyra: Lyra, data: StakingData) { - // if ([Network.Arbitrum, Network.Optimism].includes(lyra.network)) { - // throw new Error(`Staking is not supported on ${lyra.network}`) - // } - // Data - this.lyra = lyra - this.cooldownPeriod = data.cooldownPeriod - this.unstakeWindow = data.unstakeWindow - this.totalSupply = data.totalSupply - this.lyraPrice = data.lyraPrice - } - - // Getters - - static async get(lyra: Lyra): Promise { - const lyraStakingModuleContract = getGlobalContract( - lyra, - LyraGlobalContractId.LyraStakingModule, - lyra.ethereumProvider - ) - const cooldownPeriodCallData = lyraStakingModuleContract.interface.encodeFunctionData('COOLDOWN_SECONDS') - const unstakeWindowCallData = lyraStakingModuleContract.interface.encodeFunctionData('UNSTAKE_WINDOW') - const totalSupplyCallData = lyraStakingModuleContract.interface.encodeFunctionData('totalSupply') - const [[cooldownPeriod], [unstakeWindow], [totalSupply]] = await callContractWithMulticall< - [[BigNumber], [BigNumber], [BigNumber]] - >( - lyra, - [ - { - callData: cooldownPeriodCallData, - contract: lyraStakingModuleContract, - functionFragment: 'COOLDOWN_SECONDS', - }, - { - callData: unstakeWindowCallData, - contract: lyraStakingModuleContract, - functionFragment: 'UNSTAKE_WINDOW', - }, - { - callData: totalSupplyCallData, - contract: lyraStakingModuleContract, - functionFragment: 'totalSupply', - }, - ], - lyra.ethereumProvider - ) - - const lyraPrice = await fetchLyraTokenSpotPrice(lyra) - return new LyraStaking(lyra, { - cooldownPeriod: cooldownPeriod.toNumber(), - unstakeWindow: unstakeWindow.toNumber(), - totalSupply, - lyraPrice, - }) - } - - static async getStakingRewardsBalance(lyra: Lyra, owner: string): Promise { - const lyraStakingModuleContract = getGlobalContract( - lyra, - LyraGlobalContractId.LyraStakingModule, - lyra.ethereumProvider - ) - return await lyraStakingModuleContract.getTotalRewardsBalance(owner) - } - - static async getStakingRewardsApy(lyra: Lyra): Promise { - const lyraStakingModuleContract = getGlobalContract( - lyra, - LyraGlobalContractId.LyraStakingModule, - lyra.ethereumProvider - ) - const [assets, totalSupply, lyraTokenSpotPrice] = await Promise.all([ - lyraStakingModuleContract.assets('0xCb9f85730f57732fc899fb158164b9Ed60c77D49'), - lyraStakingModuleContract.totalSupply(), - fetchLyraTokenSpotPrice(lyra), - ]) - const emissionPerSecond = assets.emissionPerSecond - - const apy = totalSupply.gt(ZERO_BN) - ? (fromBigNumber(emissionPerSecond) * SECONDS_IN_YEAR * (lyraTokenSpotPrice ?? 0)) / fromBigNumber(totalSupply) - : 0 - return toBigNumber(apy) - } - - static async claimRewards(lyra: Lyra, owner: string): Promise { - const lyraStakingModuleProxyContract = getGlobalContract( - lyra, - LyraGlobalContractId.LyraStakingModule, - lyra.ethereumProvider - ) - const totalRewardsBalance = await this.getStakingRewardsBalance(lyra, owner) - const data = lyraStakingModuleProxyContract.interface.encodeFunctionData('claimRewards', [ - owner, - totalRewardsBalance, - ]) - const tx = await buildTxWithGasEstimate( - lyra.ethereumProvider ?? lyra.provider, - 1, - lyraStakingModuleProxyContract.address, - owner, - data - ) - return tx - } -} diff --git a/sdk/src/lyra_unstake/index.ts b/sdk/src/lyra_unstake/index.ts deleted file mode 100644 index dd5db08..0000000 --- a/sdk/src/lyra_unstake/index.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { BigNumber } from '@ethersproject/bignumber' -import { PopulatedTransaction } from '@ethersproject/contracts' - -import { Account, AccountBalances, AccountLiquidityTokenBalance, AccountLyraStaking } from '..' -import { ZERO_BN } from '../constants/bn' -import { LyraGlobalContractId } from '../constants/contracts' -import { SECONDS_IN_DAY } from '../constants/time' -import { GlobalRewardEpoch, RewardEpochTokenAmount } from '../global_reward_epoch' -import Lyra from '../lyra' -import buildTx from '../utils/buildTx' -import buildTxWithGasEstimate from '../utils/buildTxWithGasEstimate' -import findMarketX from '../utils/findMarketX' -import fromBigNumber from '../utils/fromBigNumber' -import getGlobalContract from '../utils/getGlobalContract' -import insertTxGasEstimate from '../utils/insertTxGasEstimate' - -export enum UnstakeDisabledReason { - NotInUnstakeWindow = 'NotInUnstakeWindow', - InsufficientBalance = 'InsufficientBalance', - ZeroAmount = 'ZeroAmount', -} - -type UnstakeData = { - globalEpoch: GlobalRewardEpoch | null - account: Account - accountStaking: AccountLyraStaking - accountBalances: AccountBalances[] - amount: BigNumber -} - -export class LyraUnstake { - lyra: Lyra - private vaultTokenBalances: Record - globalEpoch: GlobalRewardEpoch | null - accountStaking: AccountLyraStaking - account: Account - amount: BigNumber - stakedLyraBalance: BigNumber - // Derived - newStakedLyraBalance: BigNumber - newStakingYieldPerDay: RewardEpochTokenAmount[] - stakingYieldPerDay: RewardEpochTokenAmount[] - tradingFeeRebate: number - newTradingFeeRebate: number - disabledReason: UnstakeDisabledReason | null - tx: PopulatedTransaction | null - - constructor(lyra: Lyra, data: UnstakeData) { - this.lyra = lyra - this.globalEpoch = data.globalEpoch - this.accountStaking = data.accountStaking - this.account = data.account - this.amount = data.amount - this.stakedLyraBalance = data.accountStaking.lyraBalances.ethereumStkLyra - this.newStakedLyraBalance = this.stakedLyraBalance.sub(this.amount) - if (this.newStakedLyraBalance.lt(0)) { - this.newStakedLyraBalance = ZERO_BN - } - - this.vaultTokenBalances = data.accountBalances.reduce( - (lpTokenBalances, accountBalance) => ({ - ...lpTokenBalances, - [accountBalance.baseAsset.symbol]: accountBalance.liquidityToken, - }), - {} - ) - - const totalStakedLyraSupply = fromBigNumber(this.accountStaking.staking.totalSupply) - const stakedLyraPctShare = - totalStakedLyraSupply > 0 ? fromBigNumber(this.stakedLyraBalance) / totalStakedLyraSupply : 0 - const newStakedLyraPctShare = - totalStakedLyraSupply > 0 ? fromBigNumber(this.newStakedLyraBalance) / totalStakedLyraSupply : 0 - - this.stakingYieldPerDay = - this.globalEpoch?.totalStakingRewards.map(token => { - const totalTokensPerDay = - this.globalEpoch && this.globalEpoch.duration > 0 - ? (token.amount / this.globalEpoch.duration) * SECONDS_IN_DAY - : 0 - return { - ...token, - amount: totalTokensPerDay * stakedLyraPctShare, - } - }) ?? [] - - this.newStakingYieldPerDay = - this.globalEpoch?.totalStakingRewards.map(token => { - const totalTokensPerDay = - this.globalEpoch && this.globalEpoch.duration > 0 - ? (token.amount / this.globalEpoch.duration) * SECONDS_IN_DAY - : 0 - return { - ...token, - amount: totalTokensPerDay * newStakedLyraPctShare, - } - }) ?? [] - - this.tradingFeeRebate = this.globalEpoch?.tradingFeeRebate(fromBigNumber(this.stakedLyraBalance)) ?? 0 - this.newTradingFeeRebate = this.globalEpoch?.tradingFeeRebate(fromBigNumber(this.newStakedLyraBalance)) ?? 0 - - // Determine disabled reason - if (!data.accountStaking.isInUnstakeWindow) { - this.disabledReason = UnstakeDisabledReason.NotInUnstakeWindow - } else if (this.amount.gt(this.stakedLyraBalance)) { - this.disabledReason = UnstakeDisabledReason.InsufficientBalance - } else if (this.amount.eq(ZERO_BN)) { - this.disabledReason = UnstakeDisabledReason.ZeroAmount - } else { - this.disabledReason = null - } - - // Build transaction - if (!this.disabledReason) { - const lyraStakingModuleProxyContract = getGlobalContract( - lyra, - LyraGlobalContractId.LyraStakingModule, - lyra.ethereumProvider - ) - const txData = lyraStakingModuleProxyContract.interface.encodeFunctionData('redeem', [ - this.account.address, - this.amount, - ]) - this.tx = buildTx( - lyra.ethereumProvider ?? lyra.provider, - 1, - lyraStakingModuleProxyContract.address, - this.account.address, - txData - ) - } else { - this.tx = null - } - } - - // Getters - - static async get(lyra: Lyra, address: string, amount: BigNumber): Promise { - const account = Account.get(lyra, address) - const [accountStaking, globalEpoch, accountBalances] = await Promise.all([ - account.lyraStaking(), - lyra.latestGlobalRewardEpoch(), - lyra.account(address).balances(), - ]) - const unstake = new LyraUnstake(lyra, { - globalEpoch, - account, - amount, - accountStaking, - accountBalances, - }) - if (unstake?.tx) { - unstake.tx = await insertTxGasEstimate(lyra.ethereumProvider ?? lyra.provider, unstake.tx) - } - return unstake - } - - // Transactions - - static async requestUnstake(lyra: Lyra, address: string): Promise { - const lyraStakingModuleProxyContract = getGlobalContract( - lyra, - LyraGlobalContractId.LyraStakingModule, - lyra.ethereumProvider - ) - const data = lyraStakingModuleProxyContract.interface.encodeFunctionData('cooldown') - const tx = await buildTxWithGasEstimate( - lyra.ethereumProvider ?? lyra.provider, - 1, - lyraStakingModuleProxyContract.address, - address, - data - ) - return tx - } - - // Dynamic Fields - - vaultApy(marketAddressOrName: string): RewardEpochTokenAmount[] { - if (!this.globalEpoch) { - return [] - } - const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) - const marketKey = market.baseToken.symbol - const currStakedLyraBalance = fromBigNumber(this.stakedLyraBalance) - const currVaultTokenBalance = fromBigNumber(this.vaultTokenBalances[marketKey].balance) - return this.globalEpoch.vaultApy(marketAddressOrName, currStakedLyraBalance, currVaultTokenBalance) - } - - newVaultApy(marketAddressOrName: string): RewardEpochTokenAmount[] { - if (!this.globalEpoch) { - return [] - } - const market = findMarketX(this.globalEpoch.markets, marketAddressOrName) - const marketKey = market.baseToken.symbol - const newStakedLyraBalance = fromBigNumber(this.newStakedLyraBalance) - const currVaultTokenBalance = fromBigNumber(this.vaultTokenBalances[marketKey].balance) - return this.globalEpoch.vaultApy(marketAddressOrName, newStakedLyraBalance, currVaultTokenBalance) - } -} diff --git a/sdk/src/market/index.ts b/sdk/src/market/index.ts index 036a14c..9fa26c0 100644 --- a/sdk/src/market/index.ts +++ b/sdk/src/market/index.ts @@ -6,13 +6,17 @@ import { parseBytes32String } from '@ethersproject/strings' import { PoolHedgerParams } from '../admin' import { Board, BoardQuotes } from '../board' import { ZERO_BN } from '../constants/bn' -import { DataSource } from '../constants/contracts' +import { DataSource, LyraMarketContractId } from '../constants/contracts' +import { LyraMarketContractMap } from '../constants/mappings' +import { Network } from '../constants/network' import { SnapshotOptions } from '../constants/snapshots' import { BoardViewStructOutput, MarketViewWithBoardsStructOutput } from '../constants/views' import { OptionMarketViewer as AvalonOptionMarketViewer } from '../contracts/avalon/typechain/AvalonOptionMarketViewer' import { GMXAdapter } from '../contracts/newport/typechain/NewportGMXAdapter' import { GMXFuturesPoolHedger } from '../contracts/newport/typechain/NewportGMXFuturesPoolHedger' import { OptionMarketViewer as NewportOptionMarketViewer } from '../contracts/newport/typechain/NewportOptionMarketViewer' +import { SNXPerpsV2PoolHedger } from '../contracts/newport/typechain/NewportSNXPerpsV2PoolHedger' +import { SNXPerpV2Adapter } from '../contracts/newport/typechain/NewportSNXPerpV2Adapter' import { LiquidityDeposit } from '../liquidity_deposit' import { LiquidityWithdrawal } from '../liquidity_withdrawal' import Lyra, { Version } from '../lyra' @@ -28,11 +32,13 @@ import fetchMarketAddresses from '../utils/fetchMarketAddresses' import fetchMarketOwner from '../utils/fetchMarketOwner' import fetchNetGreeksHistory from '../utils/fetchNetGreeksHistory' import fetchNewportMarketViews from '../utils/fetchNewportMarketViews' +import fetchNewportOptimismMarketViews from '../utils/fetchNewportOptimismMarketViews' import fetchSpotPriceHistory from '../utils/fetchSpotPriceHistory' import fetchTradingVolumeHistory from '../utils/fetchTradingVolumeHistory' import findMarket from '../utils/findMarket' import getBoardView from '../utils/getBoardView' import getBoardViewForStrikeId from '../utils/getBoardViewForStrikeId' +import getLyraMarketContract from '../utils/getLyraMarketContract' import getMarketName from '../utils/getMarketName' import isMarketEqual from '../utils/isMarketEqual' @@ -80,6 +86,7 @@ export type MarketNetGreeksSnapshot = { export type MarketTradingVolumeSnapshot = { premiumVolume: BigNumber notionalVolume: BigNumber + totalShortOpenInterestUSD: BigNumber vaultFees: BigNumber vaultFeeComponents: { spotPriceFees: BigNumber @@ -108,8 +115,12 @@ export type MarketSpotCandle = { endTimestamp: number } -export type PoolHedgerView = GMXFuturesPoolHedger.GMXFuturesPoolHedgerViewStructOutput -export type ExchangeAdapterView = GMXAdapter.GMXAdapterStateStructOutput +export type PoolHedgerView = + | GMXFuturesPoolHedger.GMXFuturesPoolHedgerViewStructOutput + | SNXPerpsV2PoolHedger.HedgerStateStructOutput +export type ExchangeAdapterView = + | GMXAdapter.GMXAdapterStateStructOutput + | SNXPerpV2Adapter.MarketAdapterStateStructOutput export type MarketQuotes = { boards: BoardQuotes[] @@ -169,6 +180,7 @@ export type MarketParameters = { NAV: BigNumber tokenPrice: BigNumber netStdVega: BigNumber + netDelta: BigNumber hedgerView: PoolHedgerView | null adapterView: ExchangeAdapterView | null isMarketPaused: boolean @@ -194,6 +206,7 @@ export class Market { spotPrice: BigNumber contractAddresses: MarketContractAddresses params: MarketParameters + isBaseCollateralEnabled: boolean constructor( lyra: Lyra, @@ -202,16 +215,17 @@ export class Market { owner: string, tokenPrice: BigNumber, block: Block, - // TODO @michaelxuwu remove this when parmas added to viewer hedgerView?: PoolHedgerView, adapterView?: ExchangeAdapterView, - poolHedgerParams?: PoolHedgerParams + poolHedgerParams?: PoolHedgerParams, + baseLimit?: BigNumber | null ) { this.lyra = lyra this.block = block this.__data = marketView const fields = Market.getFields( lyra.version, + lyra.network, marketView, isGlobalPaused, owner, @@ -221,7 +235,7 @@ export class Market { poolHedgerParams ) this.address = fields.address - + this.isBaseCollateralEnabled = !baseLimit || baseLimit.gt(0) this.isPaused = fields.isPaused this.spotPrice = fields.spotPrice this.quoteToken = fields.quoteToken @@ -257,13 +271,15 @@ export class Market { // TODO: @dappbeast Remove getFields private static getFields( version: Version, + network: Network, marketView: MarketViewWithBoardsStructOutput, isGlobalPaused: boolean, owner: string, tokenPrice: BigNumber, hedgerView?: PoolHedgerView, adapterView?: ExchangeAdapterView, - poolHedgerParams?: PoolHedgerParams + poolHedgerParams?: PoolHedgerParams, + baseLimit?: BigNumber | null ) { const address = marketView.marketAddresses.optionMarket const isPaused = marketView.isPaused ?? isGlobalPaused @@ -276,6 +292,7 @@ export class Market { const forceCloseParams = marketView.marketParameters.forceCloseParams const varianceFeeParams = marketView.marketParameters.varianceFeeParams const lpParams = marketView.marketParameters.lpParams + const sharedParams = { optionPriceFee1xPoint: pricingParams.optionPriceFee1xPoint.toNumber(), optionPriceFee2xPoint: pricingParams.optionPriceFee2xPoint.toNumber(), @@ -326,6 +343,7 @@ export class Market { freeLiquidity: marketView.liquidity.freeLiquidity, tokenPrice, netStdVega: marketView.globalNetGreeks.netStdVega, + netDelta: marketView.globalNetGreeks.netDelta, isGlobalPaused, isMarketPaused: marketView.isPaused, owner, @@ -334,6 +352,7 @@ export class Market { (marketView as AvalonOptionMarketViewer.MarketViewWithBoardsStructOutput).marketParameters.poolHedgerParams, hedgerView: hedgerView ?? null, adapterView: adapterView ?? null, + baseLimit, } if (version === Version.Avalon) { @@ -349,19 +368,39 @@ export class Market { ...sharedParams, } } else { - if (!adapterView || !hedgerView) { - throw new Error('Adapter or hedger view does not exist') - } - const newportMarketView = marketView as NewportOptionMarketViewer.MarketViewStructOutput - spotPrice = adapterView.gmxMaxPrice - quoteSymbol = newportMarketView.quoteSymbol - quoteDecimals = newportMarketView.quoteDecimals.toNumber() - baseSymbol = newportMarketView.baseSymbol - baseDecimals = newportMarketView.baseDecimals.toNumber() - params = { - rateAndCarry: adapterView.rateAndCarry, - referenceSpotPrice: newportMarketView.spotPrice, - ...sharedParams, + let newportMarketView: NewportOptionMarketViewer.MarketViewStructOutput + switch (network) { + case Network.Arbitrum: + if (!adapterView || !hedgerView) { + throw new Error('Adapter or hedger view does not exist') + } + newportMarketView = marketView as NewportOptionMarketViewer.MarketViewStructOutput + spotPrice = (adapterView as GMXAdapter.GMXAdapterStateStructOutput).gmxMaxPrice + quoteSymbol = newportMarketView.quoteSymbol + quoteDecimals = newportMarketView.quoteDecimals.toNumber() + baseSymbol = newportMarketView.baseSymbol + baseDecimals = newportMarketView.baseDecimals.toNumber() + params = { + rateAndCarry: (adapterView as GMXAdapter.GMXAdapterStateStructOutput).rateAndCarry, + referenceSpotPrice: newportMarketView.spotPrice, + ...sharedParams, + } + break + case Network.Optimism: + if (!adapterView) { + throw new Error('Adapter or hedger view does not exist') + } + newportMarketView = marketView as NewportOptionMarketViewer.MarketViewStructOutput + spotPrice = newportMarketView.spotPrice + quoteSymbol = newportMarketView.quoteSymbol + quoteDecimals = newportMarketView.quoteDecimals.toNumber() + baseSymbol = newportMarketView.baseSymbol + baseDecimals = newportMarketView.baseDecimals.toNumber() + params = { + rateAndCarry: (adapterView as SNXPerpV2Adapter.MarketAdapterStateStructOutput).riskFreeRate, + referenceSpotPrice: spotPrice, + ...sharedParams, + } } } const quoteAddress = marketView.marketAddresses.quoteAsset @@ -439,11 +478,11 @@ export class Market { ) } else { const [{ marketViews, isGlobalPaused, owner }, block] = await Promise.all([ - fetchNewportMarketViews(lyra), + lyra.network === Network.Arbitrum ? fetchNewportMarketViews(lyra) : fetchNewportOptimismMarketViews(lyra), lyra.provider.getBlock('latest'), ]) const markets = marketViews.map( - ({ marketView, hedgerView, adapterView, poolHedgerParams, tokenPrice }) => + ({ marketView, hedgerView, adapterView, poolHedgerParams, tokenPrice, baseLimit }) => new Market( lyra, marketView, @@ -453,7 +492,8 @@ export class Market { block, hedgerView, adapterView, - poolHedgerParams + poolHedgerParams, + baseLimit ) ) return markets @@ -563,6 +603,17 @@ export class Market { } } + contract(contractId: C): LyraMarketContractMap { + return getLyraMarketContract( + this.lyra, + this.contractAddresses, + this.lyra.version, + contractId + ) as LyraMarketContractMap + } + + // Transactions + async trade( owner: string, strikeId: number, @@ -572,12 +623,31 @@ export class Market { slippage: number, options?: MarketTradeOptions ): Promise { - return await Trade.get(this.lyra, owner, this.address, strikeId, isCall, isBuy, size, { - slippage, + return await Trade.get(this.lyra, owner, this.address, strikeId, isCall, isBuy, size, slippage, { ...options, }) } + approveDeposit(owner: string, amountQuote: BigNumber): PopulatedTransaction { + return LiquidityDeposit.approve(this, owner, amountQuote) + } + + initiateDeposit(beneficiary: string, amountQuote: BigNumber): PopulatedTransaction { + return LiquidityDeposit.initiateDeposit(this, beneficiary, amountQuote) + } + + initiateWithdraw(beneficiary: string, amountLiquidityTokens: BigNumber): PopulatedTransaction { + return LiquidityWithdrawal.initiateWithdraw(this, beneficiary, amountLiquidityTokens) + } + + approveTradeQuote(owner: string, amountQuote: BigNumber): PopulatedTransaction { + return Trade.approveQuote(this, owner, amountQuote) + } + + approveTradeBase(owner: string, amountBase: BigNumber): PopulatedTransaction { + return Trade.approveBase(this, owner, amountBase) + } + // Dynamic fields async liquidity(): Promise { @@ -608,13 +678,11 @@ export class Market { return await fetchMarketOwner(this.lyra, this.contractAddresses) } - // Transactions - - async deposit(beneficiary: string, amount: BigNumber): Promise { - return await LiquidityDeposit.deposit(this.lyra, this.address, beneficiary, amount) + async deposits(owner: string): Promise { + return await LiquidityDeposit.getByOwner(this.lyra, this, owner) } - async withdraw(beneficiary: string, amount: BigNumber): Promise { - return await LiquidityWithdrawal.withdraw(this.lyra, this.address, beneficiary, amount) + async withdrawals(owner: string): Promise { + return await LiquidityWithdrawal.getByOwner(this.lyra, this, owner) } } diff --git a/sdk/src/position/getPositionPnl.ts b/sdk/src/position/getPositionPnl.ts index 862b90a..8117bd2 100644 --- a/sdk/src/position/getPositionPnl.ts +++ b/sdk/src/position/getPositionPnl.ts @@ -3,6 +3,20 @@ import { Position, PositionPnl } from '.' export default function getPositionPnl(position: Position): PositionPnl { const trades = position.trades() + + if (!trades.length) { + return { + totalAverageOpenCost: ZERO_BN, + totalAverageCloseCost: ZERO_BN, + unrealizedPnl: ZERO_BN, + unrealizedPnlPercentage: ZERO_BN, + realizedPnl: ZERO_BN, + realizedPnlPercentage: ZERO_BN, + settlementPnl: ZERO_BN, + settlementPnlPercentage: ZERO_BN, + } + } + const closingTrades = trades.filter(trade => !trade.isOpen) const settle = position.settle() diff --git a/sdk/src/position/index.ts b/sdk/src/position/index.ts index 4df4d61..fd2146e 100644 --- a/sdk/src/position/index.ts +++ b/sdk/src/position/index.ts @@ -12,7 +12,6 @@ import { Strike } from '../strike' import { Trade, TradeOptions } from '../trade' import { TradeEvent, TradeEventData } from '../trade_event' import { TransferEvent, TransferEventData } from '../transfer_event' -import fetchAllPositionData from '../utils/fetchAllPositionData' import fetchOpenPositionDataByOwner from '../utils/fetchOpenPositionDataByOwner' import fetchPositionDataByID from '../utils/fetchPositionDataByID' import fetchPositionDataByOwner from '../utils/fetchPositionDataByOwner' @@ -70,43 +69,6 @@ export type PositionPnl = { settlementPnlPercentage: BigNumber } -export type PositionFilter = { - markets?: string[] - minOpenTimestamp?: number - maxCloseTimestamp?: number - minPositionIds?: Record -} - -export enum PositionLeaderboardSortBy { - RealizedPnl = 'RealizedPnl', - RealizedLongPnl = 'RealizedLongPnl', - RealizedLongPnlPercentage = 'RealizedLongPnlPercentage', - UnrealizedPnl = 'UnrealizedPnl', - UnrealizedLongPnl = 'UnrealizedLongPnl', - UnrealizedLongPnlPercentage = 'UnrealizedLongPnlPercentage', -} - -export type PositionLeaderboardFilter = { - minTotalPremiums?: BigNumber - minTotalLongPremiums?: BigNumber - sortBy?: PositionLeaderboardSortBy - secondarySortBy?: PositionLeaderboardSortBy -} & PositionFilter - -export type PositionLeaderboard = { - account: string - realizedPnl: BigNumber - unrealizedPnl: BigNumber - realizedLongPnl: BigNumber - realizedLongPnlPercentage: BigNumber - unrealizedLongPnl: BigNumber - unrealizedLongPnlPercentage: BigNumber - totalPremiums: BigNumber - totalLongPremiums: BigNumber - totalNotionalVolume: BigNumber - positions: Position[] -} - export type PositionTradeOptions = Omit export class Position { @@ -170,14 +132,8 @@ export class Position { return new Position(lyra, position) } - static async getAll(lyra: Lyra, filter?: PositionFilter): Promise { - const positions = await fetchAllPositionData(lyra, filter) - return positions.map(position => new Position(lyra, position)) - } - static async getOpenByOwner(lyra: Lyra, owner: string): Promise { - const markets = await lyra.markets() - const positions = await fetchOpenPositionDataByOwner(lyra, owner, markets) + const positions = await fetchOpenPositionDataByOwner(lyra, owner) return positions.map(position => new Position(lyra, position)) } @@ -189,10 +145,9 @@ export class Position { // Dynamic Fields sizeBeforeClose(): BigNumber { - if (!this.isOpen && this.size.isZero()) { + const lastTrade = this.lastTrade() + if (!this.isOpen && this.size.isZero() && lastTrade) { // Position manually closed, use size before last trade - const trades = this.trades() - const lastTrade = trades[trades.length - 1] return lastTrade.prevSize(this) } else { // Position may be settled or still open @@ -258,12 +213,13 @@ export class Position { } firstTrade(): TradeEvent | null { - return this.trades()[0] ?? null + const trades = this.trades() + return trades.length > 0 ? trades[0] : null } lastTrade(): TradeEvent | null { const trades = this.trades() - return trades[trades.length - 1] ?? null + return trades.length > 0 ? trades[trades.length - 1] : null } collateralUpdates(): CollateralUpdateEvent[] { @@ -299,18 +255,35 @@ export class Position { return this.market().strike(this.strikeId) } + liveStrike(): Strike { + return this.market().liveStrike(this.strikeId) + } + async option(): Promise