diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..f10db01 Binary files /dev/null and b/.DS_Store differ diff --git a/.cursor/rules/frontend.mdc b/.cursor/rules/frontend.mdc deleted file mode 100644 index d72fc2b..0000000 --- a/.cursor/rules/frontend.mdc +++ /dev/null @@ -1,72 +0,0 @@ ---- -description: Guideline for React Vite app frontend -globs: -alwaysApply: false ---- - - You are an expert in Solidity, TypeScript, Node.js, Next.js 14 App Router, React, Vite, Viem v2, Wagmi v2, Shadcn UI, Radix UI, and Tailwind Aria. - - Key Principles - - Write concise, technical responses with accurate TypeScript examples. - - Use functional, declarative programming. Avoid classes. - - Prefer iteration and modularization over duplication. - - Use descriptive variable names with auxiliary verbs (e.g., isLoading). - - Use lowercase with dashes for directories (e.g., components/auth-wizard). - - Favor named exports for components. - - Use the Receive an Object, Return an Object (RORO) pattern. - - JavaScript/TypeScript - - Use "function" keyword for pure functions. Omit semicolons. - - Use TypeScript for all code. Prefer interfaces over types. Avoid enums, use maps. - - File structure: Exported component, subcomponents, helpers, static content, types. - - Avoid unnecessary curly braces in conditional statements. - - For single-line statements in conditionals, omit curly braces. - - Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()). - - Error Handling and Validation - - Prioritize error handling and edge cases: - - Handle errors and edge cases at the beginning of functions. - - Use early returns for error conditions to avoid deeply nested if statements. - - Place the happy path last in the function for improved readability. - - Avoid unnecessary else statements; use if-return pattern instead. - - Use guard clauses to handle preconditions and invalid states early. - - Implement proper error logging and user-friendly error messages. - - Consider using custom error types or error factories for consistent error handling. - - React/Next.js - - Use functional components and TypeScript interfaces. - - Use declarative JSX. - - Use function, not const, for components. - - Use Shadcn UI, Radix, and Tailwind Aria for components and styling. - - Implement responsive design with Tailwind CSS. - - Use mobile-first approach for responsive design. - - Place static content and interfaces at file end. - - Use content variables for static content outside render functions. - - Minimize 'use client', 'useEffect', and 'setState'. Favor RSC. - - Use Zod for form validation. - - Wrap client components in Suspense with fallback. - - Use dynamic loading for non-critical components. - - Optimize images: WebP format, size data, lazy loading. - - Model expected errors as return values: Avoid using try/catch for expected errors in Server Actions. Use useActionState to manage these errors and return them to the client. - - Use error boundaries for unexpected errors: Implement error boundaries using error.tsx and global-error.tsx files to handle unexpected errors and provide a fallback UI. - - Use useActionState with react-hook-form for form validation. - - Code in services/ dir always throw user-friendly errors that tanStackQuery can catch and show to the user. - - Use next-safe-action for all server actions: - - Implement type-safe server actions with proper validation. - - Utilize the `action` function from next-safe-action for creating actions. - - Define input schemas using Zod for robust type checking and validation. - - Handle errors gracefully and return appropriate responses. - - Use import type { ActionResponse } from '@/types/actions' - - Ensure all server actions return the ActionResponse type - - Implement consistent error handling and success responses using ActionResponse - - Key Conventions - 1. Rely on Next.js App Router for state changes. - 2. Prioritize Web Vitals (LCP, CLS, FID). - 3. Minimize 'use client' usage: - - Prefer server components and Next.js SSR features. - - Use 'use client' only for Web API access in small components. - - Avoid using 'use client' for data fetching or state management. - - Refer to Next.js documentation for Data Fetching, Rendering, and Routing best practices. - \ No newline at end of file diff --git a/.cursor/rules/backend.mdc b/.cursor/rules/fullstack.mdc similarity index 54% rename from .cursor/rules/backend.mdc rename to .cursor/rules/fullstack.mdc index f3609a8..0e18b99 100644 --- a/.cursor/rules/backend.mdc +++ b/.cursor/rules/fullstack.mdc @@ -1,10 +1,10 @@ --- description: Guideline for .NET C# backend globs: -alwaysApply: false +alwaysApply: true --- -# .NET Development Rules for Quantitative Finance +# .NET React Typescript Rules for Quantitative Finance You are a senior .NET backend developer and experimental quant with deep expertise in financial mathematics, algorithmic trading, and market indicators. @@ -15,6 +15,15 @@ You are a senior .NET backend developer and experimental quant with deep experti - Validate models with historical backtesting frameworks - Maintain audit trails for financial calculations +Key Principles + - Write concise, technical responses with accurate TypeScript examples. + - Use functional, declarative programming. Avoid classes. + - Prefer iteration and modularization over duplication. + - Use descriptive variable names with auxiliary verbs (e.g., isLoading). + - Use lowercase with dashes for directories (e.g., components/auth-wizard). + - Favor named exports for components. + - Use the Receive an Object, Return an Object (RORO) pattern. + ## Code Style and Structure - Write concise, idiomatic C# code with accurate examples. - Follow .NET and ASP.NET Core conventions and best practices. @@ -32,7 +41,7 @@ You are a senior .NET backend developer and experimental quant with deep experti ## C# and .NET Usage - Use C# 10+ features when appropriate (e.g., record types, pattern matching, null-coalescing assignment). - Leverage built-in ASP.NET Core features and middleware. - - Use Entity Framework Core effectively for database operations. + - Use MongoDb and Influxdb effectively for database operations. ## Syntax and Formatting - Follow the C# Coding Conventions (https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions) @@ -58,25 +67,43 @@ You are a senior .NET backend developer and experimental quant with deep experti - Use efficient LINQ queries and avoid N+1 query problems. - Implement pagination for large data sets. - ## Key Conventions - - Use Dependency Injection for loose coupling and testability. - - Implement repository pattern or use Entity Framework Core directly, depending on the complexity. - - Use AutoMapper for object-to-object mapping if needed. - - Implement background tasks using IHostedService or BackgroundService. - ## Testing - - Write unit tests using xUnit, NUnit, or MSTest. - - Use Moq or NSubstitute for mocking dependencies. + - Write unit tests using xUnit. + - Use Mock or NSubstitute for mocking dependencies. - Implement integration tests for API endpoints. ## Security - - Use Authentication and Authorization middleware. - - Implement JWT authentication for stateless API authentication. - - Use HTTPS and enforce SSL. - - Implement proper CORS policies. + - Give me advice when you see that some data should be carefully handled ## API Documentation - Use Swagger/OpenAPI for API documentation (as per installed Swashbuckle.AspNetCore package). - Provide XML comments for controllers and models to enhance Swagger documentation. + React/Tailwind/DaisyUI + - Use functional components and TypeScript interfaces. + - Use declarative JSX. + - Use function, not const, for components. + - Use DaisyUI Tailwind Aria for components and styling. + - Implement responsive design with Tailwind CSS. + - Use mobile-first approach for responsive design. + - Place static content and interfaces at file end. + - Use content variables for static content outside render functions. + - Minimize 'use client', 'useEffect', and 'setState'. Favor RSC. + - Use Zod for form validation. + - Wrap client components in Suspense with fallback. + - Use dynamic loading for non-critical components. + - Optimize images: WebP format, size data, lazy loading. + - Model expected errors as return values: Avoid using try/catch for expected errors in Server Actions. Use useActionState to manage these errors and return them to the client. + - Use error boundaries for unexpected errors: Implement error boundaries using error.tsx and global-error.tsx files to handle unexpected errors and provide a fallback UI. + - Use useActionState with react-hook-form for form validation. + - Code in services/ dir always throw user-friendly errors that tanStackQuery can catch and show to the user + + ## Do not forget + - Always implement the method that you created + - Before creating new object or new method/function check if there a code that can be called + - Most the time you will need to update multiple layer of code files. Make sure to reference all the method that you created when required + - When you think its necessary update all the code from the database to the front end + - Do not update ManagingApi.ts, user will always do it with nswag + - Do not reference new react library if a component already exist in mollecules or atoms + Follow the official Microsoft documentation and ASP.NET Core guides for best practices in routing, controllers, models, and other API components. diff --git a/.gitignore b/.gitignore index 6ad2b9b..66bdc23 100644 --- a/.gitignore +++ b/.gitignore @@ -362,4 +362,20 @@ src/Managing.Api.Workers/appsettings.Oda-Sandbox.json /src/Managing.WebApp/package-lock.json src/Managing.Infrastructure.Tests/PrivateKeys.cs /src/Managing.Infrastructure.Tests/PrivateKeys.cs -src/Managing.Infrastructure.Tests/PrivateKeys.cs + +# Managing.Web3Proxy build folders +/src/Managing.Web3Proxy/build/ +/src/Managing.Web3Proxy/build-*/ +/src/Managing.Web3Proxy/dist/ +/src/Managing.Web3Proxy/node_modules/ +/src/Managing.Web3Proxy/.turbo/ +/src/Managing.Web3Proxy/coverage/ +/src/Managing.Web3Proxy/.env +/src/Managing.Web3Proxy/.env.* +/src/Managing.Web3Proxy2/node_modules/ +/src/Managing.Web3Proxy2/dist/ +/src/Managing.Fastify/dist/ +/src/Managing.Fastify/node_modules/ + +# Node.js Tools for Visual Studio +node_modules/ diff --git a/README.md b/README.md index addeb97..7876640 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,20 @@ It contains bot management, backtesting, scenario management and money managemen # Features +## Privy + +Front-end required: +- Sign message to get jwt +- Delegate embedded address +- Sign delegation +- Send >10 USDc and 5$ of ETH for txn fees +- Trigger to init address + +Backend actions: +- Approve GMX contracts addresses +- Approve USDc contract address + + ## Money Management - Create a defined money management for a given timeframe (StopLoss, TakeProfit, Amount to risk) @@ -201,3 +215,30 @@ function MyComponent() { For more information, see the [Privy documentation](https://docs.privy.io/). +# Development + +## Utilities + +The project includes several utility scripts to help with development: + +### ESM Import Fixer + +When working with ES Modules in Node.js: +- Local module imports require `.js` file extensions +- JSON imports require proper type assertions + +We provide utility scripts that automatically handle these requirements: + +```bash +# Fix imports in the src directory (add .js extensions and JSON assertions) +npm run fix-imports + +# Update JSON imports to use modern "with { type: "json" }" syntax +npm run update-json-imports + +# Run both scripts in sequence (fix imports then update JSON import syntax) +npm run prepare-code +``` + +For more details, see the [scripts documentation](scripts/README.md). + diff --git a/definition-pinky b/definition-pinky new file mode 100644 index 0000000..f16793d --- /dev/null +++ b/definition-pinky @@ -0,0 +1,4 @@ +{ + "schemaVersion": 2, + "dockerfilePath": "./src/Managing.Pinky/Dockerfile-pinky" + } \ No newline at end of file diff --git a/definition-proxy-api b/definition-proxy-api new file mode 100644 index 0000000..9dd137a --- /dev/null +++ b/definition-proxy-api @@ -0,0 +1,4 @@ +{ + "schemaVersion": 2, + "dockerfilePath": "./src/Managing.Web3Proxy/Dockerfile-web3proxy" + } \ No newline at end of file diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..708ed52 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,191 @@ +# Scripts + +This directory contains utility scripts for the project. + +## Add JS Extensions Script + +The `add-js-extensions.mjs` script adds `.js` extensions to import statements in JavaScript and TypeScript files, and also adds the required JSON import assertions. + +### Why This Script? + +When working with ES Modules in Node.js: +1. Imports of local files require explicit file extensions +2. JSON imports require an `assert { type: 'json' }` assertion + +This script automates both processes to ensure your code is ESM-compatible. + +### Usage + +Run the script with npm: + +```bash +# Fix imports in the src directory (default) +npm run fix-imports + +# Fix imports in a specific directory +npm run fix-imports-dir -- path/to/directory +``` + +Or run the script directly: + +```bash +# Fix imports in the src directory (default) +node scripts/add-js-extensions.mjs + +# Fix imports in a specific directory +node scripts/add-js-extensions.mjs path/to/directory +``` + +### What This Script Does + +1. Recursively scans all JavaScript and TypeScript files in the specified directory +2. Identifies import statements with relative paths (starting with `./` or `../`) that don't have extensions and adds `.js` extensions +3. Identifies JSON imports that are missing the required assertion and adds `assert { type: 'json' }` +4. Provides a summary of files modified and any errors encountered + +### Examples + +Before: +```javascript +import { bigMath } from "./bigmath"; +import data from "./data.json"; +``` + +After: +```javascript +import { bigMath } from "./bigmath.js"; +import data from "./data.json" assert { type: 'json' }; +``` + +### Important Notes + +- The script only modifies imports with relative paths (starting with `./` or `../`) +- It skips imports that already have a file extension (except for JSON files) +- It adds `.js` extensions to extensionless imports +- It adds `assert { type: 'json' }` to JSON imports that don't already have it +- It handles regular imports, dynamic imports, and exports + +## Remove JSON Assertions Script + +The `remove-json-assertions.mjs` script removes `assert { type: 'json' }` assertions from JSON imports. + +### Why This Script? + +Different JavaScript environments have different requirements for JSON imports: +1. Some newer environments require the `assert { type: 'json' }` assertion +2. Others don't support or need these assertions + +This script removes these assertions to improve compatibility with environments that don't need them. + +### Usage + +Run the script with npm: + +```bash +# Remove JSON assertions +npm run remove-json-assertions + +# Run both import fixes and assertion removal in one command +npm run prepare-code +``` + +Or run the script directly: + +```bash +node scripts/remove-json-assertions.mjs +``` + +### What This Script Does + +1. Recursively scans all JavaScript and TypeScript files in the project +2. Identifies JSON imports with `assert { type: 'json' }` assertions +3. Removes the assertions while preserving the import statements +4. Provides a summary of files modified + +### Examples + +Before: +```javascript +import data from "./data.json" assert { type: 'json' }; +``` + +After: +```javascript +import data from "./data.json"; +``` + +### Important Notes + +- The script only modifies JSON imports with assertions +- It preserves all other import statements +- It works in conjunction with the add-js-extensions script +- These scripts can be run in sequence to first fix imports then remove assertions + +## Update JSON Imports Script + +The `update-json-imports.mjs` script updates JSON imports to use the modern `with { type: "json" }` syntax. + +### Why This Script? + +Different JavaScript environments have different requirements for JSON imports: +1. Older environments used `assert { type: 'json' }` for JSON imports +2. Modern JavaScript environments now use the `with { type: "json" }` syntax + +This script updates your codebase to use the newer, more standardized approach. + +### Usage + +Run the script with npm: + +```bash +# Update JSON import syntax +npm run update-json-imports + +# Run both import fixing and JSON import updating in one command +npm run prepare-code +``` + +Or run the script directly: + +```bash +node scripts/update-json-imports.mjs +``` + +### What This Script Does + +1. Recursively scans all JavaScript and TypeScript files in the project +2. Identifies JSON imports using either: + - The older `assert { type: 'json' }` syntax + - No type assertion at all + - Erroneous dual syntax (`assert { type: 'json' } with { type: "json" }`) +3. Updates them to use the modern `with { type: "json" }` syntax +4. Provides a summary of files modified + +### Examples + +Before (old assert syntax): +```javascript +import data from "./data.json" assert { type: 'json' }; +``` + +Before (no type assertion): +```javascript +import data from "./data.json"; +``` + +Before (erroneous dual syntax): +```javascript +import data from "./data.json" assert { type: 'json' } with { type: "json" }; +``` + +After (in all cases): +```javascript +import data from "./data.json" with { type: "json" }; +``` + +### Important Notes + +- The script updates all JSON imports to use the modern syntax +- It properly fixes cases where both old and new syntax are present +- It preserves all other import statements +- Files with properly formatted imports are not modified \ No newline at end of file diff --git a/scripts/add-js-extensions.js b/scripts/add-js-extensions.js new file mode 100644 index 0000000..8913113 --- /dev/null +++ b/scripts/add-js-extensions.js @@ -0,0 +1,110 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const { promisify } = require('util'); + +const readdir = promisify(fs.readdir); +const readFile = promisify(fs.readFile); +const writeFile = promisify(fs.writeFile); +const stat = promisify(fs.stat); + +// Regex to match import statements with relative paths without extensions +const importRegex = /import\s+(?:(?:[\w*\s{},]*)\s+from\s+)?['"](\.[^'"]*)['"]/g; + +async function processFile(filePath) { + try { + // Read file content + const content = await readFile(filePath, 'utf8'); + + // Skip files that are already processed or don't need processing + if (!content.match(importRegex)) { + return { filePath, changed: false }; + } + + // Replace imports without extensions + let modifiedContent = content.replace(importRegex, (match, importPath) => { + // Skip if already has an extension + if (path.extname(importPath)) { + return match; + } + + // Add .js extension + return match.replace(importPath, `${importPath}.js`); + }); + + // Only write if content changed + if (content !== modifiedContent) { + await writeFile(filePath, modifiedContent, 'utf8'); + return { filePath, changed: true }; + } + + return { filePath, changed: false }; + } catch (error) { + return { filePath, error: error.message }; + } +} + +async function walkDir(dir, fileTypes = ['.ts', '.tsx', '.js', '.jsx']) { + const entries = await readdir(dir, { withFileTypes: true }); + const files = []; + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + + if (entry.isDirectory()) { + // Skip node_modules and .git directories + if (entry.name !== 'node_modules' && entry.name !== '.git') { + files.push(...await walkDir(fullPath, fileTypes)); + } + } else if (entry.isFile()) { + const ext = path.extname(entry.name); + if (fileTypes.includes(ext)) { + files.push(fullPath); + } + } + } + + return files; +} + +async function main() { + const rootDir = process.argv[2] || path.resolve(process.cwd(), 'src'); + + console.log(`Scanning directory: ${rootDir}`); + + try { + const files = await walkDir(rootDir); + console.log(`Found ${files.length} files to process`); + + const results = await Promise.all(files.map(processFile)); + + // Collect statistics + const changed = results.filter(r => r.changed); + const errors = results.filter(r => r.error); + + console.log('\nSummary:'); + console.log(`- Total files scanned: ${files.length}`); + console.log(`- Files modified: ${changed.length}`); + console.log(`- Errors encountered: ${errors.length}`); + + if (changed.length > 0) { + console.log('\nModified files:'); + changed.forEach(({ filePath }) => { + console.log(`- ${path.relative(process.cwd(), filePath)}`); + }); + } + + if (errors.length > 0) { + console.log('\nErrors:'); + errors.forEach(({ filePath, error }) => { + console.log(`- ${path.relative(process.cwd(), filePath)}: ${error}`); + }); + } + } catch (error) { + console.error('Error:', error.message); + process.exit(1); + } +} + +main().catch(console.error); \ No newline at end of file diff --git a/scripts/add-js-extensions.mjs b/scripts/add-js-extensions.mjs new file mode 100755 index 0000000..055bbd6 --- /dev/null +++ b/scripts/add-js-extensions.mjs @@ -0,0 +1,130 @@ +#!/usr/bin/env node + +import fs from 'fs/promises'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +// Get the current file path and directory +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const gmxsdkDir = path.resolve(__dirname, '../src/Managing.Fastify/src/generated/gmxsdk'); + +// Regex to match import statements with relative paths without extensions +// This regex captures: import statements, export statements, and dynamic imports +const importRegex = /((?:import|export)(?:\s+(?:[\w*\s{},]*)\s+from\s+)?['"]|import\(['"])(\.[^'")\s]*)(['"]|\))/g; + +// Regex to match JSON imports that don't have the assert { type: 'json' } +const jsonImportRegex = /((?:import|export)(?:\s+(?:[\w*\s{},]*)\s+from\s+)?['"]|import\(['"])(\.[^'")\s]*\.json)(['"])(?!\s+assert\s*{\s*type\s*:\s*['"]json['"]\s*})/g; + +async function processFile(filePath) { + try { + // Read file content + const content = await fs.readFile(filePath, 'utf8'); + + // Skip files that are already processed or don't need processing + if (!content.match(importRegex) && !content.match(jsonImportRegex)) { + return { filePath, changed: false }; + } + + // First: Handle normal imports - add .js extensions + let modifiedContent = content.replace(importRegex, (match, prefix, importPath, suffix) => { + // Skip if already has an extension + if (path.extname(importPath)) { + return match; + } + + // Add .js extension + return `${prefix}${importPath}.js${suffix}`; + }); + + // Second: Handle JSON imports - add assert { type: 'json' } + modifiedContent = modifiedContent.replace(jsonImportRegex, (match, prefix, importPath, suffix) => { + // Add the JSON assertion + return `${prefix}${importPath}${suffix} assert { type: 'json' }`; + }); + + // Only write if content changed + if (content !== modifiedContent) { + await fs.writeFile(filePath, modifiedContent, 'utf8'); + return { filePath, changed: true }; + } + + return { filePath, changed: false }; + } catch (error) { + return { filePath, error: error.message }; + } +} + +async function walkDir(dir, fileTypes = ['.ts', '.tsx', '.js', '.jsx', '.mjs']) { + const entries = await fs.readdir(dir, { withFileTypes: true }); + const files = []; + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + + if (entry.isDirectory()) { + // Skip node_modules, .git, build, and dist directories + const skipDirs = ['node_modules', '.git', 'build', 'dist', '.next']; + if (!skipDirs.includes(entry.name)) { + files.push(...await walkDir(fullPath, fileTypes)); + } + } else if (entry.isFile()) { + const ext = path.extname(entry.name); + if (fileTypes.includes(ext)) { + files.push(fullPath); + } + } + } + + return files; +} + +async function main() { + console.log(`Scanning @gmxsdk directory: ${gmxsdkDir}`); + + try { + const files = await walkDir(gmxsdkDir); + console.log(`Found ${files.length} files to process in @gmxsdk`); + + // Process files in chunks to avoid memory issues with large projects + const chunkSize = 100; + const results = []; + + for (let i = 0; i < files.length; i += chunkSize) { + const chunk = files.slice(i, i + chunkSize); + const chunkResults = await Promise.all(chunk.map(processFile)); + results.push(...chunkResults); + + // Progress update + console.log(`Processed ${Math.min(i + chunkSize, files.length)}/${files.length} files...`); + } + + // Collect statistics + const changed = results.filter(r => r.changed); + const errors = results.filter(r => r.error); + + console.log('\nSummary:'); + console.log(`- Total files scanned: ${files.length}`); + console.log(`- Files modified: ${changed.length}`); + console.log(`- Errors encountered: ${errors.length}`); + + if (changed.length > 0) { + console.log('\nModified files:'); + changed.forEach(({ filePath }) => { + console.log(`- ${path.relative(process.cwd(), filePath)}`); + }); + } + + if (errors.length > 0) { + console.log('\nErrors:'); + errors.forEach(({ filePath, error }) => { + console.log(`- ${path.relative(process.cwd(), filePath)}: ${error}`); + }); + } + } catch (error) { + console.error('Error:', error.message); + process.exit(1); + } +} + +main().catch(console.error); \ No newline at end of file diff --git a/scripts/package-lock.json b/scripts/package-lock.json new file mode 100644 index 0000000..221a47c --- /dev/null +++ b/scripts/package-lock.json @@ -0,0 +1,487 @@ +{ + "name": "managing-scripts", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "managing-scripts", + "version": "1.0.0", + "dependencies": { + "glob": "^10.3.10" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + } + } +} diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000..f340d45 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,9 @@ +{ + "name": "managing-scripts", + "version": "1.0.0", + "private": true, + "type": "module", + "dependencies": { + "glob": "^10.3.10" + } +} \ No newline at end of file diff --git a/scripts/remove-json-assertions.mjs b/scripts/remove-json-assertions.mjs new file mode 100644 index 0000000..e71ae95 --- /dev/null +++ b/scripts/remove-json-assertions.mjs @@ -0,0 +1,74 @@ +#!/usr/bin/env node + +import fs from 'fs/promises'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import { glob } from 'glob'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const rootDir = path.resolve(__dirname, '..'); + +// Regex to match JSON imports that have the assert { type: 'json' } +const jsonImportWithAssertRegex = /^(import\s+.+?\s+from\s+['"].*?\.json['"])\s+assert\s+\{\s*type\s*:\s*['"]json['"]\s*\}\s*;/gm; + +async function processFile(filePath) { + try { + // Read the file content + const content = await fs.readFile(filePath, 'utf8'); + + // Check if the file contains JSON imports with assertions + if (!jsonImportWithAssertRegex.test(content)) { + return false; // No changes needed + } + + // Reset regex lastIndex + jsonImportWithAssertRegex.lastIndex = 0; + + // Replace the assertions in JSON imports + const updatedContent = content.replace(jsonImportWithAssertRegex, '$1;'); + + // Write the updated content back to the file + await fs.writeFile(filePath, updatedContent, 'utf8'); + + return true; // File was updated + } catch (error) { + console.error(`Error processing file ${filePath}:`, error); + return false; + } +} + +async function main() { + try { + console.log('Searching for TypeScript and JavaScript files...'); + + // Find all TS and JS files in the project + const files = await glob('**/*.{ts,js,mts,mjs}', { + cwd: rootDir, + ignore: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/build-test/**'] + }); + + console.log(`Found ${files.length} TypeScript/JavaScript files.`); + + let updatedFiles = 0; + + // Process files in parallel + const results = await Promise.all( + files.map(file => processFile(path.join(rootDir, file))) + ); + + updatedFiles = results.filter(Boolean).length; + + console.log(`Removed JSON assertions from ${updatedFiles} files.`); + + if (updatedFiles > 0) { + console.log('Successfully removed all JSON import assertions!'); + } else { + console.log('No files needed to be updated.'); + } + } catch (error) { + console.error('Error processing files:', error); + process.exit(1); + } +} + +main(); \ No newline at end of file diff --git a/scripts/update-json-imports.mjs b/scripts/update-json-imports.mjs new file mode 100755 index 0000000..6fd4852 --- /dev/null +++ b/scripts/update-json-imports.mjs @@ -0,0 +1,124 @@ +#!/usr/bin/env node + +import fs from 'fs/promises'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import { glob } from 'glob'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const rootDir = path.resolve(__dirname, '..'); +const gmxsdkDir = path.resolve(rootDir, 'src/Managing.Fastify/src/generated/gmxsdk'); + +// Regex to match JSON imports with assert { type: 'json' } pattern +const oldJsonImportRegex = /^(import\s+.+?\s+from\s+['"].*?\.json['"])\s+assert\s+\{\s*type\s*:\s*['"]json['"]\s*\}\s*;/gm; + +// Regex to match JSON imports without any type assertion +const plainJsonImportRegex = /^(import\s+.+?\s+from\s+['"].*?\.json['"])\s*;/gm; + +// Regex to match JSON imports with both assert and with patterns (erroneous state) +const doublePatternJsonImportRegex = /^(import\s+.+?\s+from\s+['"].*?\.json['"])\s+assert\s+\{\s*type\s*:\s*['"]json['"]\s*\}\s+with\s+\{\s*type\s*:\s*["']json["']\s*\}\s*;/gm; + +// Regex to match JSON imports that already have the with pattern +const withJsonImportRegex = /^(import\s+.+?\s+from\s+['"].*?\.json['"])\s+with\s+\{\s*type\s*:\s*["']json["']\s*\}\s*;/gm; + +async function processFile(filePath) { + try { + // Read the file content + const content = await fs.readFile(filePath, 'utf8'); + + // Check for all import patterns + const hasDoublePattern = doublePatternJsonImportRegex.test(content); + doublePatternJsonImportRegex.lastIndex = 0; + + const hasOldJsonImports = oldJsonImportRegex.test(content); + oldJsonImportRegex.lastIndex = 0; + + const hasPlainJsonImports = plainJsonImportRegex.test(content); + plainJsonImportRegex.lastIndex = 0; + + const hasWithPattern = withJsonImportRegex.test(content); + withJsonImportRegex.lastIndex = 0; + + // If no patterns to fix, return early + if (!hasDoublePattern && !hasOldJsonImports && !hasPlainJsonImports && !hasWithPattern) { + return false; // No changes needed + } + + // Apply fixes in sequence + let updatedContent = content; + + // 1. First fix the double pattern errors (both assert and with) + if (hasDoublePattern) { + updatedContent = updatedContent.replace(doublePatternJsonImportRegex, '$1 with { type: "json" };'); + } + + // 2. Replace assert pattern with with pattern + if (hasOldJsonImports) { + updatedContent = updatedContent.replace(oldJsonImportRegex, '$1 with { type: "json" };'); + } + + // 3. Add with pattern to plain JSON imports + if (hasPlainJsonImports) { + // Process line by line to avoid matching imports that already have with + const lines = updatedContent.split('\n'); + + const modifiedLines = lines.map(line => { + // Check if line is a plain JSON import without assert/with patterns + if (plainJsonImportRegex.test(line) && !line.includes('assert') && !line.includes('with')) { + plainJsonImportRegex.lastIndex = 0; + return line.replace(plainJsonImportRegex, '$1 with { type: "json" };'); + } + return line; + }); + + updatedContent = modifiedLines.join('\n'); + } + + // If content changed, write the updated content back to the file + if (updatedContent !== content) { + await fs.writeFile(filePath, updatedContent, 'utf8'); + return true; // File was updated + } + + return false; // No changes made + } catch (error) { + console.error(`Error processing file ${filePath}:`, error); + return false; + } +} + +async function main() { + try { + console.log('Searching for TypeScript and JavaScript files in @gmxsdk...'); + + // Find all TS and JS files in the gmxsdk directory + const files = await glob('**/*.{ts,js,mts,mjs}', { + cwd: gmxsdkDir, + ignore: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/build-test/**'] + }); + + console.log(`Found ${files.length} TypeScript/JavaScript files in @gmxsdk.`); + + let updatedFiles = 0; + + // Process files in parallel + const results = await Promise.all( + files.map(file => processFile(path.join(gmxsdkDir, file))) + ); + + updatedFiles = results.filter(Boolean).length; + + console.log(`Updated JSON imports in ${updatedFiles} files.`); + + if (updatedFiles > 0) { + console.log('Successfully updated all JSON import statements to use "with { type: "json" }" syntax!'); + } else { + console.log('No files needed to be updated.'); + } + } catch (error) { + console.error('Error processing files:', error); + process.exit(1); + } +} + +main(); \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store index 87d338e..edd418b 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/Dockerfile-managing-api-dev b/src/Dockerfile-managing-api-dev index 7726c8b..c63b453 100644 --- a/src/Dockerfile-managing-api-dev +++ b/src/Dockerfile-managing-api-dev @@ -11,7 +11,6 @@ COPY ["/src/Managing.Api/Managing.Api.csproj", "Managing.Api/"] COPY ["/src/Managing.Bootstrap/Managing.Bootstrap.csproj", "Managing.Bootstrap/"] COPY ["/src/Managing.Infrastructure.Storage/Managing.Infrastructure.Storage.csproj", "Managing.Infrastructure.Storage/"] COPY ["/src/Managing.Application/Managing.Application.csproj", "Managing.Application/"] -COPY ["/src/Managing.Infrastructure.MongoDb/Managing.Infrastructure.MongoDb.csproj", "Managing.Infrastructure.MongoDb/"] COPY ["/src/Managing.Common/Managing.Common.csproj", "Managing.Common/"] COPY ["/src/Managing.Core/Managing.Core.csproj", "Managing.Core/"] COPY ["/src/Managing.Application.Abstractions/Managing.Application.Abstractions.csproj", "Managing.Application.Abstractions/"] diff --git a/src/Dockerfile-worker-api-dev b/src/Dockerfile-worker-api-dev index fb0c77e..f89e105 100644 --- a/src/Dockerfile-worker-api-dev +++ b/src/Dockerfile-worker-api-dev @@ -11,7 +11,6 @@ COPY ["/src/Managing.Api.Workers/Managing.Api.Workers.csproj", "Managing.Api.Wor COPY ["/src/Managing.Bootstrap/Managing.Bootstrap.csproj", "Managing.Bootstrap/"] COPY ["/src/Managing.Infrastructure.Storage/Managing.Infrastructure.Storage.csproj", "Managing.Infrastructure.Storage/"] COPY ["/src/Managing.Application/Managing.Application.csproj", "Managing.Application/"] -COPY ["/src/Managing.Infrastructure.MongoDb/Managing.Infrastructure.MongoDb.csproj", "Managing.Infrastructure.MongoDb/"] COPY ["/src/Managing.Common/Managing.Common.csproj", "Managing.Common/"] COPY ["/src/Managing.Core/Managing.Core.csproj", "Managing.Core/"] COPY ["/src/Managing.Application.Abstractions/Managing.Application.Abstractions.csproj", "Managing.Application.Abstractions/"] diff --git a/src/Managing.Api.Workers/Dockerfile b/src/Managing.Api.Workers/Dockerfile index 688c5fc..7e1fd1e 100644 --- a/src/Managing.Api.Workers/Dockerfile +++ b/src/Managing.Api.Workers/Dockerfile @@ -11,7 +11,6 @@ COPY ["Managing.Api.Workers/Managing.Api.Workers.csproj", "Managing.Api.Workers/ COPY ["Managing.Bootstrap/Managing.Bootstrap.csproj", "Managing.Bootstrap/"] COPY ["Managing.Infrastructure.Storage/Managing.Infrastructure.Storage.csproj", "Managing.Infrastructure.Storage/"] COPY ["Managing.Application/Managing.Application.csproj", "Managing.Application/"] -COPY ["Managing.Infrastructure.MongoDb/Managing.Infrastructure.MongoDb.csproj", "Managing.Infrastructure.MongoDb/"] COPY ["Managing.Common/Managing.Common.csproj", "Managing.Common/"] COPY ["Managing.Core/Managing.Core.csproj", "Managing.Core/"] COPY ["Managing.Application.Abstractions/Managing.Application.Abstractions.csproj", "Managing.Application.Abstractions/"] diff --git a/src/Managing.Api/Controllers/BacktestController.cs b/src/Managing.Api/Controllers/BacktestController.cs index e951ff2..056ac73 100644 --- a/src/Managing.Api/Controllers/BacktestController.cs +++ b/src/Managing.Api/Controllers/BacktestController.cs @@ -19,7 +19,7 @@ namespace Managing.Api.Controllers; [Authorize] [Route("[controller]")] [Produces("application/json")] -public class BacktestController : ControllerBase +public class BacktestController : BaseController { private readonly IHubContext _hubContext; private readonly IBacktester _backtester; @@ -40,7 +40,8 @@ public class BacktestController : ControllerBase IBacktester backtester, IScenarioService scenarioService, IAccountService accountService, - IMoneyManagementService moneyManagementService) + IMoneyManagementService moneyManagementService, + IUserService userService) : base(userService) { _hubContext = hubContext; _backtester = backtester; @@ -50,24 +51,46 @@ public class BacktestController : ControllerBase } /// - /// Retrieves all backtests. + /// Retrieves all backtests for the authenticated user. /// /// A list of backtests. [HttpGet] - public ActionResult> Backtests() + public async Task>> Backtests() { - return Ok(_backtester.GetBacktests()); + var user = await GetUser(); + return Ok(await _backtester.GetBacktestsByUser(user)); } /// - /// Deletes a specific backtest by ID. + /// Retrieves a specific backtest by ID for the authenticated user. + /// This endpoint will also populate the candles for visualization. + /// + /// The ID of the backtest to retrieve. + /// The requested backtest with populated candle data. + [HttpGet("{id}")] + public async Task> Backtest(string id) + { + var user = await GetUser(); + var backtest = _backtester.GetBacktestByIdForUser(user, id); + + if (backtest == null) + { + return NotFound($"Backtest with ID {id} not found or doesn't belong to the current user."); + } + + return Ok(backtest); + } + + /// + /// Deletes a specific backtest by ID for the authenticated user. /// /// The ID of the backtest to delete. /// An ActionResult indicating the outcome of the operation. [HttpDelete] - public ActionResult DeleteBacktest(string id) + public async Task DeleteBacktest(string id) { - return Ok(_backtester.DeleteBacktest(id)); + var user = await GetUser(); + return Ok(_backtester.DeleteBacktestByUser(user, id)); } /// @@ -90,7 +113,8 @@ public class BacktestController : ControllerBase /// The name of the scenario to use for the backtest. /// The timeframe for the backtest. /// Whether to only watch the backtest without executing trades. - /// The number of days to backtest. + /// The start date for the backtest. + /// The end date for the backtest. /// The starting balance for the backtest. /// The name of the money management strategy to use. /// The money management strategy details, if not using a named strategy. @@ -104,9 +128,10 @@ public class BacktestController : ControllerBase string scenarioName, Timeframe timeframe, bool watchOnly, - int days, decimal balance, string moneyManagementName, + DateTime startDate, + DateTime endDate, MoneyManagement? moneyManagement = null, bool save = false) { @@ -127,18 +152,14 @@ public class BacktestController : ControllerBase nameof(moneyManagementName)); } - if (days > 0) - { - days = days * -1; - } - Backtest backtestResult = null; var scenario = _scenarioService.GetScenario(scenarioName); var account = await _accountService.GetAccount(accountName, true, false); + var user = await GetUser(); if (!string.IsNullOrEmpty(moneyManagementName) && moneyManagement is null) { - moneyManagement = await _moneyManagementService.GetMoneyMangement(moneyManagementName); + moneyManagement = await _moneyManagementService.GetMoneyMangement(user, moneyManagementName); } else { @@ -148,21 +169,37 @@ public class BacktestController : ControllerBase if (scenario == null) return BadRequest("No scenario found"); - // var localCandles = FileHelpers - // .ReadJson>($"{ticker.ToString()}-{timeframe.ToString()}-candles.json") - // .TakeLast(500).ToList(); - switch (botType) { case BotType.SimpleBot: break; case BotType.ScalpingBot: - backtestResult = _backtester.RunScalpingBotBacktest(account, moneyManagement, ticker, scenario, - timeframe, Convert.ToDouble(days), balance, watchOnly, save); + backtestResult = await _backtester.RunScalpingBotBacktest( + account, + moneyManagement, + ticker, + scenario, + timeframe, + balance, + startDate, + endDate, + user, + watchOnly, + save); break; case BotType.FlippingBot: - backtestResult = _backtester.RunFlippingBotBacktest(account, moneyManagement, ticker, scenario, - timeframe, Convert.ToDouble(days), balance, watchOnly, save); + backtestResult = await _backtester.RunFlippingBotBacktest( + account, + moneyManagement, + ticker, + scenario, + timeframe, + balance, + startDate, + endDate, + user, + watchOnly, + save); break; } diff --git a/src/Managing.Api/Controllers/BotController.cs b/src/Managing.Api/Controllers/BotController.cs index 46afbcf..149da45 100644 --- a/src/Managing.Api/Controllers/BotController.cs +++ b/src/Managing.Api/Controllers/BotController.cs @@ -4,11 +4,22 @@ using Managing.Application.Abstractions; using Managing.Application.Abstractions.Services; using Managing.Application.Hubs; using Managing.Application.ManageBot.Commands; +using Managing.Common; +using Managing.Domain.Bots; +using Managing.Domain.Users; using MediatR; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using static Managing.Common.Enums; +using ApplicationTradingBot = Managing.Application.Bots.TradingBot; +using ApiTradingBot = Managing.Api.Models.Responses.TradingBot; namespace Managing.Api.Controllers; @@ -20,13 +31,15 @@ namespace Managing.Api.Controllers; [Authorize] [Route("[controller]")] [Produces("application/json")] -public class BotController : ControllerBase +public class BotController : BaseController { private readonly IMediator _mediator; private readonly ILogger _logger; private readonly IHubContext _hubContext; private readonly IBacktester _backtester; private readonly IBotService _botService; + private readonly IAccountService _accountService; + private readonly IMoneyManagementService _moneyManagementService; /// /// Initializes a new instance of the class. @@ -36,13 +49,57 @@ public class BotController : ControllerBase /// SignalR hub context for real-time communication. /// Backtester for running backtests on bots. public BotController(ILogger logger, IMediator mediator, IHubContext hubContext, - IBacktester backtester, IBotService botService) + IBacktester backtester, IBotService botService, IUserService userService, + IAccountService accountService, IMoneyManagementService moneyManagementService) : base(userService) { _logger = logger; _mediator = mediator; _hubContext = hubContext; _backtester = backtester; _botService = botService; + _accountService = accountService; + _moneyManagementService = moneyManagementService; + } + + /// + /// Checks if the current authenticated user owns the account associated with the specified bot or account name + /// + /// The name of the bot to check + /// Optional account name to check when creating a new bot + /// True if the user owns the account, False otherwise + private async Task UserOwnsBotAccount(string botName, string accountName = null) + { + try + { + var user = await GetUser(); + if (user == null) + return false; + + // For new bot creation, check if the user owns the account provided in the request + if (!string.IsNullOrEmpty(accountName)) + { + var accountService = HttpContext.RequestServices.GetRequiredService(); + var account = await accountService.GetAccount(accountName, true, false); + // Compare the user names + return account != null && account.User != null && account.User.Name == user.Name; + } + + // For existing bots, check if the user owns the bot's account + var activeBots = _botService.GetActiveBots(); + var bot = activeBots.FirstOrDefault(b => b.Name == botName); + if (bot == null) + return true; // Bot doesn't exist yet, so no ownership conflict + + var botAccountService = HttpContext.RequestServices.GetRequiredService(); + var botAccount = await botAccountService.GetAccount(bot.AccountName, true, false); + // Compare the user names + return botAccount != null && botAccount.User != null && botAccount.User.Name == user.Name; + } + catch (Exception ex) + { + _logger.LogError(ex, "Error checking if user owns bot account"); + return false; + } } /// @@ -54,12 +111,39 @@ public class BotController : ControllerBase [Route("Start")] public async Task> Start(StartBotRequest request) { - var result = await _mediator.Send(new StartBotCommand(request.BotType, request.BotName, request.Ticker, - request.Scenario, request.Timeframe, request.AccountName, request.MoneyManagementName, - request.IsForWatchOnly)); + try + { + // Check if user owns the account + if (!await UserOwnsBotAccount(request.BotName, request.AccountName)) + { + return Forbid("You don't have permission to start this bot"); + } - await NotifyBotSubscriberAsync(); - return Ok(result); + // Trigger error if money management is not provided + if (string.IsNullOrEmpty(request.MoneyManagementName)) + { + return BadRequest("Money management name is required"); + } + + var user = await GetUser(); + var moneyManagement = await _moneyManagementService.GetMoneyMangement(user, request.MoneyManagementName); + if (moneyManagement == null) + { + return BadRequest("Money management not found"); + } + + var result = await _mediator.Send(new StartBotCommand(request.BotType, request.BotName, request.Ticker, + request.Scenario, request.Timeframe, request.AccountName, request.MoneyManagementName, user, + request.IsForWatchOnly)); + + await NotifyBotSubscriberAsync(); + return Ok(result); + } + catch (Exception ex) + { + _logger.LogError(ex, "Error starting bot"); + return StatusCode(500, $"Error starting bot: {ex.Message}"); + } } /// @@ -72,12 +156,26 @@ public class BotController : ControllerBase [Route("Stop")] public async Task> Stop(BotType botType, string botName) { - var result = await _mediator.Send(new StopBotCommand(botType, botName)); - _logger.LogInformation($"{botType} type called {botName} is now {result}"); + try + { + // Check if user owns the account + if (!await UserOwnsBotAccount(botName)) + { + return Forbid("You don't have permission to stop this bot"); + } - await NotifyBotSubscriberAsync(); + var result = await _mediator.Send(new StopBotCommand(botType, botName)); + _logger.LogInformation($"{botType} type called {botName} is now {result}"); - return Ok(result); + await NotifyBotSubscriberAsync(); + + return Ok(result); + } + catch (Exception ex) + { + _logger.LogError(ex, "Error stopping bot"); + return StatusCode(500, $"Error stopping bot: {ex.Message}"); + } } /// @@ -89,31 +187,68 @@ public class BotController : ControllerBase [Route("Delete")] public async Task> Delete(string botName) { - var result = await _botService.DeleteBot(botName); - await NotifyBotSubscriberAsync(); - return Ok(result); + try + { + // Check if user owns the account + if (!await UserOwnsBotAccount(botName)) + { + return Forbid("You don't have permission to delete this bot"); + } + + var result = await _botService.DeleteBot(botName); + await NotifyBotSubscriberAsync(); + return Ok(result); + } + catch (Exception ex) + { + _logger.LogError(ex, "Error deleting bot"); + return StatusCode(500, $"Error deleting bot: {ex.Message}"); + } } /// /// Stops all active bots. /// /// A string summarizing the results of the stop operations for all bots. - [HttpGet] - [Route("StopAll")] + [HttpPost("stop-all")] public async Task StopAll() { - var bots = await GetBotList(); - var result = ""; - foreach (var bot in bots) + // This method should be restricted to only stop bots owned by the current user + var user = await GetUser(); + if (user == null) + return "No authenticated user found"; + + try { - result += $"{bot.Name} : "; - result += await _mediator.Send(new StopBotCommand(bot.BotType, bot.Name)); - result += $" |"; + var bots = await GetBotList(); + // Filter to only include bots owned by the current user + var userBots = new List(); + + foreach (var bot in bots) + { + var account = await _accountService.GetAccount(bot.AccountName, true, false); + // Compare the user names + if (account != null && account.User != null && account.User.Name == user.Name) + { + userBots.Add(bot); + } + } + + foreach (var bot in userBots) + { + await _mediator.Send(new StopBotCommand(bot.BotType, bot.Name)); + await _hubContext.Clients.All.SendAsync("SendNotification", + $"Bot {bot.Name} paused by {user.Name}.", "Info"); + } + + await NotifyBotSubscriberAsync(); + return "All your bots have been stopped successfully!"; + } + catch (Exception ex) + { + _logger.LogError(ex, "Error stopping all bots"); + return $"Error stopping bots: {ex.Message}"; } - - await NotifyBotSubscriberAsync(); - - return result; } /// @@ -126,34 +261,80 @@ public class BotController : ControllerBase [Route("Restart")] public async Task> Restart(BotType botType, string botName) { - var result = await _mediator.Send(new RestartBotCommand(botType, botName)); - _logger.LogInformation($"{botType} type called {botName} is now {result}"); + try + { + // Check if user owns the account + if (!await UserOwnsBotAccount(botName)) + { + return Forbid("You don't have permission to restart this bot"); + } - await NotifyBotSubscriberAsync(); + var result = await _mediator.Send(new RestartBotCommand(botType, botName)); + _logger.LogInformation($"{botType} type called {botName} is now {result}"); - return Ok(result); + await NotifyBotSubscriberAsync(); + + return Ok(result); + } + catch (Exception ex) + { + _logger.LogError(ex, "Error restarting bot"); + return StatusCode(500, $"Error restarting bot: {ex.Message}"); + } } /// /// Restarts all active bots. /// /// A string summarizing the results of the restart operations for all bots. - [HttpGet] - [Route("RestartAll")] + [HttpPost("restart-all")] public async Task RestartAll() { - var bots = await GetBotList(); - var result = ""; - foreach (var bot in bots) + var user = await GetUser(); + if (user == null) + return "No authenticated user found"; + + try { - result += $"{bot.Name} : "; - result += await _mediator.Send(new RestartBotCommand(bot.BotType, bot.Name)); - result += $" |"; + var bots = await GetBotList(); + // Filter to only include bots owned by the current user + var userBots = new List(); + var accountService = HttpContext.RequestServices.GetRequiredService(); + + foreach (var bot in bots) + { + var account = await accountService.GetAccount(bot.AccountName, true, false); + // Compare the user names + if (account != null && account.User != null && account.User.Name == user.Name) + { + userBots.Add(bot); + } + } + + foreach (var bot in userBots) + { + // We can't directly restart a bot with just BotType and Name + // Instead, stop the bot and then retrieve the backup to start it again + await _mediator.Send(new StopBotCommand(bot.BotType, bot.Name)); + + // Get the saved bot backup + var backup = _botService.GetBotBackup(bot.Name); + if (backup != null) + { + _botService.StartBotFromBackup(backup); + await _hubContext.Clients.All.SendAsync("SendNotification", + $"Bot {bot.Name} restarted by {user.Name}.", "Info"); + } + } + + await NotifyBotSubscriberAsync(); + return "All your bots have been restarted successfully!"; + } + catch (Exception e) + { + _logger.LogError(e, "Failed to restart all bots"); + return $"Error restarting bots: {e.Message}"; } - - await NotifyBotSubscriberAsync(); - - return result; } /// @@ -165,12 +346,26 @@ public class BotController : ControllerBase [Route("ToggleIsForWatching")] public async Task> ToggleIsForWatching(string botName) { - var result = await _mediator.Send(new ToggleIsForWatchingCommand(botName)); - _logger.LogInformation($"{botName} bot is now {result}"); + try + { + // Check if user owns the account + if (!await UserOwnsBotAccount(botName)) + { + return Forbid("You don't have permission to modify this bot"); + } - await NotifyBotSubscriberAsync(); + var result = await _mediator.Send(new ToggleIsForWatchingCommand(botName)); + _logger.LogInformation($"{botName} bot is now {result}"); - return Ok(result); + await NotifyBotSubscriberAsync(); + + return Ok(result); + } + catch (Exception ex) + { + _logger.LogError(ex, "Error toggling bot watching status"); + return StatusCode(500, $"Error toggling bot watching status: {ex.Message}"); + } } /// @@ -178,7 +373,7 @@ public class BotController : ControllerBase /// /// A list of active trading bots. [HttpGet] - public async Task> GetActiveBots() + public async Task> GetActiveBots() { return await GetBotList(); } @@ -187,28 +382,28 @@ public class BotController : ControllerBase /// Retrieves a list of active bots by sending a command to the mediator. /// /// A list of trading bots. - private async Task> GetBotList() + private async Task> GetBotList() { var result = await _mediator.Send(new GetActiveBotsCommand()); - var list = new List(); + var list = new List(); foreach (var item in result) { - list.Add(new TradingBot + list.Add(new ApiTradingBot { Status = item.GetStatus(), - Name = item.GetName(), - Candles = item.OptimizedCandles.ToList(), - Positions = item.Positions, + Name = item.Name, Signals = item.Signals.ToList(), + Positions = item.Positions, + Candles = item.Candles.ToList(), WinRate = item.GetWinRate(), ProfitAndLoss = item.GetProfitAndLoss(), Timeframe = item.Timeframe, Ticker = item.Ticker, - AccountName = item.AccountName, Scenario = item.ScenarioName, IsForWatchingOnly = item.IsForWatchingOnly, BotType = item.BotType, + AccountName = item.AccountName, MoneyManagement = item.MoneyManagement }); } diff --git a/src/Managing.Api/Controllers/DataController.cs b/src/Managing.Api/Controllers/DataController.cs index 9536514..e267c0e 100644 --- a/src/Managing.Api/Controllers/DataController.cs +++ b/src/Managing.Api/Controllers/DataController.cs @@ -59,7 +59,7 @@ public class DataController : ControllerBase var cacheKey = string.Concat(timeframe.ToString()); var tickers = _cacheService.GetValue>(cacheKey); - if (tickers == null) + if (tickers == null || tickers.Count == 0) { tickers = await _exchangeService.GetTickers(timeframe); _cacheService.SaveValue(cacheKey, tickers, TimeSpan.FromHours(2)); diff --git a/src/Managing.Api/Controllers/MoneyManagementController.cs b/src/Managing.Api/Controllers/MoneyManagementController.cs index 0442a3d..c7e3329 100644 --- a/src/Managing.Api/Controllers/MoneyManagementController.cs +++ b/src/Managing.Api/Controllers/MoneyManagementController.cs @@ -1,4 +1,5 @@ using Managing.Application.Abstractions; +using Managing.Application.Abstractions.Services; using Managing.Domain.MoneyManagements; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,7 +15,7 @@ namespace Managing.Api.Controllers; [Authorize] [Route("[controller]")] [Produces("application/json")] -public class MoneyManagementController : ControllerBase +public class MoneyManagementController : BaseController { private readonly IMoneyManagementService _moneyManagementService; @@ -22,52 +23,60 @@ public class MoneyManagementController : ControllerBase /// Initializes a new instance of the class. /// /// The service for managing money management strategies. - public MoneyManagementController(IMoneyManagementService moneyManagementService) + /// The service for user-related operations. + public MoneyManagementController( + IMoneyManagementService moneyManagementService, + IUserService userService) + : base(userService) { _moneyManagementService = moneyManagementService; } /// - /// Creates a new money management strategy or updates an existing one. + /// Creates a new money management strategy or updates an existing one for the authenticated user. /// /// The money management strategy to create or update. /// The created or updated money management strategy. [HttpPost] public async Task> PostMoneyManagement(MoneyManagement moneyManagement) { - return Ok(await _moneyManagementService.CreateOrUpdateMoneyManagement(moneyManagement)); + var user = await GetUser(); + return Ok(await _moneyManagementService.CreateOrUpdateMoneyManagement(user, moneyManagement)); } /// - /// Retrieves all money management strategies. + /// Retrieves all money management strategies for the authenticated user. /// /// A list of money management strategies. [HttpGet] [Route("moneymanagements")] - public ActionResult> GetMoneyManagements() + public async Task>> GetMoneyManagements() { - return Ok(_moneyManagementService.GetMoneyMangements()); + var user = await GetUser(); + return Ok(_moneyManagementService.GetMoneyMangements(user)); } /// - /// Retrieves a specific money management strategy by name. + /// Retrieves a specific money management strategy by name for the authenticated user. /// /// The name of the money management strategy to retrieve. /// The requested money management strategy if found. [HttpGet] - public ActionResult GetMoneyManagement(string name) + public async Task> GetMoneyManagement(string name) { - return Ok(_moneyManagementService.GetMoneyMangement(name)); + var user = await GetUser(); + return Ok(await _moneyManagementService.GetMoneyMangement(user, name)); } /// - /// Deletes a specific money management strategy by name. + /// Deletes a specific money management strategy by name for the authenticated user. /// /// The name of the money management strategy to delete. /// An ActionResult indicating the outcome of the operation. [HttpDelete] - public ActionResult DeleteMoneyManagement(string name) + public async Task DeleteMoneyManagement(string name) { - return Ok(_moneyManagementService.DeleteMoneyManagement(name)); + var user = await GetUser(); + return Ok(_moneyManagementService.DeleteMoneyManagement(user, name)); } } \ No newline at end of file diff --git a/src/Managing.Api/Controllers/ScenarioController.cs b/src/Managing.Api/Controllers/ScenarioController.cs index 83cd7e2..2806bf0 100644 --- a/src/Managing.Api/Controllers/ScenarioController.cs +++ b/src/Managing.Api/Controllers/ScenarioController.cs @@ -1,4 +1,5 @@ using Managing.Application.Abstractions; +using Managing.Application.Abstractions.Services; using Managing.Domain.Scenarios; using Managing.Domain.Strategies; using Microsoft.AspNetCore.Authorization; @@ -16,7 +17,7 @@ namespace Managing.Api.Controllers; [Authorize] [Route("[controller]")] [Produces("application/json")] -public class ScenarioController : ControllerBase +public class ScenarioController : BaseController { private readonly IScenarioService _scenarioService; @@ -24,67 +25,75 @@ public class ScenarioController : ControllerBase /// Initializes a new instance of the class. /// /// The service for managing scenarios. - public ScenarioController(IScenarioService scenarioService) + /// The service for user-related operations. + public ScenarioController( + IScenarioService scenarioService, + IUserService userService) + : base(userService) { _scenarioService = scenarioService; } /// - /// Retrieves all scenarios. + /// Retrieves all scenarios for the authenticated user. /// /// A list of scenarios. [HttpGet] - public ActionResult> GetScenarios() + public async Task>> GetScenarios() { - return Ok(_scenarioService.GetScenarios()); + var user = await GetUser(); + return Ok(_scenarioService.GetScenariosByUser(user)); } /// - /// Creates a new scenario with the specified name and strategies. + /// Creates a new scenario with the specified name and strategies for the authenticated user. /// /// The name of the scenario. /// A list of strategy names to include in the scenario. /// The created scenario. [HttpPost] - public ActionResult CreateScenario(string name, List strategies, int? loopbackPeriod = null) + public async Task> CreateScenario(string name, List strategies, int? loopbackPeriod = null) { - return Ok(_scenarioService.CreateScenario(name, strategies, loopbackPeriod)); + var user = await GetUser(); + return Ok(_scenarioService.CreateScenarioForUser(user, name, strategies, loopbackPeriod)); } /// - /// Deletes a scenario by name. + /// Deletes a scenario by name for the authenticated user. /// /// The name of the scenario to delete. /// An ActionResult indicating the outcome of the operation. [HttpDelete] - public ActionResult DeleteScenario(string name) + public async Task DeleteScenario(string name) { - return Ok(_scenarioService.DeleteScenario(name)); + var user = await GetUser(); + return Ok(_scenarioService.DeleteScenarioByUser(user, name)); } // Update scenario [HttpPut] - public ActionResult UpdateScenario(string name, List strategies, int? loopbackPeriod = null) + public async Task UpdateScenario(string name, List strategies, int? loopbackPeriod = null) { - return Ok(_scenarioService.UpdateScenario(name, strategies, loopbackPeriod)); + var user = await GetUser(); + return Ok(_scenarioService.UpdateScenarioByUser(user, name, strategies, loopbackPeriod)); } /// - /// Retrieves all strategies. + /// Retrieves all strategies for the authenticated user. /// /// A list of strategies. [HttpGet] [Route("strategy")] - public ActionResult> GetStrategies() + public async Task>> GetStrategies() { - return Ok(_scenarioService.GetStrategies()); + var user = await GetUser(); + return Ok(_scenarioService.GetStrategiesByUser(user)); } /// - /// Creates a new strategy with specified parameters. + /// Creates a new strategy with specified parameters for the authenticated user. /// /// The type of the strategy. - /// The timeframe for the strategy. /// The name of the strategy. /// The period for the strategy (optional). /// The fast periods for the strategy (optional). @@ -97,7 +106,7 @@ public class ScenarioController : ControllerBase /// The created strategy. [HttpPost] [Route("strategy")] - public ActionResult CreateStrategy( + public async Task> CreateStrategy( StrategyType strategyType, string name, int? period = null, @@ -109,7 +118,9 @@ public class ScenarioController : ControllerBase int? smoothPeriods = null, int? cyclePeriods = null) { - return Ok(_scenarioService.CreateStrategy( + var user = await GetUser(); + return Ok(_scenarioService.CreateStrategyForUser( + user, strategyType, name, period, @@ -123,21 +134,22 @@ public class ScenarioController : ControllerBase } /// - /// Deletes a strategy by name. + /// Deletes a strategy by name for the authenticated user. /// /// The name of the strategy to delete. /// An ActionResult indicating the outcome of the operation. [HttpDelete] [Route("strategy")] - public ActionResult DeleteStrategy(string name) + public async Task DeleteStrategy(string name) { - return Ok(_scenarioService.DeleteStrategy(name)); + var user = await GetUser(); + return Ok(_scenarioService.DeleteStrategyByUser(user, name)); } // Update strategy [HttpPut] [Route("strategy")] - public ActionResult UpdateStrategy( + public async Task UpdateStrategy( StrategyType strategyType, string name, int? period = null, @@ -149,7 +161,9 @@ public class ScenarioController : ControllerBase int? smoothPeriods = null, int? cyclePeriods = null) { - return Ok(_scenarioService.UpdateStrategy( + var user = await GetUser(); + return Ok(_scenarioService.UpdateStrategyByUser( + user, strategyType, name, period, diff --git a/src/Managing.Api/Controllers/SettingsController.cs b/src/Managing.Api/Controllers/SettingsController.cs index f987063..bf755e2 100644 --- a/src/Managing.Api/Controllers/SettingsController.cs +++ b/src/Managing.Api/Controllers/SettingsController.cs @@ -1,6 +1,16 @@ -using Managing.Application.Abstractions; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading.Tasks; +using System.Collections.Generic; +using Managing.Application.Abstractions; +using Managing.Application.Abstractions.Services; +using Managing.Domain.MoneyManagements; +using Managing.Domain.Strategies; +using Managing.Domain.Scenarios; +using Managing.Domain.Users; +using static Managing.Common.Enums; namespace Managing.Api.Controllers; @@ -8,10 +18,12 @@ namespace Managing.Api.Controllers; [Authorize] [Route("[controller]")] [Produces("application/json")] -public class SettingsController : ControllerBase +public class SettingsController : BaseController { private readonly ISettingsService _settingsService; - public SettingsController(ISettingsService settingsService) + + public SettingsController(ISettingsService settingsService, IUserService userService) + : base(userService) { _settingsService = settingsService; } @@ -27,4 +39,26 @@ public class SettingsController : ControllerBase { return Ok(await _settingsService.ResetSettings()); } + + /// + /// Creates default configuration for backtesting including Money Management, Strategy, and Scenario + /// + /// A result indicating if the default configuration was created successfully + [HttpPost] + [Route("create-default-config")] + public async Task> CreateDefaultConfiguration() + { + try + { + var user = await GetUser(); + if (user == null) + return Unauthorized("User not found"); + + return Ok(await _settingsService.CreateDefaultConfiguration(user)); + } + catch (Exception ex) + { + return StatusCode(500, $"Error creating default configuration: {ex.Message}"); + } + } } diff --git a/src/Managing.Api/Controllers/TradingController.cs b/src/Managing.Api/Controllers/TradingController.cs index 3f7050d..8176cce 100644 --- a/src/Managing.Api/Controllers/TradingController.cs +++ b/src/Managing.Api/Controllers/TradingController.cs @@ -17,7 +17,7 @@ namespace Managing.Api.Controllers; [ApiController] [Authorize] [Route("[controller]")] -public class TradingController : ControllerBase +public class TradingController : BaseController { private readonly ICommandHandler _openTradeCommandHandler; private readonly ICommandHandler _closeTradeCommandHandler; @@ -39,7 +39,8 @@ public class TradingController : ControllerBase ICommandHandler openTradeCommandHandler, ICommandHandler closeTradeCommandHandler, ITradingService tradingService, - IMediator mediator, IMoneyManagementService moneyManagementService) + IMediator mediator, IMoneyManagementService moneyManagementService, + IUserService userService) : base(userService) { _logger = logger; _openTradeCommandHandler = openTradeCommandHandler; @@ -137,7 +138,8 @@ public class TradingController : ControllerBase if (moneyManagement != null) { - moneyManagement = await _moneyManagementService.GetMoneyMangement(moneyManagementName); + var user = await GetUser(); + moneyManagement = await _moneyManagementService.GetMoneyMangement(user, moneyManagementName); } var command = new OpenPositionRequest( diff --git a/src/Managing.Api/Dockerfile b/src/Managing.Api/Dockerfile index e16d276..ad3817b 100644 --- a/src/Managing.Api/Dockerfile +++ b/src/Managing.Api/Dockerfile @@ -11,7 +11,6 @@ COPY ["Managing.Api/Managing.Api.csproj", "Managing.Api/"] COPY ["Managing.Bootstrap/Managing.Bootstrap.csproj", "Managing.Bootstrap/"] COPY ["Managing.Infrastructure.Storage/Managing.Infrastructure.Storage.csproj", "Managing.Infrastructure.Storage/"] COPY ["Managing.Application/Managing.Application.csproj", "Managing.Application/"] -COPY ["Managing.Infrastructure.MongoDb/Managing.Infrastructure.MongoDb.csproj", "Managing.Infrastructure.MongoDb/"] COPY ["Managing.Common/Managing.Common.csproj", "Managing.Common/"] COPY ["Managing.Core/Managing.Core.csproj", "Managing.Core/"] COPY ["Managing.Application.Abstractions/Managing.Application.Abstractions.csproj", "Managing.Application.Abstractions/"] diff --git a/src/Managing.Api/Models/Responses/TradingBot.cs b/src/Managing.Api/Models/Responses/TradingBot.cs index e49bff9..a53d6f5 100644 --- a/src/Managing.Api/Models/Responses/TradingBot.cs +++ b/src/Managing.Api/Models/Responses/TradingBot.cs @@ -9,37 +9,19 @@ namespace Managing.Api.Models.Responses { public class TradingBot { - [Required] - public string Name { get; internal set; } - [Required] - public string Status { get; internal set; } - [Required] - public List Signals { get; internal set; } - [Required] - public List Positions { get; internal set; } - [Required] - public List Candles { get; internal set; } - [Required] - public RiskLevel RiskLevel { get; internal set; } - [Required] - public int WinRate { get; internal set; } - [Required] - public decimal ProfitAndLoss { get; internal set; } - [Required] - public Timeframe Timeframe { get; internal set; } - [Required] - public Ticker Ticker { get; internal set; } - [Required] - public string Scenario { get; internal set; } - [Required] - public TradingExchanges Exchange { get; internal set; } - [Required] - public bool IsForWatchingOnly { get; internal set; } - [Required] - public BotType BotType { get; internal set; } - [Required] - public string AccountName { get; internal set; } - [Required] - public MoneyManagement MoneyManagement { get; internal set; } + [Required] public string Name { get; internal set; } + [Required] public string Status { get; internal set; } + [Required] public List Signals { get; internal set; } + [Required] public List Positions { get; internal set; } + [Required] public List Candles { get; internal set; } + [Required] public int WinRate { get; internal set; } + [Required] public decimal ProfitAndLoss { get; internal set; } + [Required] public Timeframe Timeframe { get; internal set; } + [Required] public Ticker Ticker { get; internal set; } + [Required] public string Scenario { get; internal set; } + [Required] public bool IsForWatchingOnly { get; internal set; } + [Required] public BotType BotType { get; internal set; } + [Required] public string AccountName { get; internal set; } + [Required] public MoneyManagement MoneyManagement { get; internal set; } } -} +} \ No newline at end of file diff --git a/src/Managing.Api/appsettings.Prod.json b/src/Managing.Api/appsettings.Prod.json index a477322..ab0e66a 100644 --- a/src/Managing.Api/appsettings.Prod.json +++ b/src/Managing.Api/appsettings.Prod.json @@ -12,6 +12,9 @@ "AppId": "cm6f47n1l003jx7mjwaembhup", "AppSecret": "63Chz2z5M8TgR5qc8dznSLRAGTHTyPU4cjdQobrBF1Cx5tszZpTuFgyrRd7hZ2k6HpwDz3GEwQZzsCqHb8Z311bF" }, + "Web3Proxy": { + "BaseUrl": "http://srv-captain--web3-proxy:4111" + }, "Serilog": { "MinimumLevel": { "Default": "Information", diff --git a/src/Managing.Api/appsettings.json b/src/Managing.Api/appsettings.json index 4bc4253..42f15d9 100644 --- a/src/Managing.Api/appsettings.json +++ b/src/Managing.Api/appsettings.json @@ -21,6 +21,9 @@ "Organization": "", "Token": "" }, + "Web3Proxy": { + "BaseUrl": "http://localhost:3000" + }, "Serilog": { "MinimumLevel": { "Default": "Information", diff --git a/src/Managing.Application.Abstractions/Repositories/IBacktestRepository.cs b/src/Managing.Application.Abstractions/Repositories/IBacktestRepository.cs index c046ca7..899cfa0 100644 --- a/src/Managing.Application.Abstractions/Repositories/IBacktestRepository.cs +++ b/src/Managing.Application.Abstractions/Repositories/IBacktestRepository.cs @@ -1,11 +1,13 @@ using Managing.Domain.Backtests; +using Managing.Domain.Users; namespace Managing.Application.Abstractions.Repositories; public interface IBacktestRepository { - void InsertBacktest(Backtest result); - IEnumerable GetBacktests(); - void DeleteBacktestById(string id); - void DeleteAllBacktests(); + void InsertBacktestForUser(User user, Backtest result); + IEnumerable GetBacktestsByUser(User user); + Backtest GetBacktestByIdForUser(User user, string id); + void DeleteBacktestByIdForUser(User user, string id); + void DeleteAllBacktestsForUser(User user); } \ No newline at end of file diff --git a/src/Managing.Application.Abstractions/Repositories/ICandleRepository.cs b/src/Managing.Application.Abstractions/Repositories/ICandleRepository.cs index 5aa4c93..28e04bf 100644 --- a/src/Managing.Application.Abstractions/Repositories/ICandleRepository.cs +++ b/src/Managing.Application.Abstractions/Repositories/ICandleRepository.cs @@ -10,6 +10,14 @@ public interface ICandleRepository Enums.Ticker ticker, Enums.Timeframe timeframe, DateTime start); + + Task> GetCandles( + Enums.TradingExchanges exchange, + Enums.Ticker ticker, + Enums.Timeframe timeframe, + DateTime start, + DateTime end); + Task> GetTickersAsync( Enums.TradingExchanges exchange, Enums.Timeframe timeframe, diff --git a/src/Managing.Application.Abstractions/Repositories/IEvmManager.cs b/src/Managing.Application.Abstractions/Repositories/IEvmManager.cs index 0d528f2..54bda0d 100644 --- a/src/Managing.Application.Abstractions/Repositories/IEvmManager.cs +++ b/src/Managing.Application.Abstractions/Repositories/IEvmManager.cs @@ -25,7 +25,7 @@ public interface IEvmManager decimal GetVolume(SubgraphProvider subgraphProvider, Ticker ticker); Task> GetAvailableTicker(); Task GetCandle(SubgraphProvider subgraphProvider, Ticker ticker); - Task InitAddress(string chainName, string publicAddress, string privateKey); + Task InitAddress(string publicAddress); Task Send(Chain chain, Ticker ticker, decimal amount, string publicAddress, string privateKey, string receiverAddress); @@ -34,7 +34,9 @@ public interface IEvmManager Task CancelOrders(Account account, Ticker ticker); Task IncreasePosition(Account account, Ticker ticker, TradeDirection direction, decimal price, - decimal quantity, decimal? leverage = 1); + decimal quantity, decimal? leverage = 1, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null); Task GetTrade(Account account, string chainName, Ticker ticker); @@ -44,11 +46,22 @@ public interface IEvmManager Task QuantityInPosition(string chainName, string publicAddress, Ticker ticker); Task DecreaseOrder(Account account, TradeType tradeType, Ticker ticker, TradeDirection direction, - decimal price, decimal quantity, decimal? leverage); + decimal price, decimal quantity, decimal? leverage, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null); Task GetFee(string chainName); Task> GetOrders(Account account, Ticker ticker); Task GetTrade(string reference, string arbitrum, Ticker ticker); Task> GetFundingRates(); Task<(string Id, string Address)> CreatePrivyWallet(); + + /// + /// Signs a message using the embedded wallet + /// + /// The wallet id of the embedded wallet + /// The address of the embedded wallet + /// The message to sign + /// The signature response + Task SignMessageAsync(string embeddedWalletId, string address, string message); } \ No newline at end of file diff --git a/src/Managing.Application.Abstractions/Repositories/ISettingsRepository.cs b/src/Managing.Application.Abstractions/Repositories/ISettingsRepository.cs index 6aae113..7eb38a6 100644 --- a/src/Managing.Application.Abstractions/Repositories/ISettingsRepository.cs +++ b/src/Managing.Application.Abstractions/Repositories/ISettingsRepository.cs @@ -1,4 +1,5 @@ using Managing.Domain.MoneyManagements; +using Managing.Domain.Users; namespace Managing.Application.Abstractions.Repositories; @@ -10,4 +11,10 @@ public interface ISettingsRepository IEnumerable GetMoneyManagements(); void DeleteMoneyManagement(string name); void DeleteMoneyManagements(); + + // User-specific operations (these should eventually replace the above methods) + Task GetMoneyManagementByUser(User user, string name); + IEnumerable GetMoneyManagementsByUser(User user); + void DeleteMoneyManagementByUser(User user, string name); + void DeleteMoneyManagementsByUser(User user); } diff --git a/src/Managing.Application.Abstractions/Repositories/ITradingRepository.cs b/src/Managing.Application.Abstractions/Repositories/ITradingRepository.cs index 4a63c84..e38b87a 100644 --- a/src/Managing.Application.Abstractions/Repositories/ITradingRepository.cs +++ b/src/Managing.Application.Abstractions/Repositories/ITradingRepository.cs @@ -1,6 +1,7 @@ using Managing.Domain.Scenarios; using Managing.Domain.Strategies; using Managing.Domain.Trades; +using Managing.Domain.Users; using static Managing.Common.Enums; namespace Managing.Application.Abstractions.Repositories; @@ -9,6 +10,8 @@ public interface ITradingRepository { Scenario GetScenarioByName(string scenario); void InsertSignal(Signal signal); + IEnumerable GetSignalsByUser(User user); + Signal GetSignalByIdentifier(string identifier, User user = null); void InsertPosition(Position position); void UpdatePosition(Position position); Strategy GetStrategyByName(string strategy); diff --git a/src/Managing.Application.Abstractions/Repositories/IUserRepository.cs b/src/Managing.Application.Abstractions/Repositories/IUserRepository.cs index da98f3c..5cd6356 100644 --- a/src/Managing.Application.Abstractions/Repositories/IUserRepository.cs +++ b/src/Managing.Application.Abstractions/Repositories/IUserRepository.cs @@ -6,4 +6,5 @@ public interface IUserRepository { Task GetUserByNameAsync(string name); Task InsertUserAsync(User user); -} + Task UpdateUser(User user); +} \ No newline at end of file diff --git a/src/Managing.Application.Abstractions/Services/IBacktester.cs b/src/Managing.Application.Abstractions/Services/IBacktester.cs index 5c98d97..6666efa 100644 --- a/src/Managing.Application.Abstractions/Services/IBacktester.cs +++ b/src/Managing.Application.Abstractions/Services/IBacktester.cs @@ -3,28 +3,54 @@ using Managing.Domain.Backtests; using Managing.Domain.Candles; using Managing.Domain.MoneyManagements; using Managing.Domain.Scenarios; +using Managing.Domain.Users; using static Managing.Common.Enums; namespace Managing.Application.Abstractions.Services { public interface IBacktester { - Backtest RunScalpingBotBacktest(Account account, MoneyManagement moneyManagement, Ticker ticker, - Scenario scenario, Timeframe timeframe, double days, decimal balance, bool isForWatchingOnly = false, - bool save = false, List? initialCandles = null); + Task RunScalpingBotBacktest( + Account account, + MoneyManagement moneyManagement, + Ticker ticker, + Scenario scenario, + Timeframe timeframe, + decimal balance, + DateTime startDate, + DateTime endDate, + User user = null, + bool isForWatchingOnly = false, + bool save = false, + List? initialCandles = null); - Backtest RunFlippingBotBacktest(Account account, MoneyManagement moneyManagement, Ticker ticker, - Scenario scenario, Timeframe timeframe, double days, decimal balance, bool isForWatchingOnly = false, - bool save = false, List? initialCandles = null); + Task RunFlippingBotBacktest( + Account account, + MoneyManagement moneyManagement, + Ticker ticker, + Scenario scenario, + Timeframe timeframe, + decimal balance, + DateTime startDate, + DateTime endDate, + User user = null, + bool isForWatchingOnly = false, + bool save = false, + List? initialCandles = null); - IEnumerable GetBacktests(); bool DeleteBacktest(string id); bool DeleteBacktests(); - Backtest RunScalpingBotBacktest(Account account, MoneyManagement moneyManagement, Scenario scenario, - Timeframe timeframe, List candles, decimal balance); + Task RunScalpingBotBacktest(Account account, MoneyManagement moneyManagement, Scenario scenario, + Timeframe timeframe, List candles, decimal balance, User user = null); - Backtest RunFlippingBotBacktest(Account account, MoneyManagement moneyManagement, Scenario scenario, - Timeframe timeframe, List candles, decimal balance); + Task RunFlippingBotBacktest(Account account, MoneyManagement moneyManagement, Scenario scenario, + Timeframe timeframe, List candles, decimal balance, User user = null); + + // User-specific operations + Task> GetBacktestsByUser(User user); + Backtest GetBacktestByIdForUser(User user, string id); + bool DeleteBacktestByUser(User user, string id); + bool DeleteBacktestsByUser(User user); } } \ No newline at end of file diff --git a/src/Managing.Application.Abstractions/Services/IExchangeService.cs b/src/Managing.Application.Abstractions/Services/IExchangeService.cs index 9b56cce..b8556ea 100644 --- a/src/Managing.Application.Abstractions/Services/IExchangeService.cs +++ b/src/Managing.Application.Abstractions/Services/IExchangeService.cs @@ -19,7 +19,9 @@ public interface IExchangeService bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, - bool ioc = true); + bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null); Task GetBalance(Account account, bool isForPaperTrading = false); Task> GetBalances(Account account, bool isForPaperTrading = false); @@ -47,6 +49,9 @@ public interface IExchangeService Task> GetCandlesInflux(TradingExchanges exchange, Ticker ticker, DateTime startDate, Timeframe timeframe); + Task> GetCandlesInflux(TradingExchanges exchange, Ticker ticker, DateTime startDate, + Timeframe timeframe, DateTime endDate); + decimal GetBestPrice(Account account, Ticker ticker, decimal lastPrice, decimal quantity, TradeDirection direction); Orderbook GetOrderbook(Account account, Ticker ticker); diff --git a/src/Managing.Application.Tests/BaseTests.cs b/src/Managing.Application.Tests/BaseTests.cs index c47f1c4..59ad46a 100644 --- a/src/Managing.Application.Tests/BaseTests.cs +++ b/src/Managing.Application.Tests/BaseTests.cs @@ -24,7 +24,7 @@ public class BaseTests _moneyManagementService = new Mock(); MoneyManagement = new MoneyManagement() { - BalanceAtRisk = 0.30m, // 30% + BalanceAtRisk = 1m, // 30% Leverage = 2, // x2 Timeframe = Timeframe.FifteenMinutes, StopLoss = 0.008m, // 0.8% @@ -32,7 +32,7 @@ public class BaseTests Name = "Default MM" }; - _ = _moneyManagementService.Setup(m => m.GetMoneyMangement(It.IsAny())) + _ = _moneyManagementService.Setup(m => m.GetMoneyMangement(It.IsAny(), It.IsAny())) .Returns(Task.FromResult(MoneyManagement)); _accountService.Setup(a => a.GetAccount(It.IsAny(), It.IsAny(), It.IsAny())) diff --git a/src/Managing.Application.Tests/BotsTests.cs b/src/Managing.Application.Tests/BotsTests.cs index 80882f6..986ca32 100644 --- a/src/Managing.Application.Tests/BotsTests.cs +++ b/src/Managing.Application.Tests/BotsTests.cs @@ -9,6 +9,7 @@ using Managing.Core; using Managing.Domain.Candles; using Managing.Domain.MoneyManagements; using Managing.Domain.Scenarios; +using MongoDB.Driver.Linq; using Moq; using Newtonsoft.Json; using Xunit; @@ -30,6 +31,7 @@ namespace Managing.Application.Tests { var backtestRepository = new Mock().Object; var discordService = new Mock().Object; + var scenarioService = new Mock().Object; var tradingBotLogger = TradingBaseTests.CreateTradingBotLogger(); var backtestLogger = TradingBaseTests.CreateBacktesterLogger(); var botService = new Mock().Object; @@ -40,13 +42,14 @@ namespace Managing.Application.Tests _accountService.Object, _tradingService.Object, botService); - _backtester = new Backtester(_exchangeService, _botFactory, backtestRepository, backtestLogger); + _backtester = new Backtester(_exchangeService, _botFactory, backtestRepository, backtestLogger, + scenarioService); _elapsedTimes = new List(); } [Theory] [InlineData(Ticker.BTC, Timeframe.FifteenMinutes, -10)] - public void SwingBot_Should_Return_Positiv_Profit_For_Every_Position(Ticker ticker, Timeframe timeframe, + public async Task SwingBot_Should_Return_Positiv_Profit_For_Every_Position(Ticker ticker, Timeframe timeframe, int days) { // Arrange @@ -57,8 +60,9 @@ namespace Managing.Application.Tests FileHelpers.ReadJson>($"{ticker.ToString()}-{timeframe.ToString()}-candles.json"); // Act - var backtestResult = _backtester.RunFlippingBotBacktest(_account, MoneyManagement, ticker, scenario, - timeframe, Convert.ToDouble(days), 1000, initialCandles: localCandles.TakeLast(500).ToList()); + var backtestResult = await _backtester.RunFlippingBotBacktest(_account, MoneyManagement, ticker, scenario, + timeframe, 1000, new DateTime().AddDays(-3), DateTime.UtcNow, + initialCandles: localCandles.TakeLast(500).ToList()); var json = JsonConvert.SerializeObject(backtestResult, Formatting.None); File.WriteAllText($"{ticker.ToString()}-{timeframe.ToString()}-{Guid.NewGuid()}.json", json); @@ -78,7 +82,8 @@ namespace Managing.Application.Tests //[InlineData(Enums.Exchanges.Binance, "BTCUSDT", Timeframe.ThirtyMinutes, -4)] //[InlineData(Enums.Exchanges.Binance, "BTCUSDT", Timeframe.FifteenMinutes, -4)] [InlineData(Ticker.BTC, Timeframe.FifteenMinutes, -14)] - public void ScalpingBot_Should_Return_Positiv_Profit_For_Every_Position(Ticker ticker, Timeframe timeframe, + public async Task ScalpingBot_Should_Return_Positiv_Profit_For_Every_Position(Ticker ticker, + Timeframe timeframe, int days) { // Arrange @@ -87,8 +92,8 @@ namespace Managing.Application.Tests scenario.AddStrategy(strategy); // Act - var backtestResult = _backtester.RunScalpingBotBacktest(_account, MoneyManagement, ticker, scenario, - timeframe, Convert.ToDouble(days), 1000); + var backtestResult = await _backtester.RunScalpingBotBacktest(_account, MoneyManagement, ticker, scenario, + timeframe, 1000, DateTime.UtcNow.AddDays(-6), DateTime.UtcNow, null); //WriteCsvReport(backtestResult.GetStringReport()); // Assert @@ -99,7 +104,7 @@ namespace Managing.Application.Tests [Theory] [InlineData(Ticker.BTC, Timeframe.FifteenMinutes, -8)] - public void MacdCross_Should_Return_Positiv_Profit_For_Every_Position(Ticker ticker, Timeframe timeframe, + public async Task MacdCross_Should_Return_Positiv_Profit_For_Every_Position(Ticker ticker, Timeframe timeframe, int days) { // Arrange @@ -118,8 +123,8 @@ namespace Managing.Application.Tests }; // Act - var backtestResult = _backtester.RunScalpingBotBacktest(_account, moneyManagement, ticker, scenario, - timeframe, Convert.ToDouble(days), 1000); + var backtestResult = await _backtester.RunScalpingBotBacktest(_account, moneyManagement, ticker, scenario, + timeframe, 1000, DateTime.UtcNow.AddDays(-6), DateTime.UtcNow, null); WriteCsvReport(backtestResult.GetStringReport()); // Assert @@ -190,9 +195,9 @@ namespace Managing.Application.Tests { BotType.SimpleBot => throw new NotImplementedException(), BotType.ScalpingBot => _backtester.RunScalpingBotBacktest(_account, moneyManagement, - scenario, timeframe, candles, 1000), + scenario, timeframe, candles, 1000, null).Result, BotType.FlippingBot => _backtester.RunFlippingBotBacktest(_account, moneyManagement, - scenario, timeframe, candles, 1000), + scenario, timeframe, candles, 1000, null).Result, _ => throw new NotImplementedException(), }; timer.Stop(); @@ -299,9 +304,9 @@ namespace Managing.Application.Tests { BotType.SimpleBot => throw new NotImplementedException(), BotType.ScalpingBot => _backtester.RunScalpingBotBacktest(_account, moneyManagement, - scenario, timeframe, candles, 1000), + scenario, timeframe, candles, 1000, null).Result, BotType.FlippingBot => _backtester.RunFlippingBotBacktest(_account, moneyManagement, - scenario, timeframe, candles, 1000), + scenario, timeframe, candles, 1000, null).Result, _ => throw new NotImplementedException(), }; diff --git a/src/Managing.Application.Tests/TradingBaseTests.cs b/src/Managing.Application.Tests/TradingBaseTests.cs index 17a9802..7fa965e 100644 --- a/src/Managing.Application.Tests/TradingBaseTests.cs +++ b/src/Managing.Application.Tests/TradingBaseTests.cs @@ -7,13 +7,16 @@ using Managing.Infrastructure.Databases.InfluxDb; using Managing.Infrastructure.Databases.InfluxDb.Models; using Managing.Infrastructure.Evm; using Managing.Infrastructure.Evm.Abstractions; +using Managing.Infrastructure.Evm.Models.Privy; using Managing.Infrastructure.Evm.Services; using Managing.Infrastructure.Evm.Subgraphs; using Managing.Infrastructure.Exchanges; using Managing.Infrastructure.Exchanges.Abstractions; using Managing.Infrastructure.Exchanges.Exchanges; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Moq; +using Nethereum.Web3; using static Managing.Common.Enums; namespace Managing.Application.Tests @@ -34,7 +37,7 @@ namespace Managing.Application.Tests Chainlink, GbcFeed }; - var evmManager = new EvmManager(Subgraphs); + var evmManager = new EvmManager(Subgraphs, CreateWebProxyService()); var evmProcessor = new EvmProcessor(new Mock>().Object, evmManager); var exchangeProcessors = new List() @@ -44,7 +47,8 @@ namespace Managing.Application.Tests evmProcessor }; - return new ExchangeService(loggerFactory.CreateLogger(), GetCandleRepository(), exchangeProcessors); + return new ExchangeService(loggerFactory.CreateLogger(), GetCandleRepository(), + exchangeProcessors); } public static ILogger CreateTradingBotLogger() @@ -72,14 +76,22 @@ namespace Managing.Application.Tests { var settings = new InfluxDbSettings() { - Url = "http://localhost:8086/", - Token = "6b-OjFNaZRprYroZEx8zeLScvPqvOp9la1lEksXl8xRT0d96UyuN18iKpB6jKYFt8JJEX1NaxVMXhk-Sgy8sgg==", - Organization = "managing-org" + Url = "http://localhost:8086/", + Token = "6b-OjFNaZRprYroZEx8zeLScvPqvOp9la1lEksXl8xRT0d96UyuN18iKpB6jKYFt8JJEX1NaxVMXhk-Sgy8sgg==", + Organization = "managing-org" }; var influxdb = new InfluxDbRepository(settings); var candleRepository = new CandleRepository(influxdb, CreateCandleRepositoryLogger()); return candleRepository; } + + // Helper method to create Web3ProxyService for tests + public static IWeb3ProxyService CreateWebProxyService(string baseUrl = "http://localhost:4111/api/") + { + var settings = new Web3ProxySettings { BaseUrl = baseUrl }; + var options = Options.Create(settings); + return new Web3ProxyService(options); + } } -} +} \ No newline at end of file diff --git a/src/Managing.Application.Workers/StatisticService.cs b/src/Managing.Application.Workers/StatisticService.cs index a1083d8..6e8546c 100644 --- a/src/Managing.Application.Workers/StatisticService.cs +++ b/src/Managing.Application.Workers/StatisticService.cs @@ -216,16 +216,16 @@ public class StatisticService : IStatisticService MaxDegreeOfParallelism = 2 }; - _ = Parallel.ForEach(tickers, options, ticker => + _ = Parallel.ForEach(tickers, options, async ticker => { spotlight.TickerSignals.Add(new TickerSignal { Ticker = ticker, - FiveMinutes = GetSignals(account, scenario, ticker, Timeframe.FiveMinutes), - FifteenMinutes = GetSignals(account, scenario, ticker, Timeframe.FifteenMinutes), - OneHour = GetSignals(account, scenario, ticker, Timeframe.OneHour), - FourHour = GetSignals(account, scenario, ticker, Timeframe.FourHour), - OneDay = GetSignals(account, scenario, ticker, Timeframe.OneDay) + FiveMinutes = await GetSignals(account, scenario, ticker, Timeframe.FiveMinutes), + FifteenMinutes = await GetSignals(account, scenario, ticker, Timeframe.FifteenMinutes), + OneHour = await GetSignals(account, scenario, ticker, Timeframe.OneHour), + FourHour = await GetSignals(account, scenario, ticker, Timeframe.FourHour), + OneDay = await GetSignals(account, scenario, ticker, Timeframe.OneDay) }); }); @@ -237,7 +237,7 @@ public class StatisticService : IStatisticService _statisticRepository.UpdateSpotlightOverview(overview); } - private List GetSignals(Account account, Scenario scenario, Ticker ticker, Timeframe timeframe) + private async Task> GetSignals(Account account, Scenario scenario, Ticker ticker, Timeframe timeframe) { try { @@ -250,14 +250,15 @@ public class StatisticService : IStatisticService TakeProfit = 0.02m }; - var backtest = _backtester.RunScalpingBotBacktest( + var backtest = await _backtester.RunScalpingBotBacktest( account, moneyManagement, ticker, scenario, timeframe, - CandleExtensions.GetMinimalDays(timeframe), 1000, + DateTime.Now.AddDays(-7), + DateTime.Now, isForWatchingOnly: true); return backtest.Signals; diff --git a/src/Managing.Application/Abstractions/IBotService.cs b/src/Managing.Application/Abstractions/IBotService.cs index df73692..741a169 100644 --- a/src/Managing.Application/Abstractions/IBotService.cs +++ b/src/Managing.Application/Abstractions/IBotService.cs @@ -1,4 +1,5 @@ using Managing.Common; +using Managing.Domain.Accounts; using Managing.Domain.Bots; using Managing.Domain.MoneyManagements; using Managing.Domain.Workflows; @@ -14,6 +15,7 @@ public interface IBotService List GetActiveBots(); IEnumerable GetSavedBots(); void StartBotFromBackup(BotBackup backupBot); + BotBackup GetBotBackup(string name); ITradingBot CreateScalpingBot(string accountName, MoneyManagement moneyManagement, string name, Enums.Ticker ticker, string scenario, Enums.Timeframe interval, bool isForWatchingOnly); diff --git a/src/Managing.Application/Abstractions/IMoneyManagementService.cs b/src/Managing.Application/Abstractions/IMoneyManagementService.cs index 18a4f18..0589874 100644 --- a/src/Managing.Application/Abstractions/IMoneyManagementService.cs +++ b/src/Managing.Application/Abstractions/IMoneyManagementService.cs @@ -1,13 +1,14 @@ using Managing.Domain.MoneyManagements; +using Managing.Domain.Users; namespace Managing.Application.Abstractions { public interface IMoneyManagementService { - Task CreateOrUpdateMoneyManagement(MoneyManagement request); - Task GetMoneyMangement(string name); - IEnumerable GetMoneyMangements(); - bool DeleteMoneyManagement(string name); - bool DeleteMoneyManagements(); + Task CreateOrUpdateMoneyManagement(User user, MoneyManagement request); + Task GetMoneyMangement(User user, string name); + IEnumerable GetMoneyMangements(User user); + bool DeleteMoneyManagement(User user, string name); + bool DeleteMoneyManagements(User user); } } diff --git a/src/Managing.Application/Abstractions/IScenarioService.cs b/src/Managing.Application/Abstractions/IScenarioService.cs index 487dddd..c15cfd4 100644 --- a/src/Managing.Application/Abstractions/IScenarioService.cs +++ b/src/Managing.Application/Abstractions/IScenarioService.cs @@ -1,5 +1,6 @@ using Managing.Domain.Scenarios; using Managing.Domain.Strategies; +using Managing.Domain.Users; using static Managing.Common.Enums; namespace Managing.Application.Abstractions @@ -30,5 +31,31 @@ namespace Managing.Application.Abstractions bool UpdateStrategy(StrategyType strategyType, string name, int? period, int? fastPeriods, int? slowPeriods, int? signalPeriods, double? multiplier, int? stochPeriods, int? smoothPeriods, int? cyclePeriods); + + IEnumerable GetScenariosByUser(User user); + Scenario CreateScenarioForUser(User user, string name, List strategies, int? loopbackPeriod = 1); + IEnumerable GetStrategiesByUser(User user); + bool DeleteStrategyByUser(User user, string name); + bool DeleteScenarioByUser(User user, string name); + Scenario GetScenarioByUser(User user, string name); + + Strategy CreateStrategyForUser(User user, + StrategyType type, + string name, + int? period = null, + int? fastPeriods = null, + int? slowPeriods = null, + int? signalPeriods = null, + double? multiplier = null, + int? stochPeriods = null, + int? smoothPeriods = null, + int? cyclePeriods = null); + + bool DeleteStrategiesByUser(User user); + bool DeleteScenariosByUser(User user); + bool UpdateScenarioByUser(User user, string name, List strategies, int? loopbackPeriod); + + bool UpdateStrategyByUser(User user, StrategyType strategyType, string name, int? period, int? fastPeriods, + int? slowPeriods, int? signalPeriods, double? multiplier, int? stochPeriods, int? smoothPeriods, int? cyclePeriods); } } \ No newline at end of file diff --git a/src/Managing.Application/Abstractions/ISettingsService.cs b/src/Managing.Application/Abstractions/ISettingsService.cs index bb6a816..f9f2ba8 100644 --- a/src/Managing.Application/Abstractions/ISettingsService.cs +++ b/src/Managing.Application/Abstractions/ISettingsService.cs @@ -4,4 +4,5 @@ public interface ISettingsService { bool SetupSettings(); Task ResetSettings(); + Task CreateDefaultConfiguration(Domain.Users.User user); } diff --git a/src/Managing.Application/Abstractions/ITradingBot.cs b/src/Managing.Application/Abstractions/ITradingBot.cs index 4afa9e9..cc346b4 100644 --- a/src/Managing.Application/Abstractions/ITradingBot.cs +++ b/src/Managing.Application/Abstractions/ITradingBot.cs @@ -1,4 +1,5 @@ using Managing.Core.FixedSizedQueue; +using Managing.Domain.Accounts; using Managing.Domain.Bots; using Managing.Domain.Candles; using Managing.Domain.MoneyManagements; @@ -34,5 +35,6 @@ namespace Managing.Application.Abstractions void LoadStrategies(IEnumerable strategies); void LoadScenario(string scenarioName); void UpdateStrategiesValues(); + Task LoadAccount(); } } \ No newline at end of file diff --git a/src/Managing.Application/Accounts/AccountService.cs b/src/Managing.Application/Accounts/AccountService.cs index e58e8cb..e090131 100644 --- a/src/Managing.Application/Accounts/AccountService.cs +++ b/src/Managing.Application/Accounts/AccountService.cs @@ -52,8 +52,10 @@ public class AccountService : IAccountService else if (request.Exchange == Enums.TradingExchanges.Evm && request.Type == Enums.AccountType.Privy) { - if (string.IsNullOrEmpty(request.Key) || string.IsNullOrEmpty(request.Secret)) + if (string.IsNullOrEmpty(request.Key)) { + // No key provided, create new privy embedded wallet. + // TODO : Fix it to create privy wallet var privyClient = await _evmManager.CreatePrivyWallet(); request.Key = privyClient.Address; request.Secret = privyClient.Id; diff --git a/src/Managing.Application/Backtesting/Backtester.cs b/src/Managing.Application/Backtesting/Backtester.cs index 865d43e..e9f31de 100644 --- a/src/Managing.Application/Backtesting/Backtester.cs +++ b/src/Managing.Application/Backtesting/Backtester.cs @@ -14,6 +14,7 @@ using Managing.Domain.Strategies.Base; using Managing.Domain.Workflows; using Microsoft.Extensions.Logging; using static Managing.Common.Enums; +using Managing.Domain.Users; namespace Managing.Application.Backtesting { @@ -42,21 +43,25 @@ namespace Managing.Application.Backtesting { var simplebot = _botFactory.CreateSimpleBot("scenario", workflow); Backtest result = null; - if (save) + if (save && result != null) { - _backtestRepository.InsertBacktest(result); + // Simple bot backtest not implemented yet, would need user + // _backtestRepository.InsertBacktestForUser(null, result); } return result; } - public Backtest RunScalpingBotBacktest(Account account, + public async Task RunScalpingBotBacktest( + Account account, MoneyManagement moneyManagement, Ticker ticker, Scenario scenario, Timeframe timeframe, - double days, decimal balance, + DateTime startDate, + DateTime endDate, + User user = null, bool isForWatchingOnly = false, bool save = false, List initialCandles = null) @@ -64,21 +69,36 @@ namespace Managing.Application.Backtesting var scalpingBot = _botFactory.CreateBacktestScalpingBot(account.Name, moneyManagement, ticker, "scenario", timeframe, isForWatchingOnly); scalpingBot.LoadScenario(scenario.Name); - var candles = initialCandles ?? GetCandles(account, ticker, timeframe, days); + await scalpingBot.LoadAccount(); + var candles = initialCandles ?? GetCandles(account, ticker, timeframe, startDate, endDate); var result = GetBacktestingResult(ticker, scenario, timeframe, scalpingBot, candles, balance, account, moneyManagement); + + if (user != null) + { + result.User = user; + } + + // Set start and end dates + result.StartDate = startDate; + result.EndDate = endDate; + if (save) { - _backtestRepository.InsertBacktest(result); + _backtestRepository.InsertBacktestForUser(user, result); } return result; } - private List GetCandles(Account account, Ticker ticker, Timeframe timeframe, double days) + private List GetCandles(Account account, Ticker ticker, Timeframe timeframe, + DateTime startDate, DateTime endDate) { - var candles = _exchangeService.GetCandlesInflux(account.Exchange, ticker, - DateTime.Now.AddDays(Convert.ToDouble(days)), timeframe).Result; + List candles; + + // Use specific date range + candles = _exchangeService.GetCandlesInflux(account.Exchange, ticker, + startDate, timeframe, endDate).Result; if (candles == null || candles.Count == 0) throw new Exception($"No candles for {ticker} on {account.Exchange}"); @@ -86,46 +106,85 @@ namespace Managing.Application.Backtesting return candles; } - public Backtest RunFlippingBotBacktest(Account account, MoneyManagement moneyManagement, Ticker ticker, - Scenario scenario, Timeframe timeframe, - double days, decimal balance, bool isForWatchingOnly = false, bool save = false, + public async Task RunFlippingBotBacktest( + Account account, + MoneyManagement moneyManagement, + Ticker ticker, + Scenario scenario, + Timeframe timeframe, + decimal balance, + DateTime startDate, + DateTime endDate, + User user = null, + bool isForWatchingOnly = false, + bool save = false, List initialCandles = null) { var flippingBot = _botFactory.CreateBacktestFlippingBot(account.Name, moneyManagement, ticker, "scenario", timeframe, false); flippingBot.LoadScenario(scenario.Name); - var candles = initialCandles ?? GetCandles(account, ticker, timeframe, days); + await flippingBot.LoadAccount(); + + var candles = initialCandles ?? GetCandles(account, ticker, timeframe, startDate, endDate); var result = GetBacktestingResult(ticker, scenario, timeframe, flippingBot, candles, balance, account, moneyManagement); + + if (user != null) + { + result.User = user; + } + + // Set start and end dates + result.StartDate = startDate; + result.EndDate = endDate; + if (save) { - _backtestRepository.InsertBacktest(result); + _backtestRepository.InsertBacktestForUser(user, result); } return result; } - public Backtest RunScalpingBotBacktest(Account account, MoneyManagement moneyManagement, Scenario scenario, - Timeframe timeframe, List candles, decimal balance) + public async Task RunScalpingBotBacktest(Account account, MoneyManagement moneyManagement, + Scenario scenario, + Timeframe timeframe, List candles, decimal balance, User user = null) { var ticker = MiscExtensions.ParseEnum(candles.FirstOrDefault().Ticker); var bot = _botFactory.CreateBacktestScalpingBot(account.Name, moneyManagement, ticker, "scenario", timeframe, false); bot.LoadScenario(scenario.Name); + await bot.LoadAccount(); + var result = GetBacktestingResult(ticker, scenario, timeframe, bot, candles, balance, account, moneyManagement); + + if (user != null) + { + result.User = user; + } + return result; } - public Backtest RunFlippingBotBacktest(Account account, MoneyManagement moneyManagement, Scenario scenario, - Timeframe timeframe, List candles, decimal balance) + public async Task RunFlippingBotBacktest(Account account, MoneyManagement moneyManagement, + Scenario scenario, + Timeframe timeframe, List candles, decimal balance, User user = null) { var ticker = MiscExtensions.ParseEnum(candles.FirstOrDefault().Ticker); var bot = _botFactory.CreateBacktestFlippingBot(account.Name, moneyManagement, ticker, "scenario", timeframe, false); bot.LoadScenario(scenario.Name); + await bot.LoadAccount(); + var result = GetBacktestingResult(ticker, scenario, timeframe, bot, candles, balance, account, moneyManagement); + + if (user != null) + { + result.User = user; + } + return result; } @@ -177,10 +236,8 @@ namespace Managing.Application.Backtesting maxDrawdownRecoveryTime: stats.MaxDrawdownRecoveryTime ); -// Then calculate the score var score = BacktestScorer.CalculateTotalScore(scoringParams); - var result = new Backtest(ticker, scenario.Name, bot.Positions, bot.Signals.ToList(), timeframe, candles, bot.BotType, account.Name) { @@ -197,7 +254,6 @@ namespace Managing.Application.Backtesting Score = score }; - return result; } @@ -252,16 +308,14 @@ namespace Managing.Application.Backtesting return strategiesValues; } - public IEnumerable GetBacktests() - { - return _backtestRepository.GetBacktests(); - } public bool DeleteBacktest(string id) { try { - _backtestRepository.DeleteBacktestById(id); + // Since we no longer have a general DeleteBacktestById method in the repository, + // this should be implemented using DeleteBacktestByIdForUser with null + _backtestRepository.DeleteBacktestByIdForUser(null, id); return true; } catch (Exception ex) @@ -275,8 +329,111 @@ namespace Managing.Application.Backtesting { try { - _backtestRepository.DeleteAllBacktests(); - //_backtestRepository.DropCollection(); + // Since we no longer have a general DeleteAllBacktests method in the repository, + // this should be implemented using DeleteAllBacktestsForUser with null + _backtestRepository.DeleteAllBacktestsForUser(null); + return true; + } + catch (Exception ex) + { + _logger.LogError(ex.Message); + return false; + } + } + + public async Task> GetBacktestsByUser(User user) + { + var backtests = _backtestRepository.GetBacktestsByUser(user).ToList(); + + // For each backtest, ensure candles are loaded + foreach (var backtest in backtests) + { + // If the backtest has no candles or only a few sample candles, retrieve them + if (backtest.Candles == null || backtest.Candles.Count == 0 || backtest.Candles.Count < 10) + { + try + { + var candles = await _exchangeService.GetCandlesInflux( + user.Accounts.First().Exchange, + backtest.Ticker, + backtest.StartDate, + backtest.Timeframe, + backtest.EndDate); + + if (candles != null && candles.Count > 0) + { + backtest.Candles = candles; + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Failed to retrieve candles for backtest {Id}", backtest.Id); + // Continue with the next backtest if there's an error + } + } + } + + return backtests; + } + + public Backtest GetBacktestByIdForUser(User user, string id) + { + // Get the backtest from the repository + var backtest = _backtestRepository.GetBacktestByIdForUser(user, id); + + if (backtest == null) + return null; + + // If the backtest has no candles or only a few sample candles, retrieve them + if (backtest.Candles == null || backtest.Candles.Count == 0 || backtest.Candles.Count < 10) + { + try + { + // Get the account + var account = new Account { Name = backtest.AccountName, Exchange = TradingExchanges.Binance }; + + // Use the stored start and end dates to retrieve candles + var candles = _exchangeService.GetCandlesInflux( + account.Exchange, + backtest.Ticker, + backtest.StartDate, + backtest.Timeframe, + backtest.EndDate).Result; + + if (candles != null && candles.Count > 0) + { + backtest.Candles = candles; + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Failed to retrieve candles for backtest {Id}", id); + // Return the backtest without candles if there's an error + } + } + + return backtest; + } + + public bool DeleteBacktestByUser(User user, string id) + { + try + { + _backtestRepository.DeleteBacktestByIdForUser(user, id); + return true; + } + catch (Exception ex) + { + _logger.LogError(ex.Message); + return false; + } + } + + public bool DeleteBacktestsByUser(User user) + { + try + { + _backtestRepository.DeleteAllBacktestsForUser(user); return true; } catch (Exception ex) diff --git a/src/Managing.Application/Bots/TradingBot.cs b/src/Managing.Application/Bots/TradingBot.cs index ff06e14..6b15656 100644 --- a/src/Managing.Application/Bots/TradingBot.cs +++ b/src/Managing.Application/Bots/TradingBot.cs @@ -101,6 +101,7 @@ public class TradingBot : Bot, ITradingBot public override async void Start() { base.Start(); + // Load account synchronously await LoadAccount(); if (!IsForBacktest) @@ -127,7 +128,7 @@ public class TradingBot : Bot, ITradingBot Fee = TradingService.GetFee(Account, IsForBacktest); } - private async Task LoadAccount() + public async Task LoadAccount() { var account = await AccountService.GetAccount(AccountName, false, true); if (account == null) @@ -187,7 +188,7 @@ public class TradingBot : Bot, ITradingBot if (!IsForWatchingOnly) await ManagePositions(); - + if (!IsForBacktest) { SaveBackup(); @@ -225,6 +226,7 @@ public class TradingBot : Bot, ITradingBot if (!OptimizedCandles.Any(c => c.Date == candle.Date)) { OptimizedCandles.Enqueue(candle); + Candles.Add(candle); await UpdateSignals(OptimizedCandles); } } @@ -235,9 +237,9 @@ public class TradingBot : Bot, ITradingBot private async Task UpdateSignals(FixedSizeQueue candles) { var signal = TradingBox.GetSignal(candles.ToHashSet(), Strategies, Signals, Scenario.LoopbackPeriod); - if (signal == null) return; + signal.User = Account.User; await AddSignal(signal); } @@ -246,8 +248,8 @@ public class TradingBot : Bot, ITradingBot { Signals.Add(signal); - if (!IsForBacktest) - TradingService.InsertSignal(signal); + // if (!IsForBacktest) + // TradingService.InsertSignal(signal); if (IsForWatchingOnly || (ExecutionCount < 1 && !IsForBacktest)) signal.Status = SignalStatus.Expired; @@ -274,6 +276,7 @@ public class TradingBot : Bot, ITradingBot foreach (var candle in newCandle.Where(c => c.Date < DateTime.Now.ToUniversalTime())) { OptimizedCandles.Enqueue(candle); + Candles.Add(candle); } } @@ -497,7 +500,7 @@ public class TradingBot : Bot, ITradingBot MoneyManagement, signal.Direction, Ticker, - IsForBacktest ? PositionInitiator.PaperTrading : PositionInitiator.Bot , + IsForBacktest ? PositionInitiator.PaperTrading : PositionInitiator.Bot, signal.Date, IsForBacktest, lastPrice, @@ -643,12 +646,23 @@ public class TradingBot : Bot, ITradingBot { try { - var closePendingOrderStatus = await ExchangeService.CancelOrder(Account, Ticker); - Logger.LogInformation($"Closing all {Ticker} orders status : {closePendingOrderStatus}"); + var test = await ExchangeService.CancelOrder(Account, Ticker); + + var openOrders = await ExchangeService.GetOpenOrders(Account, Ticker); + if (openOrders.Any()) + { + Logger.LogInformation($"Canceling all orders for {Ticker}"); + await ExchangeService.CancelOrder(Account, Ticker); + var closePendingOrderStatus = await ExchangeService.CancelOrder(Account, Ticker); + Logger.LogInformation($"Closing all {Ticker} orders status : {closePendingOrderStatus}"); + } + + { + Logger.LogInformation($"No need to cancel orders for {Ticker}"); + } } catch (Exception ex) { - // Todo handle exception from evm Logger.LogError(ex, "Error during cancelOrders"); } } diff --git a/src/Managing.Application/ManageBot/BotService.cs b/src/Managing.Application/ManageBot/BotService.cs index 0f1c11e..671797f 100644 --- a/src/Managing.Application/ManageBot/BotService.cs +++ b/src/Managing.Application/ManageBot/BotService.cs @@ -97,11 +97,13 @@ namespace Managing.Application.ManageBot public List GetActiveBots() { - return _botTasks.Values + var bots = _botTasks.Values .Where(wrapper => typeof(ITradingBot).IsAssignableFrom(wrapper.BotType)) .Select(wrapper => wrapper.BotInstance as ITradingBot) .Where(bot => bot != null) .ToList(); + + return bots; } public IEnumerable GetSavedBots() @@ -158,7 +160,7 @@ namespace Managing.Application.ManageBot { bot.Start(); bot.LoadBackup(backupBot); - return () => { }; + return () => { }; } public IBot CreateSimpleBot(string botName, Workflow workflow) @@ -227,12 +229,10 @@ namespace Managing.Application.ManageBot public void ToggleIsForWatchingOnly(string botName) { - if (_botTasks.TryGetValue(botName, out var botWrapper)) + if (_botTasks.TryGetValue(botName, out var botTaskWrapper) && + botTaskWrapper.BotInstance is ITradingBot tradingBot) { - if (botWrapper.BotInstance is ITradingBot bot) - { - bot.IsForWatchingOnly = !bot.IsForWatchingOnly; - } + tradingBot.ToggleIsForWatchOnly().Wait(); } } diff --git a/src/Managing.Application/ManageBot/Commands/StartBotCommand.cs b/src/Managing.Application/ManageBot/Commands/StartBotCommand.cs index 90c7833..664fad5 100644 --- a/src/Managing.Application/ManageBot/Commands/StartBotCommand.cs +++ b/src/Managing.Application/ManageBot/Commands/StartBotCommand.cs @@ -1,4 +1,5 @@ using MediatR; +using Managing.Domain.Users; using static Managing.Common.Enums; namespace Managing.Application.ManageBot.Commands @@ -13,6 +14,7 @@ namespace Managing.Application.ManageBot.Commands public string Scenario { get; internal set; } public string AccountName { get; internal set; } public string MoneyManagementName { get; internal set; } + public User User { get; internal set; } public StartBotCommand(BotType botType, string name, @@ -21,6 +23,7 @@ namespace Managing.Application.ManageBot.Commands Timeframe timeframe, string accountName, string moneyManagementName, + User user, bool isForWatchingOnly = false) { BotType = botType; @@ -31,6 +34,7 @@ namespace Managing.Application.ManageBot.Commands IsForWatchingOnly = isForWatchingOnly; AccountName = accountName; MoneyManagementName = moneyManagementName; + User = user; } } } diff --git a/src/Managing.Application/ManageBot/StartBotCommandHandler.cs b/src/Managing.Application/ManageBot/StartBotCommandHandler.cs index 0a49f5c..81519ce 100644 --- a/src/Managing.Application/ManageBot/StartBotCommandHandler.cs +++ b/src/Managing.Application/ManageBot/StartBotCommandHandler.cs @@ -22,7 +22,7 @@ namespace Managing.Application.ManageBot public Task Handle(StartBotCommand request, CancellationToken cancellationToken) { BotStatus botStatus = BotStatus.Down; - var moneyManagement = _moneyManagementService.GetMoneyMangement(request.MoneyManagementName).Result; + var moneyManagement = _moneyManagementService.GetMoneyMangement(request.User, request.MoneyManagementName).Result; switch (request.BotType) { case BotType.SimpleBot: diff --git a/src/Managing.Application/MoneyManagements/MoneyManagementService.cs b/src/Managing.Application/MoneyManagements/MoneyManagementService.cs index 0c2b63d..af1a65a 100644 --- a/src/Managing.Application/MoneyManagements/MoneyManagementService.cs +++ b/src/Managing.Application/MoneyManagements/MoneyManagementService.cs @@ -2,6 +2,7 @@ using Managing.Application.Abstractions; using Microsoft.Extensions.Logging; using Managing.Application.Abstractions.Repositories; +using Managing.Domain.Users; namespace Managing.Application.MoneyManagements; @@ -18,42 +19,110 @@ public class MoneyManagementService : IMoneyManagementService _settingsRepository = settingsRepository; } - public async Task CreateOrUpdateMoneyManagement(MoneyManagement request) + public async Task CreateOrUpdateMoneyManagement(User user, MoneyManagement request) { - var moneyManagement = await _settingsRepository.GetMoneyManagement(request.Name); + // Try to get user-specific strategy first + var moneyManagement = await _settingsRepository.GetMoneyManagementByUser(user, request.Name); + + // Fall back to regular lookup if user-specific endpoint is not implemented + if (moneyManagement == null) + { + moneyManagement = await _settingsRepository.GetMoneyManagement(request.Name); + + // If found by name but doesn't belong to this user, treat as new + if (moneyManagement != null && moneyManagement.User?.Name != user.Name) + { + moneyManagement = null; + } + } if (moneyManagement == null) { + request.User = user; await _settingsRepository.InsertMoneyManagement(request); + return request; } else { + // Additional check to ensure user's ownership + if (moneyManagement.User?.Name != user.Name) + { + throw new UnauthorizedAccessException("You do not have permission to update this money management strategy."); + } + moneyManagement.StopLoss = request.StopLoss; moneyManagement.TakeProfit = request.TakeProfit; moneyManagement.BalanceAtRisk = request.BalanceAtRisk; moneyManagement.Leverage = request.Leverage; moneyManagement.Timeframe = request.Timeframe; + moneyManagement.User = user; + _settingsRepository.UpdateMoneyManagement(moneyManagement); + return moneyManagement; } + } + public IEnumerable GetMoneyMangements(User user) + { + try + { + // Try to use user-specific repository method first + return _settingsRepository.GetMoneyManagementsByUser(user); + } + catch + { + // Fall back to filtering if user-specific endpoint is not implemented + return _settingsRepository.GetMoneyManagements() + .Where(mm => mm.User?.Name == user.Name); + } + } + + public async Task GetMoneyMangement(User user, string name) + { + MoneyManagement moneyManagement; + + try + { + // Try to use user-specific repository method first + moneyManagement = await _settingsRepository.GetMoneyManagementByUser(user, name); + } + catch + { + // Fall back to regular lookup if user-specific endpoint is not implemented + moneyManagement = await _settingsRepository.GetMoneyManagement(name); + + // Filter by user + if (moneyManagement != null && moneyManagement.User?.Name != user.Name) + { + moneyManagement = null; + } + } + return moneyManagement; } - public IEnumerable GetMoneyMangements() - { - return _settingsRepository.GetMoneyManagements(); - } - - public async Task GetMoneyMangement(string name) - { - return await _settingsRepository.GetMoneyManagement(name); - } - - public bool DeleteMoneyManagement(string name) + public bool DeleteMoneyManagement(User user, string name) { try { - _settingsRepository.DeleteMoneyManagement(name); + try + { + // Try to use user-specific repository method first + _settingsRepository.DeleteMoneyManagementByUser(user, name); + } + catch + { + // Fall back to verifying user ownership before deletion + var moneyManagement = _settingsRepository.GetMoneyManagement(name).Result; + + if (moneyManagement != null && moneyManagement.User?.Name != user.Name) + { + throw new UnauthorizedAccessException("You do not have permission to delete this money management strategy."); + } + + _settingsRepository.DeleteMoneyManagement(name); + } + return true; } catch (Exception ex) @@ -63,11 +132,22 @@ public class MoneyManagementService : IMoneyManagementService } } - public bool DeleteMoneyManagements() + public bool DeleteMoneyManagements(User user) { try { - _settingsRepository.DeleteMoneyManagements(); + try + { + // Try to use user-specific repository method first + _settingsRepository.DeleteMoneyManagementsByUser(user); + } + catch + { + // This fallback is not ideal as it would delete all money managements regardless of user + // In a real implementation, we would need a filtered repository method + _logger.LogWarning("DeleteMoneyManagementsByUser not implemented, cannot delete user-specific money managements"); + } + return true; } catch (Exception ex) diff --git a/src/Managing.Application/Scenarios/ScenarioService.cs b/src/Managing.Application/Scenarios/ScenarioService.cs index bd0666f..ffdcdd1 100644 --- a/src/Managing.Application/Scenarios/ScenarioService.cs +++ b/src/Managing.Application/Scenarios/ScenarioService.cs @@ -5,6 +5,8 @@ using Managing.Domain.Strategies; using Microsoft.Extensions.Logging; using MongoDB.Driver; using static Managing.Common.Enums; +using System.Collections.Generic; +using Managing.Domain.Users; namespace Managing.Application.Scenarios { @@ -186,5 +188,166 @@ namespace Managing.Application.Scenarios return false; } } + + // User-specific methods implementation + + public IEnumerable GetScenariosByUser(User user) + { + var scenarios = _tradingService.GetScenarios(); + return scenarios.Where(s => s.User?.Name == user.Name); + } + + public Scenario CreateScenarioForUser(User user, string name, List strategies, int? loopbackPeriod = 1) + { + var scenario = new Scenario(name, loopbackPeriod ?? 1) + { + User = user + }; + + foreach (var strategyName in strategies) + { + var strategy = _tradingService.GetStrategyByName(strategyName); + if (strategy != null && strategy.User?.Name == user.Name) + { + scenario.AddStrategy(strategy); + } + } + + _tradingService.InsertScenario(scenario); + return scenario; + } + + public IEnumerable GetStrategiesByUser(User user) + { + var strategies = _tradingService.GetStrategies(); + return strategies.Where(s => s.User?.Name == user.Name); + } + + public bool DeleteStrategyByUser(User user, string name) + { + var strategy = _tradingService.GetStrategyByName(name); + if (strategy != null && strategy.User?.Name == user.Name) + { + _tradingService.DeleteStrategy(strategy.Name); + return true; + } + return false; + } + + public bool DeleteScenarioByUser(User user, string name) + { + var scenario = _tradingService.GetScenarioByName(name); + if (scenario != null && scenario.User?.Name == user.Name) + { + _tradingService.DeleteScenario(scenario.Name); + return true; + } + return false; + } + + public Scenario GetScenarioByUser(User user, string name) + { + var scenario = _tradingService.GetScenarioByName(name); + return scenario != null && scenario.User?.Name == user.Name ? scenario : null; + } + + public Strategy CreateStrategyForUser(User user, StrategyType type, string name, int? period = null, + int? fastPeriods = null, int? slowPeriods = null, int? signalPeriods = null, + double? multiplier = null, int? stochPeriods = null, int? smoothPeriods = null, + int? cyclePeriods = null) + { + // Create a new strategy using the existing implementation + var strategy = CreateStrategy(type, name, period, fastPeriods, slowPeriods, signalPeriods, + multiplier, stochPeriods, smoothPeriods, cyclePeriods); + + // Set the user + strategy.User = user; + + // Update the strategy to save the user property + _tradingService.UpdateStrategy(strategy); + + return strategy; + } + + public bool DeleteStrategiesByUser(User user) + { + try + { + var strategies = GetStrategiesByUser(user); + + foreach (var strategy in strategies) + { + _tradingService.DeleteStrategy(strategy.Name); + } + + return true; + } + catch (Exception ex) + { + _logger.LogError(ex.Message); + return false; + } + } + + public bool DeleteScenariosByUser(User user) + { + try + { + var scenarios = GetScenariosByUser(user); + + foreach (var scenario in scenarios) + { + _tradingService.DeleteScenario(scenario.Name); + } + + return true; + } + catch (Exception ex) + { + _logger.LogError(ex.Message); + return false; + } + } + + public bool UpdateScenarioByUser(User user, string name, List strategies, int? loopbackPeriod) + { + var scenario = _tradingService.GetScenarioByName(name); + if (scenario == null || scenario.User?.Name != user.Name) + { + return false; + } + + scenario.Strategies.Clear(); + scenario.LoopbackPeriod = loopbackPeriod ?? 1; + + foreach (var strategyName in strategies) + { + var strategy = _tradingService.GetStrategyByName(strategyName); + if (strategy != null && strategy.User?.Name == user.Name) + { + scenario.AddStrategy(strategy); + } + } + + _tradingService.UpdateScenario(scenario); + return true; + } + + public bool UpdateStrategyByUser(User user, StrategyType strategyType, string name, int? period, + int? fastPeriods, int? slowPeriods, int? signalPeriods, double? multiplier, + int? stochPeriods, int? smoothPeriods, int? cyclePeriods) + { + var strategy = _tradingService.GetStrategyByName(name); + if (strategy == null || strategy.User?.Name != user.Name) + { + return false; + } + + // Use the existing update strategy logic + var result = UpdateStrategy(strategyType, name, period, fastPeriods, slowPeriods, + signalPeriods, multiplier, stochPeriods, smoothPeriods, cyclePeriods); + + return result; + } } } \ No newline at end of file diff --git a/src/Managing.Application/Shared/SettingsService.cs b/src/Managing.Application/Shared/SettingsService.cs index 9edc0ce..8ff68bb 100644 --- a/src/Managing.Application/Shared/SettingsService.cs +++ b/src/Managing.Application/Shared/SettingsService.cs @@ -1,6 +1,7 @@ using Managing.Application.Abstractions; using Managing.Application.Abstractions.Services; using Managing.Domain.MoneyManagements; +using Managing.Domain.Users; using Microsoft.Extensions.Logging; using static Managing.Common.Enums; @@ -41,10 +42,6 @@ public class SettingsService : ISettingsService throw new Exception("Cannot delete all strategies"); } - if (!_moneyManagementService.DeleteMoneyManagements()) - { - throw new Exception("Cannot delete all money management settings"); - } if (!SetupSettings()) { @@ -58,10 +55,10 @@ public class SettingsService : ISettingsService { try { - SetupMoneyManagementsSeed(Timeframe.FiveMinutes); - SetupMoneyManagementsSeed(Timeframe.FifteenMinutes); - SetupMoneyManagementsSeed(Timeframe.OneHour); - SetupMoneyManagementsSeed(Timeframe.OneDay); + // SetupMoneyManagementsSeed(Timeframe.FiveMinutes); + // SetupMoneyManagementsSeed(Timeframe.FifteenMinutes); + // SetupMoneyManagementsSeed(Timeframe.OneHour); + // SetupMoneyManagementsSeed(Timeframe.OneDay); SetupScenariosSeed(); } catch (Exception ex) @@ -73,20 +70,20 @@ public class SettingsService : ISettingsService return true; } - private async void SetupMoneyManagementsSeed(Timeframe timeframe) - { - var moneyManagement = new MoneyManagement() - { - Timeframe = timeframe, - BalanceAtRisk = 0.05m, - Leverage = 1, - StopLoss = 0.021m, - TakeProfit = 0.042m, - Name = $"{timeframe}-MediumRisk", - }; - - await _moneyManagementService.CreateOrUpdateMoneyManagement(moneyManagement); - } + // private async void SetupMoneyManagementsSeed(Timeframe timeframe) + // { + // var moneyManagement = new MoneyManagement() + // { + // Timeframe = timeframe, + // BalanceAtRisk = 0.05m, + // Leverage = 1, + // StopLoss = 0.021m, + // TakeProfit = 0.042m, + // Name = $"{timeframe}-MediumRisk", + // }; + // + // await _moneyManagementService.CreateOrUpdateMoneyManagement(moneyManagement); + // } private void SetupScenariosSeed() { @@ -190,4 +187,58 @@ public class SettingsService : ISettingsService period: 200); _scenarioService.CreateScenario(name, new List { strategy.Name }); } + + public async Task CreateDefaultConfiguration(User user) + { + try + { + if (user == null) + throw new ArgumentNullException(nameof(user), "User cannot be null"); + + // Create default Money Management + var defaultMoneyManagement = new MoneyManagement + { + Name = "Personal-Hourly", + Timeframe = Timeframe.OneHour, + BalanceAtRisk = 25, // 25% + StopLoss = 2, // 2% + TakeProfit = 4, // 4% + Leverage = 1, + User = user + }; + + // Format the percentage values correctly + defaultMoneyManagement.FormatPercentage(); + + await _moneyManagementService.CreateOrUpdateMoneyManagement(user, defaultMoneyManagement); + + // Create default Strategy (StcTrend) + var defaultStrategy = _scenarioService.CreateStrategyForUser( + user, + StrategyType.Stc, + "Stc", + period: null, + fastPeriods: 23, + slowPeriods: 50, + null, + null, + cyclePeriods: 10 + ); + + // Create default Scenario containing the strategy + var strategyNames = new List { defaultStrategy.Name }; + var defaultScenario = _scenarioService.CreateScenarioForUser( + user, + "STC Scenario", + strategyNames + ); + + return true; + } + catch (Exception ex) + { + _logger.LogError(ex, "Error creating default configuration"); + return false; + } + } } \ No newline at end of file diff --git a/src/Managing.Application/Trading/ClosePositionCommandHandler.cs b/src/Managing.Application/Trading/ClosePositionCommandHandler.cs index 6df511c..24389bb 100644 --- a/src/Managing.Application/Trading/ClosePositionCommandHandler.cs +++ b/src/Managing.Application/Trading/ClosePositionCommandHandler.cs @@ -3,6 +3,9 @@ using Managing.Application.Abstractions.Services; using Managing.Application.Trading.Commands; using Managing.Domain.Shared.Helpers; using Managing.Domain.Trades; +using Microsoft.Extensions.Logging; +using System; +using System.Threading.Tasks; using static Managing.Common.Enums; namespace Managing.Application.Trading; @@ -10,40 +13,51 @@ namespace Managing.Application.Trading; public class ClosePositionCommandHandler( IExchangeService exchangeService, IAccountService accountService, - ITradingService tradingService) + ITradingService tradingService, + ILogger logger = null) : ICommandHandler { public async Task Handle(ClosePositionCommand request) { - // Get Trade - var account = await accountService.GetAccount(request.Position.AccountName, false, false); - if (request.Position == null) + try { - _ = exchangeService.CancelOrder(account, request.Position.Ticker).Result; + // Get Trade + var account = await accountService.GetAccount(request.Position.AccountName, false, false); + if (request.Position == null) + { + _ = exchangeService.CancelOrder(account, request.Position.Ticker).Result; + return request.Position; + } + + var isForPaperTrading = request.Position.Initiator == PositionInitiator.PaperTrading; + + var lastPrice = request.Position.Initiator == PositionInitiator.PaperTrading + ? request.ExecutionPrice.GetValueOrDefault() + : exchangeService.GetPrice(account, request.Position.Ticker, DateTime.UtcNow); + + // Close market + var closedPosition = + await exchangeService.ClosePosition(account, request.Position, lastPrice, isForPaperTrading); + var closeRequestedOrders = + isForPaperTrading || (await exchangeService.CancelOrder(account, request.Position.Ticker)); + + if (closeRequestedOrders || closedPosition.Status == (TradeStatus.PendingOpen | TradeStatus.Filled)) + { + request.Position.Status = PositionStatus.Finished; + request.Position.ProfitAndLoss = + TradingBox.GetProfitAndLoss(request.Position, closedPosition.Quantity, lastPrice, + request.Position.Open.Leverage); + tradingService.UpdatePosition(request.Position); + } + return request.Position; } - - var isForPaperTrading = request.Position.Initiator == PositionInitiator.PaperTrading; - - var lastPrice = request.Position.Initiator == PositionInitiator.PaperTrading - ? request.ExecutionPrice.GetValueOrDefault() - : exchangeService.GetPrice(account, request.Position.Ticker, DateTime.UtcNow); - - // Close market - var closedPosition = - await exchangeService.ClosePosition(account, request.Position, lastPrice, isForPaperTrading); - var closeRequestedOrders = - isForPaperTrading || (await exchangeService.CancelOrder(account, request.Position.Ticker)); - - if (closeRequestedOrders || closedPosition.Status == (TradeStatus.PendingOpen | TradeStatus.Filled)) + catch (Exception ex) { - request.Position.Status = PositionStatus.Finished; - request.Position.ProfitAndLoss = - TradingBox.GetProfitAndLoss(request.Position, closedPosition.Quantity, lastPrice, - request.Position.Open.Leverage); - tradingService.UpdatePosition(request.Position); - } + // Log the error - regardless of the error type + logger?.LogError(ex, "Error closing position: {Message}", ex.Message); - return request.Position; + throw new Exception(ex.Message); + } } } \ No newline at end of file diff --git a/src/Managing.Application/Trading/OpenPositionCommandHandler.cs b/src/Managing.Application/Trading/OpenPositionCommandHandler.cs index 530a927..99d1d2b 100644 --- a/src/Managing.Application/Trading/OpenPositionCommandHandler.cs +++ b/src/Managing.Application/Trading/OpenPositionCommandHandler.cs @@ -18,11 +18,11 @@ namespace Managing.Application.Trading var account = await accountService.GetAccount(request.AccountName, hideSecrets: false, getBalance: false); if (!request.IsForPaperTrading) { - var cancelOrderResult = await exchangeService.CancelOrder(account, request.Ticker); - if (!cancelOrderResult) - { - throw new Exception($"Not able to close all orders for {request.Ticker}"); - } + // var cancelOrderResult = await exchangeService.CancelOrder(account, request.Ticker); + // if (!cancelOrderResult) + // { + // throw new Exception($"Not able to close all orders for {request.Ticker}"); + // } } var initiator = request.IsForPaperTrading ? PositionInitiator.PaperTrading : request.Initiator; @@ -47,63 +47,60 @@ namespace Managing.Application.Trading : tradingService.GetFee(account, request.IsForPaperTrading); var expectedStatus = GetExpectedStatus(request); - position.Open = TradingPolicies.OpenPosition(expectedStatus).Execute( - () => - { - var openPrice = request.IsForPaperTrading || request.Price.HasValue - ? request.Price.Value - : exchangeService.GetBestPrice(account, request.Ticker, price, quantity, request.Direction); + // position.Open = TradingPolicies.OpenPosition(expectedStatus).Execute(async () => { }); - var trade = exchangeService.OpenTrade( - account, - request.Ticker, - request.Direction, - openPrice, - quantity, - request.MoneyManagement.Leverage, - TradeType.Limit, - isForPaperTrading: request.IsForPaperTrading, - currentDate: request.Date).Result; + var openPrice = request.IsForPaperTrading || request.Price.HasValue + ? request.Price.Value + : exchangeService.GetBestPrice(account, request.Ticker, price, quantity, request.Direction); - trade.Fee = TradingHelpers.GetFeeAmount(fee, openPrice * quantity, account.Exchange); - return trade; - }); + // Determine SL/TP Prices + var stopLossPrice = RiskHelpers.GetStopLossPrice(request.Direction, openPrice, request.MoneyManagement); + var takeProfitPrice = RiskHelpers.GetTakeProfitPrice(request.Direction, openPrice, request.MoneyManagement); + var trade = await exchangeService.OpenTrade( + account, + request.Ticker, + request.Direction, + openPrice, + quantity, + request.MoneyManagement.Leverage, + TradeType.Limit, + isForPaperTrading: request.IsForPaperTrading, + currentDate: request.Date, + stopLossPrice: stopLossPrice, // Pass determined SL price + takeProfitPrice: takeProfitPrice); // Pass determined TP price - if (IsOpenTradeHandled(position.Open.Status, account.Exchange) && !request.IgnoreSLTP.GetValueOrDefault()) - { - var closeDirection = request.Direction == TradeDirection.Long - ? TradeDirection.Short - : TradeDirection.Long; + trade.Fee = TradingHelpers.GetFeeAmount(fee, openPrice * quantity, account.Exchange); + position.Open = trade; + + var closeDirection = request.Direction == TradeDirection.Long + ? TradeDirection.Short + : TradeDirection.Long; - // Stop loss - position.StopLoss = exchangeService.BuildEmptyTrade( - request.Ticker, - RiskHelpers.GetStopLossPrice(request.Direction, position.Open.Price, request.MoneyManagement), - position.Open.Quantity, - closeDirection, - request.MoneyManagement.Leverage, - TradeType.StopLoss, - request.Date, - TradeStatus.PendingOpen); + // Stop loss - Use the determined price + position.StopLoss = exchangeService.BuildEmptyTrade( + request.Ticker, + stopLossPrice, // Use determined SL price + position.Open.Quantity, + closeDirection, + request.MoneyManagement.Leverage, + TradeType.StopLoss, + request.Date, + TradeStatus.PendingOpen); - position.StopLoss.Fee = TradingHelpers.GetFeeAmount(fee, - position.StopLoss.Price * position.StopLoss.Quantity, account.Exchange); + position.StopLoss.Fee = TradingHelpers.GetFeeAmount(fee, + position.StopLoss.Price * position.StopLoss.Quantity, account.Exchange); - // Take profit - position.TakeProfit1 = exchangeService.BuildEmptyTrade( - request.Ticker, - RiskHelpers.GetTakeProfitPrice(request.Direction, position.Open.Price, request.MoneyManagement), - quantity, - closeDirection, - request.MoneyManagement.Leverage, - TradeType.TakeProfit, - request.Date, - TradeStatus.PendingOpen); - - position.TakeProfit1.Fee = TradingHelpers.GetFeeAmount(fee, - position.TakeProfit1.Price * position.TakeProfit1.Quantity, account.Exchange); - } + // Take profit - Use the determined price + position.TakeProfit1 = exchangeService.BuildEmptyTrade( + request.Ticker, + takeProfitPrice, // Use determined TP price + quantity, + closeDirection, + request.MoneyManagement.Leverage, + TradeType.TakeProfit, + request.Date, + TradeStatus.PendingOpen); position.Status = IsOpenTradeHandled(position.Open.Status, account.Exchange) ? position.Status diff --git a/src/Managing.Application/Users/UserService.cs b/src/Managing.Application/Users/UserService.cs index dd68be0..a08c5b1 100644 --- a/src/Managing.Application/Users/UserService.cs +++ b/src/Managing.Application/Users/UserService.cs @@ -1,5 +1,6 @@ using Managing.Application.Abstractions.Repositories; using Managing.Application.Abstractions.Services; +using Managing.Common; using Managing.Domain.Accounts; using Managing.Domain.Users; using Microsoft.Extensions.Logging; @@ -42,12 +43,19 @@ public class UserService : IUserService { var recoveredAddress = _evmManager.VerifySignature(signature, message); - if (!authorizedAddresses.Contains(recoveredAddress)) + // Verify message + if (!message.Equals("KaigenTeamXCowchain")) { - _logger.LogWarning($"Address {recoveredAddress} not authorized"); - throw new Exception("Address not authorized"); + _logger.LogWarning($"Message {message} not starting with KaigenTeamXCowchain"); + throw new Exception("Message not good"); } + // if (!authorizedAddresses.Contains(recoveredAddress)) + // { + // _logger.LogWarning($"Address {recoveredAddress} not authorized"); + // throw new Exception("Address not authorized"); + // } + if (recoveredAddress == null || !recoveredAddress.Equals(address)) { _logger.LogWarning($"Address {recoveredAddress} not corresponding"); @@ -55,50 +63,49 @@ public class UserService : IUserService } // Check if account exist - var account = await _accountService.GetAccountByKey(recoveredAddress, true, false); var user = await _userRepository.GetUserByNameAsync(name); - if (account != null && user != null) + if (user != null) { + if (!user.Name.Equals(name)) + throw new Exception("Name not corresponding"); + // User and account found user.Accounts = _accountService.GetAccountsByUser(user).ToList(); - if (!user.Name.Equals(name)) - throw new Exception("Name not corresponding"); + // Check if recoverred address owns the account + var account = user.Accounts.FirstOrDefault(a => a.Key.Equals(recoveredAddress)); + + if (account == null) + { + throw new Exception("Account not found"); + } return user; } else { - // No account and no - account = new Account + // First login + user = new User { - Name = $"Auth-{new Random().Next(1, 99)}", - Key = recoveredAddress, - Secret = "", - Exchange = Common.Enums.TradingExchanges.Evm, - Type = Common.Enums.AccountType.Auth, + Name = name }; - if (user != null) - { - _ = await _accountService.CreateAccount(user, account); - user.Accounts = _accountService.GetAccountsByUser(user).ToList(); - return user; - } - else - { - // No user found, we create one - // Create user if not existing - user = new User() - { - Name = name, - Accounts = new List { account }, - }; + await _userRepository.InsertUserAsync(user); - _ = await _accountService.CreateAccount(user, account); - await _userRepository.InsertUserAsync(user); - } + // Create embedded account to authenticate user + var account = await _accountService.CreateAccount(user, new Account + { + Name = $"{name}-embedded", + Key = recoveredAddress, + Exchange = Enums.TradingExchanges.Evm, + Type = Enums.AccountType.Privy + }); + + user.Accounts = new List() + { + account + }; } return user; diff --git a/src/Managing.Bootstrap/ApiBootstrap.cs b/src/Managing.Bootstrap/ApiBootstrap.cs index c55f4e7..69bd8fb 100644 --- a/src/Managing.Bootstrap/ApiBootstrap.cs +++ b/src/Managing.Bootstrap/ApiBootstrap.cs @@ -135,6 +135,10 @@ public static class ApiBootstrap services.AddSingleton(); services.AddSingleton(); services.AddTransient(); + + // Web3Proxy Configuration + services.Configure(configuration.GetSection("Web3Proxy")); + services.AddTransient(); // Stream services.AddSingleton(); diff --git a/src/Managing.Domain/Accounts/Account.cs b/src/Managing.Domain/Accounts/Account.cs index 1c5b042..1b89e6b 100644 --- a/src/Managing.Domain/Accounts/Account.cs +++ b/src/Managing.Domain/Accounts/Account.cs @@ -6,14 +6,13 @@ namespace Managing.Domain.Accounts; public class Account { - [Required] - public string Name { get; set; } - [Required] - public TradingExchanges Exchange { get; set; } - [Required] - public AccountType Type { get; set; } + [Required] public string Name { get; set; } + [Required] public TradingExchanges Exchange { get; set; } + [Required] public AccountType Type { get; set; } public string Key { get; set; } public string Secret { get; set; } public User User { get; set; } public List Balances { get; set; } + + public bool IsPrivyWallet => Type == AccountType.Privy; } \ No newline at end of file diff --git a/src/Managing.Domain/Backtests/Backtest.cs b/src/Managing.Domain/Backtests/Backtest.cs index 8132467..02d8b77 100644 --- a/src/Managing.Domain/Backtests/Backtest.cs +++ b/src/Managing.Domain/Backtests/Backtest.cs @@ -3,6 +3,7 @@ using Managing.Domain.Candles; using Managing.Domain.MoneyManagements; using Managing.Domain.Strategies; using Managing.Domain.Trades; +using Managing.Domain.Users; using System.ComponentModel.DataAnnotations; using Managing.Domain.Strategies.Base; using static Managing.Common.Enums; @@ -29,6 +30,20 @@ public class Backtest Scenario = scenario; BotType = botType; AccountName = accountName; + WalletBalances = new List>(); + StrategiesValues = new Dictionary(); + + // Initialize start and end dates if candles are provided + if (candles != null && candles.Count > 0) + { + StartDate = candles.Min(c => c.Date); + EndDate = candles.Max(c => c.Date); + } + else + { + StartDate = DateTime.UtcNow.AddDays(-30); + EndDate = DateTime.UtcNow; + } } [Required] public string Id { get; set; } @@ -43,13 +58,15 @@ public class Backtest [Required] public Timeframe Timeframe { get; } [Required] public BotType BotType { get; } [Required] public string AccountName { get; } - [Required] public List Candles { get; } + [Required] public List Candles { get; set; } + [Required] public DateTime StartDate { get; set; } + [Required] public DateTime EndDate { get; set; } [Required] public PerformanceMetrics Statistics { get; set; } [Required] public decimal Fees { get; set; } [Required] public List> WalletBalances { get; set; } [Required] public MoneyManagement OptimizedMoneyManagement { get; set; } [Required] public MoneyManagement MoneyManagement { get; set; } - + [Required] public User User { get; set; } [Required] public Dictionary StrategiesValues { get; set; } [Required] public double Score { get; set; } diff --git a/src/Managing.Domain/Bots/Bot.cs b/src/Managing.Domain/Bots/Bot.cs index e86f8ef..fd8039c 100644 --- a/src/Managing.Domain/Bots/Bot.cs +++ b/src/Managing.Domain/Bots/Bot.cs @@ -1,4 +1,6 @@ -using static Managing.Common.Enums; +using System.Collections.Concurrent; +using Managing.Domain.Users; +using static Managing.Common.Enums; namespace Managing.Domain.Bots { @@ -13,6 +15,7 @@ namespace Managing.Domain.Bots public string Name { get; set; } public int Interval { get; set; } public BotStatus Status { get; set; } + public User User { get; set; } private CancellationTokenSource CancellationToken { get; set; } public Bot(string name) @@ -22,6 +25,7 @@ namespace Managing.Domain.Bots Status = BotStatus.Down; CancellationToken = new CancellationTokenSource(); ExecutionCount = 0; + Interval = 3000; } public virtual void Start() diff --git a/src/Managing.Domain/MoneyManagements/MoneyManagement.cs b/src/Managing.Domain/MoneyManagements/MoneyManagement.cs index 4f6428a..6321941 100644 --- a/src/Managing.Domain/MoneyManagements/MoneyManagement.cs +++ b/src/Managing.Domain/MoneyManagements/MoneyManagement.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Managing.Domain.Users; using static Managing.Common.Enums; namespace Managing.Domain.MoneyManagements @@ -17,6 +18,8 @@ namespace Managing.Domain.MoneyManagements public decimal TakeProfit { get; set; } [Required] public decimal Leverage { get; set; } + + public User User { get; set; } public void FormatPercentage() { diff --git a/src/Managing.Domain/Scenarios/Scenario.cs b/src/Managing.Domain/Scenarios/Scenario.cs index 9f795db..c272e90 100644 --- a/src/Managing.Domain/Scenarios/Scenario.cs +++ b/src/Managing.Domain/Scenarios/Scenario.cs @@ -1,4 +1,5 @@ using Managing.Domain.Strategies; +using Managing.Domain.Users; namespace Managing.Domain.Scenarios { @@ -14,6 +15,7 @@ namespace Managing.Domain.Scenarios public string Name { get; set; } public List Strategies { get; set; } public int? LoopbackPeriod { get; set; } + public User User { get; set; } public void AddStrategy(Strategy strategy) { diff --git a/src/Managing.Domain/Shared/Helpers/TradingBox.cs b/src/Managing.Domain/Shared/Helpers/TradingBox.cs index d953cd2..829f58f 100644 --- a/src/Managing.Domain/Shared/Helpers/TradingBox.cs +++ b/src/Managing.Domain/Shared/Helpers/TradingBox.cs @@ -24,7 +24,7 @@ public static class TradingBox // Ensure limitedCandles is ordered chronologically var orderedCandles = limitedCandles.OrderBy(c => c.Date).ToList(); - var loopback = loopbackPeriod ?? 1; + var loopback = loopbackPeriod.HasValue && loopbackPeriod > 1 ? loopbackPeriod.Value : 1; var candleLoopback = orderedCandles.TakeLast(loopback).ToList(); if (!candleLoopback.Any()) diff --git a/src/Managing.Domain/Strategies/Signal.cs b/src/Managing.Domain/Strategies/Signal.cs index 61f57b2..7200ad5 100644 --- a/src/Managing.Domain/Strategies/Signal.cs +++ b/src/Managing.Domain/Strategies/Signal.cs @@ -1,6 +1,7 @@ using System.ComponentModel.DataAnnotations; using Managing.Core; using Managing.Domain.Candles; +using Managing.Domain.Users; using static Managing.Common.Enums; namespace Managing.Domain.Strategies @@ -18,9 +19,10 @@ namespace Managing.Domain.Strategies [Required] public TradingExchanges Exchange { get; set; } [Required] public StrategyType StrategyType { get; set; } [Required] public SignalType SignalType { get; set; } + public User User { get; set; } public Signal(Ticker ticker, TradeDirection direction, Confidence confidence, Candle candle, DateTime date, - TradingExchanges exchange, StrategyType strategyType, SignalType signalType) + TradingExchanges exchange, StrategyType strategyType, SignalType signalType, User user = null) { Direction = direction; Confidence = confidence; @@ -30,6 +32,7 @@ namespace Managing.Domain.Strategies Exchange = exchange; Status = SignalStatus.WaitingForPosition; StrategyType = strategyType; + User = user; Identifier = $"{StrategyType}-{direction}-{ticker}-{candle?.Close}-{date:yyyyMMdd-HHmmss}"; SignalType = signalType; diff --git a/src/Managing.Domain/Strategies/Strategy.cs b/src/Managing.Domain/Strategies/Strategy.cs index 77dc0a3..f5d37c8 100644 --- a/src/Managing.Domain/Strategies/Strategy.cs +++ b/src/Managing.Domain/Strategies/Strategy.cs @@ -3,6 +3,7 @@ using Managing.Core.FixedSizedQueue; using Managing.Domain.Candles; using Managing.Domain.Scenarios; using Managing.Domain.Strategies.Base; +using Managing.Domain.Users; using static Managing.Common.Enums; namespace Managing.Domain.Strategies @@ -14,6 +15,7 @@ namespace Managing.Domain.Strategies Name = name; Type = type; SignalType = ScenarioHelpers.GetSignalType(type); + Candles = new FixedSizeQueue(500); } public string Name { get; set; } @@ -29,6 +31,7 @@ namespace Managing.Domain.Strategies public int? SmoothPeriods { get; set; } public int? StochPeriods { get; set; } public int? CyclePeriods { get; set; } + public User User { get; set; } public virtual List Run() { diff --git a/src/Managing.Domain/Trades/Position.cs b/src/Managing.Domain/Trades/Position.cs index 52dfa74..6ec798f 100644 --- a/src/Managing.Domain/Trades/Position.cs +++ b/src/Managing.Domain/Trades/Position.cs @@ -1,4 +1,5 @@ using Managing.Domain.MoneyManagements; +using Managing.Domain.Users; using System.ComponentModel.DataAnnotations; using static Managing.Common.Enums; @@ -43,6 +44,7 @@ namespace Managing.Domain.Trades public string Identifier { get; set; } [Required] public PositionInitiator Initiator { get; } + public User User { get; set; } public bool IsFinished() { diff --git a/src/Managing.Infrastructure.Database/BacktestRepository.cs b/src/Managing.Infrastructure.Database/BacktestRepository.cs index 4e569c0..2a726f3 100644 --- a/src/Managing.Infrastructure.Database/BacktestRepository.cs +++ b/src/Managing.Infrastructure.Database/BacktestRepository.cs @@ -1,5 +1,6 @@ using Managing.Application.Abstractions.Repositories; using Managing.Domain.Backtests; +using Managing.Domain.Users; using Managing.Infrastructure.Databases.MongoDb; using Managing.Infrastructure.Databases.MongoDb.Abstractions; using Managing.Infrastructure.Databases.MongoDb.Collections; @@ -15,24 +16,54 @@ public class BacktestRepository : IBacktestRepository _backtestRepository = backtestRepository; } - public void DeleteAllBacktests() + // User-specific operations + public void InsertBacktestForUser(User user, Backtest backtest) { - _backtestRepository.DropCollection(); + backtest.User = user; + _backtestRepository.InsertOne(MongoMappers.Map(backtest)); } - public void DeleteBacktestById(string id) + public IEnumerable GetBacktestsByUser(User user) { - _backtestRepository.DeleteById(id); - } + var backtests = _backtestRepository.AsQueryable() + .Where(b => b.User != null && b.User.Name == user.Name) + .ToList(); - public IEnumerable GetBacktests() - { - var backtests = _backtestRepository.FindAll(); return backtests.Select(b => MongoMappers.Map(b)); } - public void InsertBacktest(Backtest backtest) + public Backtest GetBacktestByIdForUser(User user, string id) { - _backtestRepository.InsertOne(MongoMappers.Map(backtest)); + var backtest = _backtestRepository.FindById(id); + + // Check if backtest exists and belongs to the user + if (backtest != null && backtest.User != null && backtest.User.Name == user.Name) + { + return MongoMappers.Map(backtest); + } + + return null; + } + + public void DeleteBacktestByIdForUser(User user, string id) + { + var backtest = _backtestRepository.FindById(id); + + if (backtest != null && backtest.User != null && backtest.User.Name == user.Name) + { + _backtestRepository.DeleteById(id); + } + } + + public void DeleteAllBacktestsForUser(User user) + { + var backtests = _backtestRepository.AsQueryable() + .Where(b => b.User != null && b.User.Name == user.Name) + .ToList(); + + foreach (var backtest in backtests) + { + _backtestRepository.DeleteById(backtest.Id.ToString()); + } } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Database/CandleRepository.cs b/src/Managing.Infrastructure.Database/CandleRepository.cs index 48c247a..66a951f 100644 --- a/src/Managing.Infrastructure.Database/CandleRepository.cs +++ b/src/Managing.Infrastructure.Database/CandleRepository.cs @@ -45,6 +45,29 @@ public class CandleRepository : ICandleRepository return results; } + public async Task> GetCandles( + TradingExchanges exchange, + Ticker ticker, + Timeframe timeframe, + DateTime start, + DateTime end) + { + var results = await _influxDbRepository.QueryAsync(async query => + { + var flux = $"from(bucket:\"{_priceBucket}\") " + + $"|> range(start: {start:s}Z, stop: {end:s}Z) " + + $"|> filter(fn: (r) => r[\"exchange\"] == \"{exchange}\")" + + $"|> filter(fn: (r) => r[\"ticker\"] == \"{ticker}\")" + + $"|> filter(fn: (r) => r[\"timeframe\"] == \"{timeframe}\")" + + $"|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")"; + + var prices = await query.QueryAsync(flux, _influxDbRepository.Organization); + return prices.Select(price => PriceHelpers.Map(price)).ToList(); + }); + + return results; + } + public async Task> GetTickersAsync( TradingExchanges exchange, Timeframe timeframe, diff --git a/src/Managing.Infrastructure.Database/MongoDb/Collections/BacktestDto.cs b/src/Managing.Infrastructure.Database/MongoDb/Collections/BacktestDto.cs index 73dc12f..303f8fd 100644 --- a/src/Managing.Infrastructure.Database/MongoDb/Collections/BacktestDto.cs +++ b/src/Managing.Infrastructure.Database/MongoDb/Collections/BacktestDto.cs @@ -1,5 +1,6 @@ using Managing.Infrastructure.Databases.MongoDb.Attributes; using Managing.Infrastructure.Databases.MongoDb.Configurations; +using Exilion.TradingAtomics; using static Managing.Common.Enums; namespace Managing.Infrastructure.Databases.MongoDb.Collections @@ -19,8 +20,13 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections public RiskLevel RiskLevel { get; set; } public string AccountName { get; set; } public List Candles { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } public BotType BotType { get; set; } public MoneyManagementDto MoneyManagement { get; internal set; } public MoneyManagementDto OptimizedMoneyManagement { get; internal set; } + public UserDto User { get; set; } + public PerformanceMetrics Statistics { get; set; } + public double Score { get; set; } } } diff --git a/src/Managing.Infrastructure.Database/MongoDb/Collections/MoneyManagementDto.cs b/src/Managing.Infrastructure.Database/MongoDb/Collections/MoneyManagementDto.cs index 7a840d7..e3c7341 100644 --- a/src/Managing.Infrastructure.Database/MongoDb/Collections/MoneyManagementDto.cs +++ b/src/Managing.Infrastructure.Database/MongoDb/Collections/MoneyManagementDto.cs @@ -14,5 +14,6 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections public decimal TakeProfit { get; set; } public decimal Leverage { get; set; } public string Name { get; internal set; } + public UserDto User { get; set; } } -} +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Database/MongoDb/Collections/PositionDto.cs b/src/Managing.Infrastructure.Database/MongoDb/Collections/PositionDto.cs index 63d4890..6ef1dae 100644 --- a/src/Managing.Infrastructure.Database/MongoDb/Collections/PositionDto.cs +++ b/src/Managing.Infrastructure.Database/MongoDb/Collections/PositionDto.cs @@ -23,5 +23,6 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections public string AccountName { get; set; } public MoneyManagementDto MoneyManagement { get; set; } public PositionInitiator Initiator { get; set; } + public UserDto User { get; set; } } } diff --git a/src/Managing.Infrastructure.Database/MongoDb/Collections/ScenarioDto.cs b/src/Managing.Infrastructure.Database/MongoDb/Collections/ScenarioDto.cs index 2593d2d..bca0d3b 100644 --- a/src/Managing.Infrastructure.Database/MongoDb/Collections/ScenarioDto.cs +++ b/src/Managing.Infrastructure.Database/MongoDb/Collections/ScenarioDto.cs @@ -9,5 +9,6 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections public string Name { get; set; } public List Strategies { get; set; } public int LoopbackPeriod { get; set; } + public UserDto User { get; set; } } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Database/MongoDb/Collections/SignalDto.cs b/src/Managing.Infrastructure.Database/MongoDb/Collections/SignalDto.cs index 644b0eb..112b036 100644 --- a/src/Managing.Infrastructure.Database/MongoDb/Collections/SignalDto.cs +++ b/src/Managing.Infrastructure.Database/MongoDb/Collections/SignalDto.cs @@ -17,5 +17,6 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections public Timeframe Timeframe { get; set; } public StrategyType Type { get; set; } public SignalType SignalType { get; set; } + public UserDto User { get; set; } } } diff --git a/src/Managing.Infrastructure.Database/MongoDb/Collections/StrategyDto.cs b/src/Managing.Infrastructure.Database/MongoDb/Collections/StrategyDto.cs index 87d2efd..1fe1e90 100644 --- a/src/Managing.Infrastructure.Database/MongoDb/Collections/StrategyDto.cs +++ b/src/Managing.Infrastructure.Database/MongoDb/Collections/StrategyDto.cs @@ -10,6 +10,7 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections public StrategyType Type { get; set; } public Timeframe Timeframe { get; set; } public string Name { get; set; } + public int MinimumHistory { get; set; } public int? Period { get; set; } public int? FastPeriods { get; set; } public int? SlowPeriods { get; set; } @@ -19,5 +20,6 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections public int? SmoothPeriods { get; set; } public int? CyclePeriods { get; set; } public SignalType SignalType { get; set; } + public UserDto User { get; set; } } } diff --git a/src/Managing.Infrastructure.Database/MongoDb/MongoMappers.cs b/src/Managing.Infrastructure.Database/MongoDb/MongoMappers.cs index b165bf6..32ae323 100644 --- a/src/Managing.Infrastructure.Database/MongoDb/MongoMappers.cs +++ b/src/Managing.Infrastructure.Database/MongoDb/MongoMappers.cs @@ -1,4 +1,5 @@ -using Managing.Domain.Accounts; +using Managing.Core; +using Managing.Domain.Accounts; using Managing.Domain.Backtests; using Managing.Domain.Bots; using Managing.Domain.Candles; @@ -12,6 +13,8 @@ using Managing.Domain.Workers; using Managing.Domain.Workflows.Synthetics; using Managing.Infrastructure.Databases.MongoDb.Collections; using static Managing.Common.Enums; +using MongoDB.Bson; +using Managing.Domain.Shared.Helpers; namespace Managing.Infrastructure.Databases.MongoDb; @@ -126,47 +129,63 @@ public static class MongoMappers internal static Backtest Map(BacktestDto b) { - return new Backtest( - ticker: b.Ticker, - scenario: b.Scenario, - positions: b.Positions.ConvertAll(bPosition => Map(bPosition)), - signals: b.Signals != null ? b.Signals.ConvertAll(bSignal => Map(bSignal)) : null, - timeframe: b.Timeframe, - candles: b.Candles.ConvertAll(bCandle => Map(bCandle)), - accountName: b.AccountName, - botType: b.BotType) + if (b == null) + return null; + + var bTest = new Backtest( + b.Ticker, + b.Scenario, + b.Positions?.Select(p => Map(p)).ToList() ?? new List(), + b.Signals?.Select(s => Map(s)).ToList() ?? new List(), + b.Timeframe, + b.Candles?.Select(c => Map(c)).ToList() ?? new List(), + b.BotType, + b.AccountName) { - Id = b.Id.ToString(), FinalPnl = b.FinalPnl, WinRate = b.WinRate, GrowthPercentage = b.GrowthPercentage, HodlPercentage = b.HodlPercentage, + Id = b.Id.ToString(), MoneyManagement = Map(b.MoneyManagement), - OptimizedMoneyManagement = Map(b.OptimizedMoneyManagement) + OptimizedMoneyManagement = Map(b.OptimizedMoneyManagement), + User = b.User != null ? Map(b.User) : null, + Statistics = b.Statistics, + StartDate = b.StartDate, + EndDate = b.EndDate, + Score = b.Score }; + + return bTest; } internal static BacktestDto Map(Backtest result) { - var backtest = new BacktestDto + if (result == null) + return null; + + return new BacktestDto { + Id = (!string.IsNullOrEmpty(result.Id)) ? ObjectId.Parse(result.Id) : ObjectId.GenerateNewId(), FinalPnl = result.FinalPnl, WinRate = result.WinRate, GrowthPercentage = result.GrowthPercentage, HodlPercentage = result.HodlPercentage, - Candles = Map(result.Candles), Positions = Map(result.Positions), + Signals = result.Signals.Select(s => Map(s)).ToList(), + Ticker = result.Ticker, + Scenario = result.Scenario, AccountName = result.AccountName, BotType = result.BotType, + Timeframe = result.Timeframe, MoneyManagement = Map(result.MoneyManagement), OptimizedMoneyManagement = Map(result.OptimizedMoneyManagement), + User = result.User != null ? Map(result.User) : null, + Statistics = result.Statistics, + StartDate = result.StartDate, + EndDate = result.EndDate, + Score = result.Score }; - - backtest.Timeframe = result.Timeframe; - backtest.Ticker = result.Ticker; - backtest.Scenario = result.Scenario; - - return backtest; } #endregion @@ -237,7 +256,8 @@ public static class MongoMappers AccountName = position.AccountName, MoneyManagement = Map(position.MoneyManagement), Initiator = position.Initiator, - Ticker = position.Ticker + Ticker = position.Ticker, + User = position.User != null ? Map(position.User) : null }; if (position.StopLoss != null) @@ -284,7 +304,8 @@ public static class MongoMappers ProfitAndLoss = new ProfitAndLoss { Realized = dto.ProfitAndLoss }, Status = dto.Status, SignalIdentifier = dto.SignalIdentifier, - Identifier = dto.Identifier + Identifier = dto.Identifier, + User = dto.User != null ? Map(dto.User) : null }; if (dto.StopLoss != null) @@ -327,26 +348,42 @@ public static class MongoMappers { return new SignalDto { - Identifier = signal.Identifier, Direction = signal.Direction, - Candle = Map(signal.Candle), Confidence = signal.Confidence, Date = signal.Date, + Candle = Map(signal.Candle), + Identifier = signal.Identifier, Ticker = signal.Ticker, Status = signal.Status, Timeframe = signal.Timeframe, - Type = signal.StrategyType + Type = signal.StrategyType, + User = signal.User != null ? Map(signal.User) : null }; } internal static Signal Map(SignalDto bSignal) { - return new Signal(ticker: bSignal.Ticker, direction: bSignal.Direction, confidence: bSignal.Confidence, - candle: Map(bSignal.Candle), date: bSignal.Date, exchange: default, - strategyType: bSignal.Type, signalType: bSignal.SignalType) + var candle = Map(bSignal.Candle); + var signal = new Signal( + bSignal.Ticker, + bSignal.Direction, + bSignal.Confidence, + candle, + bSignal.Date, + TradingExchanges.Binance, //TODO FIXME When the signal status is modified from controller + bSignal.Type, + bSignal.SignalType, + bSignal.User != null ? Map(bSignal.User) : null) { Status = bSignal.Status }; + + if (bSignal.User != null) + { + signal.User = Map(bSignal.User); + } + + return signal; } #endregion @@ -355,11 +392,15 @@ public static class MongoMappers public static ScenarioDto Map(Scenario scenario) { - return new ScenarioDto() + if (scenario == null) + return null; + + return new ScenarioDto { Name = scenario.Name, Strategies = Map(scenario.Strategies), - LoopbackPeriod = scenario.LoopbackPeriod ?? 1 + LoopbackPeriod = scenario.LoopbackPeriod ?? 1, + User = scenario.User != null ? Map(scenario.User) : null }; } @@ -370,12 +411,15 @@ public static class MongoMappers internal static Scenario Map(ScenarioDto d) { - return new Scenario(d.Name) + if (d == null) + return null; + + var scenario = new Scenario(d.Name, d.LoopbackPeriod) { - Name = d.Name, - Strategies = Map(d.Strategies).ToList(), - LoopbackPeriod = d.LoopbackPeriod > 0 ? d.LoopbackPeriod : 1 + Strategies = d.Strategies.Select(s => Map(s)).ToList(), + User = d.User != null ? Map(d.User) : null }; + return scenario; } private static List Map(List strategies) @@ -385,8 +429,13 @@ public static class MongoMappers internal static Strategy Map(StrategyDto strategyDto) { - return new Strategy(name: strategyDto.Name, type: strategyDto.Type) + if (strategyDto == null) + return null; + + return new Strategy(strategyDto.Name, strategyDto.Type) { + SignalType = strategyDto.SignalType, + MinimumHistory = strategyDto.MinimumHistory, Period = strategyDto.Period, FastPeriods = strategyDto.FastPeriods, SlowPeriods = strategyDto.SlowPeriods, @@ -395,64 +444,31 @@ public static class MongoMappers SmoothPeriods = strategyDto.SmoothPeriods, StochPeriods = strategyDto.StochPeriods, CyclePeriods = strategyDto.CyclePeriods, - SignalType = strategyDto.SignalType + User = strategyDto.User != null ? Map(strategyDto.User) : null }; } internal static StrategyDto Map(Strategy strategy) { - var dto = new StrategyDto + if (strategy == null) + return null; + + return new StrategyDto { - Type = strategy.Type, Name = strategy.Name, + Type = strategy.Type, SignalType = strategy.SignalType, - CyclePeriods = strategy.CyclePeriods, - FastPeriods = strategy.FastPeriods, - Multiplier = strategy.Multiplier, + MinimumHistory = strategy.MinimumHistory, Period = strategy.Period, - SignalPeriods = strategy.SignalPeriods, + FastPeriods = strategy.FastPeriods, SlowPeriods = strategy.SlowPeriods, + SignalPeriods = strategy.SignalPeriods, + Multiplier = strategy.Multiplier, SmoothPeriods = strategy.SmoothPeriods, - StochPeriods = strategy.StochPeriods + StochPeriods = strategy.StochPeriods, + CyclePeriods = strategy.CyclePeriods, + User = strategy.User != null ? Map(strategy.User) : null }; - - // switch (strategy.Type) - // { - // case StrategyType.RsiDivergenceConfirm: - // case StrategyType.RsiDivergence: - // case StrategyType.EmaCross: - // case StrategyType.EmaTrend: - // case StrategyType.StDev: - // dto.Period = strategy.Period; - // break; - // case StrategyType.MacdCross: - // dto.SlowPeriods = strategy.SlowPeriods; - // dto.FastPeriods = strategy.FastPeriods; - // dto.SignalPeriods = strategy.SignalPeriods; - // break; - // case StrategyType.ThreeWhiteSoldiers: - // break; - // case StrategyType.ChandelierExit: - // case StrategyType.SuperTrend: - // dto.Period = strategy.Period; - // dto.Multiplier = strategy.Multiplier; - // break; - // case StrategyType.StochRsiTrend: - // dto.Period = strategy.Period; - // dto.StochPeriods = strategy.StochPeriods; - // dto.SignalPeriods = strategy.SignalPeriods; - // dto.SmoothPeriods = strategy.SmoothPeriods; - // break; - // case StrategyType.Stc: - // dto.SlowPeriods = strategy.SlowPeriods; - // dto.FastPeriods = strategy.FastPeriods; - // dto.CyclePeriods = strategy.CyclePeriods; - // break; - // default: - // break; - // } - - return dto; } internal static IEnumerable Map(IEnumerable strategies) @@ -474,7 +490,8 @@ public static class MongoMappers StopLoss = request.StopLoss, TakeProfit = request.TakeProfit, Leverage = request.Leverage, - Name = request.Name + Name = request.Name, + User = request.User != null ? Map(request.User) : null }; } @@ -490,7 +507,8 @@ public static class MongoMappers StopLoss = request.StopLoss, TakeProfit = request.TakeProfit, Leverage = request.Leverage, - Name = request.Name + Name = request.Name, + User = request.User != null ? Map(request.User) : null }; } diff --git a/src/Managing.Infrastructure.Database/SettingsRepository.cs b/src/Managing.Infrastructure.Database/SettingsRepository.cs index c1a1570..dc9c29e 100644 --- a/src/Managing.Infrastructure.Database/SettingsRepository.cs +++ b/src/Managing.Infrastructure.Database/SettingsRepository.cs @@ -1,5 +1,6 @@ using Managing.Application.Abstractions.Repositories; using Managing.Domain.MoneyManagements; +using Managing.Domain.Users; using Managing.Infrastructure.Databases.MongoDb; using Managing.Infrastructure.Databases.MongoDb.Abstractions; using Managing.Infrastructure.Databases.MongoDb.Collections; @@ -50,4 +51,49 @@ public class SettingsRepository : ISettingsRepository dto.Id = mm.Id; _moneyManagementRepository.Update(dto); } + + // User-specific implementations + public async Task GetMoneyManagementByUser(User user, string name) + { + var moneyManagement = await _moneyManagementRepository.FindOneAsync(m => + m.Name == name && + m.User != null && + m.User.Name == user.Name); + + return MongoMappers.Map(moneyManagement); + } + + public IEnumerable GetMoneyManagementsByUser(User user) + { + var moneyManagements = _moneyManagementRepository.AsQueryable() + .Where(m => m.User != null && m.User.Name == user.Name) + .ToList(); + + return moneyManagements.Select(m => MongoMappers.Map(m)); + } + + public void DeleteMoneyManagementByUser(User user, string name) + { + var moneyManagement = _moneyManagementRepository.FindOne(m => + m.Name == name && + m.User != null && + m.User.Name == user.Name); + + if (moneyManagement != null) + { + _moneyManagementRepository.DeleteById(moneyManagement.Id.ToString()); + } + } + + public void DeleteMoneyManagementsByUser(User user) + { + var moneyManagements = _moneyManagementRepository.AsQueryable() + .Where(m => m.User != null && m.User.Name == user.Name) + .ToList(); + + foreach (var moneyManagement in moneyManagements) + { + _moneyManagementRepository.DeleteById(moneyManagement.Id.ToString()); + } + } } diff --git a/src/Managing.Infrastructure.Database/TradingRepository.cs b/src/Managing.Infrastructure.Database/TradingRepository.cs index dc18f3f..71c2050 100644 --- a/src/Managing.Infrastructure.Database/TradingRepository.cs +++ b/src/Managing.Infrastructure.Database/TradingRepository.cs @@ -2,6 +2,7 @@ using Managing.Domain.Scenarios; using Managing.Domain.Strategies; using Managing.Domain.Trades; +using Managing.Domain.Users; using Managing.Infrastructure.Databases.MongoDb; using Managing.Infrastructure.Databases.MongoDb.Abstractions; using Managing.Infrastructure.Databases.MongoDb.Collections; @@ -100,23 +101,98 @@ public class TradingRepository : ITradingRepository public void InsertPosition(Position position) { - _positionRepository.InsertOne(MongoMappers.Map(position)); + // Check if position already exists for the same user + var existingPosition = _positionRepository.FindOne(p => + p.Identifier == position.Identifier && + (position.User == null || (p.User != null && p.User.Name == position.User.Name))); + + if (existingPosition != null) + { + throw new InvalidOperationException( + $"Position with identifier '{position.Identifier}' already exists for user '{position.User?.Name}'"); + } + + var dto = MongoMappers.Map(position); + _positionRepository.InsertOne(dto); } public void InsertScenario(Scenario scenario) { - _scenarioRepository.CreateIndex(nameof(Scenario.Name)); - _scenarioRepository.InsertOne(MongoMappers.Map(scenario)); + // Check if scenario already exists for the same user + var existingScenario = _scenarioRepository.FindOne(s => + s.Name == scenario.Name && + (scenario.User == null || (s.User != null && s.User.Name == scenario.User.Name))); + + if (existingScenario != null) + { + throw new InvalidOperationException( + $"Scenario with name '{scenario.Name}' already exists for user '{scenario.User?.Name}'"); + } + + var strategyDtos = new List(); + foreach (var strategy in scenario.Strategies) + { + var dto = _strategyRepository.FindOne(s => s.Name == strategy.Name); + strategyDtos.Add(dto); + } + + var scenarioDto = new ScenarioDto + { + Name = scenario.Name, + Strategies = strategyDtos, + User = scenario.User != null ? MongoMappers.Map(scenario.User) : null + }; + + _scenarioRepository.InsertOne(scenarioDto); } public void InsertSignal(Signal signal) { - _signalRepository.InsertOne(MongoMappers.Map(signal)); + // Check if signal already exists with the same identifier, date, and user + var existingSignal = _signalRepository.FindOne(s => + s.Identifier == signal.Identifier && + s.Date == signal.Date && + ((s.User == null && signal.User == null) || + (s.User != null && signal.User != null && s.User.Name == signal.User.Name))); + + if (existingSignal != null) + { + throw new InvalidOperationException( + $"Signal with identifier '{signal.Identifier}' and date '{signal.Date}' already exists for this user"); + } + + var dto = MongoMappers.Map(signal); + _signalRepository.InsertOne(dto); } public void InsertStrategy(Strategy strategy) { - _strategyRepository.InsertOne(MongoMappers.Map(strategy)); + // Check if strategy already exists for the same user + var existingStrategy = _strategyRepository.FindOne(s => + s.Name == strategy.Name && + (strategy.User == null || (s.User != null && s.User.Name == strategy.User.Name))); + + if (existingStrategy != null) + { + throw new InvalidOperationException( + $"Strategy with name '{strategy.Name}' already exists for user '{strategy.User?.Name}'"); + } + + var dto = MongoMappers.Map(strategy); + _strategyRepository.InsertOne(dto); + } + + public void InsertFee(Fee fee) + { + // Check if fee for this exchange already exists (fee is global, not user-specific) + var existingFee = _feeRepository.FindOne(f => f.Exchange == fee.Exchange); + if (existingFee != null) + { + throw new InvalidOperationException($"Fee for exchange '{fee.Exchange}' already exists"); + } + + var dto = MongoMappers.Map(fee); + _feeRepository.InsertOne(dto); } public void UpdatePosition(Position position) @@ -133,9 +209,41 @@ public class TradingRepository : ITradingRepository return MongoMappers.Map(fee); } - public void InsertFee(Fee fee) + public IEnumerable GetSignalsByUser(User user) { - _feeRepository.InsertOne(MongoMappers.Map(fee)); + IEnumerable signals; + + if (user == null) + { + signals = _signalRepository.FilterBy(s => s.User == null); + } + else + { + signals = _signalRepository.FilterBy(s => s.User != null && s.User.Name == user.Name); + } + + return signals.Select(MongoMappers.Map); + } + + public Signal GetSignalByIdentifier(string identifier, User user = null) + { + SignalDto signal; + + if (user == null) + { + signal = _signalRepository.FindOne(s => + s.Identifier == identifier && + s.User == null); + } + else + { + signal = _signalRepository.FindOne(s => + s.Identifier == identifier && + s.User != null && + s.User.Name == user.Name); + } + + return MongoMappers.Map(signal); } public void UpdateFee(Fee fee) diff --git a/src/Managing.Infrastructure.Database/UserRepository.cs b/src/Managing.Infrastructure.Database/UserRepository.cs index b74647f..35f4633 100644 --- a/src/Managing.Infrastructure.Database/UserRepository.cs +++ b/src/Managing.Infrastructure.Database/UserRepository.cs @@ -25,4 +25,19 @@ public class UserRepository : IUserRepository { await _userRepository.InsertOneAsync(MongoMappers.Map(user)); } -} + + public async Task UpdateUser(User user) + { + try + { + var dto = await _userRepository.FindOneAsync(u => u.Name == user.Name); + dto.Name = user.Name; + _userRepository.Update(dto); + } + catch (Exception e) + { + Console.WriteLine(e); + throw new Exception("Cannot update user"); + } + } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Evm/Models/Privy/PrivyApproveTokenResponse.cs b/src/Managing.Infrastructure.Evm/Models/Privy/PrivyApproveTokenResponse.cs new file mode 100644 index 0000000..a5e460d --- /dev/null +++ b/src/Managing.Infrastructure.Evm/Models/Privy/PrivyApproveTokenResponse.cs @@ -0,0 +1,8 @@ +namespace Managing.Infrastructure.Evm.Models.Privy; + +public class PrivyApproveTokenResponse +{ + public bool Success { get; set; } + public string? Hash { get; set; } + public string? Error { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Evm/Models/Privy/PrivyInitAddressResponse.cs b/src/Managing.Infrastructure.Evm/Models/Privy/PrivyInitAddressResponse.cs new file mode 100644 index 0000000..012d1fa --- /dev/null +++ b/src/Managing.Infrastructure.Evm/Models/Privy/PrivyInitAddressResponse.cs @@ -0,0 +1,9 @@ +namespace Managing.Infrastructure.Evm.Models.Privy; + +public class PrivyInitAddressResponse +{ + public bool Success { get; set; } + public string? UsdcHash { get; set; } + public string? OrderVaultHash { get; set; } + public string? Error { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Exchanges/Abstractions/IExchangeProcessor.cs b/src/Managing.Infrastructure.Exchanges/Abstractions/IExchangeProcessor.cs index b7193e7..14cd416 100644 --- a/src/Managing.Infrastructure.Exchanges/Abstractions/IExchangeProcessor.cs +++ b/src/Managing.Infrastructure.Exchanges/Abstractions/IExchangeProcessor.cs @@ -22,7 +22,9 @@ public interface IExchangeProcessor bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, - bool ioc = true); + bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null); Task GetBalance(Account account, bool isForPaperTrading = false); Task> GetBalances(Account account, bool isForPaperTrading = false); decimal GetPrice(Account account, Ticker ticker, DateTime date); diff --git a/src/Managing.Infrastructure.Exchanges/ExchangeService.cs b/src/Managing.Infrastructure.Exchanges/ExchangeService.cs index e3d6d6a..8c8808b 100644 --- a/src/Managing.Infrastructure.Exchanges/ExchangeService.cs +++ b/src/Managing.Infrastructure.Exchanges/ExchangeService.cs @@ -37,10 +37,12 @@ namespace Managing.Infrastructure.Exchanges bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, - bool ioc = true) + bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null) { _logger.LogInformation( - $"OpenMarketTrade - {ticker} - Type: {tradeType} - {direction} - Price: {price} - Quantity: {quantity} - Leverage: {leverage}"); + $"OpenMarketTrade - {ticker} - Type: {tradeType} - {direction} - Price: {price} - Quantity: {quantity} - Leverage: {leverage} - SL: {stopLossPrice} - TP: {takeProfitPrice}"); if (isForPaperTrading) { @@ -50,7 +52,7 @@ namespace Managing.Infrastructure.Exchanges var processor = GetProcessor(account); return await processor.OpenTrade(account, ticker, direction, price, quantity, leverage, tradeType, - reduceOnly, isForPaperTrading, currentDate, ioc); + reduceOnly, isForPaperTrading, currentDate, ioc, stopLossPrice, takeProfitPrice); } private IExchangeProcessor GetProcessor(Account account) @@ -205,6 +207,13 @@ namespace Managing.Infrastructure.Exchanges return candlesFromRepo.ToList(); } + public async Task> GetCandlesInflux(TradingExchanges exchange, Ticker ticker, DateTime startDate, + Timeframe timeframe, DateTime endDate) + { + var candlesFromRepo = await _candleRepository.GetCandles(exchange, ticker, timeframe, startDate, endDate); + return candlesFromRepo.ToList(); + } + public async Task GetBalance(Account account, bool isForPaperTrading = false) { if (isForPaperTrading) diff --git a/src/Managing.Infrastructure.Exchanges/Exchanges/BaseProcessor.cs b/src/Managing.Infrastructure.Exchanges/Exchanges/BaseProcessor.cs index dd91d07..bed80ef 100644 --- a/src/Managing.Infrastructure.Exchanges/Exchanges/BaseProcessor.cs +++ b/src/Managing.Infrastructure.Exchanges/Exchanges/BaseProcessor.cs @@ -22,7 +22,20 @@ namespace Managing.Infrastructure.Exchanges.Exchanges public abstract Task GetTrade(Account account, string order, Ticker ticker); public abstract Task> GetTrades(Account account, Ticker ticker); public abstract decimal GetVolume(Account account, Ticker ticker); - public abstract Task OpenTrade(Account account, Ticker ticker, TradeDirection direction, decimal price, decimal quantity, decimal? leverage = null, Enums.TradeType tradeType = Enums.TradeType.Limit, bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, bool ioc = true); + public abstract Task OpenTrade( + Account account, + Ticker ticker, + TradeDirection direction, + decimal price, + decimal quantity, + decimal? leverage = null, + TradeType tradeType = TradeType.Limit, + bool reduceOnly = false, + bool isForPaperTrading = false, + DateTime? currentDate = null, + bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null); public abstract Orderbook GetOrderbook(Account account, Ticker ticker); public abstract Task> GetBalances(Account account, bool isForPaperTrading = false); public abstract Task> GetOrders(Account account, Ticker ticker); diff --git a/src/Managing.Infrastructure.Exchanges/Exchanges/BinanceProcessor.cs b/src/Managing.Infrastructure.Exchanges/Exchanges/BinanceProcessor.cs index 2c2253a..cdaa216 100644 --- a/src/Managing.Infrastructure.Exchanges/Exchanges/BinanceProcessor.cs +++ b/src/Managing.Infrastructure.Exchanges/Exchanges/BinanceProcessor.cs @@ -27,7 +27,8 @@ public class BinanceProcessor : BaseProcessor public override async Task CancelOrder(Account account, Ticker ticker) { - var binanceResult = await _binanceClient.UsdFuturesApi.Trading.CancelAllOrdersAsync(BinanceHelpers.ToBinanceTicker(ticker)); + var binanceResult = + await _binanceClient.UsdFuturesApi.Trading.CancelAllOrdersAsync(BinanceHelpers.ToBinanceTicker(ticker)); return binanceResult.Success; } @@ -41,6 +42,7 @@ public class BinanceProcessor : BaseProcessor { balance += item.AvailableBalance; } + return balance; } @@ -54,12 +56,15 @@ public class BinanceProcessor : BaseProcessor throw new NotImplementedException(); } - public override async Task> GetCandles(Account account, Ticker ticker, DateTime startDate, Timeframe timeframe) + public override async Task> GetCandles(Account account, Ticker ticker, DateTime startDate, + Timeframe timeframe) { - var binanceCandles = await _binanceClient.UsdFuturesApi.ExchangeData.GetKlinesAsync(BinanceHelpers.ToBinanceTicker(ticker), - BinanceHelpers.Map(timeframe), startDate); + var binanceCandles = await _binanceClient.UsdFuturesApi.ExchangeData.GetKlinesAsync( + BinanceHelpers.ToBinanceTicker(ticker), + BinanceHelpers.Map(timeframe), startDate); - return (List)binanceCandles.Data.Select(binanceKline => BinanceHelpers.Map(binanceKline, ticker, account.Exchange)); + return (List)binanceCandles.Data.Select(binanceKline => + BinanceHelpers.Map(binanceKline, ticker, account.Exchange)); } public override decimal GetFee(Account account, bool isForPaperTrading = false) @@ -79,7 +84,8 @@ public class BinanceProcessor : BaseProcessor public override decimal GetPrice(Account account, Ticker ticker, DateTime date) { - var binancePrice = _binanceClient.UsdFuturesApi.ExchangeData.GetPriceAsync(BinanceHelpers.ToBinanceTicker(ticker)).Result.Data; + var binancePrice = _binanceClient.UsdFuturesApi.ExchangeData + .GetPriceAsync(BinanceHelpers.ToBinanceTicker(ticker)).Result.Data; return binancePrice.Price; } @@ -90,7 +96,9 @@ public class BinanceProcessor : BaseProcessor public override async Task GetTrade(Account account, string order, Ticker ticker) { - var binanceOrder = await _binanceClient.UsdFuturesApi.Trading.GetOrderAsync(BinanceHelpers.ToBinanceTicker(ticker), origClientOrderId: order); + var binanceOrder = + await _binanceClient.UsdFuturesApi.Trading.GetOrderAsync(BinanceHelpers.ToBinanceTicker(ticker), + origClientOrderId: order); return BinanceHelpers.Map(binanceOrder.Data); } @@ -107,7 +115,7 @@ public class BinanceProcessor : BaseProcessor public override async Task> GetTrades(Account account, Ticker ticker) { var binanceOrder = - await _binanceClient.UsdFuturesApi.Trading.GetOrdersAsync(BinanceHelpers.ToBinanceTicker(ticker)); + await _binanceClient.UsdFuturesApi.Trading.GetOrdersAsync(BinanceHelpers.ToBinanceTicker(ticker)); return (List)binanceOrder.Data.Select(o => BinanceHelpers.Map(o)); } @@ -122,9 +130,14 @@ public class BinanceProcessor : BaseProcessor _binanceClient = new BinanceRestClient((options) => { options.ApiCredentials = credentials; }); } - public override async Task OpenTrade(Account account, Ticker ticker, TradeDirection direction, decimal price, decimal quantity, decimal? leverage = null, TradeType tradeType = TradeType.Limit, bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, bool ioc = true) + public override async Task OpenTrade(Account account, Ticker ticker, TradeDirection direction, decimal price, + decimal quantity, decimal? leverage = null, TradeType tradeType = TradeType.Limit, bool reduceOnly = false, + bool isForPaperTrading = false, DateTime? currentDate = null, bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null) { - var trade = new Trade(DateTime.Now, direction, TradeStatus.PendingOpen, tradeType, ticker, quantity, price, leverage, "", ""); + var trade = new Trade(DateTime.Now, direction, TradeStatus.PendingOpen, tradeType, ticker, quantity, price, + leverage, "", ""); trade.SetQuantity(quantity, GetQuantityPrecision(account, ticker)); trade.SetPrice(price, GetPricePrecision(account, ticker)); @@ -158,6 +171,7 @@ public class BinanceProcessor : BaseProcessor trade.SetExchangeOrderId(""); trade.SetMessage(""); } + return trade; } @@ -172,7 +186,8 @@ public class BinanceProcessor : BaseProcessor private int GetQuantityPrecision(Account account, Ticker ticker) { var binanceFutureInfo = _binanceClient.UsdFuturesApi.ExchangeData.GetExchangeInfoAsync().Result.Data; - var precision = binanceFutureInfo.Symbols.Single(p => p.Name == BinanceHelpers.ToBinanceTicker(ticker)).QuantityPrecision; + var precision = binanceFutureInfo.Symbols.Single(p => p.Name == BinanceHelpers.ToBinanceTicker(ticker)) + .QuantityPrecision; return Convert.ToInt32(precision); } -} +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Exchanges/Exchanges/EvmProcessor.cs b/src/Managing.Infrastructure.Exchanges/Exchanges/EvmProcessor.cs index b5c087e..f05e8be 100644 --- a/src/Managing.Infrastructure.Exchanges/Exchanges/EvmProcessor.cs +++ b/src/Managing.Infrastructure.Exchanges/Exchanges/EvmProcessor.cs @@ -67,7 +67,8 @@ public class EvmProcessor : BaseProcessor return _evmManager.GetCandle(SubgraphProvider.Gbc, ticker).Result; } - public override async Task> GetCandles(Account account, Ticker ticker, DateTime startDate, Timeframe interval) + public override async Task> GetCandles(Account account, Ticker ticker, DateTime startDate, + Timeframe interval) { return await _evmManager.GetCandles(SubgraphProvider.Gbc, ticker, startDate, interval); } @@ -119,7 +120,9 @@ public class EvmProcessor : BaseProcessor bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, - bool ioc = true) + bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null) { Trade trade; if (reduceOnly) @@ -128,7 +131,8 @@ public class EvmProcessor : BaseProcessor or TradeType.StopLoss) { // If trade type is TP or SL we create DecreaseOrder - trade = await _evmManager.DecreaseOrder(account, tradeType, ticker, direction, price, quantity, leverage); + trade = await _evmManager.DecreaseOrder(account, tradeType, ticker, direction, price, quantity, + leverage); } else { @@ -140,24 +144,23 @@ public class EvmProcessor : BaseProcessor } else { - trade = await _evmManager.IncreasePosition(account, ticker, direction, price, quantity, leverage); + trade = await _evmManager.IncreasePosition(account, ticker, direction, price, quantity, leverage, + stopLossPrice, takeProfitPrice); } - return trade; + return trade; } public override async Task> GetOrders(Account account, Ticker ticker) { return await _evmManager.GetOrders(account, ticker); - } - #region Not implemented public override void LoadClient(Account account) - { + { // No client needed throw new NotImplementedException(); } @@ -175,4 +178,4 @@ public class EvmProcessor : BaseProcessor } #endregion -} +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Exchanges/Exchanges/FtxProcessor.cs b/src/Managing.Infrastructure.Exchanges/Exchanges/FtxProcessor.cs index d088a61..e870e52 100644 --- a/src/Managing.Infrastructure.Exchanges/Exchanges/FtxProcessor.cs +++ b/src/Managing.Infrastructure.Exchanges/Exchanges/FtxProcessor.cs @@ -53,6 +53,7 @@ public class FtxProcessor : BaseProcessor { balance += item.UsdValue; } + return balance; } @@ -61,7 +62,7 @@ public class FtxProcessor : BaseProcessor LoadClient(account); var ftxKlines = _ftxClient.TradeApi.ExchangeData.GetKlinesAsync(FtxHelpers.ToFtxTicker(ticker), - FTX.Net.Enums.KlineInterval.OneMinute, date.AddHours(-2.5)).Result.Data; + FTX.Net.Enums.KlineInterval.OneMinute, date.AddHours(-2.5)).Result.Data; if (ftxKlines != null && ftxKlines.Any()) { var lastCandle = ftxKlines.ToList().LastOrDefault(); @@ -71,16 +72,18 @@ public class FtxProcessor : BaseProcessor return null; } - public override async Task> GetCandles(Account account, Ticker ticker, DateTime startDate, Timeframe timeframe) + public override async Task> GetCandles(Account account, Ticker ticker, DateTime startDate, + Timeframe timeframe) { LoadClient(account); var candles = new List(); var ftxCandles = await _ftxClient.TradeApi.ExchangeData.GetKlinesAsync(FtxHelpers.ToFtxTicker(ticker), - FtxHelpers.Map(timeframe), startDate); + FtxHelpers.Map(timeframe), startDate); if (ftxCandles.Success) - candles.AddRange(ftxCandles.Data.SkipLast(1).Select(ftxKline => FtxHelpers.Map(ftxKline, ticker, account.Exchange, timeframe))); + candles.AddRange(ftxCandles.Data.SkipLast(1) + .Select(ftxKline => FtxHelpers.Map(ftxKline, ticker, account.Exchange, timeframe))); return candles; } @@ -96,11 +99,12 @@ public class FtxProcessor : BaseProcessor { LoadClient(account); var ftxKlines = _ftxClient.TradeApi.ExchangeData.GetKlinesAsync(FtxHelpers.ToFtxTicker(ticker), - FTX.Net.Enums.KlineInterval.OneMinute, date.AddHours(-2.5)).Result.Data; + FTX.Net.Enums.KlineInterval.OneMinute, date.AddHours(-2.5)).Result.Data; if (ftxKlines != null && ftxKlines.Any()) { return ftxKlines.ToList().LastOrDefault().ClosePrice; } + return 0; } @@ -126,29 +130,36 @@ public class FtxProcessor : BaseProcessor public override decimal GetVolume(Account account, Ticker ticker) { - var futureStats = _ftxClient.TradeApi.ExchangeData.GetFutureStatsAsync(FtxHelpers.ToFtxTicker(ticker)).Result.Data; + var futureStats = _ftxClient.TradeApi.ExchangeData.GetFutureStatsAsync(FtxHelpers.ToFtxTicker(ticker)).Result + .Data; return futureStats.Volume; } - public override async Task OpenTrade(Account account, Ticker ticker, TradeDirection direction, decimal price, decimal quantity, decimal? leverage = null, TradeType tradeType = TradeType.Limit, bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, bool ioc = true) + public override async Task OpenTrade(Account account, Ticker ticker, TradeDirection direction, decimal price, + decimal quantity, decimal? leverage = null, TradeType tradeType = TradeType.Limit, bool reduceOnly = false, + bool isForPaperTrading = false, DateTime? currentDate = null, bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null) { LoadClient(account); - var trade = new Trade(DateTime.Now, direction, TradeStatus.PendingOpen, tradeType, ticker, quantity, price, leverage, "", ""); + var trade = new Trade(DateTime.Now, direction, TradeStatus.PendingOpen, tradeType, ticker, quantity, price, + leverage, "", ""); trade.SetQuantity(quantity, 6); Trade ftxOrder; - if (tradeType == TradeType.StopLoss || tradeType == TradeType.TakeProfitLimit || tradeType == TradeType.StopMarket) + if (tradeType == TradeType.StopLoss || tradeType == TradeType.TakeProfitLimit || + tradeType == TradeType.StopMarket) { var ftxTriggerOrderType = FtxHelpers.FtxTriggerOrderTypeMap(tradeType); var ftxResult = await _ftxClient.TradeApi.Trading.PlaceTriggerOrderAsync(FtxHelpers.ToFtxTicker(ticker), - direction != TradeDirection.Long ? FTX.Net.Enums.OrderSide.Sell : FTX.Net.Enums.OrderSide.Buy, - ftxTriggerOrderType, - triggerPrice: price, - reduceOnly: true, - retryUntilFilled: false, - quantity: quantity); + direction != TradeDirection.Long ? FTX.Net.Enums.OrderSide.Sell : FTX.Net.Enums.OrderSide.Buy, + ftxTriggerOrderType, + triggerPrice: price, + reduceOnly: true, + retryUntilFilled: false, + quantity: quantity); _logger.LogInformation("Exchange result : {0}", JsonConvert.SerializeObject(ftxResult)); ftxOrder = FtxHelpers.Map(ftxResult, leverage); } @@ -177,7 +188,8 @@ public class FtxProcessor : BaseProcessor public override Orderbook GetOrderbook(Account account, Ticker ticker) { LoadClient(account); - var ftxOrderBook = _ftxClient.TradeApi.ExchangeData.GetOrderBookAsync(FtxHelpers.ToFtxTicker(ticker), 100).Result; + var ftxOrderBook = _ftxClient.TradeApi.ExchangeData.GetOrderBookAsync(FtxHelpers.ToFtxTicker(ticker), 100) + .Result; return FtxHelpers.Map(ftxOrderBook); } @@ -200,4 +212,4 @@ public class FtxProcessor : BaseProcessor { throw new NotImplementedException(); } -} +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Exchanges/Exchanges/KrakenProcessor.cs b/src/Managing.Infrastructure.Exchanges/Exchanges/KrakenProcessor.cs index d36f868..071739a 100644 --- a/src/Managing.Infrastructure.Exchanges/Exchanges/KrakenProcessor.cs +++ b/src/Managing.Infrastructure.Exchanges/Exchanges/KrakenProcessor.cs @@ -23,6 +23,7 @@ public class KrakenProcessor : BaseProcessor { _logger = logger; } + public override Task CancelOrder(Account account, Ticker ticker) { throw new NotImplementedException(); @@ -48,7 +49,8 @@ public class KrakenProcessor : BaseProcessor throw new NotImplementedException(); } - public override Task> GetCandles(Account account, Ticker ticker, DateTime startDate, Timeframe interval) + public override Task> GetCandles(Account account, Ticker ticker, DateTime startDate, + Timeframe interval) { throw new NotImplementedException(); } @@ -72,7 +74,7 @@ public class KrakenProcessor : BaseProcessor { LoadClient(account); var krakenKline = _krakenClient.SpotApi.ExchangeData.GetKlinesAsync(ticker.ToString(), - Kraken.Net.Enums.KlineInterval.OneMinute, date).Result.Data.Data.ToList()[0]; + Kraken.Net.Enums.KlineInterval.OneMinute, date).Result.Data.Data.ToList()[0]; return (krakenKline.HighPrice + krakenKline.ClosePrice) / 2; } @@ -120,10 +122,15 @@ public class KrakenProcessor : BaseProcessor _krakenClient = new KrakenRestClient((options) => { options.ApiCredentials = krakenConfig.ApiCredentials; }); } - public override async Task OpenTrade(Account account, Ticker ticker, TradeDirection direction, decimal price, decimal quantity, decimal? leverage = null, TradeType tradeType = TradeType.Limit, bool reduceOnly = false, bool isForPaperTrading = false, DateTime? currentDate = null, bool ioc = true) + public override async Task OpenTrade(Account account, Ticker ticker, TradeDirection direction, decimal price, + decimal quantity, decimal? leverage = null, TradeType tradeType = TradeType.Limit, bool reduceOnly = false, + bool isForPaperTrading = false, DateTime? currentDate = null, bool ioc = true, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null) { LoadClient(account); - var trade = new Trade(DateTime.Now, direction, TradeStatus.PendingOpen, tradeType, ticker, quantity, price, leverage, "", ""); + var trade = new Trade(DateTime.Now, direction, TradeStatus.PendingOpen, tradeType, ticker, quantity, price, + leverage, "", ""); trade.SetQuantity(quantity, 6); trade.SetPrice(price, 1); @@ -141,4 +148,4 @@ public class KrakenProcessor : BaseProcessor trade.SetMessage(krakenOrderExecuted.Message); return trade; } -} +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Messengers/Discord/DiscordService.cs b/src/Managing.Infrastructure.Messengers/Discord/DiscordService.cs index 92dc870..b0cf1f7 100644 --- a/src/Managing.Infrastructure.Messengers/Discord/DiscordService.cs +++ b/src/Managing.Infrastructure.Messengers/Discord/DiscordService.cs @@ -9,6 +9,7 @@ using Managing.Application.Trading.Commands; using Managing.Application.Workers.Abstractions; using Managing.Common; using Managing.Core; +using Managing.Domain.MoneyManagements; using Managing.Domain.Statistics; using Managing.Domain.Trades; using Microsoft.Extensions.Hosting; @@ -262,9 +263,12 @@ namespace Managing.Infrastructure.Messengers.Discord var accountService = (IAccountService)_services.GetService(typeof(IAccountService)); var tradingService = (ITradingService)_services.GetService(typeof(ITradingService)); + // Create default user for Discord bot operations + var defaultUser = new Domain.Users.User { Name = "DiscordBot" }; + var tradeCommand = new OpenPositionRequest( accountName, - await moneyManagementService.GetMoneyMangement(moneyManagement), + await moneyManagementService.GetMoneyMangement(defaultUser, moneyManagement), direction, ticker, initiator, @@ -403,8 +407,21 @@ namespace Managing.Infrastructure.Messengers.Discord var builder = new ComponentBuilder(); var moneyManagementService = (IMoneyManagementService)_services.GetService(typeof(IMoneyManagementService)); - var moneyManagements = moneyManagementService.GetMoneyMangements(); + // var moneyManagements = moneyManagementService.GetMoneyMangements(); + // TODO Update this to get the money management from the account + var moneyManagements = new List + { + new MoneyManagement + { + Name = "MediumRisk", + BalanceAtRisk = 0.05m, + Leverage = 1, + StopLoss = 0.021m, + TakeProfit = 0.042m, + Timeframe = Timeframe.FifteenMinutes + } + }; foreach (var mm in moneyManagements) { var data = new CopyTradeData diff --git a/src/Managing.Infrastructure.MongoDb/Attributes/BsonCollectionAttribute.cs b/src/Managing.Infrastructure.MongoDb/Attributes/BsonCollectionAttribute.cs deleted file mode 100644 index 3a5b35d..0000000 --- a/src/Managing.Infrastructure.MongoDb/Attributes/BsonCollectionAttribute.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Managing.Infrastructure.MongoDb.Attributes -{ - [AttributeUsage(AttributeTargets.Class, Inherited = false)] - public class BsonCollectionAttribute : Attribute - { - public string CollectionName { get; } - - public BsonCollectionAttribute(string collectionName) - { - CollectionName = collectionName; - } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/AccountDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/AccountDto.cs deleted file mode 100644 index 6d82cde..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/AccountDto.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections; - -[BsonCollection("Accounts")] -public class AccountDto : Document -{ - public string Name { get; set; } - public Exchanges Exchanges { get; set; } - public string Key { get; set; } - public string Secret { get; set; } -} \ No newline at end of file diff --git a/src/Managing.Infrastructure.MongoDb/Collections/BacktestDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/BacktestDto.cs deleted file mode 100644 index e0e6c81..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/BacktestDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("Backtests")] - public class BacktestDto : Document - { - public decimal FinalPnl { get; set; } - public int WinRate { get; set; } - public decimal GrowthPercentage { get; set; } - public decimal HodlPercentage { get; set; } - public string Ticker { get; set; } - public string Scenario { get; set; } - public List Positions { get; set; } - public List Signals { get; set; } - public Timeframe Timeframe { get; set; } - public RiskLevel RiskLevel { get; set; } - public string AccountName { get; set; } - public List Candles { get; set; } - public BotType BotType { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/CandleDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/CandleDto.cs deleted file mode 100644 index a0d8f03..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/CandleDto.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using MongoDB.Bson.Serialization.Attributes; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("Candles")] - public class CandleDto : Document - { - public Exchanges Exchange { get; set; } - public Timeframe Timeframe { get; set; } - public string Ticker { get; set; } - [BsonDateTimeOptions] - public DateTime OpenTime { get; set; } - [BsonDateTimeOptions] - public DateTime CloseTime { get; set; } - public decimal Open { get; set; } - public decimal Close { get; set; } - public decimal High { get; set; } - public decimal Low { get; set; } - public decimal BaseVolume { get; set; } - public decimal QuoteVolume { get; set; } - public int TradeCount { get; set; } - public decimal TakerBuyBaseVolume { get; set; } - public decimal TakerBuyQuoteVolume { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/MoneyManagementDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/MoneyManagementDto.cs deleted file mode 100644 index 11bf506..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/MoneyManagementDto.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("MoneyManagement")] - public class MoneyManagementDto : Document - { - public Timeframe Timeframe { get; set; } - public RiskLevel RiskLevel { get; set; } - public decimal BalanceAtRisk { get; set; } - public decimal StopLoss { get; set; } - public decimal TakeProfit { get; set; } - public decimal QuantityTakeProfit { get; set; } - public decimal Leverage { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/PositionDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/PositionDto.cs deleted file mode 100644 index e6837f8..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/PositionDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using MongoDB.Bson.Serialization.Attributes; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("Positions")] - public class PositionDto : Document - { - [BsonDateTimeOptions] - public DateTime Date { get; set; } - public TradeDto Open { get; set; } - public TradeDto StopLoss { get; set; } - public TradeDto TakeProfit1 { get; set; } - public TradeDto TakeProfit2 { get; set; } - public decimal ProfitAndLoss { get; set; } - public TradeDirection OriginDirection { get; set; } - public string Identifier { get; set; } - public TradeStatus Status { get; set; } - public string SignalIdentifier { get; set; } - public string AccountName { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/ScenarioDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/ScenarioDto.cs deleted file mode 100644 index fa51ba7..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/ScenarioDto.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("Scenarios")] - public class ScenarioDto : Document - { - public string Name { get; set; } - public List Strategies { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/SignalDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/SignalDto.cs deleted file mode 100644 index ba20b5f..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/SignalDto.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("Signals")] - public class SignalDto : Document - { - public TradeDirection Direction { get; set; } - public Confidence Confidence { get; set; } - public DateTime Date { get; set; } - public CandleDto Candle { get; set; } - public string Identifier { get; set; } - public string Ticker { get; set; } - public SignalStatus Status { get; set; } - public Timeframe Timeframe { get; set; } - public StrategyType Type { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/StrategyDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/StrategyDto.cs deleted file mode 100644 index 3335df6..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/StrategyDto.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("Strategies")] - public class StrategyDto : Document - { - public StrategyType Type { get; set; } - public string Name { get; set; } - public int? Period { get; set; } - public int? FastPeriods { get; set; } - public int? SlowPeriods { get; set; } - public int? SignalPeriods { get; set; } - public double? Multiplier { get; set; } - public int? StochPeriods { get; set; } - public int? SmoothPeriods { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/TopVolumeTickerDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/TopVolumeTickerDto.cs deleted file mode 100644 index 20813f0..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/TopVolumeTickerDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections; - -[BsonCollection("TopVolumeTickers")] -public class TopVolumeTickerDto : Document -{ - public Ticker Ticker { get; set; } - public DateTime Date { get; set; } - public decimal Volume { get; set; } - public int Rank { get; set; } - public Exchanges Exchange { get; set; } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/TradeDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/TradeDto.cs deleted file mode 100644 index 8e6afa0..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/TradeDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using MongoDB.Bson.Serialization.Attributes; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections -{ - [BsonCollection("Trades")] - public class TradeDto : Document - { - [BsonDateTimeOptions] - public DateTime Date { get; set; } - public TradeDirection Direction { get; set; } - public TradeStatus Status { get; set; } - public TradeType TradeType { get; set; } - public string Ticker { get; set; } - public decimal Fee { get; set; } - public decimal Quantity { get; set; } - public decimal Price { get; set; } - public decimal Leverage { get; set; } - public string ExchangeOrderId { get; set; } - public string Message { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Collections/WorkerDto.cs b/src/Managing.Infrastructure.MongoDb/Collections/WorkerDto.cs deleted file mode 100644 index 7abcc36..0000000 --- a/src/Managing.Infrastructure.MongoDb/Collections/WorkerDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using static Managing.Common.Enums; - -namespace Managing.Infrastructure.MongoDb.Collections; - -[BsonCollection("Workers")] -public class WorkerDto : Document -{ - public WorkerType WorkerType { get; set; } - public DateTime StartTime { get; set; } - public DateTime? LastRunTime { get; set; } - public int ExecutionCount { get; set; } - public TimeSpan Delay { get; set; } -} diff --git a/src/Managing.Infrastructure.MongoDb/Configurations/Document.cs b/src/Managing.Infrastructure.MongoDb/Configurations/Document.cs deleted file mode 100644 index c0e04dd..0000000 --- a/src/Managing.Infrastructure.MongoDb/Configurations/Document.cs +++ /dev/null @@ -1,13 +0,0 @@ -using MongoDB.Bson; -using MongoDB.Bson.Serialization.Attributes; - -namespace Managing.Infrastructure.MongoDb.Configurations -{ - public abstract class Document : IDocument - { - [BsonId] - public ObjectId Id { get; set; } - [BsonDateTimeOptions] - public DateTime CreatedAt => Id.CreationTime; - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Configurations/IDocument.cs b/src/Managing.Infrastructure.MongoDb/Configurations/IDocument.cs deleted file mode 100644 index 85e74b3..0000000 --- a/src/Managing.Infrastructure.MongoDb/Configurations/IDocument.cs +++ /dev/null @@ -1,14 +0,0 @@ -using MongoDB.Bson; -using MongoDB.Bson.Serialization.Attributes; - -namespace Managing.Infrastructure.MongoDb.Configurations -{ - public interface IDocument - { - [BsonId] - [BsonRepresentation(BsonType.String)] - ObjectId Id { get; set; } - - DateTime CreatedAt { get; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Configurations/IManagingDatabaseSettings.cs b/src/Managing.Infrastructure.MongoDb/Configurations/IManagingDatabaseSettings.cs deleted file mode 100644 index 9d57568..0000000 --- a/src/Managing.Infrastructure.MongoDb/Configurations/IManagingDatabaseSettings.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Managing.Infrastructure.MongoDb -{ - public interface IManagingDatabaseSettings - { - string ConnectionString { get; set; } - string DatabaseName { get; set; } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Configurations/ManagingDatabaseSettings.cs b/src/Managing.Infrastructure.MongoDb/Configurations/ManagingDatabaseSettings.cs deleted file mode 100644 index 9235ffb..0000000 --- a/src/Managing.Infrastructure.MongoDb/Configurations/ManagingDatabaseSettings.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Managing.Infrastructure.MongoDb; - -public class ManagingDatabaseSettings : IManagingDatabaseSettings -{ - public string ConnectionString { get; set; } - public string DatabaseName { get; set; } -} diff --git a/src/Managing.Infrastructure.MongoDb/IMongoRepository.cs b/src/Managing.Infrastructure.MongoDb/IMongoRepository.cs deleted file mode 100644 index 93a8836..0000000 --- a/src/Managing.Infrastructure.MongoDb/IMongoRepository.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Managing.Infrastructure.MongoDb.Configurations; -using System.Linq.Expressions; - -namespace Managing.Infrastructure.MongoDb -{ - public interface IMongoRepository where TDocument : IDocument - { - IQueryable AsQueryable(); - - IEnumerable FilterBy( - Expression> filterExpression); - - IEnumerable FindAll(); - - IEnumerable FilterBy( - Expression> filterExpression, - Expression> projectionExpression); - - TDocument FindOne(Expression> filterExpression); - - Task FindOneAsync(Expression> filterExpression); - - TDocument FindById(string id); - - Task FindByIdAsync(string id); - - void InsertOne(TDocument document); - - Task InsertOneAsync(TDocument document); - - void InsertMany(ICollection documents); - - Task InsertManyAsync(ICollection documents); - - void ReplaceOne(TDocument document); - - Task ReplaceOneAsync(TDocument document); - - void DeleteOne(Expression> filterExpression); - - Task DeleteOneAsync(Expression> filterExpression); - - void DeleteById(string id); - - Task DeleteByIdAsync(string id); - - void DeleteMany(Expression> filterExpression); - - Task DeleteManyAsync(Expression> filterExpression); - - void Update(TDocument entity); - void CreateIndex(string column); - void DropCollection(); - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Managing.Infrastructure.MongoDb.csproj b/src/Managing.Infrastructure.MongoDb/Managing.Infrastructure.MongoDb.csproj deleted file mode 100644 index 08d004f..0000000 --- a/src/Managing.Infrastructure.MongoDb/Managing.Infrastructure.MongoDb.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - AnyCPU;x64 - - - - - - - - - - - - diff --git a/src/Managing.Infrastructure.MongoDb/MongoHelpers.cs b/src/Managing.Infrastructure.MongoDb/MongoHelpers.cs deleted file mode 100644 index 0dbf2c0..0000000 --- a/src/Managing.Infrastructure.MongoDb/MongoHelpers.cs +++ /dev/null @@ -1,20 +0,0 @@ -using MongoDB.Bson; -using MongoDB.Driver; - -namespace Managing.Infrastructure.MongoDb -{ - public static class MongoHelpers - { - public static async Task EnsureIndexExists(this IMongoDatabase database, string collectionName, string indexName) - { - var collection = database.GetCollection(collectionName); - var index = new BsonDocument - { - {indexName, 1} - }; - - var indexModel = new CreateIndexModel(index, new CreateIndexOptions { Unique = true }); - await collection.Indexes.CreateOneAsync(indexModel).ConfigureAwait(false); - } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/MongoRepository.cs b/src/Managing.Infrastructure.MongoDb/MongoRepository.cs deleted file mode 100644 index 9ac0086..0000000 --- a/src/Managing.Infrastructure.MongoDb/MongoRepository.cs +++ /dev/null @@ -1,173 +0,0 @@ -using Managing.Infrastructure.MongoDb.Attributes; -using Managing.Infrastructure.MongoDb.Configurations; -using MongoDB.Bson; -using MongoDB.Driver; -using System.Linq.Expressions; - -namespace Managing.Infrastructure.MongoDb -{ - public class MongoRepository : IMongoRepository - where TDocument : IDocument - { - private readonly IMongoCollection _collection; - private readonly IMongoDatabase _database; - - public MongoRepository(IManagingDatabaseSettings settings) - { - _database = new MongoClient(settings.ConnectionString).GetDatabase(settings.DatabaseName); - _collection = _database.GetCollection(GetCollectionName(typeof(TDocument))); - } - - private protected string GetCollectionName(Type documentType) - { - return ((BsonCollectionAttribute)documentType.GetCustomAttributes( - typeof(BsonCollectionAttribute), - true) - .FirstOrDefault())?.CollectionName; - } - - public virtual IQueryable AsQueryable() - { - return _collection.AsQueryable(); - } - - public virtual IEnumerable FilterBy( - Expression> filterExpression) - { - return _collection.Find(filterExpression).ToEnumerable(); - } - - public virtual IEnumerable FindAll() - { - return _collection.Find(_ => true).ToEnumerable(); - } - - public virtual IEnumerable FilterBy( - Expression> filterExpression, - Expression> projectionExpression) - { - return _collection.Find(filterExpression).Project(projectionExpression).ToEnumerable(); - } - - public virtual TDocument FindOne(Expression> filterExpression) - { - return _collection.Find(filterExpression).FirstOrDefault(); - } - - public virtual Task FindOneAsync(Expression> filterExpression) - { - return Task.Run(() => _collection.Find(filterExpression).FirstOrDefaultAsync()); - } - - public virtual TDocument FindById(string id) - { - var objectId = new ObjectId(id); - var filter = Builders.Filter.Eq(doc => doc.Id, objectId); - return _collection.Find(filter).SingleOrDefault(); - } - - public virtual Task FindByIdAsync(string id) - { - return Task.Run(() => - { - var objectId = new ObjectId(id); - var filter = Builders.Filter.Eq(doc => doc.Id, objectId); - return _collection.Find(filter).SingleOrDefaultAsync(); - }); - } - - - public virtual void InsertOne(TDocument document) - { - _collection.InsertOne(document); - } - - public virtual Task InsertOneAsync(TDocument document) - { - return Task.Run(() => _collection.InsertOneAsync(document)); - } - - public void InsertMany(ICollection documents) - { - _collection.InsertMany(documents); - } - - public void DropCollection() - { - _database.DropCollection(GetCollectionName(typeof(TDocument))); - } - - public virtual async Task InsertManyAsync(ICollection documents) - { - await _collection.InsertManyAsync(documents); - } - - public void ReplaceOne(TDocument document) - { - var filter = Builders.Filter.Eq(doc => doc.Id, document.Id); - _collection.FindOneAndReplace(filter, document); - } - - public virtual async Task ReplaceOneAsync(TDocument document) - { - var filter = Builders.Filter.Eq(doc => doc.Id, document.Id); - await _collection.FindOneAndReplaceAsync(filter, document); - } - - public void Update(TDocument entity) - { - if (entity.Id == ObjectId.Empty) - { - entity.Id = ObjectId.GenerateNewId(); - } - - var option = new ReplaceOptions { IsUpsert = true }; - _collection.ReplaceOne(x => entity != null && x.Id == entity.Id, entity, option); - } - - public void DeleteOne(Expression> filterExpression) - { - _collection.FindOneAndDelete(filterExpression); - } - - public Task DeleteOneAsync(Expression> filterExpression) - { - return Task.Run(() => _collection.FindOneAndDeleteAsync(filterExpression)); - } - - public void DeleteById(string id) - { - var objectId = new ObjectId(id); - var filter = Builders.Filter.Eq(doc => doc.Id, objectId); - _collection.FindOneAndDelete(filter); - } - - public Task DeleteByIdAsync(string id) - { - return Task.Run(() => - { - var objectId = new ObjectId(id); - var filter = Builders.Filter.Eq(doc => doc.Id, objectId); - _collection.FindOneAndDeleteAsync(filter); - }); - } - - public void DeleteMany(Expression> filterExpression) - { - _collection.DeleteMany(filterExpression); - } - - public Task DeleteManyAsync(Expression> filterExpression) - { - return _collection.DeleteManyAsync(filterExpression); - } - - public virtual void CreateIndex(string column) - { - var keys = Builders.IndexKeys.Ascending(column); - var indexOptions = new CreateIndexOptions { Unique = true }; - var model = new CreateIndexModel(keys, indexOptions); - _collection.Indexes.CreateOne(model); - } - } -} diff --git a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/MoneyManagement.bson.gz b/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/MoneyManagement.bson.gz deleted file mode 100644 index cb79d13..0000000 Binary files a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/MoneyManagement.bson.gz and /dev/null differ diff --git a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/MoneyManagement.metadata.json.gz b/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/MoneyManagement.metadata.json.gz deleted file mode 100644 index cf75afd..0000000 Binary files a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/MoneyManagement.metadata.json.gz and /dev/null differ diff --git a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Scenarios.bson.gz b/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Scenarios.bson.gz deleted file mode 100644 index eb949a5..0000000 Binary files a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Scenarios.bson.gz and /dev/null differ diff --git a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Scenarios.metadata.json.gz b/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Scenarios.metadata.json.gz deleted file mode 100644 index c98ef8b..0000000 Binary files a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Scenarios.metadata.json.gz and /dev/null differ diff --git a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Strategies.bson.gz b/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Strategies.bson.gz deleted file mode 100644 index 03393fe..0000000 Binary files a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Strategies.bson.gz and /dev/null differ diff --git a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Strategies.metadata.json.gz b/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Strategies.metadata.json.gz deleted file mode 100644 index 743fc31..0000000 Binary files a/src/Managing.Infrastructure.MongoDb/Seeds/ManagingDb/Strategies.metadata.json.gz and /dev/null differ diff --git a/src/Managing.Infrastructure.Tests/EvmManagerTests.cs b/src/Managing.Infrastructure.Tests/EvmManagerTests.cs index 25631ba..f4bce72 100644 --- a/src/Managing.Infrastructure.Tests/EvmManagerTests.cs +++ b/src/Managing.Infrastructure.Tests/EvmManagerTests.cs @@ -4,7 +4,9 @@ using Managing.Common; using Managing.Domain.Evm; using Managing.Infrastructure.Evm; using Managing.Infrastructure.Evm.Abstractions; +using Managing.Infrastructure.Evm.Models.Privy; using Managing.Infrastructure.Evm.Services; +using Microsoft.Extensions.Options; using Microsoft.VisualStudio.TestTools.UnitTesting; using Nethereum.Contracts; using Nethereum.Contracts.Standards.ERC721.ContractDefinition; @@ -21,19 +23,23 @@ public class EvmManagerTests private readonly List _chains; public List Subgraphs; - public readonly string PublicAddress = ""; + public readonly IWeb3ProxyService _web3Proxy; + public readonly string PublicAddress = "0x932167388dd9aad41149b3ca23ebd489e2e2dd78"; public EvmManagerTests() { - _manager = new EvmManager(Subgraphs); + // Use the helper method to create Web3ProxyService + _web3Proxy = CreateWebProxyService(); + + _manager = new EvmManager(Subgraphs, _web3Proxy); _chains = ChainService.GetChains(); } [Fact] public void Should_construct_manager() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); Assert.IsType(manager); } @@ -63,7 +69,7 @@ public class EvmManagerTests [InlineData("0xa435530d50d7D17Fd9fc6E1c897Dbf7C08E12d35", "0x17f4BAa9D35Ee54fFbCb2608e20786473c7aa49f")] public async Task Should_return_event_transfer_nft(string owner, string contract) { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var holders = await manager.GetNftEvent(owner, contract); Assert.IsType>>(holders); Assert.True(holders.Any()); @@ -74,7 +80,7 @@ public class EvmManagerTests [Fact] public async Task Should_return_date_of_block() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var date = await manager.GetBlockDate(38793245); Assert.Equal(new DateTime(2022, 11, 17, 11, 15, 33), date); } @@ -86,7 +92,7 @@ public class EvmManagerTests var address = "0x94618601FE6cb8912b274E5a00453949A57f8C1e"; var privateKey = "0x7580e7fb49df1c861f0050fae31c2224c6aba908e116b8da44ee8cd927b990b0"; - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var signature = manager.SignMessage(message, privateKey); var addressRecovered = manager.VerifySignature(signature, message); @@ -97,7 +103,7 @@ public class EvmManagerTests [Fact] public void Shoud_return_generated_evm_address() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var keys = manager.GenerateAddress(); Assert.IsType<(string Key, string Secret)>(keys); @@ -109,7 +115,7 @@ public class EvmManagerTests public void Should_return_correct_account_for_mnemo() { var mnemo = "twist enemy flame exchange summer roast beyond friend image pyramid topple need"; - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var publicAddress = "0x3aBAD913A70554f416944F1a4C0EAbF3BCAFB959"; var address = manager.GetAddressFromMnemo(mnemo); Assert.NotNull(address); @@ -123,7 +129,7 @@ public class EvmManagerTests // [InlineData("0x7002AE0Bae7fC67416230F025A32EfE086C0934E", Constants.Chains.Arbitrum)] public async Task Should_return_balances(string publicAddress, string chainName) { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var chain = _chains.First(c => c.Name == chainName); var balances = await manager.GetBalances(chain, 0, 500, publicAddress); @@ -137,7 +143,7 @@ public class EvmManagerTests [InlineData("0xc62F5499789b716Aa94a421A60c76c8c13A31ab6", Constants.Chains.Ethereum)] public async Task Should_return_all_balance(string publicAddress, string chainName) { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var chain = _chains.First(c => c.Name == chainName); var balances = await manager.GetAllBalances(chain, publicAddress); @@ -150,7 +156,7 @@ public class EvmManagerTests [InlineData("", Constants.Chains.Arbitrum, Ticker.GMX)] public async void Should_return_token_balance(string publicAddress, string chainName, Ticker ticker) { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var balance = await manager.GetTokenBalance(chainName, ticker, publicAddress); Assert.IsType(balance); @@ -162,7 +168,7 @@ public class EvmManagerTests [InlineData("")] public async Task Should_return_balance_of_ethers(string publicAddress) { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var chain = _chains.First(c => c.Name == Constants.Chains.Ethereum); var balance = await manager.GetEtherBalance(chain, publicAddress); @@ -174,7 +180,7 @@ public class EvmManagerTests [InlineData("")] public async Task Should_return_all_balance_for_all_chain(string publicAddress) { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var balances = await manager.GetAllBalancesOnAllChain(publicAddress); Assert.IsType>(balances); @@ -186,7 +192,7 @@ public class EvmManagerTests [InlineData(Ticker.BTC, Timeframe.FiveMinutes)] public async Task Get_Prices(Ticker ticker, Timeframe timeframe) { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var candles = await manager.GetCandles(SubgraphProvider.ChainlinkPrice, ticker, DateTime.UtcNow, timeframe); if (!candles.Any()) @@ -202,7 +208,7 @@ public class EvmManagerTests [Fact] public async Task Get_Available_Tickers() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var tickers = await manager.GetAvailableTicker(); Assert.NotEmpty(tickers); @@ -212,7 +218,7 @@ public class EvmManagerTests [Fact] public async Task GetLastCandle() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var candle = await manager.GetCandle(SubgraphProvider.Gbc, Ticker.BTC); Assert.NotNull(candle); @@ -222,8 +228,8 @@ public class EvmManagerTests [Fact] public async Task Should_Init_Address_For_Trading() { - var manager = new EvmManager(Subgraphs); - var accountInitilized = await manager.InitAddress(Constants.Chains.Arbitrum, PublicAddress, "PrivateKey"); + var manager = new EvmManager(Subgraphs, _web3Proxy); + var accountInitilized = await manager.InitAddress(PublicAddress); Assert.True(accountInitilized); } @@ -232,7 +238,7 @@ public class EvmManagerTests [Fact] public async Task Should_send_eth_from_account() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var chain = _chains.First(c => c.Name == Constants.Chains.Arbitrum); var balance = await manager.GetEtherBalance(chain, PublicAddress); // Update receiver @@ -252,7 +258,7 @@ public class EvmManagerTests [Fact] public async Task Should_send_Gmx_from_account() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var chain = _chains.First(c => c.Name == Constants.Chains.Arbitrum); var receiverAddress = ""; var balance = await manager.GetTokenBalance(chain.Name, Ticker.GMX, PublicAddress); @@ -272,7 +278,7 @@ public class EvmManagerTests [Fact] public async Task Should_return_allowance() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var account = PrivateKeys.GetAccount(); var allowance = await manager.GetAllowance(account.Key, Ticker.USDC); @@ -283,13 +289,13 @@ public class EvmManagerTests [Fact] public async Task Should_set_allowance() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, _web3Proxy); var account = PrivateKeys.GetAccount(); // Get amount from balance var balance = await manager.GetTokenBalance(Constants.Chains.Arbitrum, Ticker.USDC, account.Key); - var result = await manager.SetAllowance(account, Ticker.USDC, new BigInteger(balance.Balance)); + var result = await manager.SetAllowance(account, Ticker.USDC, new BigInteger(10)); Assert.True(result); } @@ -300,4 +306,25 @@ public class EvmManagerTests await EvmBase.GetGasPrice(new Web3(_chains.First(c => c.Name == Constants.Chains.Arbitrum).RpcUrl)); Assert.True(result > 0); } + + [Fact] + public async Task Should_Sign_Message_Embedded_Account() + { + var message = "Hello eth"; + var walletId = "cm7vxs99f0007blcl8cmzv74t"; + var address = "0x932167388dD9aad41149b3cA23eBD489E2E2DD78"; + + var manager = new EvmManager(Subgraphs, _web3Proxy); + var signature = await manager.SignMessageAsync(walletId, address, message); + + Assert.NotNull(signature); + } + + // Helper method to create Web3ProxyService for tests + public static IWeb3ProxyService CreateWebProxyService(string baseUrl = "http://localhost:4111/api/") + { + var settings = new Web3ProxySettings { BaseUrl = baseUrl }; + var options = Options.Create(settings); + return new Web3ProxyService(options); + } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Tests/ExchangeServicesTests.cs b/src/Managing.Infrastructure.Tests/ExchangeServicesTests.cs index 62b6ccb..cd1dced 100644 --- a/src/Managing.Infrastructure.Tests/ExchangeServicesTests.cs +++ b/src/Managing.Infrastructure.Tests/ExchangeServicesTests.cs @@ -4,6 +4,8 @@ using Managing.Domain.Candles; using Managing.Domain.Trades; using Managing.Infrastructure.Evm; using Managing.Infrastructure.Evm.Abstractions; +using Managing.Infrastructure.Evm.Models.Privy; +using Managing.Infrastructure.Evm.Services; using Managing.Infrastructure.Exchanges; using Managing.Infrastructure.Exchanges.Abstractions; using Managing.Infrastructure.Exchanges.Exchanges; @@ -13,6 +15,7 @@ using Moq; using Xunit; using static Managing.Common.Enums; using Ticker = Managing.Common.Enums.Ticker; +using Microsoft.Extensions.Options; namespace Managing.Infrastructure.Tests { @@ -27,7 +30,7 @@ namespace Managing.Infrastructure.Tests { ILoggerFactory doesntDoMuch = new NullLoggerFactory(); var candleRepository = new Mock().Object; - var evmManager = new EvmManager(Subgraphs); + var evmManager = new EvmManager(Subgraphs, EvmManagerTests.CreateWebProxyService()); var evmProcessor = new EvmProcessor(new Mock>().Object, evmManager); var exchangeProcessors = new List() { diff --git a/src/Managing.Infrastructure.Tests/GmxServiceTests.cs b/src/Managing.Infrastructure.Tests/GmxServiceTests.cs index 2b3dcec..bf3c7a1 100644 --- a/src/Managing.Infrastructure.Tests/GmxServiceTests.cs +++ b/src/Managing.Infrastructure.Tests/GmxServiceTests.cs @@ -3,11 +3,13 @@ using Managing.Common; using Managing.Domain.Trades; using Managing.Infrastructure.Evm; using Managing.Infrastructure.Evm.Models.Gmx.v1; +using Managing.Infrastructure.Evm.Models.Privy; using Managing.Infrastructure.Evm.Referentials; using Managing.Infrastructure.Evm.Services; using Managing.Infrastructure.Evm.Services.Gmx; using Nethereum.Web3; using Xunit; +using Microsoft.Extensions.Options; namespace Managing.Infrastructure.Tests; @@ -37,7 +39,7 @@ public class GmxServiceTests : EvmManagerTests [Fact] public async void Should_return_orders() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, EvmManagerTests.CreateWebProxyService()); var account = PrivateKeys.GetAccount(); var orders = await manager.GetOrders(account, Enums.Ticker.BTC); @@ -48,7 +50,7 @@ public class GmxServiceTests : EvmManagerTests [Fact] public async void Should_cancel_gmx_orders() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, EvmManagerTests.CreateWebProxyService()); var account = PrivateKeys.GetAccount(); var cancelled = await manager.CancelOrders(account, Enums.Ticker.BTC); @@ -101,7 +103,7 @@ public class GmxServiceTests : EvmManagerTests [Fact] public async void Should_return_quantity_in_position() { - var manager = new EvmManager(Subgraphs); + var manager = new EvmManager(Subgraphs, EvmManagerTests.CreateWebProxyService()); var account = PrivateKeys.GetAccount(); var quantity = await manager.QuantityInPosition(Constants.Chains.Arbitrum, account.Key, Enums.Ticker.BTC); diff --git a/src/Managing.Infrastructure.Tests/GmxTradingTests.cs b/src/Managing.Infrastructure.Tests/GmxTradingTests.cs deleted file mode 100644 index 76b137f..0000000 --- a/src/Managing.Infrastructure.Tests/GmxTradingTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Managing.Common; -using Managing.Domain.Trades; -using Managing.Infrastructure.Evm; -using Xunit; - -namespace Managing.Infrastructure.Tests; - -public class GmxTradingTests : EvmManagerTests -{ - [Fact] - public async void Should_return_orders() - { - var manager = new EvmManager(Subgraphs); - var account = PrivateKeys.GetAccount(); - - var orders = await manager.GetOrders(account, Enums.Ticker.SOL); - Assert.IsType>(orders); - } - - [Fact] - public async void Should_cancel_order() - { - var manager = new EvmManager(Subgraphs); - var account = PrivateKeys.GetAccount(); - - var result = await manager.CancelOrders(account, Enums.Ticker.BTC); - Assert.True(result); - } -} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Tests/PrivateKeys.cs b/src/Managing.Infrastructure.Tests/PrivateKeys.cs index 341e6b4..3a7df9c 100644 --- a/src/Managing.Infrastructure.Tests/PrivateKeys.cs +++ b/src/Managing.Infrastructure.Tests/PrivateKeys.cs @@ -11,9 +11,16 @@ public static class PrivateKeys return new Account { Exchange = Enums.TradingExchanges.GmxV2, - Type = Enums.AccountType.Trader, - Key = "", - Secret = "" + Type = Enums.AccountType.Privy, + Key = "0x932167388dD9aad41149b3cA23eBD489E2E2DD78", + Secret = "cm7vxs99f0007blcl8cmzv74t" }; + // return new Account + // { + // Exchange = Enums.TradingExchanges.GmxV2, + // Type = Enums.AccountType.Trader, + // Key = "0x0425dEAb364E9121F7CA284129dA854FD5cF22eD", + // Secret = "satisfy abandon canvas region prison winner prevent since awkward song attend magnet" + // }; } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Tests/PrivyServiceTests.cs b/src/Managing.Infrastructure.Tests/PrivyServiceTests.cs new file mode 100644 index 0000000..77fab67 --- /dev/null +++ b/src/Managing.Infrastructure.Tests/PrivyServiceTests.cs @@ -0,0 +1,504 @@ +using System.Net; +using System.Reflection; +using System.Security.Cryptography; +using System.Text; +using System.Text.Json; +using Managing.Infrastructure.Evm; +using Managing.Infrastructure.Evm.Abstractions; +using Managing.Infrastructure.Evm.Models.Privy; +using Moq; +using Moq.Protected; +using Org.Webpki.JsonCanonicalizer; +using Xunit; + +namespace Managing.Infrastructure.Tests; + +public class PrivyServiceTests +{ + private readonly PrivyService _privyService; + + public PrivyServiceTests() + { + _privyService = new PrivyService(new PrivySettings() + { + AppId = "cm7u09v0u002zrkuf2yjjr58p", + AppSecret = "25wwYu5AgxArU7djgvQEuioc9YSdGY3WN3r1dmXftPfH33KfGVfzopW3vqoPFjy1b8wS2gkDDZ9iQ8yxSo9Vi4iN", + AuthorizationKey = + "wallet-auth:MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQggpJ65PCo4E6NYpY867AyE6p1KxOrs8LJqHZw+t+076yhRANCAAS2EM23CtIfQRmHWTxcqb1j5yfrVePjZyBOZZ2RoPZHb9bDGLos206fTuVA3zgLVomlOoHTeYifkBASCn9Mfg3b" + }); + } + + [Fact] + public async Task Should_sign_message() + { + // Arrange + var walletId = "cm7vxs99f0007blcl8cmzv74t"; + var message = "Hello, Ethereum"; + var address = "0x932167388dD9aad41149b3cA23eBD489E2E2DD78"; + + // Act + var signature = await _privyService.SignMessageAsync(address, message); + + // Assert + Assert.NotNull(signature); + } + // GsyIYCt202K339eTNmB8ZG/bziRiGUcwFoXwfq85Wf+kpZgaSvJSJ/zO6TSEbDdqrb6JEWVyv4zaBV6j28w2SQ== + // MEUCIQCxx3BVsVu+GyFI/vIYm2x4hloHojKhpFrnj4KjfypgkgIgFnrlQ8CmJ479qgXpY+wdt1D5ki5+SFzXXBzMd+ckIAM= + + + [Fact] + public async Task Should_Get_User_Wallets() + { + var did = "did:privy:cm7vxs99f0007blcl8cmzv74t"; + var result = await _privyService.GetUserWalletsAsync(did); + + Assert.NotNull(result); + } + + + [Fact] + public async Task Should_Get_User_Wallets_With_Delegation_Status() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + var testDid = "did:privy:test123456789"; + + // Sample JSON response matching the actual API response structure + var mockResponse = new + { + did = testDid, + linked_accounts = new object[] + { + new + { + type = "wallet", + address = "0x123abc456def789ghi", + chain_type = "ethereum", + chain_id = "eip155:1", + delegated = true, + verified = true, + wallet_index = 0, + wallet_client = "privy", + wallet_client_type = "privy", + connector_type = "embedded", + imported = false, + recovery_method = "privy", + verified_at = 1741180715, + first_verified_at = 1741180715, + latest_verified_at = 1741180715, + id = "abc123" + }, + new + { + type = "wallet", + address = "0x987zyx654wvu321tsr", + chain_type = "ethereum", + chain_id = "eip155:1", + delegated = false, + verified = true, + wallet_index = 1, + wallet_client = "privy", + wallet_client_type = "privy", + connector_type = "embedded", + imported = false, + recovery_method = "privy", + verified_at = 1741180715, + first_verified_at = 1741180715, + latest_verified_at = 1741180715, + id = "def456" + }, + new + { + type = "email", + address = "test@example.com", + verified = true + } + } + }; + + var mockResponseJson = JsonSerializer.Serialize(mockResponse); + + // Setup mock HttpClient to return our mock response + mockHttpMessageHandler + .Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny() + ) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(mockResponseJson, Encoding.UTF8, "application/json") + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object) + { + BaseAddress = new Uri("https://auth.privy.io/") + }; + + // Create mock settings + var mockSettings = new Mock(); + mockSettings.Setup(s => s.AppId).Returns("test-app-id"); + mockSettings.Setup(s => s.AppSecret).Returns("test-app-secret"); + mockSettings.Setup(s => s.AuthorizationKey).Returns("wallet-auth:test-auth-key"); + + // Create PrivyService with mocked dependencies + var privyService = new PrivyService(mockSettings.Object); + + // Use reflection to set the private _privyClient field + var privyClientField = typeof(PrivyService).GetField("_privyClient", + BindingFlags.Instance | BindingFlags.NonPublic); + privyClientField.SetValue(privyService, httpClient); + + // Act + var result = await privyService.GetUserWalletsAsync(testDid); + + // Assert + Assert.NotNull(result); + Assert.Equal(testDid, result.Did); + Assert.Equal(3, result.LinkedAccounts.Count); + + // Verify wallet accounts correctly processed + var delegatedWallets = result.LinkedAccounts.Where(a => a.Type == "wallet" && a.Delegated).ToList(); + Assert.Single(delegatedWallets); + Assert.Equal("0x123abc456def789ghi", delegatedWallets[0].Address); + Assert.Equal("privy", delegatedWallets[0].WalletClient); + Assert.Equal(0, delegatedWallets[0].WalletIndex); + Assert.Equal(1741180715, delegatedWallets[0].VerifiedAtTimestamp); + Assert.NotNull(delegatedWallets[0].VerifiedAt); // Verify timestamp conversion works + + // Verify non-delegated wallet + var nonDelegatedWallets = result.LinkedAccounts.Where(a => a.Type == "wallet" && !a.Delegated).ToList(); + Assert.Single(nonDelegatedWallets); + Assert.Equal("0x987zyx654wvu321tsr", nonDelegatedWallets[0].Address); + + // Verify non-wallet account + var nonWalletAccounts = result.LinkedAccounts.Where(a => a.Type != "wallet").ToList(); + Assert.Single(nonWalletAccounts); + Assert.Equal("email", nonWalletAccounts[0].Type); + + // Verify HTTP request made correctly + mockHttpMessageHandler.Protected().Verify( + "SendAsync", + Times.Once(), + ItExpr.Is(req => + req.Method == HttpMethod.Get && + req.RequestUri.ToString().Contains($"/api/v1/users/{testDid}")), + ItExpr.IsAny() + ); + } + + [Fact] + public void Should_Generate_Correct_Authorization_Signature() + { + // Arrange - Use the exact values from Privy documentation + var url = "https://api.privy.io/v1/wallets"; + var body = new { chain_type = "ethereum" }; + var httpMethod = "POST"; + + // Expected signature from Privy documentation + var expectedSignature = + "MEUCIQDvwv0Ci+A+7bqi1x0UNBS7of5tV3dmon8hO3sbD3stSgIgEBGn1EdMukw7IrFS4WgYXbgZhXkp3NXL7O0T7dnO8Ck="; + + // Create a PrivyService instance with the sample auth key from the docs + var settings = new PrivySettings + { + AppId = "cm4db8x9t000ccn87pctvcg9j", // Sample app ID from Privy docs + AppSecret = "test-app-secret", // Not used for signature generation + AuthorizationKey = + "wallet-auth:MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqOBE+hZld+PCaj051uOl0XpEwe3tKBC5tsYsKdnPymGhRANCAAQ2HyYUbLRcfj9obpViwjYU/S7FdNUehkcfjYdd+R2gH/1q0ZJx7mOF1zpiEbbBNRLuXzP0NPN6nonkI8umzLXZ" + }; + + var privyService = new PrivyService(settings); + + // Act + var actualSignature = privyService.GenerateAuthorizationSignature(url, body, httpMethod); + + // Assert + Assert.Equal(expectedSignature, actualSignature); + Console.WriteLine($"Signature verification passed! Generated: {actualSignature}"); + } + + [Fact] + public void Should_Generate_Same_Signature_For_Identical_Requests() + { + // Arrange + var url = "https://auth.privy.io/v1/wallets/rpc"; + var body = new + { + address = "0x932167388dD9aad41149b3cA23eBD489E2E2DD78", + chain_type = "ethereum", + method = "personal_sign", + @params = new + { + message = "Hello, Ethereum", + encoding = "utf-8" + } + }; + + // Act + var signature1 = _privyService.GenerateAuthorizationSignature(url, body); + var signature2 = _privyService.GenerateAuthorizationSignature(url, body); + + // Assert + Assert.NotNull(signature1); + Assert.NotNull(signature2); + Assert.Equal(signature1, signature2); // Signatures should be deterministic for the same input + } + + [Fact] + public void Should_Generate_Different_Signatures_For_Different_Inputs() + { + // Arrange + var url = "https://auth.privy.io/v1/wallets/rpc"; + var body1 = new + { + address = "0x932167388dD9aad41149b3cA23eBD489E2E2DD78", + chain_type = "ethereum", + method = "personal_sign", + @params = new + { + message = "Hello, Ethereum", + encoding = "utf-8" + } + }; + + var body2 = new + { + address = "0x932167388dD9aad41149b3cA23eBD489E2E2DD78", + chain_type = "ethereum", + method = "personal_sign", + @params = new + { + message = "Different message", // Only the message is different + encoding = "utf-8" + } + }; + + var differentUrl = "https://auth.privy.io/v1/wallets/different"; + + // Act + var signature1 = _privyService.GenerateAuthorizationSignature(url, body1); + var signature2 = _privyService.GenerateAuthorizationSignature(url, body2); + var signature3 = _privyService.GenerateAuthorizationSignature(differentUrl, body1); + + // Assert + Assert.NotEqual(signature1, signature2); // Different message should produce different signature + Assert.NotEqual(signature1, signature3); // Different URL should produce different signature + Assert.NotEqual(signature2, signature3); // Different URL and message should produce different signature + } + + [Fact] + public void Should_Generate_Correct_Signature_Payload_Structure() + { + // This test validates that we're constructing the payload structure correctly + + // Arrange - Use the same sample data as the signature test + var url = "https://api.privy.io/v1/wallets"; + var body = new { chain_type = "ethereum" }; + var appId = "cm4db8x9t000ccn87pctvcg9j"; + var httpMethod = "POST"; + + // Expected payload structure from the Privy documentation + var expectedPayloadStructure = new + { + version = 1, + method = "POST", + url = "https://api.privy.io/v1/wallets", + body = new { chain_type = "ethereum" }, + headers = new Dictionary { { "privy-app-id", appId } } + }; + + // Capture the actual payload by overriding the signature generation + string capturedPayload = null; + + // We need to create a testable service that lets us inspect the payload + // Here's a simple mock that captures the JSON payload by inheriting from PrivyService + var testService = new TestPrivyService(new PrivySettings + { + AppId = appId, + AppSecret = "test-secret", + AuthorizationKey = "wallet-auth:test-key" + }); + + // Act - Generate the signature (this will capture the payload internally) + var payload = testService.GetSignaturePayload(url, body, httpMethod); + + // Assert - verify payload matches expected structure + + // Convert both to dictionaries for easier comparison + var expectedDict = ConvertAnonymousObjectToDictionary(expectedPayloadStructure); + var actualDict = ConvertAnonymousObjectToDictionary(payload); + + // Check top-level properties + Assert.Equal(expectedDict["version"], actualDict["version"]); + Assert.Equal(expectedDict["method"], actualDict["method"]); + Assert.Equal(expectedDict["url"], actualDict["url"]); + + // Compare body properties + var expectedBody = ConvertAnonymousObjectToDictionary(expectedDict["body"]); + var actualBody = ConvertAnonymousObjectToDictionary(actualDict["body"]); + Assert.Equal(expectedBody["chain_type"], actualBody["chain_type"]); + + // Compare headers + var expectedHeaders = (Dictionary)expectedDict["headers"]; + var actualHeaders = (Dictionary)actualDict["headers"]; + Assert.Equal(expectedHeaders["privy-app-id"], actualHeaders["privy-app-id"]); + + Console.WriteLine("Payload structure verification passed!"); + } + + [Fact] + public async Task Should_Use_n8n_To_sign() + { + var httpClient = new HttpClient(); + var url = "https://n8n.kaigen.managing.live/webhook-test/3d931e75-40c8-403d-a26e-6200b328ca85"; + httpClient.BaseAddress = new Uri(url); + + var privyUrl = "https://api.privy.io/v1/wallets"; + var body = new { chain_type = "ethereum" }; + var httpMethod = "POST"; + + // Expected signature from Privy documentation + var expectedSignature = + "MEUCIQDvwv0Ci+A+7bqi1x0UNBS7of5tV3dmon8hO3sbD3stSgIgEBGn1EdMukw7IrFS4WgYXbgZhXkp3NXL7O0T7dnO8Ck="; + + // Use Privy docs data for the request body + var signaturePayload = new Dictionary + { + ["method"] = "POST", + ["url"] = privyUrl, // Use the FULL URL for signature calculation as per Privy docs + ["body"] = body, + }; + + // Serialize the payload to JSON + var jsonPayload = JsonSerializer.Serialize(signaturePayload); + + // Create the request + var request = new HttpRequestMessage(HttpMethod.Post, url) + { + Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json") + }; + + // Act + var response = await httpClient.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.True(response.IsSuccessStatusCode); + + var responseContent = await response.Content.ReadAsStringAsync(); + Assert.Equal(expectedSignature, responseContent); + } + + [Fact] + public void Should_Sign_Correctly() + { + // Arrange + var url = "https://api.privy.io/v1/wallets"; + var body = new { chain_type = "ethereum" }; + var httpMethod = "POST"; + + var expectedSignature = + "MEUCIQDvwv0Ci+A+7bqi1x0UNBS7of5tV3dmon8hO3sbD3stSgIgEBGn1EdMukw7IrFS4WgYXbgZhXkp3NXL7O0T7dnO8Ck="; + + var settings = new PrivySettings + { + AppId = "cm4db8x9t000ccn87pctvcg9j", + AuthorizationKey = + "wallet-auth:MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqOBE+hZld+PCaj051uOl0XpEwe3tKBC5tsYsKdnPymGhRANCAAQ2HyYUbLRcfj9obpViwjYU/S7FdNUehkcfjYdd+R2gH/1q0ZJx7mOF1zpiEbbBNRLuXzP0NPN6nonkI8umzLXZ" + }; + + var payload = new + { + version = 1, + method = httpMethod, + url = url.TrimEnd('/'), + body = body, + headers = new + { + privy_app_id = settings.AppId + } + }; + + string serializedPayload = JsonSerializer.Serialize(payload); + JsonCanonicalizer jsonCanonicalizer = new JsonCanonicalizer(serializedPayload); + byte[] canonicalizedBytes = jsonCanonicalizer.GetEncodedUTF8(); + + Console.WriteLine($"Canonicalized JSON: {Encoding.UTF8.GetString(canonicalizedBytes)}"); + + byte[] privateKeyBytes = Convert.FromBase64String(settings.AuthorizationKey.Replace("wallet-auth:", "")); + using var privateKey = ECDsa.Create(ECCurve.NamedCurves.nistP256); + privateKey.ImportPkcs8PrivateKey(privateKeyBytes, out _); + + byte[] signatureBuffer = privateKey.SignData(canonicalizedBytes, HashAlgorithmName.SHA256); + string signature = Convert.ToBase64String(signatureBuffer); + + Console.WriteLine($"Generated Signature: {signature}"); + + Assert.Equal(expectedSignature, signature); + } + + // Helper class for testing the payload structure + private class TestPrivyService : PrivyService + { + public TestPrivyService(IPrivySettings settings) : base(settings) + { + } + + public object GetSignaturePayload(string url, object body, string httpMethod) + { + // Ensure we have a full, absolute URL for signature calculation + string fullUrl; + + if (Uri.TryCreate(url, UriKind.Absolute, out Uri uri)) + { + // Already a full URL + fullUrl = url; + } + else + { + // It's a relative path, so construct the full URL using the base address + string relativePath = url.StartsWith("/") ? url.Substring(1) : url; + fullUrl = new Uri(new Uri("https://auth.privy.io/"), relativePath).ToString(); + } + + // Create the signature payload structure exactly as in the GenerateAuthorizationSignature method + var headers = new Dictionary { { "privy-app-id", GetPrivyAppId() } }; + + return new + { + version = 1, + method = httpMethod, + url = fullUrl, + body = body, + headers = headers + }; + } + + // Helper to expose the private _appId + private string GetPrivyAppId() + { + // Use reflection to get the private field + var field = typeof(PrivyService).GetField("_appId", + BindingFlags.Instance | BindingFlags.NonPublic); + return (string)field.GetValue(this); + } + } + + // Helper for converting anonymous objects to dictionaries for easier comparison + private Dictionary ConvertAnonymousObjectToDictionary(object obj) + { + if (obj is Dictionary dict) + return dict; + + var result = new Dictionary(); + foreach (var prop in obj.GetType().GetProperties()) + { + result[prop.Name] = prop.GetValue(obj); + } + + return result; + } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Tests/PrivyTradingTests.cs b/src/Managing.Infrastructure.Tests/PrivyTradingTests.cs new file mode 100644 index 0000000..062b813 --- /dev/null +++ b/src/Managing.Infrastructure.Tests/PrivyTradingTests.cs @@ -0,0 +1,36 @@ +using Managing.Common; +using Managing.Domain.Trades; +using Managing.Infrastructure.Evm; +using Managing.Infrastructure.Evm.Models.Privy; +using Managing.Infrastructure.Evm.Services; +using Xunit; +using Managing.Infrastructure.Evm.Abstractions; +using Microsoft.Extensions.Options; + +namespace Managing.Infrastructure.Tests; + +public class PrivyTradingTests : EvmManagerTests +{ + [Fact] + public async Task Should_return_orders() + { + var manager = new EvmManager(Subgraphs, EvmManagerTests.CreateWebProxyService()); + var account = PrivateKeys.GetAccount(); + account.Type = Enums.AccountType.Privy; + + var orders = await manager.GetOrders(account, Enums.Ticker.BTC); + Assert.IsType>(orders); + } + + [Fact] + public async void Should_cancel_order() + { + var manager = new EvmManager(Subgraphs, EvmManagerTests.CreateWebProxyService()); + var account = PrivateKeys.GetAccount(); + account.Type = Enums.AccountType.Privy; + + + var result = await manager.CancelOrders(account, Enums.Ticker.BTC); + Assert.True(result); + } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Abstractions/IPrivyService.cs b/src/Managing.Infrastructure.Web3/Abstractions/IPrivyService.cs index 182e835..6d2c27f 100644 --- a/src/Managing.Infrastructure.Web3/Abstractions/IPrivyService.cs +++ b/src/Managing.Infrastructure.Web3/Abstractions/IPrivyService.cs @@ -1,4 +1,5 @@ using Managing.Infrastructure.Evm.Models; +using Managing.Infrastructure.Evm.Models.Privy; namespace Managing.Infrastructure.Evm.Abstractions; @@ -8,4 +9,39 @@ public interface IPrivyService Task SendTransactionAsync(string walletId, string recipientAddress, long value, string caip2 = "eip155:84532"); + + /// + /// Signs a message using the embedded wallet + /// + /// The ID of the wallet to use for signing + /// The message to sign + /// The signing method to use (e.g., "personal_sign", "eth_sign") + /// The signature response + Task SignMessageAsync(string embeddedWallet, string message, + string method = "personal_sign"); + + /// + /// Signs typed data (EIP-712) using the embedded wallet + /// + /// The ID of the wallet to use for signing + /// The typed data to sign (must be a valid JSON string conforming to EIP-712) + /// The CAIP-2 chain identifier + /// The signature + Task SignTypedDataAsync(string walletId, string typedData, string caip2 = "eip155:84532"); + + /// + /// Gets information about a user, including their linked wallet accounts and delegation status + /// + /// The Privy DID of the user (format: did:privy:XXXXX) + /// User information including wallets and delegation status + Task GetUserWalletsAsync(string userDid); + + /// + /// Generates an authorization signature for a request to the Privy API + /// + /// The full URL for the request + /// The request body + /// The HTTP method to use for the request (defaults to POST) + /// The generated signature + string GenerateAuthorizationSignature(string url, object body, string httpMethod = "POST"); } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Abstractions/IPrivySettings.cs b/src/Managing.Infrastructure.Web3/Abstractions/IPrivySettings.cs index 4ec54e2..d30f629 100644 --- a/src/Managing.Infrastructure.Web3/Abstractions/IPrivySettings.cs +++ b/src/Managing.Infrastructure.Web3/Abstractions/IPrivySettings.cs @@ -4,4 +4,5 @@ public interface IPrivySettings { string AppId { get; set; } string AppSecret { get; set; } + string AuthorizationKey { get; set; } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Abstractions/IWeb3ProxyService.cs b/src/Managing.Infrastructure.Web3/Abstractions/IWeb3ProxyService.cs new file mode 100644 index 0000000..fca5dfc --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Abstractions/IWeb3ProxyService.cs @@ -0,0 +1,10 @@ +namespace Managing.Infrastructure.Evm.Abstractions +{ + public interface IWeb3ProxyService + { + Task CallPrivyServiceAsync(string endpoint, object payload); + Task GetPrivyServiceAsync(string endpoint, object payload = null); + Task CallGmxServiceAsync(string endpoint, object payload); + Task GetGmxServiceAsync(string endpoint, object payload = null); + } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/EvmManager.cs b/src/Managing.Infrastructure.Web3/EvmManager.cs index 6e45b4c..7be79b1 100644 --- a/src/Managing.Infrastructure.Web3/EvmManager.cs +++ b/src/Managing.Infrastructure.Web3/EvmManager.cs @@ -11,6 +11,8 @@ using Managing.Domain.Trades; using Managing.Infrastructure.Evm.Abstractions; using Managing.Infrastructure.Evm.Models; using Managing.Infrastructure.Evm.Models.Gmx.v2; +using Managing.Infrastructure.Evm.Models.Privy; +using Managing.Infrastructure.Evm.Models.Proxy; using Managing.Infrastructure.Evm.Referentials; using Managing.Infrastructure.Evm.Services; using Managing.Infrastructure.Evm.Services.Gmx; @@ -26,6 +28,7 @@ using BalanceOfFunction = Nethereum.Contracts.Standards.ERC20.ContractDefinition using BalanceOfOutputDTO = Nethereum.Contracts.Standards.ERC20.ContractDefinition.BalanceOfOutputDTO; using Chain = Managing.Domain.Evm.Chain; using TransferEventDTO = Nethereum.Contracts.Standards.ERC721.ContractDefinition.TransferEventDTO; +using Microsoft.Extensions.Logging; namespace Managing.Infrastructure.Evm; @@ -37,7 +40,7 @@ public class EvmManager : IEvmManager private readonly IEnumerable _subgraphs; private Dictionary> _geckoPrices; private readonly GmxV2Service _gmxV2Service; - private readonly IPrivyService _privyService; + private readonly IWeb3ProxyService _web3ProxyService; private readonly List _eligibleTickers = new List() { @@ -45,13 +48,14 @@ public class EvmManager : IEvmManager Ticker.PEPE, Ticker.DOGE, Ticker.UNI }; - public EvmManager(IEnumerable subgraphs, IPrivyService privyService) + public EvmManager(IEnumerable subgraphs, + IWeb3ProxyService web3ProxyService) { var defaultChain = ChainService.GetEthereum(); _web3 = new Web3(defaultChain.RpcUrl); _httpClient = new HttpClient(); _subgraphs = subgraphs; - _privyService = privyService; + _web3ProxyService = web3ProxyService; _geckoPrices = _geckoPrices != null && _geckoPrices.Any() ? _geckoPrices : new Dictionary>(); @@ -426,19 +430,20 @@ public class EvmManager : IEvmManager return lastPrices.Last(); } - public async Task InitAddress(string chainName, string publicAddress, string privateKey) + public async Task InitAddress(string publicAddress) { try { - var chain = ChainService.GetChain(chainName); - var account = new Wallet(privateKey, _password).GetAccount(publicAddress); - var web3 = new Web3(account, chain.RpcUrl); - var tickers = await GetAvailableTicker(); - await GmxService.InitAccountForTrading(web3, publicAddress, tickers); - return true; + var response = await _web3ProxyService.CallPrivyServiceAsync( + "/init-address", + new { address = publicAddress }); + + return response.Success; } catch (Exception ex) { + // Log the error + Console.Error.WriteLine($"Error initializing address: {ex.Message}"); return false; } } @@ -512,12 +517,34 @@ public class EvmManager : IEvmManager public async Task CancelOrders(Account account, Ticker ticker) { - var wallet = new Wallet(account.Secret, _password).GetAccount(account.Key); - var chain = ChainService.GetChain(Constants.Chains.Arbitrum); - var web3 = new Web3(wallet, chain.RpcUrl); - // return await GmxService.CancelOrders(web3, account.Key, ticker); - var service = new GmxV2Service(); - return await service.CancelOrders(web3, account.Key, ticker); + if (account.IsPrivyWallet) + { + try + { + var response = await _web3ProxyService.CallGmxServiceAsync("/cancel-orders", + new + { + account = account.Key, + walletId = account.Secret, + ticker = ticker.ToString() + }); + + return response.success ?? false; + } + catch (Exception ex) + { + Console.Error.WriteLine($"Error canceling orders via Fastify API: {ex.Message}"); + return false; + } + } + else + { + var wallet = new Wallet(account.Secret, _password).GetAccount(account.Key); + var chain = ChainService.GetChain(Constants.Chains.Arbitrum); + var web3 = new Web3(wallet, chain.RpcUrl); + var service = new GmxV2Service(); + return await service.CancelOrders(web3, account.Key, ticker); + } } public async Task IncreasePosition( @@ -526,17 +553,67 @@ public class EvmManager : IEvmManager TradeDirection direction, decimal price, decimal quantity, - decimal? leverage) + decimal? leverage, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null) { - var wallet = new Wallet(account.Secret, _password).GetAccount(account.Key); - var chain = ChainService.GetChain(Constants.Chains.Arbitrum); - var web3 = new Web3(wallet, chain.RpcUrl); - Trade trade = null; + try { - trade = await _gmxV2Service.IncreasePosition(web3, account.Key, ticker, direction, price, quantity, - leverage); + // If this is a Privy wallet, call the GMX service through Fastify API + if (account.IsPrivyWallet) + { + try + { + var response = await _web3ProxyService.CallGmxServiceAsync("/open-position", + new + { + account = account.Key, + walletId = account.Secret, + tradeType = price > 0 ? "limit" : "market", + ticker = ticker.ToString(), + direction = direction.ToString(), + price = price, + quantity, + leverage = leverage ?? 1.0m, + stopLossPrice = stopLossPrice, + takeProfitPrice = takeProfitPrice + }); + + // Create a trade object using the returned hash + var tradeType = price > 0 ? TradeType.Limit : TradeType.Market; + var tradeStatus = TradeStatus.Requested; // Use a valid enum value that exists in TradeStatus + + trade = new Trade( + DateTime.UtcNow, + direction, + tradeStatus, + tradeType, + ticker, + quantity, + price, + leverage ?? 1.0m, + account.Key, + "" + ); + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + else + { + // Continue with the existing direct service call for non-Privy wallets + var wallet = new Wallet(account.Secret, _password).GetAccount(account.Key); + var chain = ChainService.GetChain(Constants.Chains.Arbitrum); + var web3 = new Web3(wallet, chain.RpcUrl); + + trade = await _gmxV2Service.IncreasePosition(web3, account.Key, ticker, direction, price, quantity, + leverage); + } } catch (Exception ex) { @@ -554,11 +631,45 @@ public class EvmManager : IEvmManager decimal quantity, decimal? leverage) { + Trade trade = null; + + if (account.IsPrivyWallet) + { + try + { + var response = await _web3ProxyService.CallGmxServiceAsync("/close-position", + new + { + account = account.Key, + ticker = ticker.ToString(), + direction = direction.ToString(), + }); + trade = new Trade( + DateTime.UtcNow, + direction, + TradeStatus.Requested, + TradeType.Market, + ticker, + quantity, + price, + leverage ?? 1, + response.Hash, + "" + ); + + return trade; + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + var wallet = new Wallet(account.Secret, _password).GetAccount(account.Key); var chain = ChainService.GetChain(Constants.Chains.Arbitrum); var web3 = new Web3(wallet, chain.RpcUrl); - Trade trade = null; try { trade = await _gmxV2Service.DecreasePosition(web3, account.Key, ticker, direction, price, quantity, @@ -573,7 +684,9 @@ public class EvmManager : IEvmManager } public async Task DecreaseOrder(Account account, TradeType tradeType, Ticker ticker, - TradeDirection direction, decimal price, decimal quantity, decimal? leverage) + TradeDirection direction, decimal price, decimal quantity, decimal? leverage, + decimal? stopLossPrice = null, + decimal? takeProfitPrice = null) { var wallet = new Wallet(account.Secret, _password).GetAccount(account.Key); var chain = ChainService.GetChain(Constants.Chains.Arbitrum); @@ -582,8 +695,11 @@ public class EvmManager : IEvmManager Trade trade; try { - trade = await GmxService.DecreaseOrder(web3, tradeType, account.Key, ticker, direction, price, quantity, - leverage); + // TODO: This method in GmxV2Service might not exist or needs different handling for Privy wallets. + // Commenting out for now as IncreasePosition is the priority. + // trade = await _gmxV2Service.DecreaseOrder(web3, account.Key, tradeType, ticker, direction, price, + // quantity, leverage); + trade = null; // Placeholder return } catch (Exception ex) { @@ -595,6 +711,34 @@ public class EvmManager : IEvmManager public async Task GetTrade(Account account, string chainName, Ticker ticker) { + if (account.IsPrivyWallet) + { + var result = await _web3ProxyService.GetGmxServiceAsync( + "/positions", + new { account = account.Key, ticker = ticker.ToString() }); + + var position = result.Positions.FirstOrDefault(p => p.Ticker == ticker.ToString()); + + if (position == null) + return null; + + // TODO: Map the position object to a Trade object + var trade = new Trade( + position.Date, + MiscExtensions.ParseEnum(position.Direction), + MiscExtensions.ParseEnum(position.Status), + MiscExtensions.ParseEnum(position.TradeType), + MiscExtensions.ParseEnum(position.Ticker), + (decimal)position.Quantity, + (decimal)position.Price, + (decimal?)position.Leverage, + account.Key, + position.ExchangeOrderId + ); + + return trade; + } + return await GetTrade(account.Key, chainName, ticker); } @@ -608,12 +752,7 @@ public class EvmManager : IEvmManager public async Task> GetFundingRates() { - var chain = ChainService.GetChain(Constants.Chains.Arbitrum); - var web3 = new Web3(chain.RpcUrl); - var service = new GmxV2Service(); - var fundingRates = await service.GetFundingRates(web3); - - return fundingRates; + return await _web3ProxyService.CallGmxServiceAsync>("/gmx/funding-rates", new { }); } public async Task QuantityInPosition(string chainName, string publicAddress, Ticker ticker) @@ -635,17 +774,39 @@ public class EvmManager : IEvmManager public async Task> GetOrders(Account account, Ticker ticker) { - var wallet = new Wallet(account.Secret, _password).GetAccount(account.Key); - var chain = ChainService.GetChain(Constants.Chains.Arbitrum); - var web3 = new Web3(wallet, chain.RpcUrl); - // var orders = await GmxService.GetOrders(web3, account.Key, ticker); - var orders = await _gmxV2Service.GetOrders(web3, account.Key, ticker); + if (account.IsPrivyWallet) + { + var orders = await _web3ProxyService.CallGmxServiceAsync>("/get-orders", + new { address = account.Key, walletId = account.Secret, ticker = ticker.ToString() }); - return GmxV2Mappers.Map(orders); + return orders; + } + else + { + var chain = ChainService.GetChain(Constants.Chains.Arbitrum); + var web3 = new Web3(chain.RpcUrl); + // var orders = await GmxService.GetOrders(web3, account.Key, ticker); + var orders = await _gmxV2Service.GetOrders(web3, account.Key, ticker); + + return GmxV2Mappers.Map(orders); + } + + return new List(); } public async Task SetAllowance(Account account, Ticker ticker, BigInteger amount) { + if (account.IsPrivyWallet) + { + var allowance = await _web3ProxyService.CallPrivyServiceAsync("/approve-token", + new + { + address = account.Key, walletId = account.Secret, ticker = ticker.ToString(), + amount = amount.Equals(0) ? null : amount.ToString() + }); + return false; + } + var web3 = BuildWeb3ForAccount(account); var contractAddress = TokenService.GetContractAddress(ticker); var approval = await EvmBase.ApproveToken(web3, account.Key, contractAddress, @@ -663,7 +824,29 @@ public class EvmManager : IEvmManager public async Task<(string Id, string Address)> CreatePrivyWallet() { - var privyWallet = await _privyService.CreateWalletAsync(); + var privyWallet = await _web3ProxyService.CallPrivyServiceAsync("/privy/create-wallet", new { }); return (privyWallet.Id, privyWallet.Address); } + + /// + /// Signs a message using the embedded wallet + /// + /// The wallet id of the embedded wallet + /// The address of the embedded wallet + /// The message to sign + /// The signature response + public async Task SignMessageAsync(string embeddedWalletId, string address, string message) + { + // Construct the request body using the exact format from Privy documentati + var requestBody = new + { + address = address, + walletId = embeddedWalletId, + message = message, + }; + + var response = + await _web3ProxyService.CallPrivyServiceAsync("sign-message", requestBody); + return response.Signature; + } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Managing.Infrastructure.Evm.csproj b/src/Managing.Infrastructure.Web3/Managing.Infrastructure.Evm.csproj index aab8a99..902af95 100644 --- a/src/Managing.Infrastructure.Web3/Managing.Infrastructure.Evm.csproj +++ b/src/Managing.Infrastructure.Web3/Managing.Infrastructure.Evm.csproj @@ -11,6 +11,7 @@ + diff --git a/src/Managing.Infrastructure.Web3/Models/Privy/PrivyApproveTokenResponse.cs b/src/Managing.Infrastructure.Web3/Models/Privy/PrivyApproveTokenResponse.cs new file mode 100644 index 0000000..1bd17ee --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Privy/PrivyApproveTokenResponse.cs @@ -0,0 +1,7 @@ +namespace Managing.Infrastructure.Evm.Models.Privy; + +public class PrivyApproveTokenResponse +{ + public bool Success { get; set; } + public string Hash { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Privy/PrivyInitAddressResponse.cs b/src/Managing.Infrastructure.Web3/Models/Privy/PrivyInitAddressResponse.cs new file mode 100644 index 0000000..20b5e91 --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Privy/PrivyInitAddressResponse.cs @@ -0,0 +1,11 @@ +namespace Managing.Infrastructure.Evm.Models.Privy; + + +public class PrivyInitAddressResponse +{ + public bool Success { get; set; } + public string? UsdcHash { get; set; } + public string? OrderVaultHash { get; set; } + public string? ExchangeRouterHash { get; set; } + public string? Error { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Privy/PrivySettings.cs b/src/Managing.Infrastructure.Web3/Models/Privy/PrivySettings.cs index c64d313..40ce0b0 100644 --- a/src/Managing.Infrastructure.Web3/Models/Privy/PrivySettings.cs +++ b/src/Managing.Infrastructure.Web3/Models/Privy/PrivySettings.cs @@ -6,4 +6,5 @@ public class PrivySettings : IPrivySettings { public string AppId { get; set; } public string AppSecret { get; set; } + public string AuthorizationKey { get; set; } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Privy/PrivySigningResponse.cs b/src/Managing.Infrastructure.Web3/Models/Privy/PrivySigningResponse.cs new file mode 100644 index 0000000..ebc4b5d --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Privy/PrivySigningResponse.cs @@ -0,0 +1,7 @@ +namespace Managing.Infrastructure.Evm.Models.Privy; + +public class PrivySigningResponse +{ + public string Signature { get; set; } + public bool Success { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Privy/PrivyUserInfo.cs b/src/Managing.Infrastructure.Web3/Models/Privy/PrivyUserInfo.cs new file mode 100644 index 0000000..15151ad --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Privy/PrivyUserInfo.cs @@ -0,0 +1,107 @@ +using System.Text.Json.Serialization; + +namespace Managing.Infrastructure.Evm.Models.Privy +{ + /// + /// Represents user information returned from the Privy API + /// + public class PrivyUserInfo + { + [JsonPropertyName("did")] + public string Did { get; set; } + + [JsonPropertyName("linked_accounts")] + public List LinkedAccounts { get; set; } = new List(); + + // These fields might be optional in the response + [JsonPropertyName("created_at")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public long? CreatedAtTimestamp { get; set; } + + [JsonPropertyName("updated_at")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public long? UpdatedAtTimestamp { get; set; } + + // Computed properties to convert Unix timestamps to DateTime + [JsonIgnore] + public DateTime? CreatedAt => CreatedAtTimestamp.HasValue + ? DateTimeOffset.FromUnixTimeSeconds(CreatedAtTimestamp.Value).DateTime + : null; + + [JsonIgnore] + public DateTime? UpdatedAt => UpdatedAtTimestamp.HasValue + ? DateTimeOffset.FromUnixTimeSeconds(UpdatedAtTimestamp.Value).DateTime + : null; + } + + /// + /// Represents a linked account in the Privy user's profile + /// + public class PrivyLinkedAccount + { + [JsonPropertyName("type")] + public string Type { get; set; } + + [JsonPropertyName("address")] + public string Address { get; set; } + + [JsonPropertyName("chain_type")] + public string ChainType { get; set; } + + [JsonPropertyName("delegated")] + public bool Delegated { get; set; } + + [JsonPropertyName("verified")] + public bool? Verified { get; set; } + + // Additional fields from the actual response + [JsonPropertyName("wallet_index")] + public int? WalletIndex { get; set; } + + [JsonPropertyName("wallet_client")] + public string WalletClient { get; set; } + + [JsonPropertyName("wallet_client_type")] + public string WalletClientType { get; set; } + + [JsonPropertyName("connector_type")] + public string ConnectorType { get; set; } + + [JsonPropertyName("imported")] + public bool? Imported { get; set; } + + [JsonPropertyName("recovery_method")] + public string RecoveryMethod { get; set; } + + [JsonPropertyName("chain_id")] + public string ChainId { get; set; } + + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("verified_at")] + public long? VerifiedAtTimestamp { get; set; } + + [JsonPropertyName("first_verified_at")] + public long? FirstVerifiedAtTimestamp { get; set; } + + [JsonPropertyName("latest_verified_at")] + public long? LatestVerifiedAtTimestamp { get; set; } + + // Computed properties to convert Unix timestamps to DateTime + [JsonIgnore] + public DateTime? VerifiedAt => VerifiedAtTimestamp.HasValue + ? DateTimeOffset.FromUnixTimeSeconds(VerifiedAtTimestamp.Value).DateTime + : null; + + [JsonIgnore] + public DateTime? FirstVerifiedAt => FirstVerifiedAtTimestamp.HasValue + ? DateTimeOffset.FromUnixTimeSeconds(FirstVerifiedAtTimestamp.Value).DateTime + : null; + + [JsonIgnore] + public DateTime? LatestVerifiedAt => LatestVerifiedAtTimestamp.HasValue + ? DateTimeOffset.FromUnixTimeSeconds(LatestVerifiedAtTimestamp.Value).DateTime + : null; + } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Proxy/ClosePositionResponse.cs b/src/Managing.Infrastructure.Web3/Models/Proxy/ClosePositionResponse.cs new file mode 100644 index 0000000..a2be22d --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Proxy/ClosePositionResponse.cs @@ -0,0 +1,8 @@ + +using Managing.Infrastructure.Evm.Models.Proxy; +using Newtonsoft.Json; +public class ClosePositionResponse : Web3ProxyBaseResponse +{ + [JsonProperty("hash")] + public string Hash { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Proxy/GetGmxPositionsResponse.cs b/src/Managing.Infrastructure.Web3/Models/Proxy/GetGmxPositionsResponse.cs new file mode 100644 index 0000000..fdc5d6b --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Proxy/GetGmxPositionsResponse.cs @@ -0,0 +1,104 @@ +using Newtonsoft.Json; + +namespace Managing.Infrastructure.Evm.Models.Proxy; + +public class Open +{ + [JsonProperty("direction")] public string Direction { get; set; } + + [JsonProperty("price")] public double Price { get; set; } + + [JsonProperty("quantity")] public double Quantity { get; set; } + + [JsonProperty("leverage")] public double Leverage { get; set; } + + [JsonProperty("status")] public string Status { get; set; } +} + +public class GmxPosition +{ + [JsonProperty("id")] public string Id { get; set; } + + [JsonProperty("ticker")] public string Ticker { get; set; } + + [JsonProperty("direction")] public string Direction { get; set; } + + [JsonProperty("price")] public double Price { get; set; } + + [JsonProperty("quantity")] public double Quantity { get; set; } + + [JsonProperty("leverage")] public double Leverage { get; set; } + + [JsonProperty("status")] public string Status { get; set; } + + [JsonProperty("tradeType")] public string TradeType { get; set; } + + [JsonProperty("date")] public DateTime Date { get; set; } + + [JsonProperty("exchangeOrderId")] public string ExchangeOrderId { get; set; } + + [JsonProperty("pnl")] public double Pnl { get; set; } + + [JsonProperty("collateral")] public double Collateral { get; set; } + + [JsonProperty("markPrice")] public double MarkPrice { get; set; } + + [JsonProperty("liquidationPrice")] public double LiquidationPrice { get; set; } + + [JsonProperty("stopLoss")] public StopLoss StopLoss { get; set; } + + [JsonProperty("takeProfit1")] public TakeProfit1 TakeProfit1 { get; set; } + + [JsonProperty("open")] public Open Open { get; set; } +} + +public class GetGmxPositionsResponse : Web3ProxyBaseResponse +{ + [JsonProperty("positions")] public List Positions { get; set; } +} + +public class StopLoss +{ + [JsonProperty("id")] public string Id { get; set; } + + [JsonProperty("ticker")] public string Ticker { get; set; } + + [JsonProperty("direction")] public string Direction { get; set; } + + [JsonProperty("price")] public double Price { get; set; } + + [JsonProperty("quantity")] public double Quantity { get; set; } + + [JsonProperty("leverage")] public int Leverage { get; set; } + + [JsonProperty("status")] public string Status { get; set; } + + [JsonProperty("tradeType")] public string TradeType { get; set; } + + [JsonProperty("date")] public DateTime Date { get; set; } + + [JsonProperty("exchangeOrderId")] public string ExchangeOrderId { get; set; } +} + +public class TakeProfit1 +{ + [JsonProperty("id")] public string Id { get; set; } + + [JsonProperty("ticker")] public string Ticker { get; set; } + + [JsonProperty("direction")] public string Direction { get; set; } + + [JsonProperty("price")] public double Price { get; set; } + + [JsonProperty("quantity")] public double Quantity { get; set; } + + [JsonProperty("leverage")] public int Leverage { get; set; } + + [JsonProperty("status")] public string Status { get; set; } + + [JsonProperty("tradeType")] public string TradeType { get; set; } + + [JsonProperty("date")] public DateTime Date { get; set; } + + [JsonProperty("exchangeOrderId")] public string ExchangeOrderId { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Proxy/Web3ProxyBaseResponse.cs b/src/Managing.Infrastructure.Web3/Models/Proxy/Web3ProxyBaseResponse.cs new file mode 100644 index 0000000..743b3a7 --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Proxy/Web3ProxyBaseResponse.cs @@ -0,0 +1,6 @@ +namespace Managing.Infrastructure.Evm.Models.Proxy; + +public abstract class Web3ProxyBaseResponse +{ + public bool Success { get; set; } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Models/Proxy/Web3ProxyError.cs b/src/Managing.Infrastructure.Web3/Models/Proxy/Web3ProxyError.cs new file mode 100644 index 0000000..b701cef --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Models/Proxy/Web3ProxyError.cs @@ -0,0 +1,129 @@ +using System.Text.Json.Serialization; + +namespace Managing.Infrastructure.Evm.Models.Proxy +{ + /// + /// Base response structure from the Web3Proxy API + /// + public class Web3ProxyResponse + { + /// + /// Whether the operation was successful + /// + [JsonPropertyName("success")] + public bool Success { get; set; } + + /// + /// Error message if not successful + /// + [JsonPropertyName("error")] + public string Error { get; set; } + } + + /// + /// Generic response with data payload + /// + /// Type of data in the response + public class Web3ProxyDataResponse : Web3ProxyResponse + { + /// + /// The response data if successful + /// + [JsonPropertyName("data")] + public T Data { get; set; } + } + + /// + /// Base error response from Web3Proxy API + /// + public class Web3ProxyError + { + /// + /// Error type + /// + [JsonPropertyName("type")] + public string Type { get; set; } + + /// + /// Error message + /// + [JsonPropertyName("message")] + public string Message { get; set; } + + /// + /// Error stack trace + /// + [JsonPropertyName("stack")] + public string Stack { get; set; } + + /// + /// HTTP status code (added by service) + /// + [JsonIgnore] + public int StatusCode { get; set; } + + /// + /// Returns a formatted error message with type and message + /// + public string FormattedMessage => $"{Type}: {Message}"; + } + + /// + /// API response containing error details + /// + public class Web3ProxyErrorResponse : Web3ProxyResponse + { + /// + /// Error details (for structured errors) + /// + [JsonPropertyName("err")] + public Web3ProxyError ErrorDetails { get; set; } + } + + /// + /// Represents a Web3Proxy API exception with error details + /// + public class Web3ProxyException : Exception + { + /// + /// The error details from the API + /// + public Web3ProxyError Error { get; } + + /// + /// Simple error message from API + /// + public string ApiErrorMessage { get; } + + /// + /// Creates a new Web3ProxyException from a structured error + /// + /// The error details + public Web3ProxyException(Web3ProxyError error) + : base(error?.Message ?? "An error occurred in the Web3Proxy API") + { + Error = error; + } + + /// + /// Creates a new Web3ProxyException from a simple error message + /// + /// The error message + public Web3ProxyException(string errorMessage) + : base(errorMessage) + { + ApiErrorMessage = errorMessage; + } + + /// + /// Creates a new Web3ProxyException with a custom message + /// + /// Custom error message + /// The error details + public Web3ProxyException(string message, Web3ProxyError error) + : base(message) + { + Error = error; + } + } +} \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Services/PrivyService.cs b/src/Managing.Infrastructure.Web3/Services/PrivyService.cs index 673de53..6482d36 100644 --- a/src/Managing.Infrastructure.Web3/Services/PrivyService.cs +++ b/src/Managing.Infrastructure.Web3/Services/PrivyService.cs @@ -1,45 +1,276 @@ using System.Net.Http.Headers; using System.Net.Http.Json; +using System.Security.Cryptography; using System.Text; +using System.Text.Encodings.Web; using System.Text.Json; +using System.Text.Json.Serialization; using Managing.Infrastructure.Evm.Abstractions; using Managing.Infrastructure.Evm.Models; +using Managing.Infrastructure.Evm.Models.Privy; +using Org.Webpki.JsonCanonicalizer; public class PrivyService : IPrivyService { private readonly HttpClient _privyClient; private readonly string _appId; private readonly string _appSecret; + private readonly string _authorizationKey; public PrivyService(IPrivySettings settings) { _privyClient = new HttpClient(); _appId = settings.AppId; _appSecret = settings.AppSecret; + _authorizationKey = settings.AuthorizationKey; ConfigureHttpClient(); } private void ConfigureHttpClient() { - _privyClient.BaseAddress = new Uri("https://api.privy.io/"); + _privyClient.BaseAddress = new Uri("https://auth.privy.io/"); var authToken = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{_appId}:{_appSecret}")); - // _privyClient.DefaultRequestHeaders.Authorization = - // new AuthenticationHeaderValue("Basic", $"{_appId}:{_appSecret}"); _privyClient.DefaultRequestHeaders.Add("privy-app-id", _appId); - // add custom header - _privyClient.DefaultRequestHeaders.Add("Authorization", authToken); + _privyClient.DefaultRequestHeaders.Add("Authorization", $"Basic {authToken}"); _privyClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); } + /// + /// Generates an authorization signature for a request to the Privy API + /// + /// The full URL for the request + /// The request body + /// The HTTP method to use for the request (defaults to POST) + /// The generated signature + public string GenerateAuthorizationSignature(string url, object body, string httpMethod = "POST") + { + try + { + // Ensure we have a full, absolute URL for signature calculation + string fullUrl; + + if (Uri.TryCreate(url, UriKind.Absolute, out Uri uri)) + { + // Already a full URL + fullUrl = url; + } + else + { + // It's a relative path, so construct the full URL using the base address + string relativePath = url.StartsWith("/") ? url.Substring(1) : url; + fullUrl = new Uri(_privyClient.BaseAddress, relativePath).ToString(); + } + + Console.WriteLine($"Full URL for signature: {fullUrl}"); + + // Create a new dictionary for headers to ensure consistent ordering + var headers = new Dictionary + { + { "privy-app-id", _appId } + }; + + // Create the properly structured payload object according to Privy's specification + var signaturePayload = new Dictionary + { + ["version"] = 1, + ["method"] = httpMethod, + ["url"] = fullUrl, // Use the FULL URL for signature calculation as per Privy docs + ["body"] = body, + ["headers"] = headers + }; + + // Serialize to JSON with consistent settings + // Note: We're not forcing camelCase conversion, preserving original property casing + var options = new JsonSerializerOptions + { + WriteIndented = false, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + PropertyNamingPolicy = null // Preserve original property casing + }; + + string serializedPayload = JsonSerializer.Serialize(signaturePayload, options); + Console.WriteLine($"Request payload for signature: {serializedPayload}"); + + // Use the JSON Canonicalizer to ensure consistent JSON formatting + JsonCanonicalizer jsonCanonicalizer = new JsonCanonicalizer(serializedPayload); + byte[] canonicalizedBytes = jsonCanonicalizer.GetEncodedUTF8(); + string canonicalizedString = jsonCanonicalizer.GetEncodedString(); + Console.WriteLine($"Request jsonCanonicalizer payload for signature: {canonicalizedString}"); + + // Remove the 'wallet-auth:' prefix from the authorization key + string privateKeyAsString = _authorizationKey.Replace("wallet-auth:", ""); + + // Convert the private key to PEM format + string privateKeyAsPem = $"-----BEGIN PRIVATE KEY-----\n{privateKeyAsString}\n-----END PRIVATE KEY-----"; + + // Create a private key object explicitly using ECDSA P-256 curve + using var privateKey = ECDsa.Create(ECCurve.NamedCurves.nistP256); + privateKey.ImportFromPem(privateKeyAsPem); + + // Sign the canonicalized payload buffer with the private key using SHA-256 + // CngAlgorithm.ECDsaP256 is implicitly used through the curve specification above + byte[] signatureBuffer = privateKey.SignData(canonicalizedBytes, HashAlgorithmName.SHA256); + + // Convert the signature to a base64 string + string signature = Convert.ToBase64String(signatureBuffer); + Console.WriteLine($"Generated signature: {signature}"); + + return signature; + } + catch (Exception ex) + { + Console.WriteLine($"Error generating signature: {ex.Message}"); + Console.WriteLine($"Stack trace: {ex.StackTrace}"); + if (ex.InnerException != null) + { + Console.WriteLine($"Inner exception: {ex.InnerException.Message}"); + } + throw new Exception($"Failed to generate authorization signature: {ex.Message}", ex); + } + } + + /// + /// Generates an authorization signature for delegated actions and sends the HTTP request with the same payload + /// + /// The full URL for the request + /// The request body + /// The HTTP method to use for the request (defaults to POST) + /// The HTTP response from the request + private async Task GenerateAuthorizationSignatureAndSendRequestAsync(string url, object body, HttpMethod httpMethod = null) + { + httpMethod ??= HttpMethod.Post; + + try + { + // Ensure we have a full, absolute URL for the request + string fullUrl; + string requestPath; + + if (Uri.TryCreate(url, UriKind.Absolute, out Uri uri)) + { + // Already a full URL + fullUrl = url; + + // For the HTTP request, we need just the path if it matches our base address + if (uri.Host == new Uri(_privyClient.BaseAddress.ToString()).Host) + { + requestPath = uri.PathAndQuery; + } + else + { + // Using a different host than the base address + throw new InvalidOperationException($"URL host {uri.Host} doesn't match base address host {_privyClient.BaseAddress.Host}"); + } + } + else + { + // It's a relative path, so construct the full URL using the base address + string relativePath = url.StartsWith("/") ? url.Substring(1) : url; + fullUrl = new Uri(_privyClient.BaseAddress, relativePath).ToString(); + requestPath = url.StartsWith("/") ? url : $"/{url}"; + } + + Console.WriteLine($"Full URL for signature: {fullUrl}"); + Console.WriteLine($"Request path for HTTP request: {requestPath}"); + + // Generate the authorization signature + string signature = GenerateAuthorizationSignature(fullUrl, body, httpMethod.Method); + + // Prepare the JSON serialization options + var options = new JsonSerializerOptions + { + WriteIndented = false, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + PropertyNamingPolicy = null // Preserve original property casing + }; + + // Create the HTTP request + var request = new HttpRequestMessage(httpMethod, requestPath); + + // Use the same serialization options to ensure the request body is identical to what we signed + var json = JsonSerializer.Serialize(body, options); + + // Create StringContent with explicit Content-Type header + var content = new StringContent(json, Encoding.UTF8); + content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + request.Content = content; + + // Add the headers in the same order we used for signing + request.Headers.Add("privy-app-id", _appId); + request.Headers.Add("privy-authorization-signature", signature); + + // Log all request headers and content for debugging + Console.WriteLine($"Sending request to {fullUrl}"); + Console.WriteLine($"With signature: {signature}"); + Console.WriteLine($"Request content: {json}"); + Console.WriteLine("Request headers:"); + foreach (var header in request.Headers) + { + Console.WriteLine($" {header.Key}: {string.Join(", ", header.Value)}"); + } + if (request.Content != null && request.Content.Headers != null) + { + Console.WriteLine("Content headers:"); + foreach (var header in request.Content.Headers) + { + Console.WriteLine($" {header.Key}: {string.Join(", ", header.Value)}"); + } + } + + // Send the request and return the response + var response = await _privyClient.SendAsync(request); + + // Log response information + Console.WriteLine($"Response status: {response.StatusCode}"); + string responseContent = await response.Content.ReadAsStringAsync(); + Console.WriteLine($"Response content: {responseContent}"); + + return response; + } + catch (Exception ex) + { + Console.WriteLine($"Error sending request: {ex.Message}"); + Console.WriteLine($"Stack trace: {ex.StackTrace}"); + if (ex.InnerException != null) + { + Console.WriteLine($"Inner exception: {ex.InnerException.Message}"); + } + throw new Exception($"Failed to send request: {ex.Message}", ex); + } + } + + /// + /// Adds the authorization signature header to the request + /// + /// + /// This method is kept for backward compatibility. + /// Prefer using GenerateAuthorizationSignatureAndSendRequestAsync which both generates + /// the signature and sends the request with the same payload. + /// + /// The HTTP request message + /// The full URL for the request + /// The request body + private void AddAuthorizationSignatureHeader(HttpRequestMessage request, string url, object body) + { + if (!string.IsNullOrEmpty(_authorizationKey)) + { + string signature = GenerateAuthorizationSignature(url, body); + request.Headers.Add("privy-authorization-signature", signature); + } + } + public async Task CreateWalletAsync(string chainType = "ethereum") { try { - var json = JsonSerializer.Serialize(new { chain_type = chainType }); - var content = new StringContent(json, Encoding.UTF8, "application/json"); + var requestBody = new { chain_type = chainType }; + var url = "https://api.privy.io/v1/wallets"; - var response = await _privyClient.PostAsJsonAsync("/v1/wallets", content); + // Use the new method that both generates the signature and sends the request + var response = await GenerateAuthorizationSignatureAndSendRequestAsync(url, requestBody); var result = new PrivyWallet(); @@ -77,9 +308,242 @@ public class PrivyService : IPrivyService } }; - return await _privyClient.PostAsJsonAsync( - $"/v1/wallets/{walletId}/rpc", - requestBody - ); + var url = $"https://api.privy.io/v1/wallets/{walletId}/rpc"; + + // Use the new method that both generates the signature and sends the request + return await GenerateAuthorizationSignatureAndSendRequestAsync(url, requestBody); + } + + public class PrivyRequest + { + [JsonPropertyName("method")] public string Method { get; set; } + [JsonPropertyName("chain_type")] public string ChainType { get; set; } + [JsonPropertyName("address")] public string Address { get; set; } + [JsonPropertyName("params")] public PrivyParamsRequest Params { get; set; } + } + + public class PrivyParamsRequest + { + [JsonPropertyName("message")] public string Message { get; set; } + [JsonPropertyName("encoding")] public string Encoding { get; set; } + } + + /// + /// Signs a message using the embedded wallet + /// + /// The address of the embedded wallet + /// The message to sign + /// The signing method to use (e.g., "personal_sign", "eth_sign") + /// The signature response + public async Task SignMessageAsync(string embeddedWallet, string message, + string method = "personal_sign") + { + try + { + // Construct the request body using the exact format from Privy documentation + var requestBody = new + { + address = embeddedWallet, + chain_type = "ethereum", + method = method, + @params = new + { + message = message, + encoding = "utf-8" + } + }; + + // The full URL for the Privy RPC endpoint exactly as specified in docs + var url = "https://auth.privy.io/v1/wallets/rpc"; + + // Use the new method that both generates the signature and sends the request + var response = await GenerateAuthorizationSignatureAndSendRequestAsync(url, requestBody); + + // Check for successful response + string responseContent = await response.Content.ReadAsStringAsync(); + + if (!response.IsSuccessStatusCode) + { + throw new Exception($"Failed to sign message: {response.StatusCode} - {responseContent}"); + } + + // Parse the response to get the signature + var responseObject = JsonSerializer.Deserialize(responseContent); + + // Extract the signature from the response + if (responseObject.TryGetProperty("data", out var dataElement)) + { + string signatureResult = dataElement.GetString() ?? string.Empty; + Console.WriteLine($"Extracted signature: {signatureResult}"); + return signatureResult; + } + + throw new Exception($"Invalid signature response format: {responseContent}"); + } + catch (Exception ex) + { + Console.WriteLine($"SignMessageAsync error: {ex}"); + throw new Exception($"Error signing message: {ex.Message}", ex); + } + } + + /// + /// Signs typed data (EIP-712) using the embedded wallet + /// + /// The ID of the wallet to use for signing + /// The typed data to sign (must be a valid JSON string conforming to EIP-712) + /// The CAIP-2 chain identifier + /// The signature + public async Task SignTypedDataAsync(string walletId, string typedData, string caip2 = "eip155:84532") + { + try + { + // Parse the typed data to ensure it's valid JSON + var typedDataJson = JsonSerializer.Deserialize(typedData); + + // Construct the request body according to the Privy documentation + var requestBody = new + { + method = "eth_signTypedData_v4", + caip2, + @params = new[] { walletId, typedData } + }; + + // Construct the full URL for the request + var url = $"https://api.privy.io/v1/wallets/{walletId}/rpc"; + + // Use the new method that both generates the signature and sends the request + var response = await GenerateAuthorizationSignatureAndSendRequestAsync(url, requestBody); + + // Handle the response + if (!response.IsSuccessStatusCode) + { + var errorContent = await response.Content.ReadAsStringAsync(); + throw new Exception($"Failed to sign typed data: {errorContent}"); + } + + // Parse the response to get the signature + var responseContent = await response.Content.ReadAsStringAsync(); + var responseObject = JsonSerializer.Deserialize(responseContent); + + // Extract the signature from the response + if (responseObject.TryGetProperty("data", out var dataElement)) + { + return dataElement.GetString() ?? string.Empty; + } + + throw new Exception($"Invalid signature response format: {responseContent}"); + } + catch (JsonException ex) + { + throw new Exception($"Invalid typed data JSON format: {ex.Message}", ex); + } + catch (Exception ex) + { + throw new Exception($"Error signing typed data: {ex.Message}", ex); + } + } + + /// + /// Gets information about a user, including their linked wallet accounts and delegation status + /// + /// The Privy DID of the user (format: did:privy:XXXXX) + /// User information including wallets and delegation status + public async Task GetUserWalletsAsync(string userDid) + { + if (string.IsNullOrEmpty(userDid)) + { + throw new ArgumentException("User DID cannot be null or empty", nameof(userDid)); + } + + if (!userDid.StartsWith("did:privy:")) + { + throw new ArgumentException("User DID must start with 'did:privy:'", nameof(userDid)); + } + + try + { + // Construct the URL for getting user information + var url = $"/api/v1/users/{userDid}"; + + // Create the HTTP request + var request = new HttpRequestMessage(HttpMethod.Get, url); + + // Send the request + var response = await _privyClient.SendAsync(request); + + // Check for success + if (!response.IsSuccessStatusCode) + { + var errorContent = await response.Content.ReadAsStringAsync(); + throw new Exception($"Failed to get user wallets: {response.StatusCode} - {errorContent}"); + } + + // Parse the response + var responseContent = await response.Content.ReadAsStringAsync(); + Console.WriteLine($"User API Response: {responseContent}"); + + var options = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + }; + + // Parse the response manually to handle potentially unexpected formats + using var document = JsonDocument.Parse(responseContent); + var root = document.RootElement; + + // Create the user info object + var userInfo = new PrivyUserInfo(); + + // Extract the DID + if (root.TryGetProperty("did", out var didElement)) + { + userInfo.Did = didElement.GetString(); + } + + // Extract timestamps if they exist + if (root.TryGetProperty("created_at", out var createdElement) && + createdElement.TryGetInt64(out var createdTimestamp)) + { + userInfo.CreatedAtTimestamp = createdTimestamp; + } + + if (root.TryGetProperty("updated_at", out var updatedElement) && + updatedElement.TryGetInt64(out var updatedTimestamp)) + { + userInfo.UpdatedAtTimestamp = updatedTimestamp; + } + + // Extract linked accounts + if (root.TryGetProperty("linked_accounts", out var accountsArray) && + accountsArray.ValueKind == JsonValueKind.Array) + { + foreach (var accountElement in accountsArray.EnumerateArray()) + { + try + { + var account = + JsonSerializer.Deserialize(accountElement.GetRawText(), options); + if (account != null) + { + userInfo.LinkedAccounts.Add(account); + } + } + catch (Exception ex) + { + Console.WriteLine($"Error deserializing account: {ex.Message}"); + // Continue with the next account if one fails + } + } + } + + return userInfo; + } + catch (Exception ex) + { + throw new Exception($"Error retrieving user wallets: {ex.Message}", ex); + } } } \ No newline at end of file diff --git a/src/Managing.Infrastructure.Web3/Services/Web3ProxyService.cs b/src/Managing.Infrastructure.Web3/Services/Web3ProxyService.cs new file mode 100644 index 0000000..0d52f6d --- /dev/null +++ b/src/Managing.Infrastructure.Web3/Services/Web3ProxyService.cs @@ -0,0 +1,223 @@ +using System.Net.Http.Json; +using Managing.Infrastructure.Evm.Abstractions; +using Microsoft.Extensions.Options; +using System.Text.Json; +using System.Web; +using Managing.Infrastructure.Evm.Models.Proxy; + +namespace Managing.Infrastructure.Evm.Services +{ + public class Web3ProxySettings + { + public string BaseUrl { get; set; } = "http://localhost:3000"; + } + + public class Web3ProxyService : IWeb3ProxyService + { + private readonly HttpClient _httpClient; + private readonly Web3ProxySettings _settings; + private readonly JsonSerializerOptions _jsonOptions; + + public Web3ProxyService(IOptions options) + { + _httpClient = new HttpClient(); + _settings = options.Value; + _jsonOptions = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; + } + + public async Task CallPrivyServiceAsync(string endpoint, object payload) + { + if (!endpoint.StartsWith("/")) + { + endpoint = $"/{endpoint}"; + } + + var url = $"{_settings.BaseUrl}privy{endpoint}"; + + try + { + var response = await _httpClient.PostAsJsonAsync(url, payload, _jsonOptions); + + if (!response.IsSuccessStatusCode) + { + await HandleErrorResponse(response); + } + + return await response.Content.ReadFromJsonAsync(_jsonOptions); + } + catch (Exception ex) when (!(ex is Web3ProxyException)) + { + throw new Web3ProxyException($"Failed to call Privy service at {endpoint}: {ex.Message}"); + } + } + + public async Task GetPrivyServiceAsync(string endpoint, object payload = null) + { + if (!endpoint.StartsWith("/")) + { + endpoint = $"/{endpoint}"; + } + + var url = $"{_settings.BaseUrl}privy{endpoint}"; + + if (payload != null) + { + url += BuildQueryString(payload); + } + + try + { + var response = await _httpClient.GetAsync(url); + + if (!response.IsSuccessStatusCode) + { + await HandleErrorResponse(response); + } + + return await response.Content.ReadFromJsonAsync(_jsonOptions); + } + catch (Exception ex) when (!(ex is Web3ProxyException)) + { + throw new Web3ProxyException($"Failed to get Privy service at {endpoint}: {ex.Message}"); + } + } + + public async Task CallGmxServiceAsync(string endpoint, object payload) + { + if (!endpoint.StartsWith("/")) + { + endpoint = $"/{endpoint}"; + } + + var url = $"{_settings.BaseUrl}gmx{endpoint}"; + + try + { + var response = await _httpClient.PostAsJsonAsync(url, payload, _jsonOptions); + + if (!response.IsSuccessStatusCode) + { + await HandleErrorResponse(response); + } + + return await response.Content.ReadFromJsonAsync(_jsonOptions); + } + catch (Exception ex) when (!(ex is Web3ProxyException)) + { + throw new Web3ProxyException($"Failed to call GMX service at {endpoint}: {ex.Message}"); + } + } + + public async Task GetGmxServiceAsync(string endpoint, object payload = null) + { + if (!endpoint.StartsWith("/")) + { + endpoint = $"/{endpoint}"; + } + + var url = $"{_settings.BaseUrl}gmx{endpoint}"; + + if (payload != null) + { + url += BuildQueryString(payload); + } + + try + { + var response = await _httpClient.GetAsync(url); + + if (!response.IsSuccessStatusCode) + { + await HandleErrorResponse(response); + } + + return await response.Content.ReadFromJsonAsync(_jsonOptions); + } + catch (Exception ex) when (!(ex is Web3ProxyException)) + { + throw new Web3ProxyException($"Failed to get GMX service at {endpoint}: {ex.Message}"); + } + } + + private async Task HandleErrorResponse(HttpResponseMessage response) + { + var statusCode = (int)response.StatusCode; + + try + { + // Try to parse as the Web3Proxy error format (success: false, error: string) + var content = await response.Content.ReadAsStringAsync(); + var errorResponse = await response.Content.ReadFromJsonAsync(_jsonOptions); + + if (errorResponse != null && !errorResponse.Success && !string.IsNullOrEmpty(errorResponse.Error)) + { + // Handle the standard Web3Proxy error format + throw new Web3ProxyException(errorResponse.Error); + } + + // Fallback for other error formats + try + { + // Try to parse as structured error if it doesn't match the simple format + var structuredErrorResponse = await response.Content.ReadFromJsonAsync(_jsonOptions); + + if (structuredErrorResponse?.ErrorDetails != null) + { + structuredErrorResponse.ErrorDetails.StatusCode = statusCode; + throw new Web3ProxyException(structuredErrorResponse.ErrorDetails); + } + } + catch + { + // If we couldn't parse as structured error, use the simple error or fallback + throw new Web3ProxyException($"HTTP error {statusCode}: {content}"); + } + } + catch (Exception ex) when (!(ex is Web3ProxyException)) + { + // If we couldn't parse the error as JSON or another issue occurred + var content = await response.Content.ReadAsStringAsync(); + throw new Web3ProxyException($"HTTP error {statusCode}: {content}"); + } + } + + private string BuildQueryString(object payload) + { + var properties = payload.GetType().GetProperties(); + if (properties.Length == 0) + { + return string.Empty; + } + + var queryString = new System.Text.StringBuilder("?"); + bool isFirst = true; + + foreach (var prop in properties) + { + var value = prop.GetValue(payload); + if (value != null) + { + if (!isFirst) + { + queryString.Append("&"); + } + + var paramName = prop.Name; + // Apply camelCase to match JSON property naming + paramName = char.ToLowerInvariant(paramName[0]) + paramName.Substring(1); + + queryString.Append(HttpUtility.UrlEncode(paramName)); + queryString.Append("="); + queryString.Append(HttpUtility.UrlEncode(value.ToString())); + + isFirst = false; + } + } + + return queryString.ToString(); + } + } +} \ No newline at end of file diff --git a/src/Managing.Pinky/.env b/src/Managing.Pinky/.env new file mode 100644 index 0000000..6128ea3 --- /dev/null +++ b/src/Managing.Pinky/.env @@ -0,0 +1,7 @@ +VITE_API_URL_LOCAL=http://localhost:5000 +VITE_API_URL_SERVER=https://dev-managing-api.apps.managing.live +VITE_WORKER_URL_LOCAL=https://localhost:5002 +VITE_WORKER_URL_SERVER=https://dev-managing-worker.apps.managing.live +ALCHEMY_ID=Bao7OirVe4bmYiDbPh0l8cs5gYb5D4_9 +WALLET_CONNECT_PROJECT_ID=363bf09c10fec2293b21ee199b2ce8d5 +VITE_PRIVY_APP_ID=cm7u09v0u002zrkuf2yjjr58p diff --git a/src/Managing.Pinky/.eslintignore b/src/Managing.Pinky/.eslintignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/src/Managing.Pinky/.eslintignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/src/Managing.Pinky/.eslintrc b/src/Managing.Pinky/.eslintrc new file mode 100644 index 0000000..2d7c78b --- /dev/null +++ b/src/Managing.Pinky/.eslintrc @@ -0,0 +1,98 @@ +{ + "root": true, + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:jsx-a11y/recommended" + ], + "parser": "@typescript-eslint/parser", + "plugins": [ + "jsx-a11y", + "import", + "sort-keys-fix", + "react-hooks", + "@typescript-eslint", + "prettier" + ], + "env": { + "browser": true, + "node": true, + "es6": true, + "jest": true + }, + "globals": { + "JSX": "readonly" + }, + "settings": { + "react": { + "version": "detect" + }, + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"] + }, + "import/resolver": { + "node": { + "extensions": [".js", ".jsx", ".ts", ".tsx"] + }, + "typescript": { + "alwaysTryTypes": true, + // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + "project": ["tsconfig.json"] + } + } + }, + "rules": { + "no-alert": "error", + "no-console": "error", + "react-hooks/rules-of-hooks": "error", + "prettier/prettier": [ + "warn", + {}, + { + "properties": { + "usePrettierrc": true + } + } + ], + "import/order": [ + "warn", + { + "groups": [ + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", + "object" + ], + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": true + } + } + ], + "import/named": "error", + "import/default": "error", + "import/export": "error", + "import/no-named-as-default": "warn", + "import/no-duplicates": "error", + "sort-keys-fix/sort-keys-fix": "warn", + "@import/no-named-as-default-member": "off", + "@typescript-eslint/consistent-type-imports": "warn", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-empty-function": "off" + }, + "overrides": [ + { + "files": ["*.js"], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": ["off"], + "@typescript-eslint/no-var-requires": ["off"] + } + } + ] +} diff --git a/src/Managing.Pinky/.gitattributes b/src/Managing.Pinky/.gitattributes new file mode 100644 index 0000000..2dd6f4d --- /dev/null +++ b/src/Managing.Pinky/.gitattributes @@ -0,0 +1,3 @@ +.jest/* linguist-vendored +mocks/* linguist-vendored +mockServiceWorker.js linguist-vendored diff --git a/src/Managing.Pinky/.github/workflows/build.yml b/src/Managing.Pinky/.github/workflows/build.yml new file mode 100644 index 0000000..cf9565c --- /dev/null +++ b/src/Managing.Pinky/.github/workflows/build.yml @@ -0,0 +1,18 @@ +name: Build +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: '18.1.0' + - run: yarn install + - run: yarn build diff --git a/src/Managing.Pinky/.github/workflows/lint.yml b/src/Managing.Pinky/.github/workflows/lint.yml new file mode 100644 index 0000000..d84f5b7 --- /dev/null +++ b/src/Managing.Pinky/.github/workflows/lint.yml @@ -0,0 +1,18 @@ +name: Lint +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: '18.1.0' + - run: yarn install + - run: yarn lint diff --git a/src/Managing.Pinky/.github/workflows/test.yml b/src/Managing.Pinky/.github/workflows/test.yml new file mode 100644 index 0000000..c409935 --- /dev/null +++ b/src/Managing.Pinky/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Test +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: '18.1.0' + - run: yarn install + - run: yarn test diff --git a/src/Managing.Pinky/.github/workflows/typecheck.yml b/src/Managing.Pinky/.github/workflows/typecheck.yml new file mode 100644 index 0000000..eeb1640 --- /dev/null +++ b/src/Managing.Pinky/.github/workflows/typecheck.yml @@ -0,0 +1,18 @@ +name: Typecheck +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: '18.1.0' + - run: yarn install + - run: yarn typecheck diff --git a/src/Managing.Pinky/.gitignore b/src/Managing.Pinky/.gitignore new file mode 100644 index 0000000..d451ff1 --- /dev/null +++ b/src/Managing.Pinky/.gitignore @@ -0,0 +1,5 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local diff --git a/src/Managing.Pinky/.prettierignore b/src/Managing.Pinky/.prettierignore new file mode 100644 index 0000000..4969764 --- /dev/null +++ b/src/Managing.Pinky/.prettierignore @@ -0,0 +1,5 @@ +.git +node_modules +.eslintignore +.gitignore +LICENSE diff --git a/src/Managing.Pinky/.prettierrc b/src/Managing.Pinky/.prettierrc new file mode 100644 index 0000000..fd496a8 --- /dev/null +++ b/src/Managing.Pinky/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "semi": false +} diff --git a/src/Managing.Pinky/Dockerfile b/src/Managing.Pinky/Dockerfile new file mode 100644 index 0000000..1d1c6bf --- /dev/null +++ b/src/Managing.Pinky/Dockerfile @@ -0,0 +1,42 @@ +# Use an official Node.js image as the base +FROM node:18-alpine + +# Set the working directory in the container +WORKDIR /app + +# Set environment variable to skip Chromium download +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true + +# Install git and Python +RUN apk update && apk add --no-cache git python3 make g++ + +# Create a symlink for python3 as python +RUN ln -sf /usr/bin/python3 /usr/bin/python + +# Copy package.json and package-lock.json to the container +# COPY package*.json ./ +COPY /src/Managing.WebApp/package.json ./ + +# Install dependencies with the --legacy-peer-deps flag to bypass peer dependency conflicts +RUN npm install --legacy-peer-deps +RUN npm install -g tailwindcss postcss autoprefixer @tailwindcss/typography + +# Copy the rest of the app's source code to the container +# COPY . . +COPY src/Managing.WebApp/ /app/ +RUN node --max-old-space-size=8192 ./node_modules/.bin/vite build + +# Build the app +RUN npm run build + +# Use NGINX as the web server +FROM nginx:alpine + +# Copy the built app to the NGINX web server directory +COPY --from=0 /app/build /usr/share/nginx/html + +# Expose port 80 for the NGINX web server +EXPOSE 80 + +# Start the NGINX web server +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/src/Managing.Pinky/Dockerfile-pinky b/src/Managing.Pinky/Dockerfile-pinky new file mode 100644 index 0000000..e31729a --- /dev/null +++ b/src/Managing.Pinky/Dockerfile-pinky @@ -0,0 +1,44 @@ +# Use an official Node.js image as the base +FROM node:18-alpine + +# Set the working directory in the container +WORKDIR /app + +# Set environment variable to skip Chromium download +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true + +# Install git and Python +RUN apk update && apk add --no-cache git python3 make g++ + +# Create a symlink for python3 as python +RUN ln -sf /usr/bin/python3 /usr/bin/python + +# Copy package.json and package-lock.json to the container +# COPY package*.json ./ +COPY /src/Managing.Pinky/package.json ./ + +# Install dependencies with the --legacy-peer-deps flag to bypass peer dependency conflicts +RUN npm install --legacy-peer-deps +RUN npm install -g tailwindcss postcss autoprefixer @tailwindcss/typography + +# Copy the rest of the app's source code to the container +# COPY . . +RUN ls -la +COPY src/Managing.Pinky/ . +RUN node --max-old-space-size=8192 ./node_modules/.bin/vite build + +# Build the app +RUN npm run build + +# Use NGINX as the web server +FROM nginx:alpine + +# Copy the built app to the NGINX web server directory +# COPY --from=0 /app/build /usr/share/nginx/html +COPY --from=0 /app/dist /usr/share/nginx/html + +# Expose port 80 for the NGINX web server +EXPOSE 80 + +# Start the NGINX web server +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/src/Managing.Pinky/LICENSE b/src/Managing.Pinky/LICENSE new file mode 100644 index 0000000..b229c5f --- /dev/null +++ b/src/Managing.Pinky/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Managing + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Managing.Pinky/README.md b/src/Managing.Pinky/README.md new file mode 100644 index 0000000..5be74be --- /dev/null +++ b/src/Managing.Pinky/README.md @@ -0,0 +1,94 @@ +# vite-react-ts-extended [![Typecheck](https://github.com/laststance/vite-react-ts-extended/actions/workflows/typecheck.yml/badge.svg)](https://github.com/laststance/vite-react-ts-extended/actions/workflows/typecheck.yml) [![Test](https://github.com/laststance/vite-react-ts-extended/actions/workflows/test.yml/badge.svg)](https://github.com/laststance/vite-react-ts-extended/actions/workflows/test.yml) [![Build](https://github.com/laststance/vite-react-ts-extended/actions/workflows/build.yml/badge.svg)](https://github.com/laststance/vite-react-ts-extended/actions/workflows/build.yml) [![Lint](https://github.com/laststance/vite-react-ts-extended/actions/workflows/lint.yml/badge.svg)](https://github.com/laststance/vite-react-ts-extended/actions/workflows/lint.yml) [![Depfu](https://badges.depfu.com/badges/6c7775918ccc8647160750e168617a65/overview.svg)](https://depfu.com/github/laststance/vite-react-ts-extended?project_id=32682) + +> My CRA alternative. +> Create plain and lightweight React+TS programming environment with familiar pre-setup tooling +> eslint/prettier, jest/TS/react-testing-library/msw, tailwindcss, CI. + +## [Trying this Online!](https://codesandbox.io/s/vite-react-ts-extended-cbgyfz?file=/src/App.tsx) + + + +This is the official [Vite](https://vitejs.dev/) template(`npm init vite@latest myapp -- --template react-ts`) and some extended setup. + +- [eslint-typescript](https://github.com/typescript-eslint/typescript-eslint) and [Prettier](https://prettier.io/) integration. Rules are 100% my personal setup 💅 +- [jest](https://jestjs.io/), [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/), [react-hooks-testing-library](https://github.com/testing-library/react-hooks-testing-library), [MSW](https://mswjs.io/) +- [tailwindcss](https://tailwindcss.com/) +- [Github Actions](https://github.com/features/actions) + +All npm package are keeping least release version powered by [Depfu](https://depfu.com/). + +# Installation + +``` +npx degit laststance/vite-react-ts-extended myapp +``` + +### yarn + +```sh +cd myapp +yarn install +yarn validate # The installation was successful if no error occurs after running 'validate'. +yarn dev +``` + +### npm + +```sh +cd myapp +npm install +npm run validate # The installation was successful if no error occurs after running 'validate'. +npm run dev +``` + +### Commands + +```sh +yarn dev # start development server +yarn validate # run test,lint,build,typecheck concurrently +yarn test # run jest +yarn lint # run eslint +yarn lint:fix # run eslint with --fix option +yarn typecheck # run TypeScript compiler check +yarn build # build production bundle to 'dist' directly +yarn prettier # run prettier for json|yml|css|md|mdx files +yarn clean # remove 'node_modules' 'yarn.lock' 'dist' completely +yarn serve # launch server for production bundle in local +``` + +# Background + +The evolution of the React framework is accelerating more than ever before. +[Next.js](https://nextjs.org/), [Remix](https://remix.run/), [RedwoodJS](https://redwoodjs.com/), [Gatsby](https://www.gatsbyjs.com/), [Blitz](https://blitzjs.com/) etc... + +Ahthough I still need plain React programming starter some reason. (.e.g Demo, Experiment like Deep Dive React Core.) +So far, [create-react-app](https://github.com/facebook/create-react-app) **was** it. +In short, [create-react-app](https://github.com/facebook/create-react-app) development couldn't say active. Please read the [Issue](https://github.com/facebook/create-react-app/issues/11180) in details. + +So I created an alternative to [create-react-app](https://github.com/facebook/create-react-app) for myself, based on [Vite](https://github.com/facebook/create-react-app). +This project contains my very opinionted setup, +but I hope it will be a useful tool for people who have similar needs to mine! 😀 + +# License + +MIT + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + +

ryota-murakami

💻 📖 ⚠️
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/src/Managing.Pinky/index.html b/src/Managing.Pinky/index.html new file mode 100644 index 0000000..9177d83 --- /dev/null +++ b/src/Managing.Pinky/index.html @@ -0,0 +1,493 @@ + + + + + + Happy Birthday My Love + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + +
+ + +
+
+
+ Rooftop pixel art +
+

Happy Birthday My Love!

+

Our journey together began on a rooftop...

+

Where we first met under the stars ✨

+
+ Pixel heart +
+
+
+ +
+
+
+ Park pixel art +
+

Our First Date

+

Walking in the park together

+

I knew then you were special 💕

+
+ You + Her +
+
+
+ +
+
+
+ Kitchen pixel art +
+

Our First Cooking Night

+

Making dinner together in your kitchen

+

Simple moments that mean everything 🍳

+
+ Pixel heart +
+
+
+ +
+
+
+ Chinese restaurant pixel art +
+

Chinese Restaurant

+

"I like to try things"

+

And trying life with you has been the best adventure 🥢

+
+ Pixel heart +
+
+
+ +
+
+
+ Kao Sok pixel art +
+

Kao Sok Adventure

+

Our trip to Kao Sok with my best friend

+

Sharing my world with you 🌿

+
+ Pixel jungle +
+
+
+ +
+
+
+ Kuala Lumpur pixel art +
+

Kuala Lumpur

+

Joining you during your work trip

+

Because every moment with you is precious 🌆

+
+ Pixel heart +
+
+
+ +
+
+
+ France pixel art +
+

Time Apart

+

Me leaving for France

+

You facing work difficulties

+

Remember to take time for yourself

+

Your health and happiness matter most 💖

+
+
+ +
+
+
+ Birthday kiss pixel art +
+

Happy Birthday!

+

Back together in Bangkok

+

Celebrating you on your special day 🎂

+
+ Pixel heart +
+

I love you more than words can say

+

(Tap the heart below)

+
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/src/Managing.Pinky/install_problematic_packages.sh b/src/Managing.Pinky/install_problematic_packages.sh new file mode 100644 index 0000000..62a600e --- /dev/null +++ b/src/Managing.Pinky/install_problematic_packages.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Array of known potentially hanging packages +hanging_packages=("xmlhttprequest-ssl@latest" "engine.io-parser@latest") + +# Timeout in seconds for each package installation attempt + + +install_with_timeout() { + package=$1 + echo "Attempting to install $package with a timeout of $timeout_duration seconds." + # Start npm install in the background + npm install $package --verbose &> $package.log & + + # Get PID of the npm process + pid=$! + + # Wait for the npm process to finish or timeout + (sleep $timeout_duration && kill -0 $pid 2>/dev/null && kill -9 $pid && echo "Timeout reached for $package, process killed." && echo $package >> exclude.log) & + waiter_pid=$! + + # Wait for the npm process to complete + wait $pid + + # Kill the waiter process in case npm finished before the timeout + kill -0 $waiter_pid 2>/dev/null && kill -9 $waiter_pid +} + +# Install potentially hanging packages first with a timeout +for package in "${hanging_packages[@]}"; do + install_with_timeout $package +done diff --git a/src/Managing.Pinky/jest.config.js b/src/Managing.Pinky/jest.config.js new file mode 100644 index 0000000..dd7f4d9 --- /dev/null +++ b/src/Managing.Pinky/jest.config.js @@ -0,0 +1,35 @@ +const config = { + collectCoverageFrom: ['/src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts'], + moduleDirectories: ['node_modules'], + moduleFileExtensions: ['js', 'mjs', 'jsx', 'ts', 'tsx', 'json'], + moduleNameMapper: { + '^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy', + }, + notify: true, + notifyMode: 'success-change', + resetMocks: true, + roots: [''], + setupFilesAfterEnv: ['/jest/setupTests.ts'], + testEnvironment: 'jsdom', + testMatch: [ + '/src/**/*.{spec,test}.{js,jsx,ts,tsx}', + '/src/**/__tests__/**/*.{js,jsx,ts,tsx}', + ], + transform: { + '^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': + '/jest/fileTransform.js', + '^.+\\.[jt]sx?$': 'esbuild-jest', + '^.+\\.css$': '/jest/cssTransform.js', + }, + transformIgnorePatterns: [ + '[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$', + '^.+\\.module\\.(css|sass|scss)$', + ], + verbose: true, + watchPlugins: [ + 'jest-watch-typeahead/filename', + 'jest-watch-typeahead/testname', + ], +} + +module.exports = config diff --git a/src/Managing.Pinky/package-lock.json b/src/Managing.Pinky/package-lock.json new file mode 100644 index 0000000..ee30f02 --- /dev/null +++ b/src/Managing.Pinky/package-lock.json @@ -0,0 +1,3400 @@ +{ + "name": "managing", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "managing", + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "@heroicons/react": "^1.0.6", + "@tailwindcss/typography": "^0.5.0", + "@tanstack/react-query": "^5.67.1", + "autoprefixer": "^10.4.7", + "classnames": "^2.3.1", + "jotai": "^1.6.7", + "latest-version": "^9.0.0" + }, + "devDependencies": { + "@types/elliptic": "^6.4.18", + "@types/react": "^18.0.9", + "@types/react-dom": "^18.0.4", + "@types/react-grid-layout": "^1.3.2", + "@types/react-plotly.js": "^2.6.0", + "@types/react-slider": "^1.3.1", + "@types/react-table": "^7.7.12", + "@vitejs/plugin-react": "^1.3.2", + "autoprefixer": "^10.4.7", + "daisyui": "^3.5.1", + "postcss": "^8.4.13", + "prettier": "^2.6.1", + "prettier-plugin-tailwind-css": "^1.5.0", + "tailwindcss": "^3.0.23", + "typescript": "^5.7.3", + "vite": "^6.0.11" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", + "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.10", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.10", + "@babel/parser": "^7.26.10", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.10", + "@babel/types": "^7.26.10", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "devOptional": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz", + "integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.0.tgz", + "integrity": "sha512-LVk7fbXml0H2xH34dFzKQ7TDZ2G4/rVTOrq9V+icbbadjbVxxeFeDsNHv2SrZeWoA+6ZiTyWYWtScEIW07EAcA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.8", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "devOptional": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz", + "integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.9.tgz", + "integrity": "sha512-s5XwpQYCqGerXl+Pu6VDL3x0j2d82eiV77UJ8a2mDHAW7j9SWRqQ2y1fNo1Z74CdcYipl5Z41zvjj4Nfzq36rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/plugin-syntax-jsx": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.25.9.tgz", + "integrity": "sha512-9mj6rm7XVYs4mdLIpbZnHOYdpW42uoiBCTVowg7sP1thUOiANgMb4UtpRivR0pp5iL+ocvUv7X4mZgFRpJEzGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.25.9.tgz", + "integrity": "sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.25.9.tgz", + "integrity": "sha512-+iqjT8xmXhhYv4/uiYd8FNQsraMFZIfxVSqxxVSZP0WbbSAWvBXAul0m/zu+7Vv4O/3WtApy9pmaTMiumEZgfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.0.tgz", + "integrity": "sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.27.0", + "@babel/parser": "^7.27.0", + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", + "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.2.tgz", + "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", + "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.2.tgz", + "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", + "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", + "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", + "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", + "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", + "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", + "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", + "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", + "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", + "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", + "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", + "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", + "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", + "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", + "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", + "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", + "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", + "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", + "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", + "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", + "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", + "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@heroicons/react": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-1.0.6.tgz", + "integrity": "sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ==", + "peerDependencies": { + "react": ">= 16" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pnpm/config.env-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", + "license": "MIT", + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", + "license": "MIT", + "dependencies": { + "graceful-fs": "4.2.10" + }, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "license": "ISC" + }, + "node_modules/@pnpm/npm-conf": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", + "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", + "license": "MIT", + "dependencies": { + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.0.tgz", + "integrity": "sha512-Eeao7ewDq79jVEsrtWIj5RNqB8p2knlm9fhR6uJ2gqP7UfbLrTrxevudVrEPDM7Wkpn/HpRC2QfazH7MXLz3vQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.0.tgz", + "integrity": "sha512-yVh0Kf1f0Fq4tWNf6mWcbQBCLDpDrDEl88lzPgKhrgTcDrTtlmun92ywEF9dCjmYO3EFiSuJeeo9cYRxl2FswA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.0.tgz", + "integrity": "sha512-gCs0ErAZ9s0Osejpc3qahTsqIPUDjSKIyxK/0BGKvL+Tn0n3Kwvj8BrCv7Y5sR1Ypz1K2qz9Ny0VvkVyoXBVUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.0.tgz", + "integrity": "sha512-aIB5Anc8hngk15t3GUkiO4pv42ykXHfmpXGS+CzM9CTyiWyT8HIS5ygRAy7KcFb/wiw4Br+vh1byqcHRTfq2tQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.0.tgz", + "integrity": "sha512-kpdsUdMlVJMRMaOf/tIvxk8TQdzHhY47imwmASOuMajg/GXpw8GKNd8LNwIHE5Yd1onehNpcUB9jHY6wgw9nHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.0.tgz", + "integrity": "sha512-D0RDyHygOBCQiqookcPevrvgEarN0CttBecG4chOeIYCNtlKHmf5oi5kAVpXV7qs0Xh/WO2RnxeicZPtT50V0g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.0.tgz", + "integrity": "sha512-mCIw8j5LPDXmCOW8mfMZwT6F/Kza03EnSr4wGYEswrEfjTfVsFOxvgYfuRMxTuUF/XmRb9WSMD5GhCWDe2iNrg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.0.tgz", + "integrity": "sha512-AwwldAu4aCJPob7zmjuDUMvvuatgs8B/QiVB0KwkUarAcPB3W+ToOT+18TQwY4z09Al7G0BvCcmLRop5zBLTag==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.0.tgz", + "integrity": "sha512-e7kDUGVP+xw05pV65ZKb0zulRploU3gTu6qH1qL58PrULDGxULIS0OSDQJLH7WiFnpd3ZKUU4VM3u/Z7Zw+e7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.0.tgz", + "integrity": "sha512-SXYJw3zpwHgaBqTXeAZ31qfW/v50wq4HhNVvKFhRr5MnptRX2Af4KebLWR1wpxGJtLgfS2hEPuALRIY3LPAAcA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.0.tgz", + "integrity": "sha512-e5XiCinINCI4RdyU3sFyBH4zzz7LiQRvHqDtRe9Dt8o/8hTBaYpdPimayF00eY2qy5j4PaaWK0azRgUench6WQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.0.tgz", + "integrity": "sha512-3SWN3e0bAsm9ToprLFBSro8nJe6YN+5xmB11N4FfNf92wvLye/+Rh5JGQtKOpwLKt6e61R1RBc9g+luLJsc23A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.0.tgz", + "integrity": "sha512-B1Oqt3GLh7qmhvfnc2WQla4NuHlcxAD5LyueUi5WtMc76ZWY+6qDtQYqnxARx9r+7mDGfamD+8kTJO0pKUJeJA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.0.tgz", + "integrity": "sha512-UfUCo0h/uj48Jq2lnhX0AOhZPSTAq3Eostas+XZ+GGk22pI+Op1Y6cxQ1JkUuKYu2iU+mXj1QjPrZm9nNWV9rg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.0.tgz", + "integrity": "sha512-chZLTUIPbgcpm+Z7ALmomXW8Zh+wE2icrG+K6nt/HenPLmtwCajhQC5flNSk1Xy5EDMt/QAOz2MhzfOfJOLSiA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.0.tgz", + "integrity": "sha512-jo0UolK70O28BifvEsFD/8r25shFezl0aUk2t0VJzREWHkq19e+pcLu4kX5HiVXNz5qqkD+aAq04Ct8rkxgbyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.0.tgz", + "integrity": "sha512-Vmg0NhAap2S54JojJchiu5An54qa6t/oKT7LmDaWggpIcaiL8WcWHEN6OQrfTdL6mQ2GFyH7j2T5/3YPEDOOGA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.0.tgz", + "integrity": "sha512-CV2aqhDDOsABKHKhNcs1SZFryffQf8vK2XrxP6lxC99ELZAdvsDgPklIBfd65R8R+qvOm1SmLaZ/Fdq961+m7A==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.0.tgz", + "integrity": "sha512-g2ASy1QwHP88y5KWvblUolJz9rN+i4ZOsYzkEwcNfaNooxNUXG+ON6F5xFo0NIItpHqxcdAyls05VXpBnludGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.16.tgz", + "integrity": "sha512-0wDLwCVF5V3x3b1SGXPCDcdsbDHMBe+lkFzBRaHeLvNi+nrrnZ1lA18u+OTWO8iSWU2GxUOCvlXtDuqftc1oiA==", + "license": "MIT", + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.72.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.72.0.tgz", + "integrity": "sha512-aa3p6Mou++JLLxxxVX9AB9uGeRIGc0JWkw96GASXuMG8K3D+JpYbSFcqXbkGFJ1eX2jKHPurmCBoO43RjjXJCA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.72.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.72.0.tgz", + "integrity": "sha512-4Dejq/IiXrPlr/0xxj4H2GbC6KckwfTCoHWbd02+UoIV0laC9yke0d0KegmFdXJA712I6UCuy8WpPM76uuPJ+w==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.72.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/@types/bn.js": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.6.tgz", + "integrity": "sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/elliptic": { + "version": "6.4.18", + "resolved": "https://registry.npmjs.org/@types/elliptic/-/elliptic-6.4.18.tgz", + "integrity": "sha512-UseG6H5vjRiNpQvrhy4VF/JXdA3V/Fp5amvveaL+fs28BZ6xIKJBPnUPRlEaZpysD9MbpfaLi8lbl7PGUAkpWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/bn.js": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "22.13.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.0.tgz", + "integrity": "sha512-ClIbNe36lawluuvq3+YYhnIN2CELi+6q8NpnM7PYp4hBn/TatfboPgVSm2rwKRfnV2M+Ty9GWDFI64KEe+kysA==", + "dev": true, + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/plotly.js": { + "version": "2.35.4", + "resolved": "https://registry.npmjs.org/@types/plotly.js/-/plotly.js-2.35.4.tgz", + "integrity": "sha512-A8d3r8I2vIsaMRJ+0ZLvzW98l4vDu5AuLAWwtWSF61ekqUj3q6Hu0w6RQk+S1fumu7A3Fji+aodta4F9+8BMuA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.14", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz", + "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.20", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.20.tgz", + "integrity": "sha512-IPaCZN7PShZK/3t6Q87pfTkRm6oLTd4vztyoj+cbHUF1g3FfVb2tFIL79uCRKEfv16AhqDMBywP2VW3KIZUvcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.6", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.6.tgz", + "integrity": "sha512-nf22//wEbKXusP6E9pfOCDwFdHAX4u172eaJI4YkDRQEZiorm6KfYnSC2SWLDMVWUOWPERmJnN0ujeAfTBLvrw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@types/react-grid-layout": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/react-grid-layout/-/react-grid-layout-1.3.5.tgz", + "integrity": "sha512-WH/po1gcEcoR6y857yAnPGug+ZhkF4PaTUxgAbwfeSH/QOgVSakKHBXoPGad/sEznmkiaK3pqHk+etdWisoeBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/react-plotly.js": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@types/react-plotly.js/-/react-plotly.js-2.6.3.tgz", + "integrity": "sha512-HBQwyGuu/dGXDsWhnQrhH+xcJSsHvjkwfSRjP+YpOsCCWryIuXF78ZCBjpfgO3sCc0Jo8sYp4NOGtqT7Cn3epQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/plotly.js": "*", + "@types/react": "*" + } + }, + "node_modules/@types/react-slider": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@types/react-slider/-/react-slider-1.3.6.tgz", + "integrity": "sha512-RS8XN5O159YQ6tu3tGZIQz1/9StMLTg/FCIPxwqh2gwVixJnlfIodtVx+fpXVMZHe7A58lAX1Q4XTgAGOQaCQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/react-table": { + "version": "7.7.20", + "resolved": "https://registry.npmjs.org/@types/react-table/-/react-table-7.7.20.tgz", + "integrity": "sha512-ahMp4pmjVlnExxNwxyaDrFgmKxSbPwU23sGQw2gJK4EhCvnvmib2s/O/+y1dfV57dXOwpr2plfyBol+vEHbi2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-1.3.2.tgz", + "integrity": "sha512-aurBNmMo0kz1O4qRoY+FM4epSA39y3ShWGuqfLRA/3z0oEJAdtoSfgA3aO98/PCCHAqMaduLxIxErWrVKIFzXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.17.10", + "@babel/plugin-transform-react-jsx": "^7.17.3", + "@babel/plugin-transform-react-jsx-development": "^7.16.7", + "@babel/plugin-transform-react-jsx-self": "^7.16.7", + "@babel/plugin-transform-react-jsx-source": "^7.16.7", + "@rollup/pluginutils": "^4.2.1", + "react-refresh": "^0.13.0", + "resolve": "^1.22.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" + }, + "node_modules/autoprefixer": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "devOptional": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001696", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz", + "integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==", + "devOptional": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "license": "MIT", + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-selector-tokenizer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.8.0.tgz", + "integrity": "sha512-Jd6Ig3/pe62/qe5SBPTN8h8LeUg/pT4lLgtavPf7updwwHpvFzxvOQBHYj2LZDMjUnBzgvIUSjRcf6oT5HzHFg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "fastparse": "^1.1.2" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/daisyui": { + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-3.9.4.tgz", + "integrity": "sha512-fvi2RGH4YV617/6DntOVGcOugOPym9jTGWW2XySb5ZpvdWO4L7bEG77VHirrnbRUEWvIEVXkBpxUz2KFj0rVnA==", + "dev": true, + "dependencies": { + "colord": "^2.9", + "css-selector-tokenizer": "^0.8", + "postcss": "^8", + "postcss-js": "^4", + "tailwindcss": "^3.1" + }, + "engines": { + "node": ">=16.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/daisyui" + } + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.90", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.90.tgz", + "integrity": "sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==", + "devOptional": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/esbuild": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", + "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.2", + "@esbuild/android-arm": "0.24.2", + "@esbuild/android-arm64": "0.24.2", + "@esbuild/android-x64": "0.24.2", + "@esbuild/darwin-arm64": "0.24.2", + "@esbuild/darwin-x64": "0.24.2", + "@esbuild/freebsd-arm64": "0.24.2", + "@esbuild/freebsd-x64": "0.24.2", + "@esbuild/linux-arm": "0.24.2", + "@esbuild/linux-arm64": "0.24.2", + "@esbuild/linux-ia32": "0.24.2", + "@esbuild/linux-loong64": "0.24.2", + "@esbuild/linux-mips64el": "0.24.2", + "@esbuild/linux-ppc64": "0.24.2", + "@esbuild/linux-riscv64": "0.24.2", + "@esbuild/linux-s390x": "0.24.2", + "@esbuild/linux-x64": "0.24.2", + "@esbuild/netbsd-arm64": "0.24.2", + "@esbuild/netbsd-x64": "0.24.2", + "@esbuild/openbsd-arm64": "0.24.2", + "@esbuild/openbsd-x64": "0.24.2", + "@esbuild/sunos-x64": "0.24.2", + "@esbuild/win32-arm64": "0.24.2", + "@esbuild/win32-ia32": "0.24.2", + "@esbuild/win32-x64": "0.24.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "devOptional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastparse": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", + "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", + "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/jotai": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/jotai/-/jotai-1.13.1.tgz", + "integrity": "sha512-RUmH1S4vLsG3V6fbGlKzGJnLrDcC/HNb5gH2AeA9DzuJknoVxSGvvg8OBB7lke+gDc4oXmdVsaKn/xDUhWZ0vw==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@babel/core": "*", + "@babel/template": "*", + "jotai-devtools": "*", + "jotai-immer": "*", + "jotai-optics": "*", + "jotai-redux": "*", + "jotai-tanstack-query": "*", + "jotai-urql": "*", + "jotai-valtio": "*", + "jotai-xstate": "*", + "jotai-zustand": "*", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@babel/template": { + "optional": true + }, + "jotai-devtools": { + "optional": true + }, + "jotai-immer": { + "optional": true + }, + "jotai-optics": { + "optional": true + }, + "jotai-redux": { + "optional": true + }, + "jotai-tanstack-query": { + "optional": true + }, + "jotai-urql": { + "optional": true + }, + "jotai-valtio": { + "optional": true + }, + "jotai-xstate": { + "optional": true + }, + "jotai-zustand": { + "optional": true + } + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "devOptional": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "devOptional": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ky": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/ky/-/ky-1.8.0.tgz", + "integrity": "sha512-DoKGmG27nT8t/1F9gV8vNzggJ3mLAyD49J8tTMWHeZvS8qLc7GlyTieicYtFzvDznMe/q2u38peOjkWc5/pjvw==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/ky?sponsor=1" + } + }, + "node_modules/latest-version": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-9.0.0.tgz", + "integrity": "sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA==", + "license": "MIT", + "dependencies": { + "package-json": "^10.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, + "node_modules/lodash.castarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", + "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "devOptional": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "devOptional": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/package-json": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-10.0.1.tgz", + "integrity": "sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==", + "license": "MIT", + "dependencies": { + "ky": "^1.2.0", + "registry-auth-token": "^5.0.2", + "registry-url": "^6.0.1", + "semver": "^7.6.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", + "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", + "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-nested/node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-tailwind-css": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwind-css/-/prettier-plugin-tailwind-css-1.5.0.tgz", + "integrity": "sha512-LUbINk8O0l+r7iPO6fUOQtoZdF7lQ0SGZTrlAl6IjW8zc5URMGqdW2QVoIK2de2HQeKvb9X2xv8aUzf+v2UVYw==", + "dev": true, + "dependencies": { + "prettier": "^2.0.5" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "license": "ISC" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-refresh": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.13.0.tgz", + "integrity": "sha512-XP8A9BT0CpRBD+NYLLeIhld/RqG9+gktUjW1FkE+Vm7OCinbG1SshcK5tb9ls4kzvjZr9mOQc7HYgBngEyPAXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/read-cache/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/registry-auth-token": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", + "integrity": "sha512-GdekYuwLXLxMuFTwAPg5UKGLW/UXzQrZvH/Zj791BQif5T05T0RsaLfHc9q3ZOKi7n+BoprPD9mJ0O0k4xzUlw==", + "license": "MIT", + "dependencies": { + "@pnpm/npm-conf": "^2.1.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/registry-url": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", + "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", + "license": "MIT", + "dependencies": { + "rc": "1.2.8" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.0.tgz", + "integrity": "sha512-+4C/cgJ9w6sudisA0nZz0+O7lTP9a3CzNLsoDwaRumM8QHwghUsu6tqHXiTmNUp/rqNiM14++7dkzHDyCRs0Jg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.34.0", + "@rollup/rollup-android-arm64": "4.34.0", + "@rollup/rollup-darwin-arm64": "4.34.0", + "@rollup/rollup-darwin-x64": "4.34.0", + "@rollup/rollup-freebsd-arm64": "4.34.0", + "@rollup/rollup-freebsd-x64": "4.34.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.0", + "@rollup/rollup-linux-arm-musleabihf": "4.34.0", + "@rollup/rollup-linux-arm64-gnu": "4.34.0", + "@rollup/rollup-linux-arm64-musl": "4.34.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.0", + "@rollup/rollup-linux-riscv64-gnu": "4.34.0", + "@rollup/rollup-linux-s390x-gnu": "4.34.0", + "@rollup/rollup-linux-x64-gnu": "4.34.0", + "@rollup/rollup-linux-x64-musl": "4.34.0", + "@rollup/rollup-win32-arm64-msvc": "4.34.0", + "@rollup/rollup-win32-ia32-msvc": "4.34.0", + "@rollup/rollup-win32-x64-msvc": "4.34.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sucrase": { + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/sucrase/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/sucrase/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sucrase/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz", + "integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.6", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tailwindcss/node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/terser": { + "version": "5.37.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", + "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" + }, + "node_modules/typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true + }, + "node_modules/update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "devOptional": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/vite": { + "version": "6.0.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.11.tgz", + "integrity": "sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==", + "dev": true, + "dependencies": { + "esbuild": "^0.24.2", + "postcss": "^8.4.49", + "rollup": "^4.23.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "devOptional": true, + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + } + } +} diff --git a/src/Managing.Pinky/package.json b/src/Managing.Pinky/package.json new file mode 100644 index 0000000..b2a3d22 --- /dev/null +++ b/src/Managing.Pinky/package.json @@ -0,0 +1,48 @@ +{ + "name": "managing", + "version": "2.0.0", + "license": "MIT", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "serve": "serve -s dist -p 3000", + "test": "jest", + "lint": "eslint . --ext .ts,.tsx,.js,jsx", + "lint:fix": "eslint . --ext .ts,.tsx,.js,jsx --fix", + "typecheck": "tsc --noEmit", + "prettier": "prettier --write \"**/*.+(json|yml|css|md|mdx)\"", + "clean": "rimraf node_modules yarn.lock dist", + "validate": "./scripts/validate" + }, + "dependencies": { + "@heroicons/react": "^1.0.6", + "@tailwindcss/typography": "^0.5.0", + "@tanstack/react-query": "^5.67.1", + "autoprefixer": "^10.4.7", + "classnames": "^2.3.1", + "jotai": "^1.6.7", + "latest-version": "^9.0.0" + }, + "devDependencies": { + "@types/elliptic": "^6.4.18", + "@types/react": "^18.0.9", + "@types/react-dom": "^18.0.4", + "@types/react-grid-layout": "^1.3.2", + "@types/react-plotly.js": "^2.6.0", + "@types/react-slider": "^1.3.1", + "@types/react-table": "^7.7.12", + "@vitejs/plugin-react": "^1.3.2", + "autoprefixer": "^10.4.7", + "daisyui": "^3.5.1", + "postcss": "^8.4.13", + "prettier": "^2.6.1", + "prettier-plugin-tailwind-css": "^1.5.0", + "tailwindcss": "^3.0.23", + "typescript": "^5.7.3", + "vite": "^6.0.11" + }, + "msw": { + "workerDirectory": "" + } +} diff --git a/src/Managing.Pinky/pics/boat.jpg b/src/Managing.Pinky/pics/boat.jpg new file mode 100644 index 0000000..731bd04 Binary files /dev/null and b/src/Managing.Pinky/pics/boat.jpg differ diff --git a/src/Managing.Pinky/pics/cook.jpg b/src/Managing.Pinky/pics/cook.jpg new file mode 100644 index 0000000..3d4621a Binary files /dev/null and b/src/Managing.Pinky/pics/cook.jpg differ diff --git a/src/Managing.Pinky/pics/khaosok.JPG b/src/Managing.Pinky/pics/khaosok.JPG new file mode 100644 index 0000000..22098f8 Binary files /dev/null and b/src/Managing.Pinky/pics/khaosok.JPG differ diff --git a/src/Managing.Pinky/pics/temple.jpg b/src/Managing.Pinky/pics/temple.jpg new file mode 100644 index 0000000..fa2c69e Binary files /dev/null and b/src/Managing.Pinky/pics/temple.jpg differ diff --git a/src/Managing.Pinky/postcss.config.js b/src/Managing.Pinky/postcss.config.js new file mode 100644 index 0000000..6e41d95 --- /dev/null +++ b/src/Managing.Pinky/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + autoprefixer: {}, + tailwindcss: {}, + }, +} diff --git a/src/Managing.Pinky/prettier.config.js b/src/Managing.Pinky/prettier.config.js new file mode 100644 index 0000000..9280030 --- /dev/null +++ b/src/Managing.Pinky/prettier.config.js @@ -0,0 +1,4 @@ +module.exports = { + plugins: [require('prettier-plugin-tailwindcss')], + tailwindConfig: './tailwind.config.js', +} diff --git a/src/Managing.Pinky/sound.mp3 b/src/Managing.Pinky/sound.mp3 new file mode 100644 index 0000000..1a6709c Binary files /dev/null and b/src/Managing.Pinky/sound.mp3 differ diff --git a/src/Managing.Pinky/tailwind.config.js b/src/Managing.Pinky/tailwind.config.js new file mode 100644 index 0000000..ad929d2 --- /dev/null +++ b/src/Managing.Pinky/tailwind.config.js @@ -0,0 +1,12 @@ +module.exports = { + content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], + daisyui: { + themes: ['black', 'coffee', 'cyberpunk', 'lofi', 'retro', 'kaigen'], + }, + plugins: [require('@tailwindcss/typography'), require('daisyui')], + theme: { + container: { + center: true, + }, + }, +} diff --git a/src/Managing.Pinky/tsconfig.json b/src/Managing.Pinky/tsconfig.json new file mode 100644 index 0000000..9f749f4 --- /dev/null +++ b/src/Managing.Pinky/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx" + }, + "include": ["./src", "hardhat.config.js"], + "exclude": ["node_modules"] +} diff --git a/src/Managing.Pinky/vite.config.ts b/src/Managing.Pinky/vite.config.ts new file mode 100644 index 0000000..9edde64 --- /dev/null +++ b/src/Managing.Pinky/vite.config.ts @@ -0,0 +1,21 @@ +import react from '@vitejs/plugin-react' +import { defineConfig } from 'vite' + +export default defineConfig({ + build: { + minify: false, + sourcemap: false, + target: 'es2022', + }, + optimizeDeps: { + esbuildOptions: { + target: 'es2022', + }, + }, + plugins: [react()], + publicDir: 'assets', + server: { + host: true, + open: true, + }, +}) diff --git a/src/Managing.Web3Proxy/.DS_Store b/src/Managing.Web3Proxy/.DS_Store new file mode 100644 index 0000000..b349bd1 Binary files /dev/null and b/src/Managing.Web3Proxy/.DS_Store differ diff --git a/src/Managing.Web3Proxy/.env b/src/Managing.Web3Proxy/.env new file mode 100644 index 0000000..576d1bc --- /dev/null +++ b/src/Managing.Web3Proxy/.env @@ -0,0 +1,31 @@ +# Must always set to production +# @see {@link https://www.youtube.com/watch?v=HMM7GJC5E2o} +NODE_ENV=production +PORT=4111 + +CAN_CREATE_DATABASE=0 +CAN_DROP_DATABASE=0 +CAN_SEED_DATABASE=0 + +# Database +MYSQL_HOST=localhost +MYSQL_PORT=3306 +MYSQL_DATABASE=test_db +MYSQL_USER=test_user +MYSQL_PASSWORD=test_password + +# Server +FASTIFY_CLOSE_GRACE_DELAY=1000 +LOG_LEVEL=info + +# Security +COOKIE_SECRET=25wwYu5AgxArU7djgvQEuioc9YSdGY3WN3r1dmXftPfH33KfGVfzopW3vqoPFjy1b8wS2gkDDZ9iQ8yxSo9Vi4iN +COOKIE_NAME=test_cookie_name +COOKIE_SECURED=true +RATE_LIMIT_MAX=4 # 4 for tests + +PRIVY_APP_ID=cm7u09v0u002zrkuf2yjjr58p +PRIVY_APP_SECRET=25wwYu5AgxArU7djgvQEuioc9YSdGY3WN3r1dmXftPfH33KfGVfzopW3vqoPFjy1b8wS2gkDDZ9iQ8yxSo9Vi4iN +PRIVY_AUTHORIZATION_KEY=wallet-auth:MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQggpJ65PCo4E6NYpY867AyE6p1KxOrs8LJqHZw+t+076yhRANCAAS2EM23CtIfQRmHWTxcqb1j5yfrVePjZyBOZZ2RoPZHb9bDGLos206fTuVA3zgLVomlOoHTeYifkBASCn9Mfg3b +API_URL=http://localhost:5000 +ARBITRUM_RPC_URL=https://arbitrum-one.publicnode.com \ No newline at end of file diff --git a/src/Managing.Web3Proxy/.sonarcloud.properties b/src/Managing.Web3Proxy/.sonarcloud.properties new file mode 100644 index 0000000..35835fb --- /dev/null +++ b/src/Managing.Web3Proxy/.sonarcloud.properties @@ -0,0 +1 @@ +sonar.exclusions=test/**/*,scripts/seed-database.ts diff --git a/src/Managing.Web3Proxy/@types/node/environment.d.ts b/src/Managing.Web3Proxy/@types/node/environment.d.ts new file mode 100644 index 0000000..0069d75 --- /dev/null +++ b/src/Managing.Web3Proxy/@types/node/environment.d.ts @@ -0,0 +1,16 @@ +declare global { + namespace NodeJS { + interface ProcessEnv { + PORT: number; + LOG_LEVEL: string; + FASTIFY_CLOSE_GRACE_DELAY: number; + MYSQL_HOST: string + MYSQL_PORT: number + MYSQL_DATABASE: string + MYSQL_USER: string + MYSQL_PASSWORD: string + } + } +} + +export {} diff --git a/src/Managing.Web3Proxy/Dockerfile-web3proxy b/src/Managing.Web3Proxy/Dockerfile-web3proxy new file mode 100644 index 0000000..a7a5613 --- /dev/null +++ b/src/Managing.Web3Proxy/Dockerfile-web3proxy @@ -0,0 +1,22 @@ +# Use an official Node.js image as the base +FROM node:22.14.0-alpine + +# Set the working directory in the container +WORKDIR /app + +# COPY package*.json ./ +COPY /src/Managing.Web3Proxy/package.json ./ + +# Declaring env +ENV NODE_ENV production + +# Install dependencies with the --legacy-peer-deps flag to bypass peer dependency conflicts +RUN npm install + +COPY src/Managing.Web3Proxy/ . + +RUN npm run build + +EXPOSE 4111 + +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/src/Managing.Web3Proxy/LICENSE b/src/Managing.Web3Proxy/LICENSE new file mode 100644 index 0000000..226c5a9 --- /dev/null +++ b/src/Managing.Web3Proxy/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Fastify + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Managing.Web3Proxy/README.md b/src/Managing.Web3Proxy/README.md new file mode 100644 index 0000000..c8647ce --- /dev/null +++ b/src/Managing.Web3Proxy/README.md @@ -0,0 +1,77 @@ +# Fastify Official Demo + +The aim of this repository is to provide a concrete example of a Fastify application using what are considered best practices by the Fastify community. + +**Prerequisites:** You need to have Node.js version 22 or higher installed. + +## Getting started +Install the dependencies: +```bash +npm install +``` + +### Database +You can run a MySQL instance with Docker: +```bash +docker compose up +``` + +To run it in the background: +```bash +docker compose up -d +``` + +To create and update the database schema, run the migrations: +```bash +npm run db:migrate +``` + +To populate the database with initial data, run: +```bash +npm run db:seed +``` + +### TypeScript +To build the project: +```bash +npm run build +``` + +### Start the server +In dev mode: +```bash +npm run dev +``` +Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +In production mode: +```bash +npm run start +``` + +### Testing +To run the tests: +```bash +npm run test +``` + +### Standalone +`dev` and `start` leverage [fastify-cli](https://github.com/fastify/fastify-cli), +but you can run the demo as a standalone executable (see [server.ts](./src/server.ts)): +```bash +npm run standalone +``` + +### Linting +To check for linting errors: +```bash +npm run lint +``` + +To check and automatically fix linting errors: +```bash +npm run lint:fix +``` + +## Learn More +To learn more about Fastify, check out the [Fastify documentation](https://www.fastify.io/docs/latest/). diff --git a/src/Managing.Web3Proxy/docker-compose.yml b/src/Managing.Web3Proxy/docker-compose.yml new file mode 100644 index 0000000..f014b4d --- /dev/null +++ b/src/Managing.Web3Proxy/docker-compose.yml @@ -0,0 +1,20 @@ +services: + db: + image: mysql:8.4 + environment: + MYSQL_ROOT_PASSWORD: root_password + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + ports: + - 3306:3306 + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-u${MYSQL_USER}", "-p${MYSQL_PASSWORD}"] + interval: 10s + timeout: 5s + retries: 3 + volumes: + - db_data:/var/lib/mysql + +volumes: + db_data: diff --git a/src/Managing.Web3Proxy/eslint.config.js b/src/Managing.Web3Proxy/eslint.config.js new file mode 100644 index 0000000..f0de266 --- /dev/null +++ b/src/Managing.Web3Proxy/eslint.config.js @@ -0,0 +1,18 @@ +import neo from 'neostandard' + +export default [ + ...neo({ + ts: true + }), + { + rules: { + '@stylistic/comma-dangle': ['error', { + arrays: 'never', + objects: 'never', + imports: 'never', + exports: 'never', + functions: 'never' + }] + } + } +] diff --git a/src/Managing.Web3Proxy/migrations/001.do.users.sql b/src/Managing.Web3Proxy/migrations/001.do.users.sql new file mode 100644 index 0000000..8142b79 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/001.do.users.sql @@ -0,0 +1,8 @@ +CREATE TABLE users ( + id INT AUTO_INCREMENT PRIMARY KEY, + email VARCHAR(255) UNIQUE NOT NULL, + username VARCHAR(255) NOT NULL, + password VARCHAR(255) NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +); diff --git a/src/Managing.Web3Proxy/migrations/001.undo.users.sql b/src/Managing.Web3Proxy/migrations/001.undo.users.sql new file mode 100644 index 0000000..c99ddcd --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/001.undo.users.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS users; diff --git a/src/Managing.Web3Proxy/migrations/002.do.tasks.sql b/src/Managing.Web3Proxy/migrations/002.do.tasks.sql new file mode 100644 index 0000000..8dd7521 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/002.do.tasks.sql @@ -0,0 +1,12 @@ +CREATE TABLE tasks ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + author_id INT NOT NULL, + assigned_user_id INT, + filename VARCHAR(255), + status VARCHAR(50) NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + FOREIGN KEY (author_id) REFERENCES users(id), + FOREIGN KEY (assigned_user_id) REFERENCES users(id) +); diff --git a/src/Managing.Web3Proxy/migrations/002.undo.tasks.sql b/src/Managing.Web3Proxy/migrations/002.undo.tasks.sql new file mode 100644 index 0000000..2ff1380 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/002.undo.tasks.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS tasks; diff --git a/src/Managing.Web3Proxy/migrations/003.do.user_tasks.sql b/src/Managing.Web3Proxy/migrations/003.do.user_tasks.sql new file mode 100644 index 0000000..6abc751 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/003.do.user_tasks.sql @@ -0,0 +1,7 @@ +CREATE TABLE user_tasks ( + user_id INT NOT NULL, + task_id INT NOT NULL, + PRIMARY KEY (user_id, task_id), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (task_id) REFERENCES tasks(id) +); diff --git a/src/Managing.Web3Proxy/migrations/003.undo.user_tasks.sql b/src/Managing.Web3Proxy/migrations/003.undo.user_tasks.sql new file mode 100644 index 0000000..bb7bc57 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/003.undo.user_tasks.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS user_tasks; diff --git a/src/Managing.Web3Proxy/migrations/004.do.roles.sql b/src/Managing.Web3Proxy/migrations/004.do.roles.sql new file mode 100644 index 0000000..0dbae96 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/004.do.roles.sql @@ -0,0 +1,4 @@ +CREATE TABLE roles ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL +); diff --git a/src/Managing.Web3Proxy/migrations/004.undo.roles.sql b/src/Managing.Web3Proxy/migrations/004.undo.roles.sql new file mode 100644 index 0000000..06e938c --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/004.undo.roles.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS roles; diff --git a/src/Managing.Web3Proxy/migrations/005.do.user_roles.sql b/src/Managing.Web3Proxy/migrations/005.do.user_roles.sql new file mode 100644 index 0000000..1ad3d93 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/005.do.user_roles.sql @@ -0,0 +1,7 @@ +CREATE TABLE user_roles ( + id INT AUTO_INCREMENT PRIMARY KEY, + user_id INT NOT NULL, + role_id INT NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE, + FOREIGN KEY (role_id) REFERENCES roles(id) ON DELETE CASCADE +); diff --git a/src/Managing.Web3Proxy/migrations/005.undo.user_roles.sql b/src/Managing.Web3Proxy/migrations/005.undo.user_roles.sql new file mode 100644 index 0000000..71fd145 --- /dev/null +++ b/src/Managing.Web3Proxy/migrations/005.undo.user_roles.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS user_roles; diff --git a/src/Managing.Web3Proxy/package-lock.json b/src/Managing.Web3Proxy/package-lock.json new file mode 100644 index 0000000..7ef26d8 --- /dev/null +++ b/src/Managing.Web3Proxy/package-lock.json @@ -0,0 +1,7363 @@ +{ + "name": "web3-proxy", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "web3-proxy", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@fastify/autoload": "^6.0.0", + "@fastify/cookie": "^11.0.1", + "@fastify/cors": "^11.0.0", + "@fastify/env": "^5.0.1", + "@fastify/helmet": "^13.0.0", + "@fastify/multipart": "^9.0.1", + "@fastify/rate-limit": "^10.0.1", + "@fastify/sensible": "^6.0.1", + "@fastify/session": "^11.0.1", + "@fastify/static": "^8.0.2", + "@fastify/swagger": "^9.0.0", + "@fastify/swagger-ui": "^5.0.1", + "@fastify/type-provider-typebox": "^5.0.0", + "@fastify/under-pressure": "^9.0.1", + "@privy-io/server-auth": "^1.18.12", + "@sinclair/typebox": "^0.34.11", + "canonicalize": "^2.0.0", + "concurrently": "^9.0.1", + "cross-fetch": "^4.1.0", + "csv-stringify": "^6.5.2", + "ethers": "^6.13.5", + "fastify": "^5.0.0", + "fastify-cli": "^7.3.0", + "fastify-plugin": "^5.0.1", + "form-data": "^4.0.1", + "knex": "^3.1.0", + "mysql2": "^3.11.3", + "postgrator": "^8.0.0", + "query-string": "^9.1.1", + "viem": "^2.23.15", + "vitest": "^3.0.8", + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/node": "^22.5.5", + "c8": "^10.1.3", + "eslint": "^9.11.0", + "fastify-tsconfig": "^3.0.0", + "glob": "^11.0.0", + "neostandard": "^0.12.0", + "tsx": "^4.19.1", + "typescript": "~5.8.2" + } + }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.11.0", + "license": "MIT" + }, + "node_modules/@babel/runtime": { + "version": "7.26.10", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.1", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.5.0", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.19.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.1.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.12.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/js": { + "version": "9.22.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.7", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@fastify/accept-negotiator": { + "version": "2.0.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/ajv-compiler": { + "version": "4.0.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^3.0.0" + } + }, + "node_modules/@fastify/autoload": { + "version": "6.2.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/busboy": { + "version": "3.1.1", + "license": "MIT" + }, + "node_modules/@fastify/cookie": { + "version": "11.0.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "cookie": "^1.0.0", + "fastify-plugin": "^5.0.0" + } + }, + "node_modules/@fastify/cors": { + "version": "11.0.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "mnemonist": "0.40.0" + } + }, + "node_modules/@fastify/deepmerge": { + "version": "2.0.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/env": { + "version": "5.0.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "env-schema": "^6.0.0", + "fastify-plugin": "^5.0.0" + } + }, + "node_modules/@fastify/error": { + "version": "4.1.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/fast-json-stringify-compiler": { + "version": "5.0.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fast-json-stringify": "^6.0.0" + } + }, + "node_modules/@fastify/forwarded": { + "version": "3.0.0", + "license": "MIT" + }, + "node_modules/@fastify/helmet": { + "version": "13.0.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "helmet": "^8.0.0" + } + }, + "node_modules/@fastify/merge-json-schemas": { + "version": "0.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/@fastify/multipart": { + "version": "9.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^3.0.0", + "@fastify/deepmerge": "^2.0.0", + "@fastify/error": "^4.0.0", + "fastify-plugin": "^5.0.0", + "secure-json-parse": "^3.0.0" + } + }, + "node_modules/@fastify/proxy-addr": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "@fastify/forwarded": "^3.0.0", + "ipaddr.js": "^2.1.0" + } + }, + "node_modules/@fastify/rate-limit": { + "version": "10.2.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "fastify-plugin": "^5.0.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/@fastify/send": { + "version": "3.3.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "^2.0.0", + "mime": "^3" + } + }, + "node_modules/@fastify/sensible": { + "version": "6.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "dequal": "^2.0.3", + "fastify-plugin": "^5.0.0", + "forwarded": "^0.2.0", + "http-errors": "^2.0.0", + "type-is": "^1.6.18", + "vary": "^1.1.2" + } + }, + "node_modules/@fastify/session": { + "version": "11.1.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.1", + "safe-stable-stringify": "^2.4.3" + } + }, + "node_modules/@fastify/static": { + "version": "8.1.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/accept-negotiator": "^2.0.0", + "@fastify/send": "^3.2.0", + "content-disposition": "^0.5.4", + "fastify-plugin": "^5.0.0", + "fastq": "^1.17.1", + "glob": "^11.0.0" + } + }, + "node_modules/@fastify/swagger": { + "version": "9.4.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "json-schema-resolver": "^3.0.0", + "openapi-types": "^12.1.3", + "rfdc": "^1.3.1", + "yaml": "^2.4.2" + } + }, + "node_modules/@fastify/swagger-ui": { + "version": "5.2.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/static": "^8.0.0", + "fastify-plugin": "^5.0.0", + "openapi-types": "^12.1.3", + "rfdc": "^1.3.1", + "yaml": "^2.4.1" + } + }, + "node_modules/@fastify/type-provider-typebox": { + "version": "5.1.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "peerDependencies": { + "@sinclair/typebox": ">=0.26 <=0.34" + } + }, + "node_modules/@fastify/under-pressure": { + "version": "9.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/error": "^4.0.0", + "fastify-plugin": "^5.0.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "dev": true, + "license": "Apache-2.0", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.2", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@noble/curves": { + "version": "1.8.1", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.7.1" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.7.1", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.4.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@privy-io/server-auth": { + "version": "1.18.12", + "license": "Apache-2.0", + "dependencies": { + "@noble/curves": "^1.6.0", + "@noble/hashes": "^1.5.0", + "@solana/web3.js": "^1.95.8", + "canonicalize": "^2.0.0", + "dotenv": "^16.0.3", + "jose": "^4.10.4", + "node-fetch-native": "^1.4.0", + "redaxios": "^0.5.1", + "svix": ">=1.29.0 <= 1.37.0 || ^1.40.0", + "ts-case-convert": "^2.0.2", + "type-fest": "^3.6.1" + }, + "peerDependencies": { + "viem": "^2" + }, + "peerDependenciesMeta": { + "viem": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.35.0", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@scure/base": { + "version": "1.2.4", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.6.2", + "license": "MIT", + "dependencies": { + "@noble/curves": "~1.8.1", + "@noble/hashes": "~1.7.1", + "@scure/base": "~1.2.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.5.4", + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.7.1", + "@scure/base": "~1.2.4" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.34.30", + "license": "MIT" + }, + "node_modules/@solana/buffer-layout": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "buffer": "~6.0.3" + }, + "engines": { + "node": ">=5.10" + } + }, + "node_modules/@solana/web3.js": { + "version": "1.98.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.0", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0", + "@solana/buffer-layout": "^4.0.1", + "agentkeepalive": "^4.5.0", + "bigint-buffer": "^1.1.5", + "bn.js": "^5.2.1", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.3", + "fast-stable-stringify": "^1.0.0", + "jayson": "^4.1.1", + "node-fetch": "^2.7.0", + "rpc-websockets": "^9.0.2", + "superstruct": "^2.0.2" + } + }, + "node_modules/@stablelib/base64": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/@stylistic/eslint-plugin": { + "version": "2.11.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^8.13.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/doctrine": { + "version": "0.0.9", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.13.10", + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.26.1", + "@typescript-eslint/type-utils": "8.26.1", + "@typescript-eslint/utils": "8.26.1", + "@typescript-eslint/visitor-keys": "8.26.1", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.26.1", + "@typescript-eslint/types": "8.26.1", + "@typescript-eslint/typescript-estree": "8.26.1", + "@typescript-eslint/visitor-keys": "8.26.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.26.1", + "@typescript-eslint/visitor-keys": "8.26.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.26.1", + "@typescript-eslint/utils": "8.26.1", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.26.1", + "@typescript-eslint/visitor-keys": "8.26.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.26.1", + "@typescript-eslint/types": "8.26.1", + "@typescript-eslint/typescript-estree": "8.26.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.26.1", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vitest/expect": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.0.8", + "@vitest/utils": "3.0.8", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.0.8", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.0.8", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.0.8", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.0.8", + "loupe": "^3.1.3", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/abitype": { + "version": "1.0.8", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/wevm" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3 >=3.22.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.14.1", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "license": "MIT" + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ajv": { + "version": "8.17.1", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ansi-regex": { + "version": "6.1.0", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/async-function": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "license": "MIT" + }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/avvio": { + "version": "9.1.0", + "license": "MIT", + "dependencies": { + "@fastify/error": "^4.0.0", + "fastq": "^1.17.1" + } + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/base-x": { + "version": "3.0.11", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bigint-buffer": { + "version": "1.1.5", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "bindings": "^1.3.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bn.js": { + "version": "5.2.1", + "license": "MIT" + }, + "node_modules/borsh": { + "version": "0.7.0", + "license": "Apache-2.0", + "dependencies": { + "bn.js": "^5.2.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/bufferutil": { + "version": "4.0.9", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/c8": { + "version": "10.1.3", + "dev": true, + "license": "ISC", + "dependencies": { + "@bcoe/v8-coverage": "^1.0.1", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/cac": { + "version": "6.7.14", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/canonicalize": { + "version": "2.0.0", + "license": "Apache-2.0" + }, + "node_modules/chai": { + "version": "5.2.0", + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-error": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/close-with-grace": { + "version": "2.2.0", + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/colorette": { + "version": "2.0.19", + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "10.0.1", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/commist": { + "version": "3.2.0", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/concurrently": { + "version": "9.1.2", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "lodash": "^4.17.21", + "rxjs": "^7.8.1", + "shell-quote": "^1.8.1", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.0.2", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/cross-fetch": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.7.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csv-stringify": { + "version": "6.5.2", + "license": "MIT" + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dateformat": { + "version": "4.6.3", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "4.4.0", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-uri-component": { + "version": "0.4.1", + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delay": { + "version": "5.0.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dotenv": { + "version": "16.4.7", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-expand": { + "version": "10.0.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.1", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/env-schema": { + "version": "6.0.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "dotenv": "^16.4.5", + "dotenv-expand": "10.0.0" + } + }, + "node_modules/es-abstract": { + "version": "1.23.9", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.6.0", + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "license": "MIT" + }, + "node_modules/es6-promisify": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "es6-promise": "^4.0.3" + } + }, + "node_modules/esbuild": { + "version": "0.25.1", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.1", + "@esbuild/android-arm": "0.25.1", + "@esbuild/android-arm64": "0.25.1", + "@esbuild/android-x64": "0.25.1", + "@esbuild/darwin-arm64": "0.25.1", + "@esbuild/darwin-x64": "0.25.1", + "@esbuild/freebsd-arm64": "0.25.1", + "@esbuild/freebsd-x64": "0.25.1", + "@esbuild/linux-arm": "0.25.1", + "@esbuild/linux-arm64": "0.25.1", + "@esbuild/linux-ia32": "0.25.1", + "@esbuild/linux-loong64": "0.25.1", + "@esbuild/linux-mips64el": "0.25.1", + "@esbuild/linux-ppc64": "0.25.1", + "@esbuild/linux-riscv64": "0.25.1", + "@esbuild/linux-s390x": "0.25.1", + "@esbuild/linux-x64": "0.25.1", + "@esbuild/netbsd-arm64": "0.25.1", + "@esbuild/netbsd-x64": "0.25.1", + "@esbuild/openbsd-arm64": "0.25.1", + "@esbuild/openbsd-x64": "0.25.1", + "@esbuild/sunos-x64": "0.25.1", + "@esbuild/win32-arm64": "0.25.1", + "@esbuild/win32-ia32": "0.25.1", + "@esbuild/win32-x64": "0.25.1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.22.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/config-helpers": "^0.1.0", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.22.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-compat-utils": { + "version": "0.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.8.6", + "dev": true, + "license": "ISC", + "dependencies": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.3.7", + "enhanced-resolve": "^5.15.0", + "get-tsconfig": "^4.10.0", + "is-bun-module": "^1.0.2", + "stable-hash": "^0.0.4", + "tinyglobby": "^0.2.12" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-es-x": { + "version": "7.8.0", + "dev": true, + "funding": [ + "https://github.com/sponsors/ota-meshi", + "https://opencollective.com/eslint" + ], + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.11.0", + "eslint-compat-utils": "^0.5.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, + "node_modules/eslint-plugin-import-x": { + "version": "4.6.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/doctrine": "^0.0.9", + "@typescript-eslint/scope-manager": "^8.1.0", + "@typescript-eslint/utils": "^8.1.0", + "debug": "^4.3.4", + "doctrine": "^3.0.0", + "enhanced-resolve": "^5.17.1", + "eslint-import-resolver-node": "^0.3.9", + "get-tsconfig": "^4.7.3", + "is-glob": "^4.0.3", + "minimatch": "^9.0.3", + "semver": "^7.6.3", + "stable-hash": "^0.0.4", + "tslib": "^2.6.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-import-x/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-plugin-import-x/node_modules/minimatch": { + "version": "9.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint-plugin-n": { + "version": "17.16.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.1", + "enhanced-resolve": "^5.17.1", + "eslint-plugin-es-x": "^7.8.0", + "get-tsconfig": "^4.8.1", + "globals": "^15.11.0", + "ignore": "^5.3.2", + "minimatch": "^9.0.5", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": ">=8.23.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "15.15.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-n/node_modules/minimatch": { + "version": "9.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint-plugin-promise": { + "version": "7.2.1", + "dev": true, + "license": "ISC", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.37.4", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-scope": { + "version": "8.3.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "dev": true, + "license": "MIT" + }, + "node_modules/esm": { + "version": "3.2.25", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/espree": { + "version": "10.3.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ethers": { + "version": "6.13.5", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.5.tgz", + "integrity": "sha512-+knKNieu5EKRThQJWwqaJ10a6HE9sSehGeqWN65//wE7j47ZpFhKAnHB/JJFibwwg61I/koxaPsXbXpD/skNOQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "22.7.5", + "aes-js": "4.0.0-beta.5", + "tslib": "2.7.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@adraffy/ens-normalize": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "license": "MIT" + }, + "node_modules/ethers/node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethers/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/ethers/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD" + }, + "node_modules/ethers/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "node_modules/ethers/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "license": "MIT" + }, + "node_modules/events": { + "version": "3.3.0", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/expect-type": { + "version": "1.2.0", + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/eyes": { + "version": "0.1.8", + "engines": { + "node": "> 0.1.90" + } + }, + "node_modules/fast-copy": { + "version": "3.0.2", + "license": "MIT" + }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stringify": { + "version": "6.0.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/merge-json-schemas": "^0.2.0", + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^3.0.0", + "json-schema-ref-resolver": "^2.0.0", + "rfdc": "^1.2.0" + } + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "license": "MIT", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/fast-redact": { + "version": "3.5.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "license": "MIT" + }, + "node_modules/fast-sha256": { + "version": "1.3.0", + "license": "Unlicense" + }, + "node_modules/fast-stable-stringify": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.0.6", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fastify": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/ajv-compiler": "^4.0.0", + "@fastify/error": "^4.0.0", + "@fastify/fast-json-stringify-compiler": "^5.0.0", + "@fastify/proxy-addr": "^5.0.0", + "abstract-logging": "^2.0.1", + "avvio": "^9.0.0", + "fast-json-stringify": "^6.0.0", + "find-my-way": "^9.0.0", + "light-my-request": "^6.0.0", + "pino": "^9.0.0", + "process-warning": "^4.0.0", + "rfdc": "^1.3.1", + "secure-json-parse": "^3.0.1", + "semver": "^7.6.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/fastify-cli": { + "version": "7.3.0", + "license": "MIT", + "dependencies": { + "@fastify/deepmerge": "^2.0.0", + "chalk": "^4.1.2", + "chokidar": "^4.0.0", + "close-with-grace": "^2.1.0", + "commist": "^3.0.0", + "dotenv": "^16.0.0", + "fastify": "^5.0.0", + "fastify-plugin": "^5.0.0", + "generify": "^4.0.0", + "help-me": "^4.0.1", + "is-docker": "^2.0.0", + "pino-pretty": "^11.2.0", + "pkg-up": "^3.1.0", + "resolve-from": "^5.0.0", + "semver": "^7.3.5", + "yargs-parser": "^21.1.1" + }, + "bin": { + "fastify": "cli.js" + } + }, + "node_modules/fastify-plugin": { + "version": "5.0.1", + "license": "MIT" + }, + "node_modules/fastify-tsconfig": { + "version": "3.0.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/fastq": { + "version": "1.19.1", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fdir": { + "version": "6.4.3", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/filter-obj": { + "version": "5.1.0", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-my-way": { + "version": "9.2.0", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "dev": true, + "license": "ISC" + }, + "node_modules/for-each": { + "version": "0.3.5", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.2", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/generify": { + "version": "4.2.0", + "license": "MIT", + "dependencies": { + "isbinaryfile": "^4.0.2", + "pump": "^3.0.0", + "split2": "^3.0.0", + "walker": "^1.0.6" + }, + "bin": { + "generify": "generify.js" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.10.0", + "devOptional": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/getopts": { + "version": "2.3.0", + "license": "MIT" + }, + "node_modules/glob": { + "version": "11.0.1", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "10.0.1", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "14.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "dev": true, + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/helmet": { + "version": "8.0.0", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/help-me": { + "version": "4.2.0", + "license": "MIT", + "dependencies": { + "glob": "^8.0.0", + "readable-stream": "^3.6.0" + } + }, + "node_modules/help-me/node_modules/brace-expansion": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/help-me/node_modules/glob": { + "version": "8.1.0", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/help-me/node_modules/minimatch": { + "version": "5.1.6", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/interpret": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/ipaddr.js": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bun-module": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.6.3" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/is-regex": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/isbinaryfile": { + "version": "4.0.10", + "license": "MIT", + "engines": { + "node": ">= 8.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/gjtorikian/" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/isows": { + "version": "1.0.6", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/jackspeak": { + "version": "4.1.0", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jayson": { + "version": "4.1.3", + "license": "MIT", + "dependencies": { + "@types/connect": "^3.4.33", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "uuid": "^8.3.2", + "ws": "^7.5.10" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.55", + "license": "MIT" + }, + "node_modules/jayson/node_modules/commander": { + "version": "2.20.3", + "license": "MIT" + }, + "node_modules/jayson/node_modules/ws": { + "version": "7.5.10", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/jose": { + "version": "4.15.9", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/joycon": { + "version": "3.1.1", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-ref-resolver": { + "version": "2.0.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/json-schema-resolver": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "fast-uri": "^3.0.5", + "rfdc": "^1.1.4" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/Eomm/json-schema-resolver?sponsor=1" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "license": "ISC" + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/knex": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "colorette": "2.0.19", + "commander": "^10.0.0", + "debug": "4.3.4", + "escalade": "^3.1.1", + "esm": "^3.2.25", + "get-package-type": "^0.1.0", + "getopts": "2.3.0", + "interpret": "^2.2.0", + "lodash": "^4.17.21", + "pg-connection-string": "2.6.2", + "rechoir": "^0.8.0", + "resolve-from": "^5.0.0", + "tarn": "^3.0.2", + "tildify": "2.0.0" + }, + "bin": { + "knex": "bin/cli.js" + }, + "engines": { + "node": ">=16" + }, + "peerDependenciesMeta": { + "better-sqlite3": { + "optional": true + }, + "mysql": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-native": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/knex/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/knex/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/levn": { + "version": "0.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/light-my-request": { + "version": "6.6.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause", + "dependencies": { + "cookie": "^1.0.1", + "process-warning": "^4.0.0", + "set-cookie-parser": "^2.6.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "dev": true, + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.1", + "license": "Apache-2.0" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/loupe": { + "version": "3.1.3", + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/lru.min": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/magic-string": { + "version": "0.30.17", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mnemonist": { + "version": "0.40.0", + "license": "MIT", + "dependencies": { + "obliterator": "^2.0.4" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "node_modules/mysql2": { + "version": "3.13.0", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.9", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/neostandard": { + "version": "0.12.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@stylistic/eslint-plugin": "2.11.0", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import-x": "^4.5.0", + "eslint-plugin-n": "^17.14.0", + "eslint-plugin-promise": "^7.2.1", + "eslint-plugin-react": "^7.37.2", + "find-up": "^5.0.0", + "globals": "^15.13.0", + "peowly": "^1.3.2", + "typescript-eslint": "^8.17.0" + }, + "bin": { + "neostandard": "cli.mjs" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": "^9.0.0" + } + }, + "node_modules/neostandard/node_modules/globals": { + "version": "15.15.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch-native": { + "version": "1.6.6", + "license": "MIT" + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "license": "MIT", + "optional": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/obliterator": { + "version": "2.0.5", + "license": "MIT" + }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/openapi-types": { + "version": "12.1.3", + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ox": { + "version": "0.6.9", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "^1.10.1", + "@noble/curves": "^1.6.0", + "@noble/hashes": "^1.5.0", + "@scure/bip32": "^1.5.0", + "@scure/bip39": "^1.4.0", + "abitype": "^1.0.6", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "license": "BlueOak-1.0.0" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "2.0.0", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.0.2", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/peowly": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.6.0" + } + }, + "node_modules/pg-connection-string": { + "version": "2.6.2", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pino": { + "version": "9.6.0", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0", + "fast-redact": "^3.1.1", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^2.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^4.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^3.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "split2": "^4.0.0" + } + }, + "node_modules/pino-abstract-transport/node_modules/split2": { + "version": "4.2.0", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/pino-pretty": { + "version": "11.3.0", + "license": "MIT", + "dependencies": { + "colorette": "^2.0.7", + "dateformat": "^4.6.3", + "fast-copy": "^3.0.2", + "fast-safe-stringify": "^2.1.1", + "help-me": "^5.0.0", + "joycon": "^3.1.1", + "minimist": "^1.2.6", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^2.0.0", + "pump": "^3.0.0", + "readable-stream": "^4.0.0", + "secure-json-parse": "^2.4.0", + "sonic-boom": "^4.0.1", + "strip-json-comments": "^3.1.1" + }, + "bin": { + "pino-pretty": "bin.js" + } + }, + "node_modules/pino-pretty/node_modules/help-me": { + "version": "5.0.0", + "license": "MIT" + }, + "node_modules/pino-pretty/node_modules/readable-stream": { + "version": "4.7.0", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/pino-pretty/node_modules/secure-json-parse": { + "version": "2.7.0", + "license": "BSD-3-Clause" + }, + "node_modules/pino-std-serializers": { + "version": "7.0.0", + "license": "MIT" + }, + "node_modules/pkg-up": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-up/node_modules/find-up": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/locate-path": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-up/node_modules/p-locate": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/path-exists": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.5.3", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postgrator": { + "version": "8.0.0", + "license": "MIT", + "dependencies": { + "glob": "^11.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/process": { + "version": "0.11.10", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-warning": { + "version": "4.0.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/pump": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/query-string": { + "version": "9.1.1", + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.4.1", + "filter-obj": "^5.1.0", + "split-on-first": "^3.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "license": "MIT" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "license": "MIT" + }, + "node_modules/react-is": { + "version": "16.13.1", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/real-require": { + "version": "0.2.0", + "license": "MIT", + "engines": { + "node": ">= 12.13.0" + } + }, + "node_modules/rechoir": { + "version": "0.8.0", + "license": "MIT", + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/redaxios": { + "version": "0.5.1", + "license": "Apache-2.0" + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "license": "MIT" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/resolve": { + "version": "1.22.10", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "devOptional": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/ret": { + "version": "0.5.0", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "license": "MIT" + }, + "node_modules/rollup": { + "version": "4.35.0", + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.35.0", + "@rollup/rollup-android-arm64": "4.35.0", + "@rollup/rollup-darwin-arm64": "4.35.0", + "@rollup/rollup-darwin-x64": "4.35.0", + "@rollup/rollup-freebsd-arm64": "4.35.0", + "@rollup/rollup-freebsd-x64": "4.35.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.35.0", + "@rollup/rollup-linux-arm-musleabihf": "4.35.0", + "@rollup/rollup-linux-arm64-gnu": "4.35.0", + "@rollup/rollup-linux-arm64-musl": "4.35.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.35.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.35.0", + "@rollup/rollup-linux-riscv64-gnu": "4.35.0", + "@rollup/rollup-linux-s390x-gnu": "4.35.0", + "@rollup/rollup-linux-x64-gnu": "4.35.0", + "@rollup/rollup-linux-x64-musl": "4.35.0", + "@rollup/rollup-win32-arm64-msvc": "4.35.0", + "@rollup/rollup-win32-ia32-msvc": "4.35.0", + "@rollup/rollup-win32-x64-msvc": "4.35.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rpc-websockets": { + "version": "9.1.1", + "license": "LGPL-3.0-only", + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/uuid": "^8.3.4", + "@types/ws": "^8.2.2", + "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/rpc-websockets/node_modules/@types/ws": { + "version": "8.18.0", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex2": { + "version": "4.0.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/secure-json-parse": { + "version": "3.0.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/semver": { + "version": "7.7.1", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/seq-queue": { + "version": "0.0.5" + }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "license": "MIT" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.2", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sonic-boom": { + "version": "4.2.0", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-on-first": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/split2": { + "version": "3.2.2", + "license": "ISC", + "dependencies": { + "readable-stream": "^3.0.0" + } + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/stable-hash": { + "version": "0.0.4", + "dev": true, + "license": "MIT" + }, + "node_modules/stackback": { + "version": "0.0.2", + "license": "MIT" + }, + "node_modules/statuses": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/std-env": { + "version": "3.8.1", + "license": "MIT" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/superstruct": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svix": { + "version": "1.61.4", + "license": "MIT", + "dependencies": { + "@stablelib/base64": "^1.0.0", + "@types/node": "^22.7.5", + "es6-promise": "^4.2.8", + "fast-sha256": "^1.3.0", + "svix-fetch": "^3.0.0", + "url-parse": "^1.5.10" + } + }, + "node_modules/svix-fetch": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.1", + "whatwg-fetch": "^3.4.1" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tarn": { + "version": "3.0.2", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/test-exclude": { + "version": "7.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.5", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/jackspeak": { + "version": "3.4.3", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/test-exclude/node_modules/lru-cache": { + "version": "10.4.3", + "dev": true, + "license": "ISC" + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/path-scurry": { + "version": "1.11.1", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/text-encoding-utf-8": { + "version": "1.0.2" + }, + "node_modules/thread-stream": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "real-require": "^0.2.0" + } + }, + "node_modules/through": { + "version": "2.3.8", + "license": "MIT" + }, + "node_modules/tildify": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tinybench": { + "version": "2.9.0", + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.0.2", + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "license": "BSD-3-Clause" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toad-cache": { + "version": "3.7.0", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-case-convert": { + "version": "2.1.0", + "license": "Apache-2.0" + }, + "node_modules/tslib": { + "version": "2.8.1", + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.19.3", + "devOptional": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "3.13.1", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.8.2", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.26.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.26.1", + "@typescript-eslint/parser": "8.26.1", + "@typescript-eslint/utils": "8.26.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "6.20.0", + "license": "MIT" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.10", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "8.3.2", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/viem": { + "version": "2.23.15", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.23.15.tgz", + "integrity": "sha512-2t9lROkSzj/ciEZ08NqAHZ6c+J1wKLwJ4qpUxcHdVHcLBt6GfO9+ycuZycTT05ckfJ6TbwnMXMa3bMonvhtUMw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@noble/curves": "1.8.1", + "@noble/hashes": "1.7.1", + "@scure/bip32": "1.6.2", + "@scure/bip39": "1.5.4", + "abitype": "1.0.8", + "isows": "1.0.6", + "ox": "0.6.9", + "ws": "8.18.1" + }, + "peerDependencies": { + "typescript": ">=5.0.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vite": { + "version": "6.2.2", + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "postcss": "^8.5.3", + "rollup": "^4.30.1" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.0", + "es-module-lexer": "^1.6.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "3.0.8", + "license": "MIT", + "dependencies": { + "@vitest/expect": "3.0.8", + "@vitest/mocker": "3.0.8", + "@vitest/pretty-format": "^3.0.8", + "@vitest/runner": "3.0.8", + "@vitest/snapshot": "3.0.8", + "@vitest/spy": "3.0.8", + "@vitest/utils": "3.0.8", + "chai": "^5.2.0", + "debug": "^4.4.0", + "expect-type": "^1.1.0", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinypool": "^1.0.2", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0", + "vite-node": "3.0.8", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.0.8", + "@vitest/ui": "3.0.8", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/walker": { + "version": "1.0.8", + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-fetch": { + "version": "3.6.20", + "license": "MIT" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.18.1", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml": { + "version": "2.7.0", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.24.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/src/Managing.Web3Proxy/package.json b/src/Managing.Web3Proxy/package.json new file mode 100644 index 0000000..b6ebf23 --- /dev/null +++ b/src/Managing.Web3Proxy/package.json @@ -0,0 +1,74 @@ +{ + "name": "web3-proxy", + "version": "1.0.0", + "description": "The official Managing Web3 Proxy", + "main": "app.js", + "type": "module", + "directories": { + "test": "test" + }, + "scripts": { + "start": "fastify start -l info dist/app.js", + "build": "tsc", + "watch": "tsc -w", + "dev": "npm run build && concurrently -k -p \"[{name}]\" -n \"TypeScript,App\" -c \"yellow.bold,cyan.bold\" \"npm:watch\" \"npm:dev:start\"", + "dev:start": "npm run build && fastify start -d --ignore-watch=.ts$ -w -l info -P dist/app.js", + "test": "npm run db:seed && c8 npm run test:run", + "test:run": "tsx --test ./test/**/*.ts", + "test:single": "tsc && tsx --test", + "standalone": "npm run build && node --env-file=.env dist/server.js", + "lint": "eslint --ignore-pattern=dist", + "lint:fix": "npm run lint -- --fix", + "db:create": "tsx --env-file=.env ./scripts/create-database.ts", + "db:drop": "tsx --env-file=.env ./scripts/drop-database.ts", + "db:migrate": "tsx --env-file=.env ./scripts/migrate.ts", + "db:seed": "tsx --env-file=.env ./scripts/seed-database.ts" + }, + "keywords": [], + "author": "Oda", + "license": "MIT", + "dependencies": { + "@fastify/autoload": "^6.0.0", + "@fastify/cookie": "^11.0.1", + "@fastify/cors": "^11.0.0", + "@fastify/env": "^5.0.1", + "@fastify/helmet": "^13.0.0", + "@fastify/multipart": "^9.0.1", + "@fastify/rate-limit": "^10.0.1", + "@fastify/sensible": "^6.0.1", + "@fastify/session": "^11.0.1", + "@fastify/static": "^8.0.2", + "@fastify/swagger": "^9.0.0", + "@fastify/swagger-ui": "^5.0.1", + "@fastify/type-provider-typebox": "^5.0.0", + "@fastify/under-pressure": "^9.0.1", + "@privy-io/server-auth": "^1.18.12", + "@sinclair/typebox": "^0.34.11", + "canonicalize": "^2.0.0", + "concurrently": "^9.0.1", + "cross-fetch": "^4.1.0", + "csv-stringify": "^6.5.2", + "ethers": "^6.13.5", + "fastify": "^5.0.0", + "fastify-cli": "^7.3.0", + "fastify-plugin": "^5.0.1", + "form-data": "^4.0.1", + "knex": "^3.1.0", + "mysql2": "^3.11.3", + "postgrator": "^8.0.0", + "query-string": "^9.1.1", + "viem": "^2.23.15", + "vitest": "^3.0.8", + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/node": "^22.5.5", + "c8": "^10.1.3", + "eslint": "^9.11.0", + "fastify-tsconfig": "^3.0.0", + "glob": "^11.0.0", + "neostandard": "^0.12.0", + "tsx": "^4.19.1", + "typescript": "~5.8.2" + } +} diff --git a/src/Managing.Web3Proxy/src/.DS_Store b/src/Managing.Web3Proxy/src/.DS_Store new file mode 100644 index 0000000..182df8f Binary files /dev/null and b/src/Managing.Web3Proxy/src/.DS_Store differ diff --git a/src/Managing.Web3Proxy/src/app.ts b/src/Managing.Web3Proxy/src/app.ts new file mode 100644 index 0000000..a6311ee --- /dev/null +++ b/src/Managing.Web3Proxy/src/app.ts @@ -0,0 +1,90 @@ +/** + * If you would like to turn your application into a standalone executable, look at server.js file + */ + +import path from 'node:path' +import fastifyAutoload from '@fastify/autoload' +import {FastifyInstance, FastifyPluginOptions} from 'fastify' + +export const options = { + ajv: { + customOptions: { + coerceTypes: 'array', + removeAdditional: 'all' + } + } +} + +export default async function serviceApp ( + fastify: FastifyInstance, + opts: FastifyPluginOptions +) { + delete opts.skipOverride // This option only serves testing purpose + // This loads all external plugins defined in plugins/external + // those should be registered first as your custom plugins might depend on them + // await fastify.register(fastifyAutoload, { + // dir: path.join(import.meta.dirname, 'plugins/external'), + // options: { ...opts } + // }) + + // This loads all your custom plugins defined in plugins/custom + // those should be support plugins that are reused + // through your application + fastify.register(fastifyAutoload, { + dir: path.join(import.meta.dirname, 'plugins/custom'), + options: { ...opts } + }) + + // This loads all plugins defined in routes + // define your routes in one of these + fastify.register(fastifyAutoload, { + dir: path.join(import.meta.dirname, 'routes'), + autoHooks: true, + cascadeHooks: true, + options: { ...opts } + }) + + fastify.setErrorHandler((err, request, reply) => { + fastify.log.error( + { + err, + request: { + method: request.method, + url: request.url, + query: request.query, + params: request.params + } + }, + 'Unhandled error occurred' + ) + + reply.code(err.statusCode ?? 500) + + let message = 'Internal Server Error' + if (err.statusCode && err.statusCode < 500) { + message = err.message + } + + return { message } + }) + + // An attacker could search for valid URLs if your 404 error handling is not rate limited. + fastify.setNotFoundHandler( + (request, reply) => { + request.log.warn( + { + request: { + method: request.method, + url: request.url, + query: request.query, + params: request.params + } + }, + 'Resource not found' + ) + + reply.code(404) + + return { message: 'Not Found' } + }) +} diff --git a/src/Managing.Web3Proxy/src/generated/.DS_Store b/src/Managing.Web3Proxy/src/generated/.DS_Store new file mode 100644 index 0000000..381bacf Binary files /dev/null and b/src/Managing.Web3Proxy/src/generated/.DS_Store differ diff --git a/src/Managing.Web3Proxy/src/generated/ManagingApiTypes.ts b/src/Managing.Web3Proxy/src/generated/ManagingApiTypes.ts new file mode 100644 index 0000000..15844df --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/ManagingApiTypes.ts @@ -0,0 +1,590 @@ +//---------------------- +// +// Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// +//---------------------- + +/* tslint:disable */ +/* eslint-disable */ +// ReSharper disable InconsistentNaming + + + +export interface Account { + name: string; + exchange: TradingExchanges; + type: AccountType; + key?: string | null; + secret?: string | null; + user?: User | null; + balances?: Balance[] | null; +} + +export enum TradingExchanges { + Binance = "Binance", + Kraken = "Kraken", + Ftx = "Ftx", + Evm = "Evm", + GmxV2 = "GmxV2", +} + +export enum AccountType { + Cex = "Cex", + Trader = "Trader", + Watch = "Watch", + Auth = "Auth", + Privy = "Privy", +} + +export interface User { + name?: string | null; + accounts?: Account[] | null; +} + +export interface Balance { + tokenImage?: string | null; + tokenName?: string | null; + amount?: number; + price?: number; + value?: number; + tokenAdress?: string | null; + chain?: Chain | null; +} + +export interface Chain { + id?: string | null; + rpcUrl?: string | null; + name?: string | null; + chainId?: number; +} + +export interface Backtest { + id: string; + finalPnl: number; + winRate: number; + growthPercentage: number; + hodlPercentage: number; + ticker: Ticker; + scenario: string; + positions: Position[]; + signals: Signal[]; + timeframe: Timeframe; + botType: BotType; + accountName: string; + candles: Candle[]; + startDate: Date; + endDate: Date; + statistics: PerformanceMetrics; + fees: number; + walletBalances: KeyValuePairOfDateTimeAndDecimal[]; + optimizedMoneyManagement: MoneyManagement; + moneyManagement: MoneyManagement; + user: User; + strategiesValues: { [key in keyof typeof StrategyType]?: StrategiesResultBase; }; + score: number; +} + +export enum Ticker { + AAVE = "AAVE", + ADA = "ADA", + APE = "APE", + ALGO = "ALGO", + ARB = "ARB", + ATOM = "ATOM", + AVAX = "AVAX", + BNB = "BNB", + BTC = "BTC", + BAL = "BAL", + CHZ = "CHZ", + COMP = "COMP", + CRO = "CRO", + CRV = "CRV", + DOGE = "DOGE", + DOT = "DOT", + DYDX = "DYDX", + ENS = "ENS", + ETC = "ETC", + ETH = "ETH", + FIL = "FIL", + FLM = "FLM", + FTM = "FTM", + GALA = "GALA", + GMX = "GMX", + GRT = "GRT", + IMX = "IMX", + JASMY = "JASMY", + KSM = "KSM", + LDO = "LDO", + LINK = "LINK", + LRC = "LRC", + LTC = "LTC", + MANA = "MANA", + MATIC = "MATIC", + MKR = "MKR", + NEAR = "NEAR", + OP = "OP", + PEPE = "PEPE", + QTUM = "QTUM", + REN = "REN", + ROSE = "ROSE", + RSR = "RSR", + RUNE = "RUNE", + SAND = "SAND", + SOL = "SOL", + SRM = "SRM", + SUSHI = "SUSHI", + THETA = "THETA", + UNI = "UNI", + USDC = "USDC", + USDT = "USDT", + WIF = "WIF", + XMR = "XMR", + XRP = "XRP", + XTZ = "XTZ", + SHIB = "SHIB", + STX = "STX", + ORDI = "ORDI", + Unknown = "Unknown", +} + +export interface Position { + accountName: string; + date: Date; + originDirection: TradeDirection; + ticker: Ticker; + moneyManagement: MoneyManagement; + open: Trade; + stopLoss: Trade; + takeProfit1: Trade; + takeProfit2?: Trade | null; + profitAndLoss?: ProfitAndLoss | null; + status: PositionStatus; + signalIdentifier?: string | null; + identifier: string; + initiator: PositionInitiator; + user?: User | null; +} + +export enum TradeDirection { + None = "None", + Short = "Short", + Long = "Long", +} + +export interface MoneyManagement { + name: string; + timeframe: Timeframe; + balanceAtRisk: number; + stopLoss: number; + takeProfit: number; + leverage: number; + user?: User | null; +} + +export enum Timeframe { + FiveMinutes = "FiveMinutes", + FifteenMinutes = "FifteenMinutes", + ThirtyMinutes = "ThirtyMinutes", + OneHour = "OneHour", + FourHour = "FourHour", + OneDay = "OneDay", +} + +export interface Trade { + fee?: number; + date: Date; + direction: TradeDirection; + status: TradeStatus; + tradeType: TradeType; + ticker: Ticker; + quantity: number; + price: number; + leverage?: number; + exchangeOrderId: string; + message?: string | null; +} + +export enum TradeStatus { + PendingOpen = "PendingOpen", + Requested = "Requested", + Cancelled = "Cancelled", + Filled = "Filled", +} + +export enum TradeType { + Limit = "Limit", + Market = "Market", + StopMarket = "StopMarket", + StopLimit = "StopLimit", + StopLoss = "StopLoss", + TakeProfit = "TakeProfit", + StopLossProfit = "StopLossProfit", + StopLossProfitLimit = "StopLossProfitLimit", + StopLossLimit = "StopLossLimit", + TakeProfitLimit = "TakeProfitLimit", + TrailingStop = "TrailingStop", + TrailingStopLimit = "TrailingStopLimit", + StopLossAndLimit = "StopLossAndLimit", + SettlePosition = "SettlePosition", +} + +export interface ProfitAndLoss { + realized?: number; + net?: number; + averageOpenPrice?: number; +} + +export enum PositionStatus { + New = "New", + Canceled = "Canceled", + Rejected = "Rejected", + Updating = "Updating", + PartiallyFilled = "PartiallyFilled", + Filled = "Filled", + Flipped = "Flipped", + Finished = "Finished", +} + +export enum PositionInitiator { + PaperTrading = "PaperTrading", + Bot = "Bot", + User = "User", + CopyTrading = "CopyTrading", +} + +export interface ValueObject { +} + +export interface Signal extends ValueObject { + status: SignalStatus; + direction: TradeDirection; + confidence: Confidence; + timeframe: Timeframe; + date: Date; + candle: Candle; + identifier: string; + ticker: Ticker; + exchange: TradingExchanges; + strategyType: StrategyType; + signalType: SignalType; + user?: User | null; +} + +export enum SignalStatus { + WaitingForPosition = "WaitingForPosition", + PositionOpen = "PositionOpen", + Expired = "Expired", +} + +export enum Confidence { + Low = "Low", + Medium = "Medium", + High = "High", + None = "None", +} + +export interface Candle { + exchange: TradingExchanges; + ticker: string; + openTime: Date; + date: Date; + open: number; + close: number; + volume?: number; + high: number; + low: number; + baseVolume?: number; + quoteVolume?: number; + tradeCount?: number; + takerBuyBaseVolume?: number; + takerBuyQuoteVolume?: number; + timeframe: Timeframe; +} + +export enum StrategyType { + RsiDivergence = "RsiDivergence", + RsiDivergenceConfirm = "RsiDivergenceConfirm", + MacdCross = "MacdCross", + EmaCross = "EmaCross", + ThreeWhiteSoldiers = "ThreeWhiteSoldiers", + SuperTrend = "SuperTrend", + ChandelierExit = "ChandelierExit", + EmaTrend = "EmaTrend", + Composite = "Composite", + StochRsiTrend = "StochRsiTrend", + Stc = "Stc", + StDev = "StDev", + LaggingStc = "LaggingStc", + SuperTrendCrossEma = "SuperTrendCrossEma", +} + +export enum SignalType { + Signal = "Signal", + Trend = "Trend", + Context = "Context", +} + +export enum BotType { + SimpleBot = "SimpleBot", + ScalpingBot = "ScalpingBot", + FlippingBot = "FlippingBot", +} + +export interface PerformanceMetrics { + count?: number; + sharpeRatio?: number; + maxDrawdown?: number; + maxDrawdownPc?: number; + maxDrawdownRecoveryTime?: string; + winningTrades?: number; + loosingTrades?: number; + totalPnL?: number; +} + +export interface KeyValuePairOfDateTimeAndDecimal { + key?: Date; + value?: number; +} + +export interface StrategiesResultBase { + ema?: EmaResult[] | null; + macd?: MacdResult[] | null; + rsi?: RsiResult[] | null; + stoch?: StochResult[] | null; + stochRsi?: StochRsiResult[] | null; + bollingerBands?: BollingerBandsResult[] | null; + chandelierShort?: ChandelierResult[] | null; + stc?: StcResult[] | null; + stdDev?: StdDevResult[] | null; + superTrend?: SuperTrendResult[] | null; + chandelierLong?: ChandelierResult[] | null; +} + +export interface ResultBase { + date?: Date; +} + +export interface EmaResult extends ResultBase { + ema?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface MacdResult extends ResultBase { + macd?: number | null; + signal?: number | null; + histogram?: number | null; + fastEma?: number | null; + slowEma?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface RsiResult extends ResultBase { + rsi?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +/** Stochastic indicator results includes aliases for those who prefer the simpler K,D,J outputs. See documentation for more information. */ +export interface StochResult extends ResultBase { + oscillator?: number | null; + signal?: number | null; + percentJ?: number | null; + k?: number | null; + d?: number | null; + j?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface StochRsiResult extends ResultBase { + stochRsi?: number | null; + signal?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface BollingerBandsResult extends ResultBase { + sma?: number | null; + upperBand?: number | null; + lowerBand?: number | null; + percentB?: number | null; + zScore?: number | null; + width?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface ChandelierResult extends ResultBase { + chandelierExit?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface StcResult extends ResultBase { + stc?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface StdDevResult extends ResultBase { + stdDev?: number | null; + mean?: number | null; + zScore?: number | null; + stdDevSma?: number | null; + "skender.Stock.Indicators.IReusableResult.Value"?: number | null; +} + +export interface SuperTrendResult extends ResultBase { + superTrend?: number | null; + upperBand?: number | null; + lowerBand?: number | null; +} + +export interface StartBotRequest { + botType: BotType; + botName: string; + ticker: Ticker; + timeframe: Timeframe; + isForWatchOnly: boolean; + scenario: string; + accountName: string; + moneyManagementName: string; +} + +export interface TradingBot { + name: string; + status: string; + signals: Signal[]; + positions: Position[]; + candles: Candle[]; + winRate: number; + profitAndLoss: number; + timeframe: Timeframe; + ticker: Ticker; + scenario: string; + isForWatchingOnly: boolean; + botType: BotType; + accountName: string; + moneyManagement: MoneyManagement; +} + +export interface SpotlightOverview { + spotlights: Spotlight[]; + dateTime: Date; + identifier?: string; + scenarioCount?: number; +} + +export interface Spotlight { + scenario: Scenario; + tickerSignals: TickerSignal[]; +} + +export interface Scenario { + name?: string | null; + strategies?: Strategy[] | null; + loopbackPeriod?: number | null; + user?: User | null; +} + +export interface Strategy { + name?: string | null; + type?: StrategyType; + signalType?: SignalType; + minimumHistory?: number; + period?: number | null; + fastPeriods?: number | null; + slowPeriods?: number | null; + signalPeriods?: number | null; + multiplier?: number | null; + smoothPeriods?: number | null; + stochPeriods?: number | null; + cyclePeriods?: number | null; + user?: User | null; +} + +export interface TickerSignal { + ticker: Ticker; + fiveMinutes: Signal[]; + fifteenMinutes: Signal[]; + oneHour: Signal[]; + fourHour: Signal[]; + oneDay: Signal[]; +} + +export enum RiskLevel { + Low = "Low", + Medium = "Medium", + High = "High", + Adaptive = "Adaptive", +} + +export interface LoginRequest { + name: string; + address: string; + signature: string; + message: string; +} + +export interface Workflow { + name: string; + usage: WorkflowUsage; + flows: IFlow[]; + description: string; +} + +export enum WorkflowUsage { + Trading = "Trading", + Task = "Task", +} + +export interface IFlow { + id: string; + name: string; + type: FlowType; + description: string; + acceptedInputs: FlowOutput[]; + children?: IFlow[] | null; + parameters: FlowParameter[]; + parentId?: string; + output?: string | null; + outputTypes: FlowOutput[]; +} + +export enum FlowType { + RsiDivergence = "RsiDivergence", + FeedTicker = "FeedTicker", + OpenPosition = "OpenPosition", +} + +export enum FlowOutput { + Signal = "Signal", + Candles = "Candles", + Position = "Position", + MoneyManagement = "MoneyManagement", +} + +export interface FlowParameter { + value?: any | null; + name?: string | null; +} + +export interface SyntheticWorkflow { + name: string; + usage: WorkflowUsage; + description: string; + flows: SyntheticFlow[]; +} + +export interface SyntheticFlow { + id: string; + parentId?: string | null; + type: FlowType; + parameters: SyntheticFlowParameter[]; +} + +export interface SyntheticFlowParameter { + value: string; + name: string; +} + +export interface FileResponse { + data: Blob; + status: number; + fileName?: string; + headers?: { [name: string]: any }; +} \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/CustomErrors.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/CustomErrors.json new file mode 100644 index 0000000..42f81d5 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/CustomErrors.json @@ -0,0 +1,3254 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Errors", + "sourceName": "contracts/error/Errors.sol", + "abi": [ + { + "inputs": [], + "name": "ActionAlreadySignalled", + "type": "error" + }, + { + "inputs": [], + "name": "ActionNotSignalled", + "type": "error" + }, + { + "inputs": [], + "name": "AdlNotEnabled", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "pnlToPoolFactor", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "maxPnlFactorForAdl", + "type": "uint256" + } + ], + "name": "AdlNotRequired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "values", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "ArrayOutOfBoundsBytes", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "ArrayOutOfBoundsUint256", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minOracleBlockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "prevMinOracleBlockNumber", + "type": "uint256" + } + ], + "name": "BlockNumbersNotSorted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "heartbeatDuration", + "type": "uint256" + } + ], + "name": "ChainlinkPriceFeedNotUpdated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "adjustedClaimableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimedAmount", + "type": "uint256" + } + ], + "name": "CollateralAlreadyClaimed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "compactedValues", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "slotIndex", + "type": "uint256" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "CompactedArrayOutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ConfigValueExceedsAllowedRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "DataStreamIdAlreadyExistsForToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DepositNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "DisabledMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "DuplicatedIndex", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "DuplicatedMarketInSwapPath", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyAddressInMarketTokenBalanceValidation", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyChainlinkPaymentToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyChainlinkPriceFeed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyChainlinkPriceFeedMultiplier", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyDataStreamFeedId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyDataStreamMultiplier", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyDepositAmounts", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyDepositAmountsAfterSwap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "EmptyGlv", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvDepositAmounts", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvMarketAmount", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvTokenSupply", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvWithdrawal", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvWithdrawalAmount", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyMarket", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyMarketTokenSupply", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyOrder", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyPosition", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyPrimaryPrice", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyShift", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyShiftAmount", + "type": "error" + }, + { + "inputs": [], + "name": "EmptySizeDeltaInTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyValidatedPrices", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyWithdrawal", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyWithdrawalAmount", + "type": "error" + }, + { + "inputs": [], + "name": "EndOfOracleSimulation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ExternalCallFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "FeeBatchNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "GlvAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "GlvDepositNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvDisabledMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvEnabledMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "marketTokenBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + } + ], + "name": "GlvInsufficientMarketTokenBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "provided", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "GlvInvalidLongToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "provided", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "GlvInvalidShortToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvMarketAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "uint256", + "name": "glvMaxMarketCount", + "type": "uint256" + } + ], + "name": "GlvMaxMarketCountExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxMarketTokenBalanceAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketTokenBalanceAmount", + "type": "uint256" + } + ], + "name": "GlvMaxMarketTokenBalanceAmountExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxMarketTokenBalanceUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketTokenBalanceUsd", + "type": "uint256" + } + ], + "name": "GlvMaxMarketTokenBalanceUsdExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "GlvNameTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvNegativeMarketPoolValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvNonZeroMarketBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "key", + "type": "address" + } + ], + "name": "GlvNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastGlvShiftExecutedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "glvShiftMinInterval", + "type": "uint256" + } + ], + "name": "GlvShiftIntervalNotYetPassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "effectivePriceImpactFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "glvMaxShiftPriceImpactFactor", + "type": "uint256" + } + ], + "name": "GlvShiftMaxPriceImpactExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "GlvShiftNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "GlvSymbolTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvUnsupportedMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "GlvWithdrawalNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "signerIndex", + "type": "uint256" + } + ], + "name": "GmEmptySigner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minOracleBlockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentBlockNumber", + "type": "uint256" + } + ], + "name": "GmInvalidBlockNumber", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minOracleBlockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOracleBlockNumber", + "type": "uint256" + } + ], + "name": "GmInvalidMinMaxBlockNumber", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "oracleSigners", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOracleSigners", + "type": "uint256" + } + ], + "name": "GmMaxOracleSigners", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "prevPrice", + "type": "uint256" + } + ], + "name": "GmMaxPricesNotSorted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "signerIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSignerIndex", + "type": "uint256" + } + ], + "name": "GmMaxSignerIndex", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "oracleSigners", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOracleSigners", + "type": "uint256" + } + ], + "name": "GmMinOracleSigners", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "prevPrice", + "type": "uint256" + } + ], + "name": "GmMinPricesNotSorted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "collateralDeltaAmount", + "type": "int256" + } + ], + "name": "InsufficientCollateralAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "remainingCollateralUsd", + "type": "int256" + } + ], + "name": "InsufficientCollateralUsd", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minExecutionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "InsufficientExecutionFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "startingGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estimatedGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAdditionalGasForExecution", + "type": "uint256" + } + ], + "name": "InsufficientExecutionGas", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "startingGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minHandleErrorGas", + "type": "uint256" + } + ], + "name": "InsufficientExecutionGasForErrorHandling", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "remainingCostUsd", + "type": "uint256" + }, + { + "internalType": "string", + "name": "step", + "type": "string" + } + ], + "name": "InsufficientFundsToPayForCosts", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minHandleExecutionErrorGas", + "type": "uint256" + } + ], + "name": "InsufficientGasForCancellation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gasToBeForwarded", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "name": "InsufficientGasLeftForCallback", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minHandleExecutionErrorGas", + "type": "uint256" + } + ], + "name": "InsufficientHandleExecutionErrorGas", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + } + ], + "name": "InsufficientMarketTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "outputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + } + ], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "poolAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientPoolAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reservedUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxReservedUsd", + "type": "uint256" + } + ], + "name": "InsufficientReserve", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reservedUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxReservedUsd", + "type": "uint256" + } + ], + "name": "InsufficientReserveForOpenInterest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "outputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + } + ], + "name": "InsufficientSwapOutputAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "wntAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "InsufficientWntAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "wntAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "InsufficientWntAmountForExecutionFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "nextPnlToPoolFactor", + "type": "int256" + }, + { + "internalType": "int256", + "name": "pnlToPoolFactor", + "type": "int256" + } + ], + "name": "InvalidAdl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "remainingAmount", + "type": "uint256" + } + ], + "name": "InvalidAmountInForFeeBatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "baseKey", + "type": "bytes32" + } + ], + "name": "InvalidBaseKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "largestMinBlockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "smallestMaxBlockNumber", + "type": "uint256" + } + ], + "name": "InvalidBlockRangeSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + } + ], + "name": "InvalidClaimAffiliateRewardsInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timeKeysLength", + "type": "uint256" + } + ], + "name": "InvalidClaimCollateralInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + } + ], + "name": "InvalidClaimFeesInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + } + ], + "name": "InvalidClaimFundingFeesInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + } + ], + "name": "InvalidClaimUiFeesInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "InvalidClaimableFactor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "InvalidCollateralTokenForMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "int192", + "name": "bid", + "type": "int192" + }, + { + "internalType": "int192", + "name": "ask", + "type": "int192" + } + ], + "name": "InvalidDataStreamBidAsk", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedFeedId", + "type": "bytes32" + } + ], + "name": "InvalidDataStreamFeedId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "int192", + "name": "bid", + "type": "int192" + }, + { + "internalType": "int192", + "name": "ask", + "type": "int192" + } + ], + "name": "InvalidDataStreamPrices", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionSizeInUsd", + "type": "uint256" + } + ], + "name": "InvalidDecreaseOrderSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "decreasePositionSwapType", + "type": "uint256" + } + ], + "name": "InvalidDecreasePositionSwapType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "totalExecutionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "InvalidExecutionFeeForMigration", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "targetsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dataListLength", + "type": "uint256" + } + ], + "name": "InvalidExternalCallInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "InvalidExternalCallTarget", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "refundTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "refundReceiversLength", + "type": "uint256" + } + ], + "name": "InvalidExternalReceiversInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeBatchTokensLength", + "type": "uint256" + } + ], + "name": "InvalidFeeBatchTokenIndex", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "InvalidFeeReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "int256", + "name": "price", + "type": "int256" + } + ], + "name": "InvalidFeedPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "totalGlpAmountToRedeem", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalGlpAmount", + "type": "uint256" + } + ], + "name": "InvalidGlpAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + } + ], + "name": "InvalidGlvDepositInitialLongToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + } + ], + "name": "InvalidGlvDepositInitialShortToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "longTokenSwapPathLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenSwapPathLength", + "type": "uint256" + } + ], + "name": "InvalidGlvDepositSwapPath", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "InvalidGmMedianMinMaxPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "InvalidGmOraclePrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recoveredSigner", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSigner", + "type": "address" + } + ], + "name": "InvalidGmSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "InvalidGmSignerMinMaxPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "keeper", + "type": "address" + } + ], + "name": "InvalidKeeperForFrozenOrder", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedMinBalance", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableFundingFeeAmount", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalanceForClaimableFunding", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalanceForCollateralAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedMinGlvTokens", + "type": "uint256" + } + ], + "name": "InvalidMinGlvTokensForFirstGlvDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedMinMarketTokens", + "type": "uint256" + } + ], + "name": "InvalidMinMarketTokensForFirstDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "InvalidMinMaxForPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "InvalidNativeTokenSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "InvalidOracleProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedProvider", + "type": "address" + } + ], + "name": "InvalidOracleProviderForToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dataLength", + "type": "uint256" + } + ], + "name": "InvalidOracleSetPricesDataParam", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "providersLength", + "type": "uint256" + } + ], + "name": "InvalidOracleSetPricesProvidersParam", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "InvalidOracleSigner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "primaryPriceMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "primaryPriceMax", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "orderType", + "type": "uint256" + } + ], + "name": "InvalidOrderPrices", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedTokenOut", + "type": "address" + } + ], + "name": "InvalidOutputToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "poolValue", + "type": "int256" + } + ], + "name": "InvalidPoolValueForDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "poolValue", + "type": "int256" + } + ], + "name": "InvalidPoolValueForWithdrawal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "InvalidPositionMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeInTokens", + "type": "uint256" + } + ], + "name": "InvalidPositionSizeValues", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "primaryTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "primaryPricesLength", + "type": "uint256" + } + ], + "name": "InvalidPrimaryPricesForSimulation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedReceiver", + "type": "address" + } + ], + "name": "InvalidReceiverForFirstDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedReceiver", + "type": "address" + } + ], + "name": "InvalidReceiverForFirstGlvDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedReceiver", + "type": "address" + } + ], + "name": "InvalidReceiverForSubaccountOrder", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionSizeInUsd", + "type": "uint256" + } + ], + "name": "InvalidSizeDeltaForAdl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "InvalidSwapMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "outputToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedOutputToken", + "type": "address" + } + ], + "name": "InvalidSwapOutputToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "bridgingToken", + "type": "address" + } + ], + "name": "InvalidSwapPathForV1", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timelockDelay", + "type": "uint256" + } + ], + "name": "InvalidTimelockDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "InvalidTokenIn", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "uiFeeFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxUiFeeFactor", + "type": "uint256" + } + ], + "name": "InvalidUiFeeFactor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "int256", + "name": "remainingCollateralUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minCollateralUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minCollateralUsdForLeverage", + "type": "int256" + } + ], + "name": "LiquidatablePosition", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fromMarketLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarketLongToken", + "type": "address" + } + ], + "name": "LongTokensAreNotEqual", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "existingMarketAddress", + "type": "address" + } + ], + "name": "MarketAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "key", + "type": "address" + } + ], + "name": "MarketNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "MaskIndexOutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAutoCancelOrders", + "type": "uint256" + } + ], + "name": "MaxAutoCancelOrdersExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCallbackGasLimit", + "type": "uint256" + } + ], + "name": "MaxCallbackGasLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxFundingFactorPerSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "MaxFundingFactorPerSecondLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "openInterest", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOpenInterest", + "type": "uint256" + } + ], + "name": "MaxOpenInterestExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "range", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRange", + "type": "uint256" + } + ], + "name": "MaxOracleTimestampRangeExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "poolAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPoolAmount", + "type": "uint256" + } + ], + "name": "MaxPoolAmountExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "poolUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPoolUsdForDeposit", + "type": "uint256" + } + ], + "name": "MaxPoolUsdForDepositExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "oracleTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + } + ], + "name": "MaxPriceAgeExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "refPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRefPriceDeviationFactor", + "type": "uint256" + } + ], + "name": "MaxRefPriceDeviationExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCount", + "type": "uint256" + } + ], + "name": "MaxSubaccountActionCountExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapPathLengh", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSwapPathLength", + "type": "uint256" + } + ], + "name": "MaxSwapPathLengthExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timelockDelay", + "type": "uint256" + } + ], + "name": "MaxTimelockDelayExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "totalCallbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalCallbackGasLimit", + "type": "uint256" + } + ], + "name": "MaxTotalCallbackGasLimitForAutoCancelOrdersExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + } + ], + "name": "MinGlvTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + } + ], + "name": "MinLongTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + } + ], + "name": "MinMarketTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionSizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minPositionSizeUsd", + "type": "uint256" + } + ], + "name": "MinPositionSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + } + ], + "name": "MinShortTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "executionPrice", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionSizeInUsd", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "priceImpactUsd", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + } + ], + "name": "NegativeExecutionPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "NonAtomicOracleProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensWithPricesLength", + "type": "uint256" + } + ], + "name": "NonEmptyTokensWithPrices", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "OpenInterestCannotBeUpdatedForSwapOnlyMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "OracleProviderAlreadyExistsForToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxOracleTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestExpirationTime", + "type": "uint256" + } + ], + "name": "OracleTimestampsAreLargerThanRequestExpirationTime", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minOracleTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedTimestamp", + "type": "uint256" + } + ], + "name": "OracleTimestampsAreSmallerThanRequired", + "type": "error" + }, + { + "inputs": [], + "name": "OrderAlreadyFrozen", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "OrderNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + } + ], + "name": "OrderNotFulfillableAtAcceptablePrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderType", + "type": "uint256" + } + ], + "name": "OrderNotUpdatable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderType", + "type": "uint256" + } + ], + "name": "OrderTypeCannotBeCreated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "pnlToPoolFactor", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "maxPnlFactor", + "type": "uint256" + } + ], + "name": "PnlFactorExceededForLongs", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "pnlToPoolFactor", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "maxPnlFactor", + "type": "uint256" + } + ], + "name": "PnlFactorExceededForShorts", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "nextPnlToPoolFactor", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "minPnlFactorForAdl", + "type": "uint256" + } + ], + "name": "PnlOvercorrected", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "PositionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "int256", + "name": "remainingCollateralUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minCollateralUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minCollateralUsdForLeverage", + "type": "int256" + } + ], + "name": "PositionShouldNotBeLiquidated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "PriceAlreadySet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "PriceFeedAlreadyExistsForToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "priceImpactUsd", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + } + ], + "name": "PriceImpactLargerThanOrderSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestAge", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestExpirationAge", + "type": "uint256" + }, + { + "internalType": "string", + "name": "requestType", + "type": "string" + } + ], + "name": "RequestNotYetCancellable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "SelfTransferNotSupported", + "type": "error" + }, + { + "inputs": [], + "name": "SequencerDown", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timeSinceUp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sequencerGraceDuration", + "type": "uint256" + } + ], + "name": "SequencerGraceDurationNotYetPassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "ShiftFromAndToMarketAreEqual", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "ShiftNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fromMarketLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarketLongToken", + "type": "address" + } + ], + "name": "ShortTokensAreNotEqual", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "signalTime", + "type": "uint256" + } + ], + "name": "SignalTimeNotYetPassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + } + ], + "name": "SubaccountNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountAfterFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "negativeImpactAmount", + "type": "int256" + } + ], + "name": "SwapPriceImpactExceedsAmountIn", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "longTokenSwapPathLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenSwapPathLength", + "type": "uint256" + } + ], + "name": "SwapsNotAllowedForAtomicWithdrawal", + "type": "error" + }, + { + "inputs": [], + "name": "ThereMustBeAtLeastOneRoleAdmin", + "type": "error" + }, + { + "inputs": [], + "name": "ThereMustBeAtLeastOneTimelockMultiSig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [], + "name": "UnableToGetBorrowingFactorEmptyPoolUsd", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "UnableToGetCachedTokenPrice", + "type": "error" + }, + { + "inputs": [], + "name": "UnableToGetFundingFactorEmptyOpenInterest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "inputToken", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "UnableToGetOppositeToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "estimatedRemainingCollateralUsd", + "type": "int256" + } + ], + "name": "UnableToWithdrawCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "positionBorrowingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cumulativeBorrowingFactor", + "type": "uint256" + } + ], + "name": "UnexpectedBorrowingFactor", + "type": "error" + }, + { + "inputs": [], + "name": "UnexpectedMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "poolValue", + "type": "int256" + } + ], + "name": "UnexpectedPoolValue", + "type": "error" + }, + { + "inputs": [], + "name": "UnexpectedPositionState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "UnexpectedTokenForVirtualInventory", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderType", + "type": "uint256" + } + ], + "name": "UnsupportedOrderType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "usdDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "longOpenInterest", + "type": "uint256" + } + ], + "name": "UsdDeltaExceedsLongOpenInterest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "usdDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "poolUsd", + "type": "uint256" + } + ], + "name": "UsdDeltaExceedsPoolValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "usdDelta", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "shortOpenInterest", + "type": "uint256" + } + ], + "name": "UsdDeltaExceedsShortOpenInterest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "WithdrawalNotFound", + "type": "error" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/DataStore.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/DataStore.json new file mode 100644 index 0000000..ed8b75a --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/DataStore.json @@ -0,0 +1,1440 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DataStore", + "sourceName": "contracts/data/DataStore.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "addAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "addBytes32", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "addUint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "addressArrayValues", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "addressValues", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "applyBoundedDeltaToUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "applyDeltaToInt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + }, + { + "internalType": "string", + "name": "errorMessage", + "type": "string" + } + ], + "name": "applyDeltaToUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "boolArrayValues", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "boolValues", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "bytes32ArrayValues", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "bytes32Values", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "containsAddress", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "containsBytes32", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "containsUint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "decrementInt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "decrementUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getAddressArray", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + } + ], + "name": "getAddressCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAddressValuesAt", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getBool", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getBoolArray", + "outputs": [ + { + "internalType": "bool[]", + "name": "", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getBytes32Array", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + } + ], + "name": "getBytes32Count", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getBytes32ValuesAt", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getInt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getIntArray", + "outputs": [ + { + "internalType": "int256[]", + "name": "", + "type": "int256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getString", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getStringArray", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getUintArray", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + } + ], + "name": "getUintCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getUintValuesAt", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "incrementInt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "incrementUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "intArrayValues", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "intValues", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "removeAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeAddressArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeBool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeBoolArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "removeBytes32", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeBytes32", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeBytes32Array", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeInt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeIntArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeString", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeStringArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeUint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "setKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "removeUint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "removeUintArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "setAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "name": "setAddressArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "setBool", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "name": "setBoolArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "setBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "name": "setBytes32Array", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "setInt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "name": "setIntArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "setString", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "name": "setStringArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "name": "setUintArray", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "stringArrayValues", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "stringValues", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "uintArrayValues", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "uintValues", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ERC721.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ERC721.json new file mode 100644 index 0000000..77a715e --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ERC721.json @@ -0,0 +1,442 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ERC721", + "sourceName": "contracts/libraries/token/ERC721/ERC721.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/EventEmitter.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/EventEmitter.json new file mode 100644 index 0000000..66eb078 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/EventEmitter.json @@ -0,0 +1,2065 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "EventEmitter", + "sourceName": "contracts/event/EventEmitter.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "eventName", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "eventNameHash", + "type": "string" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "internalType": "struct EventUtils.AddressKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "internalType": "struct EventUtils.AddressArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.AddressItems", + "name": "addressItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct EventUtils.UintKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "internalType": "struct EventUtils.UintArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.UintItems", + "name": "uintItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "internalType": "struct EventUtils.IntKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "internalType": "struct EventUtils.IntArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.IntItems", + "name": "intItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "internalType": "struct EventUtils.BoolKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "internalType": "struct EventUtils.BoolArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BoolItems", + "name": "boolItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct EventUtils.Bytes32KeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.Bytes32Items", + "name": "bytes32Items", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "internalType": "struct EventUtils.BytesKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "internalType": "struct EventUtils.BytesArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BytesItems", + "name": "bytesItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct EventUtils.StringKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "internalType": "struct EventUtils.StringArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.StringItems", + "name": "stringItems", + "type": "tuple" + } + ], + "indexed": false, + "internalType": "struct EventUtils.EventLogData", + "name": "eventData", + "type": "tuple" + } + ], + "name": "EventLog", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "eventName", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "eventNameHash", + "type": "string" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "internalType": "struct EventUtils.AddressKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "internalType": "struct EventUtils.AddressArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.AddressItems", + "name": "addressItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct EventUtils.UintKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "internalType": "struct EventUtils.UintArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.UintItems", + "name": "uintItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "internalType": "struct EventUtils.IntKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "internalType": "struct EventUtils.IntArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.IntItems", + "name": "intItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "internalType": "struct EventUtils.BoolKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "internalType": "struct EventUtils.BoolArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BoolItems", + "name": "boolItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct EventUtils.Bytes32KeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.Bytes32Items", + "name": "bytes32Items", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "internalType": "struct EventUtils.BytesKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "internalType": "struct EventUtils.BytesArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BytesItems", + "name": "bytesItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct EventUtils.StringKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "internalType": "struct EventUtils.StringArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.StringItems", + "name": "stringItems", + "type": "tuple" + } + ], + "indexed": false, + "internalType": "struct EventUtils.EventLogData", + "name": "eventData", + "type": "tuple" + } + ], + "name": "EventLog1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "eventName", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "eventNameHash", + "type": "string" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "topic2", + "type": "bytes32" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "internalType": "struct EventUtils.AddressKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "internalType": "struct EventUtils.AddressArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.AddressItems", + "name": "addressItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct EventUtils.UintKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "internalType": "struct EventUtils.UintArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.UintItems", + "name": "uintItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "internalType": "struct EventUtils.IntKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "internalType": "struct EventUtils.IntArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.IntItems", + "name": "intItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "internalType": "struct EventUtils.BoolKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "internalType": "struct EventUtils.BoolArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BoolItems", + "name": "boolItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct EventUtils.Bytes32KeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.Bytes32Items", + "name": "bytes32Items", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "internalType": "struct EventUtils.BytesKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "internalType": "struct EventUtils.BytesArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BytesItems", + "name": "bytesItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct EventUtils.StringKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "internalType": "struct EventUtils.StringArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.StringItems", + "name": "stringItems", + "type": "tuple" + } + ], + "indexed": false, + "internalType": "struct EventUtils.EventLogData", + "name": "eventData", + "type": "tuple" + } + ], + "name": "EventLog2", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "emitDataLog1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic2", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "emitDataLog2", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic3", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "emitDataLog3", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic3", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic4", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "emitDataLog4", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "eventName", + "type": "string" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "internalType": "struct EventUtils.AddressKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "internalType": "struct EventUtils.AddressArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.AddressItems", + "name": "addressItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct EventUtils.UintKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "internalType": "struct EventUtils.UintArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.UintItems", + "name": "uintItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "internalType": "struct EventUtils.IntKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "internalType": "struct EventUtils.IntArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.IntItems", + "name": "intItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "internalType": "struct EventUtils.BoolKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "internalType": "struct EventUtils.BoolArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BoolItems", + "name": "boolItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct EventUtils.Bytes32KeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.Bytes32Items", + "name": "bytes32Items", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "internalType": "struct EventUtils.BytesKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "internalType": "struct EventUtils.BytesArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BytesItems", + "name": "bytesItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct EventUtils.StringKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "internalType": "struct EventUtils.StringArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.StringItems", + "name": "stringItems", + "type": "tuple" + } + ], + "internalType": "struct EventUtils.EventLogData", + "name": "eventData", + "type": "tuple" + } + ], + "name": "emitEventLog", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "eventName", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "internalType": "struct EventUtils.AddressKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "internalType": "struct EventUtils.AddressArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.AddressItems", + "name": "addressItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct EventUtils.UintKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "internalType": "struct EventUtils.UintArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.UintItems", + "name": "uintItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "internalType": "struct EventUtils.IntKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "internalType": "struct EventUtils.IntArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.IntItems", + "name": "intItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "internalType": "struct EventUtils.BoolKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "internalType": "struct EventUtils.BoolArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BoolItems", + "name": "boolItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct EventUtils.Bytes32KeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.Bytes32Items", + "name": "bytes32Items", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "internalType": "struct EventUtils.BytesKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "internalType": "struct EventUtils.BytesArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BytesItems", + "name": "bytesItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct EventUtils.StringKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "internalType": "struct EventUtils.StringArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.StringItems", + "name": "stringItems", + "type": "tuple" + } + ], + "internalType": "struct EventUtils.EventLogData", + "name": "eventData", + "type": "tuple" + } + ], + "name": "emitEventLog1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "eventName", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic2", + "type": "bytes32" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "internalType": "struct EventUtils.AddressKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "internalType": "struct EventUtils.AddressArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.AddressItems", + "name": "addressItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct EventUtils.UintKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "internalType": "struct EventUtils.UintArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.UintItems", + "name": "uintItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "internalType": "struct EventUtils.IntKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "internalType": "struct EventUtils.IntArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.IntItems", + "name": "intItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "internalType": "struct EventUtils.BoolKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "internalType": "struct EventUtils.BoolArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BoolItems", + "name": "boolItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct EventUtils.Bytes32KeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "internalType": "struct EventUtils.Bytes32ArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.Bytes32Items", + "name": "bytes32Items", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "internalType": "struct EventUtils.BytesKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "internalType": "struct EventUtils.BytesArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.BytesItems", + "name": "bytesItems", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct EventUtils.StringKeyValue[]", + "name": "items", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "internalType": "struct EventUtils.StringArrayKeyValue[]", + "name": "arrayItems", + "type": "tuple[]" + } + ], + "internalType": "struct EventUtils.StringItems", + "name": "stringItems", + "type": "tuple" + } + ], + "internalType": "struct EventUtils.EventLogData", + "name": "eventData", + "type": "tuple" + } + ], + "name": "emitEventLog2", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ExchangeRouter.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ExchangeRouter.json new file mode 100644 index 0000000..2026511 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ExchangeRouter.json @@ -0,0 +1,1801 @@ +{ + "address": "0x69C527fC77291722b52649E45c838e41be8Bf5d5", + "abi": [ + { + "inputs": [ + { + "internalType": "contract Router", + "name": "_router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "_dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "_eventEmitter", + "type": "address" + }, + { + "internalType": "contract IDepositHandler", + "name": "_depositHandler", + "type": "address" + }, + { + "internalType": "contract IWithdrawalHandler", + "name": "_withdrawalHandler", + "type": "address" + }, + { + "internalType": "contract IShiftHandler", + "name": "_shiftHandler", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "_orderHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "_externalHandler", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "adjustedClaimableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimedAmount", + "type": "uint256" + } + ], + "name": "CollateralAlreadyClaimed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "DisabledMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyAddressInMarketTokenBalanceValidation", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyMarket", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyOrder", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + } + ], + "name": "InvalidClaimAffiliateRewardsInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timeKeysLength", + "type": "uint256" + } + ], + "name": "InvalidClaimCollateralInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + } + ], + "name": "InvalidClaimFundingFeesInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + } + ], + "name": "InvalidClaimUiFeesInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "InvalidClaimableFactor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedMinBalance", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableFundingFeeAmount", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalanceForClaimableFunding", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalanceForCollateralAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "uiFeeFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxUiFeeFactor", + "type": "uint256" + } + ], + "name": "InvalidUiFeeFactor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelShift", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "claimAffiliateRewards", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "timeKeys", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "claimCollateral", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "claimFundingFees", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "claimUiFees", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct DepositUtils.CreateDepositParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createDeposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", + "name": "numbers", + "type": "tuple" + }, + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct ShiftUtils.CreateShiftParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createShift", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct WithdrawalUtils.CreateWithdrawalParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createWithdrawal", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositHandler", + "outputs": [ + { + "internalType": "contract IDepositHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct WithdrawalUtils.CreateWithdrawalParams", + "name": "params", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + } + ], + "name": "executeAtomicWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "name": "makeExternalCalls", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + } + ], + "name": "setSavedCallbackContract", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "uiFeeFactor", + "type": "uint256" + } + ], + "name": "setUiFeeFactor", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "shiftHandler", + "outputs": [ + { + "internalType": "contract IShiftHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteLatestDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteLatestOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteLatestShift", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + }, + { + "internalType": "enum ISwapPricingUtils.SwapPricingType", + "name": "swapPricingType", + "type": "uint8" + } + ], + "name": "simulateExecuteLatestWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteShift", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + }, + { + "internalType": "enum ISwapPricingUtils.SwapPricingType", + "name": "swapPricingType", + "type": "uint8" + } + ], + "name": "simulateExecuteWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + } + ], + "name": "updateOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawalHandler", + "outputs": [ + { + "internalType": "contract IWithdrawalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x723bba33993a46238da285f8900a6c411564432b8af409c3dc8d3b1f6d5c7167", + "receipt": { + "to": null, + "from": "0xE7BfFf2aB721264887230037940490351700a068", + "contractAddress": "0x69C527fC77291722b52649E45c838e41be8Bf5d5", + "transactionIndex": 6, + "gasUsed": "6362339", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd18c90532e420963f4dc93793b032a792fdde7171138710bc41c4088e2aa5d59", + "transactionHash": "0x723bba33993a46238da285f8900a6c411564432b8af409c3dc8d3b1f6d5c7167", + "logs": [], + "blockNumber": 222747030, + "cumulativeGasUsed": "6942059", + "status": 1, + "byzantium": true + }, + "args": [ + "0x7452c558d45f8afC8c83dAe62C3f8A5BE19c71f6", + "0x3c3d99FD298f679DBC2CEcd132b4eC4d0F5e6e72", + "0xFD70de6b91282D8017aA4E741e9Ae325CAb992d8", + "0xC8ee91A54287DB53897056e12D9819156D3822Fb", + "0x321f3739983CC3E911fd67a83d1ee76238894Bd0", + "0xA19fA3F0D8E7b7A8963420De504b624167e709B2", + "0xEa90EC1228F7D1b3D47D84d1c9D46dBDFEfF7709", + "0xB0Fc2a48b873da40e7bc25658e5E6137616AC2Ee", + "0x389CEf541397e872dC04421f166B5Bc2E0b374a5" + ], + "numDeployments": 6, + "solcInputHash": "292dd15f99d7c1e4e4b27476672071d7", + "libraries": { + "CallbackUtils": "0x501e34E31f1594ffbd3D0C17634D6de6C6C5c7A3", + "DepositStoreUtils": "0x3063A99D2df2A871068D47041eB8d089E5DE1Cdc", + "FeeUtils": "0x7Fd8d13A778a22F5c2acB67226A193C7d0b0a336", + "MarketEventUtils": "0x1F493E17bcF5390d3e5E49eE0bce17d4d068f90b", + "MarketStoreUtils": "0xbbf05cF8e1c6548092A6a02c4c5330E76BF0fE2D", + "OrderStoreUtils": "0x67040c411C1b3195361801E9Ad8a91D1Fe9C0BC2", + "ReferralUtils": "0x27346Fdab142e2b8B6C6d2ecFe73e75B5e249A57", + "ShiftStoreUtils": "0xCfad9CB2a681b63884AEf98af28458692137c9E3", + "WithdrawalStoreUtils": "0xD521Cb31B14bB9F70D9a59b47D8763336CAD0395" + }, + "devdoc": { + "details": "Router for exchange functions, supports functions which require token transfers from the user IMPORTANT: PayableMulticall uses delegatecall, msg.value will be the same for each delegatecall extra care should be taken when using msg.value in any of the functions in this contract To avoid front-running issues, most actions require two steps to execute: - User sends transaction with request details, e.g. deposit / withdraw liquidity, swap, increase / decrease position - Keepers listen for the transactions, include the prices for the request then send a transaction to execute the request Prices are provided by an off-chain oracle system: - Oracle keepers continually check the latest blocks - When there is a new block, oracle keepers fetch the latest prices from reference exchanges - Oracle keepers then sign the median price for each token together with the block hash - Oracle keepers then send the data and signature to archive nodes - Archive nodes display this information for anyone to query Example: - Block 100 is finalized on the blockchain - Oracle keepers observe this block - Oracle keepers pull the latest prices from reference exchanges, token A: price 20,000, token B: price 80,000 - Oracle keepers sign [chainId, blockhash(100), 20,000], [chainId, blockhash(100), 80,000] - If in block 100, there was a market order to open a long position for token A, the market order would have a block number of 100 - The prices signed at block 100 can be used to execute this order - Order keepers would bundle the signature and price data for token A then execute the order", + "kind": "dev", + "methods": { + "cancelOrder(bytes32)": { + "details": "Cancels the given order. The `cancelOrder()` feature must be enabled for the given order type. The caller must be the owner of the order, and the order must not be a market order. The order is cancelled by calling the `cancelOrder()` function in the `OrderUtils` contract. This function also records the starting gas amount and the reason for cancellation, which is passed to the `cancelOrder()` function.", + "params": { + "key": "The unique ID of the order to be cancelled" + } + }, + "claimAffiliateRewards(address[],address[],address)": { + "details": "Claims affiliate rewards for the given markets and tokens on behalf of the caller, and sends the rewards to the specified receiver. The length of the `markets` and `tokens` arrays must be the same. For each market-token pair, the `claimAffiliateReward()` function in the `ReferralUtils` contract is called to claim the rewards for the caller.", + "params": { + "markets": "An array of market addresses", + "receiver": "The address to which the claimed rewards should be sent", + "tokens": "An array of token addresses, corresponding to the given markets" + } + }, + "claimFundingFees(address[],address[],address)": { + "details": "Claims funding fees for the given markets and tokens on behalf of the caller, and sends the fees to the specified receiver. The length of the `markets` and `tokens` arrays must be the same. For each market-token pair, the `claimFundingFees()` function in the `MarketUtils` contract is called to claim the fees for the caller.", + "params": { + "markets": "An array of market addresses", + "receiver": "The address to which the claimed fees should be sent", + "tokens": "An array of token addresses, corresponding to the given markets" + } + }, + "createDeposit((address,address,address,address,address,address,address[],address[],uint256,bool,uint256,uint256))": { + "details": "Creates a new deposit with the given long token, short token, long token amount, short token amount, and deposit parameters. The deposit is created by transferring the specified amounts of long and short tokens from the caller's account to the deposit store, and then calling the `createDeposit()` function on the deposit handler contract.", + "params": { + "params": "The deposit parameters, as specified in the `DepositUtils.CreateDepositParams` struct" + }, + "returns": { + "_0": "The unique ID of the newly created deposit" + } + }, + "createOrder(((address,address,address,address,address,address,address[]),(uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint8,uint8,bool,bool,bool,bytes32))": { + "details": "Creates a new order with the given amount, order parameters. The order is created by transferring the specified amount of collateral tokens from the caller's account to the order store, and then calling the `createOrder()` function on the order handler contract. The referral code is also set on the caller's account using the referral storage contract." + }, + "multicall(bytes[])": { + "details": "Receives and executes a batch of function calls on this contract." + }, + "updateOrder(bytes32,uint256,uint256,uint256,uint256,bool)": { + "details": "Updates the given order with the specified size delta, acceptable price, and trigger price. The `updateOrder()` feature must be enabled for the given order type. The caller must be the owner of the order, and the order must not be a market order. The size delta, trigger price, and acceptable price are updated on the order, and the order is unfrozen. Any additional WNT that is transferred to the contract is added to the order's execution fee. The updated order is then saved in the order store, and an `OrderUpdated` event is emitted.", + "params": { + "acceptablePrice": "The new acceptable price for the order", + "key": "The unique ID of the order to be updated", + "sizeDeltaUsd": "The new size delta for the order", + "triggerPrice": "The new trigger price for the order" + } + } + }, + "title": "ExchangeRouter", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 115, + "contract": "contracts/router/ExchangeRouter.sol:ExchangeRouter", + "label": "_status", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GMT.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GMT.json new file mode 100644 index 0000000..b0cf768 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GMT.json @@ -0,0 +1,522 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GMT", + "sourceName": "contracts/gambit-token/GMT.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_initialSupply", + "type": "uint256" + } + ], + "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": 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": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + } + ], + "name": "addBlockedRecipient", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_msgSender", + "type": "address" + } + ], + "name": "addMsgSender", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "admins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowedMsgSenders", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beginMigration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "blockedRecipients", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endMigration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasActiveMigration", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "migrationTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + } + ], + "name": "removeBlockedRecipient", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_msgSender", + "type": "address" + } + ], + "name": "removeMsgSender", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_migrationTime", + "type": "uint256" + } + ], + "name": "setNextMigrationTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlpManager.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlpManager.json new file mode 100644 index 0000000..487a2fc --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlpManager.json @@ -0,0 +1,592 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GlpManager", + "sourceName": "contracts/core/GlpManager.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_usdg", + "type": "address" + }, + { + "internalType": "address", + "name": "_glp", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_cooldownDuration", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "aumInUsdg", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "glpSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "AddLiquidity", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "glpAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "aumInUsdg", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "glpSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "RemoveLiquidity", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_COOLDOWN_DURATION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRICE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USDG_DECIMALS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minUsdg", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minGlp", + "type": "uint256" + } + ], + "name": "addLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_fundingAccount", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minUsdg", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minGlp", + "type": "uint256" + } + ], + "name": "addLiquidityForAccount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "aumAddition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "aumDeduction", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cooldownDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "maximise", + "type": "bool" + } + ], + "name": "getAum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "maximise", + "type": "bool" + } + ], + "name": "getAumInUsdg", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAums", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glp", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isHandler", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastAddedAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_glpAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "removeLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_glpAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "removeLiquidityForAccount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_aumAddition", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_aumDeduction", + "type": "uint256" + } + ], + "name": "setAumAdjustment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_cooldownDuration", + "type": "uint256" + } + ], + "name": "setCooldownDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateMode", + "type": "bool" + } + ], + "name": "setInPrivateMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usdg", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlvReader.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlvReader.json new file mode 100644 index 0000000..ab67f5c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlvReader.json @@ -0,0 +1,1415 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GlvReader", + "sourceName": "contracts/reader/GlvReader.sol", + "abi": [ + { + "inputs": [], + "name": "EmptyMarketTokenSupply", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvNegativeMarketPoolValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountGlvDeposits", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvDeposit.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountGlvWithdrawals", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvWithdrawal.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "getGlv", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "name": "getGlvBySalt", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvDeposit", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvDeposit.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvDeposits", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvDeposit.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "getGlvInfo", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "glv", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + } + ], + "internalType": "struct GlvReader.GlvInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvInfoList", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "glv", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + } + ], + "internalType": "struct GlvReader.GlvInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvShift", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct GlvShift.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + } + ], + "internalType": "struct GlvShift.Numbers", + "name": "numbers", + "type": "tuple" + } + ], + "internalType": "struct GlvShift.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvShifts", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct GlvShift.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + } + ], + "internalType": "struct GlvShift.Numbers", + "name": "numbers", + "type": "tuple" + } + ], + "internalType": "struct GlvShift.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address[]", + "name": "marketAddresses", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "indexTokenPrices", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getGlvTokenPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address[]", + "name": "marketAddresses", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "indexTokenPrices", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getGlvValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvWithdrawal", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvWithdrawal.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvWithdrawals", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvWithdrawal.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvs", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + } + \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlvRouter.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlvRouter.json new file mode 100644 index 0000000..1862af9 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GlvRouter.json @@ -0,0 +1,707 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GlvRouter", + "sourceName": "contracts/router/GlvRouter.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "contract Router", + "name": "_router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "_dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "_eventEmitter", + "type": "address" + }, + { + "internalType": "contract IGlvHandler", + "name": "_glvHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "_externalHandler", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "EmptyGlvDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvWithdrawal", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "InvalidNativeTokenSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelGlvDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelGlvWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDepositUtils.CreateGlvDepositParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvDeposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawalUtils.CreateGlvWithdrawalParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvWithdrawal", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glvHandler", + "outputs": [ + { + "internalType": "contract IGlvHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "name": "makeExternalCalls", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteGlvDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteGlvWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteLatestGlvDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteLatestGlvWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + } + \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GmxMigrator.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GmxMigrator.json new file mode 100644 index 0000000..3db58dc --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GmxMigrator.json @@ -0,0 +1,657 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GmxMigrator", + "sourceName": "contracts/gmx/GmxMigrator.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minAuthorizations", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ClearAction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "SignAction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "SignalApprove", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "SignalPendingAction", + "type": "event" + }, + { + "inputs": [], + "name": "actionsNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ammRouter", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "caps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endMigration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getIouToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getTokenAmounts", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getTokenPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gmxPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_ammRouter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gmxPrice", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_signers", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_whitelistedTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_iouTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_prices", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "_caps", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "_lpTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_lpTokenAs", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_lpTokenBs", + "type": "address[]" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "iouTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isMigrationActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isSigner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lpTokenAs", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lpTokenBs", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lpTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenAmount", + "type": "uint256" + } + ], + "name": "migrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minAuthorizations", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pendingActions", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "prices", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "signApprove", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "signalApprove", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "signedActions", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "signers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelistedTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GovToken.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GovToken.json new file mode 100644 index 0000000..003eeae --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/GovToken.json @@ -0,0 +1,1121 @@ +{ + "address": "0x2A29D3a792000750807cc401806d6fd539928481", + "abi": [ + { + "inputs": [ + { + "internalType": "contract RoleStore", + "name": "roleStore_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "CLOCK_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "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": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint32", + "name": "pos", + "type": "uint32" + } + ], + "name": "checkpoints", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromBlock", + "type": "uint32" + }, + { + "internalType": "uint224", + "name": "votes", + "type": "uint224" + } + ], + "internalType": "struct ERC20Votes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "clock", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "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": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "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" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xf41d2b874807c8dea4d0b21d1215669c990495bda5cdfa8ef7bb822e6edf3043", + "receipt": { + "to": null, + "from": "0xE7BfFf2aB721264887230037940490351700a068", + "contractAddress": "0x2A29D3a792000750807cc401806d6fd539928481", + "transactionIndex": 1, + "gasUsed": "15199775", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xc6e67e18e1c484c3ddd3cd5db795adc007a2633bf83bfc7d1c28ee352d90f9f6", + "transactionHash": "0xf41d2b874807c8dea4d0b21d1215669c990495bda5cdfa8ef7bb822e6edf3043", + "logs": [], + "blockNumber": 168596066, + "cumulativeGasUsed": "15199775", + "status": 1, + "byzantium": true + }, + "args": [ + "0x3c3d99FD298f679DBC2CEcd132b4eC4d0F5e6e72", + "GMX DAO", + "GMX_DAO", + 18 + ], + "numDeployments": 1, + "solcInputHash": "ddb2cd26020caa6335eda5082c5c80ae", + "libraries": {}, + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "DelegateChanged(address,address,address)": { + "details": "Emitted when an account changes their delegate." + }, + "DelegateVotesChanged(address,uint256,uint256)": { + "details": "Emitted when a token transfer or delegate change results in changes to a delegate's number of votes." + }, + "EIP712DomainChanged()": { + "details": "MAY be emitted to signal that the domain could have changed." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "CLOCK_MODE()": { + "details": "Description of the clock" + }, + "DOMAIN_SEPARATOR()": { + "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." + }, + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "checkpoints(address,uint32)": { + "details": "Get the `pos`-th checkpoint for `account`." + }, + "clock()": { + "details": "Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting)." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "delegate(address)": { + "details": "Delegate votes from the sender to `delegatee`." + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "Delegates votes from signer to `delegatee`" + }, + "delegates(address)": { + "details": "Get the address `account` is currently delegating to." + }, + "eip712Domain()": { + "details": "See {EIP-5267}. _Available since v4.9._" + }, + "getPastTotalSupply(uint256)": { + "details": "Retrieve the `totalSupply` at the end of `timepoint`. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes! Requirements: - `timepoint` must be in the past" + }, + "getPastVotes(address,uint256)": { + "details": "Retrieve the number of votes for `account` at the end of `timepoint`. Requirements: - `timepoint` must be in the past" + }, + "getVotes(address)": { + "details": "Gets the current votes balance for `account`" + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "nonces(address)": { + "details": "See {IERC20Permit-nonces}." + }, + "numCheckpoints(address)": { + "details": "Get number of checkpoints for `account`." + }, + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "See {IERC20Permit-permit}." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 207, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 213, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 215, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 217, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 219, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + }, + { + "astId": 3579, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_nameFallback", + "offset": 0, + "slot": "5", + "type": "t_string_storage" + }, + { + "astId": 3581, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_versionFallback", + "offset": 0, + "slot": "6", + "type": "t_string_storage" + }, + { + "astId": 879, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_nonces", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_struct(Counter)2557_storage)" + }, + { + "astId": 887, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "8", + "type": "t_bytes32" + }, + { + "astId": 1054, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_delegates", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 1060, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_checkpoints", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_address,t_array(t_struct(Checkpoint)1045_storage)dyn_storage)" + }, + { + "astId": 1064, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_totalSupplyCheckpoints", + "offset": 0, + "slot": "11", + "type": "t_array(t_struct(Checkpoint)1045_storage)dyn_storage" + }, + { + "astId": 27701, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_decimals", + "offset": 0, + "slot": "12", + "type": "t_uint8" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint)1045_storage)dyn_storage": { + "base": "t_struct(Checkpoint)1045_storage", + "encoding": "dynamic_array", + "label": "struct ERC20Votes.Checkpoint[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_address,t_array(t_struct(Checkpoint)1045_storage)dyn_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct ERC20Votes.Checkpoint[])", + "numberOfBytes": "32", + "value": "t_array(t_struct(Checkpoint)1045_storage)dyn_storage" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_struct(Counter)2557_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct Counters.Counter)", + "numberOfBytes": "32", + "value": "t_struct(Counter)2557_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint)1045_storage": { + "encoding": "inplace", + "label": "struct ERC20Votes.Checkpoint", + "members": [ + { + "astId": 1042, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "fromBlock", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 1044, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "votes", + "offset": 4, + "slot": "0", + "type": "t_uint224" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Counter)2557_storage": { + "encoding": "inplace", + "label": "struct Counters.Counter", + "members": [ + { + "astId": 2556, + "contract": "contracts/gov/GovToken.sol:GovToken", + "label": "_value", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "numberOfBytes": "32" + }, + "t_uint224": { + "encoding": "inplace", + "label": "uint224", + "numberOfBytes": "28" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/MintableBaseToken.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/MintableBaseToken.json new file mode 100644 index 0000000..a9542d5 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/MintableBaseToken.json @@ -0,0 +1,696 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "MintableBaseToken", + "sourceName": "contracts/tokens/MintableBaseToken.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_initialSupply", + "type": "uint256" + } + ], + "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": 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": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addNonStakingAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "admins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateTransferMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isHandler", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonStakingAccounts", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonStakingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "recoverClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeNonStakingAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateTransferMode", + "type": "bool" + } + ], + "name": "setInPrivateTransferMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "setInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_minter", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_yieldTrackers", + "type": "address[]" + } + ], + "name": "setYieldTrackers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "stakedBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "yieldTrackers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Multicall.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Multicall.json new file mode 100644 index 0000000..da2ad0a --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Multicall.json @@ -0,0 +1,333 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Multicall2", + "sourceName": "contracts/mock/Multicall2.sol", + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall2.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "returnData", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall2.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "blockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall2.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "getBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockCoinbase", + "outputs": [ + { + "internalType": "address", + "name": "coinbase", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockDifficulty", + "outputs": [ + { + "internalType": "uint256", + "name": "difficulty", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "gaslimit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getEthBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getL1BlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "l1BlockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall2.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryAggregate", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall2.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall2.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryBlockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall2.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderBook.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderBook.json new file mode 100644 index 0000000..005d838 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderBook.json @@ -0,0 +1,1997 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "OrderBook", + "sourceName": "contracts/core/OrderBook.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "CancelDecreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "purchaseToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "purchaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "CancelIncreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerRatio", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "shouldUnwrap", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "CancelSwapOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "CreateDecreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "purchaseToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "purchaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "CreateIncreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerRatio", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "shouldUnwrap", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "CreateSwapOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionPrice", + "type": "uint256" + } + ], + "name": "ExecuteDecreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "purchaseToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "purchaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionPrice", + "type": "uint256" + } + ], + "name": "ExecuteIncreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerRatio", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "shouldUnwrap", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "ExecuteSwapOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "weth", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "usdg", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minExecutionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minPurchaseTokenAmountUsd", + "type": "uint256" + } + ], + "name": "Initialize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + } + ], + "name": "UpdateDecreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "gov", + "type": "address" + } + ], + "name": "UpdateGov", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + } + ], + "name": "UpdateIncreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minExecutionFee", + "type": "uint256" + } + ], + "name": "UpdateMinExecutionFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minPurchaseTokenAmountUsd", + "type": "uint256" + } + ], + "name": "UpdateMinPurchaseTokenAmountUsd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ordexIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "triggerRatio", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "shouldUnwrap", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "name": "UpdateSwapOrder", + "type": "event" + }, + { + "inputs": [], + "name": "PRICE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USDG_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + } + ], + "name": "cancelDecreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + } + ], + "name": "cancelIncreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_swapOrderIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "_increaseOrderIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "_decreaseOrderIndexes", + "type": "uint256[]" + } + ], + "name": "cancelMultiple", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + } + ], + "name": "cancelSwapOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_triggerAboveThreshold", + "type": "bool" + } + ], + "name": "createDecreaseOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_executionFee", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_shouldWrap", + "type": "bool" + } + ], + "name": "createIncreaseOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_triggerRatio", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_executionFee", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_shouldWrap", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldUnwrap", + "type": "bool" + } + ], + "name": "createSwapOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "decreaseOrders", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "decreaseOrdersIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeDecreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeIncreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeSwapOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + } + ], + "name": "getDecreaseOrder", + "outputs": [ + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + } + ], + "name": "getIncreaseOrder", + "outputs": [ + { + "internalType": "address", + "name": "purchaseToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "purchaseTokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + } + ], + "name": "getSwapOrder", + "outputs": [ + { + "internalType": "address", + "name": "path0", + "type": "address" + }, + { + "internalType": "address", + "name": "path1", + "type": "address" + }, + { + "internalType": "address", + "name": "path2", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerRatio", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrap", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_otherToken", + "type": "address" + } + ], + "name": "getUsdgMinPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "increaseOrders", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "purchaseToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "purchaseTokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "increaseOrdersIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + }, + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "address", + "name": "_usdg", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minExecutionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minPurchaseTokenAmountUsd", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minExecutionFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minPurchaseTokenAmountUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minExecutionFee", + "type": "uint256" + } + ], + "name": "setMinExecutionFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minPurchaseTokenAmountUsd", + "type": "uint256" + } + ], + "name": "setMinPurchaseTokenAmountUsd", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "swapOrders", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerRatio", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrap", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "swapOrdersIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_triggerAboveThreshold", + "type": "bool" + } + ], + "name": "updateDecreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_triggerPrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_triggerAboveThreshold", + "type": "bool" + } + ], + "name": "updateIncreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_triggerRatio", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_triggerAboveThreshold", + "type": "bool" + } + ], + "name": "updateSwapOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usdg", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_triggerAboveThreshold", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_triggerPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_maximizePrice", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_raise", + "type": "bool" + } + ], + "name": "validatePositionOrderPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_triggerRatio", + "type": "uint256" + } + ], + "name": "validateSwapOrderPriceWithTriggerAboveThreshold", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderBookReader.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderBookReader.json new file mode 100644 index 0000000..3a01afe --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderBookReader.json @@ -0,0 +1,111 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "OrderBookReader", + "sourceName": "contracts/peripherals/OrderBookReader.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address payable", + "name": "_orderBookAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_indices", + "type": "uint256[]" + } + ], + "name": "getDecreaseOrders", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_orderBookAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_indices", + "type": "uint256[]" + } + ], + "name": "getIncreaseOrders", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_orderBookAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_indices", + "type": "uint256[]" + } + ], + "name": "getSwapOrders", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderExecutor.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderExecutor.json new file mode 100644 index 0000000..6d955cd --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/OrderExecutor.json @@ -0,0 +1,122 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "OrderExecutor", + "sourceName": "contracts/core/OrderExecutor.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_orderBook", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeDecreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeIncreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeSwapOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "orderBook", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "", + "deployedBytecode": "", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/PositionManager.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/PositionManager.json new file mode 100644 index 0000000..bc82888 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/PositionManager.json @@ -0,0 +1,1165 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "PositionManager", + "sourceName": "contracts/core/PositionManager.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_router", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_depositFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_orderBook", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "marginFeeBasisPoints", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "DecreasePositionReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "marginFeeBasisPoints", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "IncreasePositionReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "SetAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "depositFee", + "type": "uint256" + } + ], + "name": "SetDepositFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "inLegacyMode", + "type": "bool" + } + ], + "name": "SetInLegacyMode", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "increasePositionBufferBps", + "type": "uint256" + } + ], + "name": "SetIncreasePositionBufferBps", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "name": "SetLiquidator", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "longSizes", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "shortSizes", + "type": "uint256[]" + } + ], + "name": "SetMaxGlobalSizes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "name": "SetOrderKeeper", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "name": "SetPartner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "referralStorage", + "type": "address" + } + ], + "name": "SetReferralStorage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "shouldValidateIncreaseOrder", + "type": "bool" + } + ], + "name": "SetShouldValidateIncreaseOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawFees", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "decreasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + } + ], + "name": "decreasePositionAndSwap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + } + ], + "name": "decreasePositionAndSwapETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "decreasePositionETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "depositFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeDecreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeIncreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_orderIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "executeSwapOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "feeReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inLegacyMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "increasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "increasePositionBufferBps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "increasePositionETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isLiquidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isOrderKeeper", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isPartner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "liquidatePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxGlobalLongSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxGlobalShortSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderBook", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "referralStorage", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "sendValue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_depositFee", + "type": "uint256" + } + ], + "name": "setDepositFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inLegacyMode", + "type": "bool" + } + ], + "name": "setInLegacyMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_increasePositionBufferBps", + "type": "uint256" + } + ], + "name": "setIncreasePositionBufferBps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setLiquidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_longSizes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "_shortSizes", + "type": "uint256[]" + } + ], + "name": "setMaxGlobalSizes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setOrderKeeper", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setPartner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_referralStorage", + "type": "address" + } + ], + "name": "setReferralStorage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_shouldValidateIncreaseOrder", + "type": "bool" + } + ], + "name": "setShouldValidateIncreaseOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "shouldValidateIncreaseOrder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "withdrawFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/PositionRouter.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/PositionRouter.json new file mode 100644 index 0000000..35d766d --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/PositionRouter.json @@ -0,0 +1,2030 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "PositionRouter", + "sourceName": "contracts/core/PositionRouter.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_router", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "address", + "name": "_shortsTracker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_depositFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minExecutionFee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "callbackTarget", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "name": "Callback", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockGap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timeGap", + "type": "uint256" + } + ], + "name": "CancelDecreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockGap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timeGap", + "type": "uint256" + } + ], + "name": "CancelIncreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queueIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockTime", + "type": "uint256" + } + ], + "name": "CreateDecreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queueIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + } + ], + "name": "CreateIncreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "marginFeeBasisPoints", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "DecreasePositionReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockGap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timeGap", + "type": "uint256" + } + ], + "name": "ExecuteDecreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockGap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timeGap", + "type": "uint256" + } + ], + "name": "ExecuteIncreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "marginFeeBasisPoints", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "IncreasePositionReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "SetAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "name": "SetCallbackGasLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minBlockDelayKeeper", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minTimeDelayPublic", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxTimeDelay", + "type": "uint256" + } + ], + "name": "SetDelayValues", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "depositFee", + "type": "uint256" + } + ], + "name": "SetDepositFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "increasePositionBufferBps", + "type": "uint256" + } + ], + "name": "SetIncreasePositionBufferBps", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isLeverageEnabled", + "type": "bool" + } + ], + "name": "SetIsLeverageEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "longSizes", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "shortSizes", + "type": "uint256[]" + } + ], + "name": "SetMaxGlobalSizes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minExecutionFee", + "type": "uint256" + } + ], + "name": "SetMinExecutionFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "name": "SetPositionKeeper", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "referralStorage", + "type": "address" + } + ], + "name": "SetReferralStorage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "increasePositionRequestKeysStart", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decreasePositionRequestKeysStart", + "type": "uint256" + } + ], + "name": "SetRequestKeysStartValues", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawFees", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "address payable", + "name": "_executionFeeReceiver", + "type": "address" + } + ], + "name": "cancelDecreasePosition", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "address payable", + "name": "_executionFeeReceiver", + "type": "address" + } + ], + "name": "cancelIncreasePosition", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_executionFee", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_withdrawETH", + "type": "bool" + }, + { + "internalType": "address", + "name": "_callbackTarget", + "type": "address" + } + ], + "name": "createDecreasePosition", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_executionFee", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_referralCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_callbackTarget", + "type": "address" + } + ], + "name": "createIncreasePosition", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_executionFee", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_referralCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_callbackTarget", + "type": "address" + } + ], + "name": "createIncreasePositionETH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "decreasePositionRequestKeys", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decreasePositionRequestKeysStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "decreasePositionRequests", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blockTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "withdrawETH", + "type": "bool" + }, + { + "internalType": "address", + "name": "callbackTarget", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "decreasePositionsIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "address payable", + "name": "_executionFeeReceiver", + "type": "address" + } + ], + "name": "executeDecreasePosition", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_endIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_executionFeeReceiver", + "type": "address" + } + ], + "name": "executeDecreasePositions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "address payable", + "name": "_executionFeeReceiver", + "type": "address" + } + ], + "name": "executeIncreasePosition", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_endIndex", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_executionFeeReceiver", + "type": "address" + } + ], + "name": "executeIncreasePositions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "feeReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + } + ], + "name": "getDecreasePositionRequestPath", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + } + ], + "name": "getIncreasePositionRequestPath", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "getRequestKey", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getRequestQueueLengths", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "increasePositionBufferBps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "increasePositionRequestKeys", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "increasePositionRequestKeysStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "increasePositionRequests", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blockTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "hasCollateralInETH", + "type": "bool" + }, + { + "internalType": "address", + "name": "callbackTarget", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "increasePositionsIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isLeverageEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isPositionKeeper", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxGlobalLongSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxGlobalShortSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTimeDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minBlockDelayKeeper", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minExecutionFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minTimeDelayPublic", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "referralStorage", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "sendValue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_callbackGasLimit", + "type": "uint256" + } + ], + "name": "setCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minBlockDelayKeeper", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minTimeDelayPublic", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxTimeDelay", + "type": "uint256" + } + ], + "name": "setDelayValues", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_depositFee", + "type": "uint256" + } + ], + "name": "setDepositFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_increasePositionBufferBps", + "type": "uint256" + } + ], + "name": "setIncreasePositionBufferBps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isLeverageEnabled", + "type": "bool" + } + ], + "name": "setIsLeverageEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_longSizes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "_shortSizes", + "type": "uint256[]" + } + ], + "name": "setMaxGlobalSizes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minExecutionFee", + "type": "uint256" + } + ], + "name": "setMinExecutionFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setPositionKeeper", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_referralStorage", + "type": "address" + } + ], + "name": "setReferralStorage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_increasePositionRequestKeysStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_decreasePositionRequestKeysStart", + "type": "uint256" + } + ], + "name": "setRequestKeysStartValues", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "shortsTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "withdrawFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Reader.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Reader.json new file mode 100644 index 0000000..113526b --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Reader.json @@ -0,0 +1,355 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Reader", + "sourceName": "contracts/peripherals/Reader.sol", + "abi": [ + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getFees", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getFundingRates", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + } + ], + "name": "getMaxAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getPairInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_collateralTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_indexTokens", + "type": "address[]" + }, + { + "internalType": "bool[]", + "name": "_isLong", + "type": "bool[]" + } + ], + "name": "getPositions", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_yieldTrackers", + "type": "address[]" + } + ], + "name": "getStakingInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getTokenBalances", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getTokenBalancesWithSupplies", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_excludedAccounts", + "type": "address[]" + } + ], + "name": "getTokenSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_yieldTokens", + "type": "address[]" + } + ], + "name": "getTotalStaked", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getVaultTokenInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ReaderV2.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ReaderV2.json new file mode 100644 index 0000000..bc9c809 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ReaderV2.json @@ -0,0 +1,630 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Reader", + "sourceName": "contracts/peripherals/Reader.sol", + "abi": [ + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POSITION_PROPS_LENGTH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRICE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USDG_DECIMALS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + } + ], + "name": "getFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getFees", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getFullVaultTokenInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getFundingRates", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + } + ], + "name": "getMaxAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getPairInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_collateralTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_indexTokens", + "type": "address[]" + }, + { + "internalType": "bool[]", + "name": "_isLong", + "type": "bool[]" + } + ], + "name": "getPositions", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVaultPriceFeed", + "name": "_priceFeed", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getPrices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_yieldTrackers", + "type": "address[]" + } + ], + "name": "getStakingInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getTokenBalances", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getTokenBalancesWithSupplies", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_excludedAccounts", + "type": "address[]" + } + ], + "name": "getTokenSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_accounts", + "type": "address[]" + } + ], + "name": "getTotalBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_yieldTokens", + "type": "address[]" + } + ], + "name": "getTotalStaked", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getVaultTokenInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getVaultTokenInfoV2", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_vesters", + "type": "address[]" + } + ], + "name": "getVestingInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasMaxGlobalShortSizes", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_hasMaxGlobalShortSizes", + "type": "bool" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ReferralStorage.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ReferralStorage.json new file mode 100644 index 0000000..3c957a8 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/ReferralStorage.json @@ -0,0 +1,507 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ReferralStorage", + "sourceName": "contracts/referrals/ReferralStorage.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "code", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccount", + "type": "address" + } + ], + "name": "GovSetCodeOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "code", + "type": "bytes32" + } + ], + "name": "RegisterCode", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccount", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "code", + "type": "bytes32" + } + ], + "name": "SetCodeOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "handler", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "name": "SetHandler", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "discountShare", + "type": "uint256" + } + ], + "name": "SetReferrerDiscountShare", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tierId", + "type": "uint256" + } + ], + "name": "SetReferrerTier", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tierId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalRebate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "discountShare", + "type": "uint256" + } + ], + "name": "SetTier", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "code", + "type": "bytes32" + } + ], + "name": "SetTraderReferralCode", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "codeOwners", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "getTraderReferralInfo", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_code", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_newAccount", + "type": "address" + } + ], + "name": "govSetCodeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isHandler", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "referrerDiscountShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "referrerTiers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_code", + "type": "bytes32" + } + ], + "name": "registerCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_code", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_newAccount", + "type": "address" + } + ], + "name": "setCodeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_discountShare", + "type": "uint256" + } + ], + "name": "setReferrerDiscountShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_referrer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tierId", + "type": "uint256" + } + ], + "name": "setReferrerTier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tierId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_totalRebate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_discountShare", + "type": "uint256" + } + ], + "name": "setTier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_code", + "type": "bytes32" + } + ], + "name": "setTraderReferralCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_code", + "type": "bytes32" + } + ], + "name": "setTraderReferralCodeByUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "tiers", + "outputs": [ + { + "internalType": "uint256", + "name": "totalRebate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "discountShare", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "traderReferralCodes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardReader.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardReader.json new file mode 100644 index 0000000..f1c11d8 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardReader.json @@ -0,0 +1,86 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "RewardReader", + "sourceName": "contracts/peripherals/RewardReader.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_depositTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_rewardTrackers", + "type": "address[]" + } + ], + "name": "getDepositBalances", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_rewardTrackers", + "type": "address[]" + } + ], + "name": "getStakingInfo", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_vesters", + "type": "address[]" + } + ], + "name": "getVestingInfoV2", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardRouter.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardRouter.json new file mode 100644 index 0000000..e5d9238 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardRouter.json @@ -0,0 +1,1024 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "RewardRouterV2", + "sourceName": "contracts/staking/RewardRouterV2.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "StakeGlp", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "StakeGmx", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "UnstakeGlp", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "UnstakeGmx", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "acceptTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_accounts", + "type": "address[]" + } + ], + "name": "batchCompoundForAccounts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_accounts", + "type": "address[]" + } + ], + "name": "batchRestakeForAccounts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_amounts", + "type": "uint256[]" + } + ], + "name": "batchStakeGmxForAccounts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bnGmx", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bonusGmxTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claimEsGmx", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claimFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "compound", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "esGmx", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "extendedGmxTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeGlpTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeGmxTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glp", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glpManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glpVester", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gmx", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gmxVester", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "govToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_shouldClaimGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldStakeGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldClaimEsGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldStakeEsGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldStakeMultiplierPoints", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldClaimWeth", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldConvertWethToEth", + "type": "bool" + } + ], + "name": "handleRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gmxReceiver", + "type": "address" + }, + { + "internalType": "bool", + "name": "_shouldClaimGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldStakeGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldClaimEsGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldStakeEsGmx", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldStakeMultiplierPoints", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldClaimWeth", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_shouldConvertWethToEth", + "type": "bool" + } + ], + "name": "handleRewardsV2", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "inRestakingMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inStrictTransferMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "weth", + "type": "address" + }, + { + "internalType": "address", + "name": "gmx", + "type": "address" + }, + { + "internalType": "address", + "name": "esGmx", + "type": "address" + }, + { + "internalType": "address", + "name": "bnGmx", + "type": "address" + }, + { + "internalType": "address", + "name": "glp", + "type": "address" + }, + { + "internalType": "address", + "name": "stakedGmxTracker", + "type": "address" + }, + { + "internalType": "address", + "name": "bonusGmxTracker", + "type": "address" + }, + { + "internalType": "address", + "name": "extendedGmxTracker", + "type": "address" + }, + { + "internalType": "address", + "name": "feeGmxTracker", + "type": "address" + }, + { + "internalType": "address", + "name": "feeGlpTracker", + "type": "address" + }, + { + "internalType": "address", + "name": "stakedGlpTracker", + "type": "address" + }, + { + "internalType": "address", + "name": "glpManager", + "type": "address" + }, + { + "internalType": "address", + "name": "gmxVester", + "type": "address" + }, + { + "internalType": "address", + "name": "glpVester", + "type": "address" + }, + { + "internalType": "address", + "name": "externalHandler", + "type": "address" + }, + { + "internalType": "address", + "name": "govToken", + "type": "address" + } + ], + "internalType": "struct RewardRouterV2.InitializeParams", + "name": "_initializeParams", + "type": "tuple" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "name": "makeExternalCalls", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxBoostBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minUsdg", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minGlp", + "type": "uint256" + } + ], + "name": "mintAndStakeGlp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minUsdg", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minGlp", + "type": "uint256" + } + ], + "name": "mintAndStakeGlpETH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "pendingReceivers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_govToken", + "type": "address" + } + ], + "name": "setGovToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inRestakingMode", + "type": "bool" + } + ], + "name": "setInRestakingMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inStrictTransferMode", + "type": "bool" + } + ], + "name": "setInStrictTransferMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxBoostBasisPoints", + "type": "uint256" + } + ], + "name": "setMaxBoostBasisPoints", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum RewardRouterV2.VotingPowerType", + "name": "_votingPowerType", + "type": "uint8" + } + ], + "name": "setVotingPowerType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "signalTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "stakeEsGmx", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "stakeGmx", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakedGlpTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakedGmxTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_glpAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "unstakeAndRedeemGlp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_glpAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + } + ], + "name": "unstakeAndRedeemGlpETH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "unstakeEsGmx", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "unstakeGmx", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "votingPowerType", + "outputs": [ + { + "internalType": "enum RewardRouterV2.VotingPowerType", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardTracker.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardTracker.json new file mode 100644 index 0000000..e8ba864 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/RewardTracker.json @@ -0,0 +1,918 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "RewardTracker", + "sourceName": "contracts/staking/RewardTracker.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "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": "amount", + "type": "uint256" + } + ], + "name": "Claim", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowances", + "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": "", + "type": "address" + } + ], + "name": "averageStakedAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "address", + "name": "", + "type": "address" + } + ], + "name": "balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "claim", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "claimForAccount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "claimable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimableReward", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cumulativeRewardPerToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "cumulativeRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "depositBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "distributor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateClaimingMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateStakingMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateTransferMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_depositTokens", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_distributor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isDepositToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isHandler", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "previousCumulatedRewardPerToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_depositToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isDepositToken", + "type": "bool" + } + ], + "name": "setDepositToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateClaimingMode", + "type": "bool" + } + ], + "name": "setInPrivateClaimingMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateStakingMode", + "type": "bool" + } + ], + "name": "setInPrivateStakingMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateTransferMode", + "type": "bool" + } + ], + "name": "setInPrivateTransferMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_depositToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_fundingAccount", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_depositToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "stakeForAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "stakedAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokensPerInterval", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalDepositSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "_depositToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_depositToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "unstakeForAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Router-v2.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Router-v2.json new file mode 100644 index 0000000..cdfadd5 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Router-v2.json @@ -0,0 +1,605 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Router", + "sourceName": "contracts/core/Router.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_usdg", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "addPlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "approvePlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedPlugins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "decreasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "decreasePositionETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "denyPlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "directPoolDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "increasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "increasePositionETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "pluginDecreasePosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "pluginIncreasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pluginTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "plugins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "removePlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "swap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "swapETHToTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + } + ], + "name": "swapTokensToETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usdg", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Router.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Router.json new file mode 100644 index 0000000..cdfadd5 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Router.json @@ -0,0 +1,605 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Router", + "sourceName": "contracts/core/Router.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_usdg", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "addPlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "approvePlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedPlugins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "decreasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "decreasePositionETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "denyPlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "directPoolDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "increasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "increasePositionETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "pluginDecreasePosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "pluginIncreasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pluginTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "plugins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_plugin", + "type": "address" + } + ], + "name": "removePlugin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "swap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "swapETHToTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOut", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_receiver", + "type": "address" + } + ], + "name": "swapTokensToETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usdg", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SubaccountRouter.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SubaccountRouter.json new file mode 100644 index 0000000..1b70713 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SubaccountRouter.json @@ -0,0 +1,658 @@ +{ + "address": "0xe5485a4fD6527911e9b82A75A1bFEd6e47BE2241", + "abi": [ + { + "inputs": [ + { + "internalType": "contract Router", + "name": "_router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "_dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "_eventEmitter", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "_orderHandler", + "type": "address" + }, + { + "internalType": "contract OrderVault", + "name": "_orderVault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyOrder", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "InvalidNativeTokenSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedReceiver", + "type": "address" + } + ], + "name": "InvalidReceiverForSubaccountOrder", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCount", + "type": "uint256" + } + ], + "name": "MaxSubaccountActionCountExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + } + ], + "name": "SubaccountNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + } + ], + "name": "addSubaccount", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", + "name": "numbers", + "type": "tuple" + }, + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderVault", + "outputs": [ + { + "internalType": "contract OrderVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + } + ], + "name": "removeSubaccount", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "actionType", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "maxAllowedCount", + "type": "uint256" + } + ], + "name": "setMaxAllowedSubaccountActionCount", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setSubaccountAutoTopUpAmount", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + } + ], + "name": "updateOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xe5b71c86f938f547820ca3262678fb70c379c15ef02430fbb773ee4d37e86e09", + "receipt": { + "to": null, + "from": "0xE7BfFf2aB721264887230037940490351700a068", + "contractAddress": "0xe5485a4fD6527911e9b82A75A1bFEd6e47BE2241", + "transactionIndex": 0, + "gasUsed": "3707710", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x00c9beda5865106776abea90f56310f05628852d29d91b7c235c44a20123b601", + "transactionHash": "0xe5b71c86f938f547820ca3262678fb70c379c15ef02430fbb773ee4d37e86e09", + "logs": [], + "blockNumber": 46822607, + "cumulativeGasUsed": "3707710", + "status": 1, + "byzantium": true + }, + "args": [ + "0x820F5FfC5b525cD4d88Cd91aCf2c28F16530Cc68", + "0xA44F830B6a2B6fa76657a3B92C1fe74fcB7C6AfD", + "0x2F0b22339414ADeD7D5F06f9D604c7fF5b2fe3f6", + "0xDb17B211c34240B014ab6d61d4A31FA0C0e20c26", + "0x32A0258007a6ea78265a5AE4DBb28f176be4a8EB", + "0xD3D60D22d415aD43b7e64b510D86A30f19B1B12C" + ], + "numDeployments": 3, + "solcInputHash": "95ed34927f843d6700c121bcc6faf594", + "libraries": { + "OrderStoreUtils": "0x805a15bf16582eC8d76841062A47dFfEa7903131" + }, + "devdoc": { + "kind": "dev", + "methods": { + "multicall(bytes[])": { + "details": "Receives and executes a batch of function calls on this contract." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 115, + "contract": "contracts/router/SubaccountRouter.sol:SubaccountRouter", + "label": "_status", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SyntheticsReader.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SyntheticsReader.json new file mode 100644 index 0000000..afe979b --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SyntheticsReader.json @@ -0,0 +1,4706 @@ +{ + "address": "0x23D4Da5C7C6902D4C86d551CaE60d5755820df9E", + "abi": [ + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountOrders", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct Order.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct Order.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isFrozen", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + } + ], + "internalType": "struct Order.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Order.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract IReferralStorage", + "name": "referralStorage", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices[]", + "name": "marketPrices", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountPositionInfoList", + "outputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + } + ], + "internalType": "struct Position.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeInTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "increasedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "decreasedAtTime", + "type": "uint256" + } + ], + "internalType": "struct Position.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } + ], + "internalType": "struct Position.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Position.Props", + "name": "position", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "affiliate", + "type": "address" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalRebateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "affiliateRewardFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustedAffiliateRewardFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalRebateAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "affiliateRewardAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionReferralFees", + "name": "referral", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "traderTier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionProFees", + "name": "pro", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fundingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestFundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestLongTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestShortTokenClaimableFundingAmountPerSize", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionFundingFees", + "name": "funding", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "borrowingFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeAmountForFeeReceiver", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionBorrowingFees", + "name": "borrowing", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "uiFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "uiFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionUiFees", + "name": "ui", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeAmountForFeeReceiver", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionLiquidationFees", + "name": "liquidation", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "collateralTokenPrice", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "positionFeeFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeReceiverAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeAmountForPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeAmountForPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCostAmountExcludingFunding", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCostAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalDiscountAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionFees", + "name": "fees", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int256", + "name": "priceImpactUsd", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "priceImpactDiffUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionPrice", + "type": "uint256" + } + ], + "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", + "name": "executionPriceResult", + "type": "tuple" + }, + { + "internalType": "int256", + "name": "basePnlUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "uncappedBasePnlUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "pnlAfterPriceImpactUsd", + "type": "int256" + } + ], + "internalType": "struct ReaderPositionUtils.PositionInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountPositions", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + } + ], + "internalType": "struct Position.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeInTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "increasedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "decreasedAtTime", + "type": "uint256" + } + ], + "internalType": "struct Position.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } + ], + "internalType": "struct Position.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Position.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + } + ], + "name": "getAdlState", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "int256", + "name": "", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getDeposit", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct Deposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct Deposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct Deposit.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Deposit.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "longTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "enum ISwapPricingUtils.SwapPricingType", + "name": "swapPricingType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "includeVirtualInventoryImpact", + "type": "bool" + } + ], + "name": "getDepositAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "marketKey", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "positionSizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionSizeInTokens", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "sizeDeltaUsd", + "type": "int256" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } + ], + "name": "getExecutionPrice", + "outputs": [ + { + "components": [ + { + "internalType": "int256", + "name": "priceImpactUsd", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "priceImpactDiffUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionPrice", + "type": "uint256" + } + ], + "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "key", + "type": "address" + } + ], + "name": "getMarket", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "name": "getMarketBySalt", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "address", + "name": "marketKey", + "type": "address" + } + ], + "name": "getMarketInfo", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "borrowingFactorPerSecondForLongs", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFactorPerSecondForShorts", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "fundingFeeAmountPerSize", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "claimableFundingAmountPerSize", + "type": "tuple" + } + ], + "internalType": "struct ReaderUtils.BaseFundingValues", + "name": "baseFunding", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "longsPayShorts", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "fundingFactorPerSecond", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "nextSavedFundingFactorPerSecond", + "type": "int256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "fundingFeeAmountPerSizeDelta", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "claimableFundingAmountPerSizeDelta", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.GetNextFundingAmountPerSizeResult", + "name": "nextFunding", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "virtualPoolAmountForLongToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "virtualPoolAmountForShortToken", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "virtualInventoryForPositions", + "type": "int256" + } + ], + "internalType": "struct ReaderUtils.VirtualInventory", + "name": "virtualInventory", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "isDisabled", + "type": "bool" + } + ], + "internalType": "struct ReaderUtils.MarketInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices[]", + "name": "marketPricesList", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getMarketInfoList", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "borrowingFactorPerSecondForLongs", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFactorPerSecondForShorts", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "fundingFeeAmountPerSize", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "claimableFundingAmountPerSize", + "type": "tuple" + } + ], + "internalType": "struct ReaderUtils.BaseFundingValues", + "name": "baseFunding", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "longsPayShorts", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "fundingFactorPerSecond", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "nextSavedFundingFactorPerSecond", + "type": "int256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "fundingFeeAmountPerSizeDelta", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "long", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "longToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortToken", + "type": "uint256" + } + ], + "internalType": "struct MarketUtils.CollateralType", + "name": "short", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.PositionType", + "name": "claimableFundingAmountPerSizeDelta", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.GetNextFundingAmountPerSizeResult", + "name": "nextFunding", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "virtualPoolAmountForLongToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "virtualPoolAmountForShortToken", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "virtualInventoryForPositions", + "type": "int256" + } + ], + "internalType": "struct ReaderUtils.VirtualInventory", + "name": "virtualInventory", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "isDisabled", + "type": "bool" + } + ], + "internalType": "struct ReaderUtils.MarketInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "pnlFactorType", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getMarketTokenPrice", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + }, + { + "components": [ + { + "internalType": "int256", + "name": "poolValue", + "type": "int256" + }, + { + "internalType": "int256", + "name": "longPnl", + "type": "int256" + }, + { + "internalType": "int256", + "name": "shortPnl", + "type": "int256" + }, + { + "internalType": "int256", + "name": "netPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "longTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longTokenUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalBorrowingFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeePoolFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "impactPoolAmount", + "type": "uint256" + } + ], + "internalType": "struct MarketPoolValueInfo.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getMarkets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getNetPnl", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getOpenInterestWithPnl", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getOrder", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct Order.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct Order.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isFrozen", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + } + ], + "internalType": "struct Order.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Order.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getPnl", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "marketAddress", + "type": "address" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getPnlToPoolFactor", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getPosition", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + } + ], + "internalType": "struct Position.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeInTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "increasedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "decreasedAtTime", + "type": "uint256" + } + ], + "internalType": "struct Position.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } + ], + "internalType": "struct Position.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Position.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract IReferralStorage", + "name": "referralStorage", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "positionKey", + "type": "bytes32" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "bool", + "name": "usePositionSizeAsSizeDeltaUsd", + "type": "bool" + } + ], + "name": "getPositionInfo", + "outputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + } + ], + "internalType": "struct Position.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeInTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "increasedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "decreasedAtTime", + "type": "uint256" + } + ], + "internalType": "struct Position.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } + ], + "internalType": "struct Position.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Position.Props", + "name": "position", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "affiliate", + "type": "address" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalRebateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "affiliateRewardFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustedAffiliateRewardFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalRebateAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "affiliateRewardAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionReferralFees", + "name": "referral", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "traderTier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionProFees", + "name": "pro", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fundingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestFundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestLongTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestShortTokenClaimableFundingAmountPerSize", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionFundingFees", + "name": "funding", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "borrowingFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeAmountForFeeReceiver", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionBorrowingFees", + "name": "borrowing", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "uiFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "uiFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionUiFees", + "name": "ui", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeAmountForFeeReceiver", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionLiquidationFees", + "name": "liquidation", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "collateralTokenPrice", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "positionFeeFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeReceiverAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeAmountForPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeAmountForPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCostAmountExcludingFunding", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCostAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalDiscountAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionFees", + "name": "fees", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int256", + "name": "priceImpactUsd", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "priceImpactDiffUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionPrice", + "type": "uint256" + } + ], + "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", + "name": "executionPriceResult", + "type": "tuple" + }, + { + "internalType": "int256", + "name": "basePnlUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "uncappedBasePnlUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "pnlAfterPriceImpactUsd", + "type": "int256" + } + ], + "internalType": "struct ReaderPositionUtils.PositionInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract IReferralStorage", + "name": "referralStorage", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "positionKeys", + "type": "bytes32[]" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices[]", + "name": "prices", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + } + ], + "name": "getPositionInfoList", + "outputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + } + ], + "internalType": "struct Position.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeInUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeInTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "longTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "increasedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "decreasedAtTime", + "type": "uint256" + } + ], + "internalType": "struct Position.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + } + ], + "internalType": "struct Position.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Position.Props", + "name": "position", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "affiliate", + "type": "address" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalRebateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "affiliateRewardFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "adjustedAffiliateRewardFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalRebateAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "affiliateRewardAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionReferralFees", + "name": "referral", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "traderTier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "traderDiscountAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionProFees", + "name": "pro", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fundingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestFundingFeeAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestLongTokenClaimableFundingAmountPerSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestShortTokenClaimableFundingAmountPerSize", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionFundingFees", + "name": "funding", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "borrowingFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowingFeeAmountForFeeReceiver", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionBorrowingFees", + "name": "borrowing", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "uiFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "uiFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionUiFees", + "name": "ui", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationFeeAmountForFeeReceiver", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionLiquidationFees", + "name": "liquidation", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "collateralTokenPrice", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "positionFeeFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeReceiverAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeAmountForPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeAmountForPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCostAmountExcludingFunding", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCostAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalDiscountAmount", + "type": "uint256" + } + ], + "internalType": "struct PositionPricingUtils.PositionFees", + "name": "fees", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int256", + "name": "priceImpactUsd", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "priceImpactDiffUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionPrice", + "type": "uint256" + } + ], + "internalType": "struct ReaderPricingUtils.ExecutionPriceResult", + "name": "executionPriceResult", + "type": "tuple" + }, + { + "internalType": "int256", + "name": "basePnlUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "uncappedBasePnlUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "pnlAfterPriceImpactUsd", + "type": "int256" + } + ], + "internalType": "struct ReaderPositionUtils.PositionInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "positionKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + } + ], + "name": "getPositionPnlUsd", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + }, + { + "internalType": "int256", + "name": "", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getShift", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct Shift.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct Shift.Numbers", + "name": "numbers", + "type": "tuple" + } + ], + "internalType": "struct Shift.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + } + ], + "name": "getSwapAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "", + "type": "int256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "feeReceiverAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeAmountForPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAfterFees", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "uiFeeReceiverFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "uiFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct SwapPricingUtils.SwapFees", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "marketKey", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "tokenInPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "tokenOutPrice", + "type": "tuple" + } + ], + "name": "getSwapPriceImpact", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + }, + { + "internalType": "int256", + "name": "", + "type": "int256" + }, + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getWithdrawal", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct Withdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct Withdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct Withdrawal.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct Withdrawal.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "enum ISwapPricingUtils.SwapPricingType", + "name": "swapPricingType", + "type": "uint8" + } + ], + "name": "getWithdrawalAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract IReferralStorage", + "name": "referralStorage", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "positionKey", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "marketToken", + "type": "address" + }, + { + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Market.Props", + "name": "market", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + } + ], + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "shouldValidateMinCollateralUsd", + "type": "bool" + } + ], + "name": "isPositionLiquidatable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "components": [ + { + "internalType": "int256", + "name": "remainingCollateralUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minCollateralUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "minCollateralUsdForLeverage", + "type": "int256" + } + ], + "internalType": "struct PositionUtils.IsPositionLiquidatableInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xb058c26493408e1ec30b17ac5872c1c322a9d4243e75d434099d15a9e4ccea76", + "receipt": { + "to": null, + "from": "0xE7BfFf2aB721264887230037940490351700a068", + "contractAddress": "0x23D4Da5C7C6902D4C86d551CaE60d5755820df9E", + "transactionIndex": 5, + "gasUsed": "5375288", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xec6a71487f45632fdf9f6c8e7c2f3efe0c7d4093f90f28a8468bd2b7b23c3395", + "transactionHash": "0xb058c26493408e1ec30b17ac5872c1c322a9d4243e75d434099d15a9e4ccea76", + "logs": [], + "blockNumber": 252698175, + "cumulativeGasUsed": "5964774", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 10, + "solcInputHash": "be316035eac2019d87590bce566bb2c5", + "libraries": { + "DepositStoreUtils": "0x5E4A532E53359b0BeAa21e41ccC9B35042e8051C", + "MarketStoreUtils": "0xDEBC0b5DADF3F88d9f00B0d8545B61e67eF3aBEa", + "MarketUtils": "0xB6426e70E7efc43aEf14a1D963A4F740c2356467", + "PositionStoreUtils": "0x3a4F71855554552f024E936E673eDb6E5C25535C", + "PositionUtils": "0xA3D091e23FEc66D843D3Fc8a83F1C8996d32f6a4", + "ReaderDepositUtils": "0x6023f1452C85aA2f5C77f6814651d3ED2FD19654", + "ReaderPositionUtils": "0xa7Bb93C5361BD6fe66408dCc0a9d98a25a1b2d88", + "ReaderPricingUtils": "0x4eA13E6926bF984B4c8853A8fbc9AbC149A0b445", + "ReaderUtils": "0x0597FB70fF1b3081c9B27a9eFFD1407DF1B4035f", + "ReaderWithdrawalUtils": "0xa0452ae9b77d384b45816A086Bd474104fAD32a4", + "ShiftStoreUtils": "0xb30a8d551Bd51fC1493DA195289665cBcDB6EB98", + "WithdrawalStoreUtils": "0xB57Cb5eafCd367D0C4D7ecd04d170e48A6145138" + }, + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SyntheticsRouter.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SyntheticsRouter.json new file mode 100644 index 0000000..a7d3d23 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/SyntheticsRouter.json @@ -0,0 +1,77 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Router", + "sourceName": "contracts/router/Router.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "pluginTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Timelock.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Timelock.json new file mode 100644 index 0000000..b16cde8 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Timelock.json @@ -0,0 +1,1737 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Timelock", + "sourceName": "contracts/peripherals/Timelock.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_buffer", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_tokenManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_mintReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_glpManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardRouter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxTokenSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_marginFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxMarginFeeBasisPoints", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "ClearAction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "SignalApprove", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "SignalMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "SignalPendingAction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SignalRedeemUsdg", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "gov", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "SignalSetGov", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "handler", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "SignalSetHandler", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "priceFeed", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "SignalSetPriceFeed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenDecimals", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenWeight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minProfitBps", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxUsdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isStable", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isShortable", + "type": "bool" + } + ], + "name": "SignalVaultSetTokenConfig", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "action", + "type": "bytes32" + } + ], + "name": "SignalWithdrawToken", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_BUFFER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FUNDING_RATE_FACTOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_LEVERAGE_VALIDATION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRICE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vester", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_amounts", + "type": "uint256[]" + } + ], + "name": "batchSetBonusRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "batchWithdrawFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "buffer", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_action", + "type": "bytes32" + } + ], + "name": "cancelAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + } + ], + "name": "disableLeverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + } + ], + "name": "enableLeverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "glpManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_referralStorage", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_code", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_newAccount", + "type": "address" + } + ], + "name": "govSetCodeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initGlpManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initRewardRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isHandler", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isKeeper", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "marginFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxMarginFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTokenSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintReceiver", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pendingActions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "processMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "redeemUsdg", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardRouter", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_buffer", + "type": "uint256" + } + ], + "name": "setBuffer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setContractHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "name": "setExternalAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableTaxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_mintBurnFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_swapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableSwapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_marginFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_hasDynamicFees", + "type": "bool" + } + ], + "name": "setFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_fundingInterval", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fundingRateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableFundingRateFactor", + "type": "uint256" + } + ], + "name": "setFundingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_cooldownDuration", + "type": "uint256" + } + ], + "name": "setGlpCooldownDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + }, + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + }, + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "bool", + "name": "_inPrivateLiquidationMode", + "type": "bool" + } + ], + "name": "setInPrivateLiquidationMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "bool", + "name": "_inPrivateTransferMode", + "type": "bool" + } + ], + "name": "setInPrivateTransferMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLeverageEnabled", + "type": "bool" + } + ], + "name": "setIsLeverageEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isSwapEnabled", + "type": "bool" + } + ], + "name": "setIsSwapEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_keeper", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setKeeper", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_liquidator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setLiquidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_marginFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxMarginFeeBasisPoints", + "type": "uint256" + } + ], + "name": "setMarginFeeBasisPoints", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxGasPrice", + "type": "uint256" + } + ], + "name": "setMaxGasPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setMaxGlobalShortSize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxLeverage", + "type": "uint256" + } + ], + "name": "setMaxLeverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + } + ], + "name": "setPriceFeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_referralStorage", + "type": "address" + }, + { + "internalType": "address", + "name": "_referrer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tierId", + "type": "uint256" + } + ], + "name": "setReferrerTier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_shortsTrackerAveragePriceWeight", + "type": "uint256" + } + ], + "name": "setShortsTrackerAveragePriceWeight", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_shouldToggleIsLeverageEnabled", + "type": "bool" + } + ], + "name": "setShouldToggleIsLeverageEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableTaxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_mintBurnFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_swapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableSwapFeeBasisPoints", + "type": "uint256" + } + ], + "name": "setSwapFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_referralStorage", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tierId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_totalRebate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_discountShare", + "type": "uint256" + } + ], + "name": "setTier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitBps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxUsdgAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_bufferAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_usdgAmounts", + "type": "uint256[]" + } + ], + "name": "setUsdgAmounts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "contract IVaultUtils", + "name": "_vaultUtils", + "type": "address" + } + ], + "name": "setVaultUtils", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "shouldToggleIsLeverageEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "signalApprove", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "signalMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "signalRedeemUsdg", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + }, + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "signalSetGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + }, + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "signalSetHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + } + ], + "name": "signalSetPriceFeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokenWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitBps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxUsdgAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isStable", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_isShortable", + "type": "bool" + } + ], + "name": "signalVaultSetTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "signalWithdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "tokenManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + } + ], + "name": "updateUsdgSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokenWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitBps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxUsdgAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isStable", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_isShortable", + "type": "bool" + } + ], + "name": "vaultSetTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "withdrawFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Token.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Token.json new file mode 100644 index 0000000..bf99705 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Token.json @@ -0,0 +1,345 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Token", + "sourceName": "contracts/tokens/Token.sol", + "abi": [ + { + "inputs": [], + "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": 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": [ + { + "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": [], + "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": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Treasury.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Treasury.json new file mode 100644 index 0000000..dfb36b7 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Treasury.json @@ -0,0 +1,411 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Treasury", + "sourceName": "contracts/gambit-token/Treasury.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "addLiquidity", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_accounts", + "type": "address[]" + } + ], + "name": "addWhitelists", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "busd", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "busdBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "busdHardCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "busdReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "busdSlotCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endSwap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_unlockTime", + "type": "uint256" + } + ], + "name": "extendUnlockTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "fund", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gmt", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gmtListingPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gmtPresalePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_busdBasisPoints", + "type": "uint256" + } + ], + "name": "increaseBusdBasisPoints", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_values", + "type": "uint256[]" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isLiquidityAdded", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isSwapActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_accounts", + "type": "address[]" + } + ], + "name": "removeWhitelists", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_fund", + "type": "address" + } + ], + "name": "setFund", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_busdAmount", + "type": "uint256" + } + ], + "name": "swap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "swapAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "swapWhitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unlockTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prevAccount", + "type": "address" + }, + { + "internalType": "address", + "name": "nextAccount", + "type": "address" + } + ], + "name": "updateWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/UniPool.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/UniPool.json new file mode 100644 index 0000000..f030812 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/UniPool.json @@ -0,0 +1,89 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "UniPool", + "sourceName": "contracts/amm/UniPool.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "uint32[]", + "name": "", + "type": "uint32[]" + } + ], + "name": "observe", + "outputs": [ + { + "internalType": "int56[]", + "name": "tickCumulatives", + "type": "int56[]" + }, + { + "internalType": "uint160[]", + "name": "secondsPerLiquidityCumulativeX128s", + "type": "uint160[]" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "slot0", + "outputs": [ + { + "internalType": "uint160", + "name": "sqrtPriceX96", + "type": "uint160" + }, + { + "internalType": "int24", + "name": "tick", + "type": "int24" + }, + { + "internalType": "uint16", + "name": "observationIndex", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "observationCardinality", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "observationCardinalityNext", + "type": "uint16" + }, + { + "internalType": "uint8", + "name": "feeProtocol", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "unlocked", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tickSpacing", + "outputs": [ + { + "internalType": "int24", + "name": "", + "type": "int24" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/UniswapV2.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/UniswapV2.json new file mode 100644 index 0000000..6c3cf92 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/UniswapV2.json @@ -0,0 +1 @@ +{"abi":[{"inputs":[],"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":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"_reserve0","type":"uint112"},{"internalType":"uint112","name":"_reserve1","type":"uint112"},{"internalType":"uint32","name":"_blockTimestampLast","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"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"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sync","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Vault.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Vault.json new file mode 100644 index 0000000..a787d83 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Vault.json @@ -0,0 +1,3220 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Vault", + "sourceName": "contracts/core/Vault.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "BuyUSDG", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + } + ], + "name": "ClosePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeTokens", + "type": "uint256" + } + ], + "name": "CollectMarginFees", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeTokens", + "type": "uint256" + } + ], + "name": "CollectSwapFees", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseGuaranteedUsd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreasePoolAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "DecreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseReservedAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseUsdgAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DirectPoolDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseGuaranteedUsd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreasePoolAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "IncreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseReservedAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseUsdgAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "markPrice", + "type": "uint256" + } + ], + "name": "LiquidatePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "SellUSDG", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOutAfterFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fundingRate", + "type": "uint256" + } + ], + "name": "UpdateFundingRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "hasProfit", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delta", + "type": "uint256" + } + ], + "name": "UpdatePnl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "markPrice", + "type": "uint256" + } + ], + "name": "UpdatePosition", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FUNDING_RATE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FEE_BASIS_POINTS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FUNDING_RATE_FACTOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_LIQUIDATION_FEE_USD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_FUNDING_RATE_INTERVAL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_LEVERAGE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRICE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USDG_DECIMALS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + } + ], + "name": "addRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_tokenDiv", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenMul", + "type": "address" + } + ], + "name": "adjustForDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allWhitelistedTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "allWhitelistedTokensLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedRouters", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "bufferAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "buyUSDG", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "clearTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "cumulativeFundingRates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "decreasePosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "directPoolDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "errorController", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "errors", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "feeReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fundingInterval", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fundingRateFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_averagePrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_lastIncreasedTime", + "type": "uint256" + } + ], + "name": "getDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getEntryFundingRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_increment", + "type": "bool" + } + ], + "name": "getFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_entryFundingRate", + "type": "uint256" + } + ], + "name": "getFundingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getGlobalShortDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getMaxPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getMinPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_averagePrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_nextPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_lastIncreasedTime", + "type": "uint256" + } + ], + "name": "getNextAveragePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getNextFundingRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nextPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + } + ], + "name": "getNextGlobalShortAveragePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + } + ], + "name": "getPositionFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionKey", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionLeverage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + } + ], + "name": "getRedemptionAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getRedemptionCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getRedemptionCollateralUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getTargetUsdgAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getUtilisation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "globalShortAveragePrices", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "globalShortSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "guaranteedUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasDynamicFees", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inManagerMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateLiquidationMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "includeAmmPrice", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "increasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + }, + { + "internalType": "address", + "name": "_usdg", + "type": "address" + }, + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fundingRateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableFundingRateFactor", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isLeverageEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isLiquidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isSwapEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastFundingTimes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "liquidatePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationFeeUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "marginFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxGasPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxGlobalShortSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLeverage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxUsdgAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minProfitBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minProfitTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintBurnFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "poolAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "positions", + "outputs": [ + { + "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": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceFeed", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + } + ], + "name": "removeRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reservedAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "sellUSDG", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setBufferAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_errorCode", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_error", + "type": "string" + } + ], + "name": "setError", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_errorController", + "type": "address" + } + ], + "name": "setErrorController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableTaxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_mintBurnFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_swapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableSwapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_marginFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_hasDynamicFees", + "type": "bool" + } + ], + "name": "setFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_fundingInterval", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fundingRateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableFundingRateFactor", + "type": "uint256" + } + ], + "name": "setFundingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inManagerMode", + "type": "bool" + } + ], + "name": "setInManagerMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateLiquidationMode", + "type": "bool" + } + ], + "name": "setInPrivateLiquidationMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isLeverageEnabled", + "type": "bool" + } + ], + "name": "setIsLeverageEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isSwapEnabled", + "type": "bool" + } + ], + "name": "setIsSwapEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_liquidator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setLiquidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isManager", + "type": "bool" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxGasPrice", + "type": "uint256" + } + ], + "name": "setMaxGasPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setMaxGlobalShortSize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxLeverage", + "type": "uint256" + } + ], + "name": "setMaxLeverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + } + ], + "name": "setPriceFeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokenWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitBps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxUsdgAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isStable", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_isShortable", + "type": "bool" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setUsdgAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVaultUtils", + "name": "_vaultUtils", + "type": "address" + } + ], + "name": "setVaultUtils", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shortableTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableFundingRateFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableSwapFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableTaxBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "stableTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "taxBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenAmount", + "type": "uint256" + } + ], + "name": "tokenToUsdMin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenWeights", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalTokenWeights", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + } + ], + "name": "updateCumulativeFundingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newVault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "upgradeVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "usdToToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + } + ], + "name": "usdToTokenMax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + } + ], + "name": "usdToTokenMin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "usdg", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "usdgAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "useSwapPricing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_raise", + "type": "bool" + } + ], + "name": "validateLiquidation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaultUtils", + "outputs": [ + { + "internalType": "contract IVaultUtils", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "whitelistedTokenCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelistedTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "withdrawFees", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultReader.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultReader.json new file mode 100644 index 0000000..feafdca --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultReader.json @@ -0,0 +1,87 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "VaultReader", + "sourceName": "contracts/peripherals/VaultReader.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_positionManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getVaultTokenInfoV3", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_positionManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "getVaultTokenInfoV4", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultV2.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultV2.json new file mode 100644 index 0000000..35882f8 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultV2.json @@ -0,0 +1,3019 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Vault", + "sourceName": "contracts/core/Vault.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "BuyUSDG", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + } + ], + "name": "ClosePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeTokens", + "type": "uint256" + } + ], + "name": "CollectMarginFees", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeTokens", + "type": "uint256" + } + ], + "name": "CollectSwapFees", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseGuaranteedUsd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreasePoolAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "DecreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseReservedAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseUsdgAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DirectPoolDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseGuaranteedUsd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreasePoolAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "IncreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseReservedAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseUsdgAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "markPrice", + "type": "uint256" + } + ], + "name": "LiquidatePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "SellUSDG", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOutAfterFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fundingRate", + "type": "uint256" + } + ], + "name": "UpdateFundingRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "hasProfit", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delta", + "type": "uint256" + } + ], + "name": "UpdatePnl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + } + ], + "name": "UpdatePosition", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FUNDING_RATE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FEE_BASIS_POINTS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FUNDING_RATE_FACTOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_LIQUIDATION_FEE_USD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_FUNDING_RATE_INTERVAL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_LEVERAGE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRICE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USDG_DECIMALS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + } + ], + "name": "addRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_tokenDiv", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenMul", + "type": "address" + } + ], + "name": "adjustForDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allWhitelistedTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "allWhitelistedTokensLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedRouters", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "bufferAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "buyUSDG", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "clearTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "cumulativeFundingRates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "decreasePosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "directPoolDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "feeReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fundingInterval", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fundingRateFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_averagePrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_lastIncreasedTime", + "type": "uint256" + } + ], + "name": "getDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_increment", + "type": "bool" + } + ], + "name": "getFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_entryFundingRate", + "type": "uint256" + } + ], + "name": "getFundingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getGlobalShortDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getMaxPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getMinPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_averagePrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_nextPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_lastIncreasedTime", + "type": "uint256" + } + ], + "name": "getNextAveragePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getNextFundingRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nextPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + } + ], + "name": "getNextGlobalShortAveragePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + } + ], + "name": "getPositionFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionKey", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionLeverage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + } + ], + "name": "getRedemptionAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getRedemptionCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getRedemptionCollateralUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getTargetUsdgAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getUtilisation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "globalShortAveragePrices", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "globalShortSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "guaranteedUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasDynamicFees", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inManagerMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateLiquidationMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "includeAmmPrice", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "increasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + }, + { + "internalType": "address", + "name": "_usdg", + "type": "address" + }, + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fundingRateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableFundingRateFactor", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isLeverageEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isLiquidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isSwapEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastFundingTimes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "liquidatePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationFeeUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "marginFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxGasPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLeverage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxUsdgAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minProfitBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minProfitTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintBurnFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "poolAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "positions", + "outputs": [ + { + "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": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceFeed", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + } + ], + "name": "removeRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reservedAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "sellUSDG", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setBufferAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableTaxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_mintBurnFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_swapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableSwapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_marginFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_hasDynamicFees", + "type": "bool" + } + ], + "name": "setFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_fundingInterval", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fundingRateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableFundingRateFactor", + "type": "uint256" + } + ], + "name": "setFundingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inManagerMode", + "type": "bool" + } + ], + "name": "setInManagerMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateLiquidationMode", + "type": "bool" + } + ], + "name": "setInPrivateLiquidationMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isLeverageEnabled", + "type": "bool" + } + ], + "name": "setIsLeverageEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isSwapEnabled", + "type": "bool" + } + ], + "name": "setIsSwapEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_liquidator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setLiquidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isManager", + "type": "bool" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxGasPrice", + "type": "uint256" + } + ], + "name": "setMaxGasPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxLeverage", + "type": "uint256" + } + ], + "name": "setMaxLeverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + } + ], + "name": "setPriceFeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokenWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitBps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxUsdgAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isStable", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_isShortable", + "type": "bool" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setUsdgAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shortableTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableFundingRateFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableSwapFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableTaxBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "stableTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "taxBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenAmount", + "type": "uint256" + } + ], + "name": "tokenToUsdMin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenWeights", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalTokenWeights", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "updateCumulativeFundingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newVault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "upgradeVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "usdToToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + } + ], + "name": "usdToTokenMax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + } + ], + "name": "usdToTokenMin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "usdg", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "usdgAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "useSwapPricing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_raise", + "type": "bool" + } + ], + "name": "validateLiquidation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "whitelistedTokenCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelistedTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "withdrawFees", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultV2b.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultV2b.json new file mode 100644 index 0000000..a787d83 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/VaultV2b.json @@ -0,0 +1,3220 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Vault", + "sourceName": "contracts/core/Vault.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "BuyUSDG", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + } + ], + "name": "ClosePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeTokens", + "type": "uint256" + } + ], + "name": "CollectMarginFees", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeTokens", + "type": "uint256" + } + ], + "name": "CollectSwapFees", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseGuaranteedUsd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreasePoolAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "DecreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseReservedAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DecreaseUsdgAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DirectPoolDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseGuaranteedUsd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreasePoolAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "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": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "IncreasePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseReservedAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IncreaseUsdgAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "indexToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "markPrice", + "type": "uint256" + } + ], + "name": "LiquidatePosition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usdgAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "SellUSDG", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOutAfterFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeBasisPoints", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fundingRate", + "type": "uint256" + } + ], + "name": "UpdateFundingRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "hasProfit", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delta", + "type": "uint256" + } + ], + "name": "UpdatePnl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "averagePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "entryFundingRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "markPrice", + "type": "uint256" + } + ], + "name": "UpdatePosition", + "type": "event" + }, + { + "inputs": [], + "name": "BASIS_POINTS_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FUNDING_RATE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FEE_BASIS_POINTS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FUNDING_RATE_FACTOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_LIQUIDATION_FEE_USD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_FUNDING_RATE_INTERVAL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_LEVERAGE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRICE_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USDG_DECIMALS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + } + ], + "name": "addRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_tokenDiv", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenMul", + "type": "address" + } + ], + "name": "adjustForDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allWhitelistedTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "allWhitelistedTokensLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedRouters", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "bufferAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "buyUSDG", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "clearTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "cumulativeFundingRates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_collateralDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "decreasePosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "directPoolDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "errorController", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "errors", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "feeReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fundingInterval", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fundingRateFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_averagePrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_lastIncreasedTime", + "type": "uint256" + } + ], + "name": "getDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getEntryFundingRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_increment", + "type": "bool" + } + ], + "name": "getFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_entryFundingRate", + "type": "uint256" + } + ], + "name": "getFundingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getGlobalShortDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getMaxPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getMinPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_averagePrice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_nextPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_lastIncreasedTime", + "type": "uint256" + } + ], + "name": "getNextAveragePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getNextFundingRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nextPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + } + ], + "name": "getNextGlobalShortAveragePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionDelta", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + } + ], + "name": "getPositionFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionKey", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "getPositionLeverage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdgAmount", + "type": "uint256" + } + ], + "name": "getRedemptionAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getRedemptionCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getRedemptionCollateralUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getTargetUsdgAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getUtilisation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "globalShortAveragePrices", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "globalShortSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "guaranteedUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasDynamicFees", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inManagerMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inPrivateLiquidationMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "includeAmmPrice", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_sizeDelta", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + } + ], + "name": "increasePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + }, + { + "internalType": "address", + "name": "_usdg", + "type": "address" + }, + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fundingRateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableFundingRateFactor", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isLeverageEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isLiquidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isSwapEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastFundingTimes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "address", + "name": "_feeReceiver", + "type": "address" + } + ], + "name": "liquidatePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationFeeUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "marginFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxGasPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxGlobalShortSizes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLeverage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxUsdgAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minProfitBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minProfitTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintBurnFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "poolAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "positions", + "outputs": [ + { + "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": "uint256", + "name": "reserveAmount", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "realisedPnl", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "lastIncreasedTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceFeed", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_router", + "type": "address" + } + ], + "name": "removeRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reservedAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "sellUSDG", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setBufferAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_errorCode", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_error", + "type": "string" + } + ], + "name": "setError", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_errorController", + "type": "address" + } + ], + "name": "setErrorController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_taxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableTaxBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_mintBurnFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_swapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableSwapFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_marginFeeBasisPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_liquidationFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_hasDynamicFees", + "type": "bool" + } + ], + "name": "setFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_fundingInterval", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fundingRateFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_stableFundingRateFactor", + "type": "uint256" + } + ], + "name": "setFundingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inManagerMode", + "type": "bool" + } + ], + "name": "setInManagerMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_inPrivateLiquidationMode", + "type": "bool" + } + ], + "name": "setInPrivateLiquidationMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isLeverageEnabled", + "type": "bool" + } + ], + "name": "setIsLeverageEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isSwapEnabled", + "type": "bool" + } + ], + "name": "setIsSwapEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_liquidator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setLiquidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isManager", + "type": "bool" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxGasPrice", + "type": "uint256" + } + ], + "name": "setMaxGasPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setMaxGlobalShortSize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxLeverage", + "type": "uint256" + } + ], + "name": "setMaxLeverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_priceFeed", + "type": "address" + } + ], + "name": "setPriceFeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokenWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minProfitBps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxUsdgAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isStable", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_isShortable", + "type": "bool" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setUsdgAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IVaultUtils", + "name": "_vaultUtils", + "type": "address" + } + ], + "name": "setVaultUtils", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shortableTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableFundingRateFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableSwapFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stableTaxBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "stableTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "taxBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenAmount", + "type": "uint256" + } + ], + "name": "tokenToUsdMin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenWeights", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalTokenWeights", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + } + ], + "name": "updateCumulativeFundingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newVault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "upgradeVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "usdToToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + } + ], + "name": "usdToTokenMax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_usdAmount", + "type": "uint256" + } + ], + "name": "usdToTokenMin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "usdg", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "usdgAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "useSwapPricing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_collateralToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_indexToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "_raise", + "type": "bool" + } + ], + "name": "validateLiquidation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaultUtils", + "outputs": [ + { + "internalType": "contract IVaultUtils", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "whitelistedTokenCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelistedTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "withdrawFees", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Vester.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Vester.json new file mode 100644 index 0000000..6630ef8 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/Vester.json @@ -0,0 +1,1031 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Vester", + "sourceName": "contracts/staking/Vester.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_vestingDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_esToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_pairToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_claimableToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardTracker", + "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": "amount", + "type": "uint256" + } + ], + "name": "Claim", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Deposit", + "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": "PairTransfer", + "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": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "bonusRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "claim", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "claimForAccount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "claimable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "claimableToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimedAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "cumulativeClaimAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "cumulativeRewardDeductions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "depositForAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "esToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "getCombinedAverageStakedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "getMaxVestableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_esAmount", + "type": "uint256" + } + ], + "name": "getPairAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "getTotalVested", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "getVestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasMaxVestableAmount", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasPairToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasRewardTracker", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isHandler", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastVestingTimes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "pairAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pairSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pairToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardTracker", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setBonusRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setCumulativeRewardDeductions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_handler", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isActive", + "type": "bool" + } + ], + "name": "setHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_hasMaxVestableAmount", + "type": "bool" + } + ], + "name": "setHasMaxVestableAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setTransferredAverageStakedAmounts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setTransferredCumulativeRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "transferStakeValues", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "transferredAverageStakedAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "transferredCumulativeRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/WETH.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/WETH.json new file mode 100644 index 0000000..8925271 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/WETH.json @@ -0,0 +1,320 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "WETH", + "sourceName": "contracts/tokens/WETH.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + } + ], + "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": 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": [ + { + "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": [], + "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": "deposit", + "outputs": [], + "stateMutability": "payable", + "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": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/YieldFarm.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/YieldFarm.json new file mode 100644 index 0000000..8e1f521 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/YieldFarm.json @@ -0,0 +1,599 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "YieldFarm", + "sourceName": "contracts/tokens/YieldFarm.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "address", + "name": "_stakingToken", + "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": 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": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addNonStakingAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "admins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonStakingAccounts", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonStakingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "recoverClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeNonStakingAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "setInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_yieldTrackers", + "type": "address[]" + } + ], + "name": "setYieldTrackers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "stakedBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "yieldTrackers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/YieldToken.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/YieldToken.json new file mode 100644 index 0000000..1e6b9ed --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/YieldToken.json @@ -0,0 +1,560 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "YieldToken", + "sourceName": "contracts/tokens/YieldToken.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_initialSupply", + "type": "uint256" + } + ], + "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": 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": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addNonStakingAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "admins", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonStakingAccounts", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonStakingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "recoverClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeNonStakingAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gov", + "type": "address" + } + ], + "name": "setGov", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "setInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_yieldTrackers", + "type": "address[]" + } + ], + "name": "setYieldTrackers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "stakedBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "yieldTrackers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/index.ts new file mode 100644 index 0000000..0a6915c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/abis/index.ts @@ -0,0 +1,136 @@ +import type { JsonFragment } from "ethers"; +import { Abi, erc20Abi } from "viem"; + +import CustomErrors from "./CustomErrors.json" with { type: "json" }; +import DataStore from "./DataStore.json" with { type: "json" }; +import ERC721 from "./ERC721.json" with { type: "json" }; +import EventEmitter from "./EventEmitter.json" with { type: "json" }; +import ExchangeRouter from "./ExchangeRouter.json" with { type: "json" }; +import GlpManager from "./GlpManager.json" with { type: "json" }; +import GlvReader from "./GlvReader.json" with { type: "json" }; +import GlvRouter from "./GlvRouter.json" with { type: "json" }; +import GMT from "./GMT.json" with { type: "json" }; +import GmxMigrator from "./GmxMigrator.json" with { type: "json" }; +import GovToken from "./GovToken.json" with { type: "json" }; +import MintableBaseToken from "./MintableBaseToken.json" with { type: "json" }; +import Multicall from "./Multicall.json" with { type: "json" }; +import OrderBook from "./OrderBook.json" with { type: "json" }; +import OrderBookReader from "./OrderBookReader.json" with { type: "json" }; +import OrderExecutor from "./OrderExecutor.json" with { type: "json" }; +import PositionManager from "./PositionManager.json" with { type: "json" }; +import PositionRouter from "./PositionRouter.json" with { type: "json" }; +import Reader from "./Reader.json" with { type: "json" }; +import ReaderV2 from "./ReaderV2.json" with { type: "json" }; +import ReferralStorage from "./ReferralStorage.json" with { type: "json" }; +import RewardReader from "./RewardReader.json" with { type: "json" }; +import RewardRouter from "./RewardRouter.json" with { type: "json" }; +import RewardTracker from "./RewardTracker.json" with { type: "json" }; +import RouterV2 from "./Router-v2.json" with { type: "json" }; +import Router from "./Router.json" with { type: "json" }; +import SubaccountRouter from "./SubaccountRouter.json" with { type: "json" }; +import SyntheticsReader from "./SyntheticsReader.json" with { type: "json" }; +import SyntheticsRouter from "./SyntheticsRouter.json" with { type: "json" }; +import Timelock from "./Timelock.json" with { type: "json" }; +import Token from "./Token.json" with { type: "json" }; +import Treasury from "./Treasury.json" with { type: "json" }; +import UniPool from "./UniPool.json" with { type: "json" }; +import UniswapV2 from "./UniswapV2.json" with { type: "json" }; +import Vault from "./Vault.json" with { type: "json" }; +import VaultReader from "./VaultReader.json" with { type: "json" }; +import VaultV2 from "./VaultV2.json" with { type: "json" }; +import VaultV2b from "./VaultV2b.json" with { type: "json" }; +import Vester from "./Vester.json" with { type: "json" }; +import WETH from "./WETH.json" with { type: "json" }; +import YieldFarm from "./YieldFarm.json" with { type: "json" }; +import YieldToken from "./YieldToken.json" with { type: "json" }; + +export type AbiId = + | "CustomErrors" + | "DataStore" + | "ERC721" + | "ERC20" + | "EventEmitter" + | "ExchangeRouter" + | "GlpManager" + | "GlvReader" + | "GlvRouter" + | "GMT" + | "GmxMigrator" + | "GovToken" + | "MintableBaseToken" + | "Multicall" + | "OrderBook" + | "OrderBookReader" + | "OrderExecutor" + | "PositionManager" + | "PositionRouter" + | "Reader" + | "ReaderV2" + | "ReferralStorage" + | "RewardReader" + | "RewardRouter" + | "RewardTracker" + | "Router-v2" + | "Router" + | "SubaccountRouter" + | "SyntheticsReader" + | "SyntheticsRouter" + | "Timelock" + | "Token" + | "Treasury" + | "UniPool" + | "UniswapV2" + | "Vault" + | "VaultReader" + | "VaultV2" + | "VaultV2b" + | "Vester" + | "WETH" + | "YieldFarm" + | "YieldToken"; + +export const abis: Record = { + CustomErrors: CustomErrors.abi, + DataStore: DataStore.abi, + ERC721: ERC721.abi, + ERC20: erc20Abi, + EventEmitter: EventEmitter.abi, + ExchangeRouter: ExchangeRouter.abi, + GlpManager: GlpManager.abi, + GlvReader: GlvReader.abi, + GlvRouter: GlvRouter.abi, + GMT: GMT.abi, + GmxMigrator: GmxMigrator.abi, + GovToken: GovToken.abi, + MintableBaseToken: MintableBaseToken.abi, + Multicall: Multicall.abi, + OrderBook: OrderBook.abi, + OrderBookReader: OrderBookReader.abi, + OrderExecutor: OrderExecutor.abi, + PositionManager: PositionManager.abi, + PositionRouter: PositionRouter.abi, + Reader: Reader.abi, + ReaderV2: ReaderV2.abi, + ReferralStorage: ReferralStorage.abi, + RewardReader: RewardReader.abi, + RewardRouter: RewardRouter.abi, + RewardTracker: RewardTracker.abi, + RouterV2: RouterV2.abi, + Router: Router.abi, + SubaccountRouter: SubaccountRouter.abi, + SyntheticsReader: SyntheticsReader.abi, + SyntheticsRouter: SyntheticsRouter.abi, + Timelock: Timelock.abi, + Token: Token.abi, + Treasury: Treasury.abi, + UniPool: UniPool.abi, + UniswapV2: UniswapV2.abi, + Vault: Vault.abi, + VaultReader: VaultReader.abi, + VaultV2: VaultV2.abi, + VaultV2b: VaultV2b.abi, + Vester: Vester.abi, + WETH: WETH.abi, + YieldFarm: YieldFarm.abi, + YieldToken: YieldToken.abi, +} as any; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/batch.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/batch.ts new file mode 100644 index 0000000..8aac5fe --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/batch.ts @@ -0,0 +1,47 @@ +import {ClientConfig, MulticallBatchOptions} from "viem"; +import {ARBITRUM, AVALANCHE, AVALANCHE_FUJI} from "./chains.js"; + +export const BATCH_CONFIGS: Record< + number, + { + http: MulticallBatchOptions; + client: ClientConfig["batch"]; + } +> = { + [ARBITRUM]: { + http: { + batchSize: 0, // disable batches, here batchSize is the number of eth_calls in a batch + wait: 0, // keep this setting in case batches are enabled in future + }, + client: { + multicall: { + batchSize: 1024 * 1024, // here batchSize is the number of bytes in a multicall + wait: 0, // zero delay means formation of a batch in the current macro-task, like setTimeout(fn, 0) + }, + }, + }, + [AVALANCHE]: { + http: { + batchSize: 0, + wait: 0, + }, + client: { + multicall: { + batchSize: 1024 * 1024, + wait: 0, + }, + }, + }, + [AVALANCHE_FUJI]: { + http: { + batchSize: 40, + wait: 0, + }, + client: { + multicall: { + batchSize: 1024 * 1024, + wait: 0, + }, + }, + }, +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/chains.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/chains.ts new file mode 100644 index 0000000..a44e1a2 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/chains.ts @@ -0,0 +1,110 @@ +import {arbitrum, avalanche, avalancheFuji, Chain} from "viem/chains"; + +export const AVALANCHE = 43114; +export const AVALANCHE_FUJI = 43113; +export const ARBITRUM = 42161; +export const BSС_MAINNET = 56; +export const BSС_TESTNET = 97; +export const ETH_MAINNET = 1; + +export const SUPPORTED_CHAIN_IDS = [ARBITRUM, AVALANCHE]; +export const SUPPORTED_CHAIN_IDS_DEV = [...SUPPORTED_CHAIN_IDS, AVALANCHE_FUJI]; + +export const HIGH_EXECUTION_FEES_MAP = { + [ARBITRUM]: 5, // 5 USD + [AVALANCHE]: 5, // 5 USD + [AVALANCHE_FUJI]: 5, // 5 USD +}; + +// added to maxPriorityFeePerGas +// applied to EIP-1559 transactions only +// is not applied to execution fee calculation +export const MAX_FEE_PER_GAS_MAP = { + [AVALANCHE]: 200000000000n, // 200 gwei +}; + +// added to maxPriorityFeePerGas +// applied to EIP-1559 transactions only +// is also applied to the execution fee calculation +export const GAS_PRICE_PREMIUM_MAP = { + [ARBITRUM]: 0n, + [AVALANCHE]: 6000000000n, // 6 gwei +}; + +/* + that was a constant value in ethers v5, after ethers v6 migration we use it as a minimum for maxPriorityFeePerGas +*/ +export const MAX_PRIORITY_FEE_PER_GAS_MAP: Record = { + [ARBITRUM]: 1500000000n, + [AVALANCHE]: 1500000000n, + [AVALANCHE_FUJI]: 1500000000n, +}; + +export const EXCESSIVE_EXECUTION_FEES_MAP = { + [ARBITRUM]: 10, // 10 USD + [AVALANCHE]: 10, // 10 USD + [AVALANCHE_FUJI]: 10, // 10 USD +}; + +// added to gasPrice +// applied to *non* EIP-1559 transactions only +// +// it is *not* applied to the execution fee calculation, and in theory it could cause issues +// if gas price used in the execution fee calculation is lower +// than the gas price used in the transaction (e.g. create order transaction) +// then the transaction will fail with InsufficientExecutionFee error. +// it is not an issue on Arbitrum though because the passed gas price does not affect the paid gas price. +// for example if current gas price is 0.1 gwei and UI passes 0.5 gwei the transaction +// Arbitrum will still charge 0.1 gwei per gas +// +// it doesn't make much sense to set this buffer higher than the execution fee buffer +// because if the paid gas price is higher than the gas price used in the execution fee calculation +// and the transaction will still fail with InsufficientExecutionFee +// +// this buffer could also cause issues on a blockchain that uses passed gas price +// especially if execution fee buffer and lower than gas price buffer defined bellow +export const GAS_PRICE_BUFFER_MAP = { + [ARBITRUM]: 2000n, // 20% +}; + +const CHAIN_BY_CHAIN_ID = { + [AVALANCHE_FUJI]: avalancheFuji, + [ARBITRUM]: arbitrum, + [AVALANCHE]: avalanche, +}; + +export const getChain = (chainId: number): Chain => { + return CHAIN_BY_CHAIN_ID[chainId]; +}; + +export function getHighExecutionFee(chainId) { + return HIGH_EXECUTION_FEES_MAP[chainId] ?? 5; +} + +export function getExcessiveExecutionFee(chainId) { + return EXCESSIVE_EXECUTION_FEES_MAP[chainId] ?? 10; +} + +export function isSupportedChain(chainId: number, dev = false) { + return (dev ? SUPPORTED_CHAIN_IDS_DEV : SUPPORTED_CHAIN_IDS).includes(chainId); +} + +export const EXECUTION_FEE_CONFIG_V2: { + [chainId: number]: { + shouldUseMaxPriorityFeePerGas: boolean; + defaultBufferBps?: number; + }; +} = { + [AVALANCHE]: { + shouldUseMaxPriorityFeePerGas: true, + defaultBufferBps: 1000, // 10% + }, + [AVALANCHE_FUJI]: { + shouldUseMaxPriorityFeePerGas: true, + defaultBufferBps: 1000, // 10% + }, + [ARBITRUM]: { + shouldUseMaxPriorityFeePerGas: false, + defaultBufferBps: 3000, // 30% + }, +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/contracts.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/contracts.ts new file mode 100644 index 0000000..029db0c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/contracts.ts @@ -0,0 +1,281 @@ +import {type Address, zeroAddress} from "viem"; +import {ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BSС_MAINNET, BSС_TESTNET} from "./chains.js"; + +export const CONTRACTS = { + [BSС_MAINNET]: { + // bsc mainnet + Treasury: "0xa44E7252a0C137748F523F112644042E5987FfC7", + BUSD: "0xe9e7cea3dedca5984780bafc599bd69add087d56", + GMT: "0x99e92123eB77Bc8f999316f622e5222498438784", + Vault: "0xc73A8DcAc88498FD4b4B1b2AaA37b0a2614Ff67B", + Router: "0xD46B23D042E976F8666F554E928e0Dc7478a8E1f", + Reader: "0x087A618fD25c92B61254DBe37b09E5E8065FeaE7", + AmmFactory: "0xBCfCcbde45cE874adCB698cC183deBcF17952812", + AmmFactoryV2: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73", + OrderBook: "0x1111111111111111111111111111111111111111", + OrderBookReader: "0x1111111111111111111111111111111111111111", + GmxMigrator: "0xDEF2af818514c1Ca1A9bBe2a4D45E28f260063f9", + USDG: "0x85E76cbf4893c1fbcB34dCF1239A91CE2A4CF5a7", + NATIVE_TOKEN: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + XGMT: "0xe304ff0983922787Fd84BC9170CD21bF78B16B10", + GMT_USDG_PAIR: "0xa41e57459f09a126F358E118b693789d088eA8A0", + XGMT_USDG_PAIR: "0x0b622208fc0691C2486A3AE6B7C875b4A174b317", + GMT_USDG_FARM: "0x3E8B08876c791dC880ADC8f965A02e53Bb9C0422", + XGMT_USDG_FARM: "0x68D7ee2A16AB7c0Ee1D670BECd144166d2Ae0759", + USDG_YIELD_TRACKER: "0x0EF0Cf825B8e9F89A43FfD392664131cFB4cfA89", + XGMT_YIELD_TRACKER: "0x82A012A9b3003b18B6bCd6052cbbef7Fa4892e80", + GMT_USDG_FARM_TRACKER_XGMT: "0x08FAb024BEfcb6068847726b2eccEAd18b6c23Cd", + GMT_USDG_FARM_TRACKER_NATIVE: "0xd8E26637B34B2487Cad1f91808878a391134C5c2", + XGMT_USDG_FARM_TRACKER_XGMT: "0x026A02F7F26C1AFccb9Cba7C4df3Dc810F4e92e8", + XGMT_USDG_FARM_TRACKER_NATIVE: "0x22458CEbD14a9679b2880147d08CA1ce5aa40E84", + AUTO: "0xa184088a740c695E156F91f5cC086a06bb78b827", + AUTO_USDG_PAIR: "0x0523FD5C53ea5419B4DAF656BC1b157dDFE3ce50", + AUTO_USDG_FARM: "0xE6958298328D02051769282628a3b4178D0F3A47", + AUTO_USDG_FARM_TRACKER_XGMT: "0x093b8be41c1A30704De84a9521632f9a139c08bd", + AUTO_USDG_FARM_TRACKER_NATIVE: "0x23ed48E5dce3acC7704d0ce275B7b9a0e346b63A", + GMT_GMX_IOU: "0x47052469970C2484729875CC9E2dd2683fcE71fb", + XGMT_GMX_IOU: "0xeB3733DFe3b68C9d26898De2493A3Bb59FDb4A7B", + GMT_USDG_GMX_IOU: "0x481312655F81b5e249780A6a49735335BF6Ca7f4", + XGMT_USDG_GMX_IOU: "0x8095F1A92526C304623483018aA28cC6E62EB1e1", + }, + [BSС_TESTNET]: { + // bsc testnet + Vault: "0x1B183979a5cd95FAF392c8002dbF0D5A1C687D9a", + Router: "0x10800f683aa564534497a5b67F45bE3556a955AB", + Reader: "0x98D4742F1B6a821bae672Cd8721283b91996E454", + AmmFactory: "0x6725f303b657a9451d8ba641348b6761a6cc7a17", + AmmFactoryV2: "0x1111111111111111111111111111111111111111", + OrderBook: "0x9afD7B4f0b58d65F6b2978D3581383a06b2ac4e9", + OrderBookReader: "0x0713562970D1A802Fa3FeB1D15F9809943982Ea9", + GmxMigrator: "0xDEF2af818514c1Ca1A9bBe2a4D45E28f260063f9", + USDG: "0x2D549bdBf810523fe9cd660cC35fE05f0FcAa028", + GMT: "0xedba0360a44f885ed390fad01aa34d00d2532817", + NATIVE_TOKEN: "0x612777Eea37a44F7a95E3B101C39e1E2695fa6C2", + XGMT: "0x28cba798eca1a3128ffd1b734afb93870f22e613", + GMT_USDG_PAIR: "0xe0b0a315746f51932de033ab27223d85114c6b85", + XGMT_USDG_PAIR: "0x0108de1eea192ce8448080c3d90a1560cf643fa0", + GMT_USDG_FARM: "0xbe3cB06CE03cA692b77902040479572Ba8D01b0B", + XGMT_USDG_FARM: "0x138E92195D4B99CE3618092D3F9FA830d9A69B4b", + USDG_YIELD_TRACKER: "0x62B49Bc3bF252a5DB26D88ccc7E61119e3179B4f", + XGMT_YIELD_TRACKER: "0x5F235A582e0993eE9466FeEb8F7B4682993a57d0", + GMT_USDG_FARM_TRACKER_XGMT: "0x4f8EE3aE1152422cbCaFACd4e3041ba2D859913C", + GMT_USDG_FARM_TRACKER_NATIVE: "0xd691B26E544Fe370f39A776964c991363aF72e56", + XGMT_USDG_FARM_TRACKER_XGMT: "0xfd5617CFB082Ba9bcD62d654603972AE312bC695", + XGMT_USDG_FARM_TRACKER_NATIVE: "0x0354387DD85b7D8aaD1611B3D167A384d6AE0c28", + GMT_GMX_IOU: "0x47052469970C2484729875CC9E2dd2683fcE71fb", + XGMT_GMX_IOU: "0xeB3733DFe3b68C9d26898De2493A3Bb59FDb4A7B", + GMT_USDG_GMX_IOU: "0x481312655F81b5e249780A6a49735335BF6Ca7f4", + XGMT_USDG_GMX_IOU: "0x8095F1A92526C304623483018aA28cC6E62EB1e1", + }, + [ARBITRUM]: { + // arbitrum mainnet + Vault: "0x489ee077994B6658eAfA855C308275EAd8097C4A", + Router: "0xaBBc5F99639c9B6bCb58544ddf04EFA6802F4064", + VaultReader: "0xfebB9f4CAC4cD523598fE1C5771181440143F24A", + Reader: "0x2b43c90D1B727cEe1Df34925bcd5Ace52Ec37694", + GlpManager: "0x3963FfC9dff443c2A94f21b129D429891E32ec18", + RewardRouter: "0x5E4766F932ce00aA4a1A82d3Da85adf15C5694A1", + GlpRewardRouter: "0xB95DB5B167D75e6d04227CfFFA61069348d271F5", + RewardReader: "0x8BFb8e82Ee4569aee78D03235ff465Bd436D40E0", + GovToken: "0x2A29D3a792000750807cc401806d6fd539928481", + NATIVE_TOKEN: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + GLP: "0x4277f8F2c384827B5273592FF7CeBd9f2C1ac258", + GMX: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", + ES_GMX: "0xf42Ae1D54fd613C9bb14810b0588FaAa09a426cA", + BN_GMX: "0x35247165119B69A40edD5304969560D0ef486921", + USDG: "0x45096e7aA921f27590f8F19e457794EB09678141", + ES_GMX_IOU: "0x6260101218eC4cCfFF1b778936C6f2400f95A954", + StakedGmxTracker: "0x908C4D94D34924765f1eDc22A1DD098397c59dD4", + BonusGmxTracker: "0x4d268a7d4C16ceB5a606c173Bd974984343fea13", + FeeGmxTracker: "0xd2D1162512F927a7e282Ef43a362659E4F2a728F", + StakedGlpTracker: "0x1aDDD80E6039594eE970E5872D247bf0414C8903", + FeeGlpTracker: "0x4e971a87900b931fF39d1Aad67697F49835400b6", + ExtendedGmxTracker: "0x0755D33e45eD2B874c9ebF5B279023c8Bd1e5E93", + + StakedGmxDistributor: "0x23208B91A98c7C1CD9FE63085BFf68311494F193", + StakedGlpDistributor: "0x60519b48ec4183a61ca2B8e37869E675FD203b34", + + GmxVester: "0x199070DDfd1CFb69173aa2F7e20906F26B363004", + GlpVester: "0xA75287d2f8b217273E7FCD7E86eF07D33972042E", + AffiliateVester: "0x7c100c0F55A15221A4c1C5a25Db8C98A81df49B2", + + OrderBook: "0x09f77E8A13De9a35a7231028187e9fD5DB8a2ACB", + OrderExecutor: "0x7257ac5D0a0aaC04AA7bA2AC0A6Eb742E332c3fB", + OrderBookReader: "0xa27C20A7CF0e1C68C0460706bB674f98F362Bc21", + + PositionRouter: "0xb87a436B93fFE9D75c5cFA7bAcFff96430b09868", + PositionManager: "0x75E42e6f01baf1D6022bEa862A28774a9f8a4A0C", + + UniswapGmxEthPool: "0x80A9ae39310abf666A87C743d6ebBD0E8C42158E", + ReferralStorage: "0xe6fab3f0c7199b0d34d7fbe83394fc0e0d06e99d", + ReferralReader: "0x8Aa382760BCdCe8644C33e6C2D52f6304A76F5c8", + Timelock: "0xaa50bD556CE0Fe61D4A57718BA43177a3aB6A597", + + // Synthetics + DataStore: "0xFD70de6b91282D8017aA4E741e9Ae325CAb992d8", + EventEmitter: "0xC8ee91A54287DB53897056e12D9819156D3822Fb", + SubaccountRouter: "0xa329221a77BE08485f59310b873b14815c82E10D", + ExchangeRouter: "0x5ac4e27341e4cccb3e5fd62f9e62db2adf43dd57", + DepositVault: "0xF89e77e8Dc11691C9e8757e84aaFbCD8A67d7A55", + WithdrawalVault: "0x0628D46b5D145f183AdB6Ef1f2c97eD1C4701C55", + OrderVault: "0x31eF83a530Fde1B38EE9A18093A333D8Bbbc40D5", + ShiftVault: "0xfe99609C4AA83ff6816b64563Bdffd7fa68753Ab", + SyntheticsReader: "0x0537C767cDAC0726c76Bb89e92904fe28fd02fE1", + SyntheticsRouter: "0x7452c558d45f8afC8c83dAe62C3f8A5BE19c71f6", + + GlvReader: "0x6a9505D0B44cFA863d9281EA5B0b34cB36243b45", + GlvRouter: "0x994c598e3b0661bb805d53c6fa6b4504b23b68dd", + GlvVault: "0x393053B58f9678C9c28c2cE941fF6cac49C3F8f9", + + ExternalHandler: "0x389CEf541397e872dC04421f166B5Bc2E0b374a5", + + OpenOceanRouter: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", + + Multicall: "0x842ec2c7d803033edf55e478f461fc547bc54eb2", + }, + [AVALANCHE]: { + // avalanche + Vault: "0x9ab2De34A33fB459b538c43f251eB825645e8595", + Router: "0x5F719c2F1095F7B9fc68a68e35B51194f4b6abe8", + VaultReader: "0x66eC8fc33A26feAEAe156afA3Cb46923651F6f0D", + Reader: "0x2eFEE1950ededC65De687b40Fd30a7B5f4544aBd", + GlpManager: "0xD152c7F25db7F4B95b7658323c5F33d176818EE4", + RewardRouter: "0x091eD806490Cc58Fd514441499e58984cCce0630", + GlpRewardRouter: "0xB70B91CE0771d3f4c81D87660f71Da31d48eB3B3", + RewardReader: "0x04Fc11Bd28763872d143637a7c768bD96E44c1b6", + GovToken: "0x0ff183E29f1924ad10475506D7722169010CecCb", + NATIVE_TOKEN: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + GLP: "0x01234181085565ed162a948b6a5e88758CD7c7b8", + GMX: "0x62edc0692BD897D2295872a9FFCac5425011c661", + ES_GMX: "0xFf1489227BbAAC61a9209A08929E4c2a526DdD17", + BN_GMX: "0x8087a341D32D445d9aC8aCc9c14F5781E04A26d2", + USDG: "0xc0253c3cC6aa5Ab407b5795a04c28fB063273894", + ES_GMX_IOU: "0x6260101218eC4cCfFF1b778936C6f2400f95A954", // placeholder address + + StakedGmxTracker: "0x2bD10f8E93B3669b6d42E74eEedC65dd1B0a1342", + BonusGmxTracker: "0x908C4D94D34924765f1eDc22A1DD098397c59dD4", + FeeGmxTracker: "0x4d268a7d4C16ceB5a606c173Bd974984343fea13", + StakedGlpTracker: "0x9e295B5B976a184B14aD8cd72413aD846C299660", + FeeGlpTracker: "0xd2D1162512F927a7e282Ef43a362659E4F2a728F", + ExtendedGmxTracker: "0xB0D12Bf95CC1341d6C845C978daaf36F70b5910d", + + StakedGmxDistributor: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", + StakedGlpDistributor: "0xDd593Cf40734199afc9207eBe9ffF23dA4Bf7720", + + GmxVester: "0x472361d3cA5F49c8E633FB50385BfaD1e018b445", + GlpVester: "0x62331A7Bd1dfB3A7642B7db50B5509E57CA3154A", + AffiliateVester: "0x754eC029EF9926184b4CFDeA7756FbBAE7f326f7", + + OrderBook: "0x4296e307f108B2f583FF2F7B7270ee7831574Ae5", + OrderExecutor: "0x4296e307f108B2f583FF2F7B7270ee7831574Ae5", + OrderBookReader: "0xccFE3E576f8145403d3ce8f3c2f6519Dae40683B", + + PositionRouter: "0xffF6D276Bc37c61A23f06410Dce4A400f66420f8", + PositionManager: "0xA21B83E579f4315951bA658654c371520BDcB866", + + TraderJoeGmxAvaxPool: "0x0c91a070f862666bbcce281346be45766d874d98", + ReferralStorage: "0x827ed045002ecdabeb6e2b0d1604cf5fc3d322f8", + ReferralReader: "0x505Ce16D3017be7D76a7C2631C0590E71A975083", + Timelock: "0x8A68a039D555599Fd745f9343e8dE20C9eaFca75", + + // Synthetics + DataStore: "0x2F0b22339414ADeD7D5F06f9D604c7fF5b2fe3f6", + EventEmitter: "0xDb17B211c34240B014ab6d61d4A31FA0C0e20c26", + SubaccountRouter: "0x5aEb6AD978f59e220aA9099e09574e1c5E03AafD", + ExchangeRouter: "0xe37d052e1deb99901de205e7186e31a36e4ef70c", + DepositVault: "0x90c670825d0C62ede1c5ee9571d6d9a17A722DFF", + WithdrawalVault: "0xf5F30B10141E1F63FC11eD772931A8294a591996", + OrderVault: "0xD3D60D22d415aD43b7e64b510D86A30f19B1B12C", + ShiftVault: "0x7fC46CCb386e9bbBFB49A2639002734C3Ec52b39", + SyntheticsReader: "0x618fCEe30D9A26e8533C3B244CAd2D6486AFf655", + SyntheticsRouter: "0x820F5FfC5b525cD4d88Cd91aCf2c28F16530Cc68", + + GlvReader: "0xae9596a1C438675AcC75f69d32E21Ac9c8fF99bD", + GlvRouter: "0x16500c1d8ffe2f695d8dcadf753f664993287ae4", + GlvVault: "0x527FB0bCfF63C47761039bB386cFE181A92a4701", + + OpenOceanRouter: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", + + ExternalHandler: "0xD149573a098223a9185433290a5A5CDbFa54a8A9", + + Multicall: "0xcA11bde05977b3631167028862bE2a173976CA11", + }, + + [AVALANCHE_FUJI]: { + Vault: zeroAddress, + Router: zeroAddress, + VaultReader: zeroAddress, + Reader: zeroAddress, + GlpManager: zeroAddress, + RewardRouter: zeroAddress, + RewardReader: zeroAddress, + GlpRewardRouter: zeroAddress, + NATIVE_TOKEN: "0x1D308089a2D1Ced3f1Ce36B1FcaF815b07217be3", + GLP: zeroAddress, + GMX: zeroAddress, + ES_GMX: zeroAddress, + BN_GMX: zeroAddress, + USDG: zeroAddress, + ES_GMX_IOU: zeroAddress, + + StakedGmxTracker: zeroAddress, + BonusGmxTracker: zeroAddress, + FeeGmxTracker: zeroAddress, + StakedGlpTracker: zeroAddress, + FeeGlpTracker: zeroAddress, + ExtendedGmxTracker: zeroAddress, + + StakedGmxDistributor: zeroAddress, + StakedGlpDistributor: zeroAddress, + + GmxVester: zeroAddress, + GlpVester: zeroAddress, + AffiliateVester: zeroAddress, + + OrderBook: zeroAddress, + OrderExecutor: zeroAddress, + OrderBookReader: zeroAddress, + + PositionRouter: zeroAddress, + PositionManager: zeroAddress, + + TraderJoeGmxAvaxPool: zeroAddress, + ReferralStorage: "0x58726dB901C9DF3654F45a37DD307a0C44b6420e", + ReferralReader: zeroAddress, + + // Synthetics + DataStore: "0xEA1BFb4Ea9A412dCCd63454AbC127431eBB0F0d4", + EventEmitter: "0xc67D98AC5803aFD776958622CeEE332A0B2CabB9", + ExchangeRouter: "0x52A1c10c462ca4e5219d0Eb4da5052cc73F9050D", + SubaccountRouter: "0x0595f01860aa5c4C6091EED096515b4b9FE372CE", + DepositVault: "0x2964d242233036C8BDC1ADC795bB4DeA6fb929f2", + WithdrawalVault: "0x74d49B6A630Bf519bDb6E4efc4354C420418A6A2", + OrderVault: "0x25D23e8E655727F2687CC808BB9589525A6F599B", + ShiftVault: "0x257D0EA0B040E2Cd1D456fB4C66d7814102aD346", + SyntheticsReader: "0x16Fb5b8846fbfAe09c034fCdF3D3F9492484DA80", + SyntheticsRouter: "0x5e7d61e4C52123ADF651961e4833aCc349b61491", + Timelock: zeroAddress, + + GlvReader: "0x4599Ed5939C673505B7AFcd020E1d603b0dCAf69", + GlvRouter: "0x377d979AB35Cd848497707ffa6Ee91783f925b80", + GlvVault: "0x76f93b5240DF811a3fc32bEDd58daA5784e46C96", + + OpenOceanRouter: zeroAddress, + + ExternalHandler: "0x0d9F90c66C392c4d0e70EE0d399c43729B942512", + + Multicall: "0x0f53e512b49202a37c81c6085417C9a9005F2196", + }, +}; + +export function getContract(chainId: number, name: string): Address { + if (!CONTRACTS[chainId]) { + throw new Error(`Unknown chainId ${chainId}`); + } + + if (!CONTRACTS[chainId][name]) { + throw new Error(`Unknown contract "${name}" for chainId ${chainId}`); + } + + return CONTRACTS[chainId][name]; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/dataStore.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/dataStore.ts new file mode 100644 index 0000000..b5edab1 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/dataStore.ts @@ -0,0 +1,358 @@ +import {hashData, hashString} from "../utils/hash.js"; + +export const POSITION_IMPACT_FACTOR_KEY = hashString("POSITION_IMPACT_FACTOR"); +export const MAX_POSITION_IMPACT_FACTOR_KEY = hashString("MAX_POSITION_IMPACT_FACTOR"); +export const POSITION_IMPACT_EXPONENT_FACTOR_KEY = hashString("POSITION_IMPACT_EXPONENT_FACTOR"); +export const POSITION_FEE_FACTOR_KEY = hashString("POSITION_FEE_FACTOR"); +export const SWAP_IMPACT_FACTOR_KEY = hashString("SWAP_IMPACT_FACTOR"); +export const SWAP_IMPACT_EXPONENT_FACTOR_KEY = hashString("SWAP_IMPACT_EXPONENT_FACTOR"); +export const SWAP_FEE_FACTOR_KEY = hashString("SWAP_FEE_FACTOR"); +export const FEE_RECEIVER_DEPOSIT_FACTOR_KEY = hashString("FEE_RECEIVER_DEPOSIT_FACTOR"); +export const BORROWING_FEE_RECEIVER_FACTOR_KEY = hashString("BORROWING_FEE_RECEIVER_FACTOR"); +export const FEE_RECEIVER_WITHDRAWAL_FACTOR_KEY = hashString("FEE_RECEIVER_WITHDRAWAL_FACTOR"); +export const FEE_RECEIVER_SWAP_FACTOR_KEY = hashString("FEE_RECEIVER_SWAP_FACTOR"); +export const FEE_RECEIVER_POSITION_FACTOR_KEY = hashString("FEE_RECEIVER_POSITION_FACTOR"); +export const OPEN_INTEREST_KEY = hashString("OPEN_INTEREST"); +export const OPEN_INTEREST_IN_TOKENS_KEY = hashString("OPEN_INTEREST_IN_TOKENS"); +export const POOL_AMOUNT_KEY = hashString("POOL_AMOUNT"); +export const MAX_POOL_USD_FOR_DEPOSIT_KEY = hashString("MAX_POOL_USD_FOR_DEPOSIT"); +export const MAX_POOL_AMOUNT_KEY = hashString("MAX_POOL_AMOUNT"); +export const RESERVE_FACTOR_KEY = hashString("RESERVE_FACTOR"); +export const OPEN_INTEREST_RESERVE_FACTOR_KEY = hashString("OPEN_INTEREST_RESERVE_FACTOR"); +export const MAX_OPEN_INTEREST_KEY = hashString("MAX_OPEN_INTEREST"); +export const NONCE_KEY = hashString("NONCE"); +export const BORROWING_FACTOR_KEY = hashString("BORROWING_FACTOR"); +export const BORROWING_EXPONENT_FACTOR_KEY = hashString("BORROWING_EXPONENT_FACTOR"); +export const CUMULATIVE_BORROWING_FACTOR_KEY = hashString("CUMULATIVE_BORROWING_FACTOR"); +export const TOTAL_BORROWING_KEY = hashString("TOTAL_BORROWING"); +export const FUNDING_FACTOR_KEY = hashString("FUNDING_FACTOR"); +export const FUNDING_EXPONENT_FACTOR_KEY = hashString("FUNDING_EXPONENT_FACTOR"); +export const FUNDING_INCREASE_FACTOR_PER_SECOND = hashString("FUNDING_INCREASE_FACTOR_PER_SECOND"); +export const FUNDING_DECREASE_FACTOR_PER_SECOND = hashString("FUNDING_DECREASE_FACTOR_PER_SECOND"); +export const MIN_FUNDING_FACTOR_PER_SECOND = hashString("MIN_FUNDING_FACTOR_PER_SECOND"); +export const MAX_FUNDING_FACTOR_PER_SECOND = hashString("MAX_FUNDING_FACTOR_PER_SECOND"); +export const THRESHOLD_FOR_STABLE_FUNDING = hashString("THRESHOLD_FOR_STABLE_FUNDING"); +export const THRESHOLD_FOR_DECREASE_FUNDING = hashString("THRESHOLD_FOR_DECREASE_FUNDING"); +export const MAX_PNL_FACTOR_KEY = hashString("MAX_PNL_FACTOR"); +export const MAX_PNL_FACTOR_FOR_WITHDRAWALS_KEY = hashString("MAX_PNL_FACTOR_FOR_WITHDRAWALS"); +export const MAX_PNL_FACTOR_FOR_DEPOSITS_KEY = hashString("MAX_PNL_FACTOR_FOR_DEPOSITS"); +export const MAX_PNL_FACTOR_FOR_TRADERS_KEY = hashString("MAX_PNL_FACTOR_FOR_TRADERS"); +export const MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY = hashString( + "MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS" +); +export const POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("POSITION_IMPACT_POOL_AMOUNT"); +export const MIN_POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("MIN_POSITION_IMPACT_POOL_AMOUNT"); +export const POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY = hashString("POSITION_IMPACT_POOL_DISTRIBUTION_RATE"); +export const SWAP_IMPACT_POOL_AMOUNT_KEY = hashString("SWAP_IMPACT_POOL_AMOUNT"); +export const MIN_COLLATERAL_USD_KEY = hashString("MIN_COLLATERAL_USD"); +export const MIN_COLLATERAL_FACTOR_KEY = hashString("MIN_COLLATERAL_FACTOR"); +export const MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY = hashString( + "MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER" +); +export const MIN_POSITION_SIZE_USD_KEY = hashString("MIN_POSITION_SIZE_USD"); +export const MAX_LEVERAGE_KEY = hashString("MAX_LEVERAGE"); +export const DEPOSIT_GAS_LIMIT_KEY = hashString("DEPOSIT_GAS_LIMIT"); +export const WITHDRAWAL_GAS_LIMIT_KEY = hashString("WITHDRAWAL_GAS_LIMIT"); +export const INCREASE_ORDER_GAS_LIMIT_KEY = hashString("INCREASE_ORDER_GAS_LIMIT"); +export const DECREASE_ORDER_GAS_LIMIT_KEY = hashString("DECREASE_ORDER_GAS_LIMIT"); +export const SWAP_ORDER_GAS_LIMIT_KEY = hashString("SWAP_ORDER_GAS_LIMIT"); +export const SHIFT_GAS_LIMIT_KEY = hashString("SHIFT_GAS_LIMIT"); +export const SINGLE_SWAP_GAS_LIMIT_KEY = hashString("SINGLE_SWAP_GAS_LIMIT"); +export const TOKEN_TRANSFER_GAS_LIMIT_KEY = hashString("TOKEN_TRANSFER_GAS_LIMIT"); +export const NATIVE_TOKEN_TRANSFER_GAS_LIMIT_KEY = hashString("NATIVE_TOKEN_TRANSFER_GAS_LIMIT"); +export const ESTIMATED_GAS_FEE_BASE_AMOUNT_V2_1 = hashString("ESTIMATED_GAS_FEE_BASE_AMOUNT_V2_1"); +export const ESTIMATED_GAS_FEE_PER_ORACLE_PRICE = hashString("ESTIMATED_GAS_FEE_PER_ORACLE_PRICE"); +export const ESTIMATED_GAS_FEE_MULTIPLIER_FACTOR = hashString("ESTIMATED_GAS_FEE_MULTIPLIER_FACTOR"); +export const MARKET_LIST_KEY = hashString("MARKET_LIST"); +export const POSITION_LIST_KEY = hashString("POSITION_LIST"); +export const ORDER_LIST_KEY = hashString("ORDER_LIST"); +export const ACCOUNT_ORDER_LIST_KEY = hashString("ACCOUNT_ORDER_LIST"); +export const CLAIMABLE_FUNDING_AMOUNT = hashString("CLAIMABLE_FUNDING_AMOUNT"); +export const VIRTUAL_TOKEN_ID_KEY = hashString("VIRTUAL_TOKEN_ID"); +export const VIRTUAL_MARKET_ID_KEY = hashString("VIRTUAL_MARKET_ID"); +export const VIRTUAL_INVENTORY_FOR_POSITIONS_KEY = hashString("VIRTUAL_INVENTORY_FOR_POSITIONS"); +export const VIRTUAL_INVENTORY_FOR_SWAPS_KEY = hashString("VIRTUAL_INVENTORY_FOR_SWAPS"); +export const POOL_AMOUNT_ADJUSTMENT_KEY = hashString("POOL_AMOUNT_ADJUSTMENT"); +export const AFFILIATE_REWARD_KEY = hashString("AFFILIATE_REWARD"); +export const IS_MARKET_DISABLED_KEY = hashString("IS_MARKET_DISABLED"); +export const UI_FEE_FACTOR = hashString("UI_FEE_FACTOR"); +export const SUBACCOUNT_LIST_KEY = hashString("SUBACCOUNT_LIST"); +export const MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT = hashString("MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT"); +export const SUBACCOUNT_ACTION_COUNT = hashString("SUBACCOUNT_ACTION_COUNT"); +export const SUBACCOUNT_ORDER_ACTION = hashString("SUBACCOUNT_ORDER_ACTION"); +export const SUBACCOUNT_AUTO_TOP_UP_AMOUNT = hashString("SUBACCOUNT_AUTO_TOP_UP_AMOUNT"); +export const GLV_MAX_MARKET_TOKEN_BALANCE_USD = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_USD"); +export const GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT"); +export const IS_GLV_MARKET_DISABLED = hashString("IS_GLV_MARKET_DISABLED"); +export const GLV_SHIFT_LAST_EXECUTED_AT = hashString("GLV_SHIFT_LAST_EXECUTED_AT"); +export const GLV_SHIFT_MIN_INTERVAL = hashString("GLV_SHIFT_MIN_INTERVAL"); +export const GLV_DEPOSIT_GAS_LIMIT = hashString("GLV_DEPOSIT_GAS_LIMIT"); +export const GLV_WITHDRAWAL_GAS_LIMIT = hashString("GLV_WITHDRAWAL_GAS_LIMIT"); +export const GLV_PER_MARKET_GAS_LIMIT = hashString("GLV_PER_MARKET_GAS_LIMIT"); +export const MAX_AUTO_CANCEL_ORDERS_KEY = hashString("MAX_AUTO_CANCEL_ORDERS"); +export const OPTIMAL_USAGE_FACTOR = hashString("OPTIMAL_USAGE_FACTOR"); +export const BASE_BORROWING_FACTOR = hashString("BASE_BORROWING_FACTOR"); +export const ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR = hashString("ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR"); + +export function glvShiftLastExecutedAtKey(glvAddress: string) { + return hashData(["bytes32", "address"], [GLV_SHIFT_LAST_EXECUTED_AT, glvAddress]); +} + +export function glvShiftMinIntervalKey(glvAddress: string) { + return hashData(["bytes32", "address"], [GLV_SHIFT_MIN_INTERVAL, glvAddress]); +} + +export function glvMaxMarketTokenBalanceUsdKey(glvAddress: string, market: string) { + return hashData(["bytes32", "address", "address"], [GLV_MAX_MARKET_TOKEN_BALANCE_USD, glvAddress, market]); +} + +export function glvMaxMarketTokenBalanceAmountKey(glvAddress: string, market: string) { + return hashData(["bytes32", "address", "address"], [GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT, glvAddress, market]); +} + +export function isGlvDisabledKey(glvAddress: string, market: string) { + return hashData(["bytes32", "address", "address"], [IS_GLV_MARKET_DISABLED, glvAddress, market]); +} + +export function positionImpactFactorKey(market: string, isPositive: boolean) { + return hashData(["bytes32", "address", "bool"], [POSITION_IMPACT_FACTOR_KEY, market, isPositive]); +} + +export function positionImpactExponentFactorKey(market: string) { + return hashData(["bytes32", "address"], [POSITION_IMPACT_EXPONENT_FACTOR_KEY, market]); +} + +export function maxPositionImpactFactorKey(market: string, isPositive: boolean) { + return hashData(["bytes32", "address", "bool"], [MAX_POSITION_IMPACT_FACTOR_KEY, market, isPositive]); +} + +export function positionFeeFactorKey(market: string, forPositiveImpact: boolean) { + return hashData(["bytes32", "address", "bool"], [POSITION_FEE_FACTOR_KEY, market, forPositiveImpact]); +} + +export function swapImpactFactorKey(market: string, isPositive: boolean) { + return hashData(["bytes32", "address", "bool"], [SWAP_IMPACT_FACTOR_KEY, market, isPositive]); +} + +export function swapImpactExponentFactorKey(market: string) { + return hashData(["bytes32", "address"], [SWAP_IMPACT_EXPONENT_FACTOR_KEY, market]); +} + +export function swapFeeFactorKey(market: string, forPositiveImpact: boolean) { + return hashData(["bytes32", "address", "bool"], [SWAP_FEE_FACTOR_KEY, market, forPositiveImpact]); +} + +export function openInterestKey(market: string, collateralToken: string, isLong: boolean) { + return hashData(["bytes32", "address", "address", "bool"], [OPEN_INTEREST_KEY, market, collateralToken, isLong]); +} + +export function openInterestInTokensKey(market: string, collateralToken: string, isLong: boolean) { + return hashData( + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_IN_TOKENS_KEY, market, collateralToken, isLong] + ); +} + +export function poolAmountKey(market: string, token: string) { + return hashData(["bytes32", "address", "address"], [POOL_AMOUNT_KEY, market, token]); +} + +export function reserveFactorKey(market: string, isLong: boolean) { + return hashData(["bytes32", "address", "bool"], [RESERVE_FACTOR_KEY, market, isLong]); +} + +export function openInterestReserveFactorKey(market: string, isLong: boolean) { + return hashData(["bytes32", "address", "bool"], [OPEN_INTEREST_RESERVE_FACTOR_KEY, market, isLong]); +} + +export function maxOpenInterestKey(market: string, isLong: boolean) { + return hashData(["bytes32", "address", "bool"], [MAX_OPEN_INTEREST_KEY, market, isLong]); +} + +export function borrowingFactorKey(market: string, isLong: boolean) { + return hashData(["bytes32", "address", "bool"], [BORROWING_FACTOR_KEY, market, isLong]); +} + +export function borrowingExponentFactorKey(market: string, isLong: boolean) { + return hashData(["bytes32", "address", "bool"], [BORROWING_EXPONENT_FACTOR_KEY, market, isLong]); +} + +export function cumulativeBorrowingFactorKey(market: string, isLong: boolean) { + return hashData(["bytes32", "address", "bool"], [CUMULATIVE_BORROWING_FACTOR_KEY, market, isLong]); +} + +export function totalBorrowingKey(market: string, isLong: boolean) { + return hashData(["bytes32", "address", "bool"], [TOTAL_BORROWING_KEY, market, isLong]); +} + +export function fundingFactorKey(market: string) { + return hashData(["bytes32", "address"], [FUNDING_FACTOR_KEY, market]); +} + +export function fundingExponentFactorKey(market: string) { + return hashData(["bytes32", "address"], [FUNDING_EXPONENT_FACTOR_KEY, market]); +} + +export function fundingIncreaseFactorPerSecondKey(market: string) { + return hashData(["bytes32", "address"], [FUNDING_INCREASE_FACTOR_PER_SECOND, market]); +} + +export function fundingDecreaseFactorPerSecondKey(market: string) { + return hashData(["bytes32", "address"], [FUNDING_DECREASE_FACTOR_PER_SECOND, market]); +} + +export function minFundingFactorPerSecondKey(market: string) { + return hashData(["bytes32", "address"], [MIN_FUNDING_FACTOR_PER_SECOND, market]); +} + +export function maxFundingFactorPerSecondKey(market: string) { + return hashData(["bytes32", "address"], [MAX_FUNDING_FACTOR_PER_SECOND, market]); +} + +export function thresholdForStableFundingKey(market: string) { + return hashData(["bytes32", "address"], [THRESHOLD_FOR_STABLE_FUNDING, market]); +} + +export function thresholdForDecreaseFundingKey(market: string) { + return hashData(["bytes32", "address"], [THRESHOLD_FOR_DECREASE_FUNDING, market]); +} + +export function maxPnlFactorKey(pnlFactorType: string, market: string, isLong: boolean) { + return hashData(["bytes32", "bytes32", "address", "bool"], [MAX_PNL_FACTOR_KEY, pnlFactorType, market, isLong]); +} + +export function positionImpactPoolAmountKey(market: string) { + return hashData(["bytes32", "address"], [POSITION_IMPACT_POOL_AMOUNT_KEY, market]); +} + +export function minPositionImpactPoolAmountKey(market: string) { + return hashData(["bytes32", "address"], [MIN_POSITION_IMPACT_POOL_AMOUNT_KEY, market]); +} + +export function positionImpactPoolDistributionRateKey(market: string) { + return hashData(["bytes32", "address"], [POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY, market]); +} + +export function maxPositionImpactFactorForLiquidationsKey(market: string) { + return hashData(["bytes32", "address"], [MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY, market]); +} + +export function swapImpactPoolAmountKey(market: string, token: string) { + return hashData(["bytes32", "address", "address"], [SWAP_IMPACT_POOL_AMOUNT_KEY, market, token]); +} + +export function orderKey(dataStoreAddress: string, nonce: bigint) { + return hashData(["address", "uint256"], [dataStoreAddress, nonce]); +} + +export function depositGasLimitKey() { + return DEPOSIT_GAS_LIMIT_KEY; +} + +export function withdrawalGasLimitKey() { + return hashData(["bytes32"], [WITHDRAWAL_GAS_LIMIT_KEY]); +} + +export function shiftGasLimitKey() { + return SHIFT_GAS_LIMIT_KEY; +} + +export function singleSwapGasLimitKey() { + return SINGLE_SWAP_GAS_LIMIT_KEY; +} + +export function increaseOrderGasLimitKey() { + return INCREASE_ORDER_GAS_LIMIT_KEY; +} + +export function decreaseOrderGasLimitKey() { + return DECREASE_ORDER_GAS_LIMIT_KEY; +} + +export function swapOrderGasLimitKey() { + return SWAP_ORDER_GAS_LIMIT_KEY; +} + +export function accountOrderListKey(account: string) { + return hashData(["bytes32", "address"], [ACCOUNT_ORDER_LIST_KEY, account]); +} + +export function minCollateralFactorKey(market: string) { + return hashData(["bytes32", "address"], [MIN_COLLATERAL_FACTOR_KEY, market]); +} + +export function minCollateralFactorForOpenInterest(market: string, isLong: boolean) { + return hashData( + ["bytes32", "address", "bool"], + [MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY, market, isLong] + ); +} + +export function hashedPositionKey(account: string, market: string, collateralToken: string, isLong: boolean) { + return hashData(["address", "address", "address", "bool"], [account, market, collateralToken, isLong]); +} + +export function claimableFundingAmountKey(market: string, token: string, account: string) { + return hashData(["bytes32", "address", "address", "address"], [CLAIMABLE_FUNDING_AMOUNT, market, token, account]); +} +export function virtualTokenIdKey(token: string) { + return hashData(["bytes32", "address"], [VIRTUAL_TOKEN_ID_KEY, token]); +} + +export function virtualMarketIdKey(market: string) { + return hashData(["bytes32", "address"], [VIRTUAL_MARKET_ID_KEY, market]); +} + +export function virtualInventoryForSwapsKey(virtualMarketId: string, token: string) { + return hashData(["bytes32", "bytes32", "address"], [VIRTUAL_INVENTORY_FOR_SWAPS_KEY, virtualMarketId, token]); +} + +export function virtualInventoryForPositionsKey(virtualTokenId: string) { + return hashData(["bytes32", "bytes32"], [VIRTUAL_INVENTORY_FOR_POSITIONS_KEY, virtualTokenId]); +} + +export function poolAmountAdjustmentKey(market: string, token: string) { + return hashData(["bytes32", "address", "address"], [POOL_AMOUNT_ADJUSTMENT_KEY, market, token]); +} + +export function affiliateRewardKey(market: string, token: string, account: string) { + return hashData(["bytes32", "address", "address", "address"], [AFFILIATE_REWARD_KEY, market, token, account]); +} + +export function isMarketDisabledKey(market: string) { + return hashData(["bytes32", "address"], [IS_MARKET_DISABLED_KEY, market]); +} + +export function maxPoolUsdForDepositKey(market: string, token: string) { + return hashData(["bytes32", "address", "address"], [MAX_POOL_USD_FOR_DEPOSIT_KEY, market, token]); +} + +export function maxPoolAmountKey(market: string, token: string) { + return hashData(["bytes32", "address", "address"], [MAX_POOL_AMOUNT_KEY, market, token]); +} + +export function uiFeeFactorKey(address: string) { + return hashData(["bytes32", "address"], [UI_FEE_FACTOR, address]); +} + +export function subaccountListKey(account: string) { + return hashData(["bytes32", "address"], [SUBACCOUNT_LIST_KEY, account]); +} + +export function maxAllowedSubaccountActionCountKey(account: string, subaccount: string, actionType: string) { + return hashData( + ["bytes32", "address", "address", "bytes32"], + [MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT, account, subaccount, actionType] + ); +} + +export function subaccountActionCountKey(account: string, subaccount: string, actionType: string) { + return hashData( + ["bytes32", "address", "address", "bytes32"], + [SUBACCOUNT_ACTION_COUNT, account, subaccount, actionType] + ); +} + +export function subaccountAutoTopUpAmountKey(account: string, subaccount: string) { + return hashData(["bytes32", "address", "address"], [SUBACCOUNT_AUTO_TOP_UP_AMOUNT, account, subaccount]); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/factors.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/factors.ts new file mode 100644 index 0000000..9459da2 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/factors.ts @@ -0,0 +1,13 @@ +export const USD_DECIMALS = 30; + +export const BASIS_POINTS_DIVISOR = 10000; +export const BASIS_POINTS_DIVISOR_BIGINT = 10000n; + +// V2 +export const HIGH_PRICE_IMPACT_BPS = 80; // 0.8% +export const HIGH_POSITION_IMPACT_BPS = 50; // 0.5% +export const HIGH_COLLATERAL_IMPACT_BPS = 500; // 5% +export const HIGH_SWAP_IMPACT_BPS = 50; // 0.5% +export const DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER = 30; // 0.3% +export const HIGH_ALLOWED_SWAP_SLIPPAGE_BPS = 20; // 0.2% +export const DEFAULT_ALLOWED_SWAP_SLIPPAGE_BPS = 100n; // 1% diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/markets.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/markets.ts new file mode 100644 index 0000000..6b524c6 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/markets.ts @@ -0,0 +1,846 @@ +/* + This files is used to pre-build data during the build process. + Avoid adding client-side code here, as it can break the build process. +*/ +import {ARBITRUM, AVALANCHE, AVALANCHE_FUJI} from "./chains.js"; + +export const SWAP_GRAPH_MAX_MARKETS_PER_TOKEN = 5; + +export type MarketConfig = { + marketTokenAddress: string; + indexTokenAddress: string; + longTokenAddress: string; + shortTokenAddress: string; +}; + +/* + ATTENTION + When adding new markets, please add them also to the end of the list in ./src/configs/static/sortedMarkets.ts +*/ +export const MARKETS: Record> = { + [ARBITRUM]: { + // BTC/USD [WBTC.e-USDC] + "0x47c031236e19d024b42f8AE6780E44A573170703": { + marketTokenAddress: "0x47c031236e19d024b42f8AE6780E44A573170703", + indexTokenAddress: "0x47904963fc8b2340414262125aF798B9655E58Cd", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ETH/USD [WETH-USDC] + "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336": { + marketTokenAddress: "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336", + indexTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // DOGE/USD [WETH-USDC] + "0x6853EA96FF216fAb11D2d930CE3C508556A4bdc4": { + marketTokenAddress: "0x6853EA96FF216fAb11D2d930CE3C508556A4bdc4", + indexTokenAddress: "0xC4da4c24fd591125c3F47b340b6f4f76111883d8", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // SOL/USD [SOL-USDC] + "0x09400D9DB990D5ed3f35D7be61DfAEB900Af03C9": { + marketTokenAddress: "0x09400D9DB990D5ed3f35D7be61DfAEB900Af03C9", + indexTokenAddress: "0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07", + longTokenAddress: "0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // LTC/USD [WETH-USDC] + "0xD9535bB5f58A1a75032416F2dFe7880C30575a41": { + marketTokenAddress: "0xD9535bB5f58A1a75032416F2dFe7880C30575a41", + indexTokenAddress: "0xB46A094Bc4B0adBD801E14b9DB95e05E28962764", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // UNI/USD [UNI-USDC] + "0xc7Abb2C5f3BF3CEB389dF0Eecd6120D451170B50": { + marketTokenAddress: "0xc7Abb2C5f3BF3CEB389dF0Eecd6120D451170B50", + indexTokenAddress: "0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0", + longTokenAddress: "0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // LINK/USD [LINK-USDC] + "0x7f1fa204bb700853D36994DA19F830b6Ad18455C": { + marketTokenAddress: "0x7f1fa204bb700853D36994DA19F830b6Ad18455C", + indexTokenAddress: "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + longTokenAddress: "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ARB/USD [ARB-USDC] + "0xC25cEf6061Cf5dE5eb761b50E4743c1F5D7E5407": { + marketTokenAddress: "0xC25cEf6061Cf5dE5eb761b50E4743c1F5D7E5407", + indexTokenAddress: "0x912CE59144191C1204E64559FE8253a0e49E6548", + longTokenAddress: "0x912CE59144191C1204E64559FE8253a0e49E6548", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // SWAP-ONLY [USDC-USDC.e] + "0x9C2433dFD71096C435Be9465220BB2B189375eA7": { + marketTokenAddress: "0x9C2433dFD71096C435Be9465220BB2B189375eA7", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + shortTokenAddress: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + }, + // SWAP-ONLY [USDC-USDT] + "0xB686BcB112660343E6d15BDb65297e110C8311c4": { + marketTokenAddress: "0xB686BcB112660343E6d15BDb65297e110C8311c4", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + shortTokenAddress: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + }, + // SWAP-ONLY [USDC-DAI] + "0xe2fEDb9e6139a182B98e7C2688ccFa3e9A53c665": { + marketTokenAddress: "0xe2fEDb9e6139a182B98e7C2688ccFa3e9A53c665", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + shortTokenAddress: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", + }, + // XRP/USD [WETH-USDC] + "0x0CCB4fAa6f1F1B30911619f1184082aB4E25813c": { + marketTokenAddress: "0x0CCB4fAa6f1F1B30911619f1184082aB4E25813c", + indexTokenAddress: "0xc14e065b0067dE91534e032868f5Ac6ecf2c6868", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // BNB/USD [BNB-USDC] + "0x2d340912Aa47e33c90Efb078e69E70EFe2B34b9B": { + marketTokenAddress: "0x2d340912Aa47e33c90Efb078e69E70EFe2B34b9B", + indexTokenAddress: "0xa9004A5421372E1D83fB1f85b0fc986c912f91f3", + longTokenAddress: "0xa9004A5421372E1D83fB1f85b0fc986c912f91f3", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // AAVE [AAVE-USDC] + "0x1CbBa6346F110c8A5ea739ef2d1eb182990e4EB2": { + marketTokenAddress: "0x1CbBa6346F110c8A5ea739ef2d1eb182990e4EB2", + indexTokenAddress: "0xba5DdD1f9d7F570dc94a51479a000E3BCE967196", + longTokenAddress: "0xba5DdD1f9d7F570dc94a51479a000E3BCE967196", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ATOM [WETH-USDC] + "0x248C35760068cE009a13076D573ed3497A47bCD4": { + marketTokenAddress: "0x248C35760068cE009a13076D573ed3497A47bCD4", + indexTokenAddress: "0x7D7F1765aCbaF847b9A1f7137FE8Ed4931FbfEbA", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // NEAR [WETH-USDC] + "0x63Dc80EE90F26363B3FCD609007CC9e14c8991BE": { + marketTokenAddress: "0x63Dc80EE90F26363B3FCD609007CC9e14c8991BE", + indexTokenAddress: "0x1FF7F3EFBb9481Cbd7db4F932cBCD4467144237C", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // AVAX [WAVAX-USDC] + "0x7BbBf946883a5701350007320F525c5379B8178A": { + marketTokenAddress: "0x7BbBf946883a5701350007320F525c5379B8178A", + indexTokenAddress: "0x565609fAF65B92F7be02468acF86f8979423e514", + longTokenAddress: "0x565609fAF65B92F7be02468acF86f8979423e514", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // OP [OP-USDC] + "0x4fDd333FF9cA409df583f306B6F5a7fFdE790739": { + marketTokenAddress: "0x4fDd333FF9cA409df583f306B6F5a7fFdE790739", + indexTokenAddress: "0xaC800FD6159c2a2CB8fC31EF74621eB430287a5A", + longTokenAddress: "0xaC800FD6159c2a2CB8fC31EF74621eB430287a5A", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // BTC/USD [WBTC.e-WBTC.e] + "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77": { + marketTokenAddress: "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77", + indexTokenAddress: "0x47904963fc8b2340414262125aF798B9655E58Cd", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + }, + // ETH/USD [WETH-WETH] + "0x450bb6774Dd8a756274E0ab4107953259d2ac541": { + marketTokenAddress: "0x450bb6774Dd8a756274E0ab4107953259d2ac541", + indexTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + }, + // GMX/USD [GMX-USDC] + "0x55391D178Ce46e7AC8eaAEa50A72D1A5a8A622Da": { + marketTokenAddress: "0x55391D178Ce46e7AC8eaAEa50A72D1A5a8A622Da", + indexTokenAddress: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", + longTokenAddress: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // PEPE [PEPE-USDC] + "0x2b477989A149B17073D9C9C82eC9cB03591e20c6": { + marketTokenAddress: "0x2b477989A149B17073D9C9C82eC9cB03591e20c6", + indexTokenAddress: "0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00", + longTokenAddress: "0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // WIF [WIF-USDC] + "0x0418643F94Ef14917f1345cE5C460C37dE463ef7": { + marketTokenAddress: "0x0418643F94Ef14917f1345cE5C460C37dE463ef7", + indexTokenAddress: "0xA1b91fe9FD52141Ff8cac388Ce3F10BFDc1dE79d", + longTokenAddress: "0xA1b91fe9FD52141Ff8cac388Ce3F10BFDc1dE79d", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ETH/USD [wstETH-USDe] + "0x0Cf1fb4d1FF67A3D8Ca92c9d6643F8F9be8e03E5": { + marketTokenAddress: "0x0Cf1fb4d1FF67A3D8Ca92c9d6643F8F9be8e03E5", + indexTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + longTokenAddress: "0x5979D7b546E38E414F7E9822514be443A4800529", + shortTokenAddress: "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34", + }, + // SWAP-ONLY [wstETH-WETH] + "0xb56E5E2eB50cf5383342914b0C85Fe62DbD861C8": { + marketTokenAddress: "0xb56E5E2eB50cf5383342914b0C85Fe62DbD861C8", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0x5979D7b546E38E414F7E9822514be443A4800529", + shortTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + }, + // SWAP-ONLY [USDe-USDC] + "0x45aD16Aaa28fb66Ef74d5ca0Ab9751F2817c81a4": { + marketTokenAddress: "0x45aD16Aaa28fb66Ef74d5ca0Ab9751F2817c81a4", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // SHIB/USD [WETH-USDC] + "0xB62369752D8Ad08392572db6d0cc872127888beD": { + marketTokenAddress: "0xB62369752D8Ad08392572db6d0cc872127888beD", + indexTokenAddress: "0x3E57D02f9d196873e55727382974b02EdebE6bfd", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // STX/USD [wBTC-USDC] + "0xD9377d9B9a2327C7778867203deeA73AB8a68b6B": { + marketTokenAddress: "0xD9377d9B9a2327C7778867203deeA73AB8a68b6B", + indexTokenAddress: "0xBaf07cF91D413C0aCB2b7444B9Bf13b4e03c9D71", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ORDI/USD [wBTC-USDC] + "0x93385F7C646A3048051914BDFaC25F4d620aeDF1": { + marketTokenAddress: "0x93385F7C646A3048051914BDFaC25F4d620aeDF1", + indexTokenAddress: "0x1E15d08f3CA46853B692EE28AE9C7a0b88a9c994", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // BTC/USD [tBTC] + "0xd62068697bCc92AF253225676D618B0C9f17C663": { + marketTokenAddress: "0xd62068697bCc92AF253225676D618B0C9f17C663", + indexTokenAddress: "0x47904963fc8b2340414262125aF798B9655E58Cd", + longTokenAddress: "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + shortTokenAddress: "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + }, + // EIGEN/USD [WETH-USDC] + "0xD4b737892baB8446Ea1e8Bb901db092fb1EC1791": { + marketTokenAddress: "0xD4b737892baB8446Ea1e8Bb901db092fb1EC1791", + indexTokenAddress: "0x606C3e5075e5555e79Aa15F1E9FACB776F96C248", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // SATS/USD [WBTC-USDC] + "0x8ea4Fb801493DaD8724F90Fb2e279534fa591366": { + marketTokenAddress: "0x8ea4Fb801493DaD8724F90Fb2e279534fa591366", + indexTokenAddress: "0x2cD2eB61D17b78239Fcd19aafF72981B5D5eF319", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // POL/USD [ETH-USDC] + "0xD0a1AFDDE31Eb51e8b53bdCE989EB8C2404828a4": { + marketTokenAddress: "0xD0a1AFDDE31Eb51e8b53bdCE989EB8C2404828a4", + indexTokenAddress: "0x9c74772b713a1B032aEB173E28683D937E51921c", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // AAVE/USD [ETH-USDC] + "0x77B2eC357b56c7d05a87971dB0188DBb0C7836a5": { + marketTokenAddress: "0x77B2eC357b56c7d05a87971dB0188DBb0C7836a5", + indexTokenAddress: "0xba5DdD1f9d7F570dc94a51479a000E3BCE967196", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // PEPE/USD [ETH-USDC] + "0x0Bb2a83F995E1E1eae9D7fDCE68Ab1ac55b2cc85": { + marketTokenAddress: "0x0Bb2a83F995E1E1eae9D7fDCE68Ab1ac55b2cc85", + indexTokenAddress: "0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // UNI/USD [ETH-USDC] + "0xD8471b9Ea126272E6d32B5e4782Ed76DB7E554a4": { + marketTokenAddress: "0xD8471b9Ea126272E6d32B5e4782Ed76DB7E554a4", + indexTokenAddress: "0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // APE/USD [APE-USDC] + "0xdAB21c4d1F569486334C93685Da2b3F9b0A078e8": { + marketTokenAddress: "0xdAB21c4d1F569486334C93685Da2b3F9b0A078e8", + indexTokenAddress: "0x7f9FBf9bDd3F4105C478b996B648FE6e828a1e98", + longTokenAddress: "0x7f9FBf9bDd3F4105C478b996B648FE6e828a1e98", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // SUI/USD [WETH-USDC] + "0x6Ecf2133E2C9751cAAdCb6958b9654baE198a797": { + marketTokenAddress: "0x6Ecf2133E2C9751cAAdCb6958b9654baE198a797", + indexTokenAddress: "0x197aa2DE1313c7AD50184234490E12409B2a1f95", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // SEI/USD [WETH-USDC] + "0xB489711B1cB86afDA48924730084e23310EB4883": { + marketTokenAddress: "0xB489711B1cB86afDA48924730084e23310EB4883", + indexTokenAddress: "0x55e85A147a1029b985384822c0B2262dF8023452", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // APT/USD [WETH-USDC] + "0x66A69c8eb98A7efE22A22611d1967dfec786a708": { + marketTokenAddress: "0x66A69c8eb98A7efE22A22611d1967dfec786a708", + indexTokenAddress: "0x3f8f0dCE4dCE4d0D1d0871941e79CDA82cA50d0B", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // TIA/USD [WETH-USDC] + "0xBeB1f4EBC9af627Ca1E5a75981CE1AE97eFeDA22": { + marketTokenAddress: "0xBeB1f4EBC9af627Ca1E5a75981CE1AE97eFeDA22", + indexTokenAddress: "0x38676f62d166f5CE7De8433F51c6B3D6D9d66C19", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // TRX/USD [WETH-USDC] + "0x3680D7bFE9260D3c5DE81AEB2194c119a59A99D1": { + marketTokenAddress: "0x3680D7bFE9260D3c5DE81AEB2194c119a59A99D1", + indexTokenAddress: "0xb06aa7E4af937C130dDade66f6ed7642716fe07A", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // TON/USD [WETH-USDC] + "0x15c6eBD4175ffF9EE3c2615c556fCf62D2d9499c": { + marketTokenAddress: "0x15c6eBD4175ffF9EE3c2615c556fCf62D2d9499c", + indexTokenAddress: "0xB2f7cefaeEb08Aa347705ac829a7b8bE2FB560f3", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // WLD/USD [WETH-USDC] + "0x872b5D567a2469Ed92D252eaCB0EB3BB0769e05b": { + marketTokenAddress: "0x872b5D567a2469Ed92D252eaCB0EB3BB0769e05b", + indexTokenAddress: "0x75B9AdD873641b253718810E6c65dB6d72311FD0", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // BONK/USD [WETH-USDC] + "0xFaC5fF56c269432706d47DC82Ab082E9AE7D989E": { + marketTokenAddress: "0xFaC5fF56c269432706d47DC82Ab082E9AE7D989E", + indexTokenAddress: "0x1FD10E767187A92f0AB2ABDEEF4505e319cA06B2", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // TAO/USD [WBTC-USDC] + "0xe55e1A29985488A2c8846a91E925c2B7C6564db1": { + marketTokenAddress: "0xe55e1A29985488A2c8846a91E925c2B7C6564db1", + indexTokenAddress: "0x938aef36CAaFbcB37815251B602168087eC14648", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // BOME/USD [WBTC/USDC] + "0x71237F8C3d1484495A136022E16840b70fF84a69": { + marketTokenAddress: "0x71237F8C3d1484495A136022E16840b70fF84a69", + indexTokenAddress: "0x3Eea56A1ccCdbfB70A26aD381C71Ee17E4c8A15F", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // FLOKI/USD [WBTC/USDC] + "0xfD46a5702D4d97cE0164375744c65F0c31A3901b": { + marketTokenAddress: "0xfD46a5702D4d97cE0164375744c65F0c31A3901b", + indexTokenAddress: "0x6792c5B8962ffbDD020c6b6FD0Be7b182e0e33a3", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // MEME/USD [WBTC/USDC] + "0x6CB901Cc64c024C3Fe4404c940FF9a3Acc229D2C": { + marketTokenAddress: "0x6CB901Cc64c024C3Fe4404c940FF9a3Acc229D2C", + indexTokenAddress: "0xaF770F03518686a365300ab35AD860e99967B2f0", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // MEW/USD [WBTC/USDC] + "0x71B7fF592a974e2B501D8A7a11f5c42DcD365244": { + marketTokenAddress: "0x71B7fF592a974e2B501D8A7a11f5c42DcD365244", + indexTokenAddress: "0x5503CF72f54b6d692d36BBCD391516A7dE068687", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // GMX [GMX] + "0xbD48149673724f9cAeE647bb4e9D9dDaF896Efeb": { + marketTokenAddress: "0xbD48149673724f9cAeE647bb4e9D9dDaF896Efeb", + indexTokenAddress: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", + longTokenAddress: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", + shortTokenAddress: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", + }, + // PENDLE/USD [PENDLE/USDC] + "0x784292E87715d93afD7cb8C941BacaFAAA9A5102": { + marketTokenAddress: "0x784292E87715d93afD7cb8C941BacaFAAA9A5102", + indexTokenAddress: "0x0c880f6761F1af8d9Aa9C466984b80DAb9a8c9e8", + longTokenAddress: "0x0c880f6761F1af8d9Aa9C466984b80DAb9a8c9e8", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ADA/USD [WBTC/USDC] + "0xcaCb964144f9056A8f99447a303E60b4873Ca9B4": { + marketTokenAddress: "0xcaCb964144f9056A8f99447a303E60b4873Ca9B4", + indexTokenAddress: "0x53186c8419BEB83fE4Da74F7875041a1287337ED", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // BCH/USD [WBTC/USDC] + "0x62feB8Ec060A7dE5b32BbbF4AC70050f8a043C17": { + marketTokenAddress: "0x62feB8Ec060A7dE5b32BbbF4AC70050f8a043C17", + indexTokenAddress: "0xc33D9C096e74aa4f571E9417b69a19C4A1e72ef2", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // DOT/USD [WBTC/USDC] + "0x7B2D09fca2395713dcc2F67323e4876F27b9ecB2": { + marketTokenAddress: "0x7B2D09fca2395713dcc2F67323e4876F27b9ecB2", + indexTokenAddress: "0xE958f107b467d5172573F761d26931D658C1b436", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ICP/USD [WBTC/USDC] + "0xdc4e96A251Ff43Eeac710462CD8A9D18Dc802F18": { + marketTokenAddress: "0xdc4e96A251Ff43Eeac710462CD8A9D18Dc802F18", + indexTokenAddress: "0xdaf0A71608938F762e37eC5F72F670Cc44703454", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // XLM/USD [WBTC/USDC] + "0xe902D1526c834D5001575b2d0Ef901dfD0aa097A": { + marketTokenAddress: "0xe902D1526c834D5001575b2d0Ef901dfD0aa097A", + indexTokenAddress: "0xc5dbD52Ae5a927Cf585B884011d0C7631C9974c6", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // RENDER/USD [WETH/USDC] + "0x4c505e0062459cf8F60FfF13279c92ea15aE6e2D": { + marketTokenAddress: "0x4c505e0062459cf8F60FfF13279c92ea15aE6e2D", + indexTokenAddress: "0x82BB89fcc64c5d4016C5Ed1AB016bB0D1C20D6C3", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // SOL/USD [SOL] + "0xf22CFFA7B4174554FF9dBf7B5A8c01FaaDceA722": { + marketTokenAddress: "0xf22CFFA7B4174554FF9dBf7B5A8c01FaaDceA722", + indexTokenAddress: "0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07", + longTokenAddress: "0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07", + shortTokenAddress: "0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07", + }, + // FIL/USD [WBTC/USDC] + "0x262B5203f0fe00D9fe86ffecE01D0f54fC116180": { + marketTokenAddress: "0x262B5203f0fe00D9fe86ffecE01D0f54fC116180", + indexTokenAddress: "0x3AeBb98f57081DcBEb0B8EA823Cf84900A31e5D8", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // DYDX/USD [WBTC-USDC] + "0x467C4A46287F6C4918dDF780D4fd7b46419c2291": { + marketTokenAddress: "0x467C4A46287F6C4918dDF780D4fd7b46419c2291", + indexTokenAddress: "0x0739Ad7AeA69aD36EdEb91b0e55cAC140427c632", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // INJ/USD [WBTC-USDC] + "0x16466a03449CB9218EB6A980Aa4a44aaCEd27C25": { + marketTokenAddress: "0x16466a03449CB9218EB6A980Aa4a44aaCEd27C25", + indexTokenAddress: "0xfdE73EddbE6c5712A12B72c470F8FE5c77A7fF17", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // TRUMP/USD [ETH-USDC] + "0xFec8f404FBCa3b11aFD3b3f0c57507C2a06dE636": { + marketTokenAddress: "0xFec8f404FBCa3b11aFD3b3f0c57507C2a06dE636", + indexTokenAddress: "0x30021aFA4767Ad66aA52A06dF8a5AB3acA9371fD", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // MELANIA/USD [WETH-USDC] + "0x12fD1A4BdB96219E637180Ff5293409502b2951D": { + marketTokenAddress: "0x12fD1A4BdB96219E637180Ff5293409502b2951D", + indexTokenAddress: "0xfa4F8E582214eBCe1A08eB2a65e08082053E441F", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ENA/USD [WETH-USDC] + "0x9F159014CC218e942E9E9481742fE5BFa9ac5A2C": { + marketTokenAddress: "0x9F159014CC218e942E9E9481742fE5BFa9ac5A2C", + indexTokenAddress: "0xfe1Aac2CD9C5cC77b58EeCfE75981866ed0c8b7a", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // AI16Z/USD [WBTC.e-USDC] + "0xD60f1BA6a76979eFfE706BF090372Ebc0A5bF169": { + marketTokenAddress: "0xD60f1BA6a76979eFfE706BF090372Ebc0A5bF169", + indexTokenAddress: "0xBb69bd9dc152C2c0F083507641a46193d2B61EBb", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ANIME/USD [ANIME-USDC] + "0x5707673D95a8fD317e2745C4217aCD64ca021B68": { + marketTokenAddress: "0x5707673D95a8fD317e2745C4217aCD64ca021B68", + indexTokenAddress: "0x37a645648dF29205C6261289983FB04ECD70b4B3", + longTokenAddress: "0x37a645648dF29205C6261289983FB04ECD70b4B3", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // FARTCOIN/USD [WBTC.e-USDC] + "0xe2730Ffe2136aA549327EBce93D58160df7821CB": { + marketTokenAddress: "0xe2730Ffe2136aA549327EBce93D58160df7821CB", + indexTokenAddress: "0xaca341E61aB6177B0b0Df46a612e4311F8a7605f", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // BERA/USD [WETH-USDC] + "0x876Ff160d63809674e03f82DC4D3C3Ae8B0acF28": { + marketTokenAddress: "0x876Ff160d63809674e03f82DC4D3C3Ae8B0acF28", + indexTokenAddress: "0x67ADABbAd211eA9b3B4E2fd0FD165E593De1e983", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // LDO/USD [WETH-USDC] + "0xE61e608Ba010fF48A7dcE8eDd8B906744263d33E": { + marketTokenAddress: "0xE61e608Ba010fF48A7dcE8eDd8B906744263d33E", + indexTokenAddress: "0x9D678B4Dd38a6E01df8090aEB7974aD71142b05f", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // VIRTUAL/USD [WBTC-USDC] + "0x75F190E0Be6E8B933A01423EFE398c6C721A5CfF": { + marketTokenAddress: "0x75F190E0Be6E8B933A01423EFE398c6C721A5CfF", + indexTokenAddress: "0xB6672496214C90134A9223894e709F26A5eED362", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // PENGU/USD [WBTC-USDC] + "0x0c11Ed89889Fd03394E8d9d685cC5b85be569C99": { + marketTokenAddress: "0x0c11Ed89889Fd03394E8d9d685cC5b85be569C99", + indexTokenAddress: "0x4C1dac9b6eAf122Fe3DE824c1C2220413F3aC197", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // ONDO/USD [WETH-USDC] + "0xa8A455Ed94b315460CfF7d96966d91330f6A3bA0": { + marketTokenAddress: "0xa8A455Ed94b315460CfF7d96966d91330f6A3bA0", + indexTokenAddress: "0xEcFB4718aD19b626A77491895a2f99ea0cedEd08", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // FET/USD [WETH-USDC] + "0x970e578fF01589Bb470CE38a2f1753152A009366": { + marketTokenAddress: "0x970e578fF01589Bb470CE38a2f1753152A009366", + indexTokenAddress: "0x83D5944E7f5EF1d8432002d3cb062e1012f6F8e6", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // AIXBT/USD [WETH-USDC] + "0x04DecfB37e46075189324817df80a32D22b9eD8D": { + marketTokenAddress: "0x04DecfB37e46075189324817df80a32D22b9eD8D", + indexTokenAddress: "0xcA543Cb8bCC76e4E0A034F56EB40a1029bDFd70E", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // S/USD [WBTC-USDC] + "0x4d9bA415649c4B3c703562770C8ff3033478Cea1": { + marketTokenAddress: "0x4d9bA415649c4B3c703562770C8ff3033478Cea1", + indexTokenAddress: "0x8F6cCb99d4Fd0B4095915147b5ae3bbDb8075394", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // CAKE/USD [WBTC-USDC] + "0xdE967676db7b1ccdBA2bD94B01B5b19DE4b563e4": { + marketTokenAddress: "0xdE967676db7b1ccdBA2bD94B01B5b19DE4b563e4", + indexTokenAddress: "0x580b373Ac16803BB0133356F470f3c7EEF54151B", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // HYPE/USD [WBTC-USDC] + "0xBcb8FE13d02b023e8f94f6881Cc0192fd918A5C0": { + marketTokenAddress: "0xBcb8FE13d02b023e8f94f6881Cc0192fd918A5C0", + indexTokenAddress: "0xfDFA0A749dA3bCcee20aE0B4AD50E39B26F58f7C", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // JUP/USD [WBTC-USDC] + "0x7DE8E1A1fbA845A330A6bD91118AfDA09610fB02": { + marketTokenAddress: "0x7DE8E1A1fbA845A330A6bD91118AfDA09610fB02", + indexTokenAddress: "0xfEd500Df379427Fbc48BDaf3b511b519c7eCCD26", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // MKR/USD [WETH-USDC] + "0x2aE5c5Cd4843cf588AA8D1289894318130acc823": { + marketTokenAddress: "0x2aE5c5Cd4843cf588AA8D1289894318130acc823", + indexTokenAddress: "0x8904De84c3bB3B7D2383F934Af40FcB3Ef82F28b", + longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + // OM/USD [WBTC-USDC] + "0x89EB78679921499632fF16B1be3ee48295cfCD91": { + marketTokenAddress: "0x89EB78679921499632fF16B1be3ee48295cfCD91", + indexTokenAddress: "0x1f3407Ea067DfBDF6dEb6bBFdA4869215fB0ab77", + longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + }, + [AVALANCHE]: { + // BTC/USD [BTC-USDC] + "0xFb02132333A79C8B5Bd0b64E3AbccA5f7fAf2937": { + marketTokenAddress: "0xFb02132333A79C8B5Bd0b64E3AbccA5f7fAf2937", + indexTokenAddress: "0x152b9d0FdC40C096757F570A51E494bd4b943E50", + longTokenAddress: "0x152b9d0FdC40C096757F570A51E494bd4b943E50", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // ETH/USD [ETH-USDC] + "0xB7e69749E3d2EDd90ea59A4932EFEa2D41E245d7": { + marketTokenAddress: "0xB7e69749E3d2EDd90ea59A4932EFEa2D41E245d7", + indexTokenAddress: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + longTokenAddress: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // DOGE/USD [WAVAX-USDC] + "0x8970B527E84aA17a33d38b65e9a5Ab5817FC0027": { + marketTokenAddress: "0x8970B527E84aA17a33d38b65e9a5Ab5817FC0027", + indexTokenAddress: "0xC301E6fe31062C557aEE806cc6A841aE989A3ac6", + longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // SOL/USD [SOL-USDC] + "0xd2eFd1eA687CD78c41ac262B3Bc9B53889ff1F70": { + marketTokenAddress: "0xd2eFd1eA687CD78c41ac262B3Bc9B53889ff1F70", + indexTokenAddress: "0xFE6B19286885a4F7F55AdAD09C3Cd1f906D2478F", + longTokenAddress: "0xFE6B19286885a4F7F55AdAD09C3Cd1f906D2478F", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // LTC/USD [WAVAX-USDC] + "0xA74586743249243D3b77335E15FE768bA8E1Ec5A": { + marketTokenAddress: "0xA74586743249243D3b77335E15FE768bA8E1Ec5A", + indexTokenAddress: "0x8E9C35235C38C44b5a53B56A41eaf6dB9a430cD6", + longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // AVAX/USD [WAVAX-USDC] + "0x913C1F46b48b3eD35E7dc3Cf754d4ae8499F31CF": { + marketTokenAddress: "0x913C1F46b48b3eD35E7dc3Cf754d4ae8499F31CF", + indexTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // SWAP-ONLY [USDC-USDT.e] + "0xf3652Eba45DC761e7ADd4091627d5Cda21F61613": { + marketTokenAddress: "0xf3652Eba45DC761e7ADd4091627d5Cda21F61613", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + shortTokenAddress: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + }, + // SWAP-ONLY [USDC-USDC.e] + "0x297e71A931C5825867E8Fb937Ae5cda9891C2E99": { + marketTokenAddress: "0x297e71A931C5825867E8Fb937Ae5cda9891C2E99", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + shortTokenAddress: "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + }, + // SWAP-ONLY [USDT-USDT.e] + "0xA7b768d6a1f746fd5a513D440DF2970ff099B0fc": { + marketTokenAddress: "0xA7b768d6a1f746fd5a513D440DF2970ff099B0fc", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", + shortTokenAddress: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + }, + // SWAP-ONLY [USDC-DAI.e] + "0xDf8c9BD26e7C1A331902758Eb013548B2D22ab3b": { + marketTokenAddress: "0xDf8c9BD26e7C1A331902758Eb013548B2D22ab3b", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + shortTokenAddress: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70", + }, + // XRP/USD [WAVAX-USDC] + "0xD1cf931fa12783c1dd5AbB77a0706c27CF352f25": { + marketTokenAddress: "0xD1cf931fa12783c1dd5AbB77a0706c27CF352f25", + indexTokenAddress: "0x34B2885D617cE2ddeD4F60cCB49809fc17bb58Af", + longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // BTC/USD [BTC-BTC] + "0x3ce7BCDB37Bf587d1C17B930Fa0A7000A0648D12": { + marketTokenAddress: "0x3ce7BCDB37Bf587d1C17B930Fa0A7000A0648D12", + indexTokenAddress: "0x152b9d0FdC40C096757F570A51E494bd4b943E50", + longTokenAddress: "0x152b9d0FdC40C096757F570A51E494bd4b943E50", + shortTokenAddress: "0x152b9d0FdC40C096757F570A51E494bd4b943E50", + }, + // ETH/USD [ETH-ETH] + "0x2A3Cf4ad7db715DF994393e4482D6f1e58a1b533": { + marketTokenAddress: "0x2A3Cf4ad7db715DF994393e4482D6f1e58a1b533", + indexTokenAddress: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + longTokenAddress: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + shortTokenAddress: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + }, + // AVAX/USD [AVAX-AVAX] + "0x08b25A2a89036d298D6dB8A74ace9d1ce6Db15E5": { + marketTokenAddress: "0x08b25A2a89036d298D6dB8A74ace9d1ce6Db15E5", + indexTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + shortTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + }, + // TRUMP/USD [WAVAX-USDC] + "0xfB626c4e3E153947A6A94041814c25E449064dAD": { + marketTokenAddress: "0xfB626c4e3E153947A6A94041814c25E449064dAD", + indexTokenAddress: "0x2f6d7be53fab5538065a226BA091015d422a7528", + longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + // MELANIA/USD [WAVAX-USDC] + "0xe19da27Bf9733c429445E289B662bECDCa6ce10b": { + marketTokenAddress: "0xe19da27Bf9733c429445E289B662bECDCa6ce10b", + indexTokenAddress: "0xd42C991a4FAb293C57a7bf25C2E2ec5aE1dB1714", + longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }, + }, + [AVALANCHE_FUJI]: { + // AVAX/USD [WAVAX-USDC] + "0xD996ff47A1F763E1e55415BC4437c59292D1F415": { + marketTokenAddress: "0xD996ff47A1F763E1e55415BC4437c59292D1F415", + indexTokenAddress: "0x1D308089a2D1Ced3f1Ce36B1FcaF815b07217be3", + longTokenAddress: "0x1D308089a2D1Ced3f1Ce36B1FcaF815b07217be3", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // ETH/USD [ETH-USDC] + "0xbf338a6C595f06B7Cfff2FA8c958d49201466374": { + marketTokenAddress: "0xbf338a6C595f06B7Cfff2FA8c958d49201466374", + indexTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // ETH/USD [ETH-DAI] + "0xDdF708B284C5C26BE67Adf9C51DFa935b5035bF8": { + marketTokenAddress: "0xDdF708B284C5C26BE67Adf9C51DFa935b5035bF8", + indexTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // ETH/USD [USDC] + "0xe28323955C05B75E25B56C1c996C1354Eb5Aa13D": { + marketTokenAddress: "0xe28323955C05B75E25B56C1c996C1354Eb5Aa13D", + indexTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + longTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // WBTC/USD [WBTC-USDC] + "0x79E6e0E454dE82fA98c02dB012a2A69103630B07": { + marketTokenAddress: "0x79E6e0E454dE82fA98c02dB012a2A69103630B07", + indexTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + longTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // WBTC/USD [WBTC-DAI] + "0x4b6ccF6E429f038087A26b13DD6ab4304F7E5DF1": { + marketTokenAddress: "0x4b6ccF6E429f038087A26b13DD6ab4304F7E5DF1", + indexTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + longTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // SOL/USD [ETH-USDC] + "0xEDF9Be35bE84cD1e39Bda59Bd7ae8A704C12e06f": { + marketTokenAddress: "0xEDF9Be35bE84cD1e39Bda59Bd7ae8A704C12e06f", + indexTokenAddress: "0x137f4a7336df4f3f11894718528516edaaD0B082", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // SWAP-ONLY [USDC-USDT] + "0xeE8827D67C054cAa89C9d6058Fdddccd1C499c74": { + marketTokenAddress: "0xeE8827D67C054cAa89C9d6058Fdddccd1C499c74", + indexTokenAddress: "0x0000000000000000000000000000000000000000", + longTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + shortTokenAddress: "0x50df4892Bd13f01E4e1Cd077ff394A8fa1A3fD7c", + }, + // DOGE/USD [ETH-DAI] + "0xAC2c6C1b0cd1CabF78B4e8ad58aA9d43375318Cb": { + marketTokenAddress: "0xAC2c6C1b0cd1CabF78B4e8ad58aA9d43375318Cb", + indexTokenAddress: "0x2265F317eA5f47A684E5B26c50948617c945d986", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // LINK/USD [ETH-DAI] + "0xeDf53322e288F597436f5d5849771662AEe16A1C": { + marketTokenAddress: "0xeDf53322e288F597436f5d5849771662AEe16A1C", + indexTokenAddress: "0x6BD09E8D65AD5cc761DF62454452d4EC1545e647", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // BNB/USD [ETH-DAI] + "0x017de90B0fa830C592805C6148c089191716f04c": { + marketTokenAddress: "0x017de90B0fa830C592805C6148c089191716f04c", + indexTokenAddress: "0x110892Dd5fa73bE430c0ade694febD9a4CAc68Be", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // ADA/USD [ETH-DAI] + "0x695a07d3DD551b0E77A348cC6A873c1eb183FA98": { + marketTokenAddress: "0x695a07d3DD551b0E77A348cC6A873c1eb183FA98", + indexTokenAddress: "0xE64dfFF37Fa6Fe969b792B4146cEe2774Ef6e1a1", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // TRX/USD [ETH-DAI] + "0x927f31364b8836021e4F73B27a5d0EbB35C74679": { + marketTokenAddress: "0x927f31364b8836021e4F73B27a5d0EbB35C74679", + indexTokenAddress: "0x0D1495527C255068F2f6feE31C85d326D0A76FE8", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // MATIC/USD [ETH-USDC] + "0x62408de4cB1a499842EC53296EF8dD99A825CcEb": { + marketTokenAddress: "0x62408de4cB1a499842EC53296EF8dD99A825CcEb", + indexTokenAddress: "0xadc4698B257F78187Fd675FBf591a09f4c975240", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // DOT/USD [ETH-USDC] + "0xCc6AC193E1d1Ef102eCBBA864BBfE87E414a7A0D": { + marketTokenAddress: "0xCc6AC193E1d1Ef102eCBBA864BBfE87E414a7A0D", + indexTokenAddress: "0x65FFb5664a7B3377A5a27D9e59C72Fb1A5E94962", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // UNI/USD [ETH-USDC] + "0xE446E8f7074c0A97bb7cd448fA2CC3346045F514": { + marketTokenAddress: "0xE446E8f7074c0A97bb7cd448fA2CC3346045F514", + indexTokenAddress: "0xF62dC1d2452d0893735D22945Af53C290b158eAF", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // TEST/USD [ETH-USDC] + "0x1d9dC405CCEFA78b203BaD9CCe1b1623D2B25D9e": { + marketTokenAddress: "0x1d9dC405CCEFA78b203BaD9CCe1b1623D2B25D9e", + indexTokenAddress: "0x42DD131E1086FFCc59bAE9498D71E20E0C889B14", + longTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + shortTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + // WBTC/USD [USDC-USDT] + "0xd783EB54407d6d3A4D5c94b634eC9BAE3F574098": { + marketTokenAddress: "0xd783EB54407d6d3A4D5c94b634eC9BAE3F574098", + indexTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + longTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + shortTokenAddress: "0x50df4892Bd13f01E4e1Cd077ff394A8fa1A3fD7c", + }, + // ETH/USD [USDC-DAI] + "0x6d72D2787107c32a48bbA4687Eb8F9C19FE5e29C": { + marketTokenAddress: "0x6d72D2787107c32a48bbA4687Eb8F9C19FE5e29C", + indexTokenAddress: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + longTokenAddress: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + shortTokenAddress: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + // WBTC/USD [WBTC] + "0x3b649015Fe0a4d15617e57aA11c0FbbfA03A9e11": { + marketTokenAddress: "0x3b649015Fe0a4d15617e57aA11c0FbbfA03A9e11", + indexTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + longTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + shortTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + }, + }, +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/tokens.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/tokens.ts new file mode 100644 index 0000000..5e72f37 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/tokens.ts @@ -0,0 +1,1671 @@ +import { zeroAddress } from "viem"; + + +import {ARBITRUM, AVALANCHE, AVALANCHE_FUJI} from "./chains.js"; +import {getContract} from "./contracts.js"; +import {Token, TokenCategory} from "../types/tokens.js"; + +export const NATIVE_TOKEN_ADDRESS = zeroAddress; + +export const TOKENS: { [chainId: number]: Token[] } = { + [ARBITRUM]: [ + { + name: "Ethereum", + symbol: "ETH", + decimals: 18, + address: zeroAddress, + isNative: true, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png?1595348880", + coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum", + isV1Available: true, + }, + { + name: "Wrapped Ethereum", + symbol: "WETH", + decimals: 18, + address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + isWrapped: true, + baseSymbol: "ETH", + imageUrl: "https://assets.coingecko.com/coins/images/2518/thumb/weth.png?1628852295", + coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum", + isV1Available: true, + }, + { + name: "Wrapped Bitcoin", + symbol: "BTC", + assetSymbol: "WBTC", + baseSymbol: "BTC", + decimals: 8, + address: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/26115/thumb/btcb.png?1655921693", + coingeckoUrl: "https://www.coingecko.com/en/coins/wrapped-bitcoin", + explorerUrl: "https://arbiscan.io/address/0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", + isV1Available: true, + }, + { + name: "Arbitrum", + symbol: "ARB", + decimals: 18, + priceDecimals: 4, + address: "0x912CE59144191C1204E64559FE8253a0e49E6548", + categories: ["layer2", "defi"], + imageUrl: "https://assets.coingecko.com/coins/images/16547/small/photo_2023-03-29_21.47.00.jpeg?1680097630", + coingeckoUrl: "https://www.coingecko.com/en/coins/arbitrum", + explorerUrl: "https://arbiscan.io/token/0x912ce59144191c1204e64559fe8253a0e49e6548", + }, + { + name: "Wrapped SOL (Wormhole)", + symbol: "SOL", + assetSymbol: "WSOL (Wormhole)", + priceDecimals: 3, + decimals: 9, + address: "0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/4128/small/solana.png?1640133422", + coingeckoUrl: "https://www.coingecko.com/en/coins/solana", + coingeckoSymbol: "SOL", + explorerUrl: "https://arbiscan.io/token/0x2bCc6D6CdBbDC0a4071e48bb3B969b06B3330c07", + explorerSymbol: "SOL", + }, + { + name: "Chainlink", + symbol: "LINK", + decimals: 18, + priceDecimals: 4, + address: "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + isStable: false, + isShortable: true, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/877/thumb/chainlink-new-logo.png?1547034700", + coingeckoUrl: "https://www.coingecko.com/en/coins/chainlink", + explorerUrl: "https://arbiscan.io/token/0xf97f4df75117a78c1a5a0dbb814af92458539fb4", + isV1Available: true, + }, + { + name: "Uniswap", + symbol: "UNI", + decimals: 18, + priceDecimals: 4, + address: "0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0", + isStable: false, + isShortable: true, + categories: ["layer2", "defi"], + imageUrl: "https://assets.coingecko.com/coins/images/12504/thumb/uniswap-uni.png?1600306604", + coingeckoUrl: "https://www.coingecko.com/en/coins/uniswap", + explorerUrl: "https://arbiscan.io/token/0xfa7f8980b0f1e64a2062791cc3b0871572f1f7f0", + isV1Available: true, + }, + { + name: "Bridged USDC (USDC.e)", + symbol: "USDC.E", + decimals: 6, + address: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389", + coingeckoUrl: "https://www.coingecko.com/en/coins/bridged-usdc-arbitrum", + explorerUrl: "https://arbiscan.io/token/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + isV1Available: true, + }, + { + name: "USD Coin", + symbol: "USDC", + decimals: 6, + address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + isStable: true, + isV1Available: true, + imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389", + coingeckoUrl: "https://www.coingecko.com/en/coins/usd-coin", + explorerUrl: "https://arbiscan.io/address/0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + }, + { + name: "Tether", + symbol: "USDT", + decimals: 6, + address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/325/thumb/Tether-logo.png?1598003707", + explorerUrl: "https://arbiscan.io/address/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + coingeckoUrl: "https://www.coingecko.com/en/coins/tether", + isV1Available: true, + }, + { + name: "Dai", + symbol: "DAI", + decimals: 18, + address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/9956/thumb/4943.png?1636636734", + coingeckoUrl: "https://www.coingecko.com/en/coins/dai", + explorerUrl: "https://arbiscan.io/token/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", + isV1Available: true, + }, + { + name: "Frax", + symbol: "FRAX", + decimals: 18, + address: "0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F", + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/13422/small/frax_logo.png?1608476506", + coingeckoUrl: "https://www.coingecko.com/en/coins/frax", + explorerUrl: "https://arbiscan.io/token/0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F", + isV1Available: true, + }, + { + name: "Magic Internet Money", + symbol: "MIM", + decimals: 18, + address: "0xFEa7a6a0B346362BF88A9e4A88416B77a57D6c2A", + isStable: true, + isTempHidden: true, + imageUrl: "https://assets.coingecko.com/coins/images/16786/small/mimlogopng.png", + isV1Available: true, + }, + { + name: "Bitcoin", + symbol: "BTC", + address: "0x47904963fc8b2340414262125aF798B9655E58Cd", + isSynthetic: true, + decimals: 8, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/1/small/bitcoin.png?1547033579", + coingeckoUrl: "https://www.coingecko.com/en/coins/bitcoin", + }, + { + name: "Dogecoin", + symbol: "DOGE", + decimals: 8, + priceDecimals: 5, + address: "0xC4da4c24fd591125c3F47b340b6f4f76111883d8", + isSynthetic: true, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/5/small/dogecoin.png?1547792256", + coingeckoUrl: "https://www.coingecko.com/en/coins/dogecoin", + }, + { + name: "Litecoin", + symbol: "LTC", + decimals: 8, + priceDecimals: 3, + address: "0xB46A094Bc4B0adBD801E14b9DB95e05E28962764", + isSynthetic: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/2/small/litecoin.png?1547033580", + coingeckoUrl: "https://www.coingecko.com/en/coins/litecoin", + }, + { + name: "XRP", + symbol: "XRP", + decimals: 6, + priceDecimals: 4, + address: "0xc14e065b0067dE91534e032868f5Ac6ecf2c6868", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/44/small/xrp-symbol-white-128.png?1605778731", + coingeckoUrl: "https://www.coingecko.com/en/coins/xrp", + isSynthetic: true, + }, + { + name: "GMX", + symbol: "GMX", + address: getContract(ARBITRUM, "GMX"), + decimals: 18, + isPlatformToken: true, + isPlatformTradingToken: true, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/18323/small/arbit.png?1631532468", + coingeckoUrl: "https://www.coingecko.com/en/coins/gmx", + explorerUrl: "https://arbiscan.io/address/0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a", + }, + { + name: "Escrowed GMX", + symbol: "ESGMX", + address: getContract(ARBITRUM, "ES_GMX"), + decimals: 18, + isPlatformToken: true, + }, + { + name: "Wrapped BNB (LayerZero)", + symbol: "BNB", + assetSymbol: "WBNB (LayerZero)", + address: "0xa9004A5421372E1D83fB1f85b0fc986c912f91f3", + decimals: 18, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/825/standard/bnb-icon2_2x.png?1696501970", + coingeckoUrl: "https://www.coingecko.com/en/coins/bnb", + coingeckoSymbol: "BNB", + metamaskSymbol: "WBNB", + explorerUrl: "https://arbiscan.io/token/0xa9004A5421372E1D83fB1f85b0fc986c912f91f3", + explorerSymbol: "WBNB", + }, + { + name: "Cosmos", + symbol: "ATOM", + assetSymbol: "ATOM", + priceDecimals: 4, + address: "0x7D7F1765aCbaF847b9A1f7137FE8Ed4931FbfEbA", + decimals: 6, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/1481/standard/cosmos_hub.png?1696502525", + coingeckoUrl: "https://www.coingecko.com/en/coins/cosmos-hub", + coingeckoSymbol: "ATOM", + isSynthetic: true, + }, + { + name: "Near", + symbol: "NEAR", + assetSymbol: "NEAR", + priceDecimals: 4, + address: "0x1FF7F3EFBb9481Cbd7db4F932cBCD4467144237C", + decimals: 24, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/10365/standard/near.jpg?1696510367", + coingeckoUrl: "https://www.coingecko.com/en/coins/near", + coingeckoSymbol: "NEAR", + isSynthetic: true, + }, + { + name: "Aave", + symbol: "AAVE", + assetSymbol: "AAVE", + priceDecimals: 3, + address: "0xba5DdD1f9d7F570dc94a51479a000E3BCE967196", + decimals: 18, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/12645/standard/AAVE.png?1696512452", + coingeckoUrl: "https://www.coingecko.com/en/coins/aave", + coingeckoSymbol: "AAVE", + }, + { + name: "Wrapped AVAX (Wormhole)", + symbol: "AVAX", + assetSymbol: "WAVAX (Wormhole)", + priceDecimals: 4, + address: "0x565609fAF65B92F7be02468acF86f8979423e514", + decimals: 18, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/12559/small/coin-round-red.png?1604021818", + coingeckoUrl: "https://www.coingecko.com/en/coins/avalanche", + coingeckoSymbol: "AVAX", + explorerSymbol: "WAVAX", + }, + { + name: "Optimism", + symbol: "OP", + priceDecimals: 4, + address: "0xaC800FD6159c2a2CB8fC31EF74621eB430287a5A", + decimals: 18, + categories: ["layer2"], + imageUrl: "https://assets.coingecko.com/coins/images/25244/standard/Optimism.png?1696524385", + coingeckoUrl: "https://www.coingecko.com/en/coins/optimism", + }, + { + name: "Pepe", + symbol: "PEPE", + address: "0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00", + decimals: 18, + priceDecimals: 8, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776", + coingeckoUrl: "https://www.coingecko.com/en/coins/pepe", + visualMultiplier: 1000, + visualPrefix: "k", + }, + { + name: "dogwifhat", + symbol: "WIF", + address: "0xA1b91fe9FD52141Ff8cac388Ce3F10BFDc1dE79d", + decimals: 6, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/33566/standard/dogwifhat.jpg?1702499428", + coingeckoUrl: "https://www.coingecko.com/en/coins/dogwifhat", + }, + { + name: "ORDI", + symbol: "ORDI", + address: "0x1E15d08f3CA46853B692EE28AE9C7a0b88a9c994", + decimals: 18, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/30162/standard/ordi.png?1696529082", + coingeckoUrl: "https://www.coingecko.com/en/coins/ordi", + isSynthetic: true, + }, + { + name: "Stacks", + symbol: "STX", + address: "0xBaf07cF91D413C0aCB2b7444B9Bf13b4e03c9D71", + decimals: 6, + categories: ["layer2"], + imageUrl: "https://assets.coingecko.com/coins/images/2069/standard/Stacks_Logo_png.png?1709979332", + coingeckoUrl: "https://www.coingecko.com/en/coins/stacks", + isSynthetic: true, + }, + { + name: "Ethena USDe", + symbol: "USDE", + address: "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34", + decimals: 18, + imageUrl: "https://assets.coingecko.com/coins/images/33613/standard/USDE.png?1716355685", + coingeckoUrl: "https://www.coingecko.com/en/coins/ethena-usde", + isStable: true, + }, + { + name: "Wrapped stETH", + symbol: "WSTETH", + address: "0x5979D7b546E38E414F7E9822514be443A4800529", + decimals: 18, + imageUrl: "https://assets.coingecko.com/coins/images/18834/standard/wstETH.png?1696518295", + coingeckoUrl: "https://www.coingecko.com/en/coins/wrapped-steth", + }, + { + name: "Shiba Inu", + symbol: "SHIB", + assetSymbol: "SHIB", + address: "0x3E57D02f9d196873e55727382974b02EdebE6bfd", + decimals: 18, + priceDecimals: 9, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/11939/standard/shiba.png?1696511800", + coingeckoUrl: "https://www.coingecko.com/en/coins/shiba-inu", + isSynthetic: true, + visualMultiplier: 1000, + visualPrefix: "k", + }, + { + name: "tBTC", + symbol: "TBTC", + address: "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + decimals: 18, + imageUrl: + "https://assets.coingecko.com/coins/images/11224/standard/0x18084fba666a33d37592fa2633fd49a74dd93a88.png?1696511155", + coingeckoUrl: "https://www.coingecko.com/en/coins/tbtc", + }, + { + name: "Eigen", + symbol: "EIGEN", + address: "0x606C3e5075e5555e79Aa15F1E9FACB776F96C248", + decimals: 18, + categories: ["layer2"], + imageUrl: "https://assets.coingecko.com/coins/images/37441/standard/eigen.jpg?1728023974", + coingeckoUrl: "https://www.coingecko.com/en/coins/eigenlayer", + }, + { + name: "Sats", + symbol: "SATS", + address: "0x2cD2eB61D17b78239Fcd19aafF72981B5D5eF319", + decimals: 6, + priceDecimals: 11, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/30666/standard/_dD8qr3M_400x400.png?1702913020", + coingeckoUrl: "https://www.coingecko.com/en/coins/sats-ordinals", + isSynthetic: true, + visualMultiplier: 1000_000, + visualPrefix: "m", + }, + { + name: "Polygon", + symbol: "POL", + decimals: 18, + priceDecimals: 5, + address: "0x9c74772b713a1B032aEB173E28683D937E51921c", + categories: ["layer1", "layer2"], + imageUrl: "https://assets.coingecko.com/coins/images/32440/standard/polygon.png?1698233684", + coingeckoUrl: "https://www.coingecko.com/en/coins/polygon", + isSynthetic: true, + }, + { + name: "APE", + symbol: "APE", + address: "0x7f9FBf9bDd3F4105C478b996B648FE6e828a1e98", + decimals: 18, + priceDecimals: 4, + imageUrl: "https://assets.coingecko.com/coins/images/24383/standard/apecoin.jpg?1696523566", + coingeckoUrl: "https://www.coingecko.com/en/coins/apecoin", + }, + { + name: "SUI", + symbol: "SUI", + address: "0x197aa2DE1313c7AD50184234490E12409B2a1f95", + decimals: 9, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/26375/standard/sui-ocean-square.png?1727791290", + coingeckoUrl: "https://www.coingecko.com/en/coins/sui", + isSynthetic: true, + }, + { + name: "SEI", + symbol: "SEI", + address: "0x55e85A147a1029b985384822c0B2262dF8023452", + decimals: 18, + priceDecimals: 5, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png?1696527207", + coingeckoUrl: "https://www.coingecko.com/en/coins/sei", + isSynthetic: true, + }, + { + name: "APT", + symbol: "APT", + address: "0x3f8f0dCE4dCE4d0D1d0871941e79CDA82cA50d0B", + decimals: 8, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/26455/standard/aptos_round.png?1696525528", + coingeckoUrl: "https://www.coingecko.com/en/coins/aptos", + isSynthetic: true, + }, + { + name: "TIA", + symbol: "TIA", + address: "0x38676f62d166f5CE7De8433F51c6B3D6D9d66C19", + decimals: 6, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/31967/standard/tia.jpg?1696530772", + coingeckoUrl: "https://www.coingecko.com/en/coins/celestia", + isSynthetic: true, + }, + { + name: "TRON", + symbol: "TRX", + address: "0xb06aa7E4af937C130dDade66f6ed7642716fe07A", + decimals: 6, + priceDecimals: 5, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/1094/standard/tron-logo.png?1696502193", + coingeckoUrl: "https://www.coingecko.com/en/coins/tron", + isSynthetic: true, + }, + { + name: "TON", + symbol: "TON", + address: "0xB2f7cefaeEb08Aa347705ac829a7b8bE2FB560f3", + decimals: 9, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/17980/standard/photo_2024-09-10_17.09.00.jpeg?1725963446", + coingeckoUrl: "https://www.coingecko.com/en/coins/toncoin", + isSynthetic: true, + }, + { + name: "WLD", + symbol: "WLD", + address: "0x75B9AdD873641b253718810E6c65dB6d72311FD0", + decimals: 18, + priceDecimals: 4, + imageUrl: "https://assets.coingecko.com/coins/images/31069/standard/worldcoin.jpeg?1696529903", + coingeckoUrl: "https://www.coingecko.com/en/coins/worldcoin", + isSynthetic: true, + }, + { + name: "BONK", + symbol: "BONK", + address: "0x1FD10E767187A92f0AB2ABDEEF4505e319cA06B2", + decimals: 5, + priceDecimals: 9, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/28600/standard/bonk.jpg?1696527587", + coingeckoUrl: "https://www.coingecko.com/en/coins/bonk", + isSynthetic: true, + visualMultiplier: 1000, + visualPrefix: "k", + }, + { + name: "TAO", + symbol: "TAO", + address: "0x938aef36CAaFbcB37815251B602168087eC14648", + decimals: 9, + priceDecimals: 3, + imageUrl: "https://assets.coingecko.com/coins/images/28452/standard/ARUsPeNQ_400x400.jpeg?1696527447", + coingeckoUrl: "https://www.coingecko.com/en/coins/bittensor", + isSynthetic: true, + }, + { + name: "BOME", + symbol: "BOME", + address: "0x3Eea56A1ccCdbfB70A26aD381C71Ee17E4c8A15F", + decimals: 6, + priceDecimals: 6, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/36071/standard/bome.png?1710407255", + coingeckoUrl: "https://www.coingecko.com/en/coins/book-of-meme", + isSynthetic: true, + }, + { + name: "FLOKI", + symbol: "FLOKI", + address: "0x6792c5B8962ffbDD020c6b6FD0Be7b182e0e33a3", + decimals: 9, + priceDecimals: 8, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/16746/standard/PNG_image.png?1696516318", + coingeckoUrl: "https://www.coingecko.com/en/coins/floki", + isSynthetic: true, + visualMultiplier: 1000, + visualPrefix: "k", + }, + { + name: "MEME", + symbol: "MEME", + address: "0xaF770F03518686a365300ab35AD860e99967B2f0", + decimals: 18, + priceDecimals: 6, + imageUrl: "https://assets.coingecko.com/coins/images/32528/standard/memecoin_%282%29.png?1698912168", + coingeckoUrl: "https://www.coingecko.com/en/coins/meme", + isSynthetic: true, + }, + { + name: "MEW", + symbol: "MEW", + address: "0x5503CF72f54b6d692d36BBCD391516A7dE068687", + decimals: 5, + priceDecimals: 7, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/36440/standard/MEW.png?1711442286", + coingeckoUrl: "https://www.coingecko.com/en/coins/mew", + isSynthetic: true, + }, + { + name: "PENDLE", + symbol: "PENDLE", + address: "0x0c880f6761F1af8d9Aa9C466984b80DAb9a8c9e8", + decimals: 18, + priceDecimals: 4, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/15069/standard/Pendle_Logo_Normal-03.png?1696514728", + coingeckoUrl: "https://www.coingecko.com/en/coins/pendle", + }, + { + name: "ADA", + symbol: "ADA", + address: "0x53186c8419BEB83fE4Da74F7875041a1287337ED", + decimals: 6, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/975/standard/cardano.png?1696502090", + coingeckoUrl: "https://www.coingecko.com/en/coins/cardano", + isSynthetic: true, + }, + { + name: "BCH", + symbol: "BCH", + address: "0xc33D9C096e74aa4f571E9417b69a19C4A1e72ef2", + decimals: 8, + priceDecimals: 3, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/780/standard/bitcoin-cash-circle.png?1696501932", + coingeckoUrl: "https://www.coingecko.com/en/coins/bitcoin-cash", + isSynthetic: true, + }, + { + name: "DOT", + symbol: "DOT", + address: "0xE958f107b467d5172573F761d26931D658C1b436", + decimals: 10, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: + "https://static.coingecko.com/s/polkadot-73b0c058cae10a2f076a82dcade5cbe38601fad05d5e6211188f09eb96fa4617.gif", + coingeckoUrl: "https://www.coingecko.com/en/coins/polkadot", + isSynthetic: true, + }, + { + name: "ICP", + symbol: "ICP", + address: "0xdaf0A71608938F762e37eC5F72F670Cc44703454", + decimals: 8, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/14495/standard/Internet_Computer_logo.png?1696514180", + coingeckoUrl: "https://www.coingecko.com/en/coins/internet-computer", + isSynthetic: true, + }, + { + name: "XLM", + symbol: "XLM", + address: "0xc5dbD52Ae5a927Cf585B884011d0C7631C9974c6", + decimals: 7, + priceDecimals: 5, + imageUrl: "https://assets.coingecko.com/coins/images/100/standard/Stellar_symbol_black_RGB.png?1696501482", + coingeckoUrl: "https://www.coingecko.com/en/coins/stellar", + isSynthetic: true, + }, + { + name: "RENDER", + symbol: "RENDER", + address: "0x82BB89fcc64c5d4016C5Ed1AB016bB0D1C20D6C3", + decimals: 18, + priceDecimals: 4, + imageUrl: "https://assets.coingecko.com/coins/images/11636/standard/rndr.png?1696511529", + coingeckoUrl: "https://www.coingecko.com/en/coins/render", + isSynthetic: true, + }, + { + name: "Filecoin", + symbol: "FIL", + address: "0x3AeBb98f57081DcBEb0B8EA823Cf84900A31e5D8", + decimals: 18, + categories: ["layer1"], + priceDecimals: 4, + imageUrl: "https://assets.coingecko.com/coins/images/12817/standard/filecoin.png?1696512609", + coingeckoUrl: "https://www.coingecko.com/en/coins/filecoin", + isSynthetic: true, + }, + { + name: "dYdX", + symbol: "DYDX", + address: "0x0739Ad7AeA69aD36EdEb91b0e55cAC140427c632", + decimals: 18, + priceDecimals: 4, + categories: ["layer1", "defi"], + imageUrl: "https://assets.coingecko.com/coins/images/32594/standard/dydx.png?1698673495", + coingeckoUrl: "https://www.coingecko.com/en/coins/dydx-chain", + isSynthetic: true, + }, + { + name: "Injective", + symbol: "INJ", + address: "0xfdE73EddbE6c5712A12B72c470F8FE5c77A7fF17", + decimals: 18, + priceDecimals: 4, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/12882/standard/Secondary_Symbol.png?1696512670", + coingeckoUrl: "https://www.coingecko.com/en/coins/injective", + isSynthetic: true, + }, + { + name: "Official Trump", + symbol: "TRUMP", + address: "0x30021aFA4767Ad66aA52A06dF8a5AB3acA9371fD", + decimals: 6, + priceDecimals: 4, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/53746/standard/trump.png?1737171561", + coingeckoUrl: "https://www.coingecko.com/en/coins/official-trump", + isSynthetic: true, + }, + { + name: "Melania Meme", + symbol: "MELANIA", + address: "0xfa4F8E582214eBCe1A08eB2a65e08082053E441F", + decimals: 6, + priceDecimals: 4, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/53775/standard/melania-meme.png?1737329885", + coingeckoUrl: "https://www.coingecko.com/en/coins/melania-meme", + isSynthetic: true, + }, + { + name: "Ethena Governance Token", + symbol: "ENA", + address: "0xfe1Aac2CD9C5cC77b58EeCfE75981866ed0c8b7a", + decimals: 18, + priceDecimals: 4, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/36530/standard/ethena.png?1711701436", + coingeckoUrl: "https://www.coingecko.com/en/coins/ethena", + isSynthetic: true, + }, + { + name: "ai16z", + symbol: "AI16Z", + address: "0xBb69bd9dc152C2c0F083507641a46193d2B61EBb", + decimals: 9, + priceDecimals: 5, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/51090/standard/AI16Z.jpg?1730027175", + coingeckoUrl: "https://www.coingecko.com/en/coins/ai16z", + isSynthetic: true, + }, + { + name: "Animecoin", + symbol: "ANIME", + address: "0x37a645648dF29205C6261289983FB04ECD70b4B3", + decimals: 18, + priceDecimals: 6, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/53575/standard/anime.jpg?1736748703", + coingeckoUrl: "https://www.coingecko.com/en/coins/anime", + isSynthetic: false, + }, + { + name: "Fartcoin", + symbol: "FARTCOIN", + address: "0xaca341E61aB6177B0b0Df46a612e4311F8a7605f", + decimals: 6, + priceDecimals: 4, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/50891/standard/fart.jpg?1729503972", + coingeckoUrl: "https://www.coingecko.com/en/coins/fartcoin", + isSynthetic: true, + }, + { + name: "Berachain", + symbol: "BERA", + address: "0x67ADABbAd211eA9b3B4E2fd0FD165E593De1e983", + decimals: 18, + priceDecimals: 4, + categories: ["layer1", "defi"], + imageUrl: "https://assets.coingecko.com/coins/images/25235/standard/BERA.png?1738822008", + coingeckoUrl: "https://www.coingecko.com/en/coins/berachain", + isSynthetic: true, + }, + { + name: "Lido DAO", + symbol: "LDO", + address: "0x9D678B4Dd38a6E01df8090aEB7974aD71142b05f", + decimals: 18, + priceDecimals: 4, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/13573/standard/Lido_DAO.png?1696513326", + coingeckoUrl: "https://www.coingecko.com/en/coins/lido-dao", + isSynthetic: true, + }, + { + name: "Virtuals Protocol", + symbol: "VIRTUAL", + address: "0xB6672496214C90134A9223894e709F26A5eED362", + decimals: 18, + priceDecimals: 4, + imageUrl: "https://assets.coingecko.com/coins/images/34057/standard/LOGOMARK.png?1708356054", + coingeckoUrl: "https://www.coingecko.com/en/coins/virtual-protocol", + isSynthetic: true, + }, + { + name: "Pudgy Penguins", + symbol: "PENGU", + address: "0x4C1dac9b6eAf122Fe3DE824c1C2220413F3aC197", + decimals: 6, + priceDecimals: 7, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/52622/standard/PUDGY_PENGUINS_PENGU_PFP.png?1733809110", + coingeckoUrl: "https://www.coingecko.com/en/coins/pudgy-penguins", + isSynthetic: true, + }, + { + name: "Artificial Superintelligence Alliance", + symbol: "FET", + address: "0x83D5944E7f5EF1d8432002d3cb062e1012f6F8e6", + decimals: 18, + priceDecimals: 5, + imageUrl: "https://assets.coingecko.com/coins/images/5681/standard/ASI.png?1719827289", + coingeckoUrl: "https://www.coingecko.com/en/coins/artificial-superintelligence-alliance", + isSynthetic: true, + }, + { + name: "Ondo", + symbol: "ONDO", + address: "0xEcFB4718aD19b626A77491895a2f99ea0cedEd08", + decimals: 18, + priceDecimals: 4, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/26580/standard/ONDO.png?1696525656", + coingeckoUrl: "https://www.coingecko.com/en/coins/ondo", + isSynthetic: true, + }, + { + name: "AIXBT", + symbol: "AIXBT", + address: "0xcA543Cb8bCC76e4E0A034F56EB40a1029bDFd70E", + decimals: 18, + priceDecimals: 4, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/51784/standard/3.png?1731981138", + coingeckoUrl: "https://www.coingecko.com/en/coins/ondo", + isSynthetic: true, + }, + { + name: "Sonic", + symbol: "S", + address: "0x8F6cCb99d4Fd0B4095915147b5ae3bbDb8075394", + decimals: 18, + priceDecimals: 5, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png?1734679256", + coingeckoUrl: "https://www.coingecko.com/en/coins/sonic", + isSynthetic: true, + }, + { + name: "pancakeswap", + symbol: "CAKE", + address: "0x580b373Ac16803BB0133356F470f3c7EEF54151B", + decimals: 18, + priceDecimals: 5, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/12632/standard/pancakeswap-cake-logo_%281%29.png?1696512440", + coingeckoUrl: "https://www.coingecko.com/en/coins/pancakeswap", + isSynthetic: true, + }, + { + name: "Hyperliquid", + symbol: "HYPE", + address: "0xfDFA0A749dA3bCcee20aE0B4AD50E39B26F58f7C", + decimals: 8, + priceDecimals: 4, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/50882/standard/hyperliquid.jpg?1729431300", + coingeckoUrl: "https://www.coingecko.com/en/coins/hyperliquid", + isSynthetic: true, + }, + { + name: "Jupiter", + symbol: "JUP", + address: "0xfEd500Df379427Fbc48BDaf3b511b519c7eCCD26", + decimals: 6, + priceDecimals: 5, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/34188/standard/jup.png?1704266489", + coingeckoUrl: "https://www.coingecko.com/en/coins/jupiter", + isSynthetic: true, + }, + { + name: "Maker", + symbol: "MKR", + address: "0x8904De84c3bB3B7D2383F934Af40FcB3Ef82F28b", + decimals: 18, + priceDecimals: 2, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/1364/standard/Mark_Maker.png?1696502423", + coingeckoUrl: "https://www.coingecko.com/en/coins/maker", + isSynthetic: true, + }, + { + name: "MANTRA", + symbol: "OM", + address: "0x1f3407Ea067DfBDF6dEb6bBFdA4869215fB0ab77", + decimals: 18, + priceDecimals: 4, + categories: ["layer1", "defi"], + imageUrl: "https://assets.coingecko.com/coins/images/12151/standard/OM_Token.png?1696511991", + coingeckoUrl: "https://www.coingecko.com/en/coins/mantra", + isSynthetic: true, + }, + { + name: "GMX LP", + symbol: "GLP", + address: getContract(ARBITRUM, "GLP"), + decimals: 18, + imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", + reservesUrl: "https://portfolio.nansen.ai/dashboard/gmx?chain=ARBITRUM", + isPlatformToken: true, + }, + /** Placeholder tokens */ + { + name: "GMX Market tokens", + symbol: "GM", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", + isPlatformToken: true, + }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, + ], + [AVALANCHE]: [ + { + name: "Avalanche", + symbol: "AVAX", + decimals: 18, + address: zeroAddress, + isNative: true, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/12559/small/coin-round-red.png?1604021818", + coingeckoUrl: "https://www.coingecko.com/en/coins/avalanche", + isV1Available: true, + }, + { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + address: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + isWrapped: true, + baseSymbol: "AVAX", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/12559/small/coin-round-red.png?1604021818", + coingeckoUrl: "https://www.coingecko.com/en/coins/avalanche", + explorerUrl: "https://snowtrace.io/address/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + isV1Available: true, + }, + { + name: "Ethereum (WETH.e)", + symbol: "ETH", + assetSymbol: "WETH.e", + address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + decimals: 18, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png?1595348880", + coingeckoUrl: "https://www.coingecko.com/en/coins/weth", + coingeckoSymbol: "WETH", + explorerUrl: "https://snowtrace.io/address/0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + isV1Available: true, + }, + { + name: "Bitcoin (BTC.b)", + symbol: "BTC", + assetSymbol: "BTC.b", + address: "0x152b9d0FdC40C096757F570A51E494bd4b943E50", + decimals: 8, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/26115/thumb/btcb.png?1655921693", + coingeckoUrl: "https://www.coingecko.com/en/coins/bitcoin-avalanche-bridged-btc-b", + explorerUrl: "https://snowtrace.io/address/0x152b9d0FdC40C096757F570A51E494bd4b943E50", + isV1Available: true, + }, + { + name: "Bitcoin (WBTC.e)", + symbol: "WBTC", + assetSymbol: "WBTC.e", + address: "0x50b7545627a5162F82A992c33b87aDc75187B218", + decimals: 8, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/7598/thumb/wrapped_bitcoin_wbtc.png?1548822744", + coingeckoUrl: "https://www.coingecko.com/en/coins/wrapped-bitcoin", + coingeckoSymbol: "WBTC", + explorerUrl: "https://snowtrace.io/address/0x50b7545627a5162F82A992c33b87aDc75187B218", + isV1Available: true, + }, + { + name: "USD Coin", + symbol: "USDC", + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + decimals: 6, + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389", + coingeckoUrl: "https://www.coingecko.com/en/coins/usd-coin", + explorerUrl: "https://snowtrace.io/address/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + isV1Available: true, + }, + { + name: "Bridged USDC (USDC.e)", + symbol: "USDC.E", + address: "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + decimals: 6, + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389", + coingeckoUrl: "https://www.coingecko.com/en/coins/bridged-usdc-avalanche-bridge", + explorerUrl: "https://snowtrace.io/address/0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + isV1Available: true, + }, + { + name: "Tether", + symbol: "USDT", + decimals: 6, + address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/325/small/Tether-logo.png", + coingeckoUrl: "https://www.coingecko.com/en/coins/tether", + explorerUrl: "https://snowtrace.io/address/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", + }, + { + name: "Tether", + symbol: "USDT.E", + decimals: 6, + address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/325/small/Tether-logo.png", + coingeckoUrl: "https://www.coingecko.com/en/coins/tether", + explorerUrl: "https://snowtrace.io/address/0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + }, + { + name: "Dai", + symbol: "DAI.E", + address: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70", + decimals: 18, + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/9956/thumb/4943.png?1636636734", + coingeckoUrl: "https://www.coingecko.com/en/coins/dai", + explorerUrl: "https://snowtrace.io/address/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70", + }, + { + name: "Magic Internet Money", + symbol: "MIM", + address: "0x130966628846BFd36ff31a822705796e8cb8C18D", + decimals: 18, + isStable: true, + isTempHidden: true, + imageUrl: "https://assets.coingecko.com/coins/images/16786/small/mimlogopng.png", + coingeckoUrl: "https://www.coingecko.com/en/coins/magic-internet-money", + explorerUrl: "https://snowtrace.io/address/0x130966628846BFd36ff31a822705796e8cb8C18D", + isV1Available: true, + }, + { + name: "Chainlink", + symbol: "LINK", + decimals: 18, + priceDecimals: 4, + address: "0x5947BB275c521040051D82396192181b413227A3", + isStable: false, + isShortable: true, + categories: ["defi"], + imageUrl: "https://assets.coingecko.com/coins/images/877/thumb/chainlink-new-logo.png?1547034700", + coingeckoUrl: "https://www.coingecko.com/en/coins/chainlink", + explorerUrl: "https://snowtrace.io/address/0x5947BB275c521040051D82396192181b413227A3", + }, + { + name: "Dogecoin", + symbol: "DOGE", + decimals: 8, + priceDecimals: 5, + address: "0xC301E6fe31062C557aEE806cc6A841aE989A3ac6", + isSynthetic: true, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/5/small/dogecoin.png?1547792256", + coingeckoUrl: "https://www.coingecko.com/en/coins/dogecoin", + }, + { + name: "Litecoin", + symbol: "LTC", + decimals: 8, + priceDecimals: 3, + address: "0x8E9C35235C38C44b5a53B56A41eaf6dB9a430cD6", + isSynthetic: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/2/small/litecoin.png?1547033580", + coingeckoUrl: "https://www.coingecko.com/en/coins/litecoin", + }, + { + name: "Wrapped SOL (Wormhole)", + symbol: "SOL", + assetSymbol: "WSOL (Wormhole)", + priceDecimals: 3, + decimals: 9, + address: "0xFE6B19286885a4F7F55AdAD09C3Cd1f906D2478F", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/4128/small/solana.png?1640133422", + coingeckoUrl: "https://www.coingecko.com/en/coins/solana", + coingeckoSymbol: "SOL", + explorerUrl: "https://snowtrace.io/address/0xFE6B19286885a4F7F55AdAD09C3Cd1f906D2478F", + }, + { + name: "XRP", + symbol: "XRP", + decimals: 6, + priceDecimals: 5, + address: "0x34B2885D617cE2ddeD4F60cCB49809fc17bb58Af", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/44/small/xrp-symbol-white-128.png?1605778731", + coingeckoUrl: "https://www.coingecko.com/en/coins/xrp", + isSynthetic: true, + }, + { + name: "GMX", + symbol: "GMX", + address: getContract(AVALANCHE, "GMX"), + decimals: 18, + imageUrl: "https://assets.coingecko.com/coins/images/18323/small/arbit.png?1631532468", + isPlatformToken: true, + categories: ["defi"], + coingeckoUrl: "https://www.coingecko.com/en/coins/gmx", + explorerUrl: "https://snowtrace.io/address/0x62edc0692bd897d2295872a9ffcac5425011c661", + }, + { + name: "Official Trump", + symbol: "TRUMP", + address: "0x2f6d7be53fab5538065a226BA091015d422a7528", + decimals: 6, + priceDecimals: 4, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/53746/standard/trump.png?1737171561", + coingeckoUrl: "https://www.coingecko.com/en/coins/official-trump", + isSynthetic: true, + }, + { + name: "Melania Meme", + symbol: "MELANIA", + address: "0xd42C991a4FAb293C57a7bf25C2E2ec5aE1dB1714", + decimals: 6, + priceDecimals: 4, + categories: ["meme"], + imageUrl: "https://assets.coingecko.com/coins/images/53775/standard/melania-meme.png?1737329885", + coingeckoUrl: "https://www.coingecko.com/en/coins/melania-meme", + isSynthetic: true, + }, + { + name: "Escrowed GMX", + symbol: "ESGMX", + address: getContract(AVALANCHE, "ES_GMX"), + decimals: 18, + isPlatformToken: true, + }, + { + name: "GMX LP", + symbol: "GLP", + address: getContract(AVALANCHE, "GLP"), + decimals: 18, + isPlatformToken: true, + imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", + explorerUrl: "https://snowtrace.io/address/0x9e295B5B976a184B14aD8cd72413aD846C299660", + reservesUrl: "https://portfolio.nansen.ai/dashboard/gmx?chain=AVAX", + }, + /** Placeholder tokens */ + { + name: "GMX Market tokens", + symbol: "GM", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", + isPlatformToken: true, + }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, + ], + [AVALANCHE_FUJI]: [ + { + name: "Avalanche", + symbol: "AVAX", + priceDecimals: 3, + decimals: 18, + address: zeroAddress, + isNative: true, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/12559/small/coin-round-red.png?1604021818", + }, + { + name: "Wrapped AVAX", + symbol: "WAVAX", + priceDecimals: 3, + decimals: 18, + address: "0x1D308089a2D1Ced3f1Ce36B1FcaF815b07217be3", + isWrapped: true, + baseSymbol: "AVAX", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/12559/small/coin-round-red.png?1604021818", + coingeckoUrl: "https://www.coingecko.com/en/coins/avalanche", + explorerUrl: "https://testnet.snowtrace.io/address/0x1D308089a2D1Ced3f1Ce36B1FcaF815b07217be3", + }, + { + name: "Ethereum (WETH.e)", + symbol: "ETH", + assetSymbol: "WETH.e", + address: "0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + decimals: 18, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png?1595348880", + coingeckoUrl: "https://www.coingecko.com/en/coins/weth", + coingeckoSymbol: "WETH", + explorerUrl: "https://testnet.snowtrace.io/address/0x82F0b3695Ed2324e55bbD9A9554cB4192EC3a514", + }, + { + name: "USD Coin", + symbol: "USDC", + address: "0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + decimals: 6, + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389", + coingeckoUrl: "https://www.coingecko.com/en/coins/usd-coin", + explorerUrl: "https://testnet.snowtrace.io/address/0x3eBDeaA0DB3FfDe96E7a0DBBAFEC961FC50F725F", + }, + { + name: "Tether", + symbol: "USDT", + decimals: 6, + address: "0x50df4892Bd13f01E4e1Cd077ff394A8fa1A3fD7c", + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/325/small/Tether-logo.png", + coingeckoUrl: "https://www.coingecko.com/en/coins/dai", + explorerUrl: "https://testnet.snowtrace.io/address/0x50df4892Bd13f01E4e1Cd077ff394A8fa1A3fD7c", + }, + { + name: "Dai", + symbol: "DAI", + address: "0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + decimals: 6, + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/9956/thumb/4943.png?1636636734", + coingeckoUrl: "https://www.coingecko.com/en/coins/dai", + explorerUrl: "https://testnet.snowtrace.io/address/0x51290cb93bE5062A6497f16D9cd3376Adf54F920", + }, + { + name: "Wrapped Bitcoin", + symbol: "WBTC", + decimals: 8, + address: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/7598/thumb/wrapped_bitcoin_wbtc.png?1548822744", + coingeckoUrl: "https://www.coingecko.com/en/coins/wrapped-bitcoin", + explorerUrl: "https://testnet.snowtrace.io/address/0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", + }, + { + name: "Solana", + symbol: "SOL", + decimals: 18, + priceDecimals: 3, + address: "0x137f4a7336df4f3f11894718528516edaaD0B082", + categories: ["layer1"], + isSynthetic: true, + imageUrl: "https://assets.coingecko.com/coins/images/4128/small/solana.png?1640133422", + coingeckoUrl: "https://www.coingecko.com/en/coins/solana", + }, + { + name: "Test token", + symbol: "TEST", + decimals: 18, + address: "0x42DD131E1086FFCc59bAE9498D71E20E0C889B14", + isSynthetic: true, + coingeckoUrl: "https://www.coingecko.com/en/coins/tether", + }, + { + name: "BNB", + symbol: "BNB", + decimals: 18, + priceDecimals: 3, + address: "0x110892Dd5fa73bE430c0ade694febD9a4CAc68Be", + isSynthetic: true, + coingeckoUrl: "https://www.coingecko.com/en/coins/binancecoin", + }, + { + name: "Cardano", + symbol: "ADA", + decimals: 18, + priceDecimals: 5, + address: "0xE64dfFF37Fa6Fe969b792B4146cEe2774Ef6e1a1", + categories: ["layer1"], + isSynthetic: true, + coingeckoUrl: "https://www.coingecko.com/en/coins/cardano", + }, + { + name: "TRON", + symbol: "TRX", + decimals: 18, + priceDecimals: 5, + address: "0x0D1495527C255068F2f6feE31C85d326D0A76FE8", + isSynthetic: true, + coingeckoUrl: "https://www.coingecko.com/en/coins/tron", + }, + { + name: "Polygon", + symbol: "MATIC", + decimals: 18, + priceDecimals: 4, + address: "0xadc4698B257F78187Fd675FBf591a09f4c975240", + categories: ["layer1"], + isSynthetic: true, + coingeckoUrl: "https://www.coingecko.com/en/coins/polygon", + }, + { + name: "Polkadot", + symbol: "DOT", + address: "0x65FFb5664a7B3377A5a27D9e59C72Fb1A5E94962", + decimals: 18, + priceDecimals: 4, + isSynthetic: true, + categories: ["layer1"], + coingeckoUrl: "https://www.coingecko.com/en/coins/polkadot", + }, + { + name: "Uniswap", + symbol: "UNI", + decimals: 18, + priceDecimals: 4, + address: "0xF62dC1d2452d0893735D22945Af53C290b158eAF", + isSynthetic: true, + categories: ["layer2", "defi"], + coingeckoUrl: "https://www.coingecko.com/en/coins/uniswap", + }, + { + name: "Dogecoin", + symbol: "DOGE", + decimals: 8, + priceDecimals: 5, + address: "0x2265F317eA5f47A684E5B26c50948617c945d986", + isSynthetic: true, + isShortable: true, + categories: ["meme"], + coingeckoUrl: "https://www.coingecko.com/en/coins/dogecoin", + }, + { + name: "Chainlink", + symbol: "LINK", + decimals: 18, + priceDecimals: 3, + address: "0x6BD09E8D65AD5cc761DF62454452d4EC1545e647", + isSynthetic: true, + isShortable: true, + categories: ["defi"], + coingeckoUrl: "https://www.coingecko.com/en/coins/chainlink", + }, + { + name: "XRP", + symbol: "XRP", + decimals: 6, + priceDecimals: 4, + address: "0xF1C2093383453831e8c90ecf809691123116dAaC", + isSynthetic: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/44/small/xrp-symbol-white-128.png?1605778731", + coingeckoUrl: "https://www.coingecko.com/en/coins/xrp", + }, + { + name: "GMX", + symbol: "GMX", + address: "", + decimals: 18, + imageUrl: "https://assets.coingecko.com/coins/images/18323/small/arbit.png?1631532468", + isPlatformToken: true, + }, + { + name: "Escrowed GMX", + symbol: "ESGMX", + address: "", + decimals: 18, + isPlatformToken: true, + }, + { + name: "GMX LP", + symbol: "GLP", + address: "", + decimals: 18, + imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", + isPlatformToken: true, + }, + /** Placeholder tokens */ + { + name: "GMX Market tokens", + symbol: "GM", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", + isPlatformToken: true, + }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, + ], +}; + +export const TOKEN_COLOR_MAP = { + ETH: "#6062a6", + BTC: "#F7931A", + WBTC: "#F7931A", + USDC: "#2775CA", + "USDC.E": "#2A5ADA", + USDT: "#67B18A", + MIM: "#9695F8", + FRAX: "#000", + DAI: "#FAC044", + UNI: "#E9167C", + AVAX: "#E84142", + LINK: "#3256D6", + DOGE: "#BA9F2F", + SOL: "#38cbc1", + ARB: "#162c4f", + NEAR: "#07eb98", + BNB: "#efb90b", + ATOM: "#6f7390", + XRP: "#23292f", + LTC: "#16182e", + OP: "#ff0421", + DOT: "#e6007a", + tBTC: "#000000", + TEST: "#2d3ed7", + SHIB: "#f00601", + STX: "#eb6230", + ORDI: "#000000", + MATIC: "#6f41d8", + EIGEN: "#1A0C6D", + SATS: "#F7931A", + default: "#6062a6", +}; + +export const TOKENS_MAP: { [chainId: number]: { [address: string]: Token } } = {}; +export const V1_TOKENS: { [chainId: number]: Token[] } = {}; +export const V2_TOKENS: { [chainId: number]: Token[] } = {}; +export const SYNTHETIC_TOKENS: { [chainId: number]: Token[] } = {}; +export const TOKENS_BY_SYMBOL_MAP: { [chainId: number]: { [symbol: string]: Token } } = {}; +export const WRAPPED_TOKENS_MAP: { [chainId: number]: Token } = {}; +export const NATIVE_TOKENS_MAP: { [chainId: number]: Token } = {}; + +const CHAIN_IDS = [ARBITRUM, AVALANCHE, AVALANCHE_FUJI]; + +for (let j = 0; j < CHAIN_IDS.length; j++) { + const chainId = CHAIN_IDS[j]; + + TOKENS_MAP[chainId] = {}; + TOKENS_BY_SYMBOL_MAP[chainId] = {}; + SYNTHETIC_TOKENS[chainId] = []; + V1_TOKENS[chainId] = []; + V2_TOKENS[chainId] = []; + + let tokens = TOKENS[chainId]; + let wrappedTokenAddress: string | undefined; + + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + TOKENS_MAP[chainId][token.address] = token; + TOKENS_BY_SYMBOL_MAP[chainId][token.symbol] = token; + + if (token.isWrapped) { + WRAPPED_TOKENS_MAP[chainId] = token; + wrappedTokenAddress = token.address; + } + + if (token.isNative) { + NATIVE_TOKENS_MAP[chainId] = token; + } + + if (token.isV1Available && !token.isTempHidden) { + V1_TOKENS[chainId].push(token); + } + + if ((!token.isPlatformToken || (token.isPlatformToken && token.isPlatformTradingToken)) && !token.isTempHidden) { + V2_TOKENS[chainId].push(token); + } + + if (token.isSynthetic) { + SYNTHETIC_TOKENS[chainId].push(token); + } + } + + NATIVE_TOKENS_MAP[chainId].wrappedAddress = wrappedTokenAddress; +} + +export function getSyntheticTokens(chainId: number) { + return SYNTHETIC_TOKENS[chainId]; +} + +export function getWrappedToken(chainId: number) { + return WRAPPED_TOKENS_MAP[chainId]; +} + +export function getNativeToken(chainId: number) { + return NATIVE_TOKENS_MAP[chainId]; +} + +export function getTokens(chainId: number) { + return TOKENS[chainId]; +} + +export function getV1Tokens(chainId: number) { + return V1_TOKENS[chainId]; +} + +export function getV2Tokens(chainId: number) { + return V2_TOKENS[chainId]; +} + +export function getTokensMap(chainId: number) { + return TOKENS_MAP[chainId]; +} + +export function getWhitelistedV1Tokens(chainId: number) { + return getV1Tokens(chainId); +} + +export function getVisibleV1Tokens(chainId: number) { + return getV1Tokens(chainId).filter((token) => !token.isWrapped); +} + +export function isValidToken(chainId: number, address: string) { + if (!TOKENS_MAP[chainId]) { + throw new Error(`Incorrect chainId ${chainId}`); + } + return address in TOKENS_MAP[chainId]; +} + +export function getToken(chainId: number, address: string) { + if (!TOKENS_MAP[chainId]) { + throw new Error(`Incorrect chainId ${chainId}`); + } + if (!TOKENS_MAP[chainId][address]) { + throw new Error(`Incorrect address "${address}" for chainId ${chainId}`); + } + + return TOKENS_MAP[chainId][address]; +} + +export function getTokenBySymbol( + chainId: number, + symbol: string, + { + isSynthetic, + version, + symbolType = "symbol", + }: { isSynthetic?: boolean; version?: "v1" | "v2"; symbolType?: "symbol" | "baseSymbol" } = {} +) { + let tokens = Object.values(TOKENS_MAP[chainId]); + + if (version) { + tokens = version === "v1" ? getV1Tokens(chainId) : getV2Tokens(chainId); + } + + let token: Token | undefined; + + if (isSynthetic !== undefined) { + token = tokens.find((token) => { + return token[symbolType]?.toLowerCase() === symbol.toLowerCase() && Boolean(token.isSynthetic) === isSynthetic; + }); + } else { + if (symbolType === "symbol" && TOKENS_BY_SYMBOL_MAP[chainId][symbol]) { + token = TOKENS_BY_SYMBOL_MAP[chainId][symbol]; + } else { + token = tokens.find((token) => token[symbolType]?.toLowerCase() === symbol.toLowerCase()); + } + } + + if (!token) { + throw new Error(`Incorrect symbol "${symbol}" for chainId ${chainId}`); + } + + return token; +} + +export function convertTokenAddress(chainId: number, address: string, convertTo?: "wrapped" | "native") { + const wrappedToken = getWrappedToken(chainId); + + if (convertTo === "wrapped" && address === NATIVE_TOKEN_ADDRESS) { + return wrappedToken.address; + } + + if (convertTo === "native" && address === wrappedToken.address) { + return NATIVE_TOKEN_ADDRESS; + } + + return address; +} + +export function getNormalizedTokenSymbol(tokenSymbol) { + if (["WBTC", "WETH", "WAVAX"].includes(tokenSymbol)) { + return tokenSymbol.substr(1); + } else if (tokenSymbol.includes(".")) { + return tokenSymbol.split(".")[0]; + } + return tokenSymbol; +} + +export function isChartAvailableForToken(chainId: number, tokenSymbol: string) { + let token; + + try { + token = getTokenBySymbol(chainId, tokenSymbol); + } catch (e) { + return false; + } + + if (token.isChartDisabled || (token.isPlatformToken && !token.isPlatformTradingToken)) return false; + + return true; +} + +export function getPriceDecimals(chainId: number, tokenSymbol?: string) { + if (!tokenSymbol) return 2; + + try { + const token = getTokenBySymbol(chainId, tokenSymbol); + return token.priceDecimals ?? 2; + } catch (e) { + return 2; + } +} + +export function getTokenBySymbolSafe( + chainId: number, + symbol: string, + params: Parameters[2] = {} +) { + try { + return getTokenBySymbol(chainId, symbol, params); + } catch (e) { + return; + } +} + +export function isTokenInList(token: Token, tokenList: Token[]): boolean { + return tokenList.some((t) => t.address === token.address); +} + +export function isSimilarToken(tokenA: Token, tokenB: Token) { + if (tokenA.address === tokenB.address) { + return true; + } + + if (tokenA.symbol === tokenB.symbol || tokenA.baseSymbol === tokenB.symbol || tokenA.symbol === tokenB.baseSymbol) { + return true; + } + + return false; +} + +export function getTokenVisualMultiplier(token: Token): string { + return token.visualPrefix || token.visualMultiplier?.toString() || ""; +} + +export function getStableTokens(chainId: number) { + return getTokens(chainId).filter((t) => t.isStable); +} + +export function getCategoryTokenAddresses(chainId: number, category: TokenCategory) { + return TOKENS[chainId].filter((token) => token.categories?.includes(category)).map((token) => token.address); +} + +export const createTokensMap = (tokens: Token[]) => { + return tokens.reduce((acc, token) => { + acc[token.address] = token; + return acc; + }, {}); +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/ui.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/ui.ts new file mode 100644 index 0000000..87efb41 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/configs/ui.ts @@ -0,0 +1,27 @@ +export const TRIGGER_PREFIX_ABOVE = ">"; +export const TRIGGER_PREFIX_BELOW = "<"; + +export const TOAST_AUTO_CLOSE_TIME = 7000; +export const WS_LOST_FOCUS_TIMEOUT = 60_000; +export const TRADE_LOST_FOCUS_TIMEOUT = 15_000; + +export const PERCENTAGE_SUGGESTIONS = [10, 25, 50, 75]; +export const MAX_METAMASK_MOBILE_DECIMALS = 5; +export const INPUT_LABEL_SEPARATOR = ":"; + +export const TRADE_HISTORY_PER_PAGE = 25; +export const CLAIMS_HISTORY_PER_PAGE = 25; + +export const DEFAULT_TOOLTIP_POSITION = "bottom-start"; + +export const TOOLTIP_OPEN_DELAY = 100; // ms +export const TOOLTIP_CLOSE_DELAY = 100; // ms + +export const MARKET_STATS_DECIMALS = 4; +export const GM_POOL_PRICE_DECIMALS = 4; +export const GLP_PRICE_DECIMALS = 4; +export const GMX_PRICE_DECIMALS = 2; + +export const DATA_LOAD_TIMEOUT_FOR_METRICS = 10000; + +export const MAX_FEEDBACK_LENGTH = 500; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/index.ts new file mode 100644 index 0000000..bb7d736 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/index.ts @@ -0,0 +1,89 @@ +import { Abi, Address, createPublicClient, createWalletClient, http, PublicClient, WalletClient } from "viem"; + +import {Accounts} from "./modules/accounts/accounts.js"; +import {BATCH_CONFIGS} from "./configs/batch.js"; +import {getChain} from "./configs/chains.js"; +import {Markets} from "./modules/markets/index.js"; +import {Oracle} from "./modules/oracle.js"; +import {Orders} from "./modules/orders/orders.js"; +import {Positions} from "./modules/positions/positions.js"; +import {Tokens} from "./modules/tokens/tokens.js"; +import {Trades} from "./modules/trades/trades.js"; +import {Utils} from "./modules/utils/utils.js"; +import {GmxSdkConfig} from "./types/sdk.js"; +import {callContract, CallContractOpts} from "./utils/callContract.js"; +import {MAX_TIMEOUT, Multicall, MulticallRequestConfig} from "./utils/multicall.js"; + +export class GmxSdk { + public readonly markets = new Markets(this); + public readonly tokens = new Tokens(this); + public readonly positions = new Positions(this); + public readonly orders = new Orders(this); + public readonly trades = new Trades(this); + public readonly accounts = new Accounts(this); + public readonly utils = new Utils(this); + public readonly oracle: Oracle; + + public publicClient: PublicClient; + public walletClient: WalletClient; + + constructor(public config: GmxSdkConfig) { + this.oracle = new Oracle(this); + + if (config.publicClient) { + this.publicClient = config.publicClient; + } else { + // Use any to bypass TypeScript's deep type checking + const clientParams: any = { + transport: http(this.config.rpcUrl, { + retryCount: 0, + retryDelay: 10000000, + batch: BATCH_CONFIGS[this.config.chainId].http, + timeout: MAX_TIMEOUT, + }), + pollingInterval: undefined, + batch: BATCH_CONFIGS[this.config.chainId].client, + chain: getChain(this.config.chainId), + }; + this.publicClient = createPublicClient(clientParams) as PublicClient; + } + + this.walletClient = + config.walletClient ?? + createWalletClient({ + account: config.account as Address, + chain: getChain(config.chainId), + transport: http(config.rpcUrl, { + retryCount: 0, + retryDelay: 10000000, + batch: BATCH_CONFIGS[config.chainId].http, + timeout: MAX_TIMEOUT, + }), + }); + } + + setAccount(account: Address) { + this.config.account = account; + } + + async executeMulticall(request: MulticallRequestConfig) { + const multicall = await Multicall.getInstance(this); + return multicall?.call(request, MAX_TIMEOUT) as Promise; + } + + async callContract(address: Address, abi: Abi, method: string, params: any[], opts?: CallContractOpts) { + return callContract(this, address, abi, method, params, opts); + } + + get chainId() { + return this.config.chainId; + } + + get chain() { + return getChain(this.chainId); + } + + get account() { + return this.config.account as Address; + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/accounts/accounts.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/accounts/accounts.spec.ts new file mode 100644 index 0000000..eeb015f --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/accounts/accounts.spec.ts @@ -0,0 +1,10 @@ +import {describe, expect, it} from "vitest"; + +import {arbitrumSdk} from "../../utils/testUtil.js"; + +describe("Accounts", () => { + it("should be able to get delegates", async () => { + const delegates = await arbitrumSdk.accounts.getGovTokenDelegates(); + expect(delegates).toBeDefined(); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/accounts/accounts.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/accounts/accounts.ts new file mode 100644 index 0000000..35018d1 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/accounts/accounts.ts @@ -0,0 +1,39 @@ +import { getContract } from "../../configs/contracts.js"; +import { Module } from "../base.js"; + +export class Accounts extends Module { + get govTokenAddress() { + let govTokenAddress; + + try { + govTokenAddress = getContract(this.chainId, "GovToken"); + } catch (e) { + govTokenAddress = null; + } + + return govTokenAddress; + } + + getGovTokenDelegates(account?: string) { + if (!this.govTokenAddress) { + return Promise.resolve([]); + } + + return this.sdk + .executeMulticall({ + govToken: { + contractAddress: this.govTokenAddress, + abiId: "GovToken", + calls: { + delegates: { + methodName: "delegates", + params: [account ?? this.account], + }, + }, + }, + }) + .then((res) => { + return res.data.govToken.delegates.returnValues[0]; + }); + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/base.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/base.ts new file mode 100644 index 0000000..23f4f21 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/base.ts @@ -0,0 +1,19 @@ +import type {GmxSdk} from "../index.js"; + +export class Module { + constructor(public sdk: GmxSdk) { + this.sdk = sdk; + } + + get oracle() { + return this.sdk.oracle; + } + + get chainId() { + return this.sdk.chainId; + } + + get account() { + return this.sdk.account; + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/index.ts new file mode 100644 index 0000000..8a0258d --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/index.ts @@ -0,0 +1,477 @@ +import { zeroAddress } from "viem"; + +import {getContract} from "../../configs/contracts.js"; +import {convertTokenAddress, getToken} from "../../configs/tokens.js"; + +import {ClaimableFundingData, MarketInfo, MarketsData, MarketSdkConfig, MarketsInfoData} from "../../types/markets.js"; +import {TokensData} from "../../types/tokens.js"; + +import {TIMEZONE_OFFSET_SEC} from "../../utils/common.js"; +import graphqlFetcher from "../../utils/graphqlFetcher.js"; +import {getMarketDivisor, getMarketFullName} from "../../utils/markets.js"; +import {getByKey} from "../../utils/objects.js"; + +import {Module} from "../base.js"; +import { + buildClaimableFundingDataRequest, + buildMarketsConfigsRequest, + buildMarketsValuesRequest, +} from "./query-builders.js"; +import {MarketConfig, MarketsInfoResult, MarketsResult, MarketValues} from "./types.js"; + +export class Markets extends Module { + private async getClaimableFundingData() { + const chainId = this.chainId; + const account = this.account; + + if (!account) { + return {}; + } + + const { marketsAddresses, marketsData } = await this.getMarkets(); + + return this.sdk + .executeMulticall( + buildClaimableFundingDataRequest({ + chainId, + account, + marketsAddresses, + marketsData, + }) + ) + .then((result) => { + return Object.entries(result.data).reduce( + (claimableFundingData, [marketAddress, callsResult]: [string, any]) => { + const market = getByKey(marketsData, marketAddress); + + if (!market) { + return claimableFundingData; + } + + const marketDivisor = getMarketDivisor(market); + + claimableFundingData[marketAddress] = { + claimableFundingAmountLong: callsResult.claimableFundingAmountLong.returnValues[0] / marketDivisor, + claimableFundingAmountShort: callsResult.claimableFundingAmountShort.returnValues[0] / marketDivisor, + }; + + return claimableFundingData; + }, + {} as ClaimableFundingData + ); + }); + } + + private async getMarketsValues({ + marketsAddresses, + marketsData, + tokensData, + }: { + account: string | undefined; + marketsAddresses: string[] | undefined; + marketsData: MarketsData | undefined; + tokensData: TokensData | undefined; + }): Promise { + const dataStoreAddress = getContract(this.chainId, "DataStore"); + const syntheticsReaderAddress = getContract(this.chainId, "SyntheticsReader"); + + const request = await buildMarketsValuesRequest(this.chainId, { + marketsAddresses, + marketsData, + tokensData, + dataStoreAddress, + syntheticsReaderAddress, + }); + + return this.sdk.executeMulticall(request).then((res) => { + const result = marketsAddresses!.reduce( + (acc, marketAddress) => { + const readerErrors = res.errors[`${marketAddress}-reader`]; + const dataStoreErrors = res.errors[`${marketAddress}-dataStore`]; + + const readerValues = res.data[`${marketAddress}-reader`]; + const dataStoreValues = res.data[`${marketAddress}-dataStore`]; + + // Skip invalid market + if (!readerValues || !dataStoreValues || readerErrors || dataStoreErrors) { + // eslint-disable-next-line no-console + console.warn(`No market found ${marketAddress} in getMarketsValues`); + return acc; + } + + const market = getByKey(marketsData, marketAddress)!; + const marketDivisor = market.isSameCollaterals ? 2n : 1n; + + const longInterestUsingLongToken = + BigInt(dataStoreValues.longInterestUsingLongToken.returnValues[0]) / marketDivisor; + const longInterestUsingShortToken = + BigInt(dataStoreValues.longInterestUsingShortToken.returnValues[0]) / marketDivisor; + const shortInterestUsingLongToken = + BigInt(dataStoreValues.shortInterestUsingLongToken.returnValues[0]) / marketDivisor; + const shortInterestUsingShortToken = + BigInt(dataStoreValues.shortInterestUsingShortToken.returnValues[0]) / marketDivisor; + + const longInterestUsd = longInterestUsingLongToken + longInterestUsingShortToken; + const shortInterestUsd = shortInterestUsingLongToken + shortInterestUsingShortToken; + + const longInterestInTokensUsingLongToken = + BigInt(dataStoreValues.longInterestInTokensUsingLongToken.returnValues[0]) / marketDivisor; + const longInterestInTokensUsingShortToken = + BigInt(dataStoreValues.longInterestInTokensUsingShortToken.returnValues[0]) / marketDivisor; + const shortInterestInTokensUsingLongToken = + BigInt(dataStoreValues.shortInterestInTokensUsingLongToken.returnValues[0]) / marketDivisor; + const shortInterestInTokensUsingShortToken = + BigInt(dataStoreValues.shortInterestInTokensUsingShortToken.returnValues[0]) / marketDivisor; + + const longInterestInTokens = longInterestInTokensUsingLongToken + longInterestInTokensUsingShortToken; + const shortInterestInTokens = shortInterestInTokensUsingLongToken + shortInterestInTokensUsingShortToken; + + const { nextFunding, virtualInventory } = readerValues.marketInfo.returnValues; + + const [, poolValueInfoMin] = readerValues.marketTokenPriceMin.returnValues as [ + unknown, + { + poolValue: bigint; + + longPnl: bigint; + shortPnl: bigint; + netPnl: bigint; + }, + ]; + + const [, poolValueInfoMax] = readerValues.marketTokenPriceMax.returnValues as [ + unknown, + { poolValue: bigint; totalBorrowingFees: bigint; longPnl: bigint; shortPnl: bigint; netPnl: bigint }, + ]; + + acc[marketAddress] = { + longInterestUsd, + shortInterestUsd, + longInterestInTokens, + shortInterestInTokens, + longPoolAmount: dataStoreValues.longPoolAmount.returnValues[0] / marketDivisor, + shortPoolAmount: dataStoreValues.shortPoolAmount.returnValues[0] / marketDivisor, + poolValueMin: poolValueInfoMin.poolValue, + poolValueMax: poolValueInfoMax.poolValue, + totalBorrowingFees: poolValueInfoMax.totalBorrowingFees, + positionImpactPoolAmount: dataStoreValues.positionImpactPoolAmount.returnValues[0], + swapImpactPoolAmountLong: dataStoreValues.swapImpactPoolAmountLong.returnValues[0], + swapImpactPoolAmountShort: dataStoreValues.swapImpactPoolAmountShort.returnValues[0], + + borrowingFactorPerSecondForLongs: readerValues.marketInfo.returnValues.borrowingFactorPerSecondForLongs, + borrowingFactorPerSecondForShorts: readerValues.marketInfo.returnValues.borrowingFactorPerSecondForShorts, + + fundingFactorPerSecond: nextFunding.fundingFactorPerSecond, + longsPayShorts: nextFunding.longsPayShorts, + + virtualPoolAmountForLongToken: virtualInventory.virtualPoolAmountForLongToken, + virtualPoolAmountForShortToken: virtualInventory.virtualPoolAmountForShortToken, + virtualInventoryForPositions: virtualInventory.virtualInventoryForPositions, + }; + + return acc; + }, + {} as { + [marketAddress: string]: MarketValues; + } + ); + + return result; + }); + } + + private async getMarketsConfigs({ + marketsAddresses, + marketsData, + }: { + marketsAddresses: string[] | undefined; + marketsData: MarketsData | undefined; + }) { + const dataStoreAddress = getContract(this.chainId, "DataStore"); + + const request = await buildMarketsConfigsRequest(this.chainId, { + marketsData, + marketsAddresses, + dataStoreAddress, + }); + + return this.sdk.executeMulticall(request).then((res) => { + const result = marketsAddresses!.reduce( + (acc, marketAddress) => { + const dataStoreErrors = res.errors[`${marketAddress}-dataStore`]; + + const dataStoreValues = res.data[`${marketAddress}-dataStore`]; + + // Skip invalid market + if (!dataStoreValues || dataStoreErrors) { + // eslint-disable-next-line no-console + console.log("Market info error", marketAddress, dataStoreErrors, dataStoreValues); + return acc; + } + + acc[marketAddress] = { + isDisabled: dataStoreValues.isDisabled.returnValues[0], + maxLongPoolUsdForDeposit: dataStoreValues.maxLongPoolUsdForDeposit.returnValues[0], + maxShortPoolUsdForDeposit: dataStoreValues.maxShortPoolUsdForDeposit.returnValues[0], + maxLongPoolAmount: dataStoreValues.maxLongPoolAmount.returnValues[0], + maxShortPoolAmount: dataStoreValues.maxShortPoolAmount.returnValues[0], + longPoolAmountAdjustment: dataStoreValues.longPoolAmountAdjustment.returnValues[0], + shortPoolAmountAdjustment: dataStoreValues.shortPoolAmountAdjustment.returnValues[0], + reserveFactorLong: dataStoreValues.reserveFactorLong.returnValues[0], + reserveFactorShort: dataStoreValues.reserveFactorShort.returnValues[0], + openInterestReserveFactorLong: dataStoreValues.openInterestReserveFactorLong.returnValues[0], + openInterestReserveFactorShort: dataStoreValues.openInterestReserveFactorShort.returnValues[0], + maxOpenInterestLong: dataStoreValues.maxOpenInterestLong.returnValues[0], + maxOpenInterestShort: dataStoreValues.maxOpenInterestShort.returnValues[0], + minPositionImpactPoolAmount: dataStoreValues.minPositionImpactPoolAmount.returnValues[0], + positionImpactPoolDistributionRate: dataStoreValues.positionImpactPoolDistributionRate.returnValues[0], + borrowingFactorLong: dataStoreValues.borrowingFactorLong.returnValues[0], + borrowingFactorShort: dataStoreValues.borrowingFactorShort.returnValues[0], + borrowingExponentFactorLong: dataStoreValues.borrowingExponentFactorLong.returnValues[0], + borrowingExponentFactorShort: dataStoreValues.borrowingExponentFactorShort.returnValues[0], + fundingFactor: dataStoreValues.fundingFactor.returnValues[0], + fundingExponentFactor: dataStoreValues.fundingExponentFactor.returnValues[0], + fundingIncreaseFactorPerSecond: dataStoreValues.fundingIncreaseFactorPerSecond.returnValues[0], + fundingDecreaseFactorPerSecond: dataStoreValues.fundingDecreaseFactorPerSecond.returnValues[0], + thresholdForDecreaseFunding: dataStoreValues.thresholdForDecreaseFunding.returnValues[0], + thresholdForStableFunding: dataStoreValues.thresholdForStableFunding.returnValues[0], + minFundingFactorPerSecond: dataStoreValues.minFundingFactorPerSecond.returnValues[0], + maxFundingFactorPerSecond: dataStoreValues.maxFundingFactorPerSecond.returnValues[0], + + maxPnlFactorForTradersLong: dataStoreValues.maxPnlFactorForTradersLong.returnValues[0], + maxPnlFactorForTradersShort: dataStoreValues.maxPnlFactorForTradersShort.returnValues[0], + + minCollateralFactor: dataStoreValues.minCollateralFactor.returnValues[0], + minCollateralFactorForOpenInterestLong: + dataStoreValues.minCollateralFactorForOpenInterestLong.returnValues[0], + + minCollateralFactorForOpenInterestShort: + dataStoreValues.minCollateralFactorForOpenInterestShort.returnValues[0], + + positionFeeFactorForPositiveImpact: dataStoreValues.positionFeeFactorForPositiveImpact.returnValues[0], + positionFeeFactorForNegativeImpact: dataStoreValues.positionFeeFactorForNegativeImpact.returnValues[0], + positionImpactFactorPositive: dataStoreValues.positionImpactFactorPositive.returnValues[0], + positionImpactFactorNegative: dataStoreValues.positionImpactFactorNegative.returnValues[0], + maxPositionImpactFactorPositive: dataStoreValues.maxPositionImpactFactorPositive.returnValues[0], + maxPositionImpactFactorNegative: dataStoreValues.maxPositionImpactFactorNegative.returnValues[0], + maxPositionImpactFactorForLiquidations: + dataStoreValues.maxPositionImpactFactorForLiquidations.returnValues[0], + positionImpactExponentFactor: dataStoreValues.positionImpactExponentFactor.returnValues[0], + swapFeeFactorForPositiveImpact: dataStoreValues.swapFeeFactorForPositiveImpact.returnValues[0], + swapFeeFactorForNegativeImpact: dataStoreValues.swapFeeFactorForNegativeImpact.returnValues[0], + swapImpactFactorPositive: dataStoreValues.swapImpactFactorPositive.returnValues[0], + swapImpactFactorNegative: dataStoreValues.swapImpactFactorNegative.returnValues[0], + swapImpactExponentFactor: dataStoreValues.swapImpactExponentFactor.returnValues[0], + + virtualMarketId: dataStoreValues.virtualMarketId.returnValues[0], + virtualLongTokenId: dataStoreValues.virtualLongTokenId.returnValues[0], + virtualShortTokenId: dataStoreValues.virtualShortTokenId.returnValues[0], + }; + + return acc; + }, + {} as { + [marketAddress: string]: MarketConfig; + } + ); + + return result; + }); + } + + private _marketsData: MarketsResult | undefined; + async getMarkets(offset = 0n, limit = 100n): Promise { + if (this._marketsData) { + return this._marketsData; + } + + const readerAddress = getContract(this.chainId, "SyntheticsReader"); + const dataStoreAddress = getContract(this.chainId, "DataStore"); + + const apiMarkets = await this.sdk.oracle.getMarkets(); + const configMarkets = this.sdk.config.markets ?? {}; + + const marketsMap = apiMarkets.reduce( + (acc, market) => { + if (configMarkets[market.marketToken]?.isListed === false) { + return acc; + } + + return { + ...acc, + [market.marketToken]: market, + }; + }, + {} as { [marketToken: string]: MarketSdkConfig } + ); + + const markets = await this.sdk + .executeMulticall({ + markets: { + contractAddress: readerAddress, + abiId: "SyntheticsReader", + calls: { + markets: { + methodName: "getMarkets", + params: [dataStoreAddress, offset, offset + limit], + }, + }, + }, + }) + .then((res) => { + return res.data.markets.markets.returnValues.map( + (market: { marketToken: string; indexToken: string; longToken: string; shortToken: string }) => { + return { + marketTokenAddress: market.marketToken, + indexTokenAddress: market.indexToken, + longTokenAddress: market.longToken, + shortTokenAddress: market.shortToken, + }; + } + ); + }); + + const chainId = this.chainId; + + const marketsResult = markets.reduce( + (acc: MarketsResult, market) => { + try { + if (!marketsMap[market.marketTokenAddress]?.isListed) { + return acc; + } + + const indexToken = getToken(chainId, convertTokenAddress(chainId, market.indexTokenAddress, "native")); + const longToken = getToken(chainId, market.longTokenAddress); + const shortToken = getToken(chainId, market.shortTokenAddress); + + const isSameCollaterals = market.longTokenAddress === market.shortTokenAddress; + const isSpotOnly = market.indexTokenAddress === zeroAddress; + + const name = getMarketFullName({ indexToken, longToken, shortToken, isSpotOnly }); + + acc.marketsAddresses!.push(market.marketTokenAddress); + acc.marketsData![market.marketTokenAddress] = { + ...market, + isSameCollaterals, + isSpotOnly, + name, + data: "", + }; + } catch (e) { + // eslint-disable-next-line no-console + console.warn(`Unsupported market ${market.marketTokenAddress}`, e); + } + + return acc; + }, + { marketsData: {}, marketsAddresses: [] } + ); + + this._marketsData = marketsResult; + return marketsResult; + } + + async getMarketsInfo(): Promise { + const { marketsData, marketsAddresses } = await this.getMarkets(); + const { tokensData, pricesUpdatedAt } = await this.sdk.tokens.getTokensData(); + + const [marketsValues, marketsConfigs, claimableFundingData] = await Promise.all([ + this.getMarketsValues({ + account: this.account, + marketsAddresses, + marketsData, + tokensData, + }), + this.getMarketsConfigs({ + marketsAddresses, + marketsData, + }), + this.getClaimableFundingData(), + ]); + + if (!marketsValues || !marketsConfigs || !marketsAddresses || !claimableFundingData) { + return { + marketsInfoData: {}, + tokensData, + pricesUpdatedAt, + }; + } + + // Manual merging to avoid cloning tokens as they are sometimes compared by reference + const marketsInfoData: MarketsInfoData = {}; + for (const marketAddress of marketsAddresses) { + const market = marketsData?.[marketAddress]; + const marketValues = marketsValues[marketAddress]; + const marketConfig = marketsConfigs[marketAddress]; + + const longToken = getByKey(tokensData!, market?.longTokenAddress); + const shortToken = getByKey(tokensData!, market?.shortTokenAddress); + const indexToken = market + ? getByKey(tokensData!, convertTokenAddress(this.chainId, market.indexTokenAddress, "native")) + : undefined; + + if (!market || !marketValues || !marketConfig || !longToken || !shortToken || !indexToken) { + continue; + } + + const fullMarketInfo: MarketInfo = { + ...marketValues, + ...marketConfig, + ...claimableFundingData[marketAddress], + ...market, + longToken, + shortToken, + indexToken, + }; + + marketsInfoData[marketAddress] = fullMarketInfo; + } + + return { + marketsInfoData, + tokensData, + pricesUpdatedAt, + }; + } + + async getDailyVolumes(): Promise | undefined> { + const { marketsAddresses } = await this.getMarkets(); + + const endpoint = this.sdk.config.subsquidUrl; + + if (!marketsAddresses || !endpoint) { + return; + } + + const LAST_DAY_UNIX_TIMESTAMP = Math.floor(Date.now() / 1000) - 24 * 60 * 60; + const timestamp = LAST_DAY_UNIX_TIMESTAMP + TIMEZONE_OFFSET_SEC; + const variables = { + timestamp: timestamp, + }; + + return graphqlFetcher(endpoint, POSITIONS_VOLUME_INFOS_QUERY, variables).then( + (data) => { + return data?.positionsVolume.length + ? data?.positionsVolume.reduce((acc, { market, volume }) => { + return { ...acc, [market]: BigInt(volume) }; + }, {}) + : {}; + } + ); + } +} + +type PositionVolumeInfosResponse = { + positionsVolume: { + market: string; + volume: string; + }[]; +}; + +const POSITIONS_VOLUME_INFOS_QUERY = ` +query PositionVolumeInfoResolver($timestamp: Float!) { + positionsVolume(where: {timestamp: $timestamp}) { + market + volume + } +}`; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/markets.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/markets.spec.ts new file mode 100644 index 0000000..0e6b2ae --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/markets.spec.ts @@ -0,0 +1,42 @@ +import {GmxSdk} from "../../index.js"; +import {arbitrumSdk, arbitrumSdkConfig} from "../../utils/testUtil.js"; +import {describe, expect, it} from "vitest"; + +describe("Markets", () => { + describe("getMarkets", () => { + it("should be able to get markets data", async () => { + const marketsData = await arbitrumSdk.markets.getMarkets(); + expect(marketsData.marketsAddresses).toBeDefined(); + expect(marketsData.marketsData).toBeDefined(); + }); + + it("should respect config filters", async () => { + const sdk = new GmxSdk({ + ...arbitrumSdkConfig, + markets: { + "0x47c031236e19d024b42f8AE6780E44A573170703": { + isListed: false, + }, + }, + }); + const baseSdkResponse = await arbitrumSdk.markets.getMarkets(); + const sdkResponse = await sdk.markets.getMarkets(); + expect(baseSdkResponse.marketsData?.["0x47c031236e19d024b42f8AE6780E44A573170703"]).toBeDefined(); + expect(sdkResponse.marketsData?.["0x47c031236e19d024b42f8AE6780E44A573170703"]).not.toBeDefined(); + }); + }); + + describe("getMarketsInfo", () => { + it("should be able to get markets info", async () => { + const response = await arbitrumSdk.markets.getMarketsInfo(); + expect(response).toBeDefined(); + }); + }); + + describe("getDailyVolumes", () => { + it("should be able to get daily volumes", async () => { + const response = await arbitrumSdk.markets.getDailyVolumes(); + expect(response).toBeDefined(); + }, 30_000); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/query-builders.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/query-builders.ts new file mode 100644 index 0000000..02bb8d3 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/query-builders.ts @@ -0,0 +1,447 @@ +import {CLAIMABLE_FUNDING_AMOUNT, MAX_PNL_FACTOR_FOR_TRADERS_KEY} from "../../configs/dataStore.js"; +import {HASHED_MARKET_CONFIG_KEYS, HASHED_MARKET_VALUES_KEYS} from "../../prebuilt/index.js"; +import {MarketsData} from "../../types/markets.js"; +import {TokensData} from "../../types/tokens.js"; +import {hashDataMap} from "../../utils/hash.js"; +import {hashMarketConfigKeys, hashMarketValuesKeys} from "../../utils/marketKeysAndConfigs.js"; +import {getContractMarketPrices} from "../../utils/markets.js"; +import {getByKey} from "../../utils/objects.js"; +import {MarketConfigMulticallRequestConfig, MarketValuesMulticallRequestConfig} from "./types.js"; +import {getContract} from "../../configs/contracts.js"; +import { ContractCallsConfig } from "../../utils/multicall.js"; + +export function buildClaimableFundingDataRequest({ + marketsAddresses, + marketsData, + chainId, + account, +}: { + marketsAddresses: string[] | undefined; + marketsData: MarketsData | undefined; + account: string; + chainId: number; +}) { + if (!marketsAddresses) { + return {}; + } + + return marketsAddresses.reduce((request, marketAddress) => { + const market = getByKey(marketsData, marketAddress); + + if (!market) { + return request; + } + + const keys = hashDataMap({ + claimableFundingAmountLong: [ + ["bytes32", "address", "address", "address"], + [CLAIMABLE_FUNDING_AMOUNT, marketAddress, market.longTokenAddress, account], + ], + claimableFundingAmountShort: [ + ["bytes32", "address", "address", "address"], + [CLAIMABLE_FUNDING_AMOUNT, marketAddress, market.shortTokenAddress, account], + ], + }); + + request[marketAddress] = { + contractAddress: getContract(chainId, "DataStore"), + abiId: "DataStore", + calls: { + claimableFundingAmountLong: { + methodName: "getUint", + params: [keys.claimableFundingAmountLong], + }, + claimableFundingAmountShort: { + methodName: "getUint", + params: [keys.claimableFundingAmountShort], + }, + }, + } satisfies ContractCallsConfig; + + return request; + }, {}); +} + +export async function buildMarketsValuesRequest( + chainId: number, + { + marketsAddresses, + marketsData, + tokensData, + dataStoreAddress, + syntheticsReaderAddress, + }: { + marketsAddresses: string[] | undefined; + marketsData: MarketsData | undefined; + tokensData: TokensData | undefined; + dataStoreAddress: string; + syntheticsReaderAddress: string; + } +) { + const request: MarketValuesMulticallRequestConfig = {}; + + for (const marketAddress of marketsAddresses || []) { + const market = getByKey(marketsData, marketAddress)!; + const marketPrices = getContractMarketPrices(tokensData!, market)!; + + if (!marketPrices) { + // eslint-disable-next-line no-console + console.warn(`No market prices for ${marketAddress}, skipping market values request`); + continue; + } + + const marketProps = { + marketToken: market.marketTokenAddress, + indexToken: market.indexTokenAddress, + longToken: market.longTokenAddress, + shortToken: market.shortTokenAddress, + }; + + request[`${marketAddress}-reader`] = { + contractAddress: syntheticsReaderAddress, + abiId: "SyntheticsReader", + calls: { + marketInfo: { + methodName: "getMarketInfo", + params: [dataStoreAddress, marketPrices, marketAddress], + }, + marketTokenPriceMax: { + methodName: "getMarketTokenPrice", + params: [ + dataStoreAddress, + marketProps, + marketPrices.indexTokenPrice, + marketPrices.longTokenPrice, + marketPrices.shortTokenPrice, + MAX_PNL_FACTOR_FOR_TRADERS_KEY, + true, + ], + }, + marketTokenPriceMin: { + methodName: "getMarketTokenPrice", + params: [ + dataStoreAddress, + marketProps, + marketPrices.indexTokenPrice, + marketPrices.longTokenPrice, + marketPrices.shortTokenPrice, + MAX_PNL_FACTOR_FOR_TRADERS_KEY, + false, + ], + }, + }, + } satisfies ContractCallsConfig; + + let prebuiltHashedKeys = HASHED_MARKET_VALUES_KEYS[chainId]?.[marketAddress]; + + if (!prebuiltHashedKeys) { + // eslint-disable-next-line no-console + console.warn( + `No pre-built hashed market keys found for the market ${marketAddress}. Run \`yarn prebuild\` to generate them.` + ); + + if (!marketsData?.[marketAddress]) { + throw new Error(`No market data found for the market ${marketAddress}`); + } + + prebuiltHashedKeys = hashMarketValuesKeys(marketsData[marketAddress]); + } + + const keys = { + ...prebuiltHashedKeys, + }; + + request[`${marketAddress}-dataStore`] = { + contractAddress: dataStoreAddress, + abiId: "DataStore", + calls: { + longPoolAmount: { + methodName: "getUint", + params: [keys.longPoolAmount], + }, + shortPoolAmount: { + methodName: "getUint", + params: [keys.shortPoolAmount], + }, + positionImpactPoolAmount: { + methodName: "getUint", + params: [keys.positionImpactPoolAmount], + }, + swapImpactPoolAmountLong: { + methodName: "getUint", + params: [keys.swapImpactPoolAmountLong], + }, + swapImpactPoolAmountShort: { + methodName: "getUint", + params: [keys.swapImpactPoolAmountShort], + }, + longInterestUsingLongToken: { + methodName: "getUint", + params: [keys.longInterestUsingLongToken], + }, + longInterestUsingShortToken: { + methodName: "getUint", + params: [keys.longInterestUsingShortToken], + }, + shortInterestUsingLongToken: { + methodName: "getUint", + params: [keys.shortInterestUsingLongToken], + }, + shortInterestUsingShortToken: { + methodName: "getUint", + params: [keys.shortInterestUsingShortToken], + }, + longInterestInTokensUsingLongToken: { + methodName: "getUint", + params: [keys.longInterestInTokensUsingLongToken], + }, + longInterestInTokensUsingShortToken: { + methodName: "getUint", + params: [keys.longInterestInTokensUsingShortToken], + }, + shortInterestInTokensUsingLongToken: { + methodName: "getUint", + params: [keys.shortInterestInTokensUsingLongToken], + }, + shortInterestInTokensUsingShortToken: { + methodName: "getUint", + params: [keys.shortInterestInTokensUsingShortToken], + }, + }, + } satisfies ContractCallsConfig; + } + + return request; +} + +export async function buildMarketsConfigsRequest( + chainId: number, + { + marketsData, + marketsAddresses, + dataStoreAddress, + }: { + marketsData: MarketsData | undefined; + marketsAddresses: string[] | undefined; + dataStoreAddress: string; + } +) { + const request: MarketConfigMulticallRequestConfig = {}; + for (const marketAddress of marketsAddresses || []) { + let prebuiltHashedKeys = HASHED_MARKET_CONFIG_KEYS[chainId]?.[marketAddress]; + + if (!prebuiltHashedKeys) { + // eslint-disable-next-line no-console + console.warn( + `No pre-built hashed config keys found for the market ${marketAddress}. Run \`yarn prebuild\` to generate them.` + ); + + if (!marketsData?.[marketAddress]) { + throw new Error(`No market data found for the market ${marketAddress}`); + } + + prebuiltHashedKeys = hashMarketConfigKeys(marketsData[marketAddress]); + } + + request[`${marketAddress}-dataStore`] = { + contractAddress: dataStoreAddress, + abiId: "DataStore", + calls: { + isDisabled: { + methodName: "getBool", + params: [prebuiltHashedKeys.isDisabled], + }, + maxLongPoolAmount: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxLongPoolAmount], + }, + maxShortPoolAmount: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxShortPoolAmount], + }, + maxLongPoolUsdForDeposit: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxLongPoolUsdForDeposit], + }, + maxShortPoolUsdForDeposit: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxShortPoolUsdForDeposit], + }, + longPoolAmountAdjustment: { + methodName: "getUint", + params: [prebuiltHashedKeys.longPoolAmountAdjustment], + }, + shortPoolAmountAdjustment: { + methodName: "getUint", + params: [prebuiltHashedKeys.shortPoolAmountAdjustment], + }, + reserveFactorLong: { + methodName: "getUint", + params: [prebuiltHashedKeys.reserveFactorLong], + }, + reserveFactorShort: { + methodName: "getUint", + params: [prebuiltHashedKeys.reserveFactorShort], + }, + openInterestReserveFactorLong: { + methodName: "getUint", + params: [prebuiltHashedKeys.openInterestReserveFactorLong], + }, + openInterestReserveFactorShort: { + methodName: "getUint", + params: [prebuiltHashedKeys.openInterestReserveFactorShort], + }, + maxOpenInterestLong: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxOpenInterestLong], + }, + maxOpenInterestShort: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxOpenInterestShort], + }, + minPositionImpactPoolAmount: { + methodName: "getUint", + params: [prebuiltHashedKeys.minPositionImpactPoolAmount], + }, + positionImpactPoolDistributionRate: { + methodName: "getUint", + params: [prebuiltHashedKeys.positionImpactPoolDistributionRate], + }, + borrowingFactorLong: { + methodName: "getUint", + params: [prebuiltHashedKeys.borrowingFactorLong], + }, + borrowingFactorShort: { + methodName: "getUint", + params: [prebuiltHashedKeys.borrowingFactorShort], + }, + borrowingExponentFactorLong: { + methodName: "getUint", + params: [prebuiltHashedKeys.borrowingExponentFactorLong], + }, + borrowingExponentFactorShort: { + methodName: "getUint", + params: [prebuiltHashedKeys.borrowingExponentFactorShort], + }, + fundingFactor: { + methodName: "getUint", + params: [prebuiltHashedKeys.fundingFactor], + }, + fundingExponentFactor: { + methodName: "getUint", + params: [prebuiltHashedKeys.fundingExponentFactor], + }, + fundingIncreaseFactorPerSecond: { + methodName: "getUint", + params: [prebuiltHashedKeys.fundingIncreaseFactorPerSecond], + }, + fundingDecreaseFactorPerSecond: { + methodName: "getUint", + params: [prebuiltHashedKeys.fundingDecreaseFactorPerSecond], + }, + thresholdForStableFunding: { + methodName: "getUint", + params: [prebuiltHashedKeys.thresholdForStableFunding], + }, + thresholdForDecreaseFunding: { + methodName: "getUint", + params: [prebuiltHashedKeys.thresholdForDecreaseFunding], + }, + minFundingFactorPerSecond: { + methodName: "getUint", + params: [prebuiltHashedKeys.minFundingFactorPerSecond], + }, + maxFundingFactorPerSecond: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxFundingFactorPerSecond], + }, + maxPnlFactorForTradersLong: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxPnlFactorForTradersLong], + }, + maxPnlFactorForTradersShort: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxPnlFactorForTradersShort], + }, + positionFeeFactorForPositiveImpact: { + methodName: "getUint", + params: [prebuiltHashedKeys.positionFeeFactorForPositiveImpact], + }, + positionFeeFactorForNegativeImpact: { + methodName: "getUint", + params: [prebuiltHashedKeys.positionFeeFactorForNegativeImpact], + }, + positionImpactFactorPositive: { + methodName: "getUint", + params: [prebuiltHashedKeys.positionImpactFactorPositive], + }, + positionImpactFactorNegative: { + methodName: "getUint", + params: [prebuiltHashedKeys.positionImpactFactorNegative], + }, + maxPositionImpactFactorPositive: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxPositionImpactFactorPositive], + }, + maxPositionImpactFactorNegative: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxPositionImpactFactorNegative], + }, + maxPositionImpactFactorForLiquidations: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxPositionImpactFactorForLiquidations], + }, + minCollateralFactor: { + methodName: "getUint", + params: [prebuiltHashedKeys.minCollateralFactor], + }, + minCollateralFactorForOpenInterestLong: { + methodName: "getUint", + params: [prebuiltHashedKeys.minCollateralFactorForOpenInterestLong], + }, + minCollateralFactorForOpenInterestShort: { + methodName: "getUint", + params: [prebuiltHashedKeys.minCollateralFactorForOpenInterestShort], + }, + positionImpactExponentFactor: { + methodName: "getUint", + params: [prebuiltHashedKeys.positionImpactExponentFactor], + }, + swapFeeFactorForPositiveImpact: { + methodName: "getUint", + params: [prebuiltHashedKeys.swapFeeFactorForPositiveImpact], + }, + swapFeeFactorForNegativeImpact: { + methodName: "getUint", + params: [prebuiltHashedKeys.swapFeeFactorForNegativeImpact], + }, + swapImpactFactorPositive: { + methodName: "getUint", + params: [prebuiltHashedKeys.swapImpactFactorPositive], + }, + swapImpactFactorNegative: { + methodName: "getUint", + params: [prebuiltHashedKeys.swapImpactFactorNegative], + }, + swapImpactExponentFactor: { + methodName: "getUint", + params: [prebuiltHashedKeys.swapImpactExponentFactor], + }, + virtualMarketId: { + methodName: "getBytes32", + params: [prebuiltHashedKeys.virtualMarketId], + }, + virtualShortTokenId: { + methodName: "getBytes32", + params: [prebuiltHashedKeys.virtualShortTokenId], + }, + virtualLongTokenId: { + methodName: "getBytes32", + params: [prebuiltHashedKeys.virtualLongTokenId], + }, + }, + } satisfies ContractCallsConfig; + } + + return request; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/types.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/types.ts new file mode 100644 index 0000000..0e8843a --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/markets/types.ts @@ -0,0 +1,205 @@ +import {MarketInfo, MarketsData, MarketsInfoData} from "../../types/markets.js"; +import {TokensData} from "../../types/tokens.js"; +import {MulticallRequestConfig} from "../../utils/multicall.js"; + +export type MarketsResult = { + marketsData?: MarketsData; + marketsAddresses?: string[]; + error?: Error | undefined; +}; + +export type MarketsInfoResult = { + marketsInfoData?: MarketsInfoData; + tokensData?: TokensData; + pricesUpdatedAt?: number; +}; + +/** + * Updates frequently + */ +export type MarketValues = Pick< + MarketInfo, + | "longInterestUsd" + | "shortInterestUsd" + | "longInterestInTokens" + | "shortInterestInTokens" + | "longPoolAmount" + | "shortPoolAmount" + | "poolValueMin" + | "poolValueMax" + | "totalBorrowingFees" + | "positionImpactPoolAmount" + | "swapImpactPoolAmountLong" + | "swapImpactPoolAmountShort" + | "borrowingFactorPerSecondForLongs" + | "borrowingFactorPerSecondForShorts" + | "fundingFactorPerSecond" + | "longsPayShorts" + | "virtualPoolAmountForLongToken" + | "virtualPoolAmountForShortToken" + | "virtualInventoryForPositions" +>; + +/** + * Updates seldom + */ +export type MarketConfig = Pick< + MarketInfo, + | "isDisabled" + | "maxLongPoolUsdForDeposit" + | "maxShortPoolUsdForDeposit" + | "maxLongPoolAmount" + | "maxShortPoolAmount" + | "longPoolAmountAdjustment" + | "shortPoolAmountAdjustment" + | "reserveFactorLong" + | "reserveFactorShort" + | "openInterestReserveFactorLong" + | "openInterestReserveFactorShort" + | "maxOpenInterestLong" + | "maxOpenInterestShort" + | "minPositionImpactPoolAmount" + | "positionImpactPoolDistributionRate" + | "borrowingFactorLong" + | "borrowingFactorShort" + | "borrowingExponentFactorLong" + | "borrowingExponentFactorShort" + | "fundingFactor" + | "fundingExponentFactor" + | "fundingIncreaseFactorPerSecond" + | "fundingDecreaseFactorPerSecond" + | "thresholdForDecreaseFunding" + | "thresholdForStableFunding" + | "minFundingFactorPerSecond" + | "maxFundingFactorPerSecond" + | "maxPnlFactorForTradersLong" + | "maxPnlFactorForTradersShort" + | "minCollateralFactor" + | "minCollateralFactorForOpenInterestLong" + | "minCollateralFactorForOpenInterestShort" + | "positionFeeFactorForPositiveImpact" + | "positionFeeFactorForNegativeImpact" + | "positionImpactFactorPositive" + | "positionImpactFactorNegative" + | "maxPositionImpactFactorPositive" + | "maxPositionImpactFactorNegative" + | "maxPositionImpactFactorForLiquidations" + | "positionImpactExponentFactor" + | "swapFeeFactorForPositiveImpact" + | "swapFeeFactorForNegativeImpact" + | "swapImpactFactorPositive" + | "swapImpactFactorNegative" + | "swapImpactExponentFactor" + | "virtualMarketId" + | "virtualLongTokenId" + | "virtualShortTokenId" +>; + +export type MarketValuesMulticallRequestConfig = MulticallRequestConfig<{ + [key: `${string}-reader`]: { + calls: Record< + "marketInfo" | "marketTokenPriceMax" | "marketTokenPriceMin", + { + methodName: string; + params: any[]; + } + >; + }; + [key: `${string}-dataStore`]: { + calls: Record< + | "longPoolAmount" + | "shortPoolAmount" + | "positionImpactPoolAmount" + | "swapImpactPoolAmountLong" + | "swapImpactPoolAmountShort" + | "longInterestUsingLongToken" + | "longInterestUsingShortToken" + | "shortInterestUsingLongToken" + | "shortInterestUsingShortToken" + | "longInterestInTokensUsingLongToken" + | "longInterestInTokensUsingShortToken" + | "shortInterestInTokensUsingLongToken" + | "shortInterestInTokensUsingShortToken", + { + methodName: string; + params: any[]; + } + >; + }; +}>; + +export type MarketConfigMulticallRequestConfig = MulticallRequestConfig<{ + [key: `${string}-dataStore`]: { + calls: Record< + | "isDisabled" + | "maxLongPoolAmount" + | "maxShortPoolAmount" + | "maxLongPoolUsdForDeposit" + | "maxShortPoolUsdForDeposit" + | "longPoolAmountAdjustment" + | "shortPoolAmountAdjustment" + | "reserveFactorLong" + | "reserveFactorShort" + | "openInterestReserveFactorLong" + | "openInterestReserveFactorShort" + | "maxOpenInterestLong" + | "maxOpenInterestShort" + | "minPositionImpactPoolAmount" + | "positionImpactPoolDistributionRate" + | "borrowingFactorLong" + | "borrowingFactorShort" + | "borrowingExponentFactorLong" + | "borrowingExponentFactorShort" + | "fundingFactor" + | "fundingExponentFactor" + | "fundingIncreaseFactorPerSecond" + | "fundingDecreaseFactorPerSecond" + | "thresholdForStableFunding" + | "thresholdForDecreaseFunding" + | "minFundingFactorPerSecond" + | "maxFundingFactorPerSecond" + | "maxPnlFactorForTradersLong" + | "maxPnlFactorForTradersShort" + | "positionFeeFactorForPositiveImpact" + | "positionFeeFactorForNegativeImpact" + | "positionImpactFactorPositive" + | "positionImpactFactorNegative" + | "maxPositionImpactFactorPositive" + | "maxPositionImpactFactorNegative" + | "maxPositionImpactFactorForLiquidations" + | "minCollateralFactor" + | "minCollateralFactorForOpenInterestLong" + | "minCollateralFactorForOpenInterestShort" + | "positionImpactExponentFactor" + | "swapFeeFactorForPositiveImpact" + | "swapFeeFactorForNegativeImpact" + | "swapImpactFactorPositive" + | "swapImpactFactorNegative" + | "swapImpactExponentFactor" + | "virtualMarketId" + | "virtualLongTokenId" + | "virtualShortTokenId", + { + methodName: string; + params: any[]; + } + >; + }; +}>; + +export type KinkModelMarketRateMulticallRequestConfig = MulticallRequestConfig<{ + [key: `${string}-dataStore`]: { + calls: Record< + | "optimalUsageFactorLong" + | "optimalUsageFactorShort" + | "baseBorrowingFactorLong" + | "baseBorrowingFactorShort" + | "aboveOptimalUsageBorrowingFactorLong" + | "aboveOptimalUsageBorrowingFactorShort", + { + methodName: string; + params: any[]; + } + >; + }; +}>; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/oracle.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/oracle.ts new file mode 100644 index 0000000..f2fa038 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/oracle.ts @@ -0,0 +1,67 @@ +import fetch from "cross-fetch"; + +import type {GmxSdk} from "../index.js"; +import {MarketSdkConfig} from "../types/markets.js"; +import {buildUrl} from "../utils/buildUrl.js"; + + +export type TickersResponse = { + minPrice: string; + maxPrice: string; + oracleDecimals: number; + tokenSymbol: string; + tokenAddress: string; + updatedAt: number; +}[]; + +export type TokensResponse = { + symbol: string; + address: string; + decimals: number; + synthetic: boolean; +}[]; + +export class Oracle { + private url: string; + + constructor(public sdk: GmxSdk) { + this.url = sdk.config.oracleUrl; + } + + getMarkets(): Promise { + return fetch(buildUrl(this.url!, "/markets")) + .then((res) => res.json()) + .then((res) => { + if (!res.markets || !res.markets.length) { + throw new Error("Invalid markets response"); + } + + return res.markets; + }); + } + + getTokens(): Promise { + return fetch(buildUrl(this.url!, "/tokens")) + .then((res) => res.json()) + .then((res) => + res.tokens.map(({ synthetic, ...rest }) => { + return { + ...rest, + isSynthetic: synthetic, + }; + }) + ); + } + + getTickers(): Promise { + return fetch(buildUrl(this.url!, "/prices/tickers")) + .then((res) => res.json()) + .then((res) => { + if (!res.length) { + throw new Error("Invalid tickers response"); + } + + return res; + }); + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/helpers.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/helpers.spec.ts new file mode 100644 index 0000000..37865ab --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/helpers.spec.ts @@ -0,0 +1,118 @@ +import { describe, it, expect, vi, beforeEach, beforeAll } from "vitest"; +import * as swapPath from "../../utils/swap/swapPath.js"; +import * as tradeAmounts from "../../utils/trade/amounts.js"; +import { arbitrumSdk } from "../../utils/testUtil.js"; +import { ARBITRUM } from "../../configs/chains.js"; +import { getByKey } from "../../utils/objects.js"; +import { MarketInfo, MarketsInfoData } from "../../types/markets.js"; +import { TokenData, TokensData } from "../../types/tokens.js"; + +describe("increaseOrderHelper", () => { + let mockParams; + let createIncreaseOrderSpy; + + let marketsInfoData: MarketsInfoData; + let tokensData: TokensData; + + let market: MarketInfo; + let payToken: TokenData; + let collateralToken: TokenData; + + beforeAll(async () => { + const result = await arbitrumSdk.markets.getMarketsInfo(); + + if (!result.marketsInfoData || !result.tokensData) { + throw new Error("Markets info data or tokens data is not available"); + } + + marketsInfoData = result.marketsInfoData; + tokensData = result.tokensData; + }); + + beforeEach(() => { + vi.clearAllMocks(); + + createIncreaseOrderSpy = vi.spyOn(arbitrumSdk.orders, "createIncreaseOrder").mockResolvedValue(); + + market = getByKey(marketsInfoData, "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336")!; + + if (!market) { + throw new Error("Market is not available"); + } + + payToken = market.indexToken; + collateralToken = market.shortToken; + + mockParams = { + payAmount: 1000n, + marketAddress: "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336", + payTokenAddress: market.indexToken.address, + collateralTokenAddress: market.shortToken.address, + allowedSlippageBps: 125, + leverage: 50000n, + marketsInfoData, + tokensData, + }; + }); + + it("should call createIncreaseOrder with correct parameters for a market order with payAmount", async () => { + const findSwapPathSpy = vi.spyOn(swapPath, "createFindSwapPath"); + const getIncreasePositionAmountsSpy = vi.spyOn(tradeAmounts, "getIncreasePositionAmounts"); + + await arbitrumSdk.orders.long(mockParams); + + expect(findSwapPathSpy).toHaveBeenCalledWith( + expect.objectContaining({ + chainId: ARBITRUM, + fromTokenAddress: payToken.address, + toTokenAddress: collateralToken.address, + marketsInfoData: expect.any(Object), + estimator: expect.any(Function), + allPaths: expect.any(Array), + }) + ); + + expect(getIncreasePositionAmountsSpy).toHaveBeenCalledWith( + expect.objectContaining({ + isLong: true, + initialCollateralAmount: 1000n, + leverage: 50000n, + strategy: "leverageByCollateral", + marketInfo: market, + }) + ); + + expect(createIncreaseOrderSpy).toHaveBeenCalledWith( + expect.objectContaining({ + marketsInfoData: expect.any(Object), + tokensData: expect.any(Object), + marketInfo: market, + indexToken: market.indexToken, + isLimit: false, + marketAddress: market.marketTokenAddress, + allowedSlippage: 125, + collateralTokenAddress: collateralToken.address, + collateralToken, + isLong: true, + receiveTokenAddress: collateralToken.address, + increaseAmounts: expect.objectContaining({ + initialCollateralAmount: 1000n, + estimatedLeverage: 50000n, + triggerPrice: undefined, + acceptablePrice: 0n, + acceptablePriceDeltaBps: 0n, + positionFeeUsd: 0n, + uiFeeUsd: 0n, + swapUiFeeUsd: 0n, + feeDiscountUsd: 0n, + borrowingFeeUsd: 0n, + fundingFeeUsd: 0n, + positionPriceImpactDeltaUsd: 0n, + limitOrderType: undefined, + triggerThresholdType: undefined, + externalSwapQuote: undefined, + }), + }) + ); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/helpers.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/helpers.ts new file mode 100644 index 0000000..1ac163c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/helpers.ts @@ -0,0 +1,479 @@ +import { MarketsInfoData } from "../../types/markets.js"; +import { DecreasePositionSwapType, OrderType } from "../../types/orders.js"; +import { TokenData, TokensData, TokensRatio } from "../../types/tokens.js"; +import { DecreasePositionAmounts, FindSwapPath, SwapAmounts, TriggerThresholdType } from "../../types/trade.js"; +import { getByKey } from "../../utils/objects.js"; +import { createFindSwapPath, findAllSwapPaths, getWrappedAddress } from "../../utils/swap/swapPath.js"; +import { convertToUsd, getIsUnwrap, getIsWrap, getTokensRatioByPrice } from "../../utils/tokens.js"; +import { getIncreasePositionAmounts } from "../../utils/trade/amounts.js"; + +import type { GmxSdk } from "../.."; +import { createSwapEstimator, getMarketsGraph } from "../../utils/swap/swapRouting.js"; +import { getSwapAmountsByFromValue, getSwapAmountsByToValue } from "../../utils/swap/index.js"; +import { EntryField, SidecarSlTpOrderEntryValid } from "../../types/sidecarOrders.js"; +import { bigMath } from "../../utils/bigmath.js"; + +/** Base Optional params for helpers, allows to avoid calling markets, tokens and uiFeeFactor methods if they are already passed */ +interface BaseOptionalParams { + marketsInfoData?: MarketsInfoData; + tokensData?: TokensData; + uiFeeFactor?: bigint; +} + +export type PositionIncreaseParams = ( + | { + /** Increase amounts will be calculated based on collateral amount */ + payAmount: bigint; + } + | { + /** Increase amounts will be calculated based on position size amount */ + sizeAmount: bigint; + } +) & { + marketAddress: string; + payTokenAddress: string; + collateralTokenAddress: string; + + /** @default 100 */ + allowedSlippageBps?: number; + referralCodeForTxn?: string; + + leverage?: bigint; + /** If presented, then it's limit order */ + limitPrice?: bigint; + acceptablePriceImpactBuffer?: number; + fixedAcceptablePriceImpactBps?: bigint; + + skipSimulation?: boolean; + stopLossPrice?: bigint; + takeProfitPrice?: bigint; +} & BaseOptionalParams; + +async function getAndValidateBaseParams(sdk: GmxSdk, params: BaseOptionalParams) { + let tokensData: TokensData | undefined = params.tokensData; + let marketsInfoData: MarketsInfoData | undefined = params.marketsInfoData; + + if (!params.marketsInfoData && !params.tokensData) { + const result = await sdk.markets.getMarketsInfo(); + marketsInfoData = result.marketsInfoData; + tokensData = result.tokensData; + } + + if (!tokensData) { + throw new Error("Tokens data is not available"); + } + + if (!marketsInfoData) { + throw new Error("Markets info data is not available"); + } + + let uiFeeFactor = params.uiFeeFactor; + if (!uiFeeFactor) { + uiFeeFactor = await sdk.utils.getUiFeeFactor(); + } + + return { + tokensData, + marketsInfoData, + uiFeeFactor, + }; +} + +export async function increaseOrderHelper( + sdk: GmxSdk, + params: PositionIncreaseParams & { + isLong: boolean; + } +) { + const { tokensData, marketsInfoData, uiFeeFactor } = await getAndValidateBaseParams(sdk, params); + + const isLimit = Boolean(params.limitPrice); + + const fromToken = tokensData[params.payTokenAddress]; + const collateralToken = tokensData[params.collateralTokenAddress]; + + if (!fromToken) { + throw new Error("From token is not available"); + } + + if (!collateralToken) { + throw new Error("Collateral token is not available"); + } + + const marketInfo = getByKey(marketsInfoData, params.marketAddress); + + if (!marketInfo) { + throw new Error("Market info is not available"); + } + + const collateralTokenAddress = collateralToken.address; + const allowedSlippage = params.allowedSlippageBps ?? 100; + + const graph = getMarketsGraph(Object.values(marketsInfoData)); + const wrappedFromAddress = getWrappedAddress(sdk.chainId, params.payTokenAddress); + const wrappedToAddress = getWrappedAddress(sdk.chainId, collateralTokenAddress); + + const allPaths = findAllSwapPaths({ + chainId: sdk.chainId, + fromTokenAddress: params.payTokenAddress, + toTokenAddress: collateralTokenAddress, + marketsInfoData, + graph, + wrappedFromAddress, + wrappedToAddress, + }); + + const estimator = createSwapEstimator(marketsInfoData); + + const findSwapPath = createFindSwapPath({ + chainId: sdk.chainId, + fromTokenAddress: params.payTokenAddress, + toTokenAddress: collateralTokenAddress, + marketsInfoData, + estimator, + allPaths, + }); + + const payOrSizeAmount = "payAmount" in params ? params.payAmount : params.sizeAmount; + + const increaseAmounts = getIncreasePositionAmounts({ + marketInfo, + indexToken: marketInfo.indexToken, + initialCollateralToken: fromToken, + collateralToken, + isLong: params.isLong, + initialCollateralAmount: payOrSizeAmount, + position: undefined, + indexTokenAmount: payOrSizeAmount, + leverage: params.leverage, + triggerPrice: params.limitPrice, + limitOrderType: params.limitPrice ? OrderType.LimitIncrease : undefined, + userReferralInfo: undefined, + strategy: "payAmount" in params ? "leverageByCollateral" : "leverageBySize", + findSwapPath: findSwapPath, + uiFeeFactor, + acceptablePriceImpactBuffer: params.acceptablePriceImpactBuffer, + fixedAcceptablePriceImpactBps: params.fixedAcceptablePriceImpactBps, + externalSwapQuote: undefined, + }); + + const createSltpEntries: SidecarSlTpOrderEntryValid[] = [ + + ] + + let stopLossDecreaseAmounts: DecreasePositionAmounts | undefined; + if (params.stopLossPrice) { + const stopLossCollateralDeltaUsd = convertToUsd(increaseAmounts.collateralDeltaAmount, collateralToken.decimals, params.stopLossPrice); + + stopLossDecreaseAmounts = { + isFullClose: true, + sizeDeltaUsd: increaseAmounts.sizeDeltaUsd, + sizeDeltaInTokens: increaseAmounts.sizeDeltaInTokens, + collateralDeltaUsd: stopLossCollateralDeltaUsd, + collateralDeltaAmount: increaseAmounts.collateralDeltaAmount, + indexPrice: 0n, + collateralPrice: 0n, + acceptablePrice: params.stopLossPrice, + acceptablePriceDeltaBps: 0n, + recommendedAcceptablePriceDeltaBps: 0n, + estimatedPnl: 0n, + estimatedPnlPercentage: 0n, + realizedPnl: 0n, + realizedPnlPercentage: 0n, + positionFeeUsd: 0n, + uiFeeUsd: 0n, + swapUiFeeUsd: 0n, + feeDiscountUsd: 0n, + borrowingFeeUsd: 0n, + fundingFeeUsd: 0n, + swapProfitFeeUsd: 0n, + positionPriceImpactDeltaUsd: 0n, + priceImpactDiffUsd: 0n, + payedRemainingCollateralAmount: 0n, + payedOutputUsd: 0n, + payedRemainingCollateralUsd: 0n, + receiveTokenAmount: 0n, + receiveUsd: 0n, + decreaseSwapType: DecreasePositionSwapType.NoSwap, + triggerOrderType: OrderType.LimitDecrease, + triggerPrice: params.stopLossPrice, + } + + const stopLossEntry: SidecarSlTpOrderEntryValid = { + decreaseAmounts: stopLossDecreaseAmounts, + id: "sl-order", + price: { + input: params.stopLossPrice?.toString() ?? "", + value: params.stopLossPrice, + error: null, + } as EntryField, + sizeUsd: { + input: increaseAmounts.sizeDeltaUsd.toString(), + value: increaseAmounts.sizeDeltaUsd, + error: null, + } as EntryField, + percentage: { + input: "100", + value: 100n, + error: null, + } as EntryField, + txnType: "create", + mode: "keepSize", + order: null, + increaseAmounts: undefined + } + + createSltpEntries.push(stopLossEntry) + } + + let takeProfitDecreaseAmounts: DecreasePositionAmounts | undefined; + if (params.takeProfitPrice) { + const takeProfitCollateralDeltaUsd = convertToUsd(increaseAmounts.collateralDeltaAmount, collateralToken.decimals, params.takeProfitPrice); + + takeProfitDecreaseAmounts = { + isFullClose: true, + sizeDeltaUsd: increaseAmounts.sizeDeltaUsd, + sizeDeltaInTokens: increaseAmounts.sizeDeltaInTokens, + collateralDeltaUsd: takeProfitCollateralDeltaUsd, + collateralDeltaAmount: increaseAmounts.collateralDeltaAmount, + indexPrice: 0n, + collateralPrice: 0n, + acceptablePrice: params.takeProfitPrice, + acceptablePriceDeltaBps: 0n, + recommendedAcceptablePriceDeltaBps: 0n, + estimatedPnl: 0n, + estimatedPnlPercentage: 0n, + realizedPnl: 0n, + realizedPnlPercentage: 0n, + positionFeeUsd: 0n, + uiFeeUsd: 0n, + swapUiFeeUsd: 0n, + feeDiscountUsd: 0n, + borrowingFeeUsd: 0n, + fundingFeeUsd: 0n, + swapProfitFeeUsd: 0n, + positionPriceImpactDeltaUsd: 0n, + priceImpactDiffUsd: 0n, + payedRemainingCollateralAmount: 0n, + payedOutputUsd: 0n, + payedRemainingCollateralUsd: 0n, + receiveTokenAmount: 0n, + receiveUsd: 0n, + decreaseSwapType: DecreasePositionSwapType.NoSwap, + triggerOrderType: OrderType.LimitDecrease, + triggerPrice: params.takeProfitPrice, + } + + const takeProfitEntry: SidecarSlTpOrderEntryValid = { + decreaseAmounts: takeProfitDecreaseAmounts, + id: "tp-order", + price: { + input: params.takeProfitPrice?.toString() ?? "", + value: params.takeProfitPrice, + error: null, + } as EntryField, + sizeUsd: { + input: increaseAmounts.sizeDeltaUsd.toString(), + value: increaseAmounts.sizeDeltaUsd, + error: null, + } as EntryField, + percentage: { + input: "100", + value: 100n, + error: null, + } as EntryField, + txnType: "create", + mode: "keepSize", + order: null, + increaseAmounts: undefined + } + + createSltpEntries.push(takeProfitEntry) + } + + const createIncreaseOrderParams: Parameters[0] = { + marketsInfoData, + tokensData, + isLimit, + marketAddress: params.marketAddress, + fromToken: tokensData[params.payTokenAddress], + allowedSlippage, + collateralToken, + referralCodeForTxn: params.referralCodeForTxn, + triggerPrice: params.limitPrice, + collateralTokenAddress: collateralToken.address, + isLong: true, + receiveTokenAddress: collateralTokenAddress, + indexToken: marketInfo.indexToken, + marketInfo, + skipSimulation: params.skipSimulation, + increaseAmounts, + createSltpEntries: createSltpEntries.length > 0 ? createSltpEntries : undefined, + }; + + return sdk.orders.createIncreaseOrder(createIncreaseOrderParams); +} + +function getTriggerRatio({ + toToken, + fromToken, + triggerPrice, +}: { + toToken: TokenData; + fromToken: TokenData; + triggerPrice: bigint; +}) { + const fromTokenPrice = fromToken?.prices.minPrice; + const markPrice = toToken.prices.minPrice; + + const markRatio = getTokensRatioByPrice({ + fromToken, + toToken, + fromPrice: fromTokenPrice, + toPrice: markPrice, + }); + + const triggerRatio: TokensRatio = { + ratio: triggerPrice > 0 ? triggerPrice : markRatio.ratio, + largestToken: markRatio.largestToken, + smallestToken: markRatio.smallestToken, + }; + + return triggerRatio; +} + +export type SwapParams = ( + | { + fromAmount: bigint; + } + | { + toAmount: bigint; + } +) & { + fromTokenAddress: string; + toTokenAddress: string; + allowedSlippageBps?: number; + referralCodeForTxn?: string; + + /** If presented, then it's limit swap order */ + triggerPrice?: bigint; +} & BaseOptionalParams; + +export async function swap(sdk: GmxSdk, params: SwapParams) { + const { tokensData, marketsInfoData, uiFeeFactor } = await getAndValidateBaseParams(sdk, params); + + const fromToken = tokensData[params.fromTokenAddress]; + const toToken = tokensData[params.toTokenAddress]; + + if (!fromToken || !toToken) { + throw new Error("From or to token is not available"); + } + + const isLimit = Boolean(params.triggerPrice); + + if (!fromToken || !toToken) { + return undefined; + } + + const graph = getMarketsGraph(Object.values(marketsInfoData)); + const wrappedFromAddress = getWrappedAddress(sdk.chainId, params.fromTokenAddress); + const wrappedToAddress = getWrappedAddress(sdk.chainId, params.toTokenAddress); + + const allPaths = findAllSwapPaths({ + chainId: sdk.chainId, + fromTokenAddress: params.fromTokenAddress, + toTokenAddress: params.toTokenAddress, + marketsInfoData, + graph, + wrappedFromAddress, + wrappedToAddress, + }); + + const estimator = createSwapEstimator(marketsInfoData); + + const findSwapPath = createFindSwapPath({ + chainId: sdk.chainId, + fromTokenAddress: params.fromTokenAddress, + toTokenAddress: params.toTokenAddress, + marketsInfoData, + estimator, + allPaths, + }); + + const isWrapOrUnwrap = Boolean( + fromToken && toToken && (getIsWrap(fromToken, toToken) || getIsUnwrap(fromToken, toToken)) + ); + + const swapOptimizationOrder: Parameters[1]["order"] = isLimit ? ["length", "liquidity"] : undefined; + + let swapAmounts: SwapAmounts | undefined; + + const fromTokenPrice = fromToken.prices.minPrice; + const triggerRatio = params.triggerPrice + ? getTriggerRatio({ + fromToken, + toToken, + triggerPrice: params.triggerPrice, + }) + : undefined; + + if (isWrapOrUnwrap) { + const tokenAmount = "fromAmount" in params ? params.fromAmount : params.toAmount; + const usdAmount = convertToUsd(tokenAmount, fromToken.decimals, fromTokenPrice)!; + const price = fromTokenPrice; + + swapAmounts = { + amountIn: tokenAmount, + usdIn: usdAmount!, + amountOut: tokenAmount, + usdOut: usdAmount!, + swapPathStats: undefined, + priceIn: price, + priceOut: price, + minOutputAmount: tokenAmount, + }; + + return swapAmounts; + } else if ("fromAmount" in params) { + swapAmounts = getSwapAmountsByFromValue({ + tokenIn: fromToken, + tokenOut: toToken, + amountIn: params.fromAmount, + triggerRatio, + isLimit, + findSwapPath: findSwapPath, + uiFeeFactor, + swapOptimizationOrder, + allowedSwapSlippageBps: isLimit ? BigInt(params.allowedSlippageBps ?? 100) : undefined, + }); + } else { + swapAmounts = getSwapAmountsByToValue({ + tokenIn: fromToken, + tokenOut: toToken, + amountOut: params.toAmount, + triggerRatio, + isLimit: isLimit, + findSwapPath: findSwapPath, + uiFeeFactor, + swapOptimizationOrder, + allowedSwapSlippageBps: isLimit ? BigInt(params.allowedSlippageBps ?? 100) : undefined, + }); + } + + if (!swapAmounts) { + return undefined; + } + + const createSwapOrderParams: Parameters[0] = { + tokensData, + fromToken: tokensData[params.fromTokenAddress], + toToken: tokensData[params.toTokenAddress], + swapAmounts, + isLimit, + allowedSlippage: params.allowedSlippageBps ?? 100, + referralCodeForTxn: params.referralCodeForTxn, + triggerPrice: params.triggerPrice, + }; + + return sdk.orders.createSwapOrder(createSwapOrderParams); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/orders.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/orders.spec.ts new file mode 100644 index 0000000..92e7d9c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/orders.spec.ts @@ -0,0 +1,20 @@ +import {describe, expect, it} from "vitest"; +import {arbitrumSdk} from "../../utils/testUtil.js"; + +describe("Positions", () => { + describe("read", () => { + it("should be able to get orders", async () => { + const { marketsInfoData, tokensData } = (await arbitrumSdk.markets.getMarketsInfo()) ?? {}; + + if (!tokensData || !marketsInfoData) { + throw new Error("Tokens data or markets info is not available"); + } + + const orders = await arbitrumSdk.orders.getOrders({ + marketsInfoData, + tokensData, + }); + expect(orders).toBeDefined(); + }); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/orders.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/orders.ts new file mode 100644 index 0000000..e738ad2 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/orders.ts @@ -0,0 +1,429 @@ +import { Address } from "viem"; + +import { getWrappedToken } from "../../configs/tokens.js"; +import { MarketFilterLongShortItemData } from "../../modules/trades/trades.js"; + +import { MarketInfo, MarketsInfoData } from "../../types/markets.js"; +import { Order, OrdersData, OrdersInfoData, OrderType, PositionOrderInfo } from "../../types/orders.js"; +import { SidecarLimitOrderEntryValid, SidecarSlTpOrderEntryValid } from "../../types/sidecarOrders.js"; +import { TokenData, TokensData } from "../../types/tokens.js"; +import { DecreasePositionAmounts, IncreasePositionAmounts, SwapAmounts } from "../../types/trade.js"; + +import { getByKey } from "../../utils/objects.js"; +import { getOrderInfo, isOrderForPositionByData, isVisibleOrder } from "../../utils/orders.js"; + +import { createDecreaseOrderTxn } from "./transactions/createDecreaseOrderTxn.js"; +import { createIncreaseOrderTxn } from "./transactions/createIncreaseOrderTxn.js"; +import { buildGetOrdersMulticall, getExecutionFeeAmountForEntry, matchByMarket, parseGetOrdersResponse } from "./utils.js"; +import { Module } from "../base.js"; +import { createSwapOrderTxn } from "./transactions/createSwapOrderTxn.js"; +import { createWrapOrUnwrapTxn, WrapOrUnwrapParams } from "./transactions/createWrapOrUnwrapTxn.js"; +import { cancelOrdersTxn } from "./transactions/cancelOrdersTxn.js"; +import { PositionIncreaseParams, SwapParams, increaseOrderHelper, swap } from "./helpers.js"; + +export class Orders extends Module { + async getOrders({ + account: _account, + marketsInfoData, + tokensData, + orderTypesFilter = [], + marketsDirectionsFilter = [], + }: { + account?: string; + marketsInfoData: MarketsInfoData; + tokensData: TokensData; + orderTypesFilter?: OrderType[]; + marketsDirectionsFilter?: MarketFilterLongShortItemData[]; + }) { + const account = _account || this.account; + + if (!account) { + return { + count: 0, + ordersInfoData: {}, + }; + } + + const nonSwapRelevantDefinedFiltersLowercased: MarketFilterLongShortItemData[] = marketsDirectionsFilter + .filter((filter) => filter.direction !== "swap" && filter.marketAddress !== "any") + .map((filter) => ({ + marketAddress: filter.marketAddress.toLowerCase() as Address, + direction: filter.direction, + collateralAddress: filter.collateralAddress?.toLowerCase() as Address, + })); + + const hasNonSwapRelevantDefinedMarkets = nonSwapRelevantDefinedFiltersLowercased.length > 0; + + const pureDirectionFilters = marketsDirectionsFilter + .filter((filter) => filter.direction !== "any" && filter.marketAddress === "any") + .map((filter) => filter.direction); + const hasPureDirectionFilters = pureDirectionFilters.length > 0; + + const swapRelevantDefinedMarketsLowercased = marketsDirectionsFilter + .filter((filter) => (filter.direction === "any" || filter.direction === "swap") && filter.marketAddress !== "any") + .map((filter) => filter.marketAddress.toLowerCase() as Address); + + const hasSwapRelevantDefinedMarkets = swapRelevantDefinedMarketsLowercased.length > 0; + + const orders = await this.sdk + .executeMulticall(buildGetOrdersMulticall(this.chainId, account)) + .then(parseGetOrdersResponse); + + const filteredOrders = orders.orders.filter((order) => { + if (!isVisibleOrder(order.orderType)) { + return false; + } + + const matchByMarketResult = matchByMarket({ + order, + nonSwapRelevantDefinedFiltersLowercased, + hasNonSwapRelevantDefinedMarkets, + pureDirectionFilters, + hasPureDirectionFilters, + swapRelevantDefinedMarketsLowercased, + hasSwapRelevantDefinedMarkets, + chainId: this.chainId, + marketsInfoData, + }); + + let matchByOrderType = true; + + if (orderTypesFilter.length > 0) { + matchByOrderType = orderTypesFilter.includes(order.orderType); + } + + return matchByMarketResult && matchByOrderType; + }); + + const ordersData = filteredOrders?.reduce((acc, order) => { + acc[order.key] = order; + return acc; + }, {} as OrdersData); + + const wrappedToken = getWrappedToken(this.chainId); + const ordersInfoData = Object.keys(ordersData).reduce((acc: OrdersInfoData, orderKey: string) => { + const order = getByKey(ordersData, orderKey)!; + + const orderInfo = getOrderInfo({ + marketsInfoData, + tokensData, + wrappedNativeToken: wrappedToken, + order: order as Order, + }); + + if (!orderInfo) { + // eslint-disable-next-line no-console + console.warn(`OrderInfo parsing error`, order); + + return acc; + } + + acc[orderKey] = orderInfo; + + return acc; + }, {} as OrdersInfoData); + + return { + count: orders.count, + ordersInfoData, + }; + } + + async createIncreaseOrder({ + isLimit, + marketAddress, + allowedSlippage, + collateralTokenAddress, + receiveTokenAddress, + fromToken, + triggerPrice, + referralCodeForTxn, + increaseAmounts, + collateralToken, + createSltpEntries, + cancelSltpEntries, + updateSltpEntries, + marketInfo, + isLong, + indexToken, + marketsInfoData, + tokensData, + skipSimulation, + }: { + marketsInfoData: MarketsInfoData; + tokensData: TokensData; + isLimit: boolean; + marketAddress: string; + fromToken: TokenData; + allowedSlippage: number; + collateralToken: TokenData; + referralCodeForTxn?: string; + triggerPrice?: bigint; + collateralTokenAddress: string; + receiveTokenAddress: string; + isLong: boolean; + createSltpEntries?: SidecarSlTpOrderEntryValid[]; + cancelSltpEntries?: (SidecarSlTpOrderEntryValid | SidecarLimitOrderEntryValid)[]; + updateSltpEntries?: (SidecarSlTpOrderEntryValid | SidecarLimitOrderEntryValid)[]; + marketInfo: MarketInfo; + indexToken: TokenData; + increaseAmounts: IncreasePositionAmounts; + skipSimulation?: boolean; + }) { + const account = this.account; + + if (!account) { + throw new Error("Account is not defined"); + } + + const gasLimits = await this.sdk.utils.getGasLimits(); + const gasPrice = await this.sdk.utils.getGasPrice(); + const executionFee = await this.sdk.utils.getExecutionFee("increase", tokensData, { + increaseAmounts, + }); + + if (!executionFee) { + throw new Error("Execution fee is not available"); + } + + const { ordersInfoData } = await this.sdk.orders.getOrders({ + marketsInfoData, + tokensData, + }); + const orders = Object.values(ordersInfoData || {}); + const positionOrders = orders.filter((order) => + isOrderForPositionByData(order, { + isLong, + marketAddress, + account, + collateralAddress: collateralToken.address, + }) + ); + + const { autoCancelOrdersLimit } = await this.sdk.positions.getMaxAutoCancelOrders({ + positionOrders, + }); + + const commonSecondaryOrderParams = { + account, + marketAddress, + swapPath: [], + allowedSlippage, + initialCollateralAddress: collateralTokenAddress, + receiveTokenAddress, + isLong, + indexToken, + }; + + return createIncreaseOrderTxn({ + sdk: this.sdk, + createIncreaseOrderParams: { + account, + marketAddress: marketInfo.marketTokenAddress, + initialCollateralAddress: fromToken?.address, + initialCollateralAmount: increaseAmounts.initialCollateralAmount, + targetCollateralAddress: collateralToken.address, + collateralDeltaAmount: increaseAmounts.collateralDeltaAmount, + swapPath: increaseAmounts.swapPathStats?.swapPath || [], + sizeDeltaUsd: increaseAmounts.sizeDeltaUsd, + sizeDeltaInTokens: increaseAmounts.sizeDeltaInTokens, + triggerPrice: isLimit ? triggerPrice : undefined, + acceptablePrice: increaseAmounts.acceptablePrice, + isLong, + orderType: isLimit ? OrderType.LimitIncrease : OrderType.MarketIncrease, + executionFee: executionFee.feeTokenAmount, + allowedSlippage, + referralCode: referralCodeForTxn, + indexToken: marketInfo.indexToken, + tokensData, + skipSimulation: skipSimulation || isLimit, + }, + createDecreaseOrderParams: createSltpEntries?.map((entry, i) => { + return { + ...commonSecondaryOrderParams, + initialCollateralDeltaAmount: entry.decreaseAmounts.collateralDeltaAmount ?? 0n, + sizeDeltaUsd: entry.decreaseAmounts.sizeDeltaUsd, + sizeDeltaInTokens: entry.decreaseAmounts.sizeDeltaInTokens, + acceptablePrice: entry.decreaseAmounts.acceptablePrice, + triggerPrice: entry.decreaseAmounts.triggerPrice, + minOutputUsd: 0n, + decreasePositionSwapType: entry.decreaseAmounts.decreaseSwapType, + orderType: entry.decreaseAmounts.triggerOrderType!, + referralCode: referralCodeForTxn, + executionFee: getExecutionFeeAmountForEntry(this.sdk, entry, gasLimits, tokensData, gasPrice) ?? 0n, + tokensData, + txnType: entry.txnType!, + skipSimulation: isLimit, + autoCancel: i < autoCancelOrdersLimit, + }; + }), + cancelOrderParams: cancelSltpEntries?.map((entry) => ({ + ...commonSecondaryOrderParams, + orderKey: entry.order!.key, + orderType: entry.order!.orderType, + minOutputAmount: 0n, + sizeDeltaUsd: entry.order!.sizeDeltaUsd, + txnType: entry.txnType!, + initialCollateralDeltaAmount: entry.order?.initialCollateralDeltaAmount ?? 0n, + })), + updateOrderParams: updateSltpEntries?.map((entry) => ({ + ...commonSecondaryOrderParams, + orderKey: entry.order!.key, + orderType: entry.order!.orderType, + sizeDeltaUsd: (entry.increaseAmounts?.sizeDeltaUsd || entry.decreaseAmounts?.sizeDeltaUsd)!, + acceptablePrice: (entry.increaseAmounts?.acceptablePrice || entry.decreaseAmounts?.acceptablePrice)!, + triggerPrice: (entry.increaseAmounts?.triggerPrice || entry.decreaseAmounts?.triggerPrice)!, + executionFee: getExecutionFeeAmountForEntry(this.sdk, entry, gasLimits, tokensData, gasPrice) ?? 0n, + minOutputAmount: 0n, + txnType: entry.txnType!, + initialCollateralDeltaAmount: entry.order?.initialCollateralDeltaAmount ?? 0n, + autoCancel: entry.order!.autoCancel, + })), + }); + } + + async createDecreaseOrder({ + marketsInfoData, + tokensData, + marketInfo, + decreaseAmounts, + collateralToken, + allowedSlippage, + isLong, + referralCode, + }: { + marketInfo: MarketInfo; + marketsInfoData: MarketsInfoData; + tokensData: TokensData; + isLong: boolean; + allowedSlippage: number; + decreaseAmounts: DecreasePositionAmounts; + collateralToken: TokenData; + referralCode?: string; + }) { + const account = this.account; + if (!account) { + throw new Error("Account is not defined"); + } + + const executionFee = await this.sdk.utils.getExecutionFee("decrease", tokensData, { + decreaseAmounts, + }); + + if (!executionFee) { + throw new Error("Execution fee is not available"); + } + + if (decreaseAmounts?.triggerOrderType === undefined) { + throw new Error("Trigger order type is not defined"); + } + + const { ordersInfoData } = await this.sdk.orders.getOrders({ + marketsInfoData, + tokensData, + }); + const orders = Object.values(ordersInfoData || {}); + const positionOrders = orders.filter((order) => + isOrderForPositionByData(order, { + isLong, + marketAddress: marketInfo.marketTokenAddress, + account, + collateralAddress: collateralToken.address, + }) + ) as PositionOrderInfo[]; + + const { autoCancelOrdersLimit } = await this.sdk.positions.getMaxAutoCancelOrders({ + positionOrders, + }); + + return createDecreaseOrderTxn(this.sdk, { + account, + marketAddress: marketInfo.marketTokenAddress, + swapPath: [], + initialCollateralDeltaAmount: decreaseAmounts.collateralDeltaAmount, + initialCollateralAddress: collateralToken.address, + receiveTokenAddress: collateralToken.address, + triggerPrice: decreaseAmounts.triggerPrice, + acceptablePrice: decreaseAmounts.acceptablePrice, + sizeDeltaUsd: decreaseAmounts.sizeDeltaUsd, + sizeDeltaInTokens: decreaseAmounts.sizeDeltaInTokens, + minOutputUsd: BigInt(0), + isLong, + decreasePositionSwapType: decreaseAmounts.decreaseSwapType, + orderType: decreaseAmounts?.triggerOrderType, + executionFee: executionFee.feeTokenAmount, + allowedSlippage, + referralCode, + skipSimulation: true, + indexToken: marketInfo.indexToken, + tokensData, + autoCancel: autoCancelOrdersLimit > 0, + }); + } + + async createSwapOrder({ + isLimit, + swapAmounts, + allowedSlippage, + fromToken, + toToken, + referralCodeForTxn, + tokensData, + triggerPrice, + }: { + isLimit: boolean; + allowedSlippage: number; + swapAmounts: SwapAmounts; + fromToken: TokenData; + referralCodeForTxn?: string; + toToken: TokenData; + tokensData: TokensData; + triggerPrice?: bigint; + }) { + const orderType = isLimit ? OrderType.LimitSwap : OrderType.MarketSwap; + + const executionFee = await this.sdk.utils.getExecutionFee("swap", tokensData, { + swapAmounts, + }); + + if (!swapAmounts?.swapPathStats || !executionFee) { + throw new Error("Swap data is not defined"); + } + + return createSwapOrderTxn(this.sdk, { + fromTokenAddress: fromToken.address, + fromTokenAmount: swapAmounts.amountIn, + swapPath: swapAmounts.swapPathStats?.swapPath, + toTokenAddress: toToken.address, + orderType, + minOutputAmount: swapAmounts.minOutputAmount, + referralCode: referralCodeForTxn, + executionFee: executionFee.feeTokenAmount, + allowedSlippage, + tokensData, + triggerPrice: isLimit && triggerPrice !== undefined ? triggerPrice : undefined, + }); + } + + async cancelOrders(orderKeys: string[]) { + return cancelOrdersTxn(this.sdk, { + orderKeys: orderKeys, + }); + } + + async createWrapOrUnwrapOrder(p: WrapOrUnwrapParams) { + return createWrapOrUnwrapTxn(this.sdk, p); + } + + async long(params: PositionIncreaseParams) { + return increaseOrderHelper(this.sdk, { ...params, isLong: true }); + } + + async short(params: PositionIncreaseParams) { + return increaseOrderHelper(this.sdk, { ...params, isLong: false }); + } + + async swap(params: SwapParams) { + return swap(this.sdk, params); + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/cancelOrdersTxn.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/cancelOrdersTxn.ts new file mode 100644 index 0000000..706454c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/cancelOrdersTxn.ts @@ -0,0 +1,26 @@ +import { Abi, encodeFunctionData } from "viem"; + +import { abis } from "../../../abis/index.js"; +import { getContract } from "../../../configs/contracts.js"; + +import type { GmxSdk } from "../../../index.js"; + +export type CancelOrderParams = { + orderKeys: string[]; +}; + +export async function cancelOrdersTxn(sdk: GmxSdk, p: CancelOrderParams) { + const multicall = createCancelEncodedPayload(p.orderKeys); + const exchangeRouter = getContract(sdk.chainId, "ExchangeRouter"); + return sdk.callContract(exchangeRouter, abis.ExchangeRouter as Abi, "multicall", [multicall]); +} + +export function createCancelEncodedPayload(orderKeys: (string | null)[] = []) { + return orderKeys.filter(Boolean).map((orderKey) => + encodeFunctionData({ + abi: abis.ExchangeRouter as Abi, + functionName: "cancelOrder", + args: [orderKey], + }) + ); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createDecreaseOrderTxn.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createDecreaseOrderTxn.ts new file mode 100644 index 0000000..50455d1 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createDecreaseOrderTxn.ts @@ -0,0 +1,154 @@ +import { getContract } from "../../../configs/contracts.js"; + +import type { DecreasePositionSwapType, OrderType } from "../../../types/orders.js"; +import type { Token, TokensData } from "../../../types/tokens.js"; +import type { GmxSdk } from "../../../index.js"; +import type { PriceOverrides } from "./createIncreaseOrderTxn.js"; + +import { abis } from "../../../abis/index.js"; +import { convertTokenAddress, NATIVE_TOKEN_ADDRESS } from "../../../configs/tokens.js"; +import { isMarketOrderType } from "../../../utils/orders.js"; +import { simulateExecuteOrder } from "../../../utils/simulateExecuteOrder.js"; +import { convertToContractPrice } from "../../../utils/tokens.js"; +import { applySlippageToMinOut, applySlippageToPrice } from "../../../utils/trade/index.js"; +import { Abi, encodeFunctionData, zeroAddress, zeroHash } from "viem"; + +export type DecreaseOrderParams = { + account: string; + marketAddress: string; + initialCollateralAddress: string; + initialCollateralDeltaAmount: bigint; + swapPath: string[]; + receiveTokenAddress: string; + sizeDeltaUsd: bigint; + sizeDeltaInTokens: bigint; + acceptablePrice: bigint; + triggerPrice: bigint | undefined; + minOutputUsd: bigint; + isLong: boolean; + decreasePositionSwapType: DecreasePositionSwapType; + orderType: OrderType.MarketDecrease | OrderType.LimitDecrease | OrderType.StopLossDecrease; + executionFee: bigint; + allowedSlippage: number; + skipSimulation?: boolean; + referralCode?: string; + indexToken: Token; + tokensData: TokensData; + autoCancel: boolean; +}; + +export async function createDecreaseOrderTxn(sdk: GmxSdk, params: DecreaseOrderParams | DecreaseOrderParams[]) { + const chainId = sdk.chainId; + const ps = Array.isArray(params) ? params : [params]; + const orderVaultAddress = getContract(chainId, "OrderVault"); + const totalWntAmount = ps.reduce((acc, p) => acc + p.executionFee, 0n); + + const encodedPayload = createDecreaseEncodedPayload({ + sdk, + orderVaultAddress, + ps, + }); + + const simulationEncodedPayload = createDecreaseEncodedPayload({ + sdk, + orderVaultAddress, + ps, + }); + + await Promise.all( + ps.map(async (p) => { + if (!p.skipSimulation) { + const primaryPriceOverrides: PriceOverrides = {}; + if (p.triggerPrice != undefined) { + primaryPriceOverrides[p.indexToken.address] = { + minPrice: p.triggerPrice, + maxPrice: p.triggerPrice, + }; + } + await simulateExecuteOrder(sdk, { + primaryPriceOverrides, + createMulticallPayload: simulationEncodedPayload, + value: totalWntAmount, + tokensData: p.tokensData, + }); + } + }) + ); + + const routerAddress = getContract(chainId, "ExchangeRouter"); + + await sdk.callContract(routerAddress, abis.ExchangeRouter as Abi, "multicall", [encodedPayload], { + value: totalWntAmount, + }); +} + +export function createDecreaseEncodedPayload({ + sdk, + orderVaultAddress, + ps, +}: { + sdk: GmxSdk; + orderVaultAddress: string; + ps: DecreaseOrderParams[]; +}) { + const multicall = [ + ...ps.flatMap((p) => { + const isNativeReceive = p.receiveTokenAddress === NATIVE_TOKEN_ADDRESS; + + const initialCollateralTokenAddress = convertTokenAddress(sdk.chainId, p.initialCollateralAddress, "wrapped"); + + const shouldApplySlippage = isMarketOrderType(p.orderType); + + const acceptablePrice = shouldApplySlippage + ? applySlippageToPrice(p.allowedSlippage, p.acceptablePrice, false, p.isLong) + : p.acceptablePrice; + + const minOutputAmount = shouldApplySlippage + ? applySlippageToMinOut(p.allowedSlippage, p.minOutputUsd) + : p.minOutputUsd; + const orderParams = { + addresses: { + cancellationReceiver: zeroAddress, + receiver: p.account, + initialCollateralToken: initialCollateralTokenAddress, + callbackContract: zeroAddress, + market: p.marketAddress, + swapPath: p.swapPath, + uiFeeReceiver: zeroAddress, + }, + numbers: { + sizeDeltaUsd: p.sizeDeltaUsd, + initialCollateralDeltaAmount: p.initialCollateralDeltaAmount, + triggerPrice: convertToContractPrice(p.triggerPrice ?? 0n, p.indexToken.decimals), + acceptablePrice: convertToContractPrice(acceptablePrice, p.indexToken.decimals), + executionFee: p.executionFee, + callbackGasLimit: 0n, + minOutputAmount, + validFromTime: 0n, + }, + orderType: p.orderType, + decreasePositionSwapType: p.decreasePositionSwapType, + isLong: p.isLong, + shouldUnwrapNativeToken: isNativeReceive, + autoCancel: p.autoCancel, + referralCode: p.referralCode || zeroHash, + }; + + return [ + { method: "sendWnt", params: [orderVaultAddress, p.executionFee] }, + { + method: "createOrder", + params: [orderParams], + }, + ]; + }), + ]; + + return multicall.filter(Boolean).map((call) => + encodeFunctionData({ + abi: abis.ExchangeRouter as Abi, + functionName: call!.method, + args: call!.params as any, + }) + ); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createIncreaseOrderTxn.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createIncreaseOrderTxn.ts new file mode 100644 index 0000000..442d1c4 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createIncreaseOrderTxn.ts @@ -0,0 +1,301 @@ +import { abis } from "../../../abis/index.js"; +import { getContract } from "../../../configs/contracts.js"; +import { convertTokenAddress, NATIVE_TOKEN_ADDRESS } from "../../../configs/tokens.js"; + +import type { GmxSdk } from "../../../index.js"; +import concat from "lodash/concat.js"; +import { DecreasePositionSwapType, OrderTxnType, OrderType } from "../../../types/orders.js"; +import { TokenData, TokenPrices, TokensData } from "../../../types/tokens.js"; +import { isMarketOrderType } from "../../../utils/orders.js"; +import { convertToContractPrice } from "../../../utils/tokens.js"; +import { Abi, encodeFunctionData, zeroAddress, zeroHash } from "viem"; +import { createCancelEncodedPayload } from "./cancelOrdersTxn.js"; +import { createDecreaseEncodedPayload, DecreaseOrderParams } from "./createDecreaseOrderTxn.js"; +import { createUpdateEncodedPayload } from "./updateOrderTxn.js"; +import { simulateExecuteOrder } from "../../../utils/simulateExecuteOrder.js"; +import { applySlippageToMinOut, applySlippageToPrice } from "../../../utils/trade/index.js"; + +export type PriceOverrides = { + [address: string]: TokenPrices | undefined; +}; + +type IncreaseOrderParams = { + account: string; + marketAddress: string; + initialCollateralAddress: string; + targetCollateralAddress: string; + initialCollateralAmount: bigint; + collateralDeltaAmount: bigint; + swapPath: string[]; + sizeDeltaUsd: bigint; + sizeDeltaInTokens: bigint; + acceptablePrice: bigint; + triggerPrice: bigint | undefined; + isLong: boolean; + orderType: OrderType.MarketIncrease | OrderType.LimitIncrease; + executionFee: bigint; + allowedSlippage: number; + skipSimulation?: boolean; + referralCode: string | undefined; + indexToken: TokenData; + tokensData: TokensData; +}; + +type SecondaryOrderCommonParams = { + account: string; + marketAddress: string; + swapPath: string[]; + allowedSlippage: number; + initialCollateralAddress: string; + receiveTokenAddress: string; + isLong: boolean; + indexToken: TokenData; + txnType: OrderTxnType; + orderType: OrderType; + sizeDeltaUsd: bigint; + initialCollateralDeltaAmount: bigint; +}; + +export type SecondaryDecreaseOrderParams = DecreaseOrderParams & SecondaryOrderCommonParams; + +export type SecondaryCancelOrderParams = SecondaryOrderCommonParams & { + orderKey: string | null; +}; + +export type SecondaryUpdateOrderParams = SecondaryOrderCommonParams & { + orderKey: string; + sizeDeltaUsd: bigint; + acceptablePrice: bigint; + triggerPrice: bigint; + executionFee: bigint; + indexToken: TokenData; + minOutputAmount: bigint; + autoCancel: boolean; +}; + +export async function createIncreaseOrderTxn({ + sdk, + createIncreaseOrderParams: p, + createDecreaseOrderParams, + cancelOrderParams, + updateOrderParams, +}: { + sdk: GmxSdk; + createIncreaseOrderParams: IncreaseOrderParams; + createDecreaseOrderParams?: SecondaryDecreaseOrderParams[]; + cancelOrderParams?: SecondaryCancelOrderParams[]; + updateOrderParams?: SecondaryUpdateOrderParams[]; +}) { + const isNativePayment = p.initialCollateralAddress === NATIVE_TOKEN_ADDRESS; + + const chainId = sdk.chainId; + + const exchangeRouter = getContract(chainId, "ExchangeRouter"); + const orderVaultAddress = getContract(chainId, "OrderVault"); + const wntCollateralAmount = isNativePayment ? p.initialCollateralAmount : 0n; + const initialCollateralTokenAddress = convertTokenAddress(chainId, p.initialCollateralAddress, "wrapped"); + const shouldApplySlippage = isMarketOrderType(p.orderType); + const acceptablePrice = shouldApplySlippage + ? applySlippageToPrice(p.allowedSlippage, p.acceptablePrice, true, p.isLong) + : p.acceptablePrice; + + const wntAmountToIncrease = wntCollateralAmount + p.executionFee; + const totalWntAmount = concat( + createDecreaseOrderParams, + updateOrderParams + ).reduce((acc, p) => (p ? acc + p.executionFee : acc), wntAmountToIncrease); + + const encodedPayload = await createEncodedPayload({ + routerAbi: abis.ExchangeRouter as Abi, + orderVaultAddress, + totalWntAmount: wntAmountToIncrease, + p, + acceptablePrice, + isNativePayment, + initialCollateralTokenAddress, + }); + + const simulationEncodedPayload = await createEncodedPayload({ + routerAbi: abis.ExchangeRouter as Abi, + orderVaultAddress, + totalWntAmount: wntAmountToIncrease, + p, + acceptablePrice, + isNativePayment, + initialCollateralTokenAddress, + }); + + const decreaseEncodedPayload = createDecreaseEncodedPayload({ + sdk, + orderVaultAddress, + ps: createDecreaseOrderParams || [], + }); + + const cancelEncodedPayload = createCancelEncodedPayload(cancelOrderParams?.map(({ orderKey }) => orderKey) || []); + const updateEncodedPayload = + updateOrderParams?.reduce( + ( + acc, + { orderKey, sizeDeltaUsd, executionFee, indexToken, acceptablePrice, triggerPrice, minOutputAmount, autoCancel } + ) => { + return [ + ...acc, + ...createUpdateEncodedPayload({ + sdk, + orderKey, + sizeDeltaUsd, + executionFee, + indexToken, + acceptablePrice, + triggerPrice, + minOutputAmount, + autoCancel, + }), + ]; + }, + [] + ) ?? []; + + const primaryPriceOverrides: PriceOverrides = {}; + + if (p.triggerPrice != undefined) { + primaryPriceOverrides[p.indexToken.address] = { + minPrice: p.triggerPrice, + maxPrice: p.triggerPrice, + }; + } + + if (!p.skipSimulation) { + await simulateExecuteOrder(sdk, { + tokensData: p.tokensData, + primaryPriceOverrides, + createMulticallPayload: simulationEncodedPayload, + value: totalWntAmount, + }); + } + + const finalPayload = [...encodedPayload, ...decreaseEncodedPayload, ...cancelEncodedPayload, ...updateEncodedPayload]; + + await sdk.callContract(exchangeRouter, abis.ExchangeRouter as Abi, "multicall", [finalPayload], { + value: totalWntAmount, + }); +} + +async function createEncodedPayload({ + routerAbi, + orderVaultAddress, + totalWntAmount, + p, + acceptablePrice, + isNativePayment, + initialCollateralTokenAddress, +}: { + routerAbi: Abi; + orderVaultAddress: string; + totalWntAmount: bigint; + p: IncreaseOrderParams; + acceptablePrice: bigint; + isNativePayment: boolean; + initialCollateralTokenAddress: string; +}) { + const orderParams = createOrderParams({ + p, + acceptablePrice, + initialCollateralTokenAddress, + isNativePayment, + }); + const multicall = [ + { method: "sendWnt", params: [orderVaultAddress, totalWntAmount] }, + + !isNativePayment + ? { method: "sendTokens", params: [p.initialCollateralAddress, orderVaultAddress, p.initialCollateralAmount] } + : undefined, + + { + method: "createOrder", + params: [orderParams], + }, + ]; + return multicall.filter(Boolean).map((call) => + encodeFunctionData({ + abi: routerAbi, + functionName: call!.method, + args: call!.params as any, + }) + ); +} + +function createOrderParams({ + p, + acceptablePrice, + initialCollateralTokenAddress, + isNativePayment, +}: { + p: IncreaseOrderParams; + acceptablePrice: bigint; + initialCollateralTokenAddress: string; + isNativePayment: boolean; +}) { + return { + addresses: { + cancellationReceiver: zeroAddress, + receiver: p.account, + initialCollateralToken: initialCollateralTokenAddress, + callbackContract: zeroAddress, + market: p.marketAddress, + swapPath: p.swapPath, + uiFeeReceiver: zeroAddress, + }, + numbers: { + sizeDeltaUsd: p.sizeDeltaUsd, + initialCollateralDeltaAmount: 0n, + triggerPrice: convertToContractPrice(p.triggerPrice ?? 0n, p.indexToken.decimals), + acceptablePrice: convertToContractPrice(acceptablePrice, p.indexToken.decimals), + executionFee: p.executionFee, + callbackGasLimit: 0n, + minOutputAmount: 0n, + validFromTime: 0n, + }, + orderType: p.orderType, + decreasePositionSwapType: DecreasePositionSwapType.NoSwap, + isLong: p.isLong, + shouldUnwrapNativeToken: isNativePayment, + autoCancel: false, + referralCode: p.referralCode || zeroHash, + }; +} + +export function getPendingOrderFromParams( + chainId: number, + txnType: OrderTxnType, + p: DecreaseOrderParams | SecondaryUpdateOrderParams | SecondaryCancelOrderParams +) { + const isNativeReceive = p.receiveTokenAddress === NATIVE_TOKEN_ADDRESS; + + const shouldApplySlippage = isMarketOrderType(p.orderType); + let minOutputAmount = 0n; + if ("minOutputUsd" in p) { + shouldApplySlippage ? applySlippageToMinOut(p.allowedSlippage, p.minOutputUsd) : p.minOutputUsd; + } + if ("minOutputAmount" in p) { + minOutputAmount = p.minOutputAmount; + } + const initialCollateralTokenAddress = convertTokenAddress(chainId, p.initialCollateralAddress, "wrapped"); + + const orderKey = "orderKey" in p && p.orderKey ? p.orderKey : undefined; + + return { + txnType, + account: p.account, + marketAddress: p.marketAddress, + initialCollateralTokenAddress, + initialCollateralDeltaAmount: p.initialCollateralDeltaAmount, + swapPath: p.swapPath, + sizeDeltaUsd: p.sizeDeltaUsd, + minOutputAmount: minOutputAmount, + isLong: p.isLong, + orderType: p.orderType, + shouldUnwrapNativeToken: isNativeReceive, + orderKey, + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createSwapOrderTxn.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createSwapOrderTxn.ts new file mode 100644 index 0000000..700b01b --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createSwapOrderTxn.ts @@ -0,0 +1,121 @@ +import { Abi, encodeFunctionData, zeroAddress, zeroHash } from "viem"; + +import { abis } from "../../../abis/index.js"; +import { getContract } from "../../../configs/contracts.js"; +import { NATIVE_TOKEN_ADDRESS, convertTokenAddress } from "../../../configs/tokens.js"; + +import { DecreasePositionSwapType, OrderType } from "../../../types/orders.js"; +import { TokensData } from "../../../types/tokens.js"; + +import { isMarketOrderType } from "../../../utils/orders.js"; +import { applySlippageToMinOut } from "../../../utils/trade/index.js"; +import { simulateExecuteOrder } from "../../../utils/simulateExecuteOrder.js"; + +import type { GmxSdk } from "../../.."; + +export type SwapOrderParams = { + fromTokenAddress: string; + fromTokenAmount: bigint; + toTokenAddress: string; + swapPath: string[]; + referralCode?: string; + tokensData: TokensData; + minOutputAmount: bigint; + orderType: OrderType.MarketSwap | OrderType.LimitSwap; + executionFee: bigint; + allowedSlippage: number; + triggerPrice?: bigint; +}; + +export async function createSwapOrderTxn(sdk: GmxSdk, p: SwapOrderParams) { + const { encodedPayload, totalWntAmount } = await getParams(sdk, p); + const { encodedPayload: simulationEncodedPayload, totalWntAmount: sumaltionTotalWntAmount } = await getParams(sdk, p); + + if (p.orderType !== OrderType.LimitSwap) { + await simulateExecuteOrder(sdk, { + primaryPriceOverrides: {}, + createMulticallPayload: simulationEncodedPayload, + value: sumaltionTotalWntAmount, + tokensData: p.tokensData, + }); + } + + await sdk.callContract( + getContract(sdk.chainId, "ExchangeRouter"), + abis.ExchangeRouter as Abi, + "multicall", + [encodedPayload], + { + value: totalWntAmount, + } + ); +} + +async function getParams(sdk: GmxSdk, p: SwapOrderParams) { + const isNativePayment = p.fromTokenAddress === NATIVE_TOKEN_ADDRESS; + const isNativeReceive = p.toTokenAddress === NATIVE_TOKEN_ADDRESS; + const orderVaultAddress = getContract(sdk.chainId, "OrderVault"); + const wntSwapAmount = isNativePayment ? p.fromTokenAmount : 0n; + const totalWntAmount = wntSwapAmount + p.executionFee; + + const initialCollateralTokenAddress = convertTokenAddress(sdk.chainId, p.fromTokenAddress, "wrapped"); + + const shouldApplySlippage = isMarketOrderType(p.orderType); + + const minOutputAmount = shouldApplySlippage + ? applySlippageToMinOut(p.allowedSlippage, p.minOutputAmount) + : p.minOutputAmount; + + const initialCollateralDeltaAmount = p.fromTokenAmount; + + const createOrderParams = { + addresses: { + receiver: sdk.config.account, + cancellationReceiver: zeroAddress, + initialCollateralToken: initialCollateralTokenAddress, + callbackContract: zeroAddress, + market: zeroAddress, + swapPath: p.swapPath, + uiFeeReceiver: zeroAddress, + }, + numbers: { + sizeDeltaUsd: 0n, + initialCollateralDeltaAmount, + triggerPrice: p.triggerPrice !== undefined ? p.triggerPrice : 0n, + acceptablePrice: 0n, + executionFee: p.executionFee, + callbackGasLimit: 0n, + minOutputAmount, + validFromTime: 0n, + }, + autoCancel: false, + orderType: p.orderType, + decreasePositionSwapType: DecreasePositionSwapType.NoSwap, + isLong: false, + shouldUnwrapNativeToken: isNativeReceive, + referralCode: p.referralCode || zeroHash, + }; + + const multicall = [ + { method: "sendWnt", params: [orderVaultAddress, totalWntAmount] }, + + !isNativePayment + ? { method: "sendTokens", params: [p.fromTokenAddress, orderVaultAddress, p.fromTokenAmount] } + : undefined, + + { + method: "createOrder", + params: [createOrderParams], + }, + ]; + + return { + minOutputAmount, + totalWntAmount, + encodedPayload: multicall + .filter(Boolean) + .map((call) => + encodeFunctionData({ abi: abis.ExchangeRouter as Abi, functionName: call!.method, args: call!.params as any }) + ), + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createWrapOrUnwrapTxn.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createWrapOrUnwrapTxn.ts new file mode 100644 index 0000000..b7d4b68 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/createWrapOrUnwrapTxn.ts @@ -0,0 +1,23 @@ +import { Abi, Address } from "viem"; + +import { getWrappedToken } from "../../../configs/tokens.js"; +import { abis } from "../../../abis/index.js"; + +import type { GmxSdk } from "../../../index.js"; + +export type WrapOrUnwrapParams = { + amount: bigint; + isWrap: boolean; +}; + +export function createWrapOrUnwrapTxn(sdk: GmxSdk, p: WrapOrUnwrapParams) { + const wrappedToken = getWrappedToken(sdk.chainId); + + if (p.isWrap) { + return sdk.callContract(wrappedToken.address as Address, abis.WETH as Abi, "deposit", [], { + value: p.amount, + }); + } else { + return sdk.callContract(wrappedToken.address as Address, abis.WETH as Abi, "withdraw", [p.amount]); + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/updateOrderTxn.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/updateOrderTxn.ts new file mode 100644 index 0000000..699c0fd --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/transactions/updateOrderTxn.ts @@ -0,0 +1,100 @@ +import { abis } from "../../../abis/index.js"; +import { getContract } from "../../../configs/contracts.js"; + +import type { GmxSdk } from "../../../index.js"; +import { Token } from "../../../types/tokens.js"; +import { convertToContractPrice } from "../../../utils/tokens.js"; +import { Abi, Address, encodeFunctionData } from "viem"; + +export type UpdateOrderParams = { + orderKey: string; + indexToken?: Token; + sizeDeltaUsd: bigint; + triggerPrice: bigint; + acceptablePrice: bigint; + minOutputAmount: bigint; + // used to top-up execution fee for frozen orders + executionFee?: bigint; + autoCancel: boolean; +}; + +export function updateOrderTxn(sdk: GmxSdk, p: UpdateOrderParams): Promise
{ + const { + orderKey, + sizeDeltaUsd, + triggerPrice, + acceptablePrice, + minOutputAmount, + executionFee, + indexToken, + autoCancel, + } = p; + + const router = getContract(sdk.chainId, "ExchangeRouter"); + + const encodedPayload = createUpdateEncodedPayload({ + sdk, + orderKey, + sizeDeltaUsd, + executionFee, + indexToken, + acceptablePrice, + triggerPrice, + minOutputAmount, + autoCancel, + }); + + return sdk.callContract(router, abis.ExchangeRouter as Abi, "multicall", [encodedPayload], { + value: executionFee != undefined && executionFee > 0 ? executionFee : undefined, + }) as Promise
; +} + +export function createUpdateEncodedPayload({ + sdk, + orderKey, + sizeDeltaUsd, + executionFee, + indexToken, + acceptablePrice, + triggerPrice, + autoCancel, + minOutputAmount, +}: { + sdk: GmxSdk; + orderKey: string; + sizeDeltaUsd: bigint; + executionFee?: bigint; + indexToken?: Token; + acceptablePrice: bigint; + triggerPrice: bigint; + minOutputAmount: bigint; + autoCancel: boolean; +}) { + const orderVaultAddress = getContract(sdk.chainId, "OrderVault"); + + const multicall: { method: string; params: any[] }[] = []; + if (executionFee != undefined && executionFee > 0) { + multicall.push({ method: "sendWnt", params: [orderVaultAddress, executionFee] }); + } + + multicall.push({ + method: "updateOrder", + params: [ + orderKey, + sizeDeltaUsd, + acceptablePrice !== undefined ? convertToContractPrice(acceptablePrice, indexToken?.decimals || 0) : 0n, + triggerPrice !== undefined ? convertToContractPrice(triggerPrice, indexToken?.decimals || 0) : 0n, + minOutputAmount, + 0n, + autoCancel, + ], + }); + + return multicall.filter(Boolean).map((call) => + encodeFunctionData({ + abi: abis.ExchangeRouter as Abi, + functionName: call!.method, + args: call!.params, + }) + ); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/utils.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/utils.ts new file mode 100644 index 0000000..162de0a --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/orders/utils.ts @@ -0,0 +1,223 @@ + +import { Address, isAddressEqual } from "viem"; +import { GmxSdk } from "../../index.js"; +import { accountOrderListKey } from "../../configs/dataStore.js"; +import { getWrappedToken } from "../../configs/tokens.js"; +import { GasLimitsConfig } from "../../types/fees.js"; +import { MarketsInfoData } from "../../types/markets.js"; +import { DecreasePositionSwapType, Order, OrderType } from "../../types/orders.js"; +import { SidecarSlTpOrderEntry, SidecarLimitOrderEntry } from "../../types/sidecarOrders"; +import { TokensData } from "../../types/tokens.js"; +import { estimateExecuteDecreaseOrderGasLimit, estimateOrderOraclePriceCount, getExecutionFee } from "../../utils/fees/index.js"; +import { isSwapOrderType, isLimitOrderType, isIncreaseOrderType, isTriggerDecreaseOrderType } from "../../utils/orders.js"; +import { getSwapPathOutputAddresses } from "../../utils/swap/index.js"; +import { MarketFilterLongShortItemData, MarketFilterLongShortDirection } from "../trades/trades.js"; +import { MulticallRequestConfig, MulticallResult } from "../../utils/multicall.js"; +import { getContract } from "../../configs/contracts.js"; + +export const getOrderExecutionFee = ( + sdk: GmxSdk, + swapsCount: number, + decreasePositionSwapType: DecreasePositionSwapType | undefined, + gasLimits: GasLimitsConfig | undefined, + tokensData: TokensData | undefined, + gasPrice: bigint | undefined +) => { + if (!gasLimits || !tokensData || gasPrice === undefined) return; + + const estimatedGas = estimateExecuteDecreaseOrderGasLimit(gasLimits, { + decreaseSwapType: decreasePositionSwapType, + swapsCount: swapsCount ?? 0, + }); + + const oraclePriceCount = estimateOrderOraclePriceCount(swapsCount); + + return getExecutionFee(sdk.chainId, gasLimits, tokensData, estimatedGas, gasPrice, oraclePriceCount); +}; + +export const getExecutionFeeAmountForEntry = ( + sdk: GmxSdk, + entry: SidecarSlTpOrderEntry | SidecarLimitOrderEntry, + gasLimits: GasLimitsConfig, + tokensData: TokensData, + gasPrice: bigint | undefined +) => { + if (!entry.txnType || entry.txnType === "cancel") return undefined; + const securedExecutionFee = entry.order?.executionFee ?? 0n; + + let swapsCount = 0; + + const executionFee = getOrderExecutionFee( + sdk, + swapsCount, + entry.decreaseAmounts?.decreaseSwapType, + gasLimits, + tokensData, + gasPrice + ); + + if (!executionFee || securedExecutionFee >= executionFee.feeTokenAmount) return undefined; + + return executionFee.feeTokenAmount - securedExecutionFee; +}; + +export function matchByMarket({ + order, + nonSwapRelevantDefinedFiltersLowercased, + hasNonSwapRelevantDefinedMarkets, + pureDirectionFilters, + hasPureDirectionFilters, + swapRelevantDefinedMarketsLowercased, + hasSwapRelevantDefinedMarkets, + marketsInfoData, + chainId, +}: { + order: ReturnType["orders"][number]; + nonSwapRelevantDefinedFiltersLowercased: MarketFilterLongShortItemData[]; + hasNonSwapRelevantDefinedMarkets: boolean; + pureDirectionFilters: MarketFilterLongShortDirection[]; + hasPureDirectionFilters: boolean; + swapRelevantDefinedMarketsLowercased: Address[]; + hasSwapRelevantDefinedMarkets: boolean; + marketsInfoData?: MarketsInfoData; + chainId: number; +}) { + if (!hasNonSwapRelevantDefinedMarkets && !hasSwapRelevantDefinedMarkets && !hasPureDirectionFilters) { + return true; + } + + const isSwapOrder = isSwapOrderType(order.orderType); + + const matchesPureDirectionFilter = + hasPureDirectionFilters && + (isSwapOrder + ? pureDirectionFilters.includes("swap") + : pureDirectionFilters.includes(order.isLong ? "long" : "short")); + + if (hasPureDirectionFilters && !matchesPureDirectionFilter) { + return false; + } + + if (!hasNonSwapRelevantDefinedMarkets && !hasSwapRelevantDefinedMarkets) { + return true; + } + + if (isSwapOrder) { + const sourceMarketInSwapPath = swapRelevantDefinedMarketsLowercased.includes( + order.swapPath.at(0)!.toLowerCase() as Address + ); + + const destinationMarketInSwapPath = swapRelevantDefinedMarketsLowercased.includes( + order.swapPath.at(-1)!.toLowerCase() as Address + ); + + return sourceMarketInSwapPath || destinationMarketInSwapPath; + } else if (!isSwapOrder) { + return nonSwapRelevantDefinedFiltersLowercased.some((filter) => { + const marketMatch = filter.marketAddress === "any" || filter.marketAddress === order.marketAddress.toLowerCase(); + const directionMath = filter.direction === "any" || filter.direction === (order.isLong ? "long" : "short"); + const initialCollateralAddress = order.initialCollateralTokenAddress.toLowerCase(); + + let collateralMatch = true; + if (!filter.collateralAddress) { + collateralMatch = true; + } else if (isLimitOrderType(order.orderType)) { + const wrappedToken = getWrappedToken(chainId); + + if (!marketsInfoData) { + collateralMatch = true; + } else { + const { outTokenAddress } = getSwapPathOutputAddresses({ + marketsInfoData, + initialCollateralAddress, + isIncrease: isIncreaseOrderType(order.orderType), + shouldUnwrapNativeToken: order.shouldUnwrapNativeToken, + swapPath: order.swapPath, + wrappedNativeTokenAddress: wrappedToken.address, + }); + + collateralMatch = + outTokenAddress !== undefined && isAddressEqual(outTokenAddress as Address, filter.collateralAddress); + } + } else if (isTriggerDecreaseOrderType(order.orderType)) { + collateralMatch = isAddressEqual(order.initialCollateralTokenAddress as Address, filter.collateralAddress); + } + + return marketMatch && directionMath && collateralMatch; + }); + } + + return false; +} + +export const DEFAULT_COUNT = 1000; + +export function buildGetOrdersMulticall(chainId: number, account: string) { + return { + dataStore: { + contractAddress: getContract(chainId, "DataStore"), + abiId: "DataStore", + calls: { + count: { + methodName: "getBytes32Count", + params: [accountOrderListKey(account!)], + }, + keys: { + methodName: "getBytes32ValuesAt", + params: [accountOrderListKey(account!), 0, DEFAULT_COUNT], + }, + }, + }, + reader: { + contractAddress: getContract(chainId, "SyntheticsReader"), + abiId: "SyntheticsReader", + calls: { + orders: { + methodName: "getAccountOrders", + params: [getContract(chainId, "DataStore"), account, 0, DEFAULT_COUNT], + }, + }, + }, + } satisfies MulticallRequestConfig; +} + +export function parseGetOrdersResponse(res: MulticallResult>) { + const count = Number(res.data.dataStore.count.returnValues[0]); + const orderKeys = res.data.dataStore.keys.returnValues; + const orders = res.data.reader.orders.returnValues as any[]; + + return { + count, + orders: orders.map((order, i) => { + const key = orderKeys[i]; + const { data } = order; + + const orderData: Order = { + key, + account: order.addresses.account as Address, + receiver: order.addresses.receiver as Address, + callbackContract: order.addresses.callbackContract as Address, + marketAddress: order.addresses.market as Address, + initialCollateralTokenAddress: order.addresses.initialCollateralToken as Address, + swapPath: order.addresses.swapPath as Address[], + sizeDeltaUsd: BigInt(order.numbers.sizeDeltaUsd), + initialCollateralDeltaAmount: BigInt(order.numbers.initialCollateralDeltaAmount), + contractTriggerPrice: BigInt(order.numbers.triggerPrice), + contractAcceptablePrice: BigInt(order.numbers.acceptablePrice), + executionFee: BigInt(order.numbers.executionFee), + callbackGasLimit: BigInt(order.numbers.callbackGasLimit), + minOutputAmount: BigInt(order.numbers.minOutputAmount), + updatedAtTime: BigInt(order.numbers.updatedAtTime), + isLong: order.flags.isLong as boolean, + shouldUnwrapNativeToken: order.flags.shouldUnwrapNativeToken as boolean, + isFrozen: order.flags.isFrozen as boolean, + orderType: order.numbers.orderType as OrderType, + decreasePositionSwapType: order.numbers.decreasePositionSwapType as DecreasePositionSwapType, + autoCancel: order.flags.autoCancel as boolean, + data, + }; + + return orderData; + }), + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/positions/positions.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/positions/positions.spec.ts new file mode 100644 index 0000000..36a57e5 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/positions/positions.spec.ts @@ -0,0 +1,34 @@ +import { arbitrumSdk } from "../../utils/testUtil.js"; +import { describe, expect, it } from "vitest"; + +describe("Positions", () => { + describe("getPositions", () => { + it("should be able to get positions data", async () => { + const { marketsInfoData, tokensData } = (await arbitrumSdk.markets.getMarketsInfo()) ?? {}; + + if (!tokensData || !marketsInfoData) { + throw new Error("Tokens data or markets info is not available"); + } + + const positions = await arbitrumSdk.positions.getPositions({ tokensData, marketsData: marketsInfoData }); + + expect(positions).toBeDefined(); + }); + + it("should be able to get positions info", async () => { + const { marketsInfoData, tokensData } = (await arbitrumSdk.markets.getMarketsInfo()) ?? {}; + + if (!tokensData || !marketsInfoData) { + throw new Error("Tokens data or markets info is not available"); + } + + const positions = await arbitrumSdk.positions.getPositionsInfo({ + tokensData, + marketsInfoData, + showPnlInLeverage: true, + }); + + expect(positions).toBeDefined(); + }); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/positions/positions.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/positions/positions.ts new file mode 100644 index 0000000..dcb3c60 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/positions/positions.ts @@ -0,0 +1,672 @@ +import { zeroAddress, zeroHash } from "viem"; + +import { getContract } from "../../configs/contracts.js"; +import { + hashedPositionKey, + MAX_AUTO_CANCEL_ORDERS_KEY, + MIN_COLLATERAL_USD_KEY, + MIN_POSITION_SIZE_USD_KEY, + uiFeeFactorKey, +} from "../../configs/dataStore.js"; +import { ContractMarketPrices, MarketsData, MarketsInfoData } from "../../types/markets.js"; +import { Position, PositionsData, PositionsInfoData } from "../../types/positions.js"; +import { TokensData } from "../../types/tokens.js"; +import { + getContractMarketPrices, + getMarketIndexName, + getMarketPoolName, + getMaxAllowedLeverageByMinCollateralFactor, +} from "../../utils/markets.js"; +import { getByKey } from "../../utils/objects.js"; +import { + getEntryPrice, + getLeverage, + getLiquidationPrice, + getPositionKey, + getPositionNetValue, + getPositionPnlUsd, +} from "../../utils/positions.js"; + +import { Module } from "../base.js"; + +import { UserReferralInfo } from "../../types/referrals.js"; +import { getPositionFee, getPriceImpactForPosition } from "../../utils/fees/index.js"; +import { basisPointsToFloat, getBasisPoints } from "../../utils/numbers.js"; +import { getPositionPendingFeesUsd } from "../../utils/positions.js"; +import { getMarkPrice } from "../../utils/prices.js"; +import { decodeReferralCode } from "../../utils/referrals.js"; +import { convertToTokenAmount, convertToUsd } from "../../utils/tokens.js"; +import { OrderInfo } from "../../types/orders.js"; +import type { MulticallRequestConfig } from "../../utils/multicall.js"; + +type PositionsResult = { + positionsData?: PositionsData; + allPossiblePositionsKeys?: string[]; + error?: Error; +}; + +type PositionsConstantsResult = { + minCollateralUsd?: bigint; + minPositionSizeUsd?: bigint; + maxAutoCancelOrders?: bigint; +}; + +export class Positions extends Module { + static MAX_PENDING_UPDATE_AGE = 600 * 1000; // 10 minutes + + private getKeysAndPricesParams(p: { marketsData: MarketsData | undefined; tokensData: TokensData | undefined }) { + const { marketsData, tokensData } = p; + const account = this.account; + + const values = { + allPositionsKeys: [] as string[], + marketsPrices: [] as ContractMarketPrices[], + marketsKeys: [] as string[], + }; + + if (!account || !marketsData || !tokensData) { + return values; + } + + const markets = Object.values(marketsData); + + for (const market of markets) { + const marketPrices = getContractMarketPrices(tokensData, market); + + if (!marketPrices || market.isSpotOnly) { + continue; + } + + values.marketsKeys.push(market.marketTokenAddress); + values.marketsPrices.push(marketPrices); + + const collaterals = market.isSameCollaterals + ? [market.longTokenAddress] + : [market.longTokenAddress, market.shortTokenAddress]; + + for (const collateralAddress of collaterals) { + for (const isLong of [true, false]) { + const positionKey = getPositionKey(account, market.marketTokenAddress, collateralAddress, isLong); + values.allPositionsKeys.push(positionKey); + } + } + } + + return values; + } + + private getPositionsData(p: { + positionsData: PositionsData | undefined; + allPositionsKeys: string[] | undefined; + }): PositionsData | undefined { + const { positionsData, allPositionsKeys } = p; + + if (!allPositionsKeys) { + return undefined; + } + + return allPositionsKeys.reduce((acc, key) => { + let position: Position; + + if (getByKey(positionsData, key)) { + position = { ...getByKey(positionsData, key)! }; + } else { + return acc; + } + + if (position.sizeInUsd > 0) { + acc[key] = position; + } + + return acc; + }, {} as PositionsData); + } + + async getPositions(p: { + marketsData: MarketsData; + tokensData: TokensData; + start?: number; + end?: number; + }): Promise { + const chainId = this.chainId; + const account = this.sdk.config.account; + + const keysAndPrices = this.getKeysAndPricesParams(p); + + const request = { + reader: { + contractAddress: getContract(chainId, "SyntheticsReader"), + abiId: "SyntheticsReader", + calls: { + positions: { + methodName: "getAccountPositionInfoList", + params: [ + getContract(chainId, "DataStore"), + getContract(chainId, "ReferralStorage"), + account, + keysAndPrices.marketsKeys, + keysAndPrices.marketsPrices, + zeroAddress, + p.start ?? 0, + p.end ?? 1000, + ], + }, + }, + }, + } satisfies MulticallRequestConfig; + + const positions = await this.sdk.executeMulticall(request).then((res) => { + const positions = res.data.reader.positions.returnValues; + + return positions.reduce((positionsMap: PositionsData, positionInfo) => { + const { position, fees, basePnlUsd } = positionInfo; + const { addresses, numbers, flags, data } = position; + const { account, market: marketAddress, collateralToken: collateralTokenAddress } = addresses; + + // Empty position + if (numbers.increasedAtTime == 0n) { + return positionsMap; + } + + const positionKey = getPositionKey(account, marketAddress, collateralTokenAddress, flags.isLong); + const contractPositionKey = hashedPositionKey(account, marketAddress, collateralTokenAddress, flags.isLong); + + positionsMap[positionKey] = { + key: positionKey, + contractKey: contractPositionKey, + account, + marketAddress, + collateralTokenAddress, + sizeInUsd: numbers.sizeInUsd, + sizeInTokens: numbers.sizeInTokens, + collateralAmount: numbers.collateralAmount, + increasedAtTime: numbers.increasedAtTime, + decreasedAtTime: numbers.decreasedAtTime, + isLong: flags.isLong, + pendingBorrowingFeesUsd: fees.borrowing.borrowingFeeUsd, + fundingFeeAmount: fees.funding.fundingFeeAmount, + claimableLongTokenAmount: fees.funding.claimableLongTokenAmount, + claimableShortTokenAmount: fees.funding.claimableShortTokenAmount, + pnl: basePnlUsd, + positionFeeAmount: fees.positionFeeAmount, + traderDiscountAmount: fees.referral.traderDiscountAmount, + uiFeeAmount: fees.ui.uiFeeAmount, + data, + }; + + return positionsMap; + }, {} as PositionsData); + }); + + const positionsData = this.getPositionsData({ + positionsData: positions, + allPositionsKeys: keysAndPrices?.allPositionsKeys, + }); + + return { + positionsData, + }; + } + + private getUiFeeFactorRequest(): Promise { + if (!this.account) { + return Promise.resolve(0n); + } + + return this.sdk + .executeMulticall({ + dataStore: { + contractAddress: getContract(this.chainId, "DataStore"), + abiId: "DataStore", + calls: { + keys: { + methodName: "getUint", + params: [uiFeeFactorKey(this.account)], + }, + }, + }, + }) + .then((res) => { + return BigInt(res.data.dataStore.keys.returnValues[0] ?? 0n); + }); + } + + private _positionsConstants: PositionsConstantsResult | undefined = undefined; + async getPositionsConstants(): Promise { + if (this._positionsConstants) { + return this._positionsConstants; + } + + const constants = await this.sdk + .executeMulticall({ + dataStore: { + contractAddress: getContract(this.chainId, "DataStore"), + abiId: "DataStore", + calls: { + minCollateralUsd: { + methodName: "getUint", + params: [MIN_COLLATERAL_USD_KEY], + }, + minPositionSizeUsd: { + methodName: "getUint", + params: [MIN_POSITION_SIZE_USD_KEY], + }, + maxAutoCancelOrders: { + methodName: "getUint", + params: [MAX_AUTO_CANCEL_ORDERS_KEY], + }, + }, + }, + }) + .then((res) => { + return { + minCollateralUsd: res.data.dataStore.minCollateralUsd.returnValues[0], + minPositionSizeUsd: res.data.dataStore.minPositionSizeUsd.returnValues[0], + maxAutoCancelOrders: res.data.dataStore.maxAutoCancelOrders.returnValues[0], + }; + }); + + this._positionsConstants = constants; + return constants; + } + + async getMaxAutoCancelOrders({ + draftOrdersCount = 0, + positionOrders = [], + }: { + positionOrders?: OrderInfo[]; + draftOrdersCount?: number; + }) { + const constants = await this.getPositionsConstants(); + const maxAutoCancelOrders = constants.maxAutoCancelOrders; + const existingAutoCancelOrders = positionOrders.filter((order) => order.autoCancel); + + let warning = false; + let autoCancelOrdersLimit = 0; + + if (maxAutoCancelOrders === undefined) { + return { + warning, + autoCancelOrdersLimit, + }; + } + + const allowedAutoCancelOrders = Number(maxAutoCancelOrders) - 1; + autoCancelOrdersLimit = allowedAutoCancelOrders - existingAutoCancelOrders.length; + const canAddAutoCancelOrder = autoCancelOrdersLimit - draftOrdersCount > 0; + + if (!canAddAutoCancelOrder) { + warning = true; + } + + return { + warning, + autoCancelOrdersLimit, + }; + } + + private async getCodeOwner(code: string | undefined): Promise { + if (!code) { + return undefined; + } + + const referralStorageAddress = getContract(this.chainId, "ReferralStorage"); + + return this.sdk + .executeMulticall({ + referralStorage: { + contractAddress: referralStorageAddress, + abiId: "ReferralStorage", + calls: { + codeOwner: { + methodName: "codeOwners", + params: [code], + }, + }, + }, + }) + .then((res) => { + return res.data.referralStorage.codeOwner.returnValues[0]; + }); + } + + private async getUserRefferalCode() { + const referralStorageAddress = getContract(this.chainId, "ReferralStorage"); + + const onChainCode = await this.sdk.executeMulticall({ + referralStorage: { + contractAddress: referralStorageAddress, + abiId: "ReferralStorage", + calls: { + traderReferralCodes: { + methodName: "traderReferralCodes", + params: [this.account], + }, + }, + }, + }); + + let attachedOnChain = false; + let userReferralCode: string | undefined = undefined; + let userReferralCodeString: string | undefined = undefined; + let referralCodeForTxn = zeroHash; + + if (onChainCode && onChainCode === zeroHash) { + attachedOnChain = true; + userReferralCode = onChainCode; + userReferralCodeString = decodeReferralCode(onChainCode); + } + + return { + attachedOnChain, + userReferralCode, + userReferralCodeString, + referralCodeForTxn, + }; + } + + private getAffiliateTier(): Promise { + const referralStorageAddress = getContract(this.chainId, "ReferralStorage"); + return this.sdk + .executeMulticall({ + referralStorage: { + contractAddress: referralStorageAddress, + abiId: "ReferralStorage", + calls: { + referrerTiers: { + methodName: "referrerTiers", + params: [this.account], + }, + }, + }, + }) + .then((res) => { + return res.data.referralStorage.referrerTiers.returnValues[0]; + }); + } + + private getTiers(tierLevel?: number) { + if (tierLevel === undefined) { + return { + totalRebate: 0n, + discountShare: 0n, + }; + } + + const referralStorageAddress = getContract(this.chainId, "ReferralStorage"); + + return this.sdk + .executeMulticall({ + referralStorage: { + contractAddress: referralStorageAddress, + abiId: "ReferralStorage", + calls: { + tiers: { + methodName: "tiers", + params: [tierLevel], + }, + }, + }, + }) + .then((res) => { + const [totalRebate, discountShare] = res.data.referralStorage.tiers.returnValues ?? []; + + return { + totalRebate, + discountShare, + }; + }); + } + + private async getReferrerDiscountShare(owner?: string): Promise { + if (!owner) { + return undefined; + } + + return this.sdk + .executeMulticall({ + referralStorage: { + contractAddress: getContract(this.chainId, "ReferralStorage"), + abiId: "ReferralStorage", + calls: { + referrerDiscountShares: { + methodName: "referrerDiscountShares", + params: [owner], + }, + }, + }, + }) + .then((res) => { + return res.data.referralStorage.referrerDiscountShares.returnValues[0]; + }); + } + + private async getUserReferralInfo(): Promise { + const { userReferralCode, userReferralCodeString, attachedOnChain, referralCodeForTxn } = + await this.getUserRefferalCode(); + + const codeOwner = await this.getCodeOwner(userReferralCodeString); + const tierId = await this.getAffiliateTier(); + const { totalRebate, discountShare } = await this.getTiers(tierId); + const customDiscountShare = await this.getReferrerDiscountShare(codeOwner); + + const finalDiscountShare = (customDiscountShare ?? 0n) > 0 ? customDiscountShare : discountShare; + + if ( + !userReferralCode || + !userReferralCodeString || + !codeOwner || + tierId === undefined || + totalRebate === undefined || + finalDiscountShare === undefined || + !referralCodeForTxn + ) { + return undefined; + } + + return { + userReferralCode, + userReferralCodeString, + referralCodeForTxn, + attachedOnChain, + affiliate: codeOwner, + tierId, + totalRebate, + totalRebateFactor: basisPointsToFloat(totalRebate), + discountShare: finalDiscountShare, + discountFactor: basisPointsToFloat(finalDiscountShare), + }; + } + + async getPositionsInfo(p: { + marketsInfoData: MarketsInfoData; + tokensData: TokensData; + showPnlInLeverage: boolean; + }): Promise { + const { showPnlInLeverage, marketsInfoData, tokensData } = p; + const { positionsData } = await this.getPositions({ + marketsData: marketsInfoData, + tokensData, + }); + const { minCollateralUsd } = await this.getPositionsConstants(); + const uiFeeFactor = await this.getUiFeeFactorRequest(); + const userReferralInfo = await this.getUserReferralInfo(); + + if (!positionsData || minCollateralUsd === undefined) { + return {}; + } + + const positionsInfoData = Object.keys(positionsData).reduce((acc: PositionsInfoData, positionKey: string) => { + const position = getByKey(positionsData, positionKey)!; + + const marketInfo = getByKey(marketsInfoData, position.marketAddress); + const indexToken = marketInfo?.indexToken; + const longToken = getByKey(tokensData, marketInfo?.longTokenAddress); + const shortToken = getByKey(tokensData, marketInfo?.shortTokenAddress); + + const pnlToken = position.isLong ? marketInfo?.longToken : marketInfo?.shortToken; + const collateralToken = getByKey(tokensData, position.collateralTokenAddress); + + if (!marketInfo || !indexToken || !pnlToken || !collateralToken || !longToken || !shortToken) { + return acc; + } + + const markPrice = getMarkPrice({ prices: indexToken.prices, isLong: position.isLong, isIncrease: false }); + const collateralMinPrice = collateralToken.prices.minPrice; + + const entryPrice = getEntryPrice({ + sizeInTokens: position.sizeInTokens, + sizeInUsd: position.sizeInUsd, + indexToken, + }); + + const pendingFundingFeesUsd = convertToUsd( + position.fundingFeeAmount, + collateralToken.decimals, + collateralToken.prices.minPrice + )!; + + const pendingClaimableFundingFeesLongUsd = convertToUsd( + position.claimableLongTokenAmount, + marketInfo.longToken.decimals, + marketInfo.longToken.prices.minPrice + )!; + const pendingClaimableFundingFeesShortUsd = convertToUsd( + position.claimableShortTokenAmount, + marketInfo.shortToken.decimals, + marketInfo.shortToken.prices.minPrice + )!; + + const pendingClaimableFundingFeesUsd = pendingClaimableFundingFeesLongUsd + pendingClaimableFundingFeesShortUsd; + + const totalPendingFeesUsd = getPositionPendingFeesUsd({ + pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, + pendingFundingFeesUsd, + }); + + const closingPriceImpactDeltaUsd = getPriceImpactForPosition( + marketInfo, + position.sizeInUsd * -1n, + position.isLong, + { fallbackToZero: true } + ); + + const positionFeeInfo = getPositionFee( + marketInfo, + position.sizeInUsd, + closingPriceImpactDeltaUsd > 0, + userReferralInfo, + uiFeeFactor + ); + + const closingFeeUsd = positionFeeInfo.positionFeeUsd; + const uiFeeUsd = positionFeeInfo.uiFeeUsd ?? 0n; + + const collateralUsd = convertToUsd(position.collateralAmount, collateralToken.decimals, collateralMinPrice)!; + + const remainingCollateralUsd = collateralUsd - totalPendingFeesUsd; + + const remainingCollateralAmount = convertToTokenAmount( + remainingCollateralUsd, + collateralToken.decimals, + collateralMinPrice + )!; + + const pnl = getPositionPnlUsd({ + marketInfo: marketInfo, + sizeInUsd: position.sizeInUsd, + sizeInTokens: position.sizeInTokens, + markPrice, + isLong: position.isLong, + }); + + const pnlPercentage = + collateralUsd !== undefined && collateralUsd != 0n ? getBasisPoints(pnl, collateralUsd) : 0n; + + const netValue = getPositionNetValue({ + collateralUsd: collateralUsd, + pnl, + pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, + pendingFundingFeesUsd: pendingFundingFeesUsd, + closingFeeUsd, + uiFeeUsd, + }); + + const pnlAfterFees = pnl - totalPendingFeesUsd - closingFeeUsd - uiFeeUsd; + const pnlAfterFeesPercentage = + collateralUsd != 0n ? getBasisPoints(pnlAfterFees, collateralUsd + closingFeeUsd) : 0n; + + const leverage = getLeverage({ + sizeInUsd: position.sizeInUsd, + collateralUsd: collateralUsd, + pnl: showPnlInLeverage ? pnl : undefined, + pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, + pendingFundingFeesUsd: pendingFundingFeesUsd, + }); + + const leverageWithPnl = getLeverage({ + sizeInUsd: position.sizeInUsd, + collateralUsd: collateralUsd, + pnl, + pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, + pendingFundingFeesUsd: pendingFundingFeesUsd, + }); + + const maxAllowedLeverage = getMaxAllowedLeverageByMinCollateralFactor(marketInfo.minCollateralFactor); + + const hasLowCollateral = (leverage !== undefined && leverage > maxAllowedLeverage) || false; + + const liquidationPrice = getLiquidationPrice({ + marketInfo, + collateralToken, + sizeInUsd: position.sizeInUsd, + sizeInTokens: position.sizeInTokens, + collateralUsd, + collateralAmount: position.collateralAmount, + userReferralInfo, + minCollateralUsd, + pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, + pendingFundingFeesUsd, + isLong: position.isLong, + }); + + const indexName = getMarketIndexName({ indexToken, isSpotOnly: false }); + const poolName = getMarketPoolName({ longToken, shortToken }); + + acc[positionKey] = { + ...position, + market: marketInfo, + marketInfo, + indexName, + poolName, + indexToken, + collateralToken, + pnlToken, + longToken, + shortToken, + markPrice, + entryPrice, + liquidationPrice, + collateralUsd, + remainingCollateralUsd, + remainingCollateralAmount, + hasLowCollateral, + leverage, + leverageWithPnl, + pnl, + pnlPercentage, + pnlAfterFees, + pnlAfterFeesPercentage, + netValue, + closingFeeUsd, + uiFeeUsd, + pendingFundingFeesUsd, + pendingClaimableFundingFeesUsd, + }; + + return acc; + }, {} as PositionsInfoData); + + return positionsInfoData; + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/tokens/tokens.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/tokens/tokens.spec.ts new file mode 100644 index 0000000..5ef30b2 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/tokens/tokens.spec.ts @@ -0,0 +1,33 @@ +import { describe, expect, it } from "vitest"; + +import { GmxSdk } from "../.."; +import { arbitrumSdk, arbitrumSdkConfig } from "../../utils/testUtil.js"; + +describe("Tokens", () => { + it("should be able to fetch tokens", async () => { + const response = await arbitrumSdk.oracle.getTokens(); + expect(response).toBeDefined(); + }); + + it("should respect passed config", async () => { + const ARB = "0x912CE59144191C1204E64559FE8253a0e49E6548"; + const sdk = new GmxSdk({ + ...arbitrumSdkConfig, + tokens: { + [ARB]: { + symbol: "testARB", + }, + }, + }); + + const data = await sdk.tokens.getTokensData(); + + expect(sdk.tokens.tokensConfig[ARB]?.symbol).toBe("testARB"); + expect(data.tokensData?.[ARB].symbol).toBe("testARB"); + }); + + it("should be able to get tokens data", async () => { + const response = await arbitrumSdk.tokens.getTokensData(); + expect(response).toBeDefined(); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/tokens/tokens.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/tokens/tokens.ts new file mode 100644 index 0000000..b49857c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/tokens/tokens.ts @@ -0,0 +1,178 @@ +import { getContract } from "../../configs/contracts.js"; +import { NATIVE_TOKEN_ADDRESS, getToken, getTokensMap, getV2Tokens, getWrappedToken } from "../../configs/tokens.js"; +import { TokenBalancesData, TokenPricesData, TokensData, Token as TToken } from "../../types/tokens.js"; + +import { Module } from "../base.js"; +import { parseContractPrice } from "../../utils/tokens.js"; +import type { ContractCallsConfig } from "../../utils/multicall.js"; + +type TokenPricesDataResult = { + pricesData?: TokenPricesData; + updatedAt?: number; +}; + +type TokensDataResult = { + tokensData?: TokensData; + pricesUpdatedAt?: number; +}; + +export class Tokens extends Module { + _tokensConfigs: { [key: string]: TToken } | undefined = undefined; + get tokensConfig() { + if (this._tokensConfigs) { + return this._tokensConfigs; + } + + const tokenConfigs = this._tokensConfigs ?? getTokensMap(this.chainId); + + Object.entries(this.sdk.config.tokens ?? []).forEach(([address, token]) => { + tokenConfigs[address] = { + ...tokenConfigs[address], + ...token, + }; + }); + + this._tokensConfigs = tokenConfigs; + + return tokenConfigs; + } + + private getTokenRecentPrices(): Promise { + return this.oracle.getTickers().then((priceItems) => { + const result: TokenPricesData = {}; + + priceItems.forEach((priceItem) => { + let tokenConfig: any; + + try { + tokenConfig = getToken(this.chainId, priceItem.tokenAddress); + } catch (e) { + // ignore unknown token errors + + return; + } + + result[tokenConfig.address] = { + minPrice: parseContractPrice(BigInt(priceItem.minPrice), tokenConfig.decimals), + maxPrice: parseContractPrice(BigInt(priceItem.maxPrice), tokenConfig.decimals), + }; + }); + + const wrappedToken = getWrappedToken(this.chainId); + + if (result[wrappedToken.address] && !result[NATIVE_TOKEN_ADDRESS]) { + result[NATIVE_TOKEN_ADDRESS] = result[wrappedToken.address]; + } + + return { + pricesData: result, + updatedAt: Date.now(), + }; + }); + } + + private getTokensBalances( + account?: string, + tokensList?: { + address: string; + isSynthetic?: boolean; + }[] + ) { + account = account || this.sdk.config.account; + tokensList = tokensList || getV2Tokens(this.chainId); + + return this.sdk + .executeMulticall( + tokensList.reduce((acc, token) => { + // Skip synthetic tokens + if (token.isSynthetic) return acc; + + const address = token.address; + + if (address === NATIVE_TOKEN_ADDRESS) { + acc[address] = { + contractAddress: getContract(this.chainId, "Multicall"), + abiId: "Multicall", + calls: { + balance: { + methodName: "getEthBalance", + params: [account], + }, + }, + } satisfies ContractCallsConfig; + } else { + acc[address] = { + contractAddress: address, + abiId: "Token", + calls: { + balance: { + methodName: "balanceOf", + params: [account], + }, + }, + } satisfies ContractCallsConfig; + } + + return acc; + }, {}) + ) + .then((res) => { + return Object.keys(res.data).reduce((tokenBalances: TokenBalancesData, tokenAddress) => { + tokenBalances[tokenAddress] = res.data[tokenAddress].balance.returnValues[0]; + + return tokenBalances; + }, {} as TokenBalancesData); + }); + } + + getNativeToken(): TToken { + return this.tokensConfig[NATIVE_TOKEN_ADDRESS]; + } + + async getTokensData(): Promise { + const tokenConfigs = this.tokensConfig; + + const [apiTokens, { pricesData, updatedAt: pricesUpdatedAt }] = await Promise.all([ + this.sdk.oracle.getTokens(), + this.getTokenRecentPrices(), + ]); + + const nativeToken = this.getNativeToken(); + const tokens = [nativeToken, ...apiTokens]; + + const { balancesData } = this.account + ? await this.getTokensBalances(this.account, tokens) + : { + balancesData: {}, + }; + + if (!pricesData) { + return { + tokensData: undefined, + pricesUpdatedAt: undefined, + }; + } + + return { + tokensData: tokens.reduce((acc: TokensData, token) => { + const tokenAddress = token.address; + const prices = pricesData[tokenAddress]; + const balance = balancesData?.[tokenAddress]; + const tokenConfig = tokenConfigs[tokenAddress]; + + if (!prices) { + return acc; + } + + acc[tokenAddress] = { + ...token, + ...tokenConfig, + prices, + balance, + }; + return acc; + }, {} as TokensData), + pricesUpdatedAt, + }; + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/trades/trades.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/trades/trades.spec.ts new file mode 100644 index 0000000..8b8fd21 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/trades/trades.spec.ts @@ -0,0 +1,18 @@ +import { describe, expect, it } from "vitest"; +import { arbitrumSdk } from "../../utils/testUtil.js"; + +describe("Trades", () => { + it("should be able to get positions", async () => { + const { marketsInfoData, tokensData } = await arbitrumSdk.markets.getMarketsInfo(); + + const trades = await arbitrumSdk.trades.getTradeHistory({ + forAllAccounts: false, + pageSize: 50, + marketsInfoData, + tokensData, + pageIndex: 0, + }); + + expect(trades).toBeDefined(); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/trades/trades.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/trades/trades.ts new file mode 100644 index 0000000..29be766 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/trades/trades.ts @@ -0,0 +1,523 @@ +import { getWrappedToken } from "../../configs/tokens.js"; +import merge from "lodash/merge.js"; +import { MarketsInfoData } from "../../types/markets.js"; +import { OrderType } from "../../types/orders.js"; +import { Token, TokensData } from "../../types/tokens.js"; +import { PositionTradeAction, RawTradeAction, SwapTradeAction, TradeAction, TradeActionType } from "../../types/tradeHistory.js"; +import graphqlFetcher from "../../utils/graphqlFetcher.js"; +import { getByKey } from "../../utils/objects.js"; +import { isIncreaseOrderType, isLimitOrderType, isSwapOrderType, isTriggerDecreaseOrderType } from "../../utils/orders.js"; +import { buildFiltersBody, GraphQlFilters } from "../../utils/subgraph.js"; +import { getSwapPathOutputAddresses } from "../../utils/swap/swapStats.js"; +import { parseContractPrice } from "../../utils/tokens.js"; +import { Address, getAddress } from "viem"; +import { Module } from "../base.js"; +import { GmxSdk } from "../../index.js"; + +export type MarketFilterLongShortDirection = "long" | "short" | "swap" | "any"; +export type MarketFilterLongShortItemData = { + marketAddress: Address | "any"; + direction: MarketFilterLongShortDirection; + collateralAddress?: Address; +}; + +export class Trades extends Module { + async getTradeHistory(p: { + forAllAccounts?: boolean; + pageSize: number; + fromTxTimestamp?: number; + toTxTimestamp?: number; + marketsInfoData: MarketsInfoData | undefined; + tokensData: TokensData | undefined; + pageIndex: number; + marketsDirectionsFilter?: MarketFilterLongShortItemData[]; + orderEventCombinations?: { + eventName?: TradeActionType; + orderType?: OrderType; + isDepositOrWithdraw?: boolean; + }[]; + }): Promise { + const account = this.account; + + const { + pageSize, + forAllAccounts, + fromTxTimestamp, + toTxTimestamp, + marketsDirectionsFilter, + orderEventCombinations, + marketsInfoData, + pageIndex, + tokensData, + } = p; + + const data = await fetchTradeActions({ + sdk: this.sdk, + pageIndex, + pageSize, + marketsDirectionsFilter, + forAllAccounts, + account, + fromTxTimestamp, + toTxTimestamp, + orderEventCombinations, + marketsInfoData, + tokensData, + }); + + return data?.flat().filter(Boolean) as TradeAction[]; + } +} + +export async function fetchTradeActions({ + sdk, + pageIndex, + pageSize, + marketsDirectionsFilter = [], + forAllAccounts, + account, + fromTxTimestamp, + toTxTimestamp, + orderEventCombinations, + marketsInfoData, + tokensData, +}: { + sdk: GmxSdk; + pageIndex: number; + pageSize: number; + marketsDirectionsFilter: MarketFilterLongShortItemData[] | undefined; + forAllAccounts: boolean | undefined; + account: string | null | undefined; + fromTxTimestamp: number | undefined; + toTxTimestamp: number | undefined; + orderEventCombinations: + | { + eventName?: TradeActionType | undefined; + orderType?: OrderType | undefined; + isDepositOrWithdraw?: boolean | undefined; + }[] + | undefined; + marketsInfoData: MarketsInfoData | undefined; + tokensData: TokensData | undefined; +}): Promise { + const endpoint = sdk.config.subgraphUrl; + const chainId = sdk.chainId; + + if (!endpoint) { + return []; + } + + const skip = pageIndex * pageSize; + const first = pageSize; + + const nonSwapRelevantDefinedFiltersLowercased: MarketFilterLongShortItemData[] = marketsDirectionsFilter + .filter((filter) => filter.direction !== "swap" && filter.marketAddress !== "any") + .map((filter) => ({ + marketAddress: filter.marketAddress.toLowerCase() as Address, + direction: filter.direction, + collateralAddress: filter.collateralAddress?.toLowerCase() as Address, + })); + + const hasNonSwapRelevantDefinedMarkets = nonSwapRelevantDefinedFiltersLowercased.length > 0; + + const pureDirectionFilters = marketsDirectionsFilter + .filter((filter) => filter.direction !== "any" && filter.marketAddress === "any") + .map((filter) => ({ + marketAddress: filter.marketAddress.toLowerCase() as "any", + direction: filter.direction, + })); + const hasPureDirectionFilters = pureDirectionFilters.length > 0; + + const swapRelevantDefinedMarketsLowercased = marketsDirectionsFilter + .filter((filter) => (filter.direction === "any" || filter.direction === "swap") && filter.marketAddress !== "any") + .map((filter) => filter.marketAddress.toLowerCase() as Address | "any"); + + const hasSwapRelevantDefinedMarkets = swapRelevantDefinedMarketsLowercased.length > 0; + + const filtersStr = buildFiltersBody({ + and: [ + { + account: forAllAccounts ? undefined : account!.toLowerCase(), + transaction: { + timestamp_gte: fromTxTimestamp, + timestamp_lte: toTxTimestamp, + }, + }, + { + or: !hasPureDirectionFilters + ? undefined + : pureDirectionFilters.map((filter) => + filter.direction === "swap" + ? { + orderType_in: [OrderType.LimitSwap, OrderType.MarketSwap], + } + : { + isLong: filter.direction === "long", + orderType_not_in: [OrderType.LimitSwap, OrderType.MarketSwap], + } + ), + }, + { + or: [ + // For non-swap orders + { + and: !hasNonSwapRelevantDefinedMarkets + ? undefined + : [ + { + orderType_not_in: [OrderType.LimitSwap, OrderType.MarketSwap], + }, + { + or: nonSwapRelevantDefinedFiltersLowercased.map((filter) => ({ + marketAddress: filter.marketAddress === "any" ? undefined : filter.marketAddress, + isLong: filter.direction === "any" ? undefined : filter.direction === "long", + // Collateral filtering is done outside of graphql on the client + })), + }, + ], + }, + // For defined markets on swap orders + { + and: !hasSwapRelevantDefinedMarkets + ? undefined + : [ + { + orderType_in: [OrderType.LimitSwap, OrderType.MarketSwap], + }, + { + or: [ + // Source token is not in swap path so we add it to the or filter + { + marketAddress_in: swapRelevantDefinedMarketsLowercased, + } as GraphQlFilters, + ].concat( + swapRelevantDefinedMarketsLowercased.map((marketAddress) => ({ + swapPath_contains: [marketAddress], + })) || [] + ), + }, + ], + }, + ], + }, + { + or: orderEventCombinations?.map((combination) => { + let sizeDeltaUsdCondition = {}; + + if ( + combination.orderType !== undefined && + [OrderType.MarketDecrease, OrderType.MarketIncrease].includes(combination.orderType) + ) { + if (combination.isDepositOrWithdraw) { + sizeDeltaUsdCondition = { sizeDeltaUsd: 0 }; + } else { + sizeDeltaUsdCondition = { sizeDeltaUsd_not: 0 }; + } + } + + return merge( + { + eventName: combination.eventName, + orderType: combination.orderType, + }, + sizeDeltaUsdCondition + ); + }), + }, + { + // We do not show create liquidation orders in the trade history, thus we filter it out + // ... && not (liquidation && orderCreated) === ... && (not liquidation || not orderCreated) + or: [{ orderType_not: OrderType.Liquidation }, { eventName_not: TradeActionType.OrderCreated }], + }, + ], + }); + + const whereClause = `where: ${filtersStr}`; + + const query = `{ + tradeActions( + skip: ${skip}, + first: ${first}, + orderBy: transaction__timestamp, + orderDirection: desc, + ${whereClause} + ) { + id + eventName + + account + marketAddress + swapPath + initialCollateralTokenAddress + + initialCollateralDeltaAmount + sizeDeltaUsd + triggerPrice + acceptablePrice + executionPrice + minOutputAmount + executionAmountOut + + priceImpactUsd + priceImpactDiffUsd + positionFeeAmount + borrowingFeeAmount + fundingFeeAmount + pnlUsd + basePnlUsd + + collateralTokenPriceMax + collateralTokenPriceMin + + indexTokenPriceMin + indexTokenPriceMax + + orderType + orderKey + isLong + shouldUnwrapNativeToken + + reason + reasonBytes + + transaction { + timestamp + hash + } + } + }`; + + const result = await graphqlFetcher<{ tradeActions: RawTradeAction[] }>(endpoint, query); + + const rawTradeActions = result?.tradeActions || []; + + if (!marketsInfoData || !tokensData) { + return []; + } + + const wrappedToken = getWrappedToken(chainId); + + const transformer = createRawTradeActionTransformer(marketsInfoData, wrappedToken, tokensData); + + let tradeActions = rawTradeActions.map(transformer).filter(Boolean) as TradeAction[]; + + const collateralFilterTree: { + [direction in "long" | "short"]: { + [marketAddress: string]: { + [collateralAddress: string]: boolean; + }; + }; + } = { + long: {}, + short: {}, + }; + let hasCollateralFilter = false; + + marketsDirectionsFilter.forEach((filter) => { + if (filter.direction === "any" || filter.direction === "swap" || !filter.collateralAddress) { + return; + } + + if (!collateralFilterTree[filter.direction]) { + collateralFilterTree[filter.direction] = {}; + } + + if (!collateralFilterTree[filter.direction][filter.marketAddress]) { + collateralFilterTree[filter.direction][filter.marketAddress] = {}; + } + + hasCollateralFilter = true; + collateralFilterTree[filter.direction][filter.marketAddress][filter.collateralAddress] = true; + }); + + // Filter out trade actions that do not match the collateral filter + // We do this on the client side because the collateral filtering is too complex to be done in the graphql query + if (hasCollateralFilter) { + tradeActions = tradeActions.filter((tradeAction) => { + // All necessary filters for swaps are already applied in the graphql query + if (isSwapOrderType(tradeAction.orderType)) { + return true; + } + + const positionTradeAction = tradeAction as PositionTradeAction; + + let collateralMatch = true; + + const desiredCollateralAddresses = + collateralFilterTree[positionTradeAction.isLong ? "long" : "short"]?.[positionTradeAction.marketAddress]; + + if (isLimitOrderType(tradeAction.orderType)) { + const wrappedToken = getWrappedToken(chainId); + + if (!marketsInfoData) { + collateralMatch = true; + } else { + const { outTokenAddress } = getSwapPathOutputAddresses({ + marketsInfoData, + initialCollateralAddress: positionTradeAction.initialCollateralTokenAddress, + isIncrease: isIncreaseOrderType(tradeAction.orderType), + shouldUnwrapNativeToken: positionTradeAction.shouldUnwrapNativeToken, + swapPath: tradeAction.swapPath, + wrappedNativeTokenAddress: wrappedToken.address, + }); + + collateralMatch = + outTokenAddress !== undefined && Boolean(desiredCollateralAddresses?.[outTokenAddress as Address]); + } + } else if (isTriggerDecreaseOrderType(tradeAction.orderType)) { + collateralMatch = Boolean(desiredCollateralAddresses?.[positionTradeAction.initialCollateralTokenAddress]); + } + + return collateralMatch; + }); + } + + return tradeActions; +} + +function createRawTradeActionTransformer( + marketsInfoData: MarketsInfoData, + wrappedToken: Token, + tokensData: TokensData +): ( + value: RawTradeAction, + index: number, + array: RawTradeAction[] +) => SwapTradeAction | PositionTradeAction | undefined { + return (rawAction) => { + const orderType = Number(rawAction.orderType); + + if (isSwapOrderType(orderType)) { + const initialCollateralTokenAddress = getAddress(rawAction.initialCollateralTokenAddress!); + const swapPath = rawAction.swapPath!.map((address) => getAddress(address)); + + const swapPathOutputAddresses = getSwapPathOutputAddresses({ + marketsInfoData, + swapPath, + initialCollateralAddress: initialCollateralTokenAddress, + wrappedNativeTokenAddress: wrappedToken.address, + shouldUnwrapNativeToken: rawAction.shouldUnwrapNativeToken!, + isIncrease: false, + }); + + const initialCollateralToken = getByKey(tokensData, initialCollateralTokenAddress)!; + const targetCollateralToken = getByKey(tokensData, swapPathOutputAddresses.outTokenAddress)!; + + if (!initialCollateralToken || !targetCollateralToken) { + return undefined; + } + + const tradeAction: SwapTradeAction = { + id: rawAction.id, + eventName: rawAction.eventName, + account: rawAction.account, + swapPath, + orderType, + orderKey: rawAction.orderKey, + initialCollateralTokenAddress: rawAction.initialCollateralTokenAddress!, + initialCollateralDeltaAmount: bigNumberify(rawAction.initialCollateralDeltaAmount)!, + minOutputAmount: bigNumberify(rawAction.minOutputAmount)!, + executionAmountOut: rawAction.executionAmountOut ? bigNumberify(rawAction.executionAmountOut) : undefined, + shouldUnwrapNativeToken: rawAction.shouldUnwrapNativeToken!, + targetCollateralToken, + initialCollateralToken, + transaction: rawAction.transaction, + reason: rawAction.reason, + reasonBytes: rawAction.reasonBytes, + }; + + return tradeAction; + } else { + const marketAddress = getAddress(rawAction.marketAddress!); + const marketInfo = getByKey(marketsInfoData, marketAddress); + const indexToken = marketInfo?.indexToken; + const initialCollateralTokenAddress = getAddress(rawAction.initialCollateralTokenAddress!); + const swapPath = rawAction.swapPath!.map((address) => getAddress(address)); + const swapPathOutputAddresses = getSwapPathOutputAddresses({ + marketsInfoData, + swapPath, + initialCollateralAddress: initialCollateralTokenAddress, + wrappedNativeTokenAddress: wrappedToken.address, + shouldUnwrapNativeToken: rawAction.shouldUnwrapNativeToken!, + isIncrease: isIncreaseOrderType(rawAction.orderType), + }); + const initialCollateralToken = getByKey(tokensData, initialCollateralTokenAddress); + const targetCollateralToken = getByKey(tokensData, swapPathOutputAddresses.outTokenAddress); + + if (!marketInfo || !indexToken || !initialCollateralToken || !targetCollateralToken) { + return undefined; + } + + const tradeAction: PositionTradeAction = { + id: rawAction.id, + eventName: rawAction.eventName, + account: rawAction.account, + marketAddress, + marketInfo, + indexToken, + swapPath, + initialCollateralTokenAddress, + initialCollateralToken, + targetCollateralToken, + initialCollateralDeltaAmount: bigNumberify(rawAction.initialCollateralDeltaAmount)!, + sizeDeltaUsd: bigNumberify(rawAction.sizeDeltaUsd)!, + triggerPrice: rawAction.triggerPrice + ? parseContractPrice(bigNumberify(rawAction.triggerPrice)!, indexToken.decimals) + : undefined, + acceptablePrice: parseContractPrice(bigNumberify(rawAction.acceptablePrice)!, indexToken.decimals), + executionPrice: rawAction.executionPrice + ? parseContractPrice(bigNumberify(rawAction.executionPrice)!, indexToken.decimals) + : undefined, + minOutputAmount: bigNumberify(rawAction.minOutputAmount)!, + + collateralTokenPriceMax: rawAction.collateralTokenPriceMax + ? parseContractPrice(bigNumberify(rawAction.collateralTokenPriceMax)!, initialCollateralToken.decimals) + : undefined, + + collateralTokenPriceMin: rawAction.collateralTokenPriceMin + ? parseContractPrice(bigNumberify(rawAction.collateralTokenPriceMin)!, initialCollateralToken.decimals) + : undefined, + + indexTokenPriceMin: rawAction.indexTokenPriceMin + ? parseContractPrice(BigInt(rawAction.indexTokenPriceMin), indexToken.decimals) + : undefined, + indexTokenPriceMax: rawAction.indexTokenPriceMax + ? parseContractPrice(BigInt(rawAction.indexTokenPriceMax), indexToken.decimals) + : undefined, + + orderType, + orderKey: rawAction.orderKey, + isLong: rawAction.isLong!, + pnlUsd: rawAction.pnlUsd ? BigInt(rawAction.pnlUsd) : undefined, + basePnlUsd: rawAction.basePnlUsd ? BigInt(rawAction.basePnlUsd) : undefined, + + priceImpactDiffUsd: rawAction.priceImpactDiffUsd ? BigInt(rawAction.priceImpactDiffUsd) : undefined, + priceImpactUsd: rawAction.priceImpactUsd ? BigInt(rawAction.priceImpactUsd) : undefined, + positionFeeAmount: rawAction.positionFeeAmount ? BigInt(rawAction.positionFeeAmount) : undefined, + borrowingFeeAmount: rawAction.borrowingFeeAmount ? BigInt(rawAction.borrowingFeeAmount) : undefined, + fundingFeeAmount: rawAction.fundingFeeAmount ? BigInt(rawAction.fundingFeeAmount) : undefined, + + reason: rawAction.reason, + reasonBytes: rawAction.reasonBytes, + + transaction: rawAction.transaction, + shouldUnwrapNativeToken: rawAction.shouldUnwrapNativeToken!, + }; + + return tradeAction; + } + }; +} + +export function bigNumberify(n?: bigint | string | null | undefined) { + try { + if (n === undefined) throw new Error("n is undefined"); + if (n === null) throw new Error("n is null"); + + return BigInt(n); + } catch (e) { + // eslint-disable-next-line no-console + console.error("bigNumberify error", e); + return undefined; + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/utils/utils.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/utils/utils.ts new file mode 100644 index 0000000..19a03a1 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/modules/utils/utils.ts @@ -0,0 +1,285 @@ +import { withRetry } from "viem"; + +import { EXECUTION_FEE_CONFIG_V2, GAS_PRICE_PREMIUM_MAP, getChain, MAX_PRIORITY_FEE_PER_GAS_MAP } from "../../configs/chains.js"; +import { getContract } from "../../configs/contracts.js"; +import { + decreaseOrderGasLimitKey, + depositGasLimitKey, + ESTIMATED_GAS_FEE_BASE_AMOUNT_V2_1, + ESTIMATED_GAS_FEE_MULTIPLIER_FACTOR, + ESTIMATED_GAS_FEE_PER_ORACLE_PRICE, + GLV_DEPOSIT_GAS_LIMIT, + GLV_PER_MARKET_GAS_LIMIT, + GLV_WITHDRAWAL_GAS_LIMIT, + increaseOrderGasLimitKey, + shiftGasLimitKey, + singleSwapGasLimitKey, + swapOrderGasLimitKey, + uiFeeFactorKey, + withdrawalGasLimitKey, +} from "../../configs/dataStore.js"; + +import type { IncreasePositionAmounts } from "../../types/trade.js"; +import type { GasLimitsConfig } from "../../types/fees.js"; +import type { DecreasePositionAmounts, SwapAmounts, TradeFeesType } from "../../types/trade.js"; +import { TokensData } from "../../types/tokens.js"; + +import { bigMath } from "../../utils/bigmath.js"; +import { estimateOrderOraclePriceCount } from "../../utils/fees/estimateOraclePriceCount.js"; +import { + estimateExecuteDecreaseOrderGasLimit, + estimateExecuteIncreaseOrderGasLimit, + estimateExecuteSwapOrderGasLimit, + getExecutionFee, +} from "../../utils/fees/executionFee.js"; +import { getSwapCount } from "../../utils/trade/index.js"; + +import { Module } from "../base.js"; + +const DEFAULT_UI_FEE_RECEIVER_ACCOUNT = "0xff00000000000000000000000000000000000001"; + +export class Utils extends Module { + private _gasLimits: GasLimitsConfig | null = null; + async getGasLimits(): Promise { + if (this._gasLimits) { + return this._gasLimits; + } + + const gasLimits = await this.sdk + .executeMulticall({ + dataStore: { + contractAddress: getContract(this.chainId, "DataStore"), + abiId: "DataStore", + calls: { + depositToken: { + methodName: "getUint", + params: [depositGasLimitKey()], + }, + withdrawalMultiToken: { + methodName: "getUint", + params: [withdrawalGasLimitKey()], + }, + shift: { + methodName: "getUint", + params: [shiftGasLimitKey()], + }, + singleSwap: { + methodName: "getUint", + params: [singleSwapGasLimitKey()], + }, + swapOrder: { + methodName: "getUint", + params: [swapOrderGasLimitKey()], + }, + increaseOrder: { + methodName: "getUint", + params: [increaseOrderGasLimitKey()], + }, + decreaseOrder: { + methodName: "getUint", + params: [decreaseOrderGasLimitKey()], + }, + estimatedGasFeeBaseAmount: { + methodName: "getUint", + params: [ESTIMATED_GAS_FEE_BASE_AMOUNT_V2_1], + }, + estimatedGasFeePerOraclePrice: { + methodName: "getUint", + params: [ESTIMATED_GAS_FEE_PER_ORACLE_PRICE], + }, + estimatedFeeMultiplierFactor: { + methodName: "getUint", + params: [ESTIMATED_GAS_FEE_MULTIPLIER_FACTOR], + }, + glvDepositGasLimit: { + methodName: "getUint", + params: [GLV_DEPOSIT_GAS_LIMIT], + }, + glvWithdrawalGasLimit: { + methodName: "getUint", + params: [GLV_WITHDRAWAL_GAS_LIMIT], + }, + glvPerMarketGasLimit: { + methodName: "getUint", + params: [GLV_PER_MARKET_GAS_LIMIT], + }, + }, + }, + }) + .then((res) => { + const results = res.data.dataStore; + + function getBigInt(key: keyof typeof results) { + return BigInt(results[key].returnValues[0]); + } + + return { + depositToken: getBigInt("depositToken"), + withdrawalMultiToken: getBigInt("withdrawalMultiToken"), + shift: getBigInt("shift"), + singleSwap: getBigInt("singleSwap"), + swapOrder: getBigInt("swapOrder"), + increaseOrder: getBigInt("increaseOrder"), + decreaseOrder: getBigInt("decreaseOrder"), + estimatedGasFeeBaseAmount: getBigInt("estimatedGasFeeBaseAmount"), + estimatedGasFeePerOraclePrice: getBigInt("estimatedGasFeePerOraclePrice"), + estimatedFeeMultiplierFactor: getBigInt("estimatedFeeMultiplierFactor"), + glvDepositGasLimit: getBigInt("glvDepositGasLimit"), + glvWithdrawalGasLimit: getBigInt("glvWithdrawalGasLimit"), + glvPerMarketGasLimit: getBigInt("glvPerMarketGasLimit"), + }; + }); + + this._gasLimits = gasLimits; + return gasLimits; + } + + async getEstimatedGasFee( + tradeFeesType: TradeFeesType, + { + increaseAmounts, + decreaseAmounts, + swapAmounts, + }: { + swapAmounts?: SwapAmounts; + decreaseAmounts?: DecreasePositionAmounts; + increaseAmounts?: IncreasePositionAmounts; + } + ) { + const gasLimits = await this.getGasLimits(); + + switch (tradeFeesType) { + case "swap": { + if (!swapAmounts || !swapAmounts.swapPathStats) return null; + + return estimateExecuteSwapOrderGasLimit(gasLimits, { + swapsCount: swapAmounts.swapPathStats.swapPath.length, + callbackGasLimit: 0n, + }); + } + case "increase": { + if (!increaseAmounts) return null; + + return estimateExecuteIncreaseOrderGasLimit(gasLimits, { + swapsCount: increaseAmounts.swapPathStats?.swapPath.length, + }); + } + case "decrease": { + if (!decreaseAmounts) return null; + + return estimateExecuteDecreaseOrderGasLimit(gasLimits, { + callbackGasLimit: 0n, + decreaseSwapType: decreaseAmounts.decreaseSwapType, + swapsCount: 0, + }); + } + case "edit": + return null; + } + } + + async getExecutionFee( + tradeFeesType: TradeFeesType, + tokensData: TokensData, + { + increaseAmounts, + decreaseAmounts, + swapAmounts, + }: { + swapAmounts?: SwapAmounts; + decreaseAmounts?: DecreasePositionAmounts; + increaseAmounts?: IncreasePositionAmounts; + } + ) { + const gasLimits = await this.getGasLimits(); + const gasPrice = await this.getGasPrice(); + + const estimatedGas = await this.getEstimatedGasFee(tradeFeesType, { + increaseAmounts, + decreaseAmounts, + swapAmounts, + }); + + if (estimatedGas === null || estimatedGas === undefined) return undefined; + + const swapsCount = getSwapCount({ + isSwap: tradeFeesType === "swap", + isIncrease: tradeFeesType === "increase", + increaseAmounts, + decreaseAmounts, + swapAmounts, + }); + + if (swapsCount === undefined) return undefined; + if (tokensData === undefined) return undefined; + if (gasPrice === undefined) return undefined; + + const oraclePriceCount = estimateOrderOraclePriceCount(swapsCount); + + return getExecutionFee(this.chainId, gasLimits, tokensData, estimatedGas, gasPrice, oraclePriceCount); + } + + async getGasPrice() { + const executionFeeConfig = EXECUTION_FEE_CONFIG_V2[this.chainId]; + + const feeData = await withRetry( + () => + this.sdk.publicClient.estimateFeesPerGas({ + chain: getChain(this.chainId), + type: "legacy", + }), + { + retryCount: 2, + shouldRetry: ({ error }) => { + const isInvalidBlockError = error?.message?.includes("invalid value for value.hash"); + + return isInvalidBlockError; + }, + } + ); + + let gasPrice = feeData.gasPrice ?? 0n; + + if (executionFeeConfig.shouldUseMaxPriorityFeePerGas) { + const maxPriorityFeePerGas = bigMath.max( + feeData?.maxPriorityFeePerGas ?? 0n, + MAX_PRIORITY_FEE_PER_GAS_MAP[this.chainId] ?? 0n + ); + + gasPrice = gasPrice + maxPriorityFeePerGas; + } + + const premium = GAS_PRICE_PREMIUM_MAP[this.chainId] ?? 0n; + const price = gasPrice + premium; + + return price === undefined ? undefined : BigInt(gasPrice); + } + + private _uiFeeFactor = 0n; + async getUiFeeFactor() { + if (this._uiFeeFactor) { + return this._uiFeeFactor; + } + + const uiFeeReceiverAccount = this.sdk.config.settings?.uiFeeReceiverAccount ?? DEFAULT_UI_FEE_RECEIVER_ACCOUNT; + + const uiFeeFactor = await this.sdk + .executeMulticall({ + dataStore: { + contractAddress: getContract(this.chainId, "DataStore"), + abiId: "DataStore", + calls: { + keys: { + methodName: "getUint", + params: [uiFeeFactorKey(uiFeeReceiverAccount)], + }, + }, + }, + }) + .then((res) => { + return BigInt(res.data.dataStore.keys.returnValues[0]); + }); + + return uiFeeFactor ?? 0n; + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedKinkModelMarketRatesKeys.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedKinkModelMarketRatesKeys.json new file mode 100644 index 0000000..3fdec0c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedKinkModelMarketRatesKeys.json @@ -0,0 +1,944 @@ +{ + "42161": { + "0x47c031236e19d024b42f8AE6780E44A573170703": { + "optimalUsageFactorLong": "0x81cc37ff3833298b6114d8317fd6c5996dc7a8ab53fefd3edb9f415ca4267824", + "optimalUsageFactorShort": "0xa03edb610df5b58a7ed15f1e57fdad32ebcb26e2fd19446a7ba4ceab974834d6", + "baseBorrowingFactorLong": "0x370e277862664d970932e2f787422e63fd7f5e35242e65f4eb2cabe29648505f", + "baseBorrowingFactorShort": "0xa1230105ea736c1c7519c5b5e0ac34339ade90f2f572470fc38252dd82051b47", + "aboveOptimalUsageBorrowingFactorLong": "0x90348df2557781566877eeb18f5ccecfd8f23fc9e835f6d206ad4d296c935be0", + "aboveOptimalUsageBorrowingFactorShort": "0xdfa7b43120b38c7b941052dbef25f3f83fffc14d731ffbfee6cd080d40eb8d8c" + }, + "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336": { + "optimalUsageFactorLong": "0x8d45fa037d4e92448746fd350e125ec6629536deac790265474e5ef1ec1ba119", + "optimalUsageFactorShort": "0xd475845bbb151b7e9a80480bd963c954cd4b562579c03a09d89cf3c0d07b071d", + "baseBorrowingFactorLong": "0x66303f9945b2fadbb954039f7e3a5dc16b741e4309b847623c0936163265c417", + "baseBorrowingFactorShort": "0x9e25ae40d874f12dfad17144d285d01c2359bc675b76145306ed4a93fac3f9ea", + "aboveOptimalUsageBorrowingFactorLong": "0x97fadec25327578e017c86fe6297f7d503ab43c4b1c376219496b46ce4a9ae5f", + "aboveOptimalUsageBorrowingFactorShort": "0xde8a9678261d6a200a3ec381f0ccebc929b2155811dcf23178d0006a279cea51" + }, + "0x6853EA96FF216fAb11D2d930CE3C508556A4bdc4": { + "optimalUsageFactorLong": "0x4246a2fe5efe352528c8aa0545fe3599cd52778bf74a380ab3ba0b8b94859306", + "optimalUsageFactorShort": "0x0d40430e38db1b17ebfe19cef210b16b455ab45111adfa43fb4975093af6d203", + "baseBorrowingFactorLong": "0xff14babc4b1048689b62faa9b047d1f6789518c14aea45ee96f58e9ae4853f83", + "baseBorrowingFactorShort": "0xe6ac9c15c2c72deaba942ba5041efd91bda6e63aa0f06f48bba0f60b37204875", + "aboveOptimalUsageBorrowingFactorLong": "0xc706b4db86396b4b1312dc5431c312d212e8898c49f3314e974dbf9e4f193c2b", + "aboveOptimalUsageBorrowingFactorShort": "0x2c9df6b43f7d22dcd50899eb3573a4b566fa0aa20abb79f0215b1ffa6cb6c564" + }, + "0x09400D9DB990D5ed3f35D7be61DfAEB900Af03C9": { + "optimalUsageFactorLong": "0x597399ff0a54d992f95f9e344b6f5171c0ead2872540c81f788e3ab408bc239c", + "optimalUsageFactorShort": "0xb805126fbcf4c4b33e4558ad6dab561a7c421935feae4ba28380d66d3d7f9fda", + "baseBorrowingFactorLong": "0x3ed90f768de34347601322e82230201411b23b998d55284474f76c3c663dca0b", + "baseBorrowingFactorShort": "0x65d9b69206e8e144e1b84a78774f9ab4ebdc8a36201c4528392dda7ebb6f61d1", + "aboveOptimalUsageBorrowingFactorLong": "0xb3e91e15ff40a2e34d7f4b25b8df940b8dbfd5e1ab8440a5c3d611ce96384925", + "aboveOptimalUsageBorrowingFactorShort": "0x89f3d668bc977dccc76bbca5a72225eccb52f166df324c388ead50670657791d" + }, + "0xD9535bB5f58A1a75032416F2dFe7880C30575a41": { + "optimalUsageFactorLong": "0xf6bb7b0c993856298576f1896243d11c970f697449cd96bcfc033abb9dbbd927", + "optimalUsageFactorShort": "0xcde2cc90da43b99dda6ebf4fcd4cb14696fb71afc860d0df65568f7f679b0dfb", + "baseBorrowingFactorLong": "0xac4403ec6104cb8ec58bdb7da42f8f685a61805927a142574413682b074604ad", + "baseBorrowingFactorShort": "0xd4fdf7a1dfd617dfbb25c365d9c242ff7651e91aef574348e041f035afcbc0e6", + "aboveOptimalUsageBorrowingFactorLong": "0x9d293d703687f8a7a61d9503a21dc7b12b8c80ed3deec0b72bf32cd97e84ed7b", + "aboveOptimalUsageBorrowingFactorShort": "0x6e676b45b0748412eaee60517c99e510bcb9e218e6ca2cde49d8b724cfbbf38d" + }, + "0xc7Abb2C5f3BF3CEB389dF0Eecd6120D451170B50": { + "optimalUsageFactorLong": "0x4fea11dfadc0437571cdfa9dcd3d039ff7841db6d72eb5e4d511e8a399654341", + "optimalUsageFactorShort": "0x941cf61e54d0343cf3c5f75ce3ee9095bf49cf24709d13b0ad2cefe47300a537", + "baseBorrowingFactorLong": "0x7b4865e38d66c330c5ff8bb349661f3ba73a965019099bd17fcd7b59b8c91b5c", + "baseBorrowingFactorShort": "0xedbcc56e6ab5beae521229ca700ed1f4c6e9d939c8e605877d5dd90fbe0f145a", + "aboveOptimalUsageBorrowingFactorLong": "0xb8035f07fc0ec2a8c02e0ca182be19bc15e3cf49a262cdb85dd147e3372a6739", + "aboveOptimalUsageBorrowingFactorShort": "0x36d14b2bf5e3bfb942f1a9da40bdb3ed1c4e4c3c15a347003c2c63427a6f347b" + }, + "0x7f1fa204bb700853D36994DA19F830b6Ad18455C": { + "optimalUsageFactorLong": "0xfaf68c3e6d7fc04c7a16af01490107fab84b80e471d4771fa3acb3582fa48bd1", + "optimalUsageFactorShort": "0xe25c657b0d87549787f2d6cb443948fee1ef15edd18db9889cb03ae6eade52e5", + "baseBorrowingFactorLong": "0x6d4fef3bf8ef250042aaae353a5df01c524f62b5b86d46f3d0ad6200432cef1e", + "baseBorrowingFactorShort": "0x3ebdca5d7e1dd2f2cd97c35e69f1abdcbfade68d4940d999ac9974143c6ae44b", + "aboveOptimalUsageBorrowingFactorLong": "0x0ef7ad2edce34b518393e2dc115dbbd1b22412f956e634e627181a3e7c14c3a3", + "aboveOptimalUsageBorrowingFactorShort": "0x7680e046bbf9382436a472886644e8bec095181bcfe58ec6042dd744b24696b4" + }, + "0xC25cEf6061Cf5dE5eb761b50E4743c1F5D7E5407": { + "optimalUsageFactorLong": "0x3de8dc178786c9ab206766c77c55c6d44e58506b4f7484eb4e3fd38d3db29d9b", + "optimalUsageFactorShort": "0x7e0ad032007c89faca9d656abf0006bd374edeafc2a34f8f84d3e40e238d9021", + "baseBorrowingFactorLong": "0x12e3d9f749584a2e38ec96f12ec1961e64086cc74a509f2e320964a3b7f97716", + "baseBorrowingFactorShort": "0xf33cd495396c4d78f267fbe56ea086cae7e3572cf0c453217b1ebe9b8fd74e4f", + "aboveOptimalUsageBorrowingFactorLong": "0x301fe00a5d9e18f17806f7234871456f19d27403401fdc62f3c24357d7b1121a", + "aboveOptimalUsageBorrowingFactorShort": "0xc3d862116cb7688359de7abc513fe8d6bcc4895f6d413ef73f59ea086ca24822" + }, + "0x9C2433dFD71096C435Be9465220BB2B189375eA7": { + "optimalUsageFactorLong": "0x6d60ce6fbf0b5e759f25393c6270cdadcdbc3b1acbd96adc7867606735cda791", + "optimalUsageFactorShort": "0xa7864fe193b5051ae932bffaf274ead6803c9e14191447fb14138709b8724f97", + "baseBorrowingFactorLong": "0x9566bb223b85817e57680cea3878b740537f77e3e4638bea1b6495ca70db9bab", + "baseBorrowingFactorShort": "0x2bd0dffe4f34a528436b6d9a4489c43f124a8a823e9fdcb1ca38e951d29dd6a5", + "aboveOptimalUsageBorrowingFactorLong": "0x0e41dd9637bf8f8f2008c9024b2197c7b77314ee5dd64dc394efd1761c2d8673", + "aboveOptimalUsageBorrowingFactorShort": "0x6720bf962e43e4a575fdeed5f89c34af12b1499f005377ad1c60410f42320583" + }, + "0xB686BcB112660343E6d15BDb65297e110C8311c4": { + "optimalUsageFactorLong": "0x5446b31c18a540ead94e03d674114069c9627a62ed3e2243de7ccd19194dfe87", + "optimalUsageFactorShort": "0x6f8089968080914a1d75ee350317f03a6ba98eb4e3d66a38206fa5b259a35fc5", + "baseBorrowingFactorLong": "0x5064f43986b5002528f4f7ab673ca0f133e9e87c0233b94d09a9b71362712124", + "baseBorrowingFactorShort": "0x3727eaddef4b00d123ab97419cc00b112a73ac588053446444a9845baa5102bd", + "aboveOptimalUsageBorrowingFactorLong": "0x4f6977851623eeb42d047b47d87cf0a654a07549121ab67006cd8b32cb1c0e49", + "aboveOptimalUsageBorrowingFactorShort": "0x1aa1305ee44f8a535cdbf779c62485e58fc18b6701df0a21b570bb7ac09f704a" + }, + "0xe2fEDb9e6139a182B98e7C2688ccFa3e9A53c665": { + "optimalUsageFactorLong": "0x56fddd896efc0be8643b40baded54dfa165167ba34336d031757a95fc4b4c19e", + "optimalUsageFactorShort": "0x57d45f8b03ae41dcb28c96748cf4adfba5ad531741a22db539e0e3d730681010", + "baseBorrowingFactorLong": "0x628665b7f27f52dfc5b4b5c1a1fe339213e25f8f295a0791ea9e964a8eeb8d2e", + "baseBorrowingFactorShort": "0xf96e1b0b070d2a40d2be91f8b55ab5cc350d15279ef594954ebf658e6c0084ab", + "aboveOptimalUsageBorrowingFactorLong": "0x595f5444d23cf651f13917244dcbf22a4de9352aad9fc2c81dcaf4447cc6453b", + "aboveOptimalUsageBorrowingFactorShort": "0x38c240a8959d57226fb3e6dae1adff49e2b3c28cf2027af268f223ef42c435a9" + }, + "0x0CCB4fAa6f1F1B30911619f1184082aB4E25813c": { + "optimalUsageFactorLong": "0xa1be2e4ab02737b08b4ef2b0fea6426d4cd91d9fe2106cce6e77117a3f77d238", + "optimalUsageFactorShort": "0xfd0c202da1592fbd3e4788590f222cdf4c2d06c481b62912bfc70dd61136de63", + "baseBorrowingFactorLong": "0x5bfc5d4500d366858782ab5891a3af65ebb2605c2286e1da131c9fdc14075987", + "baseBorrowingFactorShort": "0xe85c0e84c165ac02318c2cc8331fa363549c1741487fd48d167b8ef38a45a571", + "aboveOptimalUsageBorrowingFactorLong": "0x387778e60054130ca57f324ab737b1fe68c8e18c9fd6b0c07e4235f46e65c51d", + "aboveOptimalUsageBorrowingFactorShort": "0x918afa3dfa6e1b1ca2043b870f4a7a521849bec5b1cb27f7952fa017196ee271" + }, + "0x2d340912Aa47e33c90Efb078e69E70EFe2B34b9B": { + "optimalUsageFactorLong": "0x7163d17f09c5ad67ecf66ee355c72a428cd94431448749ce6671e0cd1c26691b", + "optimalUsageFactorShort": "0xe00ded96f4b11cb2863d39741c58bf96575e8eeb4fc62305ea0eef0caa3a9109", + "baseBorrowingFactorLong": "0x271cffc3494b07c3ba8aca4d0d7ac50b34064bf55875103d3c4893617c2f974c", + "baseBorrowingFactorShort": "0x9cf2ec164cef4c8e24b60f17b391116a31bc2dda33d6f386f93a01e08afc6003", + "aboveOptimalUsageBorrowingFactorLong": "0xa14e561d0f071aa9d1dc589fb4af8a6d25a7eb643f0c2bdf6f41a025eb0ba537", + "aboveOptimalUsageBorrowingFactorShort": "0x25d0d598793a871dd9668949a2c372210699b2065b3d1bc42b02baf74b87ddfe" + }, + "0x1CbBa6346F110c8A5ea739ef2d1eb182990e4EB2": { + "optimalUsageFactorLong": "0x8b35083549913a0d39327ca51a5e81969b67713d7ee7f22f646779e8e4e9affc", + "optimalUsageFactorShort": "0x64c8d1fb5334ee15a50433f142eb1c7a42131e5211bd673418fc1d5474c7bb22", + "baseBorrowingFactorLong": "0xca9bd6257efa980a8c9b9050ef5254a225779ebdd08dc9d1573d20d8b2b27718", + "baseBorrowingFactorShort": "0xb41a72eb632d0d39add7ce14a8ae5832660acc0cd61225cb84f64f1e872dbae9", + "aboveOptimalUsageBorrowingFactorLong": "0x9ca6a97fba78abf72773086790b996f0a715b27a3106c858bcab7022874546bc", + "aboveOptimalUsageBorrowingFactorShort": "0x702339ffa6f643f5c107bae9dfe1feaf5dd183d9491367b47140b632be4d1d9a" + }, + "0x248C35760068cE009a13076D573ed3497A47bCD4": { + "optimalUsageFactorLong": "0x3359b1d25814ff1c1c12fe23974b63f9230bb58251f60b5fe3c77cf2677a9ff3", + "optimalUsageFactorShort": "0x6369f7e9b5126f9ba08809d29ce549a55789c375bf16ee32b081f5ad2de64f64", + "baseBorrowingFactorLong": "0xc9b6bd6aeefbf1b71dd87c0e902bd15c95df053ab3f6b805750f33e073870149", + "baseBorrowingFactorShort": "0x595c0b8d8c30ad327a0749c77781a525c6b245394784600bd53d28dc13ed0fae", + "aboveOptimalUsageBorrowingFactorLong": "0x91cd7ec48285404c8a21822ccb582e0873273abaa0fb4344137305d706182a86", + "aboveOptimalUsageBorrowingFactorShort": "0x46a2754f25c120804f67b4b04cc6705d861107ac73157bada86cea8cd8870bd0" + }, + "0x63Dc80EE90F26363B3FCD609007CC9e14c8991BE": { + "optimalUsageFactorLong": "0xc980fe4dadaa28b713ae7c8346c9a3a0df79715c4a20f24d6ff341574f65b3d1", + "optimalUsageFactorShort": "0x61989a585110b8827f30aa4576222101fa80b9a822abf70864490fd57be246db", + "baseBorrowingFactorLong": "0x1f9952b46057806d243ca941fa6d985e42c7c13c2cff7a2b6f1b08b3f84146fc", + "baseBorrowingFactorShort": "0xdc0ec1ffd3dae38f29cb3e479f291236518d56842488d9a8d953eb94b500b9ad", + "aboveOptimalUsageBorrowingFactorLong": "0xe029ab6bbd2096703860c205eb2c33e5c4b642ec0ae2d7aa344ac1fe9119e88a", + "aboveOptimalUsageBorrowingFactorShort": "0xb186739ffb515686be702c25d6681d9dc2b54ec995060fbc784b31e042c985da" + }, + "0x7BbBf946883a5701350007320F525c5379B8178A": { + "optimalUsageFactorLong": "0x9f79c20ed9ff984b7281358fe22ce5c52792f9a1d9de7d06d3594efde02153b5", + "optimalUsageFactorShort": "0xc8d1e06340207474a9b1a63f5dffde777a35d8dbcf65eff24928df0a518e21bf", + "baseBorrowingFactorLong": "0x1ea155d3e215dc60ae173f8dad0bfe79248f1d0cf37e2cda6b4e105891cf5cc0", + "baseBorrowingFactorShort": "0x53cb3a28dd35b8f016665681324821bc166c01cdd5182baf394433397e1709f4", + "aboveOptimalUsageBorrowingFactorLong": "0xcfe98e2c103f7047c25a7ed377bfb0bce0275dca10707119971c1d73a4b71b70", + "aboveOptimalUsageBorrowingFactorShort": "0x38830a5f4859e89fc03650bfb6eb10dd9d78d059553b3be8e1a158353099ce7e" + }, + "0x4fDd333FF9cA409df583f306B6F5a7fFdE790739": { + "optimalUsageFactorLong": "0x6c22171904b63fefc7632a8fd4997f6bed19dc890e96e1efc272b754ca21a629", + "optimalUsageFactorShort": "0x43179f55ddccf5e954640a46517c25a53acf50413481f53f676f13ef97c79df8", + "baseBorrowingFactorLong": "0x9696249ac766efee338a1d83031cd4c33548580ed5d8f8504bcc5cfe4331e13f", + "baseBorrowingFactorShort": "0xb590333ec39f081f0ac9d66ea36ced5c0bb2e323ba498e6e375f637a8604073a", + "aboveOptimalUsageBorrowingFactorLong": "0xc7c9eaf81f136d16ea60cd50f32064644587ff4d4b3ae5975f6cc87e4019c2d9", + "aboveOptimalUsageBorrowingFactorShort": "0xb2632d66744db29f7aa2b9cefb62520a3652f05777656c01a5f054e5c0126dc7" + }, + "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77": { + "optimalUsageFactorLong": "0xa251ec07313e5d256a7371559e25fe0917eb6c5379dcfd99eede5fc7f39754fc", + "optimalUsageFactorShort": "0x27aada0eaf820a9cd35cb0cc6d90d82e550adc75d145959727aa083c3d689358", + "baseBorrowingFactorLong": "0xa2ab6aa7552bda898ca46a6e11949600ea3a045372a4d955c59fab7bbc4cad44", + "baseBorrowingFactorShort": "0xa73e5138a484c00e6986e278c2a9981a0173a9d93f0409ea7801de7d18a4d2e3", + "aboveOptimalUsageBorrowingFactorLong": "0x9f5230ed2b1d10b67b0e54b7188402f880f39852e95a49ecca65124ef1090b55", + "aboveOptimalUsageBorrowingFactorShort": "0x99cdaac12040cc843154ef01e25664fba8d0f118c95d51b959797c343def47a1" + }, + "0x450bb6774Dd8a756274E0ab4107953259d2ac541": { + "optimalUsageFactorLong": "0xa659e9af2e1af84c4b85b9ca1b30f2c9ab53cdf4295af78767f8805028f5b1c9", + "optimalUsageFactorShort": "0x1565bb92bcf9b5cc6d3c0605d29a84eb957f7e39db82d42bd42f92af9a0f999d", + "baseBorrowingFactorLong": "0x1a9ae6995f87f2b3b96dfe1a5236a29272e21b4f7c8ab96abaef1aee4a783d35", + "baseBorrowingFactorShort": "0x9a673060bbca4ff516d43573203ce0b6f99861641085679a91f926c7e8a11b19", + "aboveOptimalUsageBorrowingFactorLong": "0xc14cc0284ae56373689201719d6c306ceda33b1846af9990e1c8abf6d504e52c", + "aboveOptimalUsageBorrowingFactorShort": "0xd6d9292ba33acd2d5ec7de3e5d3a85fb24b7d6106da944b1e2561ce5efee2bce" + }, + "0x55391D178Ce46e7AC8eaAEa50A72D1A5a8A622Da": { + "optimalUsageFactorLong": "0x2cdf41fe4c06be717875ff72a0824bbb850f9dc126f4d8aded0db24578c2ba88", + "optimalUsageFactorShort": "0x0cefba97a2ec21979f1c6a0d4fcc0e8ca0fc6503d0b498749476ebe11966fafe", + "baseBorrowingFactorLong": "0x93133be345dfd994d8e4714d0765c56a0450700d56f6e14d14030a444324bf28", + "baseBorrowingFactorShort": "0xd01c5cc8aa6426a14499a86eb0162385e98cb417866a47fe2b9956a902e93153", + "aboveOptimalUsageBorrowingFactorLong": "0x7810f510ce5b005d6edb9b4595f2c56c094c629b44669c45eba9a693caa98969", + "aboveOptimalUsageBorrowingFactorShort": "0xa0e7fdaf335493e3d2d4d9574a5d56caad22e8807a2622566303fdfcded876fd" + }, + "0x2b477989A149B17073D9C9C82eC9cB03591e20c6": { + "optimalUsageFactorLong": "0x6cec0b73cf00be36145afbfe3c9ab84fd4804b83a7db419405542468f7651b5c", + "optimalUsageFactorShort": "0x454bcafbbe0973bbf439c094e0071d673a4db81abec31d3cf088ebf0d4865fd7", + "baseBorrowingFactorLong": "0x894cc1612f6036de8c264a60b25bcd49cc0fc7a29e4a1521ed63fbd7decdd5d5", + "baseBorrowingFactorShort": "0x6c5b4180e85f0531743140aeea4a3677697550f8fc54eb7e36684fb6e9ba0d1f", + "aboveOptimalUsageBorrowingFactorLong": "0xdb229d1693cb9f5d8c028bff303ebb58aad560be87ec3e62a901a631da4c4891", + "aboveOptimalUsageBorrowingFactorShort": "0x6243d4f9aa7932bb1427d2b270dca5c253461d1e12d503c785f4ad85ca8734e3" + }, + "0x0418643F94Ef14917f1345cE5C460C37dE463ef7": { + "optimalUsageFactorLong": "0x4a54b8767c0cd1e5cc2d1c1455c1e3fa62b5164a20afa3ed407803bd16f157c9", + "optimalUsageFactorShort": "0x153d531a04a666e8a585d31d0f9c5567e22c5c0dd891ab1d58246ad0ea3bb2ea", + "baseBorrowingFactorLong": "0x1ee4c62d17ab2f27fcb46302bee29d37883786241dba3c5c0f4a7e24f7c086f9", + "baseBorrowingFactorShort": "0x949c9dd82e7521c6b7651ff21820ab9fc9e0a677838b295d1f25baa2c6dc292a", + "aboveOptimalUsageBorrowingFactorLong": "0x81925b710d8d85ec1dac0c06e590dabd30992c1975b82f841209239830e05fed", + "aboveOptimalUsageBorrowingFactorShort": "0x842e31f72f12c447bbd4bd799635dcb9dd72d155171849928f683584cc3c6237" + }, + "0x0Cf1fb4d1FF67A3D8Ca92c9d6643F8F9be8e03E5": { + "optimalUsageFactorLong": "0xbe2f0d984c451e0ca0098d6021ad09163564d42c1cbb884a6e4eab3948a25062", + "optimalUsageFactorShort": "0x26d1a51e45e94605582e7bd9be261254a1818d0938053f59d612879e9f00c8ef", + "baseBorrowingFactorLong": "0xa49650b72c936d13a89b6525c3f735282d2577e794431fbf3a49ae53cd70455e", + "baseBorrowingFactorShort": "0x8ace102f94db2defbe0951a11f40ba0a488f750cd1a73a356ad77fae8fd7fa5c", + "aboveOptimalUsageBorrowingFactorLong": "0x893938ba19aa06b225abfe3d2c8640f5718ed0f7980bbf9e57cb98e7fda8c72d", + "aboveOptimalUsageBorrowingFactorShort": "0x15b50f6d66bbfccfd9ea8d76dc6400aa9cc4c334b91a2128e444c57a81b54f35" + }, + "0xb56E5E2eB50cf5383342914b0C85Fe62DbD861C8": { + "optimalUsageFactorLong": "0xdbb84141a53645c6e25e423ba89a3e7f503e83abb94c2ac0119b73e5e2853b9c", + "optimalUsageFactorShort": "0xae91d1a72f2df40812a9b52dfba2522e2747090ce5b0e75c39b9bc0269c3c886", + "baseBorrowingFactorLong": "0x5f6ad8c0cb95f500ebf9f9a5dbc01b3c0bc3d34f44c62998c055da98b72a34a6", + "baseBorrowingFactorShort": "0x812018aa79745cc3bc9fa53c5a204c6e4568b370ecef8b99f1bbbb430352ce67", + "aboveOptimalUsageBorrowingFactorLong": "0xa4e48707eb2feb5a72c2656492528b17dcbb1d46ca72fb86455a2214a62ab1a6", + "aboveOptimalUsageBorrowingFactorShort": "0x1492f64150f3525f9cda754329bd25fe71f6ba556c1fa26df793bde1328abbab" + }, + "0x45aD16Aaa28fb66Ef74d5ca0Ab9751F2817c81a4": { + "optimalUsageFactorLong": "0x3504f44e5d4905186a30407b39139ce7b54746d02106167101100356fdfbe1d2", + "optimalUsageFactorShort": "0x5bf4696b46370397351cfb9a196b38195bded5562ff716dd88f2d2da72d190b1", + "baseBorrowingFactorLong": "0xf7558dcde5b52899fb030d361231b8dd90fbfc735fed17645076b6872b3712d1", + "baseBorrowingFactorShort": "0x3ba8754e07cae4a2e98de566c23bf04c6a5c6b3f52225aa37a117982e403030f", + "aboveOptimalUsageBorrowingFactorLong": "0xcf73113cb23db68f5ba210391318db5948ae2b6197234b9ba76612f6a7cca083", + "aboveOptimalUsageBorrowingFactorShort": "0x0170a61c841d61330e8111937ba036e1c7a701d94aba20a5cc09e610f0d3524e" + }, + "0xB62369752D8Ad08392572db6d0cc872127888beD": { + "optimalUsageFactorLong": "0xa676703d2a4d990051ed9ab24072580420db8a868ba25f0e63fa3c866395f325", + "optimalUsageFactorShort": "0x9a83d3d035d54d6c0ae1358c9b2efc33ce7ec0cd05bd8175107e36efd64257e4", + "baseBorrowingFactorLong": "0x803e2aab5ece0f6eb1996cfda1ec9ab07490892cbe84e33e495aae3c17baa6fe", + "baseBorrowingFactorShort": "0x7f55472219336f8cff55689870ff17725293c6367e40768f7003a8882ef411a8", + "aboveOptimalUsageBorrowingFactorLong": "0x7d5c1660ea291acb50df960be16c01ab18be1fbc369b3f99a8bdcd60a968190f", + "aboveOptimalUsageBorrowingFactorShort": "0x5e0e078f838dce9849dcc57842e8fa48b4a58188529a7073622eb4daf5183132" + }, + "0xD9377d9B9a2327C7778867203deeA73AB8a68b6B": { + "optimalUsageFactorLong": "0x733a742a0b35d6636681331663cd7dfec45aff43b45a0f9e41baf2c1dfb735a5", + "optimalUsageFactorShort": "0x557f086cf97a843e427828da5a20090d91682bf1bf0b1edb39ca7caa5c2c508f", + "baseBorrowingFactorLong": "0x6617d6d3b4f5a86de404df59d4dd7f8e97d2a3f0e97c0d8733315dc0c0a9359a", + "baseBorrowingFactorShort": "0x3e6080fae738b494a076be970b4052409bea015e00e83ab60b6ecdfec224c63a", + "aboveOptimalUsageBorrowingFactorLong": "0x8e158c03e6296e52ce1f4a760d19a4e51015f59710866a4209fb37163f4e140f", + "aboveOptimalUsageBorrowingFactorShort": "0xbf6026621f47003b34b34f5a595e30b4d0ce851fdef8e847f0b318a111a03da8" + }, + "0x93385F7C646A3048051914BDFaC25F4d620aeDF1": { + "optimalUsageFactorLong": "0xed8b10d952b85ea07d131dca734fc2b6560077aa3fe96270f9d78e3764223466", + "optimalUsageFactorShort": "0xc2f2fb4f95c95335187d011ec672ae5e5447303fbb7a3c6f0df1b1b4e70d5c9c", + "baseBorrowingFactorLong": "0x231b9b821669a89480037e822f36b461d5f6d9872f4d17dbca35fd33a624385a", + "baseBorrowingFactorShort": "0x1a21c0a6f6c3875c7c5edbbc0e0f1abecc8ec7a0a6103f1b557cec50bae6c836", + "aboveOptimalUsageBorrowingFactorLong": "0xcd351905c83f055a409219aa44788e6c6abea83181c1398550132f4192fc4d10", + "aboveOptimalUsageBorrowingFactorShort": "0xa386cf345a7940cecbcef26e696d18c0a72b056ec470a7f5f5bf04d26845d87d" + }, + "0xd62068697bCc92AF253225676D618B0C9f17C663": { + "optimalUsageFactorLong": "0x65bff9a36e1aa54e11af620c156b0763cbdfeef046df5a5ce12cb854dbf3bb90", + "optimalUsageFactorShort": "0xe9404ee782df41c027b1dc663c5339d2cbef97c188af730ff48179afdf3f0e0b", + "baseBorrowingFactorLong": "0xda2fce4b689d72e1ddc4a5fca5afc6fffb074fb53345306332952780c3fa6b21", + "baseBorrowingFactorShort": "0x2d5d8acb780bcbe87c273e64fdf1fbec46fc20a477822a4af868db6e869a457e", + "aboveOptimalUsageBorrowingFactorLong": "0xde75723d80e5912170381464e67eb055b78dd412f3f2178bbc9845c2e988acc1", + "aboveOptimalUsageBorrowingFactorShort": "0x0bba71f7a703f318d3b82423f4c341e3f5a2497bbb94c4a67e101f332134fa9a" + }, + "0xD4b737892baB8446Ea1e8Bb901db092fb1EC1791": { + "optimalUsageFactorLong": "0xe6f611c10e14d7cc6d40389c9ddb8e0e56784d73be0c6be4c2ee432048be23e7", + "optimalUsageFactorShort": "0x2f63972f95d536884027364b00e19486bae051757aa494cc96280f917c1e08e1", + "baseBorrowingFactorLong": "0x8c3d0c62b8d330e05c9a20c6f687bef4028c4b7be906e3f08de83517c5e9b8d1", + "baseBorrowingFactorShort": "0x032cae15ef145804cda4faa9054fee60d2097e619b7eb9c1d77fff79634df3a2", + "aboveOptimalUsageBorrowingFactorLong": "0xd7e6ebc67d8a1efac7d3bdb3de25751ed70ca8d24396fa72bf394e1bfdf9d61d", + "aboveOptimalUsageBorrowingFactorShort": "0xb2b835d37acd5ec71cd8204137bde17eba583baf15e4c3427b11d04301847f89" + }, + "0x8ea4Fb801493DaD8724F90Fb2e279534fa591366": { + "optimalUsageFactorLong": "0xf2803b94b8853f3aa5b152198b80419c1ce4d2f2718da8bf0d5529968388075e", + "optimalUsageFactorShort": "0x6d27cd6bfb659b84fcfaff740ecb0c0ecdf629d66e27e0e0e1596f013597ddf5", + "baseBorrowingFactorLong": "0xb8fd82ba634da57a851dfa6016f470370fdb5969477a455cbe66d0d4b696d4ea", + "baseBorrowingFactorShort": "0xabe589596666a3fefc9a90c0d33a6c03f313c6a0b7200711c7f46464aeb0a652", + "aboveOptimalUsageBorrowingFactorLong": "0xd9deb27462a35266851c84848218affb6db31b6d46732e0877aa5543c5c66f0b", + "aboveOptimalUsageBorrowingFactorShort": "0x898133354b4736630cebac61f4dd922f240a8f0f4235b8d9faf8bedfc239e919" + }, + "0xD0a1AFDDE31Eb51e8b53bdCE989EB8C2404828a4": { + "optimalUsageFactorLong": "0x79837f3b2010f2a070a4e4461159c803c9da9d19cd9ec06ecb975580e550fd31", + "optimalUsageFactorShort": "0x8044d373dc026daa0543e32c47c7598de5354e407641eaa50f42d04e35611ecc", + "baseBorrowingFactorLong": "0x533e9e055d8bcac6bc4a2c68b27068cd4de1107143b769b0350ba574340241c4", + "baseBorrowingFactorShort": "0xc9f74bda2912a3b6490eb635ac3547f608a8e5776279d10c637eaa78ac373ed8", + "aboveOptimalUsageBorrowingFactorLong": "0x6de13ff6f3749704af9fc7c09614064e56ecf449f9bca6fdfbdcd16bddcc9c70", + "aboveOptimalUsageBorrowingFactorShort": "0x1a7b394f9a4b556b3e6999a7fd1e798ab6b484baaac7d56a025a9418a8c16004" + }, + "0x77B2eC357b56c7d05a87971dB0188DBb0C7836a5": { + "optimalUsageFactorLong": "0x46844e33142e430efc030521242cabc2f264fad4d0c53950385f34b8e8cfedf4", + "optimalUsageFactorShort": "0xb35102ff2bcb6c1d13986a18d2f925c894ef49b7f386477f1ccf83355fdae747", + "baseBorrowingFactorLong": "0x82c6b63b62b89cdf40ec79f0fc67c5da0e3efd753613b8e97daba4bd94d2f442", + "baseBorrowingFactorShort": "0xa78c3aee86f14cd56f5d139581ce5bf4d14db783b50122ae1d71962018baa9d8", + "aboveOptimalUsageBorrowingFactorLong": "0xd6c0e644dfcd7cadcf583d0ce3a6a8b9cac1b82ec4a0b6f6c05bfa855d7b7239", + "aboveOptimalUsageBorrowingFactorShort": "0x2ec1fb2384f1c2eaf0850bda1fafd9d1ab30049cad05404e6219b8a434a1c123" + }, + "0x0Bb2a83F995E1E1eae9D7fDCE68Ab1ac55b2cc85": { + "optimalUsageFactorLong": "0xba9fe23ca99814d6d0ca973467f172b5c0204b4033a88c904a497a05b82dd10f", + "optimalUsageFactorShort": "0xa664e217bd59971e9288f3c3dd7f81677ab58e7d8f79b83b91c1426cde782ae7", + "baseBorrowingFactorLong": "0x4a5f8a3c650fcd9051a32de8b9affc99fa303b3cc18ac9d7df9629d8ab44e86e", + "baseBorrowingFactorShort": "0x7cfad2e72a5a453c5fce16efd5a07a4be672e0a4a0e3c02ffa762e131048df03", + "aboveOptimalUsageBorrowingFactorLong": "0x08afeddd3253df893ea01eaafa2423902a43ee00c24d4e86e8550e4eeda52108", + "aboveOptimalUsageBorrowingFactorShort": "0xa606a27560126e044c4367407296133d63ee989654457837667559f070aa5574" + }, + "0xD8471b9Ea126272E6d32B5e4782Ed76DB7E554a4": { + "optimalUsageFactorLong": "0x4dc627a2f37f17fa52108c01fbbca62b68662891101b72854e20e5a170142ac0", + "optimalUsageFactorShort": "0x76ee75f1da791fe95c5a94bc153a3de7d6c8978ae874853c8dba5c05f140289f", + "baseBorrowingFactorLong": "0x7086a545a04c66510a6855189ed81a2f2f9cec4e7104412ab72a81c7b96313df", + "baseBorrowingFactorShort": "0x169aa030b70c5c385f16a2cf4d8a6c2b79750da4d805c77c1f9620b6e351e922", + "aboveOptimalUsageBorrowingFactorLong": "0x56dca1f72e08e760271fa3aae9c672bb30d7ee0aff793f591420b4769734f2d3", + "aboveOptimalUsageBorrowingFactorShort": "0x547e2f14db88475c2529b1869d1e8951f4b1df40cb7407d51f17ae7431a328c0" + }, + "0xdAB21c4d1F569486334C93685Da2b3F9b0A078e8": { + "optimalUsageFactorLong": "0x67320dbd6bedb8bc67db806f0f41ff03721e17a1e74709ea9b59ee3c5cc2ed8f", + "optimalUsageFactorShort": "0xc825e9e08fce5df98bd9ccb889d26af528570664fa9b6b805a75e5364b58158a", + "baseBorrowingFactorLong": "0xa2467144140c5eddfc69ff0b82e1588d02983d39fdb4e75b17e0b573d5b158d4", + "baseBorrowingFactorShort": "0xfb0dd5d63086b1698ae16edcc4bc93ea37be4fada1c68742bb5fa0ae26faa5a3", + "aboveOptimalUsageBorrowingFactorLong": "0x787e5e87ac0df6ec4bb77646a244a5cbde43366e561528409f9e650d2029c37a", + "aboveOptimalUsageBorrowingFactorShort": "0x7ebdff6f00593a2eb42a72081a0e6254a8f50f6d80101401c761acfaf54e2087" + }, + "0x6Ecf2133E2C9751cAAdCb6958b9654baE198a797": { + "optimalUsageFactorLong": "0x74c1f486cab86d9c944ff350810006cdd14cbbdc30c572f81f593ff7e7660999", + "optimalUsageFactorShort": "0x3ab161bd16a775fc9f5bf78815da1cec92cdd8ffe8eb6cc671db0c41d67519aa", + "baseBorrowingFactorLong": "0x55630f18a6383ae0cb0eb5600efb05ef36073864c73858b35626918ac4edcaca", + "baseBorrowingFactorShort": "0xf2b399d0e564b225992a6490f450bf315f2b993f34c48f67be3f47878ae45017", + "aboveOptimalUsageBorrowingFactorLong": "0x2b07923eb56cec2878455428015c6e70cb68176347a4a957467a05f443d85702", + "aboveOptimalUsageBorrowingFactorShort": "0x1b1ada5e0da4da1acf270d48e90c443f12e32936552fc1457a0ad9c7dfd689ea" + }, + "0xB489711B1cB86afDA48924730084e23310EB4883": { + "optimalUsageFactorLong": "0xd6118b5679c88d6e2e6556f0f72b3ce79372470515cb320385f9e691d3e4763c", + "optimalUsageFactorShort": "0x861bd7f1e129ff27cd3ff9532d9ddc4d6b4ecc77726ec0a3281923e5a9d7bd8d", + "baseBorrowingFactorLong": "0xce4e7fbc7f98a99ce3fb8c4e251c252f91ecc62feb796be0ca6cab5b65bbb7f3", + "baseBorrowingFactorShort": "0x6daf84ea0b5f7eea0eb4f2f2809e2537ad79691bfa8539084526c2acb34e7223", + "aboveOptimalUsageBorrowingFactorLong": "0xb408c94a8c8188a1b46da21655357164191cf613775793645395ddc57ac9a944", + "aboveOptimalUsageBorrowingFactorShort": "0x73507b5fd368e1a6e4b12d87935759d94007328359469b178d7090041cf93085" + }, + "0x66A69c8eb98A7efE22A22611d1967dfec786a708": { + "optimalUsageFactorLong": "0xc9c32ebf8466fd3f4899d79f76cf8bd9f3b867d25d992d7f4881100ff3fc1292", + "optimalUsageFactorShort": "0x9e67420f14a22356378684aa7fe0cb99893191a160ee44ca4279ceaefebc3b20", + "baseBorrowingFactorLong": "0x0d3b5a51a7bc428b95ac7c811d7857ac7658522ea50864b862feb3005ab131ba", + "baseBorrowingFactorShort": "0xdd1ff9f612f846cedce0166ea5ea26a6fcd4b1e5234f566dac36e7e9d23d7c4b", + "aboveOptimalUsageBorrowingFactorLong": "0x70af662ab2ff6e99791b584240620edac97e1ecdc3abce75399a7505e5a38857", + "aboveOptimalUsageBorrowingFactorShort": "0x19756ca17d093f9f4a53e0223bcbec317d2734da2e5e768a549748e1e7f4d30b" + }, + "0xBeB1f4EBC9af627Ca1E5a75981CE1AE97eFeDA22": { + "optimalUsageFactorLong": "0xf088e7b6053f79ab1330129d5746e1a4af1558157cf71807ea17d7f3cd733925", + "optimalUsageFactorShort": "0x91b0f51e710556c4eea518230cf60fafe6caf829e7d706480767a2a2fe5a50c6", + "baseBorrowingFactorLong": "0xa98bf79180080b1b719a72f4b721699ebcd951e22d19aaff31d8c7fd5a367277", + "baseBorrowingFactorShort": "0x684e61eb7e9b22d6ef8654795c62913e8bcbc5a093fe169783208e5a81fc0d7f", + "aboveOptimalUsageBorrowingFactorLong": "0x84347ad2af15e85354b139d339560544ea2ef160737e25216969c29535daca1a", + "aboveOptimalUsageBorrowingFactorShort": "0xd4aad59896223ae29fbc9b835143d5df4d7144d03c68673b4b6f1cb2fc4b5586" + }, + "0x3680D7bFE9260D3c5DE81AEB2194c119a59A99D1": { + "optimalUsageFactorLong": "0xb9849aec937e9e25a14f24182a08c8594bb8c67578e70d6b684d939c1b14db20", + "optimalUsageFactorShort": "0x856b530370bfeffac08e0de7b0518824de258f8b9c07b9e1167f8c8a0c88743b", + "baseBorrowingFactorLong": "0xae6e7ede4a17c2752cc67b5cb9387cb72a5f2d1dc04fd0874d26f2f52436d6ec", + "baseBorrowingFactorShort": "0x5a8d707ac7c8e4ff2e519032cd4c963330867a2147841974d05a2e9c24ee48aa", + "aboveOptimalUsageBorrowingFactorLong": "0xff96602be2561d5413aa5df658cf9ca9aa87a5b4783750f6c556e56e86bee303", + "aboveOptimalUsageBorrowingFactorShort": "0xe918ed933fffb7c9dda659e1548b3cce7b700bfc02639d9645cafe6c01584bc6" + }, + "0x15c6eBD4175ffF9EE3c2615c556fCf62D2d9499c": { + "optimalUsageFactorLong": "0xa77fb3a62630868f9e0c6a3a4cfbe1a7145c06eaa934758c2302ca2c63478395", + "optimalUsageFactorShort": "0x05d12c5714d10668f95d9c6af0f7736d30784b3a99d4e0a248aa01adc41c2d71", + "baseBorrowingFactorLong": "0x6760c0e1abba4e4ea7bb2535bfc2bcca8a92adb0706aef13046fa7a4b46e0dd0", + "baseBorrowingFactorShort": "0x7032235bda4f13813b88a49a40c15d3538c6e4fdf0bda68363e507a81c0b2d19", + "aboveOptimalUsageBorrowingFactorLong": "0x7cda68b1fda472dc5778a97b81ce52cf199e54ba6f9ad64b4ddc91dd94c9de04", + "aboveOptimalUsageBorrowingFactorShort": "0xf83e782c5369ff7c115119347b8ea8991066d228696858eb1d27920a581ebba1" + }, + "0x872b5D567a2469Ed92D252eaCB0EB3BB0769e05b": { + "optimalUsageFactorLong": "0x4e467f50ab7eaa74f60f27e15788e704a2b1edf33b23e00f39ab4b8e29cef883", + "optimalUsageFactorShort": "0x520a1b57d45ebb9c3ada7b8474435cd9dd922897053e88694afffa05f501e621", + "baseBorrowingFactorLong": "0x84fa48b0b237e6b5a117e2a901f9112448b3ed06b631c0700d42c6ccb5e12a67", + "baseBorrowingFactorShort": "0xc046876906a87146b9fb6606eea5fd773d5de6fe4ac6ea886bff2609cbfdf130", + "aboveOptimalUsageBorrowingFactorLong": "0x820ad229e686744bfc32db4aa251e8a7df1ee3eef9113158ead7ab4651d71746", + "aboveOptimalUsageBorrowingFactorShort": "0x8e0703930b6f31ecad639555ff8751dc37b264d1cec3b7c8ddd3b353a7d40abc" + }, + "0xFaC5fF56c269432706d47DC82Ab082E9AE7D989E": { + "optimalUsageFactorLong": "0xd11cad227b7d7011a11aa416c3b17d276c6e4ac8c1426d8cd853c03c6f536bfc", + "optimalUsageFactorShort": "0xe45be47a4f6f2b491473f4b44e03a3b72a7dfe9a72065d634b04ae8125a97fe3", + "baseBorrowingFactorLong": "0xa6e8c82fb80b97cc65736ae1b34a28e08c8ee67a29a2a0c315db9f9737cab5c7", + "baseBorrowingFactorShort": "0x1f9af0d13a9baaeb2f7615f90a84326fa1b1ee24345470b332e47e69403563eb", + "aboveOptimalUsageBorrowingFactorLong": "0x5833a3f44a14d2c7e1c89cad9b21da071931ba68315a603e53b4cdb182c9230d", + "aboveOptimalUsageBorrowingFactorShort": "0x5acac925969609cbdbb7c7f9738f0c5db2b2a1961752f9281aa6acdc002a7a48" + }, + "0xe55e1A29985488A2c8846a91E925c2B7C6564db1": { + "optimalUsageFactorLong": "0xed7a469cf4b4607279cd197b180e0989492edae044bf690d1ca8f4a13603a5c0", + "optimalUsageFactorShort": "0x25c93536c8a3d9285770fada36710199e01adb89d9daf7c81df80e07f7dc951d", + "baseBorrowingFactorLong": "0x0adcbd0a9a66a9ca0fc1e706ed20c76a43eef24fb6ef463b5f79156a2a91059d", + "baseBorrowingFactorShort": "0xb006c011217df83fa2c57fe86938502a573737ce156cd2324c33d6645e2e1beb", + "aboveOptimalUsageBorrowingFactorLong": "0xb475539acd5162224a3444af5ed246ef1c5f1781f0198e64c95b37cc4450657c", + "aboveOptimalUsageBorrowingFactorShort": "0x426620bfe0cf820a058a0ad05777b46059bb1efc4b2a701ae95e3c5870ae8998" + }, + "0x71237F8C3d1484495A136022E16840b70fF84a69": { + "optimalUsageFactorLong": "0xe78d90436e4f45557db2590938ae3427582bf3a318e2651e12f3dd213a352034", + "optimalUsageFactorShort": "0xfbc253dd98f105b62bf0c5849cf609d18cc13d612eea7279ed487a25b58a4755", + "baseBorrowingFactorLong": "0x069e2770f165efc344965bb98a763bc21a17400dba57862e82f7503b6b380bcd", + "baseBorrowingFactorShort": "0x9cc3615eb65b850dde0b0e3781a05a1f9d85603c01711bc222ddc6180371c1ba", + "aboveOptimalUsageBorrowingFactorLong": "0x4a8ee117b6672c37927123502ce297de2635aa41c65abe3d3478309ecf34356f", + "aboveOptimalUsageBorrowingFactorShort": "0x5330b7b1cdcb45be564a288bb155e768d2cb1692db038f1ea490066b4eca7f00" + }, + "0xfD46a5702D4d97cE0164375744c65F0c31A3901b": { + "optimalUsageFactorLong": "0x69bcb16a411df2667d192a9dbdce7e83dca9e4ad0f5aee7470c52e4b1f2a85b2", + "optimalUsageFactorShort": "0x3d9046829f2508278155fb182e2ec3abd41645cd9a1aa316da9632c94059495c", + "baseBorrowingFactorLong": "0xc7cc0741890eaf3d0dd32b287c9cdb567c72a5fae1ab6559fa3128e674ebdde3", + "baseBorrowingFactorShort": "0x1d590c9a57ed446ccb5211329fd83e9384c2049e16cf65df34b0cd38802fc00e", + "aboveOptimalUsageBorrowingFactorLong": "0xc527d93e9d44fb570d38404f23058cae3075da4f1a8efbd78dbf36605a3800fa", + "aboveOptimalUsageBorrowingFactorShort": "0x515d88908e8665dd2b428afe6651d772fa316a392f1d400aba6f5fd41566120b" + }, + "0x6CB901Cc64c024C3Fe4404c940FF9a3Acc229D2C": { + "optimalUsageFactorLong": "0x1e5bb6dba07fa3ceb8c5c8daae37f216dcd2448ad5a9b4002e7db744ddffdd0b", + "optimalUsageFactorShort": "0xc8c365c4745d2f8c71a2e05508187d91087d20ca11d91b1567f45eb3b95212fe", + "baseBorrowingFactorLong": "0x9cae983ed9f771f1f0e3fdd2178dcfa196aa5d91279694d9084094aa4d080361", + "baseBorrowingFactorShort": "0x2c8a24ea5f7901a52cae791a67525e85c9b039734ed502d4ab2480438cd4749b", + "aboveOptimalUsageBorrowingFactorLong": "0xbca34723d022fa40f2810a0fd97d01ab7cf91b5ccd73daf3a58201e8a63024c8", + "aboveOptimalUsageBorrowingFactorShort": "0xcaad63fb8495d0c171ae4f1f51f20c608b50e4f02e0dcb309ad23e0514f006b8" + }, + "0x71B7fF592a974e2B501D8A7a11f5c42DcD365244": { + "optimalUsageFactorLong": "0x4df2fd67550df5878f250dc3dfc57b4dfd817ab08161308a6ace735707dc5bc9", + "optimalUsageFactorShort": "0x744d75016b4e200d7f96d21778a4600dfd84ee5e9b1949a286d94946e0aab22c", + "baseBorrowingFactorLong": "0xd6fb0ee5064962ff9215cb492b64147df4ff1f6adf9faa5c60119c7fbec47eb3", + "baseBorrowingFactorShort": "0x65fe5393c061ab7d27cd72701d489da67744c1b55b7c7fe16cab085261ab0448", + "aboveOptimalUsageBorrowingFactorLong": "0xa9295d2e694a5b5d50e29c04beefdb81d63ab8943ebce56438e55885a49ac1f8", + "aboveOptimalUsageBorrowingFactorShort": "0x159e758331eb4a112ef150765d702c60888bbe1dbac094baf4b90a0bd5f6f69b" + }, + "0xbD48149673724f9cAeE647bb4e9D9dDaF896Efeb": { + "optimalUsageFactorLong": "0x71f1ef34bafaf3150e1fdf5e6b1e8d31832eaa5d88f9f108a4503e5a5e41588b", + "optimalUsageFactorShort": "0xa4f72902a52e390bc8ceccf65289e6dfffcea902f35e4fc669475113c3e45546", + "baseBorrowingFactorLong": "0x1325e01cfd0713a63e2ed70e0ee7bca5d1172a25c3eea7cc975906713868bee0", + "baseBorrowingFactorShort": "0x4fec911ce56a0c870f2809ec7460f710c8df61a7a3c013be2671d1fda223458a", + "aboveOptimalUsageBorrowingFactorLong": "0x3363ad5a3e877d57e1c1fa70ba0144869ea5c348ca5564d31f14ff4e73591b96", + "aboveOptimalUsageBorrowingFactorShort": "0x7cb56df5410631ffa78c7f1560a2e63d8494fb1f75bc11b863c3eaa9a84da72e" + }, + "0x784292E87715d93afD7cb8C941BacaFAAA9A5102": { + "optimalUsageFactorLong": "0x676f0433f1a1065c9fc80d7ea9a22a88bc5e1c508f3c3c39727aa8aa9761d1a6", + "optimalUsageFactorShort": "0xe48efaac3f364f2c7192d18b741a6d56c5177365849d32dd5b2408c0599caf48", + "baseBorrowingFactorLong": "0xd0469722ab51accd4af7295aa548f7dc17fbea402d5699c81a9bdca9d3592c42", + "baseBorrowingFactorShort": "0xfa6f1f1b6c6ad558ae6e5e1a892b775b9110b48e338abd719d344a1b21b6a9bd", + "aboveOptimalUsageBorrowingFactorLong": "0x3eb20de8200b780ecd5272d346f71566fd9f2bc3f59e634384d7420d2731b98e", + "aboveOptimalUsageBorrowingFactorShort": "0x3124bf0600bcf8bad2d904846e3bdb8db4d4a3cf71030cc5a2441f5c78b765cd" + }, + "0xcaCb964144f9056A8f99447a303E60b4873Ca9B4": { + "optimalUsageFactorLong": "0x3847adb893677e0d251173ea6319604ea5e92e6a40e9fd24f0b18c778b8c221f", + "optimalUsageFactorShort": "0x8f84eeb18ea7d40f6c85bb2e3ab12caa9fcab6024486112b2ebe7f9d7d3a7e4e", + "baseBorrowingFactorLong": "0xa03718a501abea2cc433908ba231eb4342ff304baee0a77273bc365b7cf6c574", + "baseBorrowingFactorShort": "0xe4b2bb8aa0873f1e2f6bca372e107e07355fdc856240256b51e14a88318e935c", + "aboveOptimalUsageBorrowingFactorLong": "0x0d91b02d9417dce2d5bf3bc600c968e48fa49fff691ace626d55b74a57484c7c", + "aboveOptimalUsageBorrowingFactorShort": "0xf0227e71f7eda510d3ed04e54ffc9931498c445b20593dc1b36627cbacd65385" + }, + "0x62feB8Ec060A7dE5b32BbbF4AC70050f8a043C17": { + "optimalUsageFactorLong": "0x0ddbe785fae583d1503eb11da3cbdd8cd3c51f03d5352b0bed848ecd6c99c5c3", + "optimalUsageFactorShort": "0xbd815dda60df8fe6d0c9b423a6f6240044b2874b61ac3218ac353d3c373019e5", + "baseBorrowingFactorLong": "0x58398cf276005c162e5c979a31b0adf472f4ef0d2e1b885e1ac1573d834065f9", + "baseBorrowingFactorShort": "0x28e13a481e5cfccf2c4c3dbbfa56e23c7b327f55c0a890151ae1243a7b89edf3", + "aboveOptimalUsageBorrowingFactorLong": "0x645e9f88c3925c27fa55dc1c36b49e0b012b55eedba45581247d02fdb88a32da", + "aboveOptimalUsageBorrowingFactorShort": "0x947550989eee9431fa6bb7b5a6ac8f452a63b23eb80790c52cb5caff5771a218" + }, + "0x7B2D09fca2395713dcc2F67323e4876F27b9ecB2": { + "optimalUsageFactorLong": "0x376b8ccebbcf6314bd7631341bb8842a014340ac25be0c5231c72200b71be08a", + "optimalUsageFactorShort": "0xc58d8b2866fc2bbd0b656be5476560729e7a545279ac5486925008e367e8ae75", + "baseBorrowingFactorLong": "0x77e3d17ee8791d699534feb38ef086b909d863b0ef90badf080e7af5d25ba775", + "baseBorrowingFactorShort": "0xc9c5586da52863fece3113961d7599e1306f63cf9496241bb13e784cb359fd87", + "aboveOptimalUsageBorrowingFactorLong": "0x798efbaa4bbfdc30493626a6a06aaca1ba7cdc818a1fdb92ca5ad893221103b4", + "aboveOptimalUsageBorrowingFactorShort": "0x039d69908deeaa8649055aee030e6b93a6450b8ed8e80d3a057f2a812c3004ac" + }, + "0xdc4e96A251Ff43Eeac710462CD8A9D18Dc802F18": { + "optimalUsageFactorLong": "0xc2e4502d4382317ba9954540c9ec8586d6b77c4b583e774d6862e13adaf2fcd2", + "optimalUsageFactorShort": "0x6675da69d0981db44ea145bce71e123b04ab7ddfda059afdbe8d16fd7d459e48", + "baseBorrowingFactorLong": "0xdef7168f67b33198128a6e343362ee765d87e3c80472d9b0c833ad57141abdd1", + "baseBorrowingFactorShort": "0x4fdf614caa6c51c254728391a76374a4364ed294a722e4a1643c0686b2fa59c1", + "aboveOptimalUsageBorrowingFactorLong": "0xaf180ebae3188081ecf11c6cc71ef027373604e1dfc817e60697624c1c0ae062", + "aboveOptimalUsageBorrowingFactorShort": "0xcbe6f9cb2b8d9ee874b6ab34a69ec019e1e3f7d8ba9f2221df485889a720b9d2" + }, + "0xe902D1526c834D5001575b2d0Ef901dfD0aa097A": { + "optimalUsageFactorLong": "0xfe4499d2480b8af4dd1b5dfaf77e7f5d99826f01c1b67abe663cef4d261cfc8e", + "optimalUsageFactorShort": "0xb58297be4f6b805beb6f93b326b27a57f8c93156b2ff8fa7718d7243afa4d5e8", + "baseBorrowingFactorLong": "0x3d7974ac9445925e563a54b06aa76ecd8680a0698ac287ab8ccc4a8bd5f7ce6f", + "baseBorrowingFactorShort": "0x3074c53dfffc3ce381b7e3cbc0cc056ae98105e3b4fe0e0d30a94e4e7d15c278", + "aboveOptimalUsageBorrowingFactorLong": "0x85d6f09a0bd005d0b868cd88f2f89894549eb17c92845964bfe5d79728963099", + "aboveOptimalUsageBorrowingFactorShort": "0xacf2221e8bbb8ee2542af5d48ee59621b410f281294faaf393c0f78cb29f54fa" + }, + "0x4c505e0062459cf8F60FfF13279c92ea15aE6e2D": { + "optimalUsageFactorLong": "0xd4f1be664bfc75f3539579f29105cb5aa13d2069b7190a81d7f6db8613a874bd", + "optimalUsageFactorShort": "0xd224ea93e7c7adeb17f065b52a2a31dd235cdd06755ccc1744149b007922336f", + "baseBorrowingFactorLong": "0xc586f3364dcb93c7b5d428c792d5510d225ab323eded614c0f79442f5e20deed", + "baseBorrowingFactorShort": "0xf2ff853aedbe2c0744b559003a933348f9860c229fe1ea217398facbea4c2876", + "aboveOptimalUsageBorrowingFactorLong": "0xa5338865a16168457fd6b53ee43866a72556f213fd5eb0c4e63596582794410a", + "aboveOptimalUsageBorrowingFactorShort": "0x04afc03c7824845cfd9004c6166652aa5d397f64ef9423eda2bb3d479f14d9db" + }, + "0xf22CFFA7B4174554FF9dBf7B5A8c01FaaDceA722": { + "optimalUsageFactorLong": "0x3e71f7e34472687cbde84700c885afc0ffe114a75ed6356f5f2d245b0af5bbae", + "optimalUsageFactorShort": "0x20d9bdec57e6306623d2ea4ba24b583f6a7ecd68d9e822a6ec22ee80b6aadd22", + "baseBorrowingFactorLong": "0x776fe1f47ced538f15c252150aa94226518cf2c6fb819500822a746df613996b", + "baseBorrowingFactorShort": "0xbf4ad6e2569f054b529fedad1d1c8566cd866e4abcff1c30ec04c56deb949514", + "aboveOptimalUsageBorrowingFactorLong": "0xbd34185cc525927b63cc4797275a80ad5f0b6b756ce34691837581d5f3887bd7", + "aboveOptimalUsageBorrowingFactorShort": "0x428ec330bfa2b6f5282998e809b59b716f2a4a8fba70ba24b67b144147d7002f" + }, + "0x262B5203f0fe00D9fe86ffecE01D0f54fC116180": { + "optimalUsageFactorLong": "0x5cd0a6f4d08880a553d00328047d126fc5618e56d9fa39fd2f3d3038d7069628", + "optimalUsageFactorShort": "0x435441224c76dbb9c07d077b1820d0e5400b03c0aac2f194c5a7a77b0acdad80", + "baseBorrowingFactorLong": "0x7f84b8507658f93b7c6370a97fd6dbebf320525adaa2a51a205d1c22dc6df88a", + "baseBorrowingFactorShort": "0x488ad2e07ed1c47aa04dd86e97f77426c6197bfa6cff17a8b805a1cd15dd2d90", + "aboveOptimalUsageBorrowingFactorLong": "0x09bb0347a83fe3a7c85be68bdd48acc437af0a5df63af4d71f89958060a5183b", + "aboveOptimalUsageBorrowingFactorShort": "0xf537f2f92d9f7d503800034e53ed5df8212d23c932b380ad03aa870876595a35" + }, + "0x467C4A46287F6C4918dDF780D4fd7b46419c2291": { + "optimalUsageFactorLong": "0x964962aaee802042c5a9840c0ccec35a3c08b7c3a99b7acec279fdfd6d0f5602", + "optimalUsageFactorShort": "0x9497c0e6a7adc621b90db81d6d028f6f5b1583b345b578cfcc4833e7d1279906", + "baseBorrowingFactorLong": "0x1640108e55e6399e5b8517089cb4f7862284b1a447a5547af7daa4aa0f6f164c", + "baseBorrowingFactorShort": "0x3c5f5cf695ab4f79a081f2a1136a0fd87e68f0a2c119db8c2805f8ca0ece90c6", + "aboveOptimalUsageBorrowingFactorLong": "0x5e9f8c8af639f59403d5633aefaa65be94ee1ac99b0910b200b02283d34f2e85", + "aboveOptimalUsageBorrowingFactorShort": "0x278832c9b87471c0f856e3f31aa6f860be363c8ebaa0397627c85081e39b12fc" + }, + "0x16466a03449CB9218EB6A980Aa4a44aaCEd27C25": { + "optimalUsageFactorLong": "0x9e8b87143824c5582617f91611124f33711bb42d4018d803aa1d9450ad89043d", + "optimalUsageFactorShort": "0xaddecfb296f8550d3cbdbe1b9d83a97c06ff83f1fbd39396ff2ac28b43671a66", + "baseBorrowingFactorLong": "0x5537e1948501ad11928dc214dc0d165620884e871e9cbbcf5bc4ce6144ff3a11", + "baseBorrowingFactorShort": "0xc756628a72705a8f2ba1b0737509bc1e2e38afc2559cf5369c055de4e159007d", + "aboveOptimalUsageBorrowingFactorLong": "0xc60421377286117683d89fd5d15804d8e99a3d162b76d2bf5b70c22b1342f0cb", + "aboveOptimalUsageBorrowingFactorShort": "0x408b169f8bb5ede6252afb6fc2febaf67d40eb8856da18f261c616a86f65d233" + }, + "0xFec8f404FBCa3b11aFD3b3f0c57507C2a06dE636": { + "optimalUsageFactorLong": "0xb0bbe375e4a0501194eb24c6d72a6e1485a2fc7a71a3ba2210452efc231ce057", + "optimalUsageFactorShort": "0x9f2221ea701bbe10945f600b466ed40242c81f78347b6bb09f44d7d2f3890a37", + "baseBorrowingFactorLong": "0x2e95da37022c244a6d69eb66549f0a98ec05b21cc542e91d1f96ef352d9cd076", + "baseBorrowingFactorShort": "0x2e2b3ae8ca19b0139b5ff461e52810bdae6e3994baf60c61d60db402bf0a4406", + "aboveOptimalUsageBorrowingFactorLong": "0x77b2d3054c40f15792ca1cf076c931172af3d568fed4f7e5ad53e20072d45b5f", + "aboveOptimalUsageBorrowingFactorShort": "0x1c89eecfb665a04121de2af51dfe78fe9aecf9c8882b0f9a418cee6a7ed94958" + }, + "0x12fD1A4BdB96219E637180Ff5293409502b2951D": { + "optimalUsageFactorLong": "0x479fdcf30b5a854aba48b6691930693cbee17e30a881b7f8e48a1bfecb3dd864", + "optimalUsageFactorShort": "0x53e8dcac5f6deb6fe5ae5a88615623bf66ade2f16a3c2825b9ad64417737bc35", + "baseBorrowingFactorLong": "0x6e0a8720c61c3e59b5da2275b93dfb83970df9aa5a1acede764d15e6994b28cb", + "baseBorrowingFactorShort": "0x67ff5c4e5943c164dcef85b16fc224f121483949ff19eef16ee873bb9ef0576b", + "aboveOptimalUsageBorrowingFactorLong": "0xa2fdc799365df5bd5e1c044b5794dab5e068d0477767fffee9ef8e8467d40ae8", + "aboveOptimalUsageBorrowingFactorShort": "0xd537c4a116ec4b7c4208d06b1fd1ecab101a8383bfeeb397df76173d2a7d9cb4" + }, + "0x9F159014CC218e942E9E9481742fE5BFa9ac5A2C": { + "optimalUsageFactorLong": "0x23d964c7f529332c527b32496d2c7584043bcb4a032c84a4a0d1928a8ed16ea8", + "optimalUsageFactorShort": "0x82eca7ce02a1cc911dbaaf1c1ee6cd9b9988d5183b463f98547fd9f8ba42e355", + "baseBorrowingFactorLong": "0xd72ad88d228a8f07e39f354ed72fcb630aec2409bd1e0af6986ca41045e14200", + "baseBorrowingFactorShort": "0x16f6b247f7bf2ee09645fa83cc36b5aa463d55aa0447d7f51b2479fdb4e2ec45", + "aboveOptimalUsageBorrowingFactorLong": "0xece909a3ef5682c0d9d37820c7d1784bb27446df836612338ecf1ed24c853c82", + "aboveOptimalUsageBorrowingFactorShort": "0x4514eb5674c6c7d4cd73f6964e8060c240feab38036e8e7a8f759be8e48a2f0f" + }, + "0xD60f1BA6a76979eFfE706BF090372Ebc0A5bF169": { + "optimalUsageFactorLong": "0x55658eac170e10c6f18135229a5cd852ddbe9379e57b941b6a1bf4e25ef2b4bb", + "optimalUsageFactorShort": "0x31e32683757b51cd2eedb16b4237745fa64400ce3abfac1893d3e2d8ce47d554", + "baseBorrowingFactorLong": "0x928867d35ecfb7bddf91974c2353c54236c57c3d577d8178a2491792e7d18d0e", + "baseBorrowingFactorShort": "0x7a8c6c03f5296a37c3cd0c79575ce4a504312306517afb9c59e5d54060e21904", + "aboveOptimalUsageBorrowingFactorLong": "0x54a980fd43d2e55afc8be3887d69bcdd0e8549f174179079e6d959e221c62d92", + "aboveOptimalUsageBorrowingFactorShort": "0x4a3089b46f753b101fd2a53d57d690ac834487a47bb46ec5023ef9f98ca1fdfc" + }, + "0x5707673D95a8fD317e2745C4217aCD64ca021B68": { + "optimalUsageFactorLong": "0xb0e47d3696191eb5be864851a04aeb5e6a0795e4d0196e51011449cb96b01faf", + "optimalUsageFactorShort": "0x7224a50d83d1bf9108f22e4c8df0c88af24c0ddc817e6af8f7f75ad0c7192b57", + "baseBorrowingFactorLong": "0x6107b04045c786d2f7c8adf1d3a20f6bf44da36930aadbc2ae2feefb52fb08b5", + "baseBorrowingFactorShort": "0xb9b472fd43ea13bb65376f593ada49267d44656b95b776b37498b2ef4cbab468", + "aboveOptimalUsageBorrowingFactorLong": "0x731a32303b33745516ec459821d85db78020e88f324927ab62bbce07e075f932", + "aboveOptimalUsageBorrowingFactorShort": "0x128931b8e124b9d6f88ce1b5c577f88347d62b2e6497db4ac5478004cbc6d990" + }, + "0xe2730Ffe2136aA549327EBce93D58160df7821CB": { + "optimalUsageFactorLong": "0xc6b9442f62e4f55eb5fe1e04ba7396adb90e9c8a43c1b0e9e70b018028eb2c8f", + "optimalUsageFactorShort": "0x7e396f9ce3f43a358d0cb5f64499c0d67edeb3c7bd98458e2e3e74cffeb0b49c", + "baseBorrowingFactorLong": "0xdc1930499a55e33e556accdab5044862e5e9e78e992fdd2f5afdebb74403630a", + "baseBorrowingFactorShort": "0xe4d0f172b0c6812c375dd191721e9dc46fdd36f37ff90d3bf6a6e935b4c6a199", + "aboveOptimalUsageBorrowingFactorLong": "0x04cb2b6b6235deede58442bb4611047e5e0b592694f577eb5c1eec6e759a98dc", + "aboveOptimalUsageBorrowingFactorShort": "0xd7565150af4992698334b8aca479724f8ad2d8a8de5822d46f743df2ea396c12" + }, + "0x876Ff160d63809674e03f82DC4D3C3Ae8B0acF28": { + "optimalUsageFactorLong": "0x01b1140115a4c7382f5b5b75e06ae772d9fa28d65773638cbb366df7ee2347ea", + "optimalUsageFactorShort": "0xceb5fb05b716b2d04c66e546f19d878afe00aabec9313b2f91f1083b763071cf", + "baseBorrowingFactorLong": "0x0bc36d588acab62adbd0048fbda7ea2ebb98bf126fc2bd563739ba5f299d0808", + "baseBorrowingFactorShort": "0xee003465a5a4874c849c52a6764bf3fa0736e328d046233a169a1ce31c8e7f37", + "aboveOptimalUsageBorrowingFactorLong": "0xb6aa53ea88b93bf0847bfcecfcfefcb798c66df98fe18afab02585069500dc57", + "aboveOptimalUsageBorrowingFactorShort": "0x1511cae864ffe5222be8d8ce600441cfaa3b3db263a7047d39b89d7a228acd6d" + }, + "0xE61e608Ba010fF48A7dcE8eDd8B906744263d33E": { + "optimalUsageFactorLong": "0xf587745f182185ff1c932462489866e499baede964ac01f8c1b0543ae52dcf29", + "optimalUsageFactorShort": "0xac30e08d5e6f57bbbe9b8c05cecb6df3351ce4049406cc8d4525b2fa0105d00a", + "baseBorrowingFactorLong": "0x7311eec55844203b5aade6a7baf584b29b1a3805752abb1d1ac7254eda8d0108", + "baseBorrowingFactorShort": "0x8c052b4033d14fb217cdf03097c2537e2a2512ea0106c8689c71cbc1c5b778b7", + "aboveOptimalUsageBorrowingFactorLong": "0xd69ae843d329484605b65242ce37d2c08bbaaa9167e432e8e495264274a5c7a2", + "aboveOptimalUsageBorrowingFactorShort": "0x0b595a9d3a3c81cdb9b4e23ca85e6cb2e6b598cd45466cc02158cb70fa336230" + }, + "0x75F190E0Be6E8B933A01423EFE398c6C721A5CfF": { + "optimalUsageFactorLong": "0x3f4c26d596d44c5093a6cb80199ae76730bd50b912c30e2abba59c65efe160fd", + "optimalUsageFactorShort": "0x26b3cc5a7aeaecc9c476dc739c3cff282c0644a96f78ecc6b30311b73a2d98e3", + "baseBorrowingFactorLong": "0x1cd3a5bbe8bc6ca47c521170d2313f15f146343da0b36a5b2a193c244bde0849", + "baseBorrowingFactorShort": "0xd437c72a209439aea0b4623746ccda22497542193917897cca9466a585282186", + "aboveOptimalUsageBorrowingFactorLong": "0x33d0d3d3851a0177d2bbc3f227236063107d5a06fcb4a3da1491a9bed0a810ad", + "aboveOptimalUsageBorrowingFactorShort": "0x8cd306ee4cfb952cf121301933a3ac1d25549042b52c11cab60f877e98988236" + }, + "0x0c11Ed89889Fd03394E8d9d685cC5b85be569C99": { + "optimalUsageFactorLong": "0x0c7abd6fd43c65c3ff73bad2445e101c24a37da719734b4dd3cfbae804bb0ada", + "optimalUsageFactorShort": "0xe7939c977c16fcf5b73fe20f9413f62bc6f0c6a737e9d8f6776d59adb478f417", + "baseBorrowingFactorLong": "0x32ca61bf893a997ec2b7179d058b496e951e15997c7ecf4103d9dd3b964ebded", + "baseBorrowingFactorShort": "0x6927475978141dd45efb50a7eaaad664c66cc9d62a0c12eb554c621bad815b07", + "aboveOptimalUsageBorrowingFactorLong": "0x0dcdc7c2c0b0a7dfc114898e7638ee109174cf154f3edfa57af7531869152ce5", + "aboveOptimalUsageBorrowingFactorShort": "0xc4097f5815a5c5a49085ffa148efb0051649c8eba071a4d1fc559668e8233c3e" + }, + "0xa8A455Ed94b315460CfF7d96966d91330f6A3bA0": { + "optimalUsageFactorLong": "0x0f7aa3b0df181f97898475961b54f17620e3f8e6aba1b9de94e4c451454b8764", + "optimalUsageFactorShort": "0xd5a1b5ddcf6b62b640167dfe552bedd8da1e90d2686bd232d03954713e9391e9", + "baseBorrowingFactorLong": "0xd0e5927611aad48e7413c9d86739871bdc62c95cefcac6ffb4d3f521871aa957", + "baseBorrowingFactorShort": "0x3bb48ed7c4fc26bc955ebd21ed2c9a91d235b4fe622aa58453b3c6200fc3c373", + "aboveOptimalUsageBorrowingFactorLong": "0x80d078b3dedda1733a53f81ec4b66d105e2d93b3c389370abfd610e9df84d41f", + "aboveOptimalUsageBorrowingFactorShort": "0xd39a12cfe60ab144cb0a17f37b7405e1448839aa66a26c157046aa6e53da4e7f" + }, + "0x970e578fF01589Bb470CE38a2f1753152A009366": { + "optimalUsageFactorLong": "0x0d46ff2a009402159419cfcde7d9db25490d64a82e9e8c2c243213246b003113", + "optimalUsageFactorShort": "0x313965d0881117785294077448f6abcc941c43aaa547c688fe2abd846000313a", + "baseBorrowingFactorLong": "0x4bfcd3e23321579b47e3f58b29116782894407ce6d77c59bec35bbb6d09e9144", + "baseBorrowingFactorShort": "0x7ea5bdb9bfce93e7a105187f1f47e59158847a5714e597f4592d283911406b67", + "aboveOptimalUsageBorrowingFactorLong": "0x84398f74cff33295a7f82249c66aa3106488fc627e857055b69a07c6a26d96dd", + "aboveOptimalUsageBorrowingFactorShort": "0x9e3b70379f22d88325e5a1f08a0cd3d1978fbc70a6feedcc394be1a2b588d777" + }, + "0x04DecfB37e46075189324817df80a32D22b9eD8D": { + "optimalUsageFactorLong": "0x0f3e23afbde03ac9fe58436751ca9f882e7097292e1a4b2d79df5aff3bee0af6", + "optimalUsageFactorShort": "0xde4e4da3ad8f8e1a85416e2e16d8c4c5c5cf4dac147595a19d1c6e0c0dca619b", + "baseBorrowingFactorLong": "0x25441a76839790e66fad03d17801a9e69e82f73332f5ba6598703cebca56f357", + "baseBorrowingFactorShort": "0xaa8dfbf0480c3be0f16a5564e7f6446e9c1f03e512ff5562deea3afeba30826d", + "aboveOptimalUsageBorrowingFactorLong": "0xded39872f4200177e9a997313f3948854ab8a4bd4332c2ceb0f684513a7d163c", + "aboveOptimalUsageBorrowingFactorShort": "0x96db7d0c7ff710cdeba84a4bbf27652f50d81e7957831f5d45da0eda45bf3b1b" + }, + "0x4d9bA415649c4B3c703562770C8ff3033478Cea1": { + "optimalUsageFactorLong": "0xd2c3408f369046df04cefc49eb72df06f8702d7a5a3bd447e92d964c0a47d18c", + "optimalUsageFactorShort": "0x1186ae8b7dd3400ce43c75df27813ed3a9aa0465a7ac064fa7aa1c638409acba", + "baseBorrowingFactorLong": "0x8341593765049554e864661bf6889750850978b9f5d7667809e348703f30ecd0", + "baseBorrowingFactorShort": "0xfce24df13450429027d7f6fbd95188a2f84688bc6b27600a9901680699a0aa48", + "aboveOptimalUsageBorrowingFactorLong": "0x84b0fe5cbe6ed0544ebff7a2d7a909f49b8fd69083a33ed4a13bba54166ab840", + "aboveOptimalUsageBorrowingFactorShort": "0xf9e344020cb95bd7f8ba1be624a7f46061da0dba4bffac79c8746e5705f15228" + }, + "0xdE967676db7b1ccdBA2bD94B01B5b19DE4b563e4": { + "optimalUsageFactorLong": "0x18c3185cad55a71241d512f5aac65209f44fffb7a72f5f982d1ba93ad5acf16a", + "optimalUsageFactorShort": "0x8af14bd4c398fa54e5ad8923961d1987d380502364ef29647bb7c6782870421d", + "baseBorrowingFactorLong": "0xf8ce3418c89ac06027698bd175da929c59c9f945a66498663c877e211036f2d2", + "baseBorrowingFactorShort": "0xf79e01aa44c06218b8df59ec882f83b46cd5473ed56791ca81631536bf628168", + "aboveOptimalUsageBorrowingFactorLong": "0xc5f35c740b59a7dc606c31317d8ea670fa38039bbefbffc691f733fc78a6603d", + "aboveOptimalUsageBorrowingFactorShort": "0xb80cb620e86404f10a367ddc927c4d4e0ba8fdf02f421f87e9f308e913f27f6b" + }, + "0xBcb8FE13d02b023e8f94f6881Cc0192fd918A5C0": { + "optimalUsageFactorLong": "0xcf309bafa9c7a52941986a4bd32acca6fb0059aac733457d255e26e21240e1bf", + "optimalUsageFactorShort": "0x24a8bc5317c39c132ccfdc098b8b879aa79b6b128bbfe78723a79cfb2e4386fb", + "baseBorrowingFactorLong": "0x6fae5470247159297d8b28158a8822b2a7ce7928fb93f3260c0ca2875640bc9b", + "baseBorrowingFactorShort": "0x580bf146a7ce280796a704eb00658db4d123349903203328e3bf0ca59fea3f3d", + "aboveOptimalUsageBorrowingFactorLong": "0x6e7a2f531e3aa98cd75df5772e0595cb51b9d6d1f3941e34f85eaddcbc4d8377", + "aboveOptimalUsageBorrowingFactorShort": "0x7b8b4be8dc7452b3c8af43457f9ec1d0bef607c2861e0143a3ed0526994c85ec" + }, + "0x7DE8E1A1fbA845A330A6bD91118AfDA09610fB02": { + "optimalUsageFactorLong": "0x87a099eb1119d491a578f3331fb54dd82179641c7cbcad1b39c841b86fe839f6", + "optimalUsageFactorShort": "0x5ddbac0a7099e2b22c5ec79acfe6a45da3a2cd8e80bc477b7ec3c9a1e67ed8c8", + "baseBorrowingFactorLong": "0xa720cd3cd829d5965aa32069c61bf4b02d766033fd90ca1d8caa679c1e390db2", + "baseBorrowingFactorShort": "0xa44e171a5304dae690e1bfe22bdc8526b3787cda047c3fd1eed80d62a3d35ea1", + "aboveOptimalUsageBorrowingFactorLong": "0x2410ab4318c864ef567de4547982f64b0efe3c149ca34db1fe017ddcb9c88e06", + "aboveOptimalUsageBorrowingFactorShort": "0x384f906c85d5319bb92b8c5dd0e2a3cbbd34ca7fc1cfdad2d3b8e4097a067e2f" + }, + "0x2aE5c5Cd4843cf588AA8D1289894318130acc823": { + "optimalUsageFactorLong": "0xc6265c3e2f071799a33f92b211d7b65ed3165243bd5486fed1204f34ae53e3e9", + "optimalUsageFactorShort": "0x890fbecff4d040e1fa1781e06f8a896b7a7718f5718d6e8f9d8b3488fed3d437", + "baseBorrowingFactorLong": "0xde80b755b87dc0377e767c1a94205d3374b7cd92482da431ba4f9928e8b355e4", + "baseBorrowingFactorShort": "0x596a5b6ed7594ec00d8d5109c84f3f560fa2e883228be1c2ff21306b8a1f146c", + "aboveOptimalUsageBorrowingFactorLong": "0x23bf72f36ba7ce9b14f68c2e8852d11a509e9edf1551b6bee68c9f02cf2a4cba", + "aboveOptimalUsageBorrowingFactorShort": "0x59f9664787ef9be39e3215f8ac7854bba21cfb82dd43765fc0e09d91d91dc0c4" + }, + "0x89EB78679921499632fF16B1be3ee48295cfCD91": { + "optimalUsageFactorLong": "0x7f2b4b30148038dc5c267e65a2a9d6bb906aa7398b06e72eb10076b2cd7b4292", + "optimalUsageFactorShort": "0xa26e9c68c98abd1b37282b088fed93ba64212682ae385ece21969c8eb9320631", + "baseBorrowingFactorLong": "0x44d836fe77dc13ed8cf3bc441bd6a03af7a87de20456458139f03ec2be3486aa", + "baseBorrowingFactorShort": "0x4385c8e191a978b34824ae41b408ba588e261054e5945d0e99068ad10b4905ed", + "aboveOptimalUsageBorrowingFactorLong": "0x2914e46a2e627cc733a945a8eb44ab2ef758f9a6fc35821bec5e340d7e0239b4", + "aboveOptimalUsageBorrowingFactorShort": "0xe09312ebfcc03606ed101a23c5fe2e9883e431d2787ba65c5a0ae9526b58ce1b" + } + }, + "43113": { + "0xD996ff47A1F763E1e55415BC4437c59292D1F415": { + "optimalUsageFactorLong": "0x45bc84b29ce8ad040170535b6d32676b0ebd193932f4a5b2b28a619285a7091e", + "optimalUsageFactorShort": "0xef73856d1d814fb274b8c9f7dd2580d2a07fe756e2cbf1ace1c548119991a9e3", + "baseBorrowingFactorLong": "0x93b3739dabce254671757dbb584a37b2bb37dd3b758684ba724d7a6ba8422799", + "baseBorrowingFactorShort": "0x02ca0ffdff2c31cedba570bc4811e1396298fe384a34c393050b14777a45da78", + "aboveOptimalUsageBorrowingFactorLong": "0xb7dbafbc1974b312d7433357fe73e823ebabf36a5a24efaa75ca5229952c8f8b", + "aboveOptimalUsageBorrowingFactorShort": "0x2f3170d87957485ae4c638839e0e36cab1558fa3198e9f167a33b5183175ec81" + }, + "0xbf338a6C595f06B7Cfff2FA8c958d49201466374": { + "optimalUsageFactorLong": "0xcb88b68f0457a4b3d6cb66a466fee3e0b87299e9dcdd6a6bb716c857e10e4993", + "optimalUsageFactorShort": "0xb5097cfa0293895f0d2d4048ad9e3610188f4722013f25ca81878f69da2c891e", + "baseBorrowingFactorLong": "0x7b961d97c3d6c485faaedd3af288b44ed94a96b49fa78296cfc09a41d52844de", + "baseBorrowingFactorShort": "0xc99f39f99de9ddbe8bdbf457f4c736906070a9ef5fd3647ca908111bda6e5fb3", + "aboveOptimalUsageBorrowingFactorLong": "0x6a37c1e7afec3939b0b80a7b5c26a6b9df234ddb877620efa5a3b58182ae515e", + "aboveOptimalUsageBorrowingFactorShort": "0x94d18a49997026257edefa958186003880f33e2cda6be23b5ae6f1e5160044cf" + }, + "0xDdF708B284C5C26BE67Adf9C51DFa935b5035bF8": { + "optimalUsageFactorLong": "0x2c47777cfd997a7ae5cba45c53d4b82b860beb2d980e9cdfb69eec0367f28ab7", + "optimalUsageFactorShort": "0x73d2fe18868bd58226d4cf599f3a5533b8ad09bcb389a114680017276bc588a8", + "baseBorrowingFactorLong": "0x9083bc668ce82fe09254d0d13d22faa634bbc99973fa2406d14e08de71a0bc30", + "baseBorrowingFactorShort": "0x5cf3785e555fdfa2f34a1e7c92a5928f131e88b46bd0a46e4fdc7c4eb533750b", + "aboveOptimalUsageBorrowingFactorLong": "0xc809fad77a71fce02e19640a71c068be0c57056cfb826c67d36e8f923b855223", + "aboveOptimalUsageBorrowingFactorShort": "0x090a2575d0ca45282c423091a8b0e7429073c67b262dad0f7891cd00c56c94c9" + }, + "0xe28323955C05B75E25B56C1c996C1354Eb5Aa13D": { + "optimalUsageFactorLong": "0xea7c1b55868566be0f032ce521449814a994469a5ff8d0c4a9d7298440f55378", + "optimalUsageFactorShort": "0x7c642748796c754f33e649082b2c46073a51098e80cbe032979f9c55a4cc0f7f", + "baseBorrowingFactorLong": "0x84d7a79bb10b94bc123729b9acf6aded05b14f42e3d40157bbb7bc64dea3456d", + "baseBorrowingFactorShort": "0xef63a932fbab45678fc7f2b7e073a4d0628d1142f02b183a87b705422e3272c8", + "aboveOptimalUsageBorrowingFactorLong": "0x8875daebc0560b419b04b7f4693c47f6966ea63979a6135b6ca1fcefc1ca65d8", + "aboveOptimalUsageBorrowingFactorShort": "0x2b3cbc5739b0cf378fa4175a1433b3296b291c119086fb21591df0eeb2edb509" + }, + "0x79E6e0E454dE82fA98c02dB012a2A69103630B07": { + "optimalUsageFactorLong": "0x974b68b86bccc2159d5f82c5b3a64745f0e234e6046b353c25c92afa3938085e", + "optimalUsageFactorShort": "0xc7ec3bebbb114058809832a0747fe54795575964955e783141bfb1ea69d35013", + "baseBorrowingFactorLong": "0x97ef4104dd1577ebffda410270f8a19b7e1501f4b2b9c8d17ff2162835236959", + "baseBorrowingFactorShort": "0x02e7c6bc206a595e4aa532813e6289b86da396fd0cc4f9f9aa1d71050e735d3b", + "aboveOptimalUsageBorrowingFactorLong": "0xf645d5efbbe992d34bcd1d0bb8b2f15b4cb76180ce150be30353b78ba2332323", + "aboveOptimalUsageBorrowingFactorShort": "0xbf89211ffc7362e05d3e7f2412e1e662f91c3b624dbf7b952d277f812161cf2d" + }, + "0x4b6ccF6E429f038087A26b13DD6ab4304F7E5DF1": { + "optimalUsageFactorLong": "0x55bd5e3f40312446db6d973505e5f9beb9a95055f883f0f833af4b7859a40f41", + "optimalUsageFactorShort": "0xd51653b92f796a0c2dbf493567657643abaffb6d7d91b6c4dba27fffae9a10c2", + "baseBorrowingFactorLong": "0x1d8f1e2cff29d65f8b85cc47fc4883b8f23cb1c846aeb86eacb34edd30c43f19", + "baseBorrowingFactorShort": "0xefeb54e6ca533c88cf7d655d56e4aabc654bce2e49eb7226101974d2a18907fc", + "aboveOptimalUsageBorrowingFactorLong": "0x862fa7fabf8f0b76677a270bf0dda5ab5a769517a4720a5f4bc4f15104ecf75f", + "aboveOptimalUsageBorrowingFactorShort": "0x84db95b16f007bcb148c23531cfcf626365b9612fd2f3b12242abf5158d3afae" + }, + "0xEDF9Be35bE84cD1e39Bda59Bd7ae8A704C12e06f": { + "optimalUsageFactorLong": "0xf350e92152f5aba90fdeed59ceb7791e416e83b4967dd7c69e5613127d479603", + "optimalUsageFactorShort": "0xbe4913001f3f8f1c84a25abec847cc262592df99b5ae44bd494420ac41a9ff7f", + "baseBorrowingFactorLong": "0x28020d0cbfc32f3f12bcd16122c43e72f3dadfabf9f5b8894165ca0d884b54c7", + "baseBorrowingFactorShort": "0xf3486d205ef53dc108046e23e96cedd4c53b84d1cef7529d1bcc087ff24a4b16", + "aboveOptimalUsageBorrowingFactorLong": "0x054c80dc25522bbd0b3f653cbb8a34a2a3b02084d3c3c78cf593cd5019715d7e", + "aboveOptimalUsageBorrowingFactorShort": "0x8b232a5c289605b25f7d5b4d584e5160c9e0d12b461ffbcacc38975c6c99258e" + }, + "0xeE8827D67C054cAa89C9d6058Fdddccd1C499c74": { + "optimalUsageFactorLong": "0x6977f90d97ca99689570ae951dbdeb20505276f975bbd35a6e2d3579c2c81721", + "optimalUsageFactorShort": "0x935e363f6c78b830ff262bd3540a5ff01d90a6034316b40e68f4f3a0d567ca78", + "baseBorrowingFactorLong": "0xd7f64fdad4875dac82bdb39011e46cbb038d996008d5ee3271dba7645bd9602f", + "baseBorrowingFactorShort": "0x1c286e80a1641d1cca8db92f80dce06a4ffa1786e3c64754596a0cc3f3958f0b", + "aboveOptimalUsageBorrowingFactorLong": "0x34d8aac5bd3b340894d3a16836c765a83229c4cc7bbd2eedda1863ae848125b8", + "aboveOptimalUsageBorrowingFactorShort": "0xb629262b200eaf4ef510e851e3d20765f4b2fda3939d91eaa394d890063d2ef7" + }, + "0xAC2c6C1b0cd1CabF78B4e8ad58aA9d43375318Cb": { + "optimalUsageFactorLong": "0x0ac3e13404fd91d374b1de17a1c495e28076b1e36fe9acf730bb6ab4c94f8a31", + "optimalUsageFactorShort": "0xdd4c408f2d5e683bd2c759973b0b2d47898385fdfb8854a537bc5477c9ff9263", + "baseBorrowingFactorLong": "0x2e56e0e06216078b7ac1e80f3645b647bc4b0d8b3e8ff804ca49c146b19282e5", + "baseBorrowingFactorShort": "0x65f7773a7ccbff5af7e6ed715bacac325ed8af8f2fa95fccc75119f4d32f6390", + "aboveOptimalUsageBorrowingFactorLong": "0x1ecc81592df1130fbdac266a06dde3b2d42a12f88c34e75e90f3ed6f93e165a5", + "aboveOptimalUsageBorrowingFactorShort": "0x1852febbc2bbed0c9bfd25acf0dc53bcd7cdb62ebfc5eb4e31ed5cc34609f132" + }, + "0xeDf53322e288F597436f5d5849771662AEe16A1C": { + "optimalUsageFactorLong": "0x6bdf8d6a1e42f719646924f6d4648235672166918be35664efe7e888a836776d", + "optimalUsageFactorShort": "0xebcd1314a6758a690822f97040c2fd89223691bd9aef5580c849bc8b41766b97", + "baseBorrowingFactorLong": "0x8b7946296aece47a6875d9d44aa6ad88b820a0a3b60709c4f239b680cb1124df", + "baseBorrowingFactorShort": "0x63bc2417501ded27373b5def506c386073ba6834f3a81672ccdb255e2fcea021", + "aboveOptimalUsageBorrowingFactorLong": "0xb13ed14b95d2e0e691bc26dd3593cd690f834b053346abf16cc344729133b3fd", + "aboveOptimalUsageBorrowingFactorShort": "0xab8db14a4eb077a17490c2ded29920655a1d374f06e6457aafc7f952e5939300" + }, + "0x017de90B0fa830C592805C6148c089191716f04c": { + "optimalUsageFactorLong": "0x307c49ad1cf62d42892c3a5d6a02030a13877be277c00bb9d347f41dbc48187e", + "optimalUsageFactorShort": "0x7bbd0cb45e366f8cb4e7214e5fb9a61979b8969c1ab5545489cc6379c3d7976b", + "baseBorrowingFactorLong": "0xbcba0e118471ce3106b570c471a5d0d3c8708f316acea16cb30eee040640d7ad", + "baseBorrowingFactorShort": "0x578bb31bb07de97532ea5d74dc97d4247270b4ee333465a8582de5690de1881b", + "aboveOptimalUsageBorrowingFactorLong": "0x239eef9ce76941129a4004dcb7648be3954cd362c6a0e27a79fedeee4e4f2584", + "aboveOptimalUsageBorrowingFactorShort": "0xf4f1f48365562cb52349d8f3b3e689a63bbfa12451e39255bd3c5165c549239d" + }, + "0x695a07d3DD551b0E77A348cC6A873c1eb183FA98": { + "optimalUsageFactorLong": "0x924d0489613c49c237b6170a6e8991955ff9a11662224f78d83ea9cfc70089fc", + "optimalUsageFactorShort": "0x34632c79a953ed9186d8e937b36f5274edba2e668c93e006f7d480063e49a3e7", + "baseBorrowingFactorLong": "0x9bfab5f0823b48c0adb7771038d86b75a2ae52e5e9e7207c48509bcfca822132", + "baseBorrowingFactorShort": "0xe0ffe88a6f3d1b452800a95512f03f03fd6bfcc37ea7d4d0be96b3cb2296d6d6", + "aboveOptimalUsageBorrowingFactorLong": "0x1571606a0e78ccf0be10a9f3948e44450faf4506f413a8f2bfdb9b6a7b9cf0e5", + "aboveOptimalUsageBorrowingFactorShort": "0xda2550287dc811f1d626074030a19460efc533f8d5072da3a710e0cce2bc34bc" + }, + "0x927f31364b8836021e4F73B27a5d0EbB35C74679": { + "optimalUsageFactorLong": "0xd0aa9c2906017d0b98423433cb76382138e30a2b07679b76db037c921b23b3d7", + "optimalUsageFactorShort": "0xd8724f3134f700f802fc128e74cae9930e149fd20f40005a08ad7655fdfe5d5f", + "baseBorrowingFactorLong": "0xfc86e2ddab0232e34edf07526db2722425ed9d8e485ab239e46586b07cdf836c", + "baseBorrowingFactorShort": "0xbacfae22cfce4ab989489d7ddfe842c1f4c711ee342503798b59cf31a0374a03", + "aboveOptimalUsageBorrowingFactorLong": "0xb2ffba4b1417d28b505c47cef8a846d371aabfbe53b61a0551f8e4f61585d217", + "aboveOptimalUsageBorrowingFactorShort": "0x4ad840e7440d0e5d38ff69b7bef6371bd240335ef01d1230f5aead77b11a2e13" + }, + "0x62408de4cB1a499842EC53296EF8dD99A825CcEb": { + "optimalUsageFactorLong": "0x4b0fc3bd93c6f8f381c72bae8e22814d1f652484abdcecc351b3e6bec2e839f7", + "optimalUsageFactorShort": "0x25d163a69778650d90213cc80273fd6cf988ef413a01c3916562e0ceb40ffb78", + "baseBorrowingFactorLong": "0x2c5de5121e9a767569153d967e50f47e348426c460a24e801b76c874748e86f0", + "baseBorrowingFactorShort": "0x5ccd9d8187e23f3df858b8a4e6144139b3c279065236cb9e47a962cd0627fc7b", + "aboveOptimalUsageBorrowingFactorLong": "0x529dc1e49b22f1bede0df9ae4e9c3bb564848225caf3d3d37cfb8fff5eab3ff9", + "aboveOptimalUsageBorrowingFactorShort": "0x02f411fb3858897f09b03ffad0c5fbfa103bb98cb50746a216b652bbf4d5c4cb" + }, + "0xCc6AC193E1d1Ef102eCBBA864BBfE87E414a7A0D": { + "optimalUsageFactorLong": "0x2f61f16a1bc65d4d5fc198e70eb324b85364bb960c6c6ed3eaa0fd5ec4cdfad7", + "optimalUsageFactorShort": "0xe32c3099e375e1287470632db599b3052651509055d2aa1a7f1fec2534baf615", + "baseBorrowingFactorLong": "0x53e7cad27045da9d08283f898ead64c5d76c95950fa516b545562fac4e608eff", + "baseBorrowingFactorShort": "0xf24263140f39f8810e599aac441a2052e349f5a4569d60ef52101481fb84dd74", + "aboveOptimalUsageBorrowingFactorLong": "0xbc0276aa9b0a10a2c6377ec01733914cd263fe45e8e212438728f028e490f3a6", + "aboveOptimalUsageBorrowingFactorShort": "0x3991853f2b92d6507a1efaa0ceaeef7acc943c60a08fa735c2d15bcca4cd94e3" + }, + "0xE446E8f7074c0A97bb7cd448fA2CC3346045F514": { + "optimalUsageFactorLong": "0x53aacd8102294c68a60d6d0672c6c47e3c99b39fa079f562b9b7702f14a83883", + "optimalUsageFactorShort": "0xd306ba563588d08f0a7f64c64a4ef077a4aba6699a4a70aea3315ec86b589334", + "baseBorrowingFactorLong": "0x7a8da299cd67c1b2db9a9169b5004b4aef7651f5bbdeef87c8d3554454feb2c8", + "baseBorrowingFactorShort": "0x7020a690e96d2003fc68ee40b1301871544789bbaa914ecd6503736e85d5f967", + "aboveOptimalUsageBorrowingFactorLong": "0x06f94ef363efd561a87948a2e18fbd74e947af20fa8d5d8f729002a6c2065718", + "aboveOptimalUsageBorrowingFactorShort": "0x70f7cd03ae7af4d732498b8fac5bd6fc8ad9ca30616fb7d714057b8fc910f1e5" + }, + "0x1d9dC405CCEFA78b203BaD9CCe1b1623D2B25D9e": { + "optimalUsageFactorLong": "0x2a52d0c1af654f1af446c8004f5194c617683ed9dda2be2fb9db6ee5e92f3a2d", + "optimalUsageFactorShort": "0x5e41c84aa0980c4a8a094fa12817aa4bbf554238f7370ca5cee6c8b64a7d532c", + "baseBorrowingFactorLong": "0x2ca7ba0b1364a30f9e38122c4d85f0b476b861fe000930fc70994ad49b5c4563", + "baseBorrowingFactorShort": "0x9a1bd2933f310c7836377d4703b70989f61d5bf53446479bc3b9e4375225eae7", + "aboveOptimalUsageBorrowingFactorLong": "0x1a6c3c024b334dbaf55429960bac8605cf0f314652b2c4dd356fd26cbed12d0a", + "aboveOptimalUsageBorrowingFactorShort": "0xd48299ed354f27b5c12db77571e1770e9b4d8ea546144f47c535ae6d06528f85" + }, + "0xd783EB54407d6d3A4D5c94b634eC9BAE3F574098": { + "optimalUsageFactorLong": "0x72eb14de7b0c9526804b2925057e8fa8e99fa6ce62d53786b557c9793f7cba23", + "optimalUsageFactorShort": "0x92b0f2f803415e50b842fbea1727f13e62073826e3e0e995d6270044069d622c", + "baseBorrowingFactorLong": "0xe6527f8478ad7219d6300603cfd0f0bf4793506ae0abc781f7d523df74399112", + "baseBorrowingFactorShort": "0x653586d2f8a9e4b35494138376ddf1bd8cd7c33d796ad38c84c9d14eef236428", + "aboveOptimalUsageBorrowingFactorLong": "0xe94e2b6175e301f3ebd5b014e3721caead2123a884cab16526f1fdb431dc327b", + "aboveOptimalUsageBorrowingFactorShort": "0xebddc111612f22d22f332f5376f6d7629c71ff88c877e1c1cd064a2e83c7f92e" + }, + "0x6d72D2787107c32a48bbA4687Eb8F9C19FE5e29C": { + "optimalUsageFactorLong": "0xc8f3008b2be4945d00e7d2a69e88bb7f12a878d54ab9f4bb44ee6e0201c2b08e", + "optimalUsageFactorShort": "0xcd3465897096771ad977eb870993fd7e7fe30780d5199861fa59e78c91940db1", + "baseBorrowingFactorLong": "0x88197bfdd2eb8503125782d10cf48f8628c0df3563affd7d32a361dc229d18d3", + "baseBorrowingFactorShort": "0xf741e9e7675552dc1554f1128fafcee957d422daaa4c0f545472d89532eba74f", + "aboveOptimalUsageBorrowingFactorLong": "0xa94552d207a03b4079ac026126fce6424f70ee0e1fa7e74e16b7e2c6685ebec1", + "aboveOptimalUsageBorrowingFactorShort": "0xc3044fe56b5a17ab071f7a0492178f1163b50e5cdefa2707517810ffaca784fe" + }, + "0x3b649015Fe0a4d15617e57aA11c0FbbfA03A9e11": { + "optimalUsageFactorLong": "0xd76007e138671a4f1a51138a6ac0f10e399de8b2d6f2c9864329512df3b7dd35", + "optimalUsageFactorShort": "0x937bcfa159ec9980fabbc625bd25c548394d497cde795c001d358739f72ba426", + "baseBorrowingFactorLong": "0x516c54d31e14f1f4e65655ee7657a10e7c0242884bc849d68363c7b592e125d0", + "baseBorrowingFactorShort": "0xe27b57a811c5ddc9ef2a8754a4839e367629873848ad2dd9311b148a905b3704", + "aboveOptimalUsageBorrowingFactorLong": "0x6f9b6dd5f20c3d4306caa8bd503d824d2cd89fe1b75d8dddf1c71ad3e6eb25c6", + "aboveOptimalUsageBorrowingFactorShort": "0x9677bda27b7df2d90003888fda2e6b57543264124861f5beac15a17c9f25539d" + } + }, + "43114": { + "0xFb02132333A79C8B5Bd0b64E3AbccA5f7fAf2937": { + "optimalUsageFactorLong": "0xdbfa60f518f3bb7adfdc6ef3eb8cf2fec18b92c789b4e77d60678794dd0e6c23", + "optimalUsageFactorShort": "0x7e8a5bf1404bffbeec8a6e565271023538ba5d62f09d73bad258d8aeb0b805a8", + "baseBorrowingFactorLong": "0x94574fb5545bc7f887194e3f90d8d47c6ee3c10cc54f42615bc576a93adee652", + "baseBorrowingFactorShort": "0xed08a68d5ec6c6a027630572f75a92ba7b24d0d732c3c3638efe1c5b20671231", + "aboveOptimalUsageBorrowingFactorLong": "0x4ee98f62e1bfa41cbfc9d567becce616ee6483893dbe7a15653ecd2adba39dc7", + "aboveOptimalUsageBorrowingFactorShort": "0xb299621334fcb6a38b39b61b74ebae95bcbb81bdf5a9f8597e0748d8ac96904b" + }, + "0xB7e69749E3d2EDd90ea59A4932EFEa2D41E245d7": { + "optimalUsageFactorLong": "0x4f032f89e7a19d5aaca5e8f38a405ee9f21b30bf91724fdd51ef809b0c5671ca", + "optimalUsageFactorShort": "0x1cf6d107afc9915b9663af3dea4c7e140e8ddeaf46f7efd686ca0b06de531d98", + "baseBorrowingFactorLong": "0xb1949489d785eac99c9f9c2e5b3929f78faa1e48a2a90e5f5b233e047825016e", + "baseBorrowingFactorShort": "0x9b5a7bb904ce7d1c6d221d599d45478f336e227d3e85b7d2a3061056d7847e39", + "aboveOptimalUsageBorrowingFactorLong": "0xa607ab7d7e0250f8d7feaf6c968e2251cc2494a938b5e642b56fdcadfb88fd62", + "aboveOptimalUsageBorrowingFactorShort": "0x22728d0da0070b39246d95610ec66fc54e39c6b8b496a14176e00185fecbc8d3" + }, + "0x8970B527E84aA17a33d38b65e9a5Ab5817FC0027": { + "optimalUsageFactorLong": "0x5ca4acde785472c77e26a39335f40dee3ed31c1e41fd764fceeb7ee53871fd57", + "optimalUsageFactorShort": "0x7b5af7fd96f6201670211c9d835f430be81296681d1d9d533f1996066f61f513", + "baseBorrowingFactorLong": "0xae74b7216687b5f5ace8741f3ef8d45726ebde61d541257b878b3c0d929b39ba", + "baseBorrowingFactorShort": "0x4b78c487a2e977be6e8acd459226e175cabe23a91eac69c0dbeb1bd2c3a6f8b0", + "aboveOptimalUsageBorrowingFactorLong": "0x57ed378c2615603645f3fc6b7f7c781cfb8ef6b6fd9de7e9a97b6063bb2d3d2a", + "aboveOptimalUsageBorrowingFactorShort": "0x863a5d94e48340281bc7cdc60f82c716b02775a0e96d19df516d47e96a1b0766" + }, + "0xd2eFd1eA687CD78c41ac262B3Bc9B53889ff1F70": { + "optimalUsageFactorLong": "0x370026f960ba7fd2ac3031e6dc6b69a9d0cf8c0a802eac2bedb4bae2a08b13ee", + "optimalUsageFactorShort": "0x3d05090e2c1971b12035008acf738884a53ca818f07a7fd7c24116fef25ac12e", + "baseBorrowingFactorLong": "0x31d11da63ad6a2039da5a8019d5e5c66e6ba8382681b9da44ae3961bb3437b3d", + "baseBorrowingFactorShort": "0xea9d1bf883e6b01269373cbbf91fa9f69be441d29a67a3ffb1b2c5fdff6e2803", + "aboveOptimalUsageBorrowingFactorLong": "0xe1760c69d52b5c7440b8116e1ff243a3f1900b6d2f5fa14eb22bde6dbcd2a245", + "aboveOptimalUsageBorrowingFactorShort": "0xab0018d2a0443326669bc54ece79fa4dfe75f358af9502dfb310f738fae65740" + }, + "0xA74586743249243D3b77335E15FE768bA8E1Ec5A": { + "optimalUsageFactorLong": "0xabb21f10a51e7320a9cad105d297f6e7b46fea3fa3d74bb01733292b527dc669", + "optimalUsageFactorShort": "0x77052289f8da142803e2b8be5c9427648e4b6ab68fb418411a0a1c8e6b20e071", + "baseBorrowingFactorLong": "0x91701d024d9c07584d99864248e6b2e1ca6ea81f744c80f6cb774161d89255a2", + "baseBorrowingFactorShort": "0x6bf8948db728fb98681855ae9df3c7f457299c91a03866038edd3e219c8b97df", + "aboveOptimalUsageBorrowingFactorLong": "0x13e8064703dad2ec9c12a65c8066f1d8a5bea2e6692b5d21a77da6536e2252a6", + "aboveOptimalUsageBorrowingFactorShort": "0x82b866b99d0689bd3dafc42f2367ca4a9c195c9cd0ea42158ab75f3efb7d4774" + }, + "0x913C1F46b48b3eD35E7dc3Cf754d4ae8499F31CF": { + "optimalUsageFactorLong": "0x207ec3445fb5d995b22181953cedfbea87f2a0bc780dd54d1c4f1b212d100f76", + "optimalUsageFactorShort": "0xd45901ab84db1f301000cb6c2a23eff672fe8c867700a5984c2406d797a87f61", + "baseBorrowingFactorLong": "0xf717587d68f535dc09523e066251a8472d5e6bfc3c942105134a11220e4814c0", + "baseBorrowingFactorShort": "0x9ef5bf3123432a32ac14effb879d526ffbb496fef0c423cda4a02d61d6b17de8", + "aboveOptimalUsageBorrowingFactorLong": "0xfd9f0374a7feff48929e88f9dc5527c65a1b929c6dd37e332a9961fa220e8c72", + "aboveOptimalUsageBorrowingFactorShort": "0x77a198b91ab8afb5cea9e4cc494a360aa88fb5f605a2d5c7f715953bfd743022" + }, + "0xf3652Eba45DC761e7ADd4091627d5Cda21F61613": { + "optimalUsageFactorLong": "0xdd2b6559f061ab31ecc84d55ff22edc1b997fefa7f2902c39703c3a21ce90617", + "optimalUsageFactorShort": "0x3aad54bb5579b0ec1027360bdf32a34f6229a4ba44d38c18a236756f877d6072", + "baseBorrowingFactorLong": "0xa2b838fbb7436dddd32ac2320120b43bd7a31d464f0312f212c214244cbe411a", + "baseBorrowingFactorShort": "0x388590d2315db8662d05c5f591b4bee9c552c3f6517a71668b6561caf610d2d3", + "aboveOptimalUsageBorrowingFactorLong": "0xd3a1292e61a11d44f3aac459f701ca6d1b36532e2f171bb60da4a3078ab5bc3c", + "aboveOptimalUsageBorrowingFactorShort": "0x5575b57160488ca66958b7a7438a8ac59c26b3313f1073704fa6f45b15e1c239" + }, + "0x297e71A931C5825867E8Fb937Ae5cda9891C2E99": { + "optimalUsageFactorLong": "0x011626524a5d2a6c820d9780f235ba1e9a3e89de1ef13739089eb17fff35dac2", + "optimalUsageFactorShort": "0xff3218b17f4d7eb4b98aa830e53686c36670f0bfa9566d9600c3411514aab84f", + "baseBorrowingFactorLong": "0xbeb568bd1b85122a568ed6acab6f43daad876986e8c8dab52ad65625ab85593d", + "baseBorrowingFactorShort": "0x170755f314ccbd1920492aac00ba408884e5fe621263de63b793bd7a83bdea8d", + "aboveOptimalUsageBorrowingFactorLong": "0xa7b977ee1ca3872de4a4ca708f5c05a4841cf7c9c922d9b0741e763599646a03", + "aboveOptimalUsageBorrowingFactorShort": "0x74df4d1d9a47238bdcb545a9f611e4aee24e08e117176419a9cd833ea63f8f32" + }, + "0xA7b768d6a1f746fd5a513D440DF2970ff099B0fc": { + "optimalUsageFactorLong": "0x18fd2bbaaaf7b937627291f3f1b7f9b04f2e5a7d715f0bd28c4bb49ae0d6ec87", + "optimalUsageFactorShort": "0xd6784e5943210a9070f5f04e74c4f08f56553d207a28d5da6befd9c360c02e45", + "baseBorrowingFactorLong": "0xfc56189f3cba2cca61473fc9e488eab6334d7c7f8d6a02ddb4e981705b9305f2", + "baseBorrowingFactorShort": "0xed5c424fe512331ae536d64797b4b845d04f1df266a8fe3f96721bb11557b3cf", + "aboveOptimalUsageBorrowingFactorLong": "0x4ebdec6db310d17ace2b7d7ce88a40ee86f63fc8c487a70ca13050b014bd98a6", + "aboveOptimalUsageBorrowingFactorShort": "0xc8b82df28e001a6bf4ab0343958922d1de81118ae4f43cd804bdd28ede511ce8" + }, + "0xDf8c9BD26e7C1A331902758Eb013548B2D22ab3b": { + "optimalUsageFactorLong": "0x1d385d53ebc306a0245c148862e88f0ef3e63be83edd2ae54f82a670ede9e04d", + "optimalUsageFactorShort": "0xdde3f6346fb8d7eab0c21622773f6b296e108796b949530c02badb807ae47dd3", + "baseBorrowingFactorLong": "0x8b13ea3dbdb738ab7d90ba5d71e797db9d51ea8d57043133a4c05283f9f29b08", + "baseBorrowingFactorShort": "0x1d04b9ad215787a6c4ec20adff47e9cfe965dfdfa93a75143ecfc8d9de4345a6", + "aboveOptimalUsageBorrowingFactorLong": "0xff38c48b409a274e546340c87f1ccac2d2ef78a971fa912163cd67af2001f411", + "aboveOptimalUsageBorrowingFactorShort": "0x108d533f534bb86afee2722478ff58e7216b5bb00c2a189d2c895dbe08406834" + }, + "0xD1cf931fa12783c1dd5AbB77a0706c27CF352f25": { + "optimalUsageFactorLong": "0xf72a07b860140df611c4cd16e9dd9b80e7132b9408facb7f004e48ebacae45e6", + "optimalUsageFactorShort": "0x5a2fa4be3cc7dd2e5fbe1bf1c49664cf2a4c2cbd2241921097271de2eace9609", + "baseBorrowingFactorLong": "0xf505c213aeceef00180a81cd49df6e46407c0d8e59d2a15f74ed638c113c5e19", + "baseBorrowingFactorShort": "0x0da1182539fa3d3cd951a7fbf779f932e4fc47c537f90c484490d222b135c26b", + "aboveOptimalUsageBorrowingFactorLong": "0x58e9828c6a1f5a4a522b535cff3140b7b7e119ee979bc7cec3fe06b2315bad71", + "aboveOptimalUsageBorrowingFactorShort": "0x6d2b5296274ad28304f121dbc8b38b0c73d8f94b65228cd8624af591b9b5bfd1" + }, + "0x3ce7BCDB37Bf587d1C17B930Fa0A7000A0648D12": { + "optimalUsageFactorLong": "0xb7c6a2838dd8b2a8ac0c62ffb0f421d00a5575d3c29aa2e416bd2c4a74ee76c1", + "optimalUsageFactorShort": "0xcf88f137d85860e684b02745aef0fdaeb18f522dbf0ba1d8c2da7b013f42eabc", + "baseBorrowingFactorLong": "0x6ac81a0095e8f19c052b62b08d8c20ee60cce6b778a3ab46a086259b8eac4dea", + "baseBorrowingFactorShort": "0x8a69c58b9ae29787fefec736d8ff4a34a73ad21c34c8160e012e205c20cd7dc4", + "aboveOptimalUsageBorrowingFactorLong": "0xe7734ed0349c7b4fcd1b92e55d6f554cd70649cbde19320300275dff2bd34c53", + "aboveOptimalUsageBorrowingFactorShort": "0x51662ecf954647228c4452998edee27a92ee04f578519104ca51d4c814309b12" + }, + "0x2A3Cf4ad7db715DF994393e4482D6f1e58a1b533": { + "optimalUsageFactorLong": "0xa967afd3850daa9a9790ce075ffac5fdf5af629ceb977ef9871dfcdcc137ae0b", + "optimalUsageFactorShort": "0xed40a6cb548b035d9bac9432a65b37d1b7f2af75a1bd0d482d378806c110afe0", + "baseBorrowingFactorLong": "0xf9d33a266036d5d1c5d56efb2c1d6dc65ca4b3637c3d271406ad47df6dc3b7a0", + "baseBorrowingFactorShort": "0x8ee2f027f74b7514c078fa879e6bfb9e667f84b47a50c2592e6bb3a9bf3a69e9", + "aboveOptimalUsageBorrowingFactorLong": "0xbd0c8e302f4b110820a1e1a64085a1f50eb37828c3e679ed88587969fb16ca5c", + "aboveOptimalUsageBorrowingFactorShort": "0x7cb0e79d9476ca65c4f07cb2ffd81d3c3b932fb40c6531233a2048eaa12fcc2f" + }, + "0x08b25A2a89036d298D6dB8A74ace9d1ce6Db15E5": { + "optimalUsageFactorLong": "0x9dc2979d742f663006af1ad4553b270400e791ac43270deab7828ee9dab94aee", + "optimalUsageFactorShort": "0x655679150c333a56f49362d6be6cd33d4bdb53ea47e3022566a7f23350090099", + "baseBorrowingFactorLong": "0x052db93e873888c16fd36bd5885ae6d38faf157022cbeeef8cfd40b1d3a27d6f", + "baseBorrowingFactorShort": "0xbb7ec07c70a28de1cbbe5372353ce2ae56214bd8d4df7cfb88f5292d0fd8e986", + "aboveOptimalUsageBorrowingFactorLong": "0x2d50e2fd7aa7c1a800871f76bf798880937acdefef831df2ab8b70ad119054a9", + "aboveOptimalUsageBorrowingFactorShort": "0x1f38479f355604bf3afbc9b8c1386261eae99dfa180bc7b42c7002f5b9823d08" + }, + "0xfB626c4e3E153947A6A94041814c25E449064dAD": { + "optimalUsageFactorLong": "0xc19685baf2f3c11e34a2ea899bf5e2076744a533454dceabac8a0de4d84d454a", + "optimalUsageFactorShort": "0xc68a6bdbdd4367d1bc718e959d704f212865848fa6649aa24fb80dc9fdedecaf", + "baseBorrowingFactorLong": "0xe9d576a976cd7f8c7f910e89167e8d500f259b82884772d13989c1ab381905b6", + "baseBorrowingFactorShort": "0xfd5fb2feee66aff94676d715ab29959330117afcdf3611a0fb980a4f6a19e093", + "aboveOptimalUsageBorrowingFactorLong": "0x385cfbaddf7c612dc705c771a6e5b624ee4864e7136c2ea934422fa1db893563", + "aboveOptimalUsageBorrowingFactorShort": "0x57605e0c3285622481bd93af6fef15b512c931b5db53b9a072c8d86dd6621c6a" + }, + "0xe19da27Bf9733c429445E289B662bECDCa6ce10b": { + "optimalUsageFactorLong": "0xd1ab5e55b2308a1fc00f0a4dcfa2bec105ae69918cf2032de077717e35624e27", + "optimalUsageFactorShort": "0xdf7b1d9202e4bb2e7abb6a573cc70593772b89fa9a7e9bad4e139938666044a9", + "baseBorrowingFactorLong": "0x3241b54354e87d5ae06a41e4aeaa6a34115dadf063d9621f814b2e11099307c8", + "baseBorrowingFactorShort": "0x3755d19ffde034f5b43c13d0b7904191836ca26a80930493bba489db125153f9", + "aboveOptimalUsageBorrowingFactorLong": "0x80a3a0af00d7c7d55e7bfffde6bc8ea69b652dafd94d7ebe4f20b2a4cdb7537b", + "aboveOptimalUsageBorrowingFactorShort": "0xe08a60ae243116c5d4e8f5c2df48367eb2edac52889485b82e216877ffb4ff34" + } + } +} \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedMarketConfigKeys.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedMarketConfigKeys.json new file mode 100644 index 0000000..2b74561 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedMarketConfigKeys.json @@ -0,0 +1,5858 @@ +{ + "42161": { + "0x47c031236e19d024b42f8AE6780E44A573170703": { + "isDisabled": "0xe8b3327a4f36a032e9c4b5c62bd478f8f7dcb358be17e031c08af181054f89e9", + "maxLongPoolAmount": "0x7122c7aa3613333d4613df9fdd649d0511e9d406f8d4838c575f262602f06f4b", + "maxShortPoolAmount": "0x259df783d9c78073575ba824533a203c2b15679290cfdbd6d06482fc9a437a86", + "maxLongPoolUsdForDeposit": "0xc36890864be1aa564a33fa69c3f92a3929eb4a1f6dc4afe72cc76f259ac0d4e3", + "maxShortPoolUsdForDeposit": "0xf10df680fbf91b3d5a8216c8737c44023628cab2e14b178a13d20e61f5c8ea0d", + "longPoolAmountAdjustment": "0xdd4ac48c161ef4a0be773485c18d339102c339a792eb415c50b34a80ee0453c2", + "shortPoolAmountAdjustment": "0x61078d37b8ee9462bd2ea0e47d88e5b3a604247e6e0df43b21f154627bf3d503", + "reserveFactorLong": "0x212d36de7b523df4b74555395b48e3323e7c6996e14165af6bd1ec54cde3b963", + "reserveFactorShort": "0x59fb037f77cb858eca81fce0ead59189a60f57100848236472cb0bb623908a82", + "openInterestReserveFactorLong": "0x7b6b8e403bb28910630c124ce8abc1c3885f04235fbc4eedc3fdb7375fb43acf", + "openInterestReserveFactorShort": "0x095645de317d0983f941af6c7aa6f99baa01c7c649ab23a4c262d6c3714fc9b5", + "maxOpenInterestLong": "0x2d0f2aa0e0538d35e4e2e963e33bec9e130cbefe2075d1c6d28df793dc7ad81b", + "maxOpenInterestShort": "0x1591052ee37191368f8285bffabb9d1f6bdb81b52ea6f081f64210796081201a", + "minPositionImpactPoolAmount": "0x8d94be2ecf1838e2c51cb28ddd6c5e5220086a571e002797988215fbcc5bdcd0", + "positionImpactPoolDistributionRate": "0x8291b8d9e134ceb815a21fc07c99eb3a4342a5d423aaf5eed47427adbe61dba4", + "borrowingFactorLong": "0x0c2b889c478bf94e61f69bfaf7b92695f8093c7f39c4416a8edaae0eba0757d2", + "borrowingFactorShort": "0x3c138f46bb8ca079ae96fe39d12b231097e06d4274aac5c7148aaa31e4767f46", + "borrowingExponentFactorLong": "0xdd05f2297757028494ed3bf7bba51d78bedeeb3ca5ece71e061e181f0c3bee8a", + "borrowingExponentFactorShort": "0xefd22f59cbb8e2a49318d3de733a1dd1b8b41d034863c3470235b1f48bb23777", + "fundingFactor": "0x00d05e5bdb2359dbb44dadeabf027e9d230b2dbbac2c82106932adcf8eec14ec", + "fundingExponentFactor": "0xd346bdafa3b7d9c6959acf803206ede73356773e4a1dfac050614c57217f0fc5", + "fundingIncreaseFactorPerSecond": "0xa71b7d4e7d5f3a3c7b280543d8e6b1c0b7ac23ded88ef0943bf0a74b046af521", + "fundingDecreaseFactorPerSecond": "0x07ec2b7b55cb85a3be6e482457e544ce3a7d66dbda0d0c73902225eae4afb159", + "thresholdForStableFunding": "0x400e11e7adba13d2a50d03cb7f4b261c2d7e3bcd61588252f9a719f32db1c4ab", + "thresholdForDecreaseFunding": "0x31e03353c4a7e54a8430dbd1f501eab6969cabe5d690d6fbd2fe388e2882bf37", + "minFundingFactorPerSecond": "0xe46384ec4d6fedd685e99a5c4b1ac3fe5cd7e422e83337f9b29b6332fa65ae89", + "maxFundingFactorPerSecond": "0x4f7dc082dba2aa22249007c05bb4928623521833aa4d2993e150a90fbfa114e3", + "maxPnlFactorForTradersLong": "0xaa8e9afe1a8ae000f057254aec33b0b038be8079bfcb184ea356dc917326331a", + "maxPnlFactorForTradersShort": "0xfa31ea001f0ed9b3fa3d2f1deea9bf79493c211600b8f203f50dd95591e516da", + "positionFeeFactorForPositiveImpact": "0x4b9bdba3ff745320751079b586d3c4f84cf87f7c3e79e39f1158b174c405cf67", + "positionFeeFactorForNegativeImpact": "0xdd207fe702bdff93bb945786cd5d98c3259d3dbd7cf37c63c161714e938ba434", + "positionImpactFactorPositive": "0x57f9be924ba0f2c763e255396dd8fdd27b3ff06fcde5fee6018b4ed0292eae0a", + "positionImpactFactorNegative": "0x3b778e8ac16a3dc330bcceed5db97c4b853b0a696209858f5dd19591a1b3566e", + "maxPositionImpactFactorPositive": "0x825201d62a913028fa553544c19e6e9e45885502ad94b3e9ccb79e2911daf669", + "maxPositionImpactFactorNegative": "0xa0145413fea58392aad72c6aaba18435a1b6e00ff9346d8418c207d8b3f0ad1d", + "maxPositionImpactFactorForLiquidations": "0xb7ab4d8339ba5934253d04b55d4141017d73b9801df9a8810ea10d1c3ea3fc6f", + "minCollateralFactor": "0x0edf8a0fa860b71e689cfeb511c6b83c96d23eaf71c6f757184d23954fcb3169", + "minCollateralFactorForOpenInterestLong": "0x18ab1bf4fdef11804a1212c94ba4ed35498ef5942b3d385fc9c33f933f17f60d", + "minCollateralFactorForOpenInterestShort": "0xf5cca0ad2e4b2341858ed82455e0d4e3e2dc289d93124403d67c010ca53b62de", + "positionImpactExponentFactor": "0xbe60fcfd99ab63b9f7c2a82da310aa88958ee0146cbc9ea008d8cc16a97ac70f", + "swapFeeFactorForPositiveImpact": "0x695ec0e29327f505d4955e89ec25f98741aedf22d209dbc35e1d2d61e683877c", + "swapFeeFactorForNegativeImpact": "0x6805e3bd65fab2c6cda687df591a5e9011a99df2ff0aa98287114c693ef8583e", + "swapImpactFactorPositive": "0x79d8fe854154b43d003a20314c803b78ec01391248008659c0c8e998e866d7d7", + "swapImpactFactorNegative": "0xe8438cfb97aef79fdebd4e948dd086e7c042ae7b47a2414454f6b691ebcc2419", + "swapImpactExponentFactor": "0xf64c72f0c430da1f9096daec486ac3ba00752a0b600ce602ae5bd0a62c004145", + "virtualMarketId": "0x30728fe6602aed966d65c62d392bcc1a4f02e155ce82cbdcae778669fc35a83d", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336": { + "isDisabled": "0xc45b95e59c3189b1ce34bf8e690a9dda3eee932f3855117d789dd298ad364e5d", + "maxLongPoolAmount": "0xb3ea1fd4fd2a5705a0befaaf3aeaf8e3b13274e9a7b42ac29adbcff4e8ea0d36", + "maxShortPoolAmount": "0x09a0354b47ce26b937a9377bcf171768a4144b3da3e3678fd267ce0c1409fa57", + "maxLongPoolUsdForDeposit": "0xe1ccaff6899c584cd1afd51bad8c0dee84482a909301836a25c66f0d2628c210", + "maxShortPoolUsdForDeposit": "0xadd2da2afb65847d22312497be62a85c93bb6c09299cb3fbfd70349a2a075005", + "longPoolAmountAdjustment": "0xe06fc4c2a975bfa986d0af41a3dd02fe81dd7c7501be7f2fbb51ddfa88a5077b", + "shortPoolAmountAdjustment": "0x645797122396cbc1adae18dd7be3de0c27d1b57c5717d446aaa59fd9233b05f7", + "reserveFactorLong": "0x337e24e6d04ed216d312a36582f1e09658323e4e976607339857bf38abb48a35", + "reserveFactorShort": "0xa40138b1217ca2863887e5feb34c72bb7c57ad5ae301eb52c22eb5a964438bac", + "openInterestReserveFactorLong": "0x75f7ae4e1510eb1220300b6e25ffb4c58ba622674d0930d0fd71432e28e585f5", + "openInterestReserveFactorShort": "0xae28e9d759b5f7abecf4f28d6916332cec352a27b3e7cfd170c017e74846932f", + "maxOpenInterestLong": "0x4c8ff2fed94b668a66292ecb4056bb24b1de2ac1eaea0f8b38e6d815a3fe21de", + "maxOpenInterestShort": "0x36689f489df04572f96026620d7f83ce953290e1b8476b7139928fc5f0a18cc7", + "minPositionImpactPoolAmount": "0xc6bbcad1d7e03c0876394dd4048039ab015cf5ac24edea497df190f31c95e6f3", + "positionImpactPoolDistributionRate": "0xa578a514c09c7ff49cc21a599d66f253e7d007eff4381636a4297c76509a8758", + "borrowingFactorLong": "0x98ed0ffd40ee93feef46cbae636a721ecd2255bd3f6a5180f9f774eb8c5713b7", + "borrowingFactorShort": "0xc1d373679a8e8c04f741edcc53d137842adb375a026023b915e7c5aad7c7ea40", + "borrowingExponentFactorLong": "0x84b7c55ec02bc8ec25412c045042c5d71c7216294b171dee34a8eb78b75ee7ca", + "borrowingExponentFactorShort": "0x11e3c879f6e1addc7edec898778a860ca4dc0700fed538b462070f8a82d5b10c", + "fundingFactor": "0x3b954bc1862c9eb11b5cc0e7343a561c595b795841642199567f3884e214d3ad", + "fundingExponentFactor": "0x3fb09c259a63785c1a8a0a262a9cbf13253c88a6ea9ec88ddcd1118fae5c8d02", + "fundingIncreaseFactorPerSecond": "0x9c70d42f70b74c1c8d3f33ff727d8248faaec0d6ee9fe03173dbb4160ed8180a", + "fundingDecreaseFactorPerSecond": "0x199e505f4cda86d9e3ae7c8989632d7d182c9ab6ecfb408e274b933bcf7ac358", + "thresholdForStableFunding": "0x855e20de9e6caa9a092bde888c28ed70f72e693eadb629d28a685b71f28181ac", + "thresholdForDecreaseFunding": "0x54d309c97738e3ccdf4c95e79d0415d9e6d90ce7a4a81596832458a0eac48f78", + "minFundingFactorPerSecond": "0xe2aeddbe8208ff69a91e8dda02ed2f0f7c0d6deed966af3400388ee238a9e49d", + "maxFundingFactorPerSecond": "0x424c5a83737ee1e6ae9a863e64a6772ad7d591da777c4774b2484370d927b97a", + "maxPnlFactorForTradersLong": "0x04e55b2a6b73d4cb774accdc2d7f0de0f4aa8a8ae6a084be73a43ca8f17f3586", + "maxPnlFactorForTradersShort": "0x02badce9cdb1639287015c8989426be5963e2b0c8a41abd9723284ebff7f2e9e", + "positionFeeFactorForPositiveImpact": "0x914f66951bf2600e37ce4f2e2fd45983c6d842e40cda838267764e38fbad3594", + "positionFeeFactorForNegativeImpact": "0xe1a9164e4ffd3e27713953d91592d29e5e51e16c1df48725a919fa8785b184af", + "positionImpactFactorPositive": "0xb2d34408902891f7a1ffb5a66609a793e142ed6dffc6d7c0c8b9b9bc6d6dd380", + "positionImpactFactorNegative": "0x68cc8c831904230bbfe2ba8d3ee911509896dac5b48cc45c1323718a54fb4016", + "maxPositionImpactFactorPositive": "0xc230e1e4d328166be2c9c1e775203c706519bd3f17777d460f0bd159e2680920", + "maxPositionImpactFactorNegative": "0xf0304143d99ab54dd4a90b22df08fec271f1c69fc31cdcbdbcaaf2f3f9abbe90", + "maxPositionImpactFactorForLiquidations": "0x2d8a11f53ea0e4da886046922afbdaf2f98111c2c3617ce8d53320e5368ece53", + "minCollateralFactor": "0xcf1cefe1a11576531900922002113a6cf623823d2c813a4534c5d181976450ae", + "minCollateralFactorForOpenInterestLong": "0xbcf38cdb77fa9cb02787c89b5b616dc4d91337a400795d617a2580ae49a6e209", + "minCollateralFactorForOpenInterestShort": "0x635ce4b3864fcc94a0eb30789ab0eedb1724ed4bb51ebad2fa2e9a2bc051f60a", + "positionImpactExponentFactor": "0xd3fb6cf1d6db9b533ada6f4f3e7f52adf7fa871788e67b80e7ae6e63811017e5", + "swapFeeFactorForPositiveImpact": "0xd795542d99d4dc3faa6f4e4a11da9347d4f58fcfce910ccd9878f8fd79234324", + "swapFeeFactorForNegativeImpact": "0x4a0e3a43fc8a8e48629f6d4e1c0c1ae7098a35d9834cd0c13446fc2b802a24a7", + "swapImpactFactorPositive": "0x801066104b68a8504d32a319a865f5010a763e0b3f4372e0b03f3fe87ab77eb7", + "swapImpactFactorNegative": "0x1a282191426197cc0dacd8fdca48acc252d354470638b44ca410893f9bc8d576", + "swapImpactExponentFactor": "0x62f7b6ed5b17f35d4d42eb6abcaa00b07af41f4694af6f491f9bb5b31911af3e", + "virtualMarketId": "0xa8cd287a5068df6cf03223613f14a133ec7b31a50b305ee6091c89c1dcff904f", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x6853EA96FF216fAb11D2d930CE3C508556A4bdc4": { + "isDisabled": "0xbd2e133e3672c29fadb887a377cb41ca4421b484d6311d6c235deeda77cb1122", + "maxLongPoolAmount": "0xf2a19f0fc95d8e9aa18733b84e19f222c40fb2436447749226fdf3876b702299", + "maxShortPoolAmount": "0x014b579a6a16241a955aaf663427b7815aead5ac8dca1d10409e00cad7c1335e", + "maxLongPoolUsdForDeposit": "0x6f0162d6712686b9d3f54e9d64ea88b4b96d647fd6f1f97c8ea557c8d39c2530", + "maxShortPoolUsdForDeposit": "0x081e26b0996713b0206c3020dcfaf76f5226deb0c48b0cbb81397174cd7ff5c6", + "longPoolAmountAdjustment": "0x7369c7708e79b0ee8d070e6a46897271b7725ed5239ab4479ff67b7b2281fceb", + "shortPoolAmountAdjustment": "0x49e0703ccacdfee9505137868f65437507b52a083997532dcdb7924f48453e80", + "reserveFactorLong": "0x5c150417d919fc4cee0a0b25c630ca857961aed6f81a382affa9502954e66e24", + "reserveFactorShort": "0xcbe6caba57585e15b5512813e264e8d2b7a78744958cac0a5d6654daaa6d3571", + "openInterestReserveFactorLong": "0x5ad9b812f3f6fedbcea95e0d21f63e925cad5721d972ed501aa01ec32df12816", + "openInterestReserveFactorShort": "0x1c658f6568aabc862c99c76f349f92e75ec87ca01da9ffc24bbd985289f40682", + "maxOpenInterestLong": "0x3041ed43d6857b170418d422690141101116cec7a2824836c575e842233d1a23", + "maxOpenInterestShort": "0x08f728f1196210ae39b3d165095b3fd4d58c14f7d60da07680c78708fa913cae", + "minPositionImpactPoolAmount": "0xe8363959399e7ed2ec6b63691fe5511f9cb8156397631351b385a82a6efe8a1b", + "positionImpactPoolDistributionRate": "0xcbb955da719fe4d90dce949d1e66be6d665e26b0b30f115ec787c797a6c697e9", + "borrowingFactorLong": "0x03a19849efba94a7805df96b8cf060e61bd676323ede4b0bab543eca7c3ca4bf", + "borrowingFactorShort": "0xa488800ae9c99107499bcc73e3ec0bd81fc5e9b0c32ff2a31887a2b642af9aa5", + "borrowingExponentFactorLong": "0x7ec7b39d7580212a9992daa1ca94ada070074c4f11e8b03e181b48bb3c9d9244", + "borrowingExponentFactorShort": "0xf57fa02528a5676fb0e8d757a6964fb8e43c82faddba567dfcbd298912775aa6", + "fundingFactor": "0xabd27d424744cfdff88f1484d7ab1e3116505624d5741a914ccf4284092cf472", + "fundingExponentFactor": "0xd54767b8e1cacdc1d04a3de4709e128cd06ff38f7eb3a447326741749ab5e364", + "fundingIncreaseFactorPerSecond": "0xa7692ef7d74fc7f78d502ea742a8d04b34cbc74f2fad14c6babf252767783f9e", + "fundingDecreaseFactorPerSecond": "0xfc06e588a4c1dc1e624541966bdf0cc6b5bc2ff00e7e201afaca1ceff150411a", + "thresholdForStableFunding": "0x4b051585056ffc8bc44829078f55d97370725a19091673cc367b079f54b88770", + "thresholdForDecreaseFunding": "0xa280e7d186cbdd93b65ae3b91dc87a69ce96ef130acd6dc13e88bf743f279a84", + "minFundingFactorPerSecond": "0x99b77bb6445d22f4ec498c19823bb28c3e2369d39cce3e65d10c786bb6ac8c3c", + "maxFundingFactorPerSecond": "0xf9eebd782b6379771362c4bac105681bfa6f503b704718bcad8352c0de19f688", + "maxPnlFactorForTradersLong": "0x4ad6b8b2ba952450663a8d5bf31ee14ed32607a478d6cd7294fe55a4a4ef90d2", + "maxPnlFactorForTradersShort": "0x6c1fad48bb23f5fbd6f258f605f43fb3ced23cc7af730b7a7b4e8f05687c6939", + "positionFeeFactorForPositiveImpact": "0x0a91a7ca843ae3371debc48312c71f1ed0ae40a087d2626c6c43fd86002de08c", + "positionFeeFactorForNegativeImpact": "0x8e901273173d5fd00df54a257dc627db643127f496f5e187609a3210ba484b27", + "positionImpactFactorPositive": "0x0c641238e5258665a42ece9c3874c8c5e0d627522aaf8c60cf0bbc5e64c5c5d8", + "positionImpactFactorNegative": "0xc4bfa605ffb9f50e0f18e0399ccdac8f6fe971a739a91a6a726517653177e0e7", + "maxPositionImpactFactorPositive": "0xef102c726b741df58e10ba28b7f783ebaa6c2076f27b615f9d21a4edfba791c1", + "maxPositionImpactFactorNegative": "0x98bec1ab62f465a2a83119494f5f21c753b0527908dc422f67220e613c532771", + "maxPositionImpactFactorForLiquidations": "0x5fbccb68c5d1de0fd2d39c7a60110688e10a969992910911b5a7ff5461a7fddd", + "minCollateralFactor": "0x832e125ad1a59ec76a096a906db0abca415fae50215a04713ba7d26b806170d7", + "minCollateralFactorForOpenInterestLong": "0x47ece80b5a8441270dc51b704ac241ee205157d6e79a17ec9a7a78d5a1c405cc", + "minCollateralFactorForOpenInterestShort": "0x3ac33ae245dfa87c5023e2ada76a30d63b5d4a462868f2df4cf285c450c055bb", + "positionImpactExponentFactor": "0x8185adf991484ed9941b9d357c45b4aaa04298bf56481c3ac20410b14c6e0426", + "swapFeeFactorForPositiveImpact": "0x67a550e4fa661b4a6f6f7a4f2f276a0dac54970e784fe703031ee403f04b4665", + "swapFeeFactorForNegativeImpact": "0x5f0f923b62e09d2ebb7df2b4b505d5eb8843b57816cb1fc36090965cfa939bfd", + "swapImpactFactorPositive": "0x0538cdd47f4c430b1fcb396d2d4b81d55cc0fb604620d2cc1d1092d9a3d13b4a", + "swapImpactFactorNegative": "0x7eb5c1dc27cc686df401fe1cc4a36537b363bfaa4d94f77d6fe72fd5ede61d08", + "swapImpactExponentFactor": "0x7e561221c0f8fa07e9ca813aca94becde6d2fc0feacd84f50cadde2b177a4310", + "virtualMarketId": "0x6fb554632adada3dfa9cce73bc454e855fb9969ebce7a35ba3f266de425e731e", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x09400D9DB990D5ed3f35D7be61DfAEB900Af03C9": { + "isDisabled": "0x382490eeea8df42b09a4e6c2c7f5720784be8b95b8de3ba960c8eb2bdc8123a5", + "maxLongPoolAmount": "0x8d5ca4d7a73c2fbe70cb54d71b5cab887ddee76eddbaa922a1e870435fb509d2", + "maxShortPoolAmount": "0xf875d8d0b071114de2992c8ee8e5aa229989807fea4381c61f24e283e17a5ac3", + "maxLongPoolUsdForDeposit": "0x2dd782cf4b4a21869043889e20716913fa67865d30972b728f3fc8d9472fc2ea", + "maxShortPoolUsdForDeposit": "0xc3dbd43e14db059345a7549ae8eb1c1cbb2573ef281bd2dfe0b8db4331047dea", + "longPoolAmountAdjustment": "0x3cb8477be65494bb8d679f5a18d3c07678f319c3be7e7ebfaa5c0369ec1dbe2b", + "shortPoolAmountAdjustment": "0x071eb9e378cb51e4acb31fbd6f6c44f5776b5682a5f2d6f4267c3b43109d9b66", + "reserveFactorLong": "0x7c6124ff9bc18002a0adcf45dffaa7f5a3d1509d909a2d3ca3ad57be9d1714c9", + "reserveFactorShort": "0xfe05d80ac48b6d31d2d13310166dffcca3ca0f335509331d70f1bad1283456c9", + "openInterestReserveFactorLong": "0xdca9e9bc9359f1fe12916304aa46260a002d669075c9b3158bc6c14e02665ef3", + "openInterestReserveFactorShort": "0xa8dde5202490af598fef361405f97b635c435c5ed0b4fa078c7c2ee72f99cd35", + "maxOpenInterestLong": "0x75856eea766ea24217827b4360c234266b13c6174c91d8261f80ee2e123941ee", + "maxOpenInterestShort": "0x78dc8d9e0e43a773d292b0742af47bd875a66f0da504f7e81a06fb8ebc72589c", + "minPositionImpactPoolAmount": "0x958ec97500cc8495432f910ddd6a9d1128b0b6dfeb9212717d6cc31b1a1b23f8", + "positionImpactPoolDistributionRate": "0xf6f8b595477ebdb70bd3806080e272cb4adedf66d18fefc9269cfda5ee65f5b8", + "borrowingFactorLong": "0x9704bf350ed9b2d84a024441a20053a75e4334e3462097aa2863174f4257f539", + "borrowingFactorShort": "0xbdc2b9c3469227f42444b4ad9a916c416f206a7ae82b1d6bd0c5c822501b7039", + "borrowingExponentFactorLong": "0x4f0779bd87e51ccce25bcc83555e731acc63b72df0f54d6b6caa4286bfe69618", + "borrowingExponentFactorShort": "0xab1e5f2a0116f18486b78d23610a0ea0130246c6fa8f28ef3606f14a98244f56", + "fundingFactor": "0x4f16cbd424ae61016b93b803007afea10f4c5c609f608d1f3a08ceaef121ffbc", + "fundingExponentFactor": "0x129cd42ccb4c4bf9a8af07f304e4f0ff072ac89aa3a0c8e93ed505b28ea56c23", + "fundingIncreaseFactorPerSecond": "0xafd77132773fc6a8732648296a0e45529217b075842464a56a88bbdc424934ac", + "fundingDecreaseFactorPerSecond": "0x9e34e55a97b4085084afbebaeed51d8024980e378d3425207b8b14a87f0fbe84", + "thresholdForStableFunding": "0xf936ab18a3e17efa978c9fdf5365c6c62f40b583da963f75c773683982553fa0", + "thresholdForDecreaseFunding": "0x69f642f50ebecae1309230d26e63ebc2abae7468fbfabfbf104edd88a31b0f70", + "minFundingFactorPerSecond": "0xed5144250ca46cf74da875772cd00965af40372ac5605dac489080557570afc4", + "maxFundingFactorPerSecond": "0xd84ef4cc15df47ff3afd13c9d28e9a859dbabf200c94bcd0206c29b95f24e436", + "maxPnlFactorForTradersLong": "0x72419a34e63cbfb23ab394e4439234ac97ea134e828df7be5bfb5df3ec881fb4", + "maxPnlFactorForTradersShort": "0xa6300cb5902ed56008bca5c8649dc25ae7b7f119a00b42fa383e2d76f5ae5cb1", + "positionFeeFactorForPositiveImpact": "0xc2e64a5a0c61ef9bb36e3f5d49f7ae23191b915b9b453689a7abd06820fb9b6a", + "positionFeeFactorForNegativeImpact": "0xa6be8c7c302085742a3296b00ad87b973361d8a174bb7d30ffbf88e4c6f4d8cf", + "positionImpactFactorPositive": "0x04bcbebc64b09778830c1b12d8c1b2d32504c94d71d5f64f2d547d6fe1ed4ff0", + "positionImpactFactorNegative": "0x0c00767fffed8b00ff6d17106121d436ec02b7ff6c01968d8aecb9d29972e75a", + "maxPositionImpactFactorPositive": "0x10951da02818a2ad689fc04ff3ca1935a2bd85a7023d53189f9f2526c1ad19df", + "maxPositionImpactFactorNegative": "0x789029ddd96ed090034a9b9f30b7b5b6c658b3b2c03c3d8e8b99087572e6c29f", + "maxPositionImpactFactorForLiquidations": "0xe67bb29085a2c9505c14cb22b778ffd89bab7484bcf0142d4b8f0d94823fe8b8", + "minCollateralFactor": "0x25ca6ce85c0568d84138f6b3264fedf1668f1ddfc320f7ba409d3d6019411833", + "minCollateralFactorForOpenInterestLong": "0x3c2241385fd888324a03ea03eb3606df19e300ae2c3cf2dcafbe2d235a04b676", + "minCollateralFactorForOpenInterestShort": "0xeca78003c8f185c46542ba76034dd77edf8c1cee1a710cc59fde908d5b92f309", + "positionImpactExponentFactor": "0xf1f5a97e4945291c333c8857cc08ec673be5b6c9cde98be1ad86931599685acc", + "swapFeeFactorForPositiveImpact": "0x6a1d8e63575704359c436b79657db011d72a92f67f1bd5e14afb57e9a2912498", + "swapFeeFactorForNegativeImpact": "0xaf4fad6d380803699ec362dd04941db2d6c038f504ad922664c8f9d1a4ef7160", + "swapImpactFactorPositive": "0x5d50cff84fe2d5abc20ecbe3156a438d1b3479175f4748dae1d121887ed30eec", + "swapImpactFactorNegative": "0xb9cc0f62898c08c383e014640b673a6cecc479fa1080544ea3250f029f3c304c", + "swapImpactExponentFactor": "0xc7bcb77b7806e06a50ec6ba4bf17541c63b0577ef3d18018f96e5e74d2bd7619", + "virtualMarketId": "0x5eadb7b43a05016c33bc1d1a89e4938b37406a70977a8fd7bea66d62ba4df824", + "virtualLongTokenId": "0x8f92ebbddf51de9f1607c3d6748a858fab29822d139ddcd3b8f877241ce75e70", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xD9535bB5f58A1a75032416F2dFe7880C30575a41": { + "isDisabled": "0xac22710e48fc7a9710dd08859634ebaef6b475897f190e543b0d071b1222bc80", + "maxLongPoolAmount": "0x7b6afc38ee99bd6a2fad93a6d739eb81bc766a44cf7dba77cb95611ed57282b9", + "maxShortPoolAmount": "0xde25a103d468d8197403a27de53f627c7229d5c0354e8f55c57cd1d4484a8b13", + "maxLongPoolUsdForDeposit": "0xdff94e258d022aa19698596b1504aadddf88cfeb4566559ee817b0cb4305d882", + "maxShortPoolUsdForDeposit": "0x5e032f67eed642ade37ed3d94cef0eba66ab6f4d12acf3f66b91178515082097", + "longPoolAmountAdjustment": "0xd3f4970c2ca9815e0d0906dad117f88ea83afe8e55760371cca991fb9deb0554", + "shortPoolAmountAdjustment": "0x4447fbca62e144f4a420ad4f5086670239c59e1b0f5b963ca024940481db28d4", + "reserveFactorLong": "0xbef1f359aebab6d38dbe716f46988191a08fa6aa72eddbae2c3ad720fc56ada6", + "reserveFactorShort": "0x1d1710e3b42085266909ddb56a8cd6ee4a2fd296c1095d287915c42d18264eb1", + "openInterestReserveFactorLong": "0x38b11830c1c117bb21a916d4755adcf48e0a0ffc143dbf4630931644331ccd92", + "openInterestReserveFactorShort": "0xcfb57419c31ac39c54f1352144d376ff2708798d1e643870623a59ba90a49eaa", + "maxOpenInterestLong": "0x43a34556631b0d04ffe8042b5e20f4cfaa29a410775a31005301cae346d1d5a3", + "maxOpenInterestShort": "0x266d81546faa89a220299698e34e47b83fcdbb025cd8867345ebbc1b273344c0", + "minPositionImpactPoolAmount": "0xdc8cc168bbf034e77d7ed2eed3c0d8cc027bb96943b3baca5748e2331ce40853", + "positionImpactPoolDistributionRate": "0xa8107caf4c443947cc3bf81aa2f8a353b8e1d2be98da7305057d9c996ef7143a", + "borrowingFactorLong": "0xcbef5377c01763fe8a02b16e3253c75a6b3b99e2bf515200931b47b099322a09", + "borrowingFactorShort": "0xd67ead02e820ce8fe1ddf43bcd1eca1f3175fd00d1143b8d7d35f33f85d04a5a", + "borrowingExponentFactorLong": "0xd4c7a13803d7c1a650ea91d031289fea22d31f4145afe92fe8704ee4b5f4c78e", + "borrowingExponentFactorShort": "0x883430518537cb05e260cb7aecd55db9fd0245f8e8add75914a8c993a2bf01cb", + "fundingFactor": "0xc4b6c75535c1792a62ea66b5f71cb35302ce55233753a3f5082c85562df51e8c", + "fundingExponentFactor": "0xa524200894e068682fca71287f96b4c1c11375bf34b9f60ecaad7e4d4aaf9a4e", + "fundingIncreaseFactorPerSecond": "0xe8e4bc72fcbc4720a33d6de05be85baf3eec3f61d254c14e572cd1034a824d76", + "fundingDecreaseFactorPerSecond": "0xee9499448181735963b3e839fd16a91ebcd371d92aefd7399d83f459dccc6e8f", + "thresholdForStableFunding": "0xb85dec3a08107e1bb12b18a45c43eedb81565c11c5f6c7f06ebf13eb9450c38e", + "thresholdForDecreaseFunding": "0xcdea9807c2d3347d07c5f37e5d4727c1bbd31db42b56c7bed300b3aa4b831031", + "minFundingFactorPerSecond": "0x6fed3347f971d3d2c366381cf47b9387f5a871019bd683e6aa884e936e9b14ca", + "maxFundingFactorPerSecond": "0xb67c5c79dea1409495a4296882f29f55711c3613b3962c49406e76fb41cb3bd2", + "maxPnlFactorForTradersLong": "0xa5a61d7f4a7f07641ab50335ad1305741802139fe956021e15cc7d9bc7be8d7f", + "maxPnlFactorForTradersShort": "0xd493bce0cc5d3d5c297296e7eabc2585c31272109c39bbb39cabbfbe0030600d", + "positionFeeFactorForPositiveImpact": "0xff452922f847142c79ed67c6b9f0f1f57d703384dacf714a43ea097072f341c1", + "positionFeeFactorForNegativeImpact": "0x7e7eac91fdbffd192d12b66d7d34f83b12ca2709d7f6cea208e64c3b7905560a", + "positionImpactFactorPositive": "0x04a7dc43056b287535c2fddccef2e0b361e2fc841de23ce8e630db13d4e3cabe", + "positionImpactFactorNegative": "0xd1fa1ed0858635234f05b957d0f102dcdcff2d59307f5b378d07c404c515be22", + "maxPositionImpactFactorPositive": "0x35e161be38af516eabcc7215e158450e46aa9123dfd22a127a3a22717f68e412", + "maxPositionImpactFactorNegative": "0xad122e0fa63007cec09c08f304aa598044be6f5191018370739bc16a9c439816", + "maxPositionImpactFactorForLiquidations": "0x1a5334adfb5b61b4aa80163c205dda0a875dea3d2db2fe0850b7b0614f31cdbd", + "minCollateralFactor": "0x2bcb8363ff421d07360a2a95773d3f7b64319b6bc58f328c6c734e090562cdc1", + "minCollateralFactorForOpenInterestLong": "0x7f97bdae1ee1c0424ccd6dc21526e5ef1e0cb581856d3c0b3279c518b2b140f6", + "minCollateralFactorForOpenInterestShort": "0xa370583d9939495b60095d94f3906c9b15ba4e7a3d7422210d6f541c426d4010", + "positionImpactExponentFactor": "0xe33c49e3c7a970aa64a71f22c589f0436ff537390a61d71088600b2f1fe24fb6", + "swapFeeFactorForPositiveImpact": "0x1dbf6ea5c40ddb4981c0c991291ebcfe9ca18da36b55476f46c07db6f9d4d796", + "swapFeeFactorForNegativeImpact": "0xbdfacc5a3aafccef508a92c25358d876d54cab9266f562bfeb0f075011400b5f", + "swapImpactFactorPositive": "0xa24690e158bd6148dd1ee7619d26d4db4c22e063bf7fbc4849b248713ecc4be6", + "swapImpactFactorNegative": "0xea3e78f194aabd8ee877feb4dd76f0f10e28e5375fe88a39575480d27d265afd", + "swapImpactExponentFactor": "0x708c76a038fd213a993b7643df04ab046fa1987cbe5d0d428475cffb4c1147dd", + "virtualMarketId": "0x67e3328811cfb35653f2f4c14979f600f39845fc18fc343c14304f0734072a9b", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xc7Abb2C5f3BF3CEB389dF0Eecd6120D451170B50": { + "isDisabled": "0xe31c0474f0ae67a291668449dc770532d0692dd0e0b0973ace320f4351230d23", + "maxLongPoolAmount": "0x8fd9b1072830782492a86f89541be9981cd45179ee14c83aa0ef979f86d1fdf2", + "maxShortPoolAmount": "0x5c29e5ae83edbd0ea9f796ece7753428ac0abfcb1f9eed6a0d52be50a3971d9e", + "maxLongPoolUsdForDeposit": "0xd52409557286998f6253428f8a16fe801080e34363260c83c3541b2dd0131da9", + "maxShortPoolUsdForDeposit": "0x2cbf927caefede44905c878cf4be72d712e82e9ece4ae725e848c95f9c09f986", + "longPoolAmountAdjustment": "0x895e9269530dafb937ce1aa620aae6cfe56f00074857470ffb1c3f1e61bd9ce7", + "shortPoolAmountAdjustment": "0x900de2fc53b3e2a42080cc8f925888c349bf0a1a5a7036be641aa548a037e3ee", + "reserveFactorLong": "0x0285cb239e99e4627bf295cca3025820baa60c5833e1e6216b52fc09f687bcd1", + "reserveFactorShort": "0xf7c96c68c833a4c9100088cb8c64a803b4bef37dfc21f8a6dd4b2f2098d1cd01", + "openInterestReserveFactorLong": "0x732bac9969a3288cc473892f43e80792e58e7530338c8a37f1c63ba4dd855f15", + "openInterestReserveFactorShort": "0xfdde6740f6d5ea37a932f2eb09aa74f8d78eaba61a15d18d1a7b446d008dc10c", + "maxOpenInterestLong": "0x6f33c67d41efde4c880658de09d2ae29adb4649b0e092e31ba9e74a4310723d3", + "maxOpenInterestShort": "0xe1595099ce8c877a64ac704ea84331cf9fe74fd92ce97e4d535c0e5195d47a44", + "minPositionImpactPoolAmount": "0x82c22c1e0a9d3d32afa63308137ee99ace7d78e4bd8fa78f11d0191ce9fc97ae", + "positionImpactPoolDistributionRate": "0xcbe85693d8b09a78e719fb4e18838aec0c8ec7e74fb6023c629c131db592024c", + "borrowingFactorLong": "0xfe1d0c7d5862b8f73711afc5ba8fb662aa662cd217340b4db53da04faa9cdb6a", + "borrowingFactorShort": "0xc6cef96f9c16ef21492cacdbacee441c819ac5385856c314c687d7c5735569f1", + "borrowingExponentFactorLong": "0xec78b4aa9ec9955c5ed9df8cdd6e522cc6fd2109e3bd352920101c334a79b536", + "borrowingExponentFactorShort": "0xa3ffb2b5924fa3a8bf0e6df7a1b1dcfb2c59e383a869c1d7d1808de3edd85ac9", + "fundingFactor": "0xc0e0a73fd818b7a5f7e8c190aab4c72d4e2f11ca2d6ef5fcce0ae265979a5ca9", + "fundingExponentFactor": "0x37753f9e81052c27ac58e26a3927ae63f1e0a56aeb366177426401b2e2df1119", + "fundingIncreaseFactorPerSecond": "0x93175fa017d53689873818c9dc9526d498d6eb32f0f6796209dadef1eac40370", + "fundingDecreaseFactorPerSecond": "0xb21fa3248df65a3a84186668811360a48b594d556969d64efbcb3249ee5caaa8", + "thresholdForStableFunding": "0xe2877029637aeb67773acd2f7b38d35ca20dc9f570a6e599c40d10427df423a8", + "thresholdForDecreaseFunding": "0x2ab6526d0c3cfb71d205f330c502f1bcbcd98269fe4f8cdbbd18ed3db7d80c15", + "minFundingFactorPerSecond": "0x2cc6179d7488ad3afc665ae7b745a70805e4d8f89822164211155df29e3cb09d", + "maxFundingFactorPerSecond": "0x5c35b3218147478cc4180f5aa2855d0f28596ba4441f9d2e8d209ae71eeccd89", + "maxPnlFactorForTradersLong": "0x62b1329a211b95ce1332d70babea14c068cd8ba5a664cd92aefa4dfcaa4f167a", + "maxPnlFactorForTradersShort": "0x974b387f81e50088e3c3ac618012d346cc44ada48d7755853beaf23ab5cf13d7", + "positionFeeFactorForPositiveImpact": "0xb1bf22ec2a6afd7bcc3c9005e3c3c2487c8dae699c0f4ef601cd0bf2ec00b0fb", + "positionFeeFactorForNegativeImpact": "0x491eab7041f5a8e59a24551f5f7c7f88554dfc7d8aa1cc32dc8447d4e0a3433d", + "positionImpactFactorPositive": "0x058ef893f1d5f6ef1fc9eafb5b98f219ba86fe1ff1732bd8e621ed9314b04c2f", + "positionImpactFactorNegative": "0xc3dd689dd953a4ead23ac3691cce97602c03ec497d0b618b927045ee6b05ec94", + "maxPositionImpactFactorPositive": "0x76f07a9c4842e03295e606a17118aa7055df974c7e8119e90c54366f8438c824", + "maxPositionImpactFactorNegative": "0xa90e6926653827715ada027f4112fe7c882a3ccaf37c922462d40fa4ea8d03ab", + "maxPositionImpactFactorForLiquidations": "0x41af16a1d0ba06020391564578914ec605001bc8ed683269ff1c10ecde331864", + "minCollateralFactor": "0x47e6ae06f279a68f0ca067d5a30ed3650bb14114110b8ee80883b47804ef6a3b", + "minCollateralFactorForOpenInterestLong": "0x2baf62173b9765c40d17461b94ede9de9288eaceb9bea879a93916d6fbc22a19", + "minCollateralFactorForOpenInterestShort": "0x2d87dc943787f13f340d4ca58bc57c9779423fb4b7a25951482d25d8cedc88ed", + "positionImpactExponentFactor": "0x255ba96b3ea4034ce13d81ee90f50b43d11aa4cf3d7f6cf6e214708c8cfcdd02", + "swapFeeFactorForPositiveImpact": "0x3de65a272685fe435c3bf061d018861d43e0981580e7f7fbbee8322549a24448", + "swapFeeFactorForNegativeImpact": "0x16ac4a989200e46829ff7e2a35892009f28622ddbe6474b3bcbf0be26843bc8a", + "swapImpactFactorPositive": "0xdd0713bd8c7d7d813cf41f2134c5c4171d1dd731b92f992bca75cee16f113bbf", + "swapImpactFactorNegative": "0x2c1ef24611bfb6198a766b0251729bb7dac63eadd6743ed5585dcfba706d2b58", + "swapImpactExponentFactor": "0x83731a2fa9b0d93a6a58adff585bfc0f336a70bb3a85535745a1d35ca14c41f4", + "virtualMarketId": "0x5d43ce08a24729807f7c46d7cbde59be236c1d3101b2aaa22e3d56b31bbd1602", + "virtualLongTokenId": "0x6547e1b09306192c47b377a6974e71c596aefec1820265db5088bac5550038af", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x7f1fa204bb700853D36994DA19F830b6Ad18455C": { + "isDisabled": "0x326470f02e7dcdbed5c2bf2a7a280970c8e6bbd22e8f702bb3c8bda8efa52909", + "maxLongPoolAmount": "0x6e9790a393e3f3bb111de81db14531fb65e1946e70bc3e4e91fdc3e5335b8064", + "maxShortPoolAmount": "0x45ae34fec4cf59d6b90edc724b710d91af4c64fddf1f0f36df86786f875b2294", + "maxLongPoolUsdForDeposit": "0x24b8c29389965242b8e1d21a75edc2bdc9e622301c6efb3d3c4f842374d6b682", + "maxShortPoolUsdForDeposit": "0xe0138895bc14ce6ac2f34a128e53fc8ddf7618f0bb6638edfac0e7f06d590d0a", + "longPoolAmountAdjustment": "0x960250e3511e26d9fc463fca2ab4336837fa1aa9b4e43df045c58dd031ab755a", + "shortPoolAmountAdjustment": "0x8792960fde3f1706abdb518fc691fd79c239bc28b123e97cc4ccbd5d8d6e23ab", + "reserveFactorLong": "0xff0a930271e88ee0d0cd9e02b248dd70a13f773cf55bbf578aa8941331f7d203", + "reserveFactorShort": "0xf397760ee901bb1ce6043cf70f533bba4dd0d5821f8ca21712ff195c3826ca2e", + "openInterestReserveFactorLong": "0xf6d9427331c14241209cbf9111a3a91cc011edb1a57a20cb732c52d27fd18fc5", + "openInterestReserveFactorShort": "0x64aaa4867c5e70be5dbf75a7ed7d4426485c9fb4ed89243db8315ba17b5fc816", + "maxOpenInterestLong": "0x0b20696e923124a1cf70d2b7c09bc182c9ff2263a1fd95bcb3045da39c1d8ced", + "maxOpenInterestShort": "0x73d461d2b8298da8d4b762f3cf81357e1da0d8c5123b8e5ff516a7b36613fccc", + "minPositionImpactPoolAmount": "0x0ead98684b7c65db5de5c6c06c0eefe6daffeb2d5cce77e1217cf1e606118116", + "positionImpactPoolDistributionRate": "0xede76755bb0112cb507216c12278b100aaf71fc4a1a677e2401fa7e518cdbb8f", + "borrowingFactorLong": "0xc530eef3eb91acd23cd0fdde1e36608797a59e42d0904edc0d2cff0c95c45846", + "borrowingFactorShort": "0x624938db5681e20b83cdb0a9d663142c0ad75e047577783941e0a869eb379ba0", + "borrowingExponentFactorLong": "0xce8c3d5822d4c02496927afcb7b3dd62c2dfc1b0255057a762aff7d04ed307ea", + "borrowingExponentFactorShort": "0xd11eda8de3daa0dad87ec408041278fb2d6e5bb74aa80c8f20c8f07cfb8831f7", + "fundingFactor": "0x97fe703a4ad969326b4c5f6eda95ea68764b4816e619d1e45ed9551ee3480bd9", + "fundingExponentFactor": "0xe9a61a3fcfa1da2fbbd55c1e25d30f088021985bf80b01883db06c254da3f39b", + "fundingIncreaseFactorPerSecond": "0x998ddc3ec098759d9b20c50505c6d8402303ff53b7cf47bdd63cad549ef3c750", + "fundingDecreaseFactorPerSecond": "0x95d6a37be0e594ceae565f0880c9aaebd81795ca255720b250b078d14f2de500", + "thresholdForStableFunding": "0x01b2a308462c37cbbfcf31e757e8db9600b5db45330efd4b945dfd427b6491a4", + "thresholdForDecreaseFunding": "0x3f54a318d3b38eda63d6aa2e05f283a3ff7d66ef83b6b09d2f876975d91931ea", + "minFundingFactorPerSecond": "0x16447d2801e2a19877de94089151e9223994cf89dc6c768296160ed2e490d613", + "maxFundingFactorPerSecond": "0x1ef61f8f945d86cd58ef7e1e4bc7729da62fef5ec14affddbba24e7fd1c961bf", + "maxPnlFactorForTradersLong": "0xef8aaa370644aaf3abf0f745c8d419b4e8b022fa74bd591331b9049f01a776a5", + "maxPnlFactorForTradersShort": "0xa0ddc4194a3ed609bab97fffba907154c8b2fab359f5339b564c416dd307fdfc", + "positionFeeFactorForPositiveImpact": "0xe0a8dfbd751b5d5206a4421add9c6138627ad8b1dd6c33c53e903e54a873d6bd", + "positionFeeFactorForNegativeImpact": "0xb1d9a20a9576c7c8e95d076152d6b7471f325274e27944234317d1655b9a7c68", + "positionImpactFactorPositive": "0xa72f633da73261095054c3c45e61c545b71b34515676776202071552eb46744e", + "positionImpactFactorNegative": "0x06aa2f3ce1399efdc7ced916c85dab36fdb5f78075b6ffa4cad253f726e194e1", + "maxPositionImpactFactorPositive": "0x5c9741051d509ce2c9f6984c4c7f98516b2cbf91e1342f56f0e1b5d40056b688", + "maxPositionImpactFactorNegative": "0xc5e52b000c6cf276f134adfe885de18e057f3c5f68a128cd952aae394b3c11cf", + "maxPositionImpactFactorForLiquidations": "0xe124a4a1a960aab0503ef70a732184bbc30732fd4697eb1ce4d4463f3a25c509", + "minCollateralFactor": "0x96dbb6d13d7c6ad973f98461378032ffcf09dcfff780a087bfb18e8b2345b446", + "minCollateralFactorForOpenInterestLong": "0x55f19e1cb6994dac8de0f0595716c8ce1c98c4a0fe7ab84d94a2581a2857ef77", + "minCollateralFactorForOpenInterestShort": "0x661c2ecf5182f780d9b14cd701f17b54d2fec0a3c78259175f382a53aaa17c85", + "positionImpactExponentFactor": "0x9c4e91c06294bf042d7bf732cb8ef8eacbc2b113523e0a3d00ca94d3baee95b5", + "swapFeeFactorForPositiveImpact": "0x1e388b1aefe26c7999b5916b8d315dc220aab3bd1abf69d022fb2ca798af1d87", + "swapFeeFactorForNegativeImpact": "0x42455fb0390e5144cf404e735d539d273f23e0599527cd4cfbea64781471c11b", + "swapImpactFactorPositive": "0x8879db97a79f1b27c0eaf1b7e8326ca6b02dde9dab4a136bf6de2ae5bc87eb43", + "swapImpactFactorNegative": "0x267ab1bdc0e337337fb57913abbc1774c61393c941ec14405210702c243dd087", + "swapImpactExponentFactor": "0x42417562a37eef95c1e2ebc561a16eb5d2719490bbc0c214707c278411bdee69", + "virtualMarketId": "0xbd5d0629f6fa7cfbbc696188d6e70260c1965336daa35470f96c58867af8ee36", + "virtualLongTokenId": "0xf1560d4507be69cfa4a1caaeb724e1a2e5a3f483f931332ea5ae9d057224f287", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xC25cEf6061Cf5dE5eb761b50E4743c1F5D7E5407": { + "isDisabled": "0xb1d3cf88abedde4fe5bfe1a8b31ea31fdd5217bd4c18eace1b0174c05207770f", + "maxLongPoolAmount": "0x2de33c18d1ba1c4b2178d1f59f940119156c13c57313fa0ccec9068dc25ee14c", + "maxShortPoolAmount": "0x1f5836422874f52e62a3e5f9b18dcfcc4f756e18deaf8970cb8f8b22cbc870da", + "maxLongPoolUsdForDeposit": "0xd037e3bf6b8fd9542598f8d4b32d056cbefd1f1b7b9389c3b0bb2e8702eacab1", + "maxShortPoolUsdForDeposit": "0x303e01786379e113fa64d7e00fe38cbb41517f3273b6d45f196985c156823b66", + "longPoolAmountAdjustment": "0xf6e31dc8ea13a1ae2858567339b85d2dfa627da93631df992c08da350b6c0926", + "shortPoolAmountAdjustment": "0xfa261879f962482d5193f8ce26ba18f57d8943346b2a56a01b06e728947a004f", + "reserveFactorLong": "0x63bae2f62e73f425dd3151bacf894c0a693ae52e615c9b92af1d0446182c7c07", + "reserveFactorShort": "0xe2ae33340f4eb98c6db75dfa90b5c8a07792d3436becbab39ed1097ee7330692", + "openInterestReserveFactorLong": "0x66375251f2286c9d1aecdb09f09ce30983c44b376609697167c0cd1eadf2da71", + "openInterestReserveFactorShort": "0x782eb655b1aa48d0898e76be6cc31396af34672b4ddab6a899ad432d39776167", + "maxOpenInterestLong": "0xdc3cc38ccb07563f5b9be451d1e14a238a7d533a1499e9bb3ce3692d888a42eb", + "maxOpenInterestShort": "0x60c0ba303e41eec81cea88370d528e0d7d65429430ca18dfa0617fffac08f5f0", + "minPositionImpactPoolAmount": "0x2e2af174dd52a9460413b14ff0e1b71859d284fd1f660569dc0ae9fa01bad08d", + "positionImpactPoolDistributionRate": "0x3a3f8cdfc7c48bf53164300d060f3081f46c1793eb2369aa7943f0340f6848a5", + "borrowingFactorLong": "0xe04346192cd96b604ef9f1a1818401f46d87342b4d90defa0db448f0fd0fc88f", + "borrowingFactorShort": "0x20778c75cb7ed4d65557b54a899af279a7351ff41ef7d11c0c164937c0ac66bb", + "borrowingExponentFactorLong": "0x024de70645b3c71fc6a3ec8e9736110d0d4ea788346a6a51e1eb0ae3ae67ee9f", + "borrowingExponentFactorShort": "0x2738f4a4b28a1eb52bf80ca90df8d3d0d24d86707a91a9523d996a4f3e5c337c", + "fundingFactor": "0x5a6371bc88237c71b04ed58aec7d999a0303a044d561d9deb6e5fc0a52c804c5", + "fundingExponentFactor": "0xdd9fc9c75ff997e7bb0f44292b38f59a98263baaea832f8ffe4817b055416b52", + "fundingIncreaseFactorPerSecond": "0xdc26c558117d98c8e55fcffd6e0c866f702a2389ef3b73ca91871f6545f1c3cb", + "fundingDecreaseFactorPerSecond": "0x609422a21e5a5041c957cf180a0dcf7dc2b7579152d4d7f91d4cfd736d06b47c", + "thresholdForStableFunding": "0xde58b077b55c6126211e76d587050fca2d3e16ea6d90b94aaa44d0808a73b420", + "thresholdForDecreaseFunding": "0x68b85cae0efa1919568d3e329aa6b43139738ee6df7e484b18008306bdef300e", + "minFundingFactorPerSecond": "0x2d4dfc45a9d66995a9962b01513b20ff299e38e22b16e198bce4d175f51c3852", + "maxFundingFactorPerSecond": "0x80fbfee732d414f7e197bd2dca60406b5443b01a07b4bcdb3e9c79809d5b1c98", + "maxPnlFactorForTradersLong": "0x0d971c00493d5db7d3270c7a8cfa9cc7aa0a99e5005fb913d5dc26b445f551f7", + "maxPnlFactorForTradersShort": "0xf9a064f376e3c391caabd7d692c3e5e5c601ac3a9ebd1d2c105ef84117e3588b", + "positionFeeFactorForPositiveImpact": "0x57a019d7c544d1c83cd3118bf0c636b2e212af7f8c5c1e1ad5267adf98f3bbd6", + "positionFeeFactorForNegativeImpact": "0x99694bed9c85088df5242e4cfb72caecd4c1cb1870445956483f383b2ad6a5c0", + "positionImpactFactorPositive": "0x48e76a2a5d0acb603c2113e72183f2ff900dad314753ccd89847cbb3ab21a522", + "positionImpactFactorNegative": "0x2892774a5b56d753852b4a0f3bfb467e3a8ec009f9363ea1e87a1fb0be8949eb", + "maxPositionImpactFactorPositive": "0x2ff3590362f429c9e9fed9dbdd6d9b7af0fadc3db5958cbdad4915effd446ab5", + "maxPositionImpactFactorNegative": "0xc5700a9f0f48d7f11ad44433d1848041e475133baa14ceabfd308aa05291380c", + "maxPositionImpactFactorForLiquidations": "0x95b07614a06ac0a81e49b6e02b6b5be9ff94bec514e0e62042c8e1f5c1429733", + "minCollateralFactor": "0xda500b491a746b24ab50e0b8b019f220ead47914b3745a2a7e7fdbd254e98380", + "minCollateralFactorForOpenInterestLong": "0x766fd0d002f43488d55b72193e9da1714d44851b4eb0e813cc8d280bef17a17e", + "minCollateralFactorForOpenInterestShort": "0xd7db435910f38921a33518f369da861bc79b935c47e55310cda4cac15d5e8817", + "positionImpactExponentFactor": "0x2efcc03e271bba8971dffc9f4ceb1afc8fc3c3c21d00a7c3b55ce76374ad79d8", + "swapFeeFactorForPositiveImpact": "0x33809fa251f2a79834e55024e55c4f8108575f4de5b2cb36a20328e5ab447533", + "swapFeeFactorForNegativeImpact": "0x2cedab9e26e3f9beb8d6b7ed636b6bafb5c22480925bba846038f0c06b622eaa", + "swapImpactFactorPositive": "0xb63747d677b3f4894bf83370aa290ba493a3279ab6c71e8f627d6a19200fd0c1", + "swapImpactFactorNegative": "0x6db11718caa3c178b5c71b0ebb38438e678887ee9808ee5fff12f45dff61f523", + "swapImpactExponentFactor": "0xecb5d9ab804ddb4babf57af0763d13484ab59dc753b190aed034545d261dad6b", + "virtualMarketId": "0x403b84c44a43de012d5af0d352ddee18816098b6dc9ab85d18725c6c80ee34ad", + "virtualLongTokenId": "0xd75a55ed2ecea1a03f2ca36bf769ceee55b3fcaa9c02f4cf863518485ed4918c", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x9C2433dFD71096C435Be9465220BB2B189375eA7": { + "isDisabled": "0x162396023668ae739ec419fa915ee1f236d89e72258db6e912f7d16e756c70a0", + "maxLongPoolAmount": "0xab787d0a3c9c67c45e6f938ff770c45490acaad006cb7b3be08e981bd492656d", + "maxShortPoolAmount": "0x93f6c9bc0eea0dd04594416ae4296d38b68f4392dd54b70d78c8a5e261286039", + "maxLongPoolUsdForDeposit": "0x962e6363f5f6db5bb775a2171825ae83d1933bbeff0018de29bda54488da6b2a", + "maxShortPoolUsdForDeposit": "0x32153c99b3d40dc8c10cf4008b39dfa7056a9dedafc097269c92aab12ef876c3", + "longPoolAmountAdjustment": "0xb249223bf4f78fafb799532ef2d3c1051b062906f9c0078f7b20a4e7efbc4925", + "shortPoolAmountAdjustment": "0xe9d6461d1253952d7728d3353f0f7755d6e6fd78c26584f3046b14b0d1194a9c", + "reserveFactorLong": "0xf0d74a6066ac8b666c5c6985229190cb526b6f92bbfbf104971d42c15c608cf4", + "reserveFactorShort": "0x21fb31f5c7825cd9085a102961308096a7e0818094775d817e814a07c7ca308d", + "openInterestReserveFactorLong": "0x2e9ba8c354794ee137efeca795cbe0582624d0d356a60d7609aacd8e2a945cfe", + "openInterestReserveFactorShort": "0xbe22575e03c45413eb3cccc465e3ae4edf94d822a5362426871206cb6044d45e", + "maxOpenInterestLong": "0xc6c4c0c7938091163d0d5a9ccd9c033d5c924372c986ab1c5392ebaa43011769", + "maxOpenInterestShort": "0x1b5c6f515490d0f7fa0445a43d637956290f6f1cffd7be82206c7773965eb27e", + "minPositionImpactPoolAmount": "0x491d869920adaf7023df887682598d5b70be5b7329c9e9d730b41e7813210d20", + "positionImpactPoolDistributionRate": "0xdc36b4ad31f89bbca3718b5d1a5576780cd3bf6d0753a4a88c504107801761bb", + "borrowingFactorLong": "0x0010586fca59b9c6ba9a71d77fa89b7cabd88a8e06efa5ce7444c2cc4dcc0d91", + "borrowingFactorShort": "0xc622eb5feb439ecadda1be14da73dbcfb15c6f70d5b3757ad4df84407c2b421f", + "borrowingExponentFactorLong": "0xa38ca37a94ee21435ee72d6dd2548196ab17c5783ddbc8d4ced3799e7f8d1096", + "borrowingExponentFactorShort": "0x67ea041a14f482e3210650d103c472675fcb07e3304c1c088c0e09d31691b94c", + "fundingFactor": "0x344d5fd167a03c4d70e85de59961e4c108f19f1fe37653f7bad39022fef90dc4", + "fundingExponentFactor": "0x795ffc2e17fd0b19ec6668afb345e1005371a8cdf6974ccd99048bc578f13056", + "fundingIncreaseFactorPerSecond": "0xb914624bf16e17720f861cc262c8629021f1a6dcefe2ed7c097a2e154adc86a8", + "fundingDecreaseFactorPerSecond": "0xaa5c773af164cb6410d7190462045d9dbf192f6b653015a77de2706c4152d616", + "thresholdForStableFunding": "0x34b34b6eb4a7a24518621b63c032c85585baf585789df50c03810377cb6753b4", + "thresholdForDecreaseFunding": "0x008889fa98faf38a55328a35a0de7f44d1ccb6731cb3fafc19ab1cb5c6f19ac0", + "minFundingFactorPerSecond": "0x659b0eb229674dc1e2dea48d018bd2cd48b43e850b1ab70ab9c856f12c046a17", + "maxFundingFactorPerSecond": "0xe7a76386a66a7510ccb548446cb42001ef38df88ed137941f22f742a80662a9f", + "maxPnlFactorForTradersLong": "0xd5f058fb977929295998ca0eff3c526b05bc44fad34dd48f5067d6d63b7eae2c", + "maxPnlFactorForTradersShort": "0x50c66a2e6ed8488a2a6ba5ada5720a9475a809201089d4fc87977b851c382866", + "positionFeeFactorForPositiveImpact": "0x52f8b77c96eee555524449d744f3f6c6ab77a4f26db48d6df363a32fba500e11", + "positionFeeFactorForNegativeImpact": "0xe4b8f5be03631cd111cafc0ac01dc8a8ab8f8ffc65b2a47287e8f9cf72b9c39d", + "positionImpactFactorPositive": "0x4c9c2a48ed819ebea8ffdd30af8644af6bca85d2a73c6212b3e116d565ea6f1a", + "positionImpactFactorNegative": "0x14770004251515604996859abeaefb248ed77bac98b0182e5d0de798e73a9880", + "maxPositionImpactFactorPositive": "0x3bd8a0156fa25ff8ede082290885def48ebc2b978d3d3bb634261bbd940aa8ee", + "maxPositionImpactFactorNegative": "0x01d477fd068479d04cb497540a393c8b5ef72afcc50e7b820000f5d863d185b0", + "maxPositionImpactFactorForLiquidations": "0x4ec66905f0f5391fc597d1928fcb5b1785f5ff1c58238c67026b62121f2c02ce", + "minCollateralFactor": "0x0319e091a3ec1a799e073a0b7936f425076d1918f56c3ebca0a61a077925d1a7", + "minCollateralFactorForOpenInterestLong": "0x534530389b87caf5d983a7e0e861fa8081b2a7a13384cf923705a64a186c5230", + "minCollateralFactorForOpenInterestShort": "0xe5b9a75cc9c16a9e118200b3e6bd4b4a4a3849781b494af86fd3b61368f3a9ef", + "positionImpactExponentFactor": "0x2f3fcc42ff0aebd5654ab91b39ee87bf3782130d659ee6dcb17bfd46609a202b", + "swapFeeFactorForPositiveImpact": "0x76240fbd6e985d59376b17429e35328adb92d235eaed290e881d2905f4fee93c", + "swapFeeFactorForNegativeImpact": "0x98d812495968f772c1430ad5bda82be56209a512f5038e644d21baa4649258b7", + "swapImpactFactorPositive": "0x322d07f82afd4f2749d56278757d206f52add338aa5bc9359b259a5ddef4e514", + "swapImpactFactorNegative": "0xe765a130a8cb9790e3c622efbb5422a8fd76ba0ed4a41840a89b667104954b19", + "swapImpactExponentFactor": "0x4f3835c05f851e1cdbc009ca97f15327ab116a04ddef47c133d035ef3f3fc8fd", + "virtualMarketId": "0xa0146dca4369d92ee7d0993f033b43f1e64a08340ed10878c24f2be4dab96b54", + "virtualLongTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960", + "virtualShortTokenId": "0x982754fe7fcef5cc4e54f2c0fa354975d1fac185e1b78a6ce1b38c9b7c9d8cbb" + }, + "0xB686BcB112660343E6d15BDb65297e110C8311c4": { + "isDisabled": "0x9c06387493865236f8d101050e29898838a80e902814ee7bace306470e6005f7", + "maxLongPoolAmount": "0x584a30b1d37c441de84a93d35d51eaf72a6a04b8dfd958fefa85e7051c05b816", + "maxShortPoolAmount": "0x0b4d5a27f35b6f184c50a9215b16c15c8d2c83c850835d1c8bc8cd1f80c16d15", + "maxLongPoolUsdForDeposit": "0xa869348d8cb49599fbe5d249b7cc3ae0e4a1b6a3faef22610a435a332c09c4c6", + "maxShortPoolUsdForDeposit": "0xadf6ef5018dfa50c5a97a1b73996db0f87bd471c8a972e2422cad95d0df76790", + "longPoolAmountAdjustment": "0x8cab141db1e9a38e7e20758c0c082003b5b154bc9f589d7813d4b02f33902e0d", + "shortPoolAmountAdjustment": "0x9c7c6f94f767818f7f89877d5907835f0d7b4ec27c9ebdb8a0e259a9a2e93f25", + "reserveFactorLong": "0x7ae71b31d48a1a9def94cf61b69009b6fc60c6c809ca6ef90525f55a4f4c5c2b", + "reserveFactorShort": "0x74e0a986629f91e67d4ad1eb01fb7b5b557166e51a12fac4f9402819fc317ac8", + "openInterestReserveFactorLong": "0xfc096de78cb126ca2154591a6afb07f4c24e8f7697c564df2882438dbf6153dc", + "openInterestReserveFactorShort": "0xe8b8869cc4cafe0bb13f25e101c69cacb6881065b06520a68d8cb710926052c6", + "maxOpenInterestLong": "0xc1c3992f715830014e3ddfaa736238c830bc70e5f4cbcf66a93694252d8ce973", + "maxOpenInterestShort": "0xa2e79b6a0237595d4e3ece771a4cfe82deabc6af86edfab59b1da91029961b8a", + "minPositionImpactPoolAmount": "0xe4d89e3a8355cb14bf45f25d76e69b16accae687e834972783c398f4f6ab05e2", + "positionImpactPoolDistributionRate": "0x14b6b73dfacc2778c838cbe28c6270604688afa8ceaedfc62ecf83fe7c5a4bf1", + "borrowingFactorLong": "0x4d8b8c74a4d69853c6ed370845e5b195ed0e8bc5b300642e545dfc21919f370b", + "borrowingFactorShort": "0xd1fb343b8eab1f88e8473d28f303756cbc225d7cbcb02b1d86e914761629676a", + "borrowingExponentFactorLong": "0x9bd954c1a498ce975859815aee46e5d93aa7ad6493d2c409bee9416d32b0bb0e", + "borrowingExponentFactorShort": "0x9febcf03b12663c8280e54c3811f7c15c05f5c90cbabadf97fdf670a1c8cc2c3", + "fundingFactor": "0x3ffa9499c42ce647d9511f6b0d47dbaf4e3666257c9d390fc056d7d0a6e360c9", + "fundingExponentFactor": "0xa9f244268804fdc40a66456fa29e346a8a0102423001629dfb5adb82b63dda1f", + "fundingIncreaseFactorPerSecond": "0x087d91ba7d628e15c3e7e6433a40a9cd44df9106c9fd3b3928707adc0644ce78", + "fundingDecreaseFactorPerSecond": "0xfe5eeecfb41b553235441966ca2fd6868f777fa6ebd48386b33b3e05a51fc1f9", + "thresholdForStableFunding": "0x2503f8046994ea786ddda5034adc26f2941fbc0acc6f6159730fd4220ab0e240", + "thresholdForDecreaseFunding": "0x4e5a0d195ab3c99ef9fb1ec40f5955026f690c7a651f0e1aa766bc072b62ca0c", + "minFundingFactorPerSecond": "0x21cb06994ca5e82169f0596f2dce33547f5d27970d260f6251f4bb4f642f964a", + "maxFundingFactorPerSecond": "0x99b8fb43ab749f6efe10459bf77c6e6d1cc46a02d8556deaae37bfce7e310fed", + "maxPnlFactorForTradersLong": "0xe819b259874d89abd8406b4d8b5e978103e20599ce37ae5e6fcf35aadd672806", + "maxPnlFactorForTradersShort": "0xc08bed49b3149d637af537bd879916ad2179e5f790c6a4d9fa254f70468f8c54", + "positionFeeFactorForPositiveImpact": "0xa33ef0e7e5737b815d4ee3818c9dda824c74ca1c0010ceca073401987419dd6e", + "positionFeeFactorForNegativeImpact": "0xbaa718f209c80155d83205a86874b4ec814ad173901eb25ef539652c4c0f7102", + "positionImpactFactorPositive": "0x01e45a73c87ea6a24bd3e4b646a8fb50e525994b47b2e071688832b3db9a36a3", + "positionImpactFactorNegative": "0x0eb07128e77ab3ed0303be75bf40e58de698d31f3587002010201f1f87383ba8", + "maxPositionImpactFactorPositive": "0x3aaa745ed518dd8c579ee6533f0abc0f71f0b5856a057d7cdb74765251b41f7c", + "maxPositionImpactFactorNegative": "0x28706d4a1fdc22299d49f2506ff82c9d9acc08e657e2d01a527678b6c6762247", + "maxPositionImpactFactorForLiquidations": "0x15bcf662fdf9b8cd990c2b62c63190df2eb471bed3de8b9252a8d9f1d25fe9df", + "minCollateralFactor": "0xff3a85b820937ac9b174e1f49510b221d1e2eccc89cbdb68794b1e04f82c5e1e", + "minCollateralFactorForOpenInterestLong": "0xce841b0d0a75f7f23b3068a8731d79d46ffd5224bf752b82c99278c615ce9610", + "minCollateralFactorForOpenInterestShort": "0x095df3a0a35194c30b382a21aa95ff97440c497a9fa7308d9046a7c6a830a077", + "positionImpactExponentFactor": "0xa776cf8b6750764a7baceb04c49b3e8316f86ba63007da12ce39fac78ce94815", + "swapFeeFactorForPositiveImpact": "0xa5c03fcca15132bd6eaab72fcb0be1671560cbff2bb1216ba7a680423f852cc5", + "swapFeeFactorForNegativeImpact": "0xad609e8a1ec4b62de757f26762513889a12b50c490a2c972b4cffdab526ce5b1", + "swapImpactFactorPositive": "0x40780b4dfe67cb9032a30a9ae910a8e63c568c0bfcfbac6962149a0480760e02", + "swapImpactFactorNegative": "0x981313e20ad119ffd4e7297d65ac074bda816af74f76dc5ebef3a288ea0420c6", + "swapImpactExponentFactor": "0x3a49bd6e93391cdc99dfea5cfd912c9e3cb54ae1dcd9c56801924b4db11e9b9e", + "virtualMarketId": "0x15704d8d313a8a9b84f0554bc4b8b032736212ce269bc3222f3a50ef32a72ab4", + "virtualLongTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960", + "virtualShortTokenId": "0x1ce9cae7dec48a356431d92c03845f8929446aee01fbea8eb35c1407e345a5f2" + }, + "0xe2fEDb9e6139a182B98e7C2688ccFa3e9A53c665": { + "isDisabled": "0xb74cc43e7e817542a54e3b1d2ececcf83074b211181c024415ef7f85fa4748f8", + "maxLongPoolAmount": "0x2f1934c05784d31b4146a78b3dac6f0a72d3b569c063c39c729409f59dd3fd18", + "maxShortPoolAmount": "0x81cc635bcf88d5fc104ca8c585e79ccf35330862b1542bc7c056bc4fc36b3bc3", + "maxLongPoolUsdForDeposit": "0x7e6b7df1d22f053ca257972542037730222d4922d33fac138327c470da617178", + "maxShortPoolUsdForDeposit": "0x4fc4be02822546883970c09b35f4f95de56de5c7481e8a758a972e8f4d932f47", + "longPoolAmountAdjustment": "0x7d5c45033a0311271128e11f143ad8c5ed8302b90a0af7bcf75a7523a3c64517", + "shortPoolAmountAdjustment": "0xa367d030454373bd0efef06e71602ed44b939beefef351dcdbfe1d95adc36878", + "reserveFactorLong": "0xd8bb63239f8b899bcff044bb63ba286070ff4366e12cf336a4dc0f85f0908796", + "reserveFactorShort": "0x5327107d7e1a1b8b1c16868e3a6eb257fa499f6c88ff038bb20b73c22ebf4351", + "openInterestReserveFactorLong": "0x90e6e19f6295a0183ce68a8823e2ae5aa1d8e609d80b8585ccd3f578283ec08d", + "openInterestReserveFactorShort": "0x0df1a1c4165cf2ac998f6b6516a4a28a9bdd31f81633f27a48fb415084490835", + "maxOpenInterestLong": "0x6e86eab1667ef665b661e2e14d876d3a09276c0c00959be645d17cd4a49f0655", + "maxOpenInterestShort": "0x867b5baf990ee6ab0b400161e64dc198bfac6e9efc42cc698f00bc803bfa2f22", + "minPositionImpactPoolAmount": "0x992f945846bf37109a6d29460a2481a2ac383b4ff5a12aaa0ebf0389e76a0335", + "positionImpactPoolDistributionRate": "0xd585aca6858901d3f069a8592504acddc1d4c5d46de26b786bfaee20a07d7773", + "borrowingFactorLong": "0xc884969394de355af35495ead66f1e465ea9a118434b6d52f952528ef1e7a319", + "borrowingFactorShort": "0x240e716ddf441cff717dec1da727da3107b2e34c3ed4a4cc4985c452ab340fd5", + "borrowingExponentFactorLong": "0xee6386815cfc1d6281b4e7e9cdb00229272478ad1322d93e2025955930953f08", + "borrowingExponentFactorShort": "0xb77577362ddb2ab4f3e198bbcc02f5f1693ebbdae546905b8ccf4d251eac4a86", + "fundingFactor": "0xd839fbe52a68b5a27d83ad919a246083cd194293d7718ea15edec04c5e9271fb", + "fundingExponentFactor": "0xa29db75a4ccdb346ac24adf66dde28bbd17f610f9fbf46a5148d4249c199726e", + "fundingIncreaseFactorPerSecond": "0xe05f3ddfc3b5f081255067f851b8b21dd4cd7d83250d263f252278f3795ffc13", + "fundingDecreaseFactorPerSecond": "0x00f2a950c6461e861e21e4cb7ebd51ed0b2ffcc8c2a8e6466940036061ce27de", + "thresholdForStableFunding": "0x3c99bc979c80555ffaf1ee202602874188ae5b7b736e95620d817c431b1de8af", + "thresholdForDecreaseFunding": "0x75ede7b066cdc09c10a9edaf1a38bb295a5a07a16e6b6fc469fdeed885c3c8cf", + "minFundingFactorPerSecond": "0x1e356b2f576c8222f3cc2bda4202fa352026b445182dd4e9c8a901800cde376b", + "maxFundingFactorPerSecond": "0x8b5935796ab74f3629e2ecb0efb2aaa95ec6c22cac58d7d2549715ec3b637f02", + "maxPnlFactorForTradersLong": "0xdbff4e5388b3cadab3adb3cbea18328ab85615d1d33540f1daa3637191bd2a7a", + "maxPnlFactorForTradersShort": "0x25e92f539fa9d6181cb3175d855b0e3db892f87e7cf44683c2bd88c3987151f1", + "positionFeeFactorForPositiveImpact": "0x75342f90740d718e915d25876def103e0aadb790eeec0e51cf80a0164fdb998d", + "positionFeeFactorForNegativeImpact": "0xa3181a5fa6716d137684451c14456bd1e089a30d7e4195041e1d03c5877fbdb1", + "positionImpactFactorPositive": "0xfaf02c5d36cb1652804abd1004a4a3cc59b1d9639b6451440e856c507ca45e8e", + "positionImpactFactorNegative": "0x68e601b74c240b88ff66adfef9b198da08f6b4eb2f6bbc5745217e2ee220c74c", + "maxPositionImpactFactorPositive": "0x55682cadf8c0c42f07f7537e036888e6509b4c1fefbe791f8806c0122464065c", + "maxPositionImpactFactorNegative": "0xcc4ecb935ca3ee301c72b4a0a5a2e0ec012bb977e18988abbf65ec31dacfb01d", + "maxPositionImpactFactorForLiquidations": "0x53e40c837b0c78b8e732b33a14b1a71eafb92ad162e389509adf12d012804445", + "minCollateralFactor": "0x19551441f4fad115496cad924a5234a7c54fdfb4c8a1488f93b7bbd6b0ecedc1", + "minCollateralFactorForOpenInterestLong": "0x2236f68da88942f622d2e117770f8f2147a2e26a5ae248e7facaed024241fff9", + "minCollateralFactorForOpenInterestShort": "0x97b31e77e2349e5ca9393f9b039ae4c6e08b561674013325694aee511fa70f4d", + "positionImpactExponentFactor": "0xd29cc14774ff37425210a4b4982d64598d960517246358ca6ae31e8278b88171", + "swapFeeFactorForPositiveImpact": "0x2453b281ca272f6b3c4aabcc06da5f61a03fde91143ecbb636906d8760751038", + "swapFeeFactorForNegativeImpact": "0x43fdf293b2369b23c689953b361e57206f130569d07cdec5b02a91f7db302988", + "swapImpactFactorPositive": "0x6e872e48337e83b9b0974c98123f42c6c42133a809dda28947e45044fef0d763", + "swapImpactFactorNegative": "0x7f74925d83c9749b52d3c463b52f75f56d3df222aa8091d320be024fcc136ab5", + "swapImpactExponentFactor": "0x93ac087aef99ee1d1d4337027e16e9f34e2b3e95b449f6e1afd4969af2b95d99", + "virtualMarketId": "0x20bf0a582d4508bc430f8d7e00de90061aeb901a0c0e11076d70511678cac8ce", + "virtualLongTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960", + "virtualShortTokenId": "0x31d656b47c3d16978767c8760419f35660ce6b3f01fa1add1aef6fd361fda2b0" + }, + "0x0CCB4fAa6f1F1B30911619f1184082aB4E25813c": { + "isDisabled": "0xfb532704a44e3486571fe4e8fe62e7780e56fa790b833842d79f90d0f46288c8", + "maxLongPoolAmount": "0x9d77a79b78ff0f86f396c977116cc28b7b34ec8b9b4b2752f3653e57ece05263", + "maxShortPoolAmount": "0x4e804829b61b4a8ef75dd498c47d231e56160c494bd8d40515bb413fc777d5e7", + "maxLongPoolUsdForDeposit": "0xe179c8aa812fe724113753f8e7735894da602e37c8109bbf67782398a574db97", + "maxShortPoolUsdForDeposit": "0x6ab6233fab510097c6143eafade050e9166d20d72ab6614b4ba55ac5356fe94d", + "longPoolAmountAdjustment": "0xda25a1e17e62d1bddbb481cd18a5ae16ddde5acbb8fd8c8c96b2dc53803b5c67", + "shortPoolAmountAdjustment": "0xb6e34e87a1f8e633fae5fa3626c547f51f24494b8e5ee6c2161dee19d7e68b84", + "reserveFactorLong": "0xfc1101b1047085db2d628cfc59d344549f7fe0be0c815b1f45523922e030343f", + "reserveFactorShort": "0xc3b41b507b5f324ac2e4d8b2e5639a5416648a0ec00ea0c3e0c07e0d8cb96c81", + "openInterestReserveFactorLong": "0x2158e1bc5d3d391e0818960999eee66c0fd7b00d133fa26808996ec248b5eca6", + "openInterestReserveFactorShort": "0xd713c839e38eef01cf2ae81bc02166e1f255e83842091cfd68076fb2fcd08d6e", + "maxOpenInterestLong": "0x6e29ee2c0926edeb6c68b6192d29f4b1d29463e9679a9a93bbc8c8d9ea088368", + "maxOpenInterestShort": "0x8b18dce04c412d0a5b3f066a33ba853350605a4f348b92a482fcc44ef0b2aa63", + "minPositionImpactPoolAmount": "0x72ab83ddf0fb1454a055654d429c60573d5649ff4c4a01899c44c96206f622bc", + "positionImpactPoolDistributionRate": "0xcbc24fdd19c94c38dd10f51fe4ae141568b9233d2321407a3a77b7b661591398", + "borrowingFactorLong": "0x23aaa724d649229661d04a81588ed47157d7adb06ef8848eddf36e626600536c", + "borrowingFactorShort": "0x8397002fbbf56f73116879b26f679628094302d9fc43589c06dc591565e4ca79", + "borrowingExponentFactorLong": "0xdd00f6b2e003144f1bb4fb4c1aa69897149f45c9dd41ad302d7219fb94aa6741", + "borrowingExponentFactorShort": "0x238e8be4b40f1f005781ae1edd45acd0d7f6058c9a83ba23c6a9619ba723e5e0", + "fundingFactor": "0xc61075b8cde8c86c8d00cf87c027f4b6c293fa282b7b2475c9eb8ce2d7b6dbdd", + "fundingExponentFactor": "0x09674033e9197240c0f552d0978a9fd097d9b09b42491ab2e04aad63428a8f08", + "fundingIncreaseFactorPerSecond": "0xc6a27b4d510e63f3a84c63c0fa86efd0af51b3dff437804da143dbf2419c16c3", + "fundingDecreaseFactorPerSecond": "0x38cb2573f8dc621fe74a2df4c283a0a8c5763fd6429762c8eaf50bb1662659c2", + "thresholdForStableFunding": "0x7df45d7ece6e1f0615f60adb4e08d26c0ec552e38301e5ca501008f4fa5661df", + "thresholdForDecreaseFunding": "0x0c76d2b8a327c15978e3f37c0030b168a24bfbee3cf2ad1900195f7e401ba34d", + "minFundingFactorPerSecond": "0x5ad463d95ec6163be46538304d7d1f8debd06ae0142111f7ee5dfe0ef835e528", + "maxFundingFactorPerSecond": "0x77905364bba50c4f33e22bccadbd317691a1c22b10fb45c5dc8c32129526044b", + "maxPnlFactorForTradersLong": "0x9dfce95f35750ed7989c98bc3fa7b9ffdc4d923342b99b475bd1a68dd2bea55f", + "maxPnlFactorForTradersShort": "0x3f7a7d4fa7b04934a74b5c4fe364e15ec7f182a731e00665a8087943d90d8ef3", + "positionFeeFactorForPositiveImpact": "0x2afa6ab01eaffdcdce3de67ca9408d171dca6f345e4a933977f017c3f935a150", + "positionFeeFactorForNegativeImpact": "0x16a9815fd641b782481c256ae44f741d91f98e60f198e6f67711c2f872654659", + "positionImpactFactorPositive": "0x163076b9dd0072442b9329b1e08c52eaf7f5d809f427178601592806a5200645", + "positionImpactFactorNegative": "0xc27bde803397efc87d5d72964b6602262a80df80f9793084055ef0d6dd08b1af", + "maxPositionImpactFactorPositive": "0x1c69876249545cf8f840054e487971e4faa2bf1574ac216060f5367e8fc4a611", + "maxPositionImpactFactorNegative": "0xc6af5f36195b175198abc4774b59c643fd769f4e2c9e249c1e3006b88b70fa9e", + "maxPositionImpactFactorForLiquidations": "0xbf51cc5c91b13d3465f57f3e9c7b3d9a464a01ad65b0cd7a784fd2d83ccb7051", + "minCollateralFactor": "0x7cc57d46d5ff50a03e5a0f29242e18131d031794b2629b7f6398de7841588dbc", + "minCollateralFactorForOpenInterestLong": "0xc91baace01ed132d5a1f539fb6ddacfa913f012c6d706993f1f9d21e28646417", + "minCollateralFactorForOpenInterestShort": "0x42ab637ba5ede5ce450b490c92fd5308a4b63d814d521886092107e000564243", + "positionImpactExponentFactor": "0xfbaadfdbb5b204e122e8a78505941f01262e57d5b600482db442a452bdf0c5e4", + "swapFeeFactorForPositiveImpact": "0x13c0be771ab61c6f159c7b5afdf946b2e46e53aafb8881484d71a028dd441160", + "swapFeeFactorForNegativeImpact": "0x7b665b4b365ff791322993f71e61afeba792f6ccb7a2f5f2163825643637c897", + "swapImpactFactorPositive": "0x6d7c56088daa2bea15028f86d6f54e24a63768356083dce669015965c9f5b873", + "swapImpactFactorNegative": "0x3b2c183b4353852490404ae6be59826b51e24517576e18db1483a6c593a1a99a", + "swapImpactExponentFactor": "0xde8e209ca4616ee04606284a891e35dc078488672e5a98b257aaef147e46b5cd", + "virtualMarketId": "0x33ce55e7dda117ba6480d3120f3d7403d8db763bd7606ca8695846851288c789", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x2d340912Aa47e33c90Efb078e69E70EFe2B34b9B": { + "isDisabled": "0xc1d32ed0c76a3f0514d2972978714afaeebb7f1f439307c9e8c8d1d17e937858", + "maxLongPoolAmount": "0x9121aa2f0d512e0756e93f4eaa3c6d274e546558dea5f721b897b67f9db5e8ba", + "maxShortPoolAmount": "0x0625bc3dd53555a03320174e5be6f468deca9f67c95db201f2d8bd48814b8373", + "maxLongPoolUsdForDeposit": "0x30cad517470e6f44fb271fd7ac7050169248e1cb3e02d6b7e2629ff3ef94a2f2", + "maxShortPoolUsdForDeposit": "0x90476494490e62a97d255ead9bc174ee42b889f4a716654b2ce17a5387ddb26b", + "longPoolAmountAdjustment": "0x023cfe385001f6f535f804f5c8c4364cc2d2d861dde939d437e5f94d6ada607d", + "shortPoolAmountAdjustment": "0x76b438e5baa05bf7d9fb43ec067baa90d1a5530254e79a731f997d913760c48c", + "reserveFactorLong": "0xee12daa6322646c6ad0f613f13fbb115e7147e646365fcf22638c311b3baa657", + "reserveFactorShort": "0x7e6c586a5e265f204036389179d4d4987cbb2a7edafe47868d12dc426a84e2aa", + "openInterestReserveFactorLong": "0x56cd4bd3e0a7a42cfd55e27a9183d595660ccff7f5702723b69561212ef17b18", + "openInterestReserveFactorShort": "0xbf4157920fd33a3ea64561fd1ac504a46e7936f1269dc091d75cc2d90ea88993", + "maxOpenInterestLong": "0xba9f5d08da55c0e4d80ee0df2a1a9c76a435adc80a6adfc0ef94fac0f3ba5fc9", + "maxOpenInterestShort": "0x46b29dd4bcba368c088d4ab08e74babb236ad1d80d3bc753dbaeb29385af81fa", + "minPositionImpactPoolAmount": "0x6aa69e47c30cc774f3c22beba7bfdeb098cf0c64cd6e89e87153ffc6d449162e", + "positionImpactPoolDistributionRate": "0xc08e83a94ca5019fd44b90708ada389660461c40906712a50a9ae81fcf17f1a8", + "borrowingFactorLong": "0x36053028a19ecafa8fda920d11534cdf5a8fc435b3bcf9f9a80b9c540bb37456", + "borrowingFactorShort": "0xbbdaf140c7a031bc05b96fe8210ca75409356178d6568fac51e1cf7f524769f4", + "borrowingExponentFactorLong": "0x33e420b8f0a1bf9e108df3ace664be15f3f2694914eb464ea8a3842aaa63a32b", + "borrowingExponentFactorShort": "0x4e2f09c1eafd4a91007d3b0f728f5abeda3a38c63d1bdfd4871c72e66043d853", + "fundingFactor": "0xe288814d1635e3c6a21994bb350acf5d74b2fc933662fbd5cabb61e9454551a7", + "fundingExponentFactor": "0x6b5e438c6dbd2cf2e8716d94fed2c88893dfb07e8666a7905758cf8a9971aa64", + "fundingIncreaseFactorPerSecond": "0x5a8a8c161015a025c4a0431f22546c819ff2dd2f1b019ae4ee6703669e30cb8a", + "fundingDecreaseFactorPerSecond": "0xed14af8b59043d260dc529f546fbab4fb2916182a5d336ba92ccb99c90bb60c4", + "thresholdForStableFunding": "0x01865033922695631505e435deac05ee1e0be391d506975e74375e8aab642075", + "thresholdForDecreaseFunding": "0x28a167885f010d70cc03b13f995aeea01bce14cd550d652967136d599b8a5568", + "minFundingFactorPerSecond": "0x4a32c33bebf88ca2787f949d72bc5d442731a7a2fedb29fe7c3cd9c87095a2f2", + "maxFundingFactorPerSecond": "0xfaa2e2d54bd6c23be91d8e5c47cb3ae9d9fec59b9aa8290ef792420f15b2469c", + "maxPnlFactorForTradersLong": "0x85ec736c56013977c51d5e19da50497a732239f0fca988471f4e0a3066fca75b", + "maxPnlFactorForTradersShort": "0x8edb1f5246ad1af8d59a7ad26d8f41fe7dd2a1813a1569cdcfe40851df6ea6cf", + "positionFeeFactorForPositiveImpact": "0x529d29c9843efe4be2f9872d2e78fcf6e0440a13d77141765380fc76817f5c87", + "positionFeeFactorForNegativeImpact": "0x8e3f4978a3cf5cce73d79ff5773e2edb617da3267e8017ac64dfb274f7742094", + "positionImpactFactorPositive": "0x84bf3fb933429f4de132e3c58aff52a078506381c7f24020b466fccf28905941", + "positionImpactFactorNegative": "0xf54c7c49ce94e0c61f7c5038863aff7eb4a7aa1a1097acf42851ffe9350bb0a5", + "maxPositionImpactFactorPositive": "0x8fba80b3646c853ff0999394fbddf236bfdb72482b4fb1dadf6fbc81caa1b9f8", + "maxPositionImpactFactorNegative": "0x12ba189cc009055d7cb1907f44c8b32ba8b8c6a8f0359713a84ba3179420f542", + "maxPositionImpactFactorForLiquidations": "0xf630085ecccd08f436223030db10c9c8bbbf96d9b8e0dfdf97d02c978c024b14", + "minCollateralFactor": "0x44d3450628900783da0a74bb9d83b0bca2ff8504e6c4d420a2c5480085883855", + "minCollateralFactorForOpenInterestLong": "0x95ed56a404dad3b4f299ec1ce25cef2de1a828458f02787a404fff019baaafa4", + "minCollateralFactorForOpenInterestShort": "0x8f5bb4ea781f12eefd8cc65f9cbe17af85a9e315fef4cc50fe63e7471af42531", + "positionImpactExponentFactor": "0x2ad9516b4cf9062372bbb664ccbba50dff378bedfb8e9defbdc4eadab8306d1d", + "swapFeeFactorForPositiveImpact": "0xcd711380dcd676e0544ad089e8c882686c308f656fa651d48a0747b7f70fd564", + "swapFeeFactorForNegativeImpact": "0xfeadc380b20cab88593bd96433d4b0ee08368051055dfcfbfcc594a02a98cf08", + "swapImpactFactorPositive": "0x737c7f824ed4b98d1e563da86dd27bc6555ef0c5e3a7735a9d2efad4b87dddc1", + "swapImpactFactorNegative": "0x71533255ae7a74548b062c095bfbf28d36199e44d3481ed295bc9075f5137ef7", + "swapImpactExponentFactor": "0x1a4ce691b5691f71e7bee1bc45b36e300e1549a3ee40a24945c65d0146428e30", + "virtualMarketId": "0x3eb5746eac364208e2f9195e45b599e3646c837956a8a41ffbaa1c75bb8ecdfc", + "virtualLongTokenId": "0xd923fa1e30d3730f7ae064ccdc6dfa814534f0e8a5cbe1eb5f035a80ddaa2843", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x1CbBa6346F110c8A5ea739ef2d1eb182990e4EB2": { + "isDisabled": "0xef9d3de546fd33f13d39f9e0e49e9ab2c0bd1fc8e5d6c1490a40a8803f56457b", + "maxLongPoolAmount": "0x0eb205be04d5fffe0321faac1d13c78ff6b6eebdb93bc58aca321fd5504f92ab", + "maxShortPoolAmount": "0xf1bd2e9819a756bf388aa0508c8a28c93d8d07ae738f1b752c7d02c25e04a973", + "maxLongPoolUsdForDeposit": "0xd36217e92178e4fee13ff1d3a3a2b7af92b48adea8448e8491ad78fae6e45f58", + "maxShortPoolUsdForDeposit": "0x2cb3bf88d0102c24b25375930a7a1dfc4eb0162880c7478aa8d77f854ec369e2", + "longPoolAmountAdjustment": "0xe32de65889fed6ae7dd25a65e96276abb215ff2a287b4adcc0dcc2eddc9eebae", + "shortPoolAmountAdjustment": "0xf02c09739d49303805d645434dd3e4c5a6d2f70587ff7a53c7b0d36747b56a5c", + "reserveFactorLong": "0x5fa5fb4a664608c4fcc52f5db846d70c0f1b327816ca3b1da3789dae20cd7d06", + "reserveFactorShort": "0x77cf584ea7d32edc66fe17b14cee220885107de50d12af6f7718d47aa64ad321", + "openInterestReserveFactorLong": "0x7dc5ed8947657008db74db38a50bf5decc638e75627a758dd00c215a4c057594", + "openInterestReserveFactorShort": "0x9f690340546c6de2e4f6876e6cc5eefbe737dfc4b983d545ab7ed071a60e3fff", + "maxOpenInterestLong": "0xdb713883489ef68a34f4265dd67dd8ae5a894b561ab97190707af7bbb4ed53e4", + "maxOpenInterestShort": "0x655f2ec62f3aac30b58ffd5344166576a5a3dd61bfe932698b513de2e11c500a", + "minPositionImpactPoolAmount": "0xcc5572591a70f9b3b9a438388a3148d2682011bba8b7734d0285e0f400242535", + "positionImpactPoolDistributionRate": "0xc255e87804e204d36c244b34aea0a1f74975798d0c2ffe5bddb5d0b76dbf3e4d", + "borrowingFactorLong": "0xeae7c5fc25204d7315f878e1249ff67e2db2db5c2e7d511a3797202d094cdf9b", + "borrowingFactorShort": "0x0b9c3b324f415e7220a099bb10376b42f387881c105248099dea22fa038aae1b", + "borrowingExponentFactorLong": "0x6f25bc5c85281ea16831a7735debede39dd3e75a1414e60d0afd258483a058d1", + "borrowingExponentFactorShort": "0xfbc607c98f9164a2ca729b8b1820149cca58ae35cf5f30e25dd97c4d2f4ef02d", + "fundingFactor": "0x402b09ddd11d6e70990c40bbd8a89439b9d2b9ff7bd0de5d89fdc4319b953ef8", + "fundingExponentFactor": "0x692d7e1e2473d5a267e4ff716317b0a8aa117cf37bd938d22212e6ff3d4a9d12", + "fundingIncreaseFactorPerSecond": "0xbf9f749b412d9d0fbd0ab1f782c5d94189754c87aeb82e25f2f7a7d7e7650614", + "fundingDecreaseFactorPerSecond": "0xa34c615cabca6cd973143be3ec4ebd4c1888a75b12ecc88f55b588de1327a8e7", + "thresholdForStableFunding": "0x11436632bc7f0e17d051650f498db06367baac4d2c5c42e129173a7e1e44c2d8", + "thresholdForDecreaseFunding": "0x4166e1cf33010f2ca643b2acecd79a1933d7691715af21db029b228449bc7613", + "minFundingFactorPerSecond": "0x13ecc4bbaab7ad05006595e65d421b8e16dc8dd254cd4e2b98efa38f6c2f4e3d", + "maxFundingFactorPerSecond": "0xc3d8ca914f0cc679122fb0f2cf851dd828b598d7d60d3b5fcc56ed86d8cc33fa", + "maxPnlFactorForTradersLong": "0xea0ab7ba61168c2bee279288a503df6416568c2bbabfa80fe953fe824954d628", + "maxPnlFactorForTradersShort": "0xab9ca42c0baf668370ea036fec734f4badac8b93f7d98bf8aca0c7bc53e3a100", + "positionFeeFactorForPositiveImpact": "0xe5e2c324445803bae980161bc19f60163527312fb3ba12a69c42ac9d2d1ce824", + "positionFeeFactorForNegativeImpact": "0x3c8892db6ea33607529e998daf052e2d7631399762ee3d4ed1dc0ef43290fa54", + "positionImpactFactorPositive": "0x3bea7fd67f7eb844908e5e28482f18674e6bba80493bcac40694608c91afb23a", + "positionImpactFactorNegative": "0xe6d8bca55d639e4693467c4031793f201d42fb885127ca38006b4948dd7af1e0", + "maxPositionImpactFactorPositive": "0x4263f2ff7af12d6564bab215180503848e8bbaae4bf39c4e6e4e5d73b9a8add3", + "maxPositionImpactFactorNegative": "0xf398b3bf767ae253c3dcace78389d530c601ae67be971378528e0b5a0bf2164d", + "maxPositionImpactFactorForLiquidations": "0x8fe8d9a666bd04e67d114209c1926e70a58a132db2beeed4177f31ae9d0318c3", + "minCollateralFactor": "0x6a8d715582ce7a436f0926fce0f99d60dd260a473e14babbb4560315a488cc1f", + "minCollateralFactorForOpenInterestLong": "0x6d844c42863e83e23fa960ab45a1a5696e1be08fa1e4e772366172c0ac93229f", + "minCollateralFactorForOpenInterestShort": "0x47f7b3459fe7e68075e8c6444215e21468de24ee4f0fdb3ddc04af016f6755b4", + "positionImpactExponentFactor": "0x6193f8d462c3326bc8cb666374837667c596f93cd996cffbd81668a636843061", + "swapFeeFactorForPositiveImpact": "0x2fc46450b98092e9b66e0bf7696ce02d4c833be88de497cfb915d3f39e3812ec", + "swapFeeFactorForNegativeImpact": "0xb37a74e4f029bbab4db5c9a9bf086565143dc8e25ac8cd13909d079fb770d4c6", + "swapImpactFactorPositive": "0x027553df27e8e9b5a65bebc5f963f76e85ff58fb8d9c1ae933ca099379ca4b60", + "swapImpactFactorNegative": "0xb75f6793ffd5ebc77458bcfe941d32c2939bfde678876cb5795ef174242a34fd", + "swapImpactExponentFactor": "0x3db9029b93780175fc0b831246129f3a2dd55c2f32d7f03ec0802bcd1e83a748", + "virtualMarketId": "0x682b13e4eb57bc482b33cd2f48a9c3fb262fb4e645cab8fc718a866f7ca7b83b", + "virtualLongTokenId": "0xe72465f260a5f100354daa20326f641873d2ee6b58b8697cc900105b58981005", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x248C35760068cE009a13076D573ed3497A47bCD4": { + "isDisabled": "0xc449d45abeee4d6989a118918991b90297b8d25be5f150def433ac5820db5c7a", + "maxLongPoolAmount": "0x2d3a492a72424d4c7c13344dbfadb3801d77685becb19c822af3e9659215e0e4", + "maxShortPoolAmount": "0xc2a2520a542fe97f34a8ba34761ece112d54b5db49bb72a95bcaac6458b37eee", + "maxLongPoolUsdForDeposit": "0xeb0b25ff20dcb6801b23043589e08010abbc85aa8ca517067189f2569ae22da6", + "maxShortPoolUsdForDeposit": "0xbb56a9f5e5053d96ecb98e2a6507f2f74c000f96604ca9f37326d8536a37190c", + "longPoolAmountAdjustment": "0xd535d0416d824c2dcc75fc4cc6b705dc005edf148655cd9b8ec8585aeb1c0854", + "shortPoolAmountAdjustment": "0x016c2dceeceab1f9efc9a0bc5c55cf2b03a64037ad77b48a338ca9f77f6baf4f", + "reserveFactorLong": "0x4959cae4852bbe7bd7098d8d537cedab036f12956dcf55cff8f76909d2200957", + "reserveFactorShort": "0x0a318dc81f7f1795d47da970a606c903326ce7087b7d836132a5fbbeadc57418", + "openInterestReserveFactorLong": "0xfdae1f05d9d02268df647c589fdd9aea9bfd69872a9891cd4f3b48a153386d53", + "openInterestReserveFactorShort": "0x4bfe61793ed50a2747bf5e51550d82249ebd9fdd1db9c4d4fd4d1ce217254949", + "maxOpenInterestLong": "0xd8871f2955e887876d0c65f23dac9a4100507af1dc1adda8fdefe91807631ccd", + "maxOpenInterestShort": "0x9c126025133b8ff440bd5d6c26296c2aa54e674b5ecaef544e261e445d320147", + "minPositionImpactPoolAmount": "0x718462076049eb871c946a1dde912d437fabc92ef3a7eca7abae97006da05157", + "positionImpactPoolDistributionRate": "0x5975f347f3ba1f9592f650fade4b4d417f99d3e7f7427b69a4047ad6ed8266e8", + "borrowingFactorLong": "0xb682798d304203347953ed92d82b32d6e4c5042f388df81b5b5d7a2b5a2fab14", + "borrowingFactorShort": "0x3e62195b7fe1a7dd3d7f2e020c0017ad656401f9182095bff1da06eb629072dd", + "borrowingExponentFactorLong": "0x6ae1f6eb2950a60f56ef0507698007b27c2743f50c6343dbdb64686f1e5935cb", + "borrowingExponentFactorShort": "0x20a562f14a3cfcb8040992bebbb424cb3d905dbaa0a4829f2359c46f76b06b0c", + "fundingFactor": "0xece3b641944681dae45bc9aee4e7c75ec015b7559a56849fd1858024c59dd92b", + "fundingExponentFactor": "0xd4ecb89d1f2b2ffe3e4c7971c77e3859fe1a776afc086fd6a1e7fdc00b7d45f8", + "fundingIncreaseFactorPerSecond": "0xea4cdb244fe76a9d01a1bc6d0dabf6d999a9a180725999ec393c6fe27d8fb1b7", + "fundingDecreaseFactorPerSecond": "0xd35971ec977cd8bafede1f8dbbcdc32f755bc76427538fb6fd45153dee937662", + "thresholdForStableFunding": "0xc4c912458efa7f5b518bee2eab56d7dac6c8f14604dee5c00950214836cf12ef", + "thresholdForDecreaseFunding": "0xb940efbcb9813eb825f866f95f0350fde86663083329d20d12d03d4c8d44e3ed", + "minFundingFactorPerSecond": "0xe84b4ce3d5f88c3b775721bca55580ac828bea2bb85caed7f03b8d3b3eb4aedd", + "maxFundingFactorPerSecond": "0x55069748b013aeafed958fcb91ec1fd542ea8544b742f6eb55c55776ac9f35dd", + "maxPnlFactorForTradersLong": "0x8eb7ba2e0073ed92d420187aebffc7b087a92b226be547ff071f08274a0a4bfd", + "maxPnlFactorForTradersShort": "0xd16159783f2f3480377b1016b40459ce05c08c5dba1055f792df1a4244251f45", + "positionFeeFactorForPositiveImpact": "0x0c5805974efe868ce0ca027b4a7633ad68158550b1bb97bc30278ebbf228c14d", + "positionFeeFactorForNegativeImpact": "0xdb16d4b4d8013bcc93d01321c277effb94bf6b8550cc8344b7b66819a29638fb", + "positionImpactFactorPositive": "0xb11d8986c9d5f1ddb9a54c87c508436447121d439f07f9095a366cc5cc07527d", + "positionImpactFactorNegative": "0x37dbbde80316028bcc42ab769e2d1dea559042641b0ef5e7e8b2c9bbdc92d21a", + "maxPositionImpactFactorPositive": "0xc48d8c6bc423b09532b41f9989b3379cf2f045332ff8653091fe4d7269132d16", + "maxPositionImpactFactorNegative": "0x56c740c2ca614eab1d549b7bb7a4f6288cf040a585c97ec247670cc345d4ec91", + "maxPositionImpactFactorForLiquidations": "0x73aac72421893e1c0d682fad9aed3749e082ff69084394c9acc9b4ed0a0cc3b1", + "minCollateralFactor": "0x5b9cbe70edfdfea83201f44a0f1c912fb82a4a1ee106f9a3842bb29cb5301035", + "minCollateralFactorForOpenInterestLong": "0x2a50bf17c53f122cad04b207535a3c74b062687e8c8f8657ea2f927b501c1062", + "minCollateralFactorForOpenInterestShort": "0xff365ea9e77f3aff0dea18e392461b9ca0e3b42051708fa32969f77d5ca76b87", + "positionImpactExponentFactor": "0xd0d2c3fbe177c70b48f1f2866e4a15ccedeae13f3e7c96726a6e367325a045dd", + "swapFeeFactorForPositiveImpact": "0xf9e19bb3189d432360663917ab7316f9eb15e32ca0fc81158e76cdcd51084b52", + "swapFeeFactorForNegativeImpact": "0xe5f10a8eee33843ebf12cef81e4141d649bfb8c2584c80c0fc1e71d1e32d0d0e", + "swapImpactFactorPositive": "0x51f43de19f522a77191e09d4d845cabc4a6b411ed843bd7333c97c0dd2a1e99d", + "swapImpactFactorNegative": "0xdb943b0a66e6c7d34998c8e3ff6ce90d1f79df2b550aac083000d80ca80b1277", + "swapImpactExponentFactor": "0xb4650d732840a970384403281dae1ab9569caa614bb95e82e845e5dbdec3f3ae", + "virtualMarketId": "0x682be80fbd5b14f1b05cbea1a5e3eef02bf3a52c7e8f908903d6eecf1e1fb093", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x63Dc80EE90F26363B3FCD609007CC9e14c8991BE": { + "isDisabled": "0xda6f27b51a3534d74643ce6b7a83acd8431d25bf81fa09a1eb20a4127d66ec24", + "maxLongPoolAmount": "0xef4f443f8d8a3af9a00bae8337664ea49126512f0491158bfda4d294b877842c", + "maxShortPoolAmount": "0x624b26cd3400ca82e218997da9deb37a448529d324d656b68323a0e424da479c", + "maxLongPoolUsdForDeposit": "0x6d109b65036ff66f517f9dfa757532b95fbcd02537c4594275450f6aa86d1e2b", + "maxShortPoolUsdForDeposit": "0xfdc403c04d446af9e5bdc81dc5396dd557b75575ab1414c7103fce0c3423ab5c", + "longPoolAmountAdjustment": "0xd3dc79af22d17188c7000d4b955bdd47c3f0842765c98dc4f0967135c08ef9e9", + "shortPoolAmountAdjustment": "0x1ba76d3b2bbdf19d17c0323f31ec835f4fc62547c764f8ada71b925b4d8ac823", + "reserveFactorLong": "0x3d4877d86175f53799446bb2b013b6aa134e5859247ee3408c0daf972c085db5", + "reserveFactorShort": "0x2a522e9d2efcfdca342e80206ec9f2142da2480000caa9d81a292ce75166fe70", + "openInterestReserveFactorLong": "0xe6d0736ea27358e0c989141cc0613863ec26b60db37d0eedf1d287d080500881", + "openInterestReserveFactorShort": "0x2733f6a71a470306a4b4f2e843ca4af613b4e68cfcc66cadfad93b72ffc9eebb", + "maxOpenInterestLong": "0x9528a62c5206eb8d9e2e2db3d73ce6f2421d9fc349c20edc836d5101499875bd", + "maxOpenInterestShort": "0x6ad150f244fe2d3246e42a80487e6fde8444ac3bf6051fc80b78a6fe66bbff67", + "minPositionImpactPoolAmount": "0x7830b72edfdf54dacd2b318deeceb6013c57d86c7c978c5ed21cd0eb9018e3fb", + "positionImpactPoolDistributionRate": "0xbeebad4363d64226a2844b9e519e11658d57ab47c0dee05a723d71bc8814f912", + "borrowingFactorLong": "0x87a38100c055e9fbf58f95c1c789a3c595452c7590e11b8e3baece9ae661fd2f", + "borrowingFactorShort": "0xa7f2577a57fc42029a6db69e9c860ce1ee7a06863bf0527ed7cc2c7eceeb7bdb", + "borrowingExponentFactorLong": "0x37fd94700dce079c9cda703aab8c7bdbd64cbb35b283e3b712882321c23bbef3", + "borrowingExponentFactorShort": "0xea45a28654641df56dd0169aeb5e0053cf00c514bf2b31161af6f4b8da76b47a", + "fundingFactor": "0x2ba9f36b9edb678880a9bfdce61a9988b5a3439ec7569c905d7dde7bd5161c29", + "fundingExponentFactor": "0xb1dd6e7c119844833fdfe0f077d043a0fb4949dc14710e5be45ce4e3f33f3092", + "fundingIncreaseFactorPerSecond": "0x1ae33b17d208bf7b519b24dccafb3b940c7be96e524c2670ab5d822c08a5ddf2", + "fundingDecreaseFactorPerSecond": "0x03c5f4722a30df6ff8a427fb917aad7fb63b00de6848d2235e304df5de0fb0da", + "thresholdForStableFunding": "0x070aa65a40d69584436301e1f656e348348a25d80e223894a3a61e0ae55f31d6", + "thresholdForDecreaseFunding": "0xd39cb0b7df8f78f1c0d2f5b6c64bc423f974d17f0db6e57e201a517cdc51d7b9", + "minFundingFactorPerSecond": "0x24c4c036c8ff6b7f5aa218f5e001841c12d0337781048b80aada3c666015741e", + "maxFundingFactorPerSecond": "0x62aa103c40f4782518c92f328ea7e13953221a344bbe17e1182069e74bdccd43", + "maxPnlFactorForTradersLong": "0x5c46a769b0e6fc8e1900598d8b17673417a9f295712f0839f2ba621fdaaa1420", + "maxPnlFactorForTradersShort": "0x3157f0b83f7f288d4345b32021f8625dd0211a0bb3a856869d8449883481df51", + "positionFeeFactorForPositiveImpact": "0x8e1966a3f947cb6695cd3294ede56aa8667a859843a47c8a1dfa15355ae302bd", + "positionFeeFactorForNegativeImpact": "0x3d52d46103b4fd7fe8a8d527bf5a484d3950554a42a2879766c90dcaf48541a1", + "positionImpactFactorPositive": "0x7938767f73461676c26d5a862999ac1f38ce4efa8b026f6ac6b1e8df69c4a8f7", + "positionImpactFactorNegative": "0x9028c1019ee95416ba45534f1a394daea60dc7fdd77b5320961b263773789bb5", + "maxPositionImpactFactorPositive": "0x8cc0069408f08a8a1e914d23f0bd90ab2edd81dcb73ba80808c1cb161d7f866b", + "maxPositionImpactFactorNegative": "0x8326d13e731e4a06711e304528185e6df2a513e097f53a509c44e802ebc0c816", + "maxPositionImpactFactorForLiquidations": "0x3ffd3e2d8443b5c30958a5bac0fdf3d6c024ea77777f91dea6aeaeff923797cf", + "minCollateralFactor": "0x69a941e84ede0f13d1c7a57eb687f63ce8927eeef908b0e1e8dc22f9fda6c050", + "minCollateralFactorForOpenInterestLong": "0x9a7f1df75521d5245272629ae3d633c5b1df32b56dbfb7bcb79f6ed1783f3207", + "minCollateralFactorForOpenInterestShort": "0xa3964e38e2bfad919081510f192eb40d3c12b8102f229d74230e94476af37ba5", + "positionImpactExponentFactor": "0xc59aff205787697cfac1654c750728376206127692ee4e7134bb41d79217bcb6", + "swapFeeFactorForPositiveImpact": "0x3364c0f9fc9f8bb96a1008c317d26b51f20c5ea1d1130799e4662d8c4a7bf3b9", + "swapFeeFactorForNegativeImpact": "0x305d6a42c6ccdab58c16ec512fc0b9394bf2dbdf82516c15d09cdcb76085e4b2", + "swapImpactFactorPositive": "0x6ca9dab5d892a8a0c799579aad85021f29ddde1c808da563752093e0ddf2d4c7", + "swapImpactFactorNegative": "0x0a2d863399db84d689cfdc9148b1a486ad96583764fdf636a66862500cc51b96", + "swapImpactExponentFactor": "0x081a97750956cc6250ce06858d4427b11c1f050d0dacb64792d92f18f66a8da9", + "virtualMarketId": "0x1b85db12d28f55ab49eac5c82867a61b99fbd1658d56cba37cc8538120c18520", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x7BbBf946883a5701350007320F525c5379B8178A": { + "isDisabled": "0x37f133fd29f19aa132b67b37a32cf5dd0c1fc0335feea28191dbaea391908459", + "maxLongPoolAmount": "0xe2e00fde0410deecf69b30a6ceaa2ac64cb550b2f06825bb54427657dd16525a", + "maxShortPoolAmount": "0xb13020fd6d863e44055fd2ab14e7532745ce473f1d8152bfdfb0ae956c41dafa", + "maxLongPoolUsdForDeposit": "0xdc3ead598f0d2baa900d0cae632c96696e1b8bd63b1e585d9a4e1b20c527f124", + "maxShortPoolUsdForDeposit": "0xf626f650f71f86a1110dc06d2dd20c30b798056869ebd550493ad1e18195c616", + "longPoolAmountAdjustment": "0xd0f13bb49c3ce6f4aa3b14bb6f1f3cdd3569595d37a721bd1cbc8b105ffd3bed", + "shortPoolAmountAdjustment": "0xb7105c2b473d388b9564d4cf92ebf102e35475feb34e399190e15a8402eb9453", + "reserveFactorLong": "0xe365962def257c0197c21509b0563974200c951567a224b2bee630dcc9390a01", + "reserveFactorShort": "0x9c95664de36e3b90a62a3ed43ebd43c109fbd2dd31a911033df84cb51316499d", + "openInterestReserveFactorLong": "0xb1929b4558965c059ea4c201b0958c7c5102481eb4803689a9055f9d56fc2b1b", + "openInterestReserveFactorShort": "0xd426d9733944956aa6db3f1a38facec294d237e0b2d2acec99391cebde9dbf82", + "maxOpenInterestLong": "0xe3040e174b457b6f16fe1c15a92b50d0fd1edcf8387c9db092cccb2ae14bf965", + "maxOpenInterestShort": "0x35a7856186177dd2008b0fdb956b6904d109724c0b426af18fd17c09048837f4", + "minPositionImpactPoolAmount": "0x80a2f4bb28e340abfefdcf3c9e41464c4951363dc6d9a6e6fdf4f09e4f1187c9", + "positionImpactPoolDistributionRate": "0x668c745190d2f5070714958681a329d1b73c95c402f1ca1986b1d09092765d05", + "borrowingFactorLong": "0xd5e5b22167c99e5d9aee4032bb7c8f519219bb4a6680f0877e3b052a0f81729b", + "borrowingFactorShort": "0xf9d28a58b5ab4c0b47a1382588fad47e7a340bfbb8464abc8bd16901069544c4", + "borrowingExponentFactorLong": "0xc1520be0b79841918b653d8d2c162f5c86850514ed0f594b8cb94ee2c63abea4", + "borrowingExponentFactorShort": "0xbe8b6d833a170eac0fa29d6d07060f35561e64f5c7068ceb89d2c33e7a8999e3", + "fundingFactor": "0xe3eee9e2a35c490a627a465c9829cb1e186f1fe8fe8cdd85e1eaab65248b7867", + "fundingExponentFactor": "0x9f51caeb1c1fbfc122ddae0ac2b6ca923729046910930d50bd4812e2c584eafc", + "fundingIncreaseFactorPerSecond": "0x72c0b098bef9137aaec1c66adfa6394e31cbc5f3ebd56eefff4e7f94f501d783", + "fundingDecreaseFactorPerSecond": "0x0edc5e78789167ae6f0f987c4eede5a28ad9c03efe9b3b660579458966d4d011", + "thresholdForStableFunding": "0x7a61b093118e29c58afdc7abf588441554ef438d4b2fc030a707f307d42b420c", + "thresholdForDecreaseFunding": "0x24720246bc20a5fbbff33b5f4c286c2a61a0b38e5fb3f492cff4327e544f16bc", + "minFundingFactorPerSecond": "0xe48176d45903cb6943e6090d565d426f8cf3106d2f209e5dc65d5d239718fbb8", + "maxFundingFactorPerSecond": "0x2e363ac3de945f9e347a42944c7ddc509c53f8ce07b05316181a4834368d4af7", + "maxPnlFactorForTradersLong": "0xc2b6ba297e2818e9751c3039ff2071b2ae3b4d72dee96205fd6c62cc9545a5ab", + "maxPnlFactorForTradersShort": "0xa7db2c7ecf2ff216c4276556a88d852ea7296c5da8839673baa4f00f17e708c1", + "positionFeeFactorForPositiveImpact": "0xd777c5b4d55d87e7a3876930db0af4b021a643cfa9070d896e77bda6b5681d6a", + "positionFeeFactorForNegativeImpact": "0xa94fd16219d3c4b400807acb21ef6ac91bb6f1870bca3cb5ba5a19dc4f6e6c9c", + "positionImpactFactorPositive": "0x644525ed476f4be317620be6a478b562b0de82d724dbced4b69c638ebdfdec79", + "positionImpactFactorNegative": "0x1d5d8012f2837929e603657bc2d70a612947a3a1926d332e48e709b209d90f9d", + "maxPositionImpactFactorPositive": "0x5319f499876d4621e715dc632e7d7cb3933dc765ea1acf8d430e17a55393e986", + "maxPositionImpactFactorNegative": "0x7e416f0acea3cc9622087968a015c15cf9a9039935214cbd69d6e7a2059f93fc", + "maxPositionImpactFactorForLiquidations": "0x1763e966632029c1f297e56d1a17944619af4ac6276c6f897ecd10bedd501f28", + "minCollateralFactor": "0x658da6dd132bb7e1756b246c646e4f3681462f841ea26f37d83a1bc7a7c640af", + "minCollateralFactorForOpenInterestLong": "0x5b29bc756da04509ebef8e49358a85e1b080ee9d9b19f646413c7ec366643c4f", + "minCollateralFactorForOpenInterestShort": "0xc386fa4fcdecdfd9ac1d63b2d86d391f4676ced1e3ddb89d47bbb629bfcbde6e", + "positionImpactExponentFactor": "0x2214e49931ae131c89d827b277789c69bccf736319f9448888c99ff753982a5f", + "swapFeeFactorForPositiveImpact": "0xcf099a51e285d31b3ded24bb284f311662deae9715dff06251f99a1a623a7c01", + "swapFeeFactorForNegativeImpact": "0x54f7ac0acaf50fddc48a4d1687ef164394bd31f48441c86b9fea6d348f7d83c8", + "swapImpactFactorPositive": "0x004df3c0dc3d5b0aef8045ddf6c7170646212a2708d9c8efd90d42aa68887f7c", + "swapImpactFactorNegative": "0xddc46fbfef1ad897fbe83b4250c0e21dc33408f6035ed37f98b4349cac818569", + "swapImpactExponentFactor": "0x923471186f28cf538007fd535bdbd75f7378d1331f6d07cd2a40276153e34550", + "virtualMarketId": "0x4e2463fdc8eb0e623472d4e6fb67440aaf8b50db715ff81c918dcf0a9b4f6e02", + "virtualLongTokenId": "0xda567314a5104c9d1832b3d80c0f411685db2478bc7f0a7d8c607bc4aff2bebd", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x4fDd333FF9cA409df583f306B6F5a7fFdE790739": { + "isDisabled": "0x47ad9d41bf78222568388d91815ca45d33c3fbce708dca956a07ec40e9ea1863", + "maxLongPoolAmount": "0xf836f86fa333377c6707732974778aec73b1507698d794308d3b34ec58645bfc", + "maxShortPoolAmount": "0x9e9ae241036832a5f184407c222b31ce65f7d0e7a4b3ad6d93fe139c23860f29", + "maxLongPoolUsdForDeposit": "0x3b24e4ea1aec213c99c0805eae35b42e6a1dd86fc0f7e1efc5cf87705a663d29", + "maxShortPoolUsdForDeposit": "0x376edf6873a9adbe218f792fb6aef0c132027c432d0ff76ccc3768f2c185680b", + "longPoolAmountAdjustment": "0x8402bd23f34524aee932454a15615f4d39ef171d9ec562717b3d685bcdd5363c", + "shortPoolAmountAdjustment": "0x22d2937d5327e4186b3ac8774aa62d0bcfdf407c4880ee9f3d94c7d45d5668b1", + "reserveFactorLong": "0x7287a470dcffbc2c5bda4769185c34e3cc00aaa207ec5ec36e1a88d208768da9", + "reserveFactorShort": "0xab263cfc97448c25c573cf73d610deec79616a03f09453de76d7ba5c4bc3e014", + "openInterestReserveFactorLong": "0x38f702462a67b9ca1b107dd2f00691b13b5b5955b7fa9b67d12834f820f4d111", + "openInterestReserveFactorShort": "0x826fb0b70b6e3de63f99f5f72da87b5cb48a186b7c3fb5d709853f60390c123f", + "maxOpenInterestLong": "0x61e01b267458cc968860c92409fa2cca8853647c5e9787d947de3ed8987766e1", + "maxOpenInterestShort": "0xb6f6324e8cdfd5818f1fd0fe060723b0036d87ec2e813a087227ed582b114075", + "minPositionImpactPoolAmount": "0xc467e76d4300e0e8e9a56e529821ff275b89679ce46259a9285ccf5bf7517e3a", + "positionImpactPoolDistributionRate": "0x7d3fe5c201f9185d7a79278ffc597f92641721f2af8298575fe33f3854ac8779", + "borrowingFactorLong": "0x583b47435e1df1ff8e2a38ab3dc231b18ff08fcee84c6b600ffadf2b477eeabd", + "borrowingFactorShort": "0xc7b8317a43b73cea0c701cb8ff3fc84cefe124c519bc0ad4628e467385206e82", + "borrowingExponentFactorLong": "0x801c5dc9e50967b6efcdda178b5ff7c171cc7dc9eb1e03698fe1bbb879922cba", + "borrowingExponentFactorShort": "0xc3574e8f83495d3499a0a142e9663923a6c3fe74fd9e3f9461ba42f3de1eca31", + "fundingFactor": "0x400a02ae7b4fd8a9caafdce19846ebe8a338c85b046b0f0dbcc9992450b5d5ee", + "fundingExponentFactor": "0x24f460306ac0916b9bc3b1a05303ea3378f99365963881f64a11e66e149fa9a2", + "fundingIncreaseFactorPerSecond": "0x42c227ccc3735deb22ff7dac82bf7ff80051d7cb4439ba8d0ba3dae6a63aa519", + "fundingDecreaseFactorPerSecond": "0x3579768cea1b1400c472249b201450841a1da809ff1cefa88a4090f0a8440ef1", + "thresholdForStableFunding": "0xc37bac6412d0b30518d860bd87e0281aa07b41066e61e67bab9b031247c96a0e", + "thresholdForDecreaseFunding": "0x2e231aae3d887f1b876996cd74f40c0a388a5d1acdbfaec0603c47f160152f96", + "minFundingFactorPerSecond": "0xb32b4c131f8165df98626140c44a535fa403da1f06ded732498d7b774f366cb7", + "maxFundingFactorPerSecond": "0x600ebc560d5b1d959a5561e38cfc1e6fbafa3f74e4b84d3c77c000003913420f", + "maxPnlFactorForTradersLong": "0x48fbe5087841455da95914af5afadfdb9bff2c13381ddd257abb5a01860d302e", + "maxPnlFactorForTradersShort": "0x22cd9499d49aeaa2f91b64be08489a3ce928b8022d46363d16d60d459b0d7f94", + "positionFeeFactorForPositiveImpact": "0x97c1a448f396a50ccc22e2ea500e54434962a5249dc5a661d06658985ae59383", + "positionFeeFactorForNegativeImpact": "0xddf9c6e8a3146f2034501e798506b8a353893e80b3de3748c74b87532f824982", + "positionImpactFactorPositive": "0xb906177bd22906fb4855b38744d7322883feb6e061495886d5c12d0b8f810ccf", + "positionImpactFactorNegative": "0xc75f07b39b2aaf3050d588849ef734198cff5801bfa21c4559b08a95e281f72d", + "maxPositionImpactFactorPositive": "0xe38a3799bc01e41c85e5fd8df2d75f32af5e85731835f96bec4cc30adab2fe75", + "maxPositionImpactFactorNegative": "0x409c6508fd9685bb329819c23f0ec5e609025de5ee993837362348919dfb86b3", + "maxPositionImpactFactorForLiquidations": "0x49704998ebf84402cb8e86f8e617cfc500631b77d9589d637e25350c84582f29", + "minCollateralFactor": "0x99b3701cc7c1265785f49ccd881b41099fbe598b8eec779a1cb9f9d0ab47c538", + "minCollateralFactorForOpenInterestLong": "0xc711c4d6d1307e7c53adb1d3e70e48374818834facdddda9f3aa07ab3b84b6eb", + "minCollateralFactorForOpenInterestShort": "0x43728b39e120b4a41ea9f74f87206a5de82c1fd6020b9c20e8a12becd690628a", + "positionImpactExponentFactor": "0x58ff383b5858a0568214aa46f74f6c6acda40c2de4e119a9fc703e6e9f883533", + "swapFeeFactorForPositiveImpact": "0xc88b708cf46980ee7b53f2d31c02cae3f4097451afe3d262d1ae325896e2fb2f", + "swapFeeFactorForNegativeImpact": "0xae26f90162d5a9dd0c751088ef6e3d8ad0a4e4d4296c92959aecebe6eba55438", + "swapImpactFactorPositive": "0x9afe4fd264c1db9a7311ade7ccd92b9901cda321ff91dc4a544e60e9aefdd403", + "swapImpactFactorNegative": "0x24b8ea4213ef6ea1381eef1d22c8be6e6a2776542043f94cd0b75451e722acc3", + "swapImpactExponentFactor": "0x4436d7db87e33e8caf71800781dfda7be283203615038a5bc6bad07cdfa8ddeb", + "virtualMarketId": "0xdcb08bed475a372d58c8d4a4106e2d728aba9f394a7edbbfc9af501300fa7578", + "virtualLongTokenId": "0xa7a9f75b7dbea0c14f881634e911f467cea6ed6b8b309892a16f6bb88196f4ac", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77": { + "isDisabled": "0xb8a7e23fdff208107a7b26cd4d279087bc702bf105aa0465a7b207bd59f7ed13", + "maxLongPoolAmount": "0x84654f983352393a35235f362b8e4416978a11bf9f7e392453fe8d9094f878b9", + "maxShortPoolAmount": "0x84654f983352393a35235f362b8e4416978a11bf9f7e392453fe8d9094f878b9", + "maxLongPoolUsdForDeposit": "0x3afcc1a93aafa417b7ef751cc7467d330c8c473359b617e2d77349fd4a8f7043", + "maxShortPoolUsdForDeposit": "0x3afcc1a93aafa417b7ef751cc7467d330c8c473359b617e2d77349fd4a8f7043", + "longPoolAmountAdjustment": "0xf5eba6d704dd5bcb627dbb0dc30172dccbd254c52d089a71f66b2633d4ff248b", + "shortPoolAmountAdjustment": "0xf5eba6d704dd5bcb627dbb0dc30172dccbd254c52d089a71f66b2633d4ff248b", + "reserveFactorLong": "0x4ff0c4325193101a3ecb3950dc5b118ed1a07a2455a54a2e2e35d73f679f226d", + "reserveFactorShort": "0x6f311634950b830983054fac96de7c535351c97e9efdb5324e3365caed8db4e8", + "openInterestReserveFactorLong": "0x0ccbbeb76e1a4f47e17937cdedffb4963a02f6379cafc9fc56d7ea9bad2cb952", + "openInterestReserveFactorShort": "0xaafac62da9c69924c5a550f5dcef997c973f8cb79835efb71b43e0be043bd63e", + "maxOpenInterestLong": "0xcd504f5f40fd13f357d44c42988b854a9de30b201e5bb082d58327ef9a02018c", + "maxOpenInterestShort": "0x7661ed2388284d70ec7fe9260f0836f77002653c783ee0243740d60f05c5d67d", + "minPositionImpactPoolAmount": "0x26ae3b832d2753124d7cf74fad467e7b70341e56578ebc5d136ba8de2e8fa11e", + "positionImpactPoolDistributionRate": "0x04313f4c98bb35d9e64eb471ef94eff7fb769e0204cea09027bd90618c2a26fe", + "borrowingFactorLong": "0xc3e7ec50fb1ef19ef013db0523e60513369ad361f572aaa9b10968930c121837", + "borrowingFactorShort": "0x7c14bf81fda21f2512b50c441d0b986fdef17273b7b8d7995ba00188ab40b616", + "borrowingExponentFactorLong": "0xa67201d3c5d9d198b1ac3bab37696e5bd5e21f22957f0c9a14bb670251db67f9", + "borrowingExponentFactorShort": "0x26c2d60666055e27160ec2e0664ad5e4863dbd939d7ef27a99b7c12b663ab4c0", + "fundingFactor": "0x0b6b206951154da2a2e46e7b47d1531194e01060b3169f98384599bbbd52d5a6", + "fundingExponentFactor": "0x8b8f0a001ccbe2090fef54d99f3d2cd12555e2012a8c533e3560fd8113de92aa", + "fundingIncreaseFactorPerSecond": "0xec0df726bcea04f0c32b519b29f76067a8b5348a3ecf3b8bd25f44137872c761", + "fundingDecreaseFactorPerSecond": "0x66a133104a2afcc8d693b474615df610474a1b8a44a4efbf385b321177d87ca9", + "thresholdForStableFunding": "0x86512217c5ed5b22b96b799987bac827cb91e89f1a623d088e3b1b23c32ed663", + "thresholdForDecreaseFunding": "0x85a8ee1afaefec0f69cb55aa6aa42b6197e915f3364908372038841ce07bd88d", + "minFundingFactorPerSecond": "0xcbd5cee538f38f56d9af56bf02fa1cdc93531e4d130fc39df18adef02f1a824c", + "maxFundingFactorPerSecond": "0x791b8aacf46146f2c630c31e87150454705394d0ddee283d9a218093004c4991", + "maxPnlFactorForTradersLong": "0x61205f138d458d410fb24113fddaf8bfb906c41a5bd1243e09a60bd3fa95e6ad", + "maxPnlFactorForTradersShort": "0xef08c3656d3ce51df1b75f08a987d879463632460692bcda68e4ef17ebac29c7", + "positionFeeFactorForPositiveImpact": "0x55eb1bd845d62653b5e99b5862c3604b078e1609942fddc47148214a9f1b6c98", + "positionFeeFactorForNegativeImpact": "0xeab5b72f46abf95fba34f585b311a74eb14eb8c40d3030aa04e806881a5338f3", + "positionImpactFactorPositive": "0x5639f816f2049a823282162b24c26bccad96430b6cc80cfd802a6e0a4daa48e8", + "positionImpactFactorNegative": "0x64b33aa4893fc85aeec723156a0fc0c151ec4e7d9e8c3f2f3225e52cdc6f5453", + "maxPositionImpactFactorPositive": "0xebacab0fccc785fffddf4ce399ec5f857e302fa137d3b3443f5a3153b5d925b1", + "maxPositionImpactFactorNegative": "0x0a64b1059a69b7fb1f5738256b5d1009c654a0343331b552b0946bce23fa5abb", + "maxPositionImpactFactorForLiquidations": "0x9f5eb4d0a87742d78eb809fd1c85d378f22e830e2155e4c130147b107606db2c", + "minCollateralFactor": "0x505fc7c1a1954b72fd3b5f7f9b5250661340b75ce9e9044e6dd11c8da2d692db", + "minCollateralFactorForOpenInterestLong": "0x7be7f22de8ae3c36d8218b44d06c5a126ea07b5bf1176ff4e90c34ccdae32302", + "minCollateralFactorForOpenInterestShort": "0x49034ddfa16113a80d2c700f7fa75fee26f684beec367e2c7d7e4f3f08320bb8", + "positionImpactExponentFactor": "0xd0316ba8768fcb3880ea8519def956514eb9bc7d1cd1d9805bc936e379eb8610", + "swapFeeFactorForPositiveImpact": "0x3097eb783f61d26eb308b82a5f390ad8a3b17605c548f16f6c22a9e4a9d4fdfc", + "swapFeeFactorForNegativeImpact": "0x8439bc00c0643f5214a648849ed64fad4e16c6fdaa17c415cec3232757a71e70", + "swapImpactFactorPositive": "0xcc58aaa5866cf4113e41fc4df9e5ee80b1d697ae5449bb1aada134f5eb228cbf", + "swapImpactFactorNegative": "0x02fcf4c3f06217571778935d3f7e97c3e8d72c50baa6e937265d4b9d3cb65b37", + "swapImpactExponentFactor": "0x68b31e362df2067ef9092172713fce629e43c8fb3ae7c604fda0e6ba18967a4f", + "virtualMarketId": "0xd8d68dd67fd4509abfc2afe7261228687df5a857867ce0a35bf860e27184d77a", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f" + }, + "0x450bb6774Dd8a756274E0ab4107953259d2ac541": { + "isDisabled": "0xa11facb99bb90360154b9cf8ddfe405e5706f36b6c435a70698686a7f2d5b85c", + "maxLongPoolAmount": "0xa6216f68f1ee28685382ab766fabd8398532ad41b358ec5ea8a3d38db6c7553d", + "maxShortPoolAmount": "0xa6216f68f1ee28685382ab766fabd8398532ad41b358ec5ea8a3d38db6c7553d", + "maxLongPoolUsdForDeposit": "0x3326be4089d11ec02c8c6f2effbfa5cdea20fbe474830f2ecbfc06d0f5cef695", + "maxShortPoolUsdForDeposit": "0x3326be4089d11ec02c8c6f2effbfa5cdea20fbe474830f2ecbfc06d0f5cef695", + "longPoolAmountAdjustment": "0xf9c13e51dcbf38a3b33d6b2a683d44a9761232267923d9aae10b7993215b5f6a", + "shortPoolAmountAdjustment": "0xf9c13e51dcbf38a3b33d6b2a683d44a9761232267923d9aae10b7993215b5f6a", + "reserveFactorLong": "0x02e5d3361e614a40d445ebdcb9ebd26d2c1e5b02afbfdbd970245343ed3f73fa", + "reserveFactorShort": "0x7d4cdc5c53db8fa5d0f35fbded84d6d05231c22a5cffb76f6b7aab0635e7c536", + "openInterestReserveFactorLong": "0xe3ddc2a7f56eda5e56cc8d3c17d6fd2e43eca0f8a295fbba518bf3fe21548ba8", + "openInterestReserveFactorShort": "0x1968626f42054ac7a49410983f9e066a4ffd6a9ea95017e2b180c0ad37c2e772", + "maxOpenInterestLong": "0xcc386b59735dffe597c731e54e9e766016b19a0f23bb9398c8a2f146548133d3", + "maxOpenInterestShort": "0x877e9a262da69a28f910737aff4813d28c59029aaa14612197d49264822b31a0", + "minPositionImpactPoolAmount": "0xf307f00ffedbd9a6096bc0867fdd892bc20afc3e2a3221e5ab8266c05ddabeb2", + "positionImpactPoolDistributionRate": "0x86f75c9ed81bb5c44f92e22d16b76f631abefe29bb9dbe2feb52ede92df02590", + "borrowingFactorLong": "0xec2b54efb298c6452d29aa4fbf15998db5e8cd939d55fe52bcd4e74381fe320e", + "borrowingFactorShort": "0xbb6dd7f5a10bcbf82f266023409a1105d99bcbddfba4b86688788e4265439796", + "borrowingExponentFactorLong": "0xc0a58c241ba74eebba1fa0b923d58aeabdb89356bbeebe9dab15d42b6ae597d7", + "borrowingExponentFactorShort": "0x0b8aefdc3e1b33d53477d528a0fd168172cb5e9341f20bc1bbf60f6411362440", + "fundingFactor": "0xbd0f57543d571720ae85b9d2490ff8c833b467c626e488362f72803492d336cc", + "fundingExponentFactor": "0x77c4955931cd79cbe3eb759c68c7bf1c26ab41bfe73d611082ae6236e66c3208", + "fundingIncreaseFactorPerSecond": "0x603ae1d9fb72eed507c91f92e2c0213505d1770b2b58a66aa13304cc05d21264", + "fundingDecreaseFactorPerSecond": "0x507e710de2e49eef3cbe99ccf4ca25036e8be5f37d4a4ae954d2c0acb4d51300", + "thresholdForStableFunding": "0xa26d03ea93138af89bcec9362a56259cd850940d09190a5f1d9219729404ff99", + "thresholdForDecreaseFunding": "0x51c0548ec8fdb71c60053ce7e421f873960cfecb15f9edf927ba08e207368a49", + "minFundingFactorPerSecond": "0x1af5d8fc73e7dd8cbe09da773a96a49c6404acd273702f7957da0ace318f3df1", + "maxFundingFactorPerSecond": "0x0a6526a497e4489cf4be22651eccc3b5071dc85cdaf2db76ebbee48f55fe4b44", + "maxPnlFactorForTradersLong": "0x9ddabf7f3e53a1821379516b58312039c6eb26b81ee291c1252ef022bc03dc64", + "maxPnlFactorForTradersShort": "0xbd9f0a0545529a2ddc6068c9d4d8c38529cab28e6dbea62d20017cdf93bba76f", + "positionFeeFactorForPositiveImpact": "0x483710f439356b530fcbd39fe35dca94e09ae68f9b42137c2426b15c7eecab44", + "positionFeeFactorForNegativeImpact": "0x9fcbf5b6ce818dc0a039fe77c3344216992a26473d6aa52571b5f9b1ebdd29f6", + "positionImpactFactorPositive": "0x6e0611944f4603e4b3eb24878be8b06c454f0d32cdbd115b6989ce8666412b9f", + "positionImpactFactorNegative": "0x6e3f4836d516e2b3c7d97f4eb14b647210743805f6625f18dc048184d42f3236", + "maxPositionImpactFactorPositive": "0xa49f2ccad33245c6c3e4e65abbc1b574fb1b260c790a598aa1607b7916af939b", + "maxPositionImpactFactorNegative": "0x1264f0fe836dba8344c27cfd30a27687f01ede436cbcb88905f3d099866aa385", + "maxPositionImpactFactorForLiquidations": "0x3bee549827b24a6c7258484153433d3e8975a38058ca8301a06274c57c12febb", + "minCollateralFactor": "0x23996b6d9b7a115e3ce89b84c1fb992e361ab8b7d0eee682f20dee97ec68ffe1", + "minCollateralFactorForOpenInterestLong": "0x35859412d8490a4c126fe4f1bfc34c55cb8fe37dfa500acd3c8b86af666c5ec3", + "minCollateralFactorForOpenInterestShort": "0x9fbb1a4f2cee065baea2f8cc6c37830cef07cbbc7a5c433a7a525949f5ecebd1", + "positionImpactExponentFactor": "0xb6bff386e5ea9af0e6720bebfdd73d88abd8d3028c1819942bcee244f2ca9405", + "swapFeeFactorForPositiveImpact": "0xaaf64b979df9faef0f42c389d81152da8e9d914ed4fae4f41a31ef0f70334eb0", + "swapFeeFactorForNegativeImpact": "0xbe982294c986c3affb4919d120c418c791a8602c614700dc2bb0ca07815e6ed0", + "swapImpactFactorPositive": "0x9fd271446b4cb4dabfda536750bd6f93b58bfb591131e601bae3c640d9609b2a", + "swapImpactFactorNegative": "0x4a7f2a5421a3eb1067a7e45de84e107fc455e79cfbf6236aa396f99272cfe4b0", + "swapImpactExponentFactor": "0x4ddfcb88742329060e7fae862f0bd237355ac1d858fc4be4928caa94ceef9abd", + "virtualMarketId": "0x418e7c8fefa6d403a9778e123defd25ede196ce24b2de6d119798652b05a2d0c", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5" + }, + "0x55391D178Ce46e7AC8eaAEa50A72D1A5a8A622Da": { + "isDisabled": "0x94a6fe2b4cd290c255255ed7e166f90e8f4a88196d0e23b835da044c6d808d73", + "maxLongPoolAmount": "0x6de39cee1659b19a7aede71fad06b802be3fcb549e54e288a6847fb462bdc5c6", + "maxShortPoolAmount": "0x9e9c9481cf518b0abb0afe32270555724613f96935fad6d208959abaab7362f8", + "maxLongPoolUsdForDeposit": "0x7163541d793ee6c014f266a3d320bafa0f22980981c6dd1c222dcba2e5e5a858", + "maxShortPoolUsdForDeposit": "0x2cd620bf307a42ee0fcd880255508abbdebb5cf5d650f658e67c2bddac8b284c", + "longPoolAmountAdjustment": "0x2a3b1c06d0773b973002f56de5b5bacf2e3be323ebbb3b9d635008c727cf53d3", + "shortPoolAmountAdjustment": "0x9f16a6c4fa9967595c0c27896865c7204bb530970fa596d03685389612f5b510", + "reserveFactorLong": "0xa919db502fd209965f823fc33320b58b98b538ad07d1f2c882521d10fcfb1330", + "reserveFactorShort": "0x7ab3d81c87f79a924973d0db364d6ea3b139307056a0d61855f1054741d7616f", + "openInterestReserveFactorLong": "0x73432956b0a36fa668a930273af2d971d936a58916b8049419cae3d7aa51e0b8", + "openInterestReserveFactorShort": "0x3a2f6f5d3897a451a92e7d1d2c128913a6640fbf46cff08d1ead005d7ec31270", + "maxOpenInterestLong": "0x679b6748fd721885de011493120c9831fd6bd2b046889503c8d28d0dc5252c2f", + "maxOpenInterestShort": "0x8175d9915a0dc2773d2fdd54e0e11c735b337b5b6330d5c45221e82d4eaa376b", + "minPositionImpactPoolAmount": "0xc1c97477894ed1a067d6f3649c9977bab6bb6adfb491e820f1c13e1d9661e9b0", + "positionImpactPoolDistributionRate": "0xb613cce94cdcecbefcd1cdd27f4b92631ceece2f032d9065e44da99b429f8483", + "borrowingFactorLong": "0x98a8e94cf7d5469c0cce611f26586c2181f9f7854e700798c0fdbad7f14d52c8", + "borrowingFactorShort": "0xc363a26032a115eb79d97d29055648de478959998f94cdc9c9e7c4a8713b6802", + "borrowingExponentFactorLong": "0x66e27f44035c8f071bd1c6b2f24fff2c4257784278cb3c07bf2c5e080e1e545e", + "borrowingExponentFactorShort": "0x3e64b34b6798d9422e4b587848a4de7d08ee0de67f64f1ac619076136b52c9e5", + "fundingFactor": "0xba09adbcdbf01313837f6d4e9a30ee1544eb365b7dcbc748fee6bd4999b312ee", + "fundingExponentFactor": "0x580df30eac40cbea65e5d4f0c7f69013a6ce1226dc2fd67a22bc2fb3bc61c521", + "fundingIncreaseFactorPerSecond": "0x08698d4cb3c66be55f620f4777eeb957f3d8bfffba11c2d38962d33a6c9afa03", + "fundingDecreaseFactorPerSecond": "0xdded7c8cd711bbfbf71f8ac4243d214af66e29b0b5ce44eb7899d116a8cf80a9", + "thresholdForStableFunding": "0xaa73a55adfb469a06d8ce438519b19373ab93eb09493a4b34b60cfe88d134a30", + "thresholdForDecreaseFunding": "0x4acdfba0d6217c8580e76bee851cd41de3927a429580aea87b55be61fada8291", + "minFundingFactorPerSecond": "0xf1fb92c5564712350d72e3db95c65ca88e50602e975932a9c9b73eaa840e234b", + "maxFundingFactorPerSecond": "0x5b6b8bfa2a902a4700b5a546209cb4097cb278eaffa6c775832110dec862dd16", + "maxPnlFactorForTradersLong": "0x7e878f228e830c2c29edf1cebd86787df291d03924e2681eb9192db2925e2576", + "maxPnlFactorForTradersShort": "0x13a5a683a8052446dd311ec4c4a537be6c046a45cdf374b87ecbd3663196e07c", + "positionFeeFactorForPositiveImpact": "0x546c33b1dba15b428da83872dde33a920eb215ff6f219683cd72ba4a26d5c533", + "positionFeeFactorForNegativeImpact": "0x8d6b3bf9f919ba71b67feb739447c6b300ac0f9f79068132584ce16c2a1e0fda", + "positionImpactFactorPositive": "0x799fd72dcd8bc0b912b482f186a074b67fdab11aec58c5fc3c09a5ab601bfe4d", + "positionImpactFactorNegative": "0xc35bd69b22ba7b4339033e97d3d4ad5735fbb434b54e10be44bac834d63d4ca6", + "maxPositionImpactFactorPositive": "0xe2991c2345da0cfdfd5b8ec9e7676658276be8890053e15fcccb194d3bf7e12b", + "maxPositionImpactFactorNegative": "0xe113eb600d7bbf5d1eecc81235c5881d5d33afb2f11d9ec2a2be8028b471a17b", + "maxPositionImpactFactorForLiquidations": "0x5837f920215e0e61cea98ec67e54f88ea6b2c37942ce77134be57426826ea24e", + "minCollateralFactor": "0x36ab3e3013ad52ba6a0d8f4a0453b7102f49cac48a2a11fa6c73dbe0aefe816f", + "minCollateralFactorForOpenInterestLong": "0xb53e1f7357d8985ac911799567e535ae47b4b735a3aa570d896d2675c5ebb6d9", + "minCollateralFactorForOpenInterestShort": "0x24518edda98ceefe82f1204ce0f521627a009586216d80895e53abfe2ecf184a", + "positionImpactExponentFactor": "0xd0f2eee3c7933f4cd4be61e89645e29cc81fe2e6b8182b4622055eda40e77d48", + "swapFeeFactorForPositiveImpact": "0x95cc059a74ab0cc2d211ba23f2332e2b506142a89fddc54e2006bc3f35931464", + "swapFeeFactorForNegativeImpact": "0x4771d81fc424f4ad1751f397a8bf3cccc268f477d6a35c745a0e9d1841e1027b", + "swapImpactFactorPositive": "0xb5f17a97f65ee498fdac7f1788550bbd6a729107081de95c3890c697fe931481", + "swapImpactFactorNegative": "0xddcb4f9e4b88feb61b957dbc5dc0bd03435c471d8ab9c3c985699b0cad17ffc2", + "swapImpactExponentFactor": "0x83899b2c9cd5391747c3988b8797dda3e5f3189c446c3f43746edd33e6e4bd1c", + "virtualMarketId": "0x0f02984b3dea380f61ec0a6c8d7c60fb497a489eb055b2d95d8ef2826282fb45", + "virtualLongTokenId": "0x383a0fdd5ebac620fe9349688ff6922600f2d5659c01c204e11f3181114b8700", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x2b477989A149B17073D9C9C82eC9cB03591e20c6": { + "isDisabled": "0xaf38c5d82180c4b155871b090949249989b70acbec4313eb41845a1061f0d644", + "maxLongPoolAmount": "0x08211b0d10f775c70fdcb9da260fda3079b206a48eac26c9bd4432ff135961d0", + "maxShortPoolAmount": "0x3d160932eb28ae21446ad1c8515556b1daa7235052f8f68b5623d411259911ec", + "maxLongPoolUsdForDeposit": "0xa3778c6c0133d0e2be190772c78dc34e0bbabc486a1e09155be4f14e27ac13e5", + "maxShortPoolUsdForDeposit": "0x4e600770e19cbc36cc0c9b1810745d875e229ee3c3512e3f0bd1ac460c6bfbc4", + "longPoolAmountAdjustment": "0x93b2ef5691e06ece3fc4a84a97d3f7f25a0eb2905fac34e3376a37c89075f1f6", + "shortPoolAmountAdjustment": "0xef8a3cab8bfc23c73eb979dd9a95212376f0defb55d7eb0107f824091f223148", + "reserveFactorLong": "0xa67c17f5ad9f9c3a670e6ca824fd553e48a0a87ea1627b399e15d102d084e2ba", + "reserveFactorShort": "0x1994481d5f277f989af8d002caa26a8ec31be4ccf63be579fe70db2c78b534fb", + "openInterestReserveFactorLong": "0x17cf1d8fbb84f8e10546a951b3a2ce8d217d879959cfccb31305e435109868d9", + "openInterestReserveFactorShort": "0xcca8553319979a9971eec5cea944f20462154d845e7c2203c0e1c3c777cd7b42", + "maxOpenInterestLong": "0x116859648842e833cfe05ad1efbbd4a4cdf3f16bbf87240e0c13c9a6e444bebd", + "maxOpenInterestShort": "0xf6eb813b9b564a94d18f2649bd3d8e09681855eb97722a4647bf13a3315f5c3a", + "minPositionImpactPoolAmount": "0x828b70cd2feeb4c23dd24eff9633c97581ae1d4591f15a4c6017ed4caa51db37", + "positionImpactPoolDistributionRate": "0x0cc0041ba95aec083aadddf118ef899282c47120b0f17d111d00028eeb4f19c9", + "borrowingFactorLong": "0xd032d4d671747d4dfc710bf9a76c39b8fd293c2954b8f4a40894bae35ab48d2c", + "borrowingFactorShort": "0xb380f7e0ea51cf3d0e4c168fe3dc636ac74573fde0099f8275d10e6529f37af0", + "borrowingExponentFactorLong": "0xe1ffeb7db9230a1bac6e41d474f82ea59fea6a2e77b830baea2872196ea4db48", + "borrowingExponentFactorShort": "0x6168c3e6a9a81333d3a6ff61ab66ccf696cb1aacb4a922af74e9fc0dc02ee836", + "fundingFactor": "0xc1000ae35f4f02f20bf5b58e8076242c3d4af501f151a5d9e49888e8ce5b91b2", + "fundingExponentFactor": "0x2a131e64e8f2babedecaf000ad3b2c28de08e5d6f728b2dcc8374c5df1d1f2bc", + "fundingIncreaseFactorPerSecond": "0xc6a392686beabd57971fe8bfe9ac32b82d2d37d5f1905cab849925afc1a4918c", + "fundingDecreaseFactorPerSecond": "0x6381e281277e9d4a06f7dea74ddad4b2feada167ed97916f739b71a2635d6c2e", + "thresholdForStableFunding": "0x9c12b3ee776d2d6990982fc22ede32e1a14976feb10b2bc9386994c31bcfd65d", + "thresholdForDecreaseFunding": "0xcb9d81abd7f59282023527f186db011b1a7a47becf96759cd0fbc72be589bb39", + "minFundingFactorPerSecond": "0xaaefe5d07f5c06b8db251238a70a8ed25a18ccb3a80cc13619808cb63986fc36", + "maxFundingFactorPerSecond": "0x6c5d09a30a097dc3ce6bc2bdf3ae5515da61cf6eee5ffe30776669db8d0299ff", + "maxPnlFactorForTradersLong": "0xa4856280b896701f3961e30b5ae67819ccfb3ecfcc1b02b51a279498566bab2a", + "maxPnlFactorForTradersShort": "0x9261ef9a90b9f9785f18258aee39f431e7af66971ce7628b37dd197d93bde9dd", + "positionFeeFactorForPositiveImpact": "0x98853d8dfbb87c8e9d5e028e404924d8e05219c0b47225b2044b7e7877f7a173", + "positionFeeFactorForNegativeImpact": "0x37f06a157c23a33de4ca7196216ce1915ec1a3cc92d0a99ad8546b9ec307ccd9", + "positionImpactFactorPositive": "0x548ce19161df3c4381f589d02db21974b0760e345caad0f3d209d39e87ef0e93", + "positionImpactFactorNegative": "0x7f948d551673d7db11bc768d5e619644ad8fcd7d3b5ea979802542bef58c1ac2", + "maxPositionImpactFactorPositive": "0xcc90fb298e671c27c085ae0f7416295fadedbd92249139252ddc869a5ca25dc7", + "maxPositionImpactFactorNegative": "0x08e3b3b485b631d3a46abbc16ece5d6f745d41def3f018df49b7c4943d4a15e0", + "maxPositionImpactFactorForLiquidations": "0x52ac32768630686448d7056b478dbb59679a30728f24b36d590687f6188e1491", + "minCollateralFactor": "0xb763d546f4c43a22e39e6d544d2a097e2b739449ac8125be625ca1b3edb6c7e6", + "minCollateralFactorForOpenInterestLong": "0x4279cffcd52e0915df8447175e708381712393531426166172e9a466f544ea6e", + "minCollateralFactorForOpenInterestShort": "0xa7dd5e63b8b99bbd36c61b26e144889399099bdc86c904aa8dcf3d53670a8806", + "positionImpactExponentFactor": "0x3a2cd4a711e8cba8017733aa537e32ebfd2e5fa858bf0a773a3967ca2f7b30b0", + "swapFeeFactorForPositiveImpact": "0x4965fc8a21524ad70b41143626dd638286b9b42ceaa02dbb9bc821f614cf9fdf", + "swapFeeFactorForNegativeImpact": "0xf890051400774cc25b9f4e404ba50d42ebd497e3b1c8b9541fa1da94174e71c2", + "swapImpactFactorPositive": "0xa6399402207293d84fc48222f3238feae062d86e26e725edaca06fab54bf2e4b", + "swapImpactFactorNegative": "0x8c3bbbb69bd132cae186a17c0f17fec773e3b7d2ef52c639a31ce3ecc4bba196", + "swapImpactExponentFactor": "0x9a72811ae0698e31c2231403ff4e3263f7a83255c3ebd61ff1a9e6c90a5014fc", + "virtualMarketId": "0xc0d8524413137e633578123c56536277851f30fa476e320824d3841d54e8331f", + "virtualLongTokenId": "0x94039423f90376014849cce954f0d034b4adc74ce9d0f4142524fd668580cdd3", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x0418643F94Ef14917f1345cE5C460C37dE463ef7": { + "isDisabled": "0x3f3fd9c1581b7e4899657049fd1ffddbdea9cb8dc3282975dc30a87f9641afc2", + "maxLongPoolAmount": "0x497d2c066ee0a1d4f5d860dd118b56dffb0d77b8c1cb28414b260b19f958a206", + "maxShortPoolAmount": "0x67d641d32e1eb1dfc49886ff8259989b5bf70e5dfd2b53c7b6e87a80fec525f0", + "maxLongPoolUsdForDeposit": "0x297322829eaf1f798c0926208744c90c2c5684664457deedb2178d80b26310f3", + "maxShortPoolUsdForDeposit": "0xca2451fe7f61f020d4d53f55c5c84178ffbae6d918bfba03fb6c50ed5cc54527", + "longPoolAmountAdjustment": "0x934cbe2b03cd2a8197cd2d3d9a47c79c3e3d22839a2f20e8a7372756446f7802", + "shortPoolAmountAdjustment": "0x0a4ce0fe2a8a8ebecfc6401e12a5185cd0d721505a10c0d126569d5b3e27d15f", + "reserveFactorLong": "0x924eb0ec3f72c21cd5eb5c7311bd82f0f795be5cee2c1440f73192353f39f6cb", + "reserveFactorShort": "0x895b9293d82672cb457c407fee8c753900dfff1de6987e00a0798eae9e253890", + "openInterestReserveFactorLong": "0x8a0c3f5a0b7e9e23e72b960138a9d0b69c8fe644d76cdc8c604c669660399658", + "openInterestReserveFactorShort": "0xa57ce8a217fd4ec2bfca5d1580f5b5f6ce23a26ef213a81245d29667328ca698", + "maxOpenInterestLong": "0xbb197bcd6d4584b3eccc105f59368e512f079adabbaec3a232d6ba279af23ca8", + "maxOpenInterestShort": "0x6505b94678c6b33d474e653963bc2f098be613c12e88cfa01fe512e1975345bc", + "minPositionImpactPoolAmount": "0x7b738eef299c0f53e9515f9a152e1ffd846208c6dce2cdf3f246774b57f2f3b5", + "positionImpactPoolDistributionRate": "0x29b659e40441ff3d00e7e4cd36aed95844a4a150d624580d5baab5abb70da4bd", + "borrowingFactorLong": "0x5584737905d0688f0f098df75a1ac2946d5b9186f228e5b163062e8b0613b243", + "borrowingFactorShort": "0x5586c685b1bb8b97532bbdf7123e43895441a2ee4a801d6a804294b2ab5f13ca", + "borrowingExponentFactorLong": "0xbe35cdafeeaf2527e277d398fdf7d973f7f501a11ad1b361cd026e46644268d6", + "borrowingExponentFactorShort": "0x24ffa01597c8fca02c6be053d7ce77598f144bf38d9ebf9556618b6d9ea93c71", + "fundingFactor": "0x0cf8ed5c568f04fa299c6507b1b4fcdf0627a89a9170afdbd43a78e27b3803c7", + "fundingExponentFactor": "0xce158a3f9a5f344285e865b05db9ac6162151cd038cc3d2da4fc2c3d48705565", + "fundingIncreaseFactorPerSecond": "0xc4a2e8612964239f74d2a154fada3c9814e92c911b2fd1a64ba7d451c2a7ece1", + "fundingDecreaseFactorPerSecond": "0x7dda61f1744872d02d069f555063cc6d791fac38d765805afd2bdd614779e527", + "thresholdForStableFunding": "0x2ed138212dcefc6912f737b68be3b2c7d556df4c6152399d2a26b3fa921114d0", + "thresholdForDecreaseFunding": "0x99091ba73de4fb6ad50e9335cc0a04511753258004776c81597cb31ae0f6a841", + "minFundingFactorPerSecond": "0x919a22ed814b944f03c1d7da6791c601791c3d32dd9dfaaecc2b3a8789b15fdd", + "maxFundingFactorPerSecond": "0x3835500eefeba57cbe50ccb407e19aaec2f84810d63c5390fd9e7b6754d9166e", + "maxPnlFactorForTradersLong": "0x1383fddcb6581558336fbc217cfc3db183cd69fb3e7cdac5fdf5ddafcfe3c75e", + "maxPnlFactorForTradersShort": "0x71d36d7c6a247209ce0590c54c0d14752956059486987fc5161b7bec6739c8b3", + "positionFeeFactorForPositiveImpact": "0x2708cfa61a406341dc08ec540f21a474d06cc5091f45dad2888452f9619320f1", + "positionFeeFactorForNegativeImpact": "0x3596e5879e782fc01324e6c9391e2fe90856824c369c31b33c23987e61304bb7", + "positionImpactFactorPositive": "0x5871f75e257b7d79f48e659a4c02d14ddd0b8baca3c4a1583219d85f177c5268", + "positionImpactFactorNegative": "0x46340a568baf8d8bdd7d3198bfd3d4327a7532eac8a249a7cd6fe33cc05a86ea", + "maxPositionImpactFactorPositive": "0x19d692d2b95d1189dba6f596c97673a944821958599797b977eb5408ce276ba3", + "maxPositionImpactFactorNegative": "0x36ed3cee02b2c2f532d0985c0ea3f92ed5e980ce06a1116a0b6f2f65fa0de69d", + "maxPositionImpactFactorForLiquidations": "0xc7ca98bf7ac93f2ca8dc4a8a99e99194279493898e08ebf4b7e8f6cfe0452d7c", + "minCollateralFactor": "0x1cddd19b6c5ab7bac13bca435de5c29b7eb8b6d8f63653990ca7d124b6630211", + "minCollateralFactorForOpenInterestLong": "0xf62a2cd524471634da150460345daeb42bcc47fc9a8b5ea5b1a581013edfef77", + "minCollateralFactorForOpenInterestShort": "0xd9b39ffa382462e2b24dd0ebd1c3baec3d78c5ade8d4cbee813c5b8a51baeb20", + "positionImpactExponentFactor": "0xa2af6371bc1aeebd6802ac29ccd755b5ab13703022b5b772111b4e555273e745", + "swapFeeFactorForPositiveImpact": "0xa08dd6fcd6029bc48ce2addf2868af78d216638205a73838668634ca2a4981b7", + "swapFeeFactorForNegativeImpact": "0xc9bbb4bcd2036e8e18f3fd37c85140389749faa6bb95005ded218d00ab217029", + "swapImpactFactorPositive": "0x9f5c1ba768149251f1ac9bbe83db59ca66c5bc1dac404af7fe71e644dfe9cbb7", + "swapImpactFactorNegative": "0xded0c3d499ee81a6f139dbbbafd11a57b4b0d741c4deed0eb81b462952739816", + "swapImpactExponentFactor": "0xcb33824480bc1af4edb3a02742e93fc84d154d007addbabbf9515e6b900085c3", + "virtualMarketId": "0xa1f23522ffd6ecb1fbfee47dc3174341b74a30afb70d283e382b19fe9da9e5eb", + "virtualLongTokenId": "0xddc8f44ea682520585381041be40a0e629e6ad51d6ed26e690d316dc2c55e957", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x0Cf1fb4d1FF67A3D8Ca92c9d6643F8F9be8e03E5": { + "isDisabled": "0x7fb4adb2dd9d5690c22a56d50ca1012b6adc6fb18c3ac3ed48868b8ece70fb18", + "maxLongPoolAmount": "0x67662972e8c6bd988619b336cf4a17d973fcb2d865a755f8f85bec9aac3c145c", + "maxShortPoolAmount": "0xceb14f2ac022eed1874d3aadad7ed13eeb5ea4f2a34d5a2b2cf43153ad0a0bd6", + "maxLongPoolUsdForDeposit": "0x1c2f2588f73d49540a57d30a63636bdde044bef6519dab60c5da95dee1ba3799", + "maxShortPoolUsdForDeposit": "0xb7a8d66a3e3dacb53d43640fb4e4d60e7242d4a714908de9542fba7b939ddaf9", + "longPoolAmountAdjustment": "0x7e4b883b3033627780ceae6cd9d485a7e9e2675f4fe2b68a2b370a19e68f9ada", + "shortPoolAmountAdjustment": "0xb9e1ea6544cff347f113032a75f716e5fab58a3376bdc3d97e9ae52702695354", + "reserveFactorLong": "0x74dcfb1ec201febc51a93944380bc289cc6f62f06329839f8cb5885ec20f2000", + "reserveFactorShort": "0xc015788b418e8385d5e0fb37693a1c876761531efc4f223e8c75b7633f326324", + "openInterestReserveFactorLong": "0x29e053a0c90001e3c9ebf771bef8336cfdb3ef59b2b799ce582d3d964d94a462", + "openInterestReserveFactorShort": "0xe4445e4f28b7303776550fcb570cb3febf268047a3adfd28d0b9bbf69cb7bc3b", + "maxOpenInterestLong": "0x4268dcd71ccc231c0f7e5f561108f9af47e7f7d25b6c485f35447144c5e68e96", + "maxOpenInterestShort": "0x04acd7bcf017c33f2dd8f7f5bd57db2d6da4c8f86dcbff7bda3b77d7770c9767", + "minPositionImpactPoolAmount": "0x804fef54968cd82f6fe5eaf5d9d7d0f010705d59ca0b43b236fafd66971da672", + "positionImpactPoolDistributionRate": "0x269d64d7433377329801319b2ee1875ed28b302018cd732b62b8601ae0cde666", + "borrowingFactorLong": "0x9a03d37d1fe4253d66aeae2acb153c69613378cf90ee42f0f8b883ec33030cd2", + "borrowingFactorShort": "0x11da9332a8d784bb8b3dc20c06c94321337caf6bb689c19c20d4190c23d0f1fe", + "borrowingExponentFactorLong": "0xac59d8376fd4bdaf4d30846b807d8a32abe9b4af7ee125dfc4c82ff6a4e2e714", + "borrowingExponentFactorShort": "0x2457a24fbd3a58cc38ce1e8bafd2dacd5e8fb26b3a9f3795476d53d61332cbd2", + "fundingFactor": "0xddf76cb98e565c880d3229a0c5e42d04d8071f7f23529816c68fbc8c99f48652", + "fundingExponentFactor": "0xaecede320903706633241d2946b7b2cf67a6644c829ab2c648a42bad2bdb1833", + "fundingIncreaseFactorPerSecond": "0xbd1a32bbc26c808bbcc9bd6b5148759f8cf26d02b544f90ec0fbdcc5cbe5cabd", + "fundingDecreaseFactorPerSecond": "0x9cbc311044a1cd63d703c6c6554e9828401833354f2d08d71cd58200c5e09e85", + "thresholdForStableFunding": "0xcbc6b2d29626fe521311f854397720e1a12f4a848cd749635a82da7de3fee68e", + "thresholdForDecreaseFunding": "0x54cb3e888e5ebf2accc324c7634ea189b4dda6d328d2488fff011c42275c5480", + "minFundingFactorPerSecond": "0xabc3fb65b8aace7f58f7ef4df24c3170cd4f0f02a487d986c0ef9d5db8c6a88c", + "maxFundingFactorPerSecond": "0x0bf8542c05326ad5f245f8ba4f53a5413526ee86b08ab300cbcfa53c8f7e75bd", + "maxPnlFactorForTradersLong": "0x7e1a7f613272fff1571d4406fb4f7943444c3fe98768f85cdaf2742879ff334f", + "maxPnlFactorForTradersShort": "0x20c8ff6d63e62ce262a9cd193aaa60b95cf9ddbe860ab71336988a646baf26e0", + "positionFeeFactorForPositiveImpact": "0xc7f070dd821b1624b6a2929d567327bb3867502d02dcd2e71065cdd41ee23cf3", + "positionFeeFactorForNegativeImpact": "0xd5c959261e7a34eddeae5b309b1cca01ca260753eb2124ca19d3ed308287e0a5", + "positionImpactFactorPositive": "0x24d1fea37d4c67a275c1d219f987fdd8716789d24675e2a5d1c83afa319a327d", + "positionImpactFactorNegative": "0x80a256eee5da715b887d848baaf967bb8f7f9082d982e4678f4ce3cb6130d7b0", + "maxPositionImpactFactorPositive": "0x6823916303f2ab71c4c0c51d8ebe85bd81c3e041feeead165128a864338a7e2b", + "maxPositionImpactFactorNegative": "0xbea9f39702340352b6210661276d0196a3d4f0f52787211fdf3b2aa7e428ea83", + "maxPositionImpactFactorForLiquidations": "0x21fe4ef5e0d11726ac12f09444f2a2a5296577de3e50ecaf41f28796c2f315ed", + "minCollateralFactor": "0xcc59cb6b61c7943f711dc18dfc2fa4726e3e0e23320769e9599a2362835575cd", + "minCollateralFactorForOpenInterestLong": "0xd0b617f09379ad18f7bc551443b94d4b5c55e0023fb79c7165eec37289860743", + "minCollateralFactorForOpenInterestShort": "0x45b9bea14109e02351108100e302342f22e4658eb48584be5fe6b4d585dfe27d", + "positionImpactExponentFactor": "0x751f7109c025778b3f40dbc637af12a93d5a0c622c49f4115dc80f784b299eb7", + "swapFeeFactorForPositiveImpact": "0x83492ab5df99806cdbd8314795b516b6a9782b0942161be4f1af9bca88951ac1", + "swapFeeFactorForNegativeImpact": "0x63766eeca2ae5b09a2e0eb72120df5dbe6a8875527d67cd7b45ef9aba940e951", + "swapImpactFactorPositive": "0x5a6f6f80c4a3e8d65986a384398e538c8faf9088f78210ea7b4f0f390633a51d", + "swapImpactFactorNegative": "0x8f02874c8602664244cb90ca2139b5ba51aa0d59bd1479b6b94603a7cce88086", + "swapImpactExponentFactor": "0x8ed2859874287cb901256ffbfb84ae0f23e82f31893202aa1d67db64e2b63a63", + "virtualMarketId": "0x1d28b1001e8de41d554667802ab510f6b1b76aa6dffd943ed06a17c9bc0a9c97", + "virtualLongTokenId": "0xd6866dd6a33ff4abb4d6c4e944499daacd97b3fe0599c1e0d9988a698a0acc8c", + "virtualShortTokenId": "0xf131c85158814e22bf5ac40e4556e1134eda0141cfdf3a0d22cd0b81ea84107f" + }, + "0xb56E5E2eB50cf5383342914b0C85Fe62DbD861C8": { + "isDisabled": "0xc57fa57a212b891fc42e7f62e25048da5f71561498184e0f8237bc83353fc945", + "maxLongPoolAmount": "0x895e0674075b29eb3b00b705d168f086643e2a98ed89693dfe9bcbaa6793e8e0", + "maxShortPoolAmount": "0x28c45d36bcac82b721ceec0a9dccc06d8dd32f476b0dd0e24c153f828c7d944b", + "maxLongPoolUsdForDeposit": "0x4fbf27d5a44910ed1579feee7db0177825d875dc7f57ed584c7f2fdbf0fbac4e", + "maxShortPoolUsdForDeposit": "0x685ac339463b4bfffffe884b308a0501abec935e3bd11398923deb3550606305", + "longPoolAmountAdjustment": "0x69192ee4c24942e453a30cfd8c09ca162e830144728ffd54c33cc02b518951f4", + "shortPoolAmountAdjustment": "0x0f08a960d782cd94c0d4f9596e81bfe9bf9c94b243d9a571798897125e4e72d1", + "reserveFactorLong": "0x02ff4a63b6e2283a4743cc7e0103715cea79ec1c839804850c09efef903b8d38", + "reserveFactorShort": "0x9754cd390f91de5a1ba60bfed09f2e0cc722fdcc17e27a1bd86dd382b83a5187", + "openInterestReserveFactorLong": "0x44c32e3441ef3a134403ecc036f9dd685dc7341dfc25d84e5920a104ec0f9bb7", + "openInterestReserveFactorShort": "0x4a49378c82fdab4232664c5656ec2125b1c40ef06534bda79d919d6e23567519", + "maxOpenInterestLong": "0x9e4acf5f626688c7e0972732a766062fcc00025f05ce32d4490d0c087a07ca21", + "maxOpenInterestShort": "0x1160533215eceea303dd37f3593186ac5012412ad039fa3ca8ac86b4898f12ed", + "minPositionImpactPoolAmount": "0x57ae8d53a6de384541c4e22282a76af62b798d1a9c06d3f1908d60e64bebb95c", + "positionImpactPoolDistributionRate": "0xf60b5932db11a2f2a0cd08f76a93053fc02ead97ca0edb92580d5b4472af2128", + "borrowingFactorLong": "0x751f569a870d2ec8a72ddd07591c6e7a55b5dcf06136e81d6b2913fe885b3ff4", + "borrowingFactorShort": "0x5399e49d0a8fe52e700125acae2b10ede8cb9c4e00929240bbf89f91cf3ae441", + "borrowingExponentFactorLong": "0x877a0d8af99351b0933947595d23eb4b238d9980539fbcc76718ae5a198b3f32", + "borrowingExponentFactorShort": "0xbf558f56023672740128cf09c460fe8af3c5dd4f9d80e41b4c2c475041f7a7c5", + "fundingFactor": "0x076ceef4c1dbdb4d785153e952b207c0a08d55c7c6a47b4aaa6c4a436230d301", + "fundingExponentFactor": "0xed0c023b7081305990fb5db8c74b1b20314738ac14e3ef4603f090aa60201688", + "fundingIncreaseFactorPerSecond": "0x05a0a144949002c8322ff7d819847b78eb32a966f15c090550875cf1ffb4def5", + "fundingDecreaseFactorPerSecond": "0xb98baed72a95f04cd184d0fb32bedc98432f23900c032ac99993b1468d4b40b4", + "thresholdForStableFunding": "0x4b47eb9440f7442ea36914a7112e8d4a49bb992a61d836dbb7fde02ab4b5bede", + "thresholdForDecreaseFunding": "0xea9a55b5ef5f6740d709f3fe34faa45f2d1593e2842a8eaf8176c184cfd2e75b", + "minFundingFactorPerSecond": "0xa057af3cd0a30d2adff4e63573e62d97350c0121b34569cdc3945ad65275efc2", + "maxFundingFactorPerSecond": "0x1da7debb0b6df3807925c7cbebd7dbc68d0ee443039816f3a8fd68c1f747b861", + "maxPnlFactorForTradersLong": "0x7cfde814ebf3d1250c0842f9cdb144ced475a1dd2822a2c51c668916a60b5e4d", + "maxPnlFactorForTradersShort": "0x69c09c494cb8be5ceec8b05f2fe89d979733230188b1fad94a8ecaeb1b277a3b", + "positionFeeFactorForPositiveImpact": "0xdf5425159f0f0d87b1f2539ee40a039a381156da40713f7016b06cf7a4b16b15", + "positionFeeFactorForNegativeImpact": "0x654dfb3012335aec94c961545f0be05714f87c533d86962a9ea736f56124362a", + "positionImpactFactorPositive": "0x95058468ab52487db6520bc0a691ebe5ca226682fc034aca2f4291925890f7de", + "positionImpactFactorNegative": "0x141ad82e988c1652d94c149e0ffc2b2f296d8226f0804545b9b2f30f3a3e50ae", + "maxPositionImpactFactorPositive": "0xe74534e23b02234d9c1b63786b1e0595a47d733a393bb45daaff8b82dc4937d4", + "maxPositionImpactFactorNegative": "0xe75fecd581da9d267408fb6b502d011f69de3d9d39119b2ab286e8856516bc22", + "maxPositionImpactFactorForLiquidations": "0x631fd71c9b5735e3fe95e1cacc9080c5cf9a54e0785e4f57040a029e36e71131", + "minCollateralFactor": "0xc887506d87b14983ab7ed186f9178fed3a134abbbe8245a13be07e42e313249e", + "minCollateralFactorForOpenInterestLong": "0x974698c39aecd68284a0766fb070354eb0cc788557c000717eb1187a717a465e", + "minCollateralFactorForOpenInterestShort": "0x2cbcfa8219414a67ac30cbf47e0c87e3f98fa566922e42b7109f5148feb792a0", + "positionImpactExponentFactor": "0x8799f37db27fe4c64571774da8d11bb61b5a5b914a054aa230e26e58f694148e", + "swapFeeFactorForPositiveImpact": "0x6141d666bb9b2a68a9749663d3c3dab876615cb1c1c19cd40b04bc1c90e89109", + "swapFeeFactorForNegativeImpact": "0x154777b0009efb8b45f129e93dd06b79d93a034e74db99ee4c7f53fd6bb1064c", + "swapImpactFactorPositive": "0x461e2c7445b7c5765c40de6c216908f8dae1dd7515416d2b39d09c59c9410f9c", + "swapImpactFactorNegative": "0x844b935996c3559c7315004f459033cb6b4daba806b740a81bd8e9bee4d5f47a", + "swapImpactExponentFactor": "0x1cef00edb03ed714041d7451cc3bd97b04dc3b8f965505a3e78e9f1a5dea6179", + "virtualMarketId": "0x7de0ff9083c9fc4846e6cf984949de1b3d7986f334a415d69b151b365010bd14", + "virtualLongTokenId": "0xd6866dd6a33ff4abb4d6c4e944499daacd97b3fe0599c1e0d9988a698a0acc8c", + "virtualShortTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5" + }, + "0x45aD16Aaa28fb66Ef74d5ca0Ab9751F2817c81a4": { + "isDisabled": "0x43a1077e01531ec8e506f4e148899da5af9658e5296b25f7fb78daf5552e9250", + "maxLongPoolAmount": "0xc8f39054a15d4400659ae3439032f46961aa31ac33fa9a5d0a82c75f4289fd45", + "maxShortPoolAmount": "0xe76711bc7deb3c00954ec048962a3f25e1f0e42be82df06054387f3263c80bd3", + "maxLongPoolUsdForDeposit": "0xee5a73bc337f601dafe0e51690c5b1c110f82ff619981c22d5d297361772f205", + "maxShortPoolUsdForDeposit": "0x16ad5b65e7ad854aac38ca484ff9e1c9569e0056f3f2af2d9a52cc68762aac9a", + "longPoolAmountAdjustment": "0x1654b373050b752cee11814ca4f9ae9d99e2c3b406320688f23dffbaaf55ad88", + "shortPoolAmountAdjustment": "0xdd5a51ca019880590d9ab4f021b618774e7a0b14684ce0708ba78f45c41dd465", + "reserveFactorLong": "0xf551f9c0eb0963719599b81f2d71729ee3cb9a246fcd262381c867a082773b8f", + "reserveFactorShort": "0xe4edaa88594ba2c29213b5919996375de2bdf20a7a007a049874e0e545e47183", + "openInterestReserveFactorLong": "0x1e13c61ec092328aa6fa0a918ed70e3ee10f16762e38cb9e69b1176c9d0fd162", + "openInterestReserveFactorShort": "0x25019fcce4450f6dbb6609b8140ca595223450648927d048664a774f6e06885c", + "maxOpenInterestLong": "0xcf98e04916fbd40db20ea3fd7bb37d6178316d47180d18825ed82be2cf079db5", + "maxOpenInterestShort": "0xd56b74fd15da36b5c3ef9973b8d83b086775fe4438ab637eafa48f03688da5bb", + "minPositionImpactPoolAmount": "0x1a735d7f3210e8c8d23268679a33e5635291f72c60832a71a830aaa396ca86f4", + "positionImpactPoolDistributionRate": "0x56c8c8d8b1cd7483f9cff7dd3c130043c08993c6303f10b1f3338a4525221d18", + "borrowingFactorLong": "0x458a33d84bd95737f5f4d3ed6f0c6a1e0c46457c34a5c93b2c095ff1e28eb623", + "borrowingFactorShort": "0xf7a7a0ff538dba562da6eda93a293931b12e201b29ba63256ad8943bc3de2343", + "borrowingExponentFactorLong": "0xdb13fa79849454d71a482876eebb031675e3b461ae9641c25df1b7d29fab700c", + "borrowingExponentFactorShort": "0xd3ab5a35085464fb2d2a31c6603ffd0c3fcf138365f595f995aaeb73da807a52", + "fundingFactor": "0x79e06e0a67b994616bccc180f6a5012d2c14f079e236870b955a0ef092ed129b", + "fundingExponentFactor": "0xf890c2d7b132c5e21810513a15bc5884ec9a91d5e0a4f7557622201276f01f33", + "fundingIncreaseFactorPerSecond": "0x5673777b5461b011895e8e151d181bf0ce289458ed872072eba852123d54b411", + "fundingDecreaseFactorPerSecond": "0xb2d0a8535bbfe7be3fa8bbb03b4e70f560b9e471e0f0cd590b080a21ab06e2fa", + "thresholdForStableFunding": "0x56aabb14a5914636622622b45e4705a4cecb2315d2c703fbd8207dd000d81708", + "thresholdForDecreaseFunding": "0xaf3f7ae98524feb7cbbd21c63d897178f02899e409165d955e6acdef22ba4a5b", + "minFundingFactorPerSecond": "0x100bb0c46e163331467a35fd8e2d7f4f283f3239070ecf90c78b1de56f461075", + "maxFundingFactorPerSecond": "0xa86190d0831a71843286266b26bb09d290e7274457d4c6884dcc1ce7af8b75d5", + "maxPnlFactorForTradersLong": "0xae6a9602886e00e8f9cc9fae500cea6315539ce497876e3d8c68a7c2bce8ff83", + "maxPnlFactorForTradersShort": "0x7e0d5ffba6ead92454e3b86bdf9a7e5f05b90fe3f4191b817c4f1a5a88f31e19", + "positionFeeFactorForPositiveImpact": "0xb12a559764e28d5b6e2828f2dafd4ec774c41481df3dc7a8b1d01051025775af", + "positionFeeFactorForNegativeImpact": "0xe6787e7aff99034a0a90b9df8364057d42c7f114ef414a94b798cf7d9fb3499b", + "positionImpactFactorPositive": "0x6f738a6e9c2976fa3398260c2678ceeebbc372c8740bca3d419def2cdd72d7fe", + "positionImpactFactorNegative": "0x042414808b145a04357da24216c441d4cb1866192323c65253d7d5d7ae5b16e6", + "maxPositionImpactFactorPositive": "0x417f05c74dda8045134d4ea5faa8558b54bd35e13417dad8988bac462d511986", + "maxPositionImpactFactorNegative": "0x8ca16c9c73994cd267eff2951818721a251b0c048efd9f87e97dee49a7b4960d", + "maxPositionImpactFactorForLiquidations": "0x0d1c038bdc72efeda626efe5e534102d4a9b352b46a778ae44aca00da277fde1", + "minCollateralFactor": "0x306c4d11774ba8acc5857bc2b9eed4e6f4eaebd78ca19cc36c9e7543ee4e2baa", + "minCollateralFactorForOpenInterestLong": "0x1a91d60f924b7371fe96dc19aec25c04a3c778b64b02909898c8ba552f8f8d74", + "minCollateralFactorForOpenInterestShort": "0x64a53510be4bbae7a856bad32346bdf81c3f6d8895c5cdb6d9b4c3061c7113d3", + "positionImpactExponentFactor": "0x8ccbfcefe45e6333409c1703e2b19a344996c8805280f1a49c6922a10509a67e", + "swapFeeFactorForPositiveImpact": "0x1590ee2481a3040cb0d23eb50d8e5f03df05af2a0adb6647b64d9dd18409e4bf", + "swapFeeFactorForNegativeImpact": "0x9ef8535355d5ea75d57b8faa5093312c6a291fecf76f923fd04bbd8cf9461f0a", + "swapImpactFactorPositive": "0x3ce367a95fad78d15965cfa917ca6137f707a3d77022ba1f643a316323402f4b", + "swapImpactFactorNegative": "0x4cbf632cb133bbcc438fd421654e7dae88fa165ba171fd6e6044c505eb728017", + "swapImpactExponentFactor": "0xe7d7639aef796eab87ec1ac108ef4ae5de1a5f867b9624bde199f46297b78a32", + "virtualMarketId": "0xdf0a8d5e921c33cd5da9de36cd122eba3630c34ba710c1e9c17365d57b985988", + "virtualLongTokenId": "0xf131c85158814e22bf5ac40e4556e1134eda0141cfdf3a0d22cd0b81ea84107f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xB62369752D8Ad08392572db6d0cc872127888beD": { + "isDisabled": "0x03a5155414acfa53a2a5f4fe6daef37cde40c438c7c046f8557f8b57ec6a10a7", + "maxLongPoolAmount": "0xe00705dbc3a958cc3e5875bc2e4bc38baaf1ec16f4bbf936dda2606dc2613685", + "maxShortPoolAmount": "0x9f92b886a29cf5c0f395972393c54254728fdf12e64d4422b6dfa58e0828c6b1", + "maxLongPoolUsdForDeposit": "0x8e8a33a35ab4d6bf88fea7400f1b3156755cf154f37fa306d3681f6cdac92b5d", + "maxShortPoolUsdForDeposit": "0x198c20ab100a043b232f3f553aabc4cdb38c4ad46f6122f9248f6cf0cc3c3719", + "longPoolAmountAdjustment": "0x36f91a9f6c0b23a1a5fb2034e4e87c6c63767056fa921a986616166204570776", + "shortPoolAmountAdjustment": "0xace1fe34fdc3172c12730e608492dc95160c0e5cd1effd59ad736ccae2ac4082", + "reserveFactorLong": "0xb942291725efadb47f90b489a560166356babc41889c76b3e701b09a3be44a67", + "reserveFactorShort": "0x72cc372c566a117f4bc76cf9e36a1c453fc2cce23db5e1e171bc8339f715d9a0", + "openInterestReserveFactorLong": "0xea3535598f41c182bf9a6ecf1407d5526041953bfd0ff78f7e3bd183fa36f85a", + "openInterestReserveFactorShort": "0xcd05c3be6d802c5465a7476303f94e1302b8847fa6042d368d9a2b9782c35864", + "maxOpenInterestLong": "0x5dc97f5a0317b8799a69d443d37af5e048c91fbdc95d34b1ea4230f734f6a300", + "maxOpenInterestShort": "0x285ced9e7b561c4b6b2c31b7f88f74d5b73833725762fe747fe72a16554ae372", + "minPositionImpactPoolAmount": "0x5ef5523deb7be600d86473fb5aa81c1f9dcda59392eead0c9dede478e7b57f96", + "positionImpactPoolDistributionRate": "0x9153fd10ef3def4580425914e2f410df9882aea06853a2941f9c5199946384fa", + "borrowingFactorLong": "0xdb0b2e7d0ee4091fa786aebdedfb940daeae5cf07127549bdb4be9f0b8da80dc", + "borrowingFactorShort": "0xb510a1d30f323a6bfa36b71c4ab2c4a338bbd41717b4bbf17bb5fba2ab4a6cbb", + "borrowingExponentFactorLong": "0x2c3cbe4bd92abe28e26ab1c6e1ec690533dfbb10275d4aca6f688c17d28e51f9", + "borrowingExponentFactorShort": "0x6e0a73f752e65fe44f2bd93d0608a10e14e8c8e5d81648dbe16d64343d046fdc", + "fundingFactor": "0x6f2ecad16f1c834edc1b4c4635a901d3cc8a1fc4b989f3fa161ad88e66b388c7", + "fundingExponentFactor": "0x20804a56e215b89ca879963c29d21a7e4e69e44c4aafa0abc67853c424931f4b", + "fundingIncreaseFactorPerSecond": "0x8db9b3067b1e847a3bd291cc8d3e15f456104eab4ccd699f2ca132f25e8a39b2", + "fundingDecreaseFactorPerSecond": "0xd66e36a0f16077bb94a8a580f8f08bd46819370638e694ce2f0ff995aaa23139", + "thresholdForStableFunding": "0x9f7edfccd82a16d59264d71a2df2c0c5cd1bf1ebe65a249ef9dd6aa669bb009c", + "thresholdForDecreaseFunding": "0x8aebc73bdbdd8776ba05f57cb763fcbf6df9223fa1d83d0fc2da77166d94c492", + "minFundingFactorPerSecond": "0x3ea4e2edbe73786a314e8cc88ff042ab92a3916895086f0a4982b515d68e4489", + "maxFundingFactorPerSecond": "0xa5f8602de310b7ef0eac8c0b938744a9c6b0127e0d806d7f8f0b58b6318614d5", + "maxPnlFactorForTradersLong": "0x10c8eb29dea6e099e25573dccff9650d218c309953f6ba9b03690e8cfdd66b5b", + "maxPnlFactorForTradersShort": "0xeca0d151e83f98ef5e12410b0a2d223e29cc7d97f228f9d63edb1a90d9467696", + "positionFeeFactorForPositiveImpact": "0x10d2a12dc0ae3d3ebf4846a7fbe21f4c46517ee74bdd7c6fd72417e75ec1caaf", + "positionFeeFactorForNegativeImpact": "0x611c3bc2e992fc865409dc0b81a02796f19cf207d98a8636ba04889156767b3c", + "positionImpactFactorPositive": "0xe26bfc6ea0695527daaf43790b252c6cd520b6f041d52b89fa1765e332b0a2ba", + "positionImpactFactorNegative": "0x29078683fd16217f167c57ce10332c45b25a7e2a42b7e317f4993cdd182ee4f0", + "maxPositionImpactFactorPositive": "0x92c555de2df6a801fca90169a37445fa9e1b6127ad2b24e9aae09e610daa64d8", + "maxPositionImpactFactorNegative": "0x836e6ed579eef0ce940ce76d025708ed4872eb6897ffdbecbaeba7d3a54e5a90", + "maxPositionImpactFactorForLiquidations": "0x52fb95366a88cf85b51d86af2a6aaca9b2a742d85554af7cbe67a75a2a683f1c", + "minCollateralFactor": "0xf222dcd515762a01b5dcd95d0d7bf6220adebaeeca37241b2334aec31858d008", + "minCollateralFactorForOpenInterestLong": "0x159b5efb14ba5fdf82eb9483ce36a5cc511603ddc0851867d2f62e061a1eb5a5", + "minCollateralFactorForOpenInterestShort": "0x5ea79f8f1091195b3a4b2e7b906f73a855a4677d85a563c73c636da18a4c3b61", + "positionImpactExponentFactor": "0x5de08cfc1c45dc70944717fb92318d5f3f66c26fc83ad52ac82277eb036d81db", + "swapFeeFactorForPositiveImpact": "0x8039a612505e93d3b3b411b3e667f13e1a54b0d830e9dcc16cb41d838b85c6bd", + "swapFeeFactorForNegativeImpact": "0x07bcac70080ce14495a72e4e38fcbf3cf15913013379a12d4cab5ac6c741851d", + "swapImpactFactorPositive": "0x16e0ad50beb175b5eb950fb44fac610b3289a7a74fe8a788d974cf667cb024a9", + "swapImpactFactorNegative": "0xf4d68d4587e30f6e4d7a9ee6eb78d8d4c1c05ace6f9bafd291483c9ce9eb1bb7", + "swapImpactExponentFactor": "0x97d1c1c0f5ad236f5f1edac5fdf95bce3537739693abc65a09ed0a3dcf34498d", + "virtualMarketId": "0x03f15dfbb59683ff19459d28557cd3323f0872a7f560af3b99a3d3f9653d01bd", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xD9377d9B9a2327C7778867203deeA73AB8a68b6B": { + "isDisabled": "0x2380fc010a0e5f7f7b04f932daecd0f1b6f99fc16e617314519e7cce3a27a174", + "maxLongPoolAmount": "0x0e149b98652c3541dedda5a1b3fabbcc3910d5ce322855ea94844ff42f4d6bdd", + "maxShortPoolAmount": "0xe73752519aa541a49b1ae6c397342bab1b0e39df55d6ccee20ee3d62471e4d3f", + "maxLongPoolUsdForDeposit": "0x1fd569a5eb7ecdf1939b28605e1643850c8299bf922812fe43e3fbc9b906ba22", + "maxShortPoolUsdForDeposit": "0xbf01e5edb903e400523203a86dc4523fa749411884418921767b03b990214279", + "longPoolAmountAdjustment": "0x7643bdbbf851d2422681152476ee0935b2d33c863f98b7feba89be587f8ff2ac", + "shortPoolAmountAdjustment": "0x67df1c7379d41ca7d760f5ce511d298a31c2308c2608b4eb69383235759243d0", + "reserveFactorLong": "0xf9b0e634b9ecf0769dafc8520e64c31ab144a27f8d2bf29146f760d185160255", + "reserveFactorShort": "0x269ea276239f8685144a50b36f392128a5da82b657324ba1a137cdffcbe047e2", + "openInterestReserveFactorLong": "0x12f184070de2fba8ea4c7cbf928de4e80c853046f908077238f64ed598f0b780", + "openInterestReserveFactorShort": "0xa350402f3a5651788a3ee7aa27649bebe99648e3818050d2038c93ce6e3f1edd", + "maxOpenInterestLong": "0x96eed57a3645682a545916166d27bc36b1284615d7a31b8d99155053d2ab3da6", + "maxOpenInterestShort": "0xc58e145b0ec975ded664b8c54bfe78e6d4d4fa3f0ef26ae6dc27beed3e8a75e7", + "minPositionImpactPoolAmount": "0x99d7244d0654144d8151bb6589336fa58bba1ae07a4598187897c6a446f0d6a3", + "positionImpactPoolDistributionRate": "0x9dc905d0515f160738405b35981d9a25d33c35111ae11b015c69271c3ff93982", + "borrowingFactorLong": "0xac72f0ca2a800d6af69ec42aee49479f0579ba8f508585ae8e97939d0541f146", + "borrowingFactorShort": "0x1e8de47584976506f9c7414855d25b643d9a0c30bd748eae75b27306650e29bb", + "borrowingExponentFactorLong": "0x659fbfb6c176fcea38185f13b32f36eecd6f79506c25106d8b186d95db8e5fc2", + "borrowingExponentFactorShort": "0x85066a700eccda161ae2bca4a4666c155874e9ce4688b45eaea3a5b92a10b493", + "fundingFactor": "0x05f86353fa1d54eef5474a1b9ab0cdc31a3cdcdc9358e2d378701214e5daa0fb", + "fundingExponentFactor": "0x640bf64ab1f9a0f85b261a3b74cdd7589962b119dbb7a947a5a96411022e7d13", + "fundingIncreaseFactorPerSecond": "0x73569f247c7b4835b59fbb25cde9091867b68e5f6ac72fd9ccb4f4e71244b8e5", + "fundingDecreaseFactorPerSecond": "0xdab9e50176f46c0325e4ed424ba3af9ee3cfab934f7f1679ff575eeba39413c1", + "thresholdForStableFunding": "0x8cc54d3116370bb984d3047167bb7cc6b9ec28c863d172218fbc2504fdd81064", + "thresholdForDecreaseFunding": "0x53f4d44e4f08a647d57873e0481d107522d7d72e601abc7af1c6cf32795031d3", + "minFundingFactorPerSecond": "0xf2e95f7bddaf5a6f7e9f5985143ee5ead74342e3c038fdc123dec21454bc7a98", + "maxFundingFactorPerSecond": "0x33a776a9e8fdf2baa5a32b016dd8e6a333cf2e461554870d0c06cfc1f15bce5a", + "maxPnlFactorForTradersLong": "0x7b53f5192016caedcfe36d2c9283142ab453a038f9f58d3b6956a3d4e5b9723b", + "maxPnlFactorForTradersShort": "0x2fb89797b374a76143438b2cec9ffb464bfc30d36738dcd9fed215190b5d6323", + "positionFeeFactorForPositiveImpact": "0xf3bf654aaa18bed4473e41fbf07fda8631a7c410c2e3f63a85158e40cc7d9b7a", + "positionFeeFactorForNegativeImpact": "0xe348ca82ff412191d0856eab30d838889649105a16951e03680ecbc33572fba5", + "positionImpactFactorPositive": "0x1db5aaa72739243e2cd7cbb59e13526bb779b6513f648c3be647a3945ee0b6ff", + "positionImpactFactorNegative": "0x9f4b1c96ad48b04dcb2e090029b07fa05c74137e2b3264b5b31b659c69c194de", + "maxPositionImpactFactorPositive": "0x054407c473f235dea7a7f175def0de1c030b1617f399a34315331710b5dc0c72", + "maxPositionImpactFactorNegative": "0x7a7bd10cbcf566e8e80449dbcb0b9461c37aa3ca35e289a7f2777b1cf04b2a68", + "maxPositionImpactFactorForLiquidations": "0x5c8317b7e68038721e2b6020e3d99c388914cf6acf570fde1ceacc34bc2abef4", + "minCollateralFactor": "0x37c9327170636d2644b4aef9428093a4b840396c017062d69214990437f11295", + "minCollateralFactorForOpenInterestLong": "0x3037baca9542bb9bf19e795a3ea8588f62fd7aa7f391835394eb39113b24f199", + "minCollateralFactorForOpenInterestShort": "0xdb99a450e0b3214c2eac3f7523de613aab2352d659dae70c2a748d158dcb92f7", + "positionImpactExponentFactor": "0x24d3d26a6be3949ac749df173c37d80cf593084309fc6214c3f2b987b8b5bf3a", + "swapFeeFactorForPositiveImpact": "0xea7cc342e21f8f0d3929c81522fc565f43b539e5cdcd8b06e27fd147f5ea8122", + "swapFeeFactorForNegativeImpact": "0x293b0ec6f9d1dfd04f394f6a2ac44c3c5dc6390cc10d3cdf91808e413ca6cad7", + "swapImpactFactorPositive": "0x43815a7794b4f7f293baf4954ce22899083f202f8bacb7c6318febdd200c8647", + "swapImpactFactorNegative": "0x1b4e062640c62d2ea26baac2c515da1c438db5cdde51ce3b7e87c389c4588648", + "swapImpactExponentFactor": "0xec66bc2197cd85704c758f3f88d82b4e96952086421a0744e4e4bee8043d6b17", + "virtualMarketId": "0x8e4b9ce4d107fbfa15745d1d17325cc3bf6d44d3ae1a092cb5d22ad813aba8ba", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x93385F7C646A3048051914BDFaC25F4d620aeDF1": { + "isDisabled": "0x33280a36433e9877c56b2aee09cb21102124b7026349330698d514fc90cdbe38", + "maxLongPoolAmount": "0x536b58acbbb55007fe76c492e5b3eb2aa853c575c6a9f745e7c7be5aea18bcce", + "maxShortPoolAmount": "0xf11ba26c551e48305fb097e28d33332263a580f8ee53a144c2147562aa8f79d4", + "maxLongPoolUsdForDeposit": "0xb93927c7aa98a4dd319f4edd9dd7fefe165f60bf7a6c3a9d741da5be6d6cfe21", + "maxShortPoolUsdForDeposit": "0x52eb7de69933408ec109062646ffce951c4d286b4a8137f041dd38a042a40751", + "longPoolAmountAdjustment": "0xa9555de3101790eacba3af4524b4b8a09284ca5f18859027918b75d3a5fa31a7", + "shortPoolAmountAdjustment": "0x8ed4c6b7a64a9ef0d33b04ad58d451ad4590ed706d11b5b3d313c3bda136a7e0", + "reserveFactorLong": "0xc9198d3e323008926aa2b18d0bf8f76f9112c58b1f93206a02f634d8adca65a2", + "reserveFactorShort": "0x16c3c83bf90d1fc32e5ab142adc07ea251302e7fac4853c99a07190ae31f9ef7", + "openInterestReserveFactorLong": "0x935f3e2115512905fbc8e0d568c61d1659537af9a142e3b0d730fe131bcef29b", + "openInterestReserveFactorShort": "0x1f395093c678d49d5d48f2aeda5897941b3db8debbd2bfdb01050427d320b683", + "maxOpenInterestLong": "0x2a47941375ba8fce179499aa550aa204ac519b7d64ca3debec8fa471b84047b9", + "maxOpenInterestShort": "0x3a02b59a85cbee0260765708f046a09216074d8184c4a93f51fb53fdbb6c3dfe", + "minPositionImpactPoolAmount": "0x6ee67eb98599a355bbd99399505e9c885d7d3cd1f3dc9fd2d728ddd2f98f0960", + "positionImpactPoolDistributionRate": "0xed4aa6437e6167dd9bd2a53c938aecec8ddf57313de595cf58f8786d5e1d3386", + "borrowingFactorLong": "0x122d05aa36145252e527805b7aafda84f6787d3df6188eb4ae21fe6316a80639", + "borrowingFactorShort": "0x9e037015c5730c695359818af8817b68854dc762be784260e23d696b72162287", + "borrowingExponentFactorLong": "0x55fb1eb8e6f2d2c44e55b0214b9e7902252cd77c04bbe15ec164b8c3264a0116", + "borrowingExponentFactorShort": "0x3b917de97904f2c4906635946c88fdd6114623407037e681c1ba4f31b8af6e81", + "fundingFactor": "0x284a364b65a1ecb2bc4da581860959915385971706e9a7035cacc416a9ff5c3e", + "fundingExponentFactor": "0xc48b5174f827670af4043efe367a30d4cc42f9377fbcd41fab72eca053dbd6f0", + "fundingIncreaseFactorPerSecond": "0x19646e867a3374c82095d29f08471107b81764960835c5f40aa6e865f9d9fe26", + "fundingDecreaseFactorPerSecond": "0x7ecdd3b5ba2375462e899fb2d8a78dde5ac327eb39e94d04cb0e5247bbc1b700", + "thresholdForStableFunding": "0x827d0c9e3162a357ddba7b598f1500a5c774c6804b41778f4237314f6ea12def", + "thresholdForDecreaseFunding": "0xe1f14c9218f4aa27d6f010905d4c1933bd12aba5bcdb1ddba22f48bf3787ee87", + "minFundingFactorPerSecond": "0xfdb5b11efeb961ea79ee22d85f8ceffdc8483c553762c96dccb2bc9f1639ee03", + "maxFundingFactorPerSecond": "0xa9ef8b74a174c9e223b7d703e4ecd5529724a3ed601cb05ad3972d69abd47b9e", + "maxPnlFactorForTradersLong": "0x5a378457c164946c52e07daa0bd710b55462b6c1166b1f9db12dc0cf90f0b09d", + "maxPnlFactorForTradersShort": "0xfa1252240c112896c95967a9f25716248b91106fa011dc48460dc122f7a01a8f", + "positionFeeFactorForPositiveImpact": "0x7ad381a480212f1a2cd99216ab2fd20d2d3278de35a579524373361be43b638b", + "positionFeeFactorForNegativeImpact": "0x7d17a4ff2eaec3da855d96f23a19e78ee118553b7ec5e877fd6ba2ecdeb70a38", + "positionImpactFactorPositive": "0xc762ad5da3a0eff95f66232719c3912fc2f2ac454f86df09fcee9ccc1125906e", + "positionImpactFactorNegative": "0xdeaa0bb6c0dd14655f2b47aa4e7fbd84a48891105499b6d39ccac6773de55908", + "maxPositionImpactFactorPositive": "0x5d881863abefde1acac40bd9a69e9985a6946e409beee4bc2b1c250afcac9c0f", + "maxPositionImpactFactorNegative": "0x4d5ed30598d7ad750ac5cbb67c1cc9f880103986f5778a65104f0c0a2feb5b0e", + "maxPositionImpactFactorForLiquidations": "0x39c2c99bcc2c851bd93b362e0d6854420c9d73c24c2a64655fe575897284a5af", + "minCollateralFactor": "0x26cf36b642d845e4537b703e1988ec4f179852681fa1da1da83f0c4f07aaa277", + "minCollateralFactorForOpenInterestLong": "0x093de38ced41ca0b1ed4b1125b61d2b919957df4784cfd03a2bec7169efe69d4", + "minCollateralFactorForOpenInterestShort": "0x26036e46776ea0eb1742bf11074ac5e347c4a16656bffb61ea87249d85908f71", + "positionImpactExponentFactor": "0x5c860ae9aabebb3cbd58b3aef502c6e8d7de7ee9352d4287a53912877b065f6d", + "swapFeeFactorForPositiveImpact": "0x83f7fd8f66ad11eaec868ce47d0d0f0541d3c5b97db7510c6a5221f3d7742049", + "swapFeeFactorForNegativeImpact": "0xd55ebff53d86bd23cf89b366ce663d0666ff69f0b57bca785f06f9a8241278b7", + "swapImpactFactorPositive": "0x554aa25ead86224ab91bef3c3666a62e090f2ff373660d1ad93b5bce40d86280", + "swapImpactFactorNegative": "0xa635d2782a0a1a49d0f0109507ad9f758eb8d886465a59b2a6aa4a0d4402b411", + "swapImpactExponentFactor": "0x99ae407ca0909a5ede62cf8e5e0cd01c88b10c8bcc977c6be4c60124609ec505", + "virtualMarketId": "0xee0116ab2f3ff5a9baf77133e43fe02da8321a8490c5ac205369bace02758d51", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xd62068697bCc92AF253225676D618B0C9f17C663": { + "isDisabled": "0x2f906f6a298abd28f726c37379be0c5def1d85abfb7ba70ce572754acd0c5a08", + "maxLongPoolAmount": "0x7aad45d57c12171f54e3aa0c319db8d017d36cbeb01198a290ff417d1a466324", + "maxShortPoolAmount": "0x7aad45d57c12171f54e3aa0c319db8d017d36cbeb01198a290ff417d1a466324", + "maxLongPoolUsdForDeposit": "0x600ad826951026922c214cf85b12616d8105bf5f28bfdf78be2b080c71c3b1fb", + "maxShortPoolUsdForDeposit": "0x600ad826951026922c214cf85b12616d8105bf5f28bfdf78be2b080c71c3b1fb", + "longPoolAmountAdjustment": "0xb2046a6ddb04fb47b3d1beec1696671fa693b81734820dc61322f0952b470d6f", + "shortPoolAmountAdjustment": "0xb2046a6ddb04fb47b3d1beec1696671fa693b81734820dc61322f0952b470d6f", + "reserveFactorLong": "0x336907c3530dacf62d7f844a0fc0a625aac8976e3098f365f341b73a0e3d4f5e", + "reserveFactorShort": "0x92303b878a586fbd13bfcb31b380a27039b9045afbe1c33ea79a37765230ca92", + "openInterestReserveFactorLong": "0xb52d55ed32e6329e2ebd8f07be29f2c119551217cf6f7a70511c2c9c07de004f", + "openInterestReserveFactorShort": "0x57620b33d2928b54b36f19c94d391a35a024779b7dc8e86b6d330047da0e38af", + "maxOpenInterestLong": "0xf7f3d1346e2dbb7c21a54e1c5c8fd9531e9e84367be069b9f329ca8bfcc36434", + "maxOpenInterestShort": "0x8bf23a572846549e36dea23e29538ce21f9b835ae554d9db823548b8b24d5513", + "minPositionImpactPoolAmount": "0x20ba9b8274778be0ce4ab70e3ff1319148d0feefed8953fb93f9ef3697f9bb5b", + "positionImpactPoolDistributionRate": "0xf35ae1e742dc12217266520f7cb37fc483079e5594e9c75bea18a6edc6116fc5", + "borrowingFactorLong": "0x76b2af1c89bf4aff6be4791940ab674cf2d596b08674c5406e54bf6bbe0cb5a1", + "borrowingFactorShort": "0x780159c680f686e528c893488334517389b8296da7c22bc1eaa00b3cc463e5c0", + "borrowingExponentFactorLong": "0xb28a03154df5f7389c980f07233bbe0de96d083e14c4a0083664e9a8a676fac5", + "borrowingExponentFactorShort": "0x169821057f56a0c57b34f37c8ba0e3074e9c7d6bb1091628846ad667adea1867", + "fundingFactor": "0x3f30d900894de92f1e4e4c3c21501c3690c5b1c683a776956ede9916dc41b599", + "fundingExponentFactor": "0x0c61e2515a46ceeb0831a7e2113c0cb3826fb23e2c7811ab9bcca8339875919c", + "fundingIncreaseFactorPerSecond": "0x4e9007874ede478cc16e789f15d14bf6285efd7eb2643c99fee7d1a14635ae3c", + "fundingDecreaseFactorPerSecond": "0xa4c64f1750a32e1513c3efb7ebc7fa9a8c956491628286f2d5137a3a548c85d7", + "thresholdForStableFunding": "0xa179e9efabb6207e96c49544e7195316bb60a36612bc3514f053b1f5f6bf1bca", + "thresholdForDecreaseFunding": "0x4589a4db90238d7af374f67e2a99f25773d5eddbebb17c7c835f6266789e881c", + "minFundingFactorPerSecond": "0x490f7b7028281e3aaf771890cf538c0491670095e144ca224891a60a636d6804", + "maxFundingFactorPerSecond": "0xaea060ad5c01b6855a8ba41c879877ad9e7c0d89d22c24b2d808dfca154c3192", + "maxPnlFactorForTradersLong": "0x0cca8f43022acf6faf517d0057db8de6c50145c84c4c178375f32c525504e162", + "maxPnlFactorForTradersShort": "0xa5db5e8014020874226641a8db0eb55033824863e8c3218a983672ff9962d866", + "positionFeeFactorForPositiveImpact": "0x4a1f770da272d53d04cf31e8c4a04ef9fe459681c1ec5278abb1fab151d7ec92", + "positionFeeFactorForNegativeImpact": "0x8f7d93c1516186baf16daaaed34af81384d055695f0fc0c143cbee3bbd8e73ec", + "positionImpactFactorPositive": "0xe30ca65f7576e63a00ad697a68075c47c69ba27e489fafd76ff29fb752b6a091", + "positionImpactFactorNegative": "0xb375b763eff4f0763ada21285731c4887d417d372dd7464b74a29c8bc3fdf350", + "maxPositionImpactFactorPositive": "0xfe35d1068a4bf727664f3683964a8585efa69f42b3fa05eb9bf95678e5fd0e9e", + "maxPositionImpactFactorNegative": "0x8559fb313fda3675ef298adde1583c8eed97bc729c3f1797b4238c7e0b169ec8", + "maxPositionImpactFactorForLiquidations": "0xf224c1634c4a4f1e74b27f1f86b940b3848610a8742fe6e05a979282184a8320", + "minCollateralFactor": "0x9796d33d6fd886b0f785e0e524e2b25f1e7c291b682ece47fe5ae62611e448cc", + "minCollateralFactorForOpenInterestLong": "0x1677f8025e1e4279b5a1db64264a79835c58c80818191018a56890aa23e9416d", + "minCollateralFactorForOpenInterestShort": "0xc62d3cca1c3f6cf4e2770239bc3db387c22a0874a46b28bd8d86bea5d0fd882b", + "positionImpactExponentFactor": "0x8d37091394262b6981015a549871fe3c908943afaa10321a82aabd7fdca918d3", + "swapFeeFactorForPositiveImpact": "0x5cb96b68635c2011b20c1a103f94a8fae1fd3a1a31f929db520a540f3521a224", + "swapFeeFactorForNegativeImpact": "0x3af0747e232c7341bb056cedc52a023be289515396288b8bea2867bd132efe38", + "swapImpactFactorPositive": "0x7c0dcaa54ea81581befa553bf6ad5d1ed18aa7ad80bd7b80fcd6ef9b1615bd43", + "swapImpactFactorNegative": "0xd9536a29966ec9255729ded57ca8f7dddb0c0b9af89354db014171689595efc0", + "swapImpactExponentFactor": "0xc0af564625767bd4c8d5c3450753dfc573b1e93682d4989afd2f90ef459922e1", + "virtualMarketId": "0x679bde52b07e75dc728418cd095c199a7defdfe74368c391b3ea89e729e49b63", + "virtualLongTokenId": "0x4586a40f82486304a403813a3e4506085f44f379287675806f0d785961e1f46c", + "virtualShortTokenId": "0x4586a40f82486304a403813a3e4506085f44f379287675806f0d785961e1f46c" + }, + "0xD4b737892baB8446Ea1e8Bb901db092fb1EC1791": { + "isDisabled": "0x9c41d8a5c17d76c198fd1e66f7a02ed03b53a149e0f488c7053e6a1eb3c059f0", + "maxLongPoolAmount": "0x7254183f75ef2a211fb0d0cf0bd1c4ac11b4d9ec34ded87f63b2aa1b3b2c53fa", + "maxShortPoolAmount": "0x0d5fc1fb63990200f37ceb299514810cf4eae58503991038738b72bfc4a6ad7f", + "maxLongPoolUsdForDeposit": "0xab9dd7c528788e85bc7a9519bd2685601fe692298fcb1bfaee73ba30f859be2f", + "maxShortPoolUsdForDeposit": "0x5396fa492e3eea37e10f37702285764fc7d089831df3feff45be5cddaf234ee9", + "longPoolAmountAdjustment": "0x03c5efc409512a272ed49b09bb790562d7e55d230653195cd8c834078243858b", + "shortPoolAmountAdjustment": "0xa631468b07ab1acafad36fe6af8e4dd6171e5b15b0f389152863d5ed47a43449", + "reserveFactorLong": "0xfbb6ba697dea0007f2dfe63729f9b6d4d78cc2c3888fbd8bee34c7f53793c791", + "reserveFactorShort": "0x9152971cd2a935c9fe8856427ea6e67dbf4a7d7c91dd3d8453bb284440a3e777", + "openInterestReserveFactorLong": "0x686ab0fb8f1a7ce1e6168ac1136baf6ef1d576f45c4d9edd406b5d15731c86e5", + "openInterestReserveFactorShort": "0x4f5ab34bdb5d7f59177dd416a256e321b22e5b67a7881e83b64ea51c50943c87", + "maxOpenInterestLong": "0x6dbb18c618b3e7301a534c14f235ebb2d32cbe0b6f623d6a54dda1e06ca7937f", + "maxOpenInterestShort": "0xd7355535495aa1fa5b4a5dcb0c4e1d425b915d29e8df9defe6af81dbbad0f405", + "minPositionImpactPoolAmount": "0x0e42922ba1fc76dc6b424718917fc48c48a7d6576f9c4438fc3539a7798a8c11", + "positionImpactPoolDistributionRate": "0x094afba68bf1416cce140dcd1919ecf8550634aa9e156736ad910efa779fd7d5", + "borrowingFactorLong": "0x7fa24f138ba17a45a1a59c85b7c5b2f2b6497ce61a3bc4868253d9c0efad9292", + "borrowingFactorShort": "0xaaf06c9cbb5b307f795c9043ad176ab1a66aae2dcc757ec31703f6a025646d3e", + "borrowingExponentFactorLong": "0xfa5721708bcaf87881e9c76a87561f51dd33fddc2a6c2a3144728e2bb9fe8fd2", + "borrowingExponentFactorShort": "0x8681ccd606babd825f92d0ab4150b9f6f3090d4d0392d45241156019895c20fe", + "fundingFactor": "0xe26ef6c6686572e1b9165329ed4bc051331c92740e3ffb5e1a35ec8dac022de9", + "fundingExponentFactor": "0xf9dd5d29d72222b3239368ea0772b1419195f28995c653ac3dc6f652b6fa6403", + "fundingIncreaseFactorPerSecond": "0x8321a197f2f04767c35d3108c4ec7ed7578009a65af5cebe1500279da5d1c6dc", + "fundingDecreaseFactorPerSecond": "0x638909f2c4ed0a015be9db325e09c7f857ec6a2bb4f41996ed562c015e038783", + "thresholdForStableFunding": "0x548cf59d9e806c5a7dc713aa395859149f7be4fc3f2d2fc4e3a0f16e74fd45aa", + "thresholdForDecreaseFunding": "0x1d8a2d765e00533dd0dc1f6bdca16603a53ed833a731308fb749ef2af04bcbe4", + "minFundingFactorPerSecond": "0x81e790d23f0ae80a2b8b6040a219ae2a3731dedf03a2136ff79d950914ab7c4e", + "maxFundingFactorPerSecond": "0x34406dae1f399278c36439e30610303e8881eb0c1eb42c6865deeba2e1ca66a8", + "maxPnlFactorForTradersLong": "0x91f778de8f64270aac0b40bb44479cf9a7d2aefb2acabefea02adfa91b4ac80b", + "maxPnlFactorForTradersShort": "0x795d4f86e291bed384ac47280b3905bab11d4b622389f9abd295265a4cb3b9bc", + "positionFeeFactorForPositiveImpact": "0xf140e4b048ebb70318a767afaf2861c9824c804046133fe53a8c28fd95abc1ac", + "positionFeeFactorForNegativeImpact": "0xae6cc55956556a8a91c679697b2fdc574ba1119a77475d516a526734dff64e36", + "positionImpactFactorPositive": "0xb5896aa101e635b6dd6b537b9cc24882580b95e8c282a544938c78a62ebc3185", + "positionImpactFactorNegative": "0x673862b9af47f7a839c274fe6743e7836f5ccdd9e426777a733b88fa9e38b2e9", + "maxPositionImpactFactorPositive": "0x83cfcad7830ac109e2d615c46c7061e128c7ecedbaa7b2eaa0f9c37fc1685633", + "maxPositionImpactFactorNegative": "0xdb820abf9ef22cfc064719c1e3f14e54fe667051dd75f879853d5b9181d866ba", + "maxPositionImpactFactorForLiquidations": "0x287b8c27f13d7884cb5147e3748649d0fa2072aad502b1a578d4927b4d908e98", + "minCollateralFactor": "0xdfe35a4a7d6fcea0730ea6a1d1296f1e1186dcdab4fec5c377a43ce80f26992b", + "minCollateralFactorForOpenInterestLong": "0x28e3fb3d6672b82c0d07651dc08f2dc5b1a60a464edcc11c4ea8b5e0421cb3e7", + "minCollateralFactorForOpenInterestShort": "0x85d241676b23e38f5edd65fff0fbaf35ab45a4c062d5971bd99d31a6cff3be9a", + "positionImpactExponentFactor": "0x4fcc2ef0a8e8cbd0a35c3560320662a39b102617306b41d31e0db602ccbdca2e", + "swapFeeFactorForPositiveImpact": "0x762f094bbedc499cfb8ab344894a1337fa2827d9ca29c1652ef501a23a5796de", + "swapFeeFactorForNegativeImpact": "0xb98d0057d669fde48bf1bfc5fc807f6783d140cce36c5c796f0c9d1f957924c8", + "swapImpactFactorPositive": "0x609b62f795290278ccdd73a7134158fd53801275c79a62f4741c967904d3bbd6", + "swapImpactFactorNegative": "0xd1aa256ef61e9f42f8c1ea56925edaaab20bf4c9c894a1769748459cdc9f1a13", + "swapImpactExponentFactor": "0x4b108c71c95fe54771a329eb035d3e8270d64ea5b79e3ddeb1bdf9d208a39ad6", + "virtualMarketId": "0xb50280db73b9cb00f37072e37efb197cfdce41d687b639e2dbe8f905083cb6ac", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x8ea4Fb801493DaD8724F90Fb2e279534fa591366": { + "isDisabled": "0x4372be187d4f2c8ec9fd686817912e699d4bb927dc31cd2386f59bb4f711e0ff", + "maxLongPoolAmount": "0x13b83c922caf3381f3a7f9e18246ab83632eb1d4be3f1a4a1adb0af4f6324342", + "maxShortPoolAmount": "0x18df251cd91a664d158d2f545dd82839c53e1c1de85e627bce2794991b6f9bba", + "maxLongPoolUsdForDeposit": "0x18dbe7e3853cf96bafe3abb51ce87fc7a027a4c39249408c8214362426861eab", + "maxShortPoolUsdForDeposit": "0x652aee64a1e3d3e37310386895139fa6a63cba630a95c122f47cd4017abf8ce5", + "longPoolAmountAdjustment": "0x4208f8b3088247ed04a2a2cba18423b3f15ae0d661e86b646425d2f5091b9eca", + "shortPoolAmountAdjustment": "0x65623e126e58f80eff131d11e398c2f88f9712009e0438f0db0e05883b89d1a2", + "reserveFactorLong": "0x3168294bb39bed96d3e6d4de8ef7bb7d135c5be041c6314414e37b57a6c8e4b9", + "reserveFactorShort": "0x74725f8e48d7c2966a90c0572ac4b6b03395ab0c6cb9ea5348c58c2ac603fd2c", + "openInterestReserveFactorLong": "0x65717996963772abf0e33287a8c5db6b2fb8e32edea0fdfd03f931672ef86421", + "openInterestReserveFactorShort": "0xbdfb96ee0e4e5b85e639beaa8d5467793789d655bc5c900333d4830979210105", + "maxOpenInterestLong": "0xd11fb6915a208cf7bb9ef43c233bedb246f96f144054f5c8030011aa1a46de6f", + "maxOpenInterestShort": "0x183ab6f271fffce509dff6dc0f927a0641827d4895b920bf7142f5f5d685240b", + "minPositionImpactPoolAmount": "0x7fd84ded3cb38462bca976a6b0b009c3788ccc9783de7968e7232f004580d211", + "positionImpactPoolDistributionRate": "0x745ca5a205794abeb77c501249edfaf5b07b70f9349aa87ab6dac526081688cd", + "borrowingFactorLong": "0x8bf2f160a090e3d64c68440131faeab0a1ffa6d9b90c2c6fc55ac4ae4cfbd35b", + "borrowingFactorShort": "0xd2524c181181bc112ac5bcfd928f8a14a4748800a3241f0ec8939b1a42e86017", + "borrowingExponentFactorLong": "0x581a1f990acce344cc5b93b1da92ca20501fd7ce26036ad016e23f57a8cd7b6b", + "borrowingExponentFactorShort": "0x793777c2e0ad7e72ed364f963ba31cb5a3c48a5aa5a2dbadab8f3e12df5f8f75", + "fundingFactor": "0x56e544084b44cfae1fcd69c5cea792abe26c9ec2dfd0b98bda5b2b037e17602d", + "fundingExponentFactor": "0x502421a1515bf79b5cef15f56a6e2740fffee2503935b4f16a1447676d730d9b", + "fundingIncreaseFactorPerSecond": "0xeaf9a854ec97dec873124c6a45b6e6c82cae4090c3d21e07ce81778f522c8717", + "fundingDecreaseFactorPerSecond": "0x08e2a75d4559cd88934c3f446c42e511c2a04e1348d4b25539cdc88758d0cf52", + "thresholdForStableFunding": "0x6269174f78a83cab7ee9fae17a233526718dda009a638385db1d6a65512ca522", + "thresholdForDecreaseFunding": "0xc20850c2c88c9c4f8a86a60f9d83a5b972dede8dd7943ab2ceca232346c6bff2", + "minFundingFactorPerSecond": "0x102f16b2965dc19c6b81d9742519cd0d38c7db682f5a5b47db993969c197b0a7", + "maxFundingFactorPerSecond": "0xc8050137da6a9f433046c4b36fbf2bc953dceba773ef1225633240d2d85c0a8d", + "maxPnlFactorForTradersLong": "0xca07f7c616ab6f9805c6e8073e3b8774cba4deab4083dae0fdc4534f8564b643", + "maxPnlFactorForTradersShort": "0xa7b778271fee1571b28cb6708c350cabaa3ed6ef606b0cbff46697782a9bd25b", + "positionFeeFactorForPositiveImpact": "0xe59160e09d9e46a995adb177032b42fc9903f8c1a9be530e9399f9663268e619", + "positionFeeFactorForNegativeImpact": "0x53d747159802d68a32d22fc72977cd9444145e25509d61bbb7bae73a62b076fd", + "positionImpactFactorPositive": "0x855cd8b64b05e4e41158e5a1b01a07c030cf28d5023707edf00319f7b34acc35", + "positionImpactFactorNegative": "0x2300b73380f1ea8b3fcc88f736adbcc7196d4e5cb58d48e6aa23fdeb13056564", + "maxPositionImpactFactorPositive": "0xed918a7f0b5755162e808591716e05d3b487c7039d952e15ac9acd2a92c961c6", + "maxPositionImpactFactorNegative": "0x4e865b46729b1650053cd17db3a4367ab0184d8d12518ac0a29217034b6c2950", + "maxPositionImpactFactorForLiquidations": "0xa9251e003d2653e3c04825e915d3cc179577d520b90c0214fd4f656c94ea579f", + "minCollateralFactor": "0x71a615ceb63b3067aa53360b743986465151e56e727f6963baeb6f4a25483e6f", + "minCollateralFactorForOpenInterestLong": "0x5b602b41a9133139c01e6d0627ad253da782dfa70d615dea06e636974c0d2190", + "minCollateralFactorForOpenInterestShort": "0xb184fd747edc421383cd0ef45d3eca4c4551ef1be063daa0f93b350e0ca63299", + "positionImpactExponentFactor": "0x56936ed105ce2e078a8a02d6d884ec7ca0971f6e5bb24cd79e1a74c33be26c37", + "swapFeeFactorForPositiveImpact": "0x0c2a02cb5d4ca72eb638bbc23178fbd9ef50fcad6ed4563b43600dbdc7f69874", + "swapFeeFactorForNegativeImpact": "0x6ad012eb794a17a8ffcf7423e99c003381fe99e2f8a45ee381645195a360a090", + "swapImpactFactorPositive": "0xf173e2084eda5671a0f4ea671bd7f0837776cdeda6178d17d5926537f468c7c3", + "swapImpactFactorNegative": "0xb792682cfb2272eee71294b3bed2d420d96f3b838650917f08eeaf20c6861eb6", + "swapImpactExponentFactor": "0x79ed42232c53bf8b095cbc2384a5205b686c5a13b1b9c7ae12b224621296f95f", + "virtualMarketId": "0xffbd86a67d642bcd2868d7a851df40c2fdb83ff61c2b1d66ad63ced8b6051792", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xD0a1AFDDE31Eb51e8b53bdCE989EB8C2404828a4": { + "isDisabled": "0xc2a26d0b32744416f0b93c1940e5bbcc05cc36c75c92b1fcf9cc4ee4d4f84576", + "maxLongPoolAmount": "0x86b6cc9fd10a55746ad44620f4855a186367e4e7da875e4716d6cbfdbcfee964", + "maxShortPoolAmount": "0x077e6e84f0a3354a4d838cab6e90faa79614b9e0ac471cbc9483a5860aa91f98", + "maxLongPoolUsdForDeposit": "0x39017d8985f796b09a205743b334c400ae1e76fd40709e7de38ed0f8894b0943", + "maxShortPoolUsdForDeposit": "0x8cfad6b706f31cc788d11e9c51041a7c7698cb7996227efb51ff7ca78e341435", + "longPoolAmountAdjustment": "0xd5469cc2f366f760b6764ecb7a207690f0aeb92ded6738c5b86ec9fb8339b073", + "shortPoolAmountAdjustment": "0xe1f3680737522e673b01c90a5abe06ba97b912ceac0e26cb03de8816f6ef5762", + "reserveFactorLong": "0xbe706db7226895515632c2d72b6e0a958a430482e60d7360f2e9061abb578007", + "reserveFactorShort": "0xdb2a481015bb13576346d37b6047c1f62b77f8cc3d0b4ab101ad2ede73332249", + "openInterestReserveFactorLong": "0x2d6034005f0b507fa2cb067c33401703e248f3ec89274f531de1713d22f1a32b", + "openInterestReserveFactorShort": "0x201edeb1fe75baaf9790dbedbc5ab507a51f964189047a6d368a4e9fd92d4925", + "maxOpenInterestLong": "0xd45abefbda34c924c36435b115adc76e3633ab32f631897be17a6b5ed576acad", + "maxOpenInterestShort": "0x634d568b9cd7ef22339de9dea6a289497eb9f8bc9d0a82e70a1f21b3f1d8bfb0", + "minPositionImpactPoolAmount": "0x05b770fca9da756fefabbe10c73b14dcb95ae90ccf7f0b2e74084a19f3162854", + "positionImpactPoolDistributionRate": "0x8bffb489b0269c53caac88f934122899d53fa2c4deba3144bf03c34f6f6a08ee", + "borrowingFactorLong": "0xa48992d1c8ed558d2be8523b947797084f684e51db99656780c45d93c631ae3f", + "borrowingFactorShort": "0x3dc98a78086ed5cb81d9337784a3a127f0f7ac3ee82811324edc26c79abb68c6", + "borrowingExponentFactorLong": "0xb1f1af0aa9cad60a8a7fd1dffdcbffc8b69b11e1da1848d8514c5ac16f03d5fd", + "borrowingExponentFactorShort": "0xd201b9ee875c29bcbb707006fccad0b160cbc1c2266eb04afe78eb84caf4a386", + "fundingFactor": "0x621c0b5f7770027595c090ee631370ea22931e3d83f9df14969ac03e319d5b22", + "fundingExponentFactor": "0xa56c3fd4a833c7935b32192f418c0e05f3df29079477f79d9e2b5c4f19550f2a", + "fundingIncreaseFactorPerSecond": "0x053f2254af9e531d94a039c64dacfe4b96a4c98a3f3635ecbd9d61fe9016d71f", + "fundingDecreaseFactorPerSecond": "0x6f1e01b90d83bc79655fe603fdb4a87b34298ce9d338dbd817c1748736e8b152", + "thresholdForStableFunding": "0xaf0e0d0ec554432caa9f6e2f31df07e47e1a47c1a1191981a491cf905a754519", + "thresholdForDecreaseFunding": "0xb1427f56218254faa3695c7a5485f92fed89c77d5104d9d9c82b9ee032950059", + "minFundingFactorPerSecond": "0xcdc5577e1cd0e8691c43a84445fe09e336fc20f84a16ffa75e2db2718070b244", + "maxFundingFactorPerSecond": "0xc73d22835ccf44694188b7d84e65857850e9346bed1c61a7c0a44d52fa26b2b3", + "maxPnlFactorForTradersLong": "0x3435ce1dc9ba5d1ad05c18a88bf1506c3e19fd9e5112f612b1a6c973c8ea3fde", + "maxPnlFactorForTradersShort": "0xf8400e70e5699ced498165dbcd4f673a2ceac4a31bbcb00a04a51ac0ee607390", + "positionFeeFactorForPositiveImpact": "0x1ff672b4479b096ec040e2f446a621d71be58dbbbe1f19af6cba6b4f719c9e5c", + "positionFeeFactorForNegativeImpact": "0x9f7bbc000233b9646d97ae3bb79a70b2ef9ffc4b4dad350a64f0662d8a3e0773", + "positionImpactFactorPositive": "0x592471e23e8877fed51e465f6b98a83185d15c69346222166e9e70112a399da6", + "positionImpactFactorNegative": "0x172259f1b039320c8dbe0337fc3c4669009ea3e33fbed0f1f72de64834abefc1", + "maxPositionImpactFactorPositive": "0x7ad9019e284cfbcafb6a562e8c38d38afbf8ceb039fabbda946ab2c4016f27f7", + "maxPositionImpactFactorNegative": "0x7cd82495926051f9036de5ae9a571872375dba1755c20cb061227c8c7cfe1396", + "maxPositionImpactFactorForLiquidations": "0x990890ecc20200de9a1bd87598b95848787445930857aef49c72aab7ba037e97", + "minCollateralFactor": "0xc3e99d30df1bb7237cf5b6a371f53440e558f68381ad34cd7a39c8083f6835f3", + "minCollateralFactorForOpenInterestLong": "0xa9b976f225b7a1d9aa149a1674b712b8da2245e1d36f7e336a96c3794de912cc", + "minCollateralFactorForOpenInterestShort": "0x67fcd6cd3ab04ad285b2a1bb5393df7d7e368846bc8c2654c872e61cbdadb18d", + "positionImpactExponentFactor": "0x6fe9d3e57df23a89ed73e33f91d91d31fd23406654cf3de63dedfb6568389941", + "swapFeeFactorForPositiveImpact": "0xc1d2acd5c88eedc10e84ea9905b6cee5274b2e01c1325a574170d39a27a28603", + "swapFeeFactorForNegativeImpact": "0x9eb334e661c82faf90d0bfabbd8831d8bbfffc2a15d5caf6a53bea1a52a11f2a", + "swapImpactFactorPositive": "0x995b47106472df08b1d99bfcdf5a5c58a22fd505cb0454ba3c65d25836e5e383", + "swapImpactFactorNegative": "0x6fde49ded6431284fad0ab80a5d2bb9e23bc71bdb6768018feb1d0d92cea86f9", + "swapImpactExponentFactor": "0xe7230f74591696274ab9b6e56d5f6a7da17e29e6a1e6df2ade2e8e6837d6cb0f", + "virtualMarketId": "0x867f8307648d7c8c0fcfa9ce7bd2e268ae4b215c281fdb565dc0dd2a0fbb02e5", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x77B2eC357b56c7d05a87971dB0188DBb0C7836a5": { + "isDisabled": "0x95e82d72390bf9b3b843cba31ac621a3c22734745c302be49e4c5a803cd8b823", + "maxLongPoolAmount": "0x656ed4a462354bf326407ef958cf4f8f9024fef237b8d372a9a2176aa4a28853", + "maxShortPoolAmount": "0x41d79cc17934907521c7dc2b7b24f7aec03b9425cdbdcab54c74d3a35711f084", + "maxLongPoolUsdForDeposit": "0x6c5eb7f9d4d0928b5469d0944942eadaebc0f62922442e011ee0feec327126cd", + "maxShortPoolUsdForDeposit": "0xe06e15b2f7c8143a29ac75b446a8133194b708351ed0ba81089ef8be4319a97b", + "longPoolAmountAdjustment": "0xa637c37d4fd1d67c0d3890d92d44ea2a277857b8b3bbf53568420420d21bb1b5", + "shortPoolAmountAdjustment": "0x034b1e59aec58391324f3b58b470b403cd3389b6afb4050081984df995270ad5", + "reserveFactorLong": "0x5dec12aadfd302aa6928230d5dfc6fde685430f2061e55462b4a3b4e1a2223d2", + "reserveFactorShort": "0x4cde10f84bddaf4ed2c3fbd897d5c7353424b3edbf48577bda0e44c6f16f5ab9", + "openInterestReserveFactorLong": "0x85e69e50a7b4156001204bfc3fe7098acf048db35d141d1fe624ce9d916749a3", + "openInterestReserveFactorShort": "0x80c1d08b630e1d9dccbc3ebc451b954766afbdfa3207d1a14346f0afa14e7b24", + "maxOpenInterestLong": "0x945b049a685f2b17103c297ddc70ea658a8e3605b8f961c2169edde8f4d4d9aa", + "maxOpenInterestShort": "0x9f18ffe86ae1570c8725707065a1ab0bdc36d38f5af1dc383cc639eb71ca87d2", + "minPositionImpactPoolAmount": "0xcddd72810d18b386353a328b7806bcca9dd8949e9f1dd21235e7bdb3d74c7217", + "positionImpactPoolDistributionRate": "0x4145a2e014b43e5ee5d61ed4547f904dea491c1098297d2dc45dcffc8b4fa131", + "borrowingFactorLong": "0x7111f4faaf17eb4714b9f9e46fab71444e2a3bd87af29fc60a67e21b75635644", + "borrowingFactorShort": "0xa944d0eda1c44f5282ddaa9bba4eca8a600dd95d828822f02beeb599806b3def", + "borrowingExponentFactorLong": "0xac6fd3bf16c41ee2d9efce0f16d0189609f372ca63dc472b0b64e0f704b1ba33", + "borrowingExponentFactorShort": "0x1a8e9a35c9446874a5da0f45ea41be4bec7569053c138b08445ea71394c252e7", + "fundingFactor": "0xbd7ae30122c785d45a79d34be9df1777440dd5aac319a816f7e0a1d5ab3e45ec", + "fundingExponentFactor": "0x3fe8a3674040b2a30c404401c6423bbd36b31293ef33f566b33c05d38d64ab00", + "fundingIncreaseFactorPerSecond": "0x417b858ea476a4ad517ea2d283f5755befe5641563a914ff25868dbd232bfd74", + "fundingDecreaseFactorPerSecond": "0xc62931bae4de071ade66eb9d53d4371cc99bbbcfbace5cbe650a3a5b809946c5", + "thresholdForStableFunding": "0xe6d98b18960dcef4d67688b94e189aa23d026525d73a38500f6fafeff026db4f", + "thresholdForDecreaseFunding": "0x7ec0755f81c8288ec50843f2f96e3f0daec02e2014e1c9f1f3780368cab97d7d", + "minFundingFactorPerSecond": "0x76b82d43b6fae96d6a4e995a5cf2cb3fd0dcb28a2529fef9c42281790c391914", + "maxFundingFactorPerSecond": "0xbdcdf2207e1ed7bbf132ff481b5821964c764f82b9a0d3710cb1c3e2ebfacab8", + "maxPnlFactorForTradersLong": "0x1e9639bf478f9c1c6e3f2c86487f1d095e877143acfa2abec4d8e529c16ddfdc", + "maxPnlFactorForTradersShort": "0x9e2ccf0a5e3d1e61b01dab339e6b8e898fec0c99aa7f3eb9357c92c3a1973226", + "positionFeeFactorForPositiveImpact": "0xf07887eec3f30afc0147d9f489b64d03f360068f48998d05a9ccb06187b6be07", + "positionFeeFactorForNegativeImpact": "0x0f7f470662d96642b2c2c82cccde4267736d60b558afaf66fbe7ab57ba67cee0", + "positionImpactFactorPositive": "0xb9b5fcedd5c91a9d3c5c40a7a7a065885bd09fcb02181cad7b8c323c373875db", + "positionImpactFactorNegative": "0x2ad2b91e53b4a3a925e04f8c6d6eab8bbd1e770f8354fe3518d501bb86115c20", + "maxPositionImpactFactorPositive": "0x19b6035bb9a91088962ca09e26b08a5bf95d95b97c90f4f98ce550cb3e280d23", + "maxPositionImpactFactorNegative": "0xf37ffd53b8ec3da5920c7e9003549490450e14e5f51725b0629e5dd81b4516a5", + "maxPositionImpactFactorForLiquidations": "0x768e1e0b9c1bee456110ec4ba84080574645b213cf3551ac1d0146c3fcf1ae78", + "minCollateralFactor": "0x063c26170386b99ed813e28bbc466b472d58fbc4c565896708a259e15c426026", + "minCollateralFactorForOpenInterestLong": "0x49b7345940105477f772afb7f563688a99053ca3edca50f043ea031ef1bfa630", + "minCollateralFactorForOpenInterestShort": "0xafcbb8875e23ba9ea3aea7c817003ce9fd6c9f7e3a7397dc9d355d7030c1c6b9", + "positionImpactExponentFactor": "0x0e24bdb43d7906365809d9ad11ddd0a0b2d13541544125fd45e8f3e772df585a", + "swapFeeFactorForPositiveImpact": "0x48cff709ea1bc1d7c25bbd8a21ec36fb0103a61fea7b2d79e71443214893b878", + "swapFeeFactorForNegativeImpact": "0x0404920bfb8782dd3c3ca6bfaf367ed5b12377e0ed5cc20539714b87331a1e35", + "swapImpactFactorPositive": "0x19e448c0928954fcb9a9cabbcf59f3132cc20f890325d3b12a4c7e8cda0fc283", + "swapImpactFactorNegative": "0x6a0d172623fbdc523516101821ee8863144416e7dd357b967bc205842b287bcf", + "swapImpactExponentFactor": "0xfeccfd7ff923ae1f8ec494e1b6701a513a7d9c47b645572d323b17a79e0f4bc5", + "virtualMarketId": "0xa4a5ca1f8a367c4926788fc57c91dbc9e5b2142056b0c9b6806c597606437b2e", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x0Bb2a83F995E1E1eae9D7fDCE68Ab1ac55b2cc85": { + "isDisabled": "0xbf7db0d77eb826c30bd266ac077361bda65b64497541c7352cd22fa03c48913a", + "maxLongPoolAmount": "0xbc5780ad2094bc1c8db76142cb5c51cfbbfd29af4c3636ab700895b6822e4875", + "maxShortPoolAmount": "0x75b01148baf3ca4e605487e57f83c7a5cd8c8dcaf9d95b9d1337c2697570a12e", + "maxLongPoolUsdForDeposit": "0xd6eb01dad0afd5f39d0bf04a1d8d837d78397e654b3f121ee995a58a2bf9ccb7", + "maxShortPoolUsdForDeposit": "0xf600b4b9b0e68f1d6266086e22ecdd527cdd06ee50b67d6a9eb56abebbd54c4e", + "longPoolAmountAdjustment": "0x0f22100599a00c27f438ed457c29c76d055d3ee17d8be268a822813a73bd2eb5", + "shortPoolAmountAdjustment": "0xa5c611fd1aaffc32f289d06ab7e0c5b6cff79e699189588b26cbd3b9dd13d5a8", + "reserveFactorLong": "0x12ca7eddc4f110353a0a86c16d0a9995d54c04325238797592699aab341788af", + "reserveFactorShort": "0xfea167067b4a1bc0b5d94f514f4ee53c8c2a1f7f15142aff87539ee474eb321d", + "openInterestReserveFactorLong": "0xee329acad8b04a9bf204b2a5fb6c131b451b20a095ffe6d919146221be2bc44a", + "openInterestReserveFactorShort": "0x79422dbff858519ad7e11b861a09a3d4a96ea708628ad9db947f929681d8c307", + "maxOpenInterestLong": "0x2aff8ad7968b69d16c592ffb9cbf99c3f47066b879dfa6a96ba2fabec845b20a", + "maxOpenInterestShort": "0xe7c2a027ee9d4b33e72bbf47f17351df5a51ae6637f3008edc7f63b82be4ca0b", + "minPositionImpactPoolAmount": "0xf951a217e50c1b581e7868aa3abc8c9ef070d738d4d83dd14180a09173dda5e8", + "positionImpactPoolDistributionRate": "0x4c7ecdc09f14f73c036742658f4d315c13f6b33ad0f882a570eb39ba7ce44973", + "borrowingFactorLong": "0x4cb7b7f230f90eb3bfa17546d7bad62b06128d78a8c0eb78d317fab2d4f37040", + "borrowingFactorShort": "0x5f4788c430994fb4b9f8a9a41834925efaca135373dd41a439ee1cc83ddddaa6", + "borrowingExponentFactorLong": "0x0d8b4ce28f87974a0e9b063297dedadb016d53a12ce1e417673fc6725a9e3a30", + "borrowingExponentFactorShort": "0x4a05798d88a0f239821bfe907a433d1fdd6a03828a8d3d3c31fed1b300f4185d", + "fundingFactor": "0xddbdeb359b61ee366cae6a82af79c4d34344666a2d859e4c6092d5962c13be6f", + "fundingExponentFactor": "0x93e28c0bb9589f3dd3622070e9c78cf26f6de5a5a9393a946ed7f8c784027ce8", + "fundingIncreaseFactorPerSecond": "0x70574be92eb77b955ac8a5e2d4bbaa733be571d6e7f1b09947f87ff6483e5026", + "fundingDecreaseFactorPerSecond": "0x5a473651a9369c56939c850324639b62af72ce95e275db077fe47cd6bbb8878f", + "thresholdForStableFunding": "0xb0e481946566ab6c479b3b81c5e0b7d750240c636d475097e21dbcf6b5814794", + "thresholdForDecreaseFunding": "0xc10c4176fe8f1ae8fd992fa2bc67d35f54b887080e17d90a4b9bcd6445bd9944", + "minFundingFactorPerSecond": "0x76772d6012546917375ddb095a5503985410546ce08beb6d28c426e6c7feffac", + "maxFundingFactorPerSecond": "0x231ae23473685d04ef11c3f42aa7abc80bda19111e19f8af81a16565c0d341fc", + "maxPnlFactorForTradersLong": "0x0e6ee86e4636087f668e859c1446bbdb621df2e89db4c80682767bd8c3f4a2e0", + "maxPnlFactorForTradersShort": "0x758917d8b45db106bfde22a64cb91efadb0e76531160f2e79daa9da99961bbf2", + "positionFeeFactorForPositiveImpact": "0x493d7cf32315ed2576fdb6556232938b3ba4d8fc4c7c129f795f312aaedf1e99", + "positionFeeFactorForNegativeImpact": "0x0f09eb3de794846219c162423714c95efcb52241bf3495ba262a8b65a5f15077", + "positionImpactFactorPositive": "0x40cff93be7a95242a1789f12175aef67bc23fcc2daeab8753ea2bb08fed670f6", + "positionImpactFactorNegative": "0xf54c1402f09610ae072a8746966b94006d7c7a1de7eb44f47b7eb29fbaef02ec", + "maxPositionImpactFactorPositive": "0x786d142f5056003f1e7cd12b82c7954ac0f65b0ddeee41aaab69846be14ba1be", + "maxPositionImpactFactorNegative": "0xbd154e1d9827e166d594ccb658c4b5babe79cdbcf980e65cd25c661aa87071dd", + "maxPositionImpactFactorForLiquidations": "0x10f4c29b08a9a5521940a0f61df0361c0a98e01e3be448bfc8a877fed3e66a67", + "minCollateralFactor": "0xb30c0c9c615ca78136924ffcfd347ccbcfbd07cfbb066331490e171eb1a0a98f", + "minCollateralFactorForOpenInterestLong": "0xffea67e6c99a9d19d8e0fc2310bfa16b75cdc3634fa319d67a8ddedd5aaaab29", + "minCollateralFactorForOpenInterestShort": "0x5b380cc5290171b8adb5730fc97eeaa8eb027e04035944e2ee6dd395cc26143f", + "positionImpactExponentFactor": "0xc883aaf52b8c7712b5e3de31516b99dddb2d07514d55d14f1a8ccde642ac9ffa", + "swapFeeFactorForPositiveImpact": "0x54ed8f84ebf52a26785f7383623bfeea82c8602db2cec9305c72de8bb57c9880", + "swapFeeFactorForNegativeImpact": "0x69273f9d47ea8b35c92c122a3100ed560284f8f1dd8a75144f5b184e13f2f88a", + "swapImpactFactorPositive": "0xff7b5bd53c1fed235757a116187bd94c2bfcc5dccf9c79d3afb485782a5a86e8", + "swapImpactFactorNegative": "0x2349db6b6cb6bc3749db19a55dfa7795476c7bfbb8ee0474769e5537adc48653", + "swapImpactExponentFactor": "0x88a425e4fb5c7e4b0d858949061fe36dc6212bdee8d5e60a704ff90577560e5e", + "virtualMarketId": "0x352d11c1d47015bbb2f18d6dd602155a9def60d9b7e2b8c501adea36dc0126ce", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xD8471b9Ea126272E6d32B5e4782Ed76DB7E554a4": { + "isDisabled": "0x2f9bd92ad875b4bf6191eeab2dbdd2708bac1b093b14745c24c10128dcc4a6bd", + "maxLongPoolAmount": "0xfe08f587af77fa3fe7854423ed0e9497ca454a24c61672a43aeaf94bf048ffa7", + "maxShortPoolAmount": "0x29ddf8072e6e4fb9e682ccb0c541c7d15d3caeeaaf2801f553a51694f949a687", + "maxLongPoolUsdForDeposit": "0x150c3e183d86da659c5144b8e2f8de2c1fe4817967ccd9a39f972e04cefbf698", + "maxShortPoolUsdForDeposit": "0x4e0a77b97ad82ca4aab700400cd7ed8d02875c3ed8566e31a69ee3db7d39d573", + "longPoolAmountAdjustment": "0xf12ee754a9c2b7f3172d8852df529e35fcfb5c868d9b3ddbba626397cc661de3", + "shortPoolAmountAdjustment": "0x195a8be658537b44e4b238b949dd48762fa4e5229eda4579a300be9235628e60", + "reserveFactorLong": "0x998db8896b7d69f152199916a26991dd3fe6e7e989a333071236edc7077740a7", + "reserveFactorShort": "0x0c320c244888cae4e7ebff6d303a6d8b3d72360e85a4c9f4b750f6821f8e86aa", + "openInterestReserveFactorLong": "0x6eb35c2ae6dcd4b81602ab9fa3400324ebc3fe0b9768fbaac22da77cc23edd21", + "openInterestReserveFactorShort": "0xaa3ac7a4105b04d32b59bc29894eb9de0930f259ea3124086c74c09b256ce6b9", + "maxOpenInterestLong": "0x038d6f0b0584d7edad576617845af1bbd629d6cf7de8d30732c1bdb731d30985", + "maxOpenInterestShort": "0x37925b93ec04a004ebf91682e9aa2b25f1afc635c01c5dbb214291f36e68c7b6", + "minPositionImpactPoolAmount": "0x2352b34b1c1d71b7d12a3d5a2db83bb2735a8180e4d4c124384dc91f57f7a50d", + "positionImpactPoolDistributionRate": "0x6a977be38f7bf0483909436d8dc07f890b43a452e986afb5f4625f05cf1c6c1c", + "borrowingFactorLong": "0xbda90cf4c533e55a11aadaaa08a311c9397184321af642ba758f5313b6975a48", + "borrowingFactorShort": "0xdd201408380209be71825a942e8e46d29bdb384c6bc47a72200d5d58df729fbd", + "borrowingExponentFactorLong": "0x276f7f8e49aa7148993578172bbcadb608836e9cfc65bc3fa27e87aa6fa224bf", + "borrowingExponentFactorShort": "0xc1fad1387fb5998f751592149024d028ccfa34024559b4cc57bc854c52d380db", + "fundingFactor": "0x5b6c60079a78c3b79361f1276943894bbc16d7d78c525b563aa37b8267a09b26", + "fundingExponentFactor": "0x6465c9eff92d6069942ba784bcf28e7ee3e132c0d793601a21553697e1d62587", + "fundingIncreaseFactorPerSecond": "0xec1c8c8a987627847edd8a728a30f768adc254a78fb1b86638032890c3bbcd57", + "fundingDecreaseFactorPerSecond": "0x060b1fb0f7ee2803fd2a9667d5e3e80c3ea7119811c1e23b53a874f1c949c583", + "thresholdForStableFunding": "0x00c7f046c4f35d07cc7f1857ed10817e3be1299096cdcf6f21a0972a9d36eeb0", + "thresholdForDecreaseFunding": "0x5d186bc0dae78b247ff8c525147ddfc8c019849583521f948adfdc612d2c80f6", + "minFundingFactorPerSecond": "0xea06934a98234f82558292d0f496e24f766457449a0c5369df4983fc8a3b05eb", + "maxFundingFactorPerSecond": "0x6dd09fe578a0d2f802a55247f16e453c5e0975fe31470136c13f70b57707b47c", + "maxPnlFactorForTradersLong": "0x8e310d1456f3e834278f007a80efac7013d816f68aca59d6a478e049914ca1f9", + "maxPnlFactorForTradersShort": "0x1f09ebbd17b78d190303bc6331e789197fe9b781c767d947eefba5904256e90e", + "positionFeeFactorForPositiveImpact": "0x5c0d2e79c65ad90be3dfb25475dbecdf197f86d6d288318a16ed53493201ba7c", + "positionFeeFactorForNegativeImpact": "0x2705f2437c8e5e3bdfe0663ff0e749ea4d73671b89d2ec3e72626200b6b75c2a", + "positionImpactFactorPositive": "0x9f78a2142db60a7d5eab84476a06f69252bb6e21e4b0fce2de8145e5b8765509", + "positionImpactFactorNegative": "0xf9f25ffd4b9320df0e661297bad0f80ce9ec7d0f2c672f70d8376da8e2bcdfcd", + "maxPositionImpactFactorPositive": "0x554195019be19dded2deebdf7bba714dedc29cf6194613468be1447e51a8aa7a", + "maxPositionImpactFactorNegative": "0x0c49426f88135deb7578441b1a06e9cd0458f2610f844a0e06ee61e846cfca66", + "maxPositionImpactFactorForLiquidations": "0x8d46a381a9692d246102e90ea5b4f53000b4f9407ec0d053e82d3a9ab324cecd", + "minCollateralFactor": "0xaf529b6d8c16416ab7e8dea0fee2c88b02a2582e96fd786c3c4aa1b6dd7ab315", + "minCollateralFactorForOpenInterestLong": "0x4d83d368f9ff304adca7477a95605fca7d41bd25fb35ffdba3dc61e7bff2a83b", + "minCollateralFactorForOpenInterestShort": "0x62e8fc9c6e9f155895f43e9edcf84239b180c4e9737887a8b86545ada24195c0", + "positionImpactExponentFactor": "0xc2b2c25918334d3d885588d558503500beb43b71d72e9cb05e3e2b86e5bca6e5", + "swapFeeFactorForPositiveImpact": "0x4fb41fdd043a724e464d95478c74670b21d3a4ea15c7c2e96269b41df178abc6", + "swapFeeFactorForNegativeImpact": "0xfbaf2e48e418c8af4d690859073a3a79040c63c1f4b4cd1c41bae9a5787190ec", + "swapImpactFactorPositive": "0x7459c01ebffc50f3aea8bf2ef8ab6cf36d2b2e7398811e79ae65b427c7a4cc45", + "swapImpactFactorNegative": "0x42f1b2dcd3ff9e25ca0ea9e9ae7ce948a668d2ac2ab3d078020a55ef96400ce5", + "swapImpactExponentFactor": "0x0836eed83cef2717c66ecd1b31f6d02efa3ddb2278915485d1c5f71f220a1928", + "virtualMarketId": "0xbcf8771e6647348c49962927093ad7bb98b885b43bc7955aea88ecbc01e86b5f", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xdAB21c4d1F569486334C93685Da2b3F9b0A078e8": { + "isDisabled": "0x75e426a8b8395f409289320e8c7e1ac1cf7da51af4d76f3a81c2a846cc2acf9f", + "maxLongPoolAmount": "0xc361577f0096640c200184e77c9ab025a39e9a439438804608967cd0eb138f7f", + "maxShortPoolAmount": "0x84faab0ccdf3ee4e7105dc73594b197387cc6bb9c8daa33723580f7439aff018", + "maxLongPoolUsdForDeposit": "0xd6eb2c8aa7ac89bd3dfb19a91fb683935b663521ed17a7c6a662d988aa6a45b8", + "maxShortPoolUsdForDeposit": "0x5fe3f10e4cd6db855d0c8699b469690515a88984e85ed698fb2ce138840d520d", + "longPoolAmountAdjustment": "0xb558ddc272b1613bb91320b6606a0085b4fdc5c62edc190cd4cd8d886672feae", + "shortPoolAmountAdjustment": "0xbb071d7a07fd095c75a0893a9729ac2e0645ff5c53f3c335bb30967916400b62", + "reserveFactorLong": "0x4277f84bf91ccbae1b0e075827097edbe27a669f91961a39614a7f9946ee5b9f", + "reserveFactorShort": "0x799f0f314fb1532ad600764baebc4083c270a82a09b059147c9e8eff7ff42899", + "openInterestReserveFactorLong": "0xb8a05c2cdb3ddb962f40734e3bb4a1bb3fd24e70d5802749fb400651c7877ec5", + "openInterestReserveFactorShort": "0x913817dc14e854262d41fe802aad351b5ab6dc755d2586a97d3df1c1fb634027", + "maxOpenInterestLong": "0x74fcf9a673745ebfe620b1efba914a29c086c2e0e1e675c77488824bf2fd05b7", + "maxOpenInterestShort": "0x5c9fe289f3415edc91560500460584de2995da5e7c6ba22585471db54ed32728", + "minPositionImpactPoolAmount": "0xe82df00690ab76eaea4ef07162da6b50f5c57013f005ecbec9aaf84be4026ec9", + "positionImpactPoolDistributionRate": "0x2fd4767cdcf786d963000741e94a57b34c01dd730760f36c274104e3539054bf", + "borrowingFactorLong": "0x49881a4966f4565b05d55b3cb687bc781a668a532415743702c6fe69f7806d06", + "borrowingFactorShort": "0x20683d47e9f6cee697e13cc90aa971c512bc44a50a44c4a69c0796f86aed1670", + "borrowingExponentFactorLong": "0xecd5d2450da7e16d517b845ee91ee346b917590db8e0c72d8149998cf8ff0f12", + "borrowingExponentFactorShort": "0x893be6247342567870fab0f5b935927d999deb3c7b1f4aa43e88a8062ae5bb6b", + "fundingFactor": "0x80d8454b53b2de35d60fd6ecd411ee082b885bf7ad173e353d17a5bed9bd27c7", + "fundingExponentFactor": "0xa0347abce1b384641f129228d63ac8d6460f7d8226ec387177a65d3e2eb75551", + "fundingIncreaseFactorPerSecond": "0x18e4d6b239489579a7f52182df0bce951f140075a4dc06edaba85269facf4f93", + "fundingDecreaseFactorPerSecond": "0xd4da7a3c1ec88317821c1c54e9915349c2968da576821217ba33042ee8b326e9", + "thresholdForStableFunding": "0x7fa6926e67cacb8fe10528420b5bb54643599e747dc6b5b0cc4987301b51d15a", + "thresholdForDecreaseFunding": "0x7a225fc839ff4b09646412aee2fcb0a774288bf04471218d60035785b726514b", + "minFundingFactorPerSecond": "0x010330b5b34a42a60803ca551510a745bb3eefc64ca1dc53f4f1cabc37295987", + "maxFundingFactorPerSecond": "0xbb71ae099045fbdabdb856feee219f73d825249c1e141e62e4d6c8311d96850e", + "maxPnlFactorForTradersLong": "0x2cadfcd4e17d654ada050a5d994209e709d70637f6fea841b8c6dc6fa6b7dda1", + "maxPnlFactorForTradersShort": "0xa9d11314eb3f8f6667b2ce35bf54ba6007ef811471a03c2812901fc845968cb1", + "positionFeeFactorForPositiveImpact": "0x6a8195663337d4db3cb56a6f8702a7aeb0b9a25864376dfa9727b59bf15fa1a0", + "positionFeeFactorForNegativeImpact": "0xd732b50d5a27eeeb3c9f13320266b5c0f48a4cf28bd08ee3341e5d17ef6a57a2", + "positionImpactFactorPositive": "0x99695421d96317555b37f315cdf03725584fda95559fb3c6d3adca06c38d23de", + "positionImpactFactorNegative": "0xc4c5609be5dd555ca967fe416a04fd54438a86edd4f859a111207dfc9ec9ed1e", + "maxPositionImpactFactorPositive": "0xb24b2729d4b986448d34d3161d59c59e280251393ce4262181a2bf7b70e645a4", + "maxPositionImpactFactorNegative": "0x093f21e9a0ab2debd31074f3e73a51eae6adb17095a69777b31fbf09ee66794b", + "maxPositionImpactFactorForLiquidations": "0x6e206fd42772e8fe8a8835b6306583de3b225215da66ffddfff05e9fb823a8e4", + "minCollateralFactor": "0xde8e2683a32db2582bae01bac254fc9ffdf847f49c73f8e40d70831d516a0d63", + "minCollateralFactorForOpenInterestLong": "0x2352a72b34e744b19d46183f2e17312f8c6d8e6e55ee031745c01426f29f46ec", + "minCollateralFactorForOpenInterestShort": "0xcb4811e66720bbc8c900831dbe35327485a8fa6aa48d94e28be4ad20e7cfeb05", + "positionImpactExponentFactor": "0x335695a5a27844054e1229edd8c203f61834fdae52a2761be583d5a8b2d87f5f", + "swapFeeFactorForPositiveImpact": "0x0dbec8f5dddc19030eadf103f8d951bb8a586ec11a30f86b8fdf75d565d9ac58", + "swapFeeFactorForNegativeImpact": "0x59d63cc7ab7a3dff92097678f7a98e7f1a3cf7a97616b312e871fc39bcf673df", + "swapImpactFactorPositive": "0x461a95b066cf6086852497f137b3ea75bd3ffec0796c7d9400c8e5a92037d7cc", + "swapImpactFactorNegative": "0x499433d197d5305ea41dc1d247e491dd6975ce88fab6979e485537a86d043d6d", + "swapImpactExponentFactor": "0xe10b5f823fb387f827b6a600f049a9804073a2b410ad2d1789dee8f418388267", + "virtualMarketId": "0x51d0a8b4aced607bde6034b727d384d3b742d8bd6da553a2f63802ff762209c0", + "virtualLongTokenId": "0x4d68d2798555d20bf717b1375b599dc49e3af2789d5a47388d3d34b97b7d9f67", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x6Ecf2133E2C9751cAAdCb6958b9654baE198a797": { + "isDisabled": "0x5aa714bf721d4670e2ac8637b21067517931903b1fa593e1caf2bc4827e06c4b", + "maxLongPoolAmount": "0xef9bc28514adc9267f2bff66de4315a89d7b56389640be7608dd389505745332", + "maxShortPoolAmount": "0x7cacec68920f057960601c467852cd1c05a10e546a7d23d66326e1bd7e332a11", + "maxLongPoolUsdForDeposit": "0xb3691355f4618fdd46f03046d1781539509bbb07e2efb08fb33b59e8108209c1", + "maxShortPoolUsdForDeposit": "0xfa914da48abab816d982df4622bee9262d9840d4e97eb095f2fd9eb856d339ab", + "longPoolAmountAdjustment": "0x203a0758567629ef9e34e21f1251453d8f6f4bc6da0be052cce031e73657c99a", + "shortPoolAmountAdjustment": "0xbfa7b79a9ef0076527b4409f6e8d5ed5c168df000eccba8ef67f734da488d353", + "reserveFactorLong": "0x4a96aa84fea7967b22a283790b994176fe9c6b7994bdaf147515780c5f70a7d0", + "reserveFactorShort": "0xf533ae904343421c18793a353b3dbc67caaec80411525a2b37f1a45d601a1fc4", + "openInterestReserveFactorLong": "0xb3faecca93177abbcc6f639957564b18965e4ee42896e82c19b3d4e416d02729", + "openInterestReserveFactorShort": "0x4d6b598e699cb19894a1fcda51a181054840c538bb4de4c12b69c730e2f73cd1", + "maxOpenInterestLong": "0x84f8b758a81dc4da6dd8ec611089a541fa70dc7efbe97ad221562ef04432a9cf", + "maxOpenInterestShort": "0x5a0dfec3682052f2f13bdb6bd249736d9203415024c7502e22d2b3dc70f1b5ff", + "minPositionImpactPoolAmount": "0xa4a349515601c8704bda8ceaaa87427a2fad521c54970222e3b2d867e3b0b1ce", + "positionImpactPoolDistributionRate": "0x31ea181f238228e253d0c0d97827f08de2fdbb046916989afff2f51bfeeb1fa9", + "borrowingFactorLong": "0x3e8cfcef19f4f9218351a830759478bc0ae04fe3ad754c04415018e96f9ec075", + "borrowingFactorShort": "0x4331c95cdca84bc08e83f5f844bf605869f8b5fa5844e129755352b70020e4b1", + "borrowingExponentFactorLong": "0x56dbf1b2a5a7a8005116a3344f048f6e1466490af9f8fc7ea97937d91b6df753", + "borrowingExponentFactorShort": "0x4da904f673f55e52aceb6400b0fedf5b4b43e611f7b545dafaf0b811a11704b1", + "fundingFactor": "0x13e4b02829eb6b299a1d174beeb0d79a7a826c4448e30511b7312f7ad11816de", + "fundingExponentFactor": "0xc63de01a1b1699f69bfff95b8030e8d66501520a8cd046c385c5d943dc1a8d85", + "fundingIncreaseFactorPerSecond": "0x972c16ebb5f51f5016b94fbe8c2952bb87216fe6038e995c25ba787522d2ad52", + "fundingDecreaseFactorPerSecond": "0x12cbb34ee32ae32df89a6093a04cd8bce31de163abc1825afa3dfa0e7d3d1003", + "thresholdForStableFunding": "0x905b10e0b1d538e9390e4994d8304297cbd765fd9bbf0cee65507e765dbfe139", + "thresholdForDecreaseFunding": "0x5037bdd9ec03549ddcc5b6d2ec14109b21dc4a1b8eda83baf8e643d5682c5b02", + "minFundingFactorPerSecond": "0x55f9e2e807bb342b523acfc6018cbdca1c8d9d5ee7f88e616fa8f7e2c91b147e", + "maxFundingFactorPerSecond": "0xcf7b665da2d105bcb27781fe68c363db8732c0794e0df27ca9c2bcb907990433", + "maxPnlFactorForTradersLong": "0x284fd994c8c1361d712bbfe0bef917ebe7486477cda2bb8c3d17ced46552f834", + "maxPnlFactorForTradersShort": "0x3a1cca2b9c435bad26e1ff77b841a349feaabd02386f9e7b2d58a14b3c69aa1b", + "positionFeeFactorForPositiveImpact": "0xe21f27a70af775536902487c5ce88233c67cf0c743555b8490ef2483150513ba", + "positionFeeFactorForNegativeImpact": "0xa665c582bf2cd99dc19fb0302fad3c4ed2ed0e7423e288d22ff13816351a93a0", + "positionImpactFactorPositive": "0x32beb3676955e674bfa936e22b7e4c93a75a451387f996c4248243cbe1d323c5", + "positionImpactFactorNegative": "0x0b90f13784d0f8129e986101813c02d873aff0fd427569138444995f46e6e662", + "maxPositionImpactFactorPositive": "0x19a1bd926c6151f48a05d3aac08ff880ab7bc87a6ed2b5292569196a64c4a525", + "maxPositionImpactFactorNegative": "0x431d4f40d2fffb4de5d661edcbc6b0e6554964ec51cff739f127f68ded07377d", + "maxPositionImpactFactorForLiquidations": "0x561b7c6b780552b688ab9f8e3bc96dbcc018702e3caff500fe80d5ffa9d62de3", + "minCollateralFactor": "0xe12f227cd7530228e3e5fd17cc6e483d16da92b2a84c0e5ff1da9e812a5b165f", + "minCollateralFactorForOpenInterestLong": "0x17278babb19736222b2d9de676d18653ddf62c086d3665741aea4e5073e56fc6", + "minCollateralFactorForOpenInterestShort": "0xd5a1fad8da19fe7337b65624c25c09577ce75115b54770ff38ef6bb95dda326c", + "positionImpactExponentFactor": "0x804b39a27e2dd8f1ff7b9c8b9e8c617f279de79423a04c8fa048b1a7d04e0a87", + "swapFeeFactorForPositiveImpact": "0x19c203129972249281a0b60e7b622a8d66a1d7bf798dc42ac056684d96e71805", + "swapFeeFactorForNegativeImpact": "0x323d04891a07265a4b585037fdbdb85d79170c22cd5f34dc3864039d93a1a6c0", + "swapImpactFactorPositive": "0xa71869892b9b6533e98daebca840e5d5536dc60b02f242dd2aa099f47e3a36bb", + "swapImpactFactorNegative": "0x4179e67be0eb7afc3c56a4d16854b7b691f85c5592c3c13c743bbfe2e519a76c", + "swapImpactExponentFactor": "0x399b4895a6bb319b3a1df26d56ff6b188547f4da5697c2a2d3109186c8d50962", + "virtualMarketId": "0xd3a3de86c5e60d99f6739730b9d43e55d55d3759cad41b823bf67cd07aec447e", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xB489711B1cB86afDA48924730084e23310EB4883": { + "isDisabled": "0x188914fdb1cb1c1bfd4a9567d134ec8330d2f9bffd3e3b79d2662894814c1754", + "maxLongPoolAmount": "0xf0a217ab360044fa4aae531d6b8d2900c65a2b77fb26ea47067d283c9bcd3b7e", + "maxShortPoolAmount": "0x2933733a651d96ab7e4c5f0d575485231d9001d78f0a763f3ab35d8c748c1dd9", + "maxLongPoolUsdForDeposit": "0xdc40bcc145e3e7bafa9855edfc69054077e68567c4e132f133c6e9f3945172ae", + "maxShortPoolUsdForDeposit": "0x6a96bb3eb9799aeeaae8eadf0337bb7070815271b5aebe4c4d83a5be7d68df78", + "longPoolAmountAdjustment": "0x9bd644c35a482aeac1f160000a4925e608224409510e485f297289b0bec6b3b1", + "shortPoolAmountAdjustment": "0x24433be76fe8f04418fd90c834d3fddf43cea0ba1bdaa94380763f14a5c5df8b", + "reserveFactorLong": "0x5bd8ffbafa1901194812b34bc0ac74297625744458ca5a5324e3d766668c611e", + "reserveFactorShort": "0x3ce777e232b1b5e7678b1456ad4b086f6fea8b08e2ad173246dae9e536369350", + "openInterestReserveFactorLong": "0x0a07af97d2fb02322745e04bc7249e135efb9fd6d7cfa37ada97fb8c1508001c", + "openInterestReserveFactorShort": "0x41ee23ee6c6d9fba9916063bf1fbc0457cf4573e4d2bc13f50cc31a3e84bc19b", + "maxOpenInterestLong": "0xcb81e2b5386f0436a1c46af63ec389cd699b1b09f06a88fd9f5adfec859f146d", + "maxOpenInterestShort": "0xf6b3888f4303d9ca026e209569bdb9329c9448356d926ecff779c3d3029b1a24", + "minPositionImpactPoolAmount": "0xaa7e28084a75253cdbca0a9b650babbf37030f7f98a0d492a3abe9ef05db3d5a", + "positionImpactPoolDistributionRate": "0x58c51f1482d68faad2aa00a3f7772aa0190102098ec9c30bdcb1648293f5af71", + "borrowingFactorLong": "0x4d6c841d5827230173c7eaad4015db1faea12998f82743e607d27848667a507f", + "borrowingFactorShort": "0x26ea008cd297e1eacf7f3abf92bb54f29f42d9b70ec1b64ef6daafe1f9940a2f", + "borrowingExponentFactorLong": "0x2510f1adefbe63734a97d2a6c7937542c2214d1b62e274673e3cc50591a68226", + "borrowingExponentFactorShort": "0x16d1a8a857cf5118254771a441b34551ea07a034a50f588905c56f9784117095", + "fundingFactor": "0xa5667e7c98f7d86cd0498d2c93ecc237621e339c8f076cd193335e727df5e135", + "fundingExponentFactor": "0xc08582e52ea88121ee6c360332e022b0499b99feba17a2767c16bae4c6a5be4b", + "fundingIncreaseFactorPerSecond": "0x00d48ea4a73638ee124e4bc183ecaf58facd84a050a9c2be9b43b69af62a39e9", + "fundingDecreaseFactorPerSecond": "0xd11ea8d25d5ad4ad6f637a3bc7b8f063f3ec7d31b2b25e716dd1ff0c3864a502", + "thresholdForStableFunding": "0x7378b39bbd62e8f8bb3180ab68538a59c6dfcc9b1e33dc7eddd7911d2a23cfe4", + "thresholdForDecreaseFunding": "0xc72a24846968e892e661de710a18811224be770790d74d1443386f18757d8c4d", + "minFundingFactorPerSecond": "0xb4671c762c9194e267c554b5ed843e41a0c5367104f5daee7ffce28295ef21cb", + "maxFundingFactorPerSecond": "0x236ef1bb27f759ec8f3561653ffe9db18a8bd37b5414d803ea24ffef8db7e1f6", + "maxPnlFactorForTradersLong": "0x28c6560a3d84672c3d84081988ff32450a9f1b417062644ea4ae62ea4ddfbe59", + "maxPnlFactorForTradersShort": "0x727dddeb2f67de8636f5e9dcc0dfab740c594b2c6464457e3ee6ac5e05c155c8", + "positionFeeFactorForPositiveImpact": "0xb8130da30b2d52f0da6b00cca4d6e27796e8e29cc770424d81830d468f6e46ab", + "positionFeeFactorForNegativeImpact": "0x86619920b9bd2a757bdb46082f9e7814b07b346b85ec327426e81ed2b98c9512", + "positionImpactFactorPositive": "0xe9a08eac13757d3e3c9ec273c660957e20735fe6b0fbb100efa42fd2dc103e03", + "positionImpactFactorNegative": "0xe3a1c8fa81526ad49a0e29a269d6322584f06fc8360bdeffeac122ce5bd71412", + "maxPositionImpactFactorPositive": "0xc5830d4233c3c4b40396b597456329984dd1fa00d54ccc6a0ff3ed8ad24318ed", + "maxPositionImpactFactorNegative": "0xeac0372e3d88ea3b6591a48a239ca5cd3bec458c763374376558ae8de853c342", + "maxPositionImpactFactorForLiquidations": "0xdc60fe72bf55e425533f747c6952ba5d44777e6d701caf52570b3b72f481bc77", + "minCollateralFactor": "0xd1a9d8c3945e025659b09a50bbdf19d4b9a115dadcc662b86b59a61af9e795ce", + "minCollateralFactorForOpenInterestLong": "0xbf0cbbcddabe14afa33f3d923e06fc7c713ad118078f7e77f3d2bb9a8d648619", + "minCollateralFactorForOpenInterestShort": "0xd54c4e668acaeb80926b6c76790870e89a47e80823955189e02c504021ada729", + "positionImpactExponentFactor": "0x0d0b5deb037a6e299a4f6746578fb10d363fcdbb8f713c4194e64cb0344002b0", + "swapFeeFactorForPositiveImpact": "0xa766d46faa67189be6ffb6615e6ea31a5f403e8ece029a45b4cd3eeb08cbe02c", + "swapFeeFactorForNegativeImpact": "0xab3e9d384304687b4fcfaf1fa93376f0f72ba120fc0511f2d7f009e7e46622f2", + "swapImpactFactorPositive": "0x13eda227af6bd9bd0817e3771f202173a24574f81d1ae84a0b394fcf675dfa8e", + "swapImpactFactorNegative": "0xd5d924bf90f87618ba23759e1df30db025573ec12a4af3940533c4f03cad76ad", + "swapImpactExponentFactor": "0x8b1b0e78966a367740b4f1d102a9188442fa9a450eb815d28cd384b8e0616ae2", + "virtualMarketId": "0xcb51081d96fa96ccb10c6d6ab05ec9199cfd76d538d6dd2adfe42a09b7480261", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x66A69c8eb98A7efE22A22611d1967dfec786a708": { + "isDisabled": "0x15aef662638dadae078b4b8f2e25faa8eab06b66b93f8d637ac2683fe693d473", + "maxLongPoolAmount": "0x756fa92e4b2ee3532de4b4c553e2bd868225637e6558f413d6ec81bdb582d204", + "maxShortPoolAmount": "0xf4ae7bcd55670907e9019de108537d0fc6663cfc3730d987212f1575ddabbb8e", + "maxLongPoolUsdForDeposit": "0xef6eab07416299142ebdefe351e37dcd396a6c29f100d41912cbc6b1469dda3b", + "maxShortPoolUsdForDeposit": "0x45e30abb85641d690afa8eca39e7259617a294877f1708f57702b16cf91554a2", + "longPoolAmountAdjustment": "0x37ff45a8c6ca260852c395fb2d106d310ad78c81e1ef7c1b867c01e7e0a21fd5", + "shortPoolAmountAdjustment": "0xed554cedf68d428c2603c89103d69ae7bdfc024e88c2787ba4395735c3d0b728", + "reserveFactorLong": "0xa04f9df1fcf32549bace65240db2d31e0f8cbfd8a47b2d4d5677ac95e15672c6", + "reserveFactorShort": "0xd8715b4407c801e1a0c66d45d93c8bc7556af7479412975b49043f3c73414074", + "openInterestReserveFactorLong": "0x7f30f4a3e88e84daafe8418d449c003109f78585149d5f7420fc7c6d8bed2683", + "openInterestReserveFactorShort": "0x3d0449b84a655efeae7fd50e9601f165bbe5fc744ae2bbbe69230071e8931109", + "maxOpenInterestLong": "0x34cdc3e6a3f2f05db9b0ed8ea081efa3a15d411120ef604680f81a816ce59943", + "maxOpenInterestShort": "0x990df59eee2f9862ecb2c68499fcc6a3c54ce89aaed2604b9aa395b1f466a754", + "minPositionImpactPoolAmount": "0xadd5649f6d95251724c5391d0b5612cbd821df4bbbb7c8fe4ac7656be8f71f50", + "positionImpactPoolDistributionRate": "0x1b02e23cb5ce24825a8a18b78dc6c6550a7d3abf229347de2440a58af4cfc04b", + "borrowingFactorLong": "0xbb041ea0a887d5e00a4ebd98317464b2a90c033c3741cac84dba94dcd724f22d", + "borrowingFactorShort": "0xfa3a0dbfb914586a160f9e04414a71b4246b54f65f97f1500354f54babba591a", + "borrowingExponentFactorLong": "0x6433047f593ee5876747d9ab6b9ddaaad80b0cc3d6f6ded8a9961433e67b2f96", + "borrowingExponentFactorShort": "0x7c9720cf02a55a74aef696eb107127820ee316247f09ddf0c0d72e9312daab7d", + "fundingFactor": "0xa2b0c3de31f9c13c6f414cd51c1b4a8f91ffa1d0c6e66644923e1a65e29168c3", + "fundingExponentFactor": "0x2b20abe366bb5648ba63fc6274255b353513b673947466eb17463f631b7bf05c", + "fundingIncreaseFactorPerSecond": "0x146b6c30d08e45a51185ef849267e36d628fda888502df41f95eeade48e58f4f", + "fundingDecreaseFactorPerSecond": "0x9aa99ebd417dd21e85bd4ab7c7285d5be6d9df792a916b7dfa9e37bf85078c6e", + "thresholdForStableFunding": "0x98cd31eb985dd4c43ecea3ee5017d8297a715cb771e0b75e8e09a44b0a8ac55d", + "thresholdForDecreaseFunding": "0xcb2f67cc738837095970da25789576d69d9bc89b7e8d24144eaaca81b01b30a2", + "minFundingFactorPerSecond": "0x28b8090f1bfe2d5beb5b3eafb8759d0f841c9d5c3b3273ddb9ee960e29cb47de", + "maxFundingFactorPerSecond": "0x2d6fd46347386695821f8183b44b3c52e4adb3e05d21baed6c3ee136c929634a", + "maxPnlFactorForTradersLong": "0x42206deb102983b56125efa6b7a1a9a91c9718f60f6c08ed39086d427a01c070", + "maxPnlFactorForTradersShort": "0x5d6715d11e8d236acf70c9866d3d10e50d66db002aa8af4daf308319e839c55a", + "positionFeeFactorForPositiveImpact": "0xe6e6eeaa3e7c8031ae37ee72d1fffa975b364d1c44f948e43af20211f346eafe", + "positionFeeFactorForNegativeImpact": "0x4f59fabf762b3e86dd3205e0f99ca9b63b08c14c90e0d50bef53f10df085a060", + "positionImpactFactorPositive": "0xd38ee3b78399bc9248c38814306468884b4fc7516eeec324cd19733ceefc652a", + "positionImpactFactorNegative": "0x6ec836bdd3077fc5d55b47e37b5adb4451d7a355521c503092cfd8ab8860c6f4", + "maxPositionImpactFactorPositive": "0x2d159b4e62a983c5c028f2c9257af7d9dc7813e54bb7ec68cb5abe37af1f8509", + "maxPositionImpactFactorNegative": "0xb09e57cdc10afaa5d73dcb0b84982faf2bb6fcc8ffce9dc77c3a70668dfe917a", + "maxPositionImpactFactorForLiquidations": "0x264ca4cdc35dd30b69ff7cb46b77b8e60659253ac3c1486a85acce86d758ad6d", + "minCollateralFactor": "0xeda57e7c9f036aced07cbf0300755e5a198f5b38b8f38709a4b3db66c6614d70", + "minCollateralFactorForOpenInterestLong": "0x4e55b36b90bb86b6c710c7a94743860cf086374614e1de9788b5d60f6f2af678", + "minCollateralFactorForOpenInterestShort": "0x0c8510fa2a221d973bba3edcb9353a25738e7d0e3a217a5618077208ed4df0da", + "positionImpactExponentFactor": "0x142524c8e6b264412253aab7e884fea1fcf5610232b882cebb399d9d5a20adfe", + "swapFeeFactorForPositiveImpact": "0x8882eb6d03e0ebad72e73c10506efbfb2062a15fb87ef045b2a5da71e2807ce0", + "swapFeeFactorForNegativeImpact": "0xf572e75310cd3f77b9a3f87cf5815f0a95e7c97841906d11ece78caf827475b3", + "swapImpactFactorPositive": "0x2c164a61e689a8a81aeda0f29bff44d8a7f2d8895878c64b4e41c5aab8c4389d", + "swapImpactFactorNegative": "0xb88ad88aaa77586d993ed016bbee3584738069ab1f80fc3f7d9a8544cd6b6916", + "swapImpactExponentFactor": "0x6f7ac0f128733366619afcddeca36ec6a2da3b379f9938024da379e0be8c1fbb", + "virtualMarketId": "0x49e3aee310864cac3bf7766b04a8a0f4a0dabb5803f5113c583862fea4f74ac0", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xBeB1f4EBC9af627Ca1E5a75981CE1AE97eFeDA22": { + "isDisabled": "0x36f708e1a92a6bebfd54246970c831d1004e689e2c24df742f1e3d330b40e751", + "maxLongPoolAmount": "0x1c59791dac278a7c21e5163ff4d645b6f1f0e507fdcbfe15185567817695509c", + "maxShortPoolAmount": "0x9fbe7feb72ef3fa8fbb3f80f7e2fbcc0304c7e94bd3189429b537ea7a8c40fb4", + "maxLongPoolUsdForDeposit": "0xc474f466efc875b862d186ec0136f4e3b41e6220ea3a8057de249dfbfbeb3e2a", + "maxShortPoolUsdForDeposit": "0xa907fb263196ee0f976d2b2cd6b6fb5e5ad52626968d3699243458bb3c30d77e", + "longPoolAmountAdjustment": "0xaa0a126aeda6fe0c44a6af5142cd4f66ed35868e6e4a5aa6daddb3405225e279", + "shortPoolAmountAdjustment": "0xa98e7e47887cf30a68a77d2fe1343ab06453dff80e2da4bb11be2dd7b107e380", + "reserveFactorLong": "0xe7a857e936aa00ed034bdb1f793649a012c1b85b8d689d01e2a2d90737902604", + "reserveFactorShort": "0x6061dc0000551bff2389afa2a66887bfafdab606c426fe7d8a2f11bded5c58da", + "openInterestReserveFactorLong": "0x6cef370e3ba2903a2b20f4d46ce510f62301f5298e1c90a5dc5539662b30ee4c", + "openInterestReserveFactorShort": "0x5e1dbeaba4024ecbda2a21dd9e64e4d6f171748f891074e5237ee0f3bb583e6e", + "maxOpenInterestLong": "0xab61dd855add87aa3bd756b3f3401c5852ffda62e51e4b37c1c1aee3d1e26654", + "maxOpenInterestShort": "0xe3ac655ec5a2f7e4142cf6d05705f277210053db2599f1a96f71a7f56e28559d", + "minPositionImpactPoolAmount": "0x33cde8e421916d6f640bcf5fe3534036f4f1f6112bb06a0ef80bdc0eb8b1f8ec", + "positionImpactPoolDistributionRate": "0x33866bc56478a5ca305701aad3da0ba0385f15122e4dbffcf5bb601ec7ab39b8", + "borrowingFactorLong": "0xd761f8c32840b3c01a974c3264d4018199526588e4fbf94a279165556e23e358", + "borrowingFactorShort": "0x11b59ad26bf864cdbdf9cf7975c76591d5de77e4a18f628d120c12fe8c20e297", + "borrowingExponentFactorLong": "0x631c6a8516b57a3be51d700b205428d7b19ffff5d1b078a0d9eda61103c0ee83", + "borrowingExponentFactorShort": "0x61b5cb7b5eed6ad8746be2690b9f90fbed8271c329ade7ce25703a9a988587b0", + "fundingFactor": "0x0bfa3624edd2bf5e80361c0f8165b6f902d5375e194ca45393c9a475a863d7c4", + "fundingExponentFactor": "0x66e2a691ad9100c3e9956957ecc37ae9f59593f881c212a7d7dcf2e05d916591", + "fundingIncreaseFactorPerSecond": "0x94fc181b1a56f99e176ee3fea9910e4fe1c5c6cb4ac83f69d8cb981e58285ac2", + "fundingDecreaseFactorPerSecond": "0xa5f4fe4b1fd1333b0d87404ecb79cb240968885a007d9f04892565ad1bb8f022", + "thresholdForStableFunding": "0x4cbb45dae866430d2b8ea3fe6ff7a72db58f65625d7311c03d25cba5f39a89f1", + "thresholdForDecreaseFunding": "0xa6db1162c2368a60a67c1977921c1d61d30cc8a9a877ef9fe6e3a6a788067bf9", + "minFundingFactorPerSecond": "0x52c7feaed130abd532053d27f857429282e0372e78000c5babd1a1a5954aa09c", + "maxFundingFactorPerSecond": "0xc054005cc2f37c32e1ef3b76b389a7ee9bf66a860b8b46bb02614b59630502c2", + "maxPnlFactorForTradersLong": "0xa94654778e8d045b745c37d4949fca238c14141ffb3f39955f72692d7723420a", + "maxPnlFactorForTradersShort": "0xc353eb203a1beb0be8441b249a43981a15bd0a6841bab87b3ca6fb9ca1228935", + "positionFeeFactorForPositiveImpact": "0x797f04bc0775c8db2983c4b6a39a9ff455e6074fa15d697b497ed9a0323bdbb1", + "positionFeeFactorForNegativeImpact": "0xd714718d551b78772cb65cfe1a4c6f8bb77cc66af359c92adf8568ff6a15f033", + "positionImpactFactorPositive": "0x3c21979d6fa1a52812bbea6ed9c4e45edc07fb528d1288d8dc454da59655d385", + "positionImpactFactorNegative": "0x9add40936e4063e215522e32a8ae7847e0db2e8b27b4db0284f3f3f9401b808b", + "maxPositionImpactFactorPositive": "0xac08965b798a991c076440d2e2678d2e18bf6a22c4a1b7323eefbd345cbf2ddb", + "maxPositionImpactFactorNegative": "0x8e393b5ffccbfaaf16c5ae93cd98901ec890efb2554a03fb723c082280ab2991", + "maxPositionImpactFactorForLiquidations": "0xdcab036d83ec75c77aac09db90596f2b3ad8bb2fa8f908917acff8c9c702822d", + "minCollateralFactor": "0x77bde089799540169026c8dd1d4ae2e2128599fd8b9e31446c4dcc83bb9c23e7", + "minCollateralFactorForOpenInterestLong": "0x36e72daab303600b4522ff9c0d0bb9a1eaf31c1cce97b8ae17084f0ebefe5924", + "minCollateralFactorForOpenInterestShort": "0x93a0ba9c685fab64917a6ab1a5e27dff7537836ea12f0c7645c76abd965d21e4", + "positionImpactExponentFactor": "0x78b509b0ba1718dc95363e99b4b27fbc80a15ff26f4c7af4d09bff22b4708a36", + "swapFeeFactorForPositiveImpact": "0x1bb948b925f5b0890197e4a96a36efa3405166da0bb37057376b1c9afc67a1f9", + "swapFeeFactorForNegativeImpact": "0x3936d99bd3d40af388a17a62030f9472559e4073150a3b7df3e29aa7b5652a9c", + "swapImpactFactorPositive": "0x43fd312437e0556e2d89f99e604d50d1ed9c4b02d4e9804bf69d8c71c1ff2928", + "swapImpactFactorNegative": "0xe5ea472c4d680fd020ee7c372c33683a5739fb3822fe39d969f07cbe4167bd0d", + "swapImpactExponentFactor": "0xdde80356bdb18a6e5cf7fe6659145d4e2236f7615e6934e10bca1ea8e618158e", + "virtualMarketId": "0xf72c205a8c133f81158f89a7e84d278fa326b2b0cc4ad79f0be5a53e25b7d22d", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x3680D7bFE9260D3c5DE81AEB2194c119a59A99D1": { + "isDisabled": "0xec0271af1ee58a880fda3c7577a75ee6c76f5af731125c77205c927a0b4e3f24", + "maxLongPoolAmount": "0xde9f8d4474f95f44a38bc54490956f5c1fe4d60afb8d25279cfd682bcc7fa7b8", + "maxShortPoolAmount": "0x34dd611eb98c9bec3c9f7a1a1f75fc00516fb28ebe94677df83eacff411f4d51", + "maxLongPoolUsdForDeposit": "0xfcd8a025234bb9019be43d20897f1d4b4ad617257257bff56cf9f864b8d0bcf9", + "maxShortPoolUsdForDeposit": "0x2967db980cad6b94d648a88e85632d34df55ebca128ba25fbb2a6df4d85fb19f", + "longPoolAmountAdjustment": "0xb8addd626e5c549ac9c0e0fce01569410dc95c3faee22eaacf53fd6969ef71b7", + "shortPoolAmountAdjustment": "0x62fccc038523de6eaadb323ab42b760f47546d5f042ff97f01da7f019cb35813", + "reserveFactorLong": "0x8570fd6cef84d11d53508dac39e41c311bf49a4a1e1f890268b35c56f0cce470", + "reserveFactorShort": "0x560049974825eeeb3f8ba81ba98f0402a4c17068d5c88fddb56eea4e8e57af53", + "openInterestReserveFactorLong": "0xd3058e052062a90b7c297d4b008f9f0d490ad37d88e074d7125215bdf7d7ccf6", + "openInterestReserveFactorShort": "0x0a6e16e8563bb72334fdd62010f93d188bf4f26d8e12a9585e7c7bf6eda32be8", + "maxOpenInterestLong": "0x81e065e2ea16835a1a38c82d268b92c4a6758b2dea12abf5180ef011b958f34e", + "maxOpenInterestShort": "0x63a2cee4b57a1b7df8980ff0fcb5fd9c78c5f654d7bd71b8db680299035afcc2", + "minPositionImpactPoolAmount": "0xfcc2239b892102b683429d0d69e917d63097eeecd2e654b11fe27a0a92638ba1", + "positionImpactPoolDistributionRate": "0xdf18661c5f6f48110bb619724648d28e49d391dd2b836e31ff3588cace97ed84", + "borrowingFactorLong": "0xaeb74698e28d208bb1386ee1fdc42b4544478f053df921fd721cb10532f39e34", + "borrowingFactorShort": "0x36bab91ce6675fb482d8ce4b5d42d8b06a079ff164b51dfc75c9fdf76b50a736", + "borrowingExponentFactorLong": "0x65d843515bfcb468997e4e60c0a5a4b386d05d957b83ce86d30fd8ba7d37eb77", + "borrowingExponentFactorShort": "0x0d0be7f1a3f75c719718b9961b6be7cc25790ad827863ad072ad5329093c526f", + "fundingFactor": "0x4db3ffa09c5ea73f979b62acbede06a70e587b387cd343214b27cd002b12f01e", + "fundingExponentFactor": "0xfb8a3914f8d849f8a54f7342415862b2904e93e43c810030d40306546526c967", + "fundingIncreaseFactorPerSecond": "0x8297c928b8f73035550c979154b61befc2047e5f3913d4cdd161ccbef9715705", + "fundingDecreaseFactorPerSecond": "0xda371ada39b1aacfa15d1da6e2d920a94bb7127f4fa6cb46d7159acb93944cb4", + "thresholdForStableFunding": "0xad3694d22107f31f7b3d81d0819f84a41439ae1514f4f1c7312b993832558906", + "thresholdForDecreaseFunding": "0xd8e4536fad6d55f59274dd21a01fc1da12a6e5b442f33044b1276d9ccd290088", + "minFundingFactorPerSecond": "0x8bf15a932075149c95f7f9b67cf827661563d61a8c93ba7bc045e448ab2a94fc", + "maxFundingFactorPerSecond": "0x7c7d2c063e2459eab3f0b4617d9a10deef46d0b92fd039e83e83ab508de22dbb", + "maxPnlFactorForTradersLong": "0x88880540378c25ab3984cf20f61798200656efa0a6df24c9848bbb980be23a17", + "maxPnlFactorForTradersShort": "0x7c292ade526b200d6dab2668fd249b4e1c8462c4fee902f3d8b5dd10438a0297", + "positionFeeFactorForPositiveImpact": "0x60b0929e249f03887b7653b500ef4fd2f72f5338f946b5a9b4243ffbde989eb7", + "positionFeeFactorForNegativeImpact": "0x2b9925b6789771e207b9223ca7476cc9fbc5b742a243e5b7cb4e836a20817807", + "positionImpactFactorPositive": "0x2758725c04034379168a8d828ed91d9d3e855a2d10aff4dd54326b154d640a15", + "positionImpactFactorNegative": "0x51783acf88ad8bb641add39a04bea27fe7715c01fa0ebdbe7ef3f72d473e2fc5", + "maxPositionImpactFactorPositive": "0x8c12b034ee8ad6fc1164338e82528933622843f83631cef944038173ec07125f", + "maxPositionImpactFactorNegative": "0x812b06e8a9ae30129f248baa9f7e032708f037b1138d7f487060bca9cb4287f6", + "maxPositionImpactFactorForLiquidations": "0xf129060dfcad1deca65540e0b1641443a5f0fcec26235aa946eacb088c0eadf2", + "minCollateralFactor": "0x64c28b87c54a43b52e4e78491ecc0749386e5fa99986c78e5855e4e0039fdd01", + "minCollateralFactorForOpenInterestLong": "0xb1f9e034cd8013cd53cef9f0bdec7c7bdbc4db862e555e88eb9d1cf5e6511956", + "minCollateralFactorForOpenInterestShort": "0x20b6d2f9b79b868e1524b9e961bab3641f9f799c6d97d63911dea52d70c5cada", + "positionImpactExponentFactor": "0x9f1b87272507fe9ec122c5535383fff447e2ebf7c92121965b17bf0f4184fd41", + "swapFeeFactorForPositiveImpact": "0xadd2c67471f951b61e2eff6f7decbdf8c2ef20f48059afcbdea87d9a435d01c5", + "swapFeeFactorForNegativeImpact": "0x31edee4dfd4291a0492f60b88b76f2f0752edfe619e20e30710894daac78e1ca", + "swapImpactFactorPositive": "0x36e871427ac1ce490403c9351e871024aaee072fa90fafeea3a09ee1296c5100", + "swapImpactFactorNegative": "0x6a34903a427c705b14eebd04e3d807ce9465c22b28c84ae75b83b142bc0e34ab", + "swapImpactExponentFactor": "0xe04a2a7a7efdaea4326561690e5a525f60dff65d3aadb010dd528ccb6a083752", + "virtualMarketId": "0x1748a903ec4a04ecc4e805b5916ae06350e4dac5585e31be9fd0184f1dd5d9dc", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x15c6eBD4175ffF9EE3c2615c556fCf62D2d9499c": { + "isDisabled": "0xb99b46413ad51ecc4fb6421dc823b1e00b4b7220c90de9dd8c877598ae754d38", + "maxLongPoolAmount": "0x009a3354ae2bfd9d685a12e30d028805b3a5b18c270708e0376adb497de0ce7d", + "maxShortPoolAmount": "0x2e611022b5e858059595ca62c1ed36bd1abfc679c60a2fed5b8c8c21f0b9980f", + "maxLongPoolUsdForDeposit": "0x0b21080f351ea67a96136767a19e447d5ae164678cd5a4a451f1866b264a627e", + "maxShortPoolUsdForDeposit": "0xb73db61fd11bd0606b71c9458d4bcc8aa620a29529a85107079e403f37fcaf01", + "longPoolAmountAdjustment": "0x1dc2c26bfe3c234a2631254939b80dd051fb62247ad011db6ec8984897eae9ac", + "shortPoolAmountAdjustment": "0xe449722dcb48b8fe1fba022a10ea6d1efd83fdeed9d150cf303162ac8a41ac5d", + "reserveFactorLong": "0x98b9d61ddcb47f1d817eb0530c68a260b8a414c77fe53388c10da8166a36a86d", + "reserveFactorShort": "0xdcfa6daf28427966016daf3a4acaa5c3862b560ed51fc2ffd381d63b02040a88", + "openInterestReserveFactorLong": "0xbd8babbc0cb8ede14a9811a84a47d3fcfabeafd39ab30d2b06280e276aee8b96", + "openInterestReserveFactorShort": "0x558db7315c249ea26b9dab565896ad9f1e467d2e9ef4c03c21584656eaa3553e", + "maxOpenInterestLong": "0x335689fcd40898c9f821790616c690f74fa48cf77096592b86b3405d1b94084b", + "maxOpenInterestShort": "0xb00d645570b1f870affd9b67dec59751fa0844f74d814169aa7f3614493b2578", + "minPositionImpactPoolAmount": "0x81ffd15809ad79c0395ca78679164d16b388952937fd26bce2dced17c0ebf7bf", + "positionImpactPoolDistributionRate": "0x69973192b716c9994496856db4fcf0d22dac5b590f9536bf6cf3760ba5d06c1e", + "borrowingFactorLong": "0x700d3c53e3ed68b2b7997bb7b0bedd74ae60b28e3742314bd0bd46a586618628", + "borrowingFactorShort": "0xe522216eb234839a33c2f0f5bd3a06397760da898ecc34666fd89b3e5a5259b4", + "borrowingExponentFactorLong": "0xd2a015b3d9bb902fcb8eac0ed6282e867ad00dc927cd741f7683d3958475b01a", + "borrowingExponentFactorShort": "0xea6d42a98b68ce259abc1f15016a85746691b54d605edd7f8512b2dd93e0b192", + "fundingFactor": "0xa8eb9b51370742ededa5b55084731ada49b2da7aa38fb44004d14219293a4398", + "fundingExponentFactor": "0xb643a8145744c8d2681e13d6b3bbfd8b3c3418cfe7774d3e23b909ac99df1683", + "fundingIncreaseFactorPerSecond": "0x337a766eb78c5d0a53662d0b06a499b429609ffb04f536251a1171d92ebef07b", + "fundingDecreaseFactorPerSecond": "0xfe55592462226ea74ca7281f69669365791a00be3d3179bb7bd1bb1108b4db88", + "thresholdForStableFunding": "0x35b769fc671ff10b903d32b5f7915abb0422feffd7f979ee7e148b3c382ed066", + "thresholdForDecreaseFunding": "0x5d484cf289823fe4bf296b30528f02a921290ca29f988048430f7e45e7b191cb", + "minFundingFactorPerSecond": "0x2045ff63086e54a7215dc8e0e5d370867c0c87a701c2fe7d3835d2f90afb9a55", + "maxFundingFactorPerSecond": "0xbc1f8614236a23d18e95db9ce4af307af690e5ab8206ffea12ca642c6cd6dea7", + "maxPnlFactorForTradersLong": "0xcbb5ee9549df2459619925fd79c95020edd6b39393c707c37ca096d31570720a", + "maxPnlFactorForTradersShort": "0x4e7efb010dd37130af7c8133f32a850a2390afd139b7893e47fb75df081b7eea", + "positionFeeFactorForPositiveImpact": "0xb65ad101925e7990ccca3a06feb91cffe0d80cbcb201841f6b5b7ca816079b4e", + "positionFeeFactorForNegativeImpact": "0xef6385c6a2f181806f748dd22a2c0ccc32882d9fb08e7747514a1b41929100fa", + "positionImpactFactorPositive": "0xc2acf82f196514ddbcfb4250e4aaf2765fb3fda2f0e09da76e552cef2f83a8fa", + "positionImpactFactorNegative": "0x78bf708597d31ecf8d57abcec8dabfa5c0d21147ac154d5d288f5c20f5f220c6", + "maxPositionImpactFactorPositive": "0xb0a73010ecdba53705c694d2f936d18e4a05df0f17c700bdace6271ca813c9a3", + "maxPositionImpactFactorNegative": "0xd5e633acde47db2e2ffff00c56aa46345ef121f1a456f1d77b79706719b2c3f6", + "maxPositionImpactFactorForLiquidations": "0xb9f158697849b94901cc34c765b0796456aef9657a895abbbc4da40e752e6e89", + "minCollateralFactor": "0xe987e328f86edb1ddbe92a10a5a8ed7cc9e27012a3f8eacabb95015d8d4a5029", + "minCollateralFactorForOpenInterestLong": "0x43fd25f73c5ad7cfa51e170a8e62c4b5267f167b881d77c8db40d0fff9b0cbfd", + "minCollateralFactorForOpenInterestShort": "0xbe919143794d2b200798bb5ce729615b2c0da3f4918a5928f7020ea6fd19899d", + "positionImpactExponentFactor": "0x68e38c9e7e097fb2dca604ab440cc4c81ec75b7cb19de8a626c93bd00019e02e", + "swapFeeFactorForPositiveImpact": "0xed597aacfcc0d2c97088b29821bc7c5481db8decbdc266300b3998ae014dba2c", + "swapFeeFactorForNegativeImpact": "0x605173de6a0cb1f167f584339ff5b46851ceff4ddd725a1db918231f9912a43b", + "swapImpactFactorPositive": "0x208c6acc0507566d2cb55884616eee785678beeba5542607b18d32de7007639e", + "swapImpactFactorNegative": "0xbc075ce4fb66dc695cd10edf51e201ae23591004d823be69ee8ad5ab0ccf87f5", + "swapImpactExponentFactor": "0x446d2f81a872accc792188ba237193feef42d1f282e2b7ac0ea9660566f370f8", + "virtualMarketId": "0x7bdb363de42627474f6a80a35d34a43a708bb74f5687e255fdcee6e4738431ca", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x872b5D567a2469Ed92D252eaCB0EB3BB0769e05b": { + "isDisabled": "0xa17dab553087a120b0ab290c6c37218b649ef70cbb37dbcce2d7e6dc3587b418", + "maxLongPoolAmount": "0x12dd1d4409084330b6898b9eba6c418be98435435d1cf9955385909833c09996", + "maxShortPoolAmount": "0x2b385fcc8a90e2da7583dd1101c7473d3144586972ed5c091cfacd3d31db04fb", + "maxLongPoolUsdForDeposit": "0xdf3e7f9846153685ac1ffcaba326cd57f44b6a4e216eb5a19934067b8c336701", + "maxShortPoolUsdForDeposit": "0x4b5a82d7bbbb79c46bf727c75f6dcef7f61689c85380cd483d7cf9138d50c2a9", + "longPoolAmountAdjustment": "0xd067fafff785b9e8f27a45d4ae7889932f0659f7bbb9a343b5ea499ee5e85946", + "shortPoolAmountAdjustment": "0x2d0615cdf4c22651dc46c0e46249fed18bbd10b6315b38e2d0963822386cefee", + "reserveFactorLong": "0x592d63effd3f0d7bb6f8c94142ec962e118f849a9c9e6d62c941ebef63edffc6", + "reserveFactorShort": "0xeb4400c11786cdbb533d508acf9f687c914f0f2c0b7165319e8f49ac97c5a345", + "openInterestReserveFactorLong": "0x775833e7169e6b22bbff183dfaf9fa7d343aa759aee1bdba8a713a5de17180df", + "openInterestReserveFactorShort": "0x5c245a3305342ec1b8f2e9c906660d9e0e1746166815fc6ad3cf90020c543c0f", + "maxOpenInterestLong": "0x15adcf87c5fc6d287ac86e005c7b2f068fea9ed444c915e7a849611e54e55522", + "maxOpenInterestShort": "0xe834b9ab024ea423553820eb882395069864ac0769e082b36d7bcc2f58d4f1ea", + "minPositionImpactPoolAmount": "0x4a74f05daf72fabfc6ada61ef44516029d1623a745773c052e8ab6cd0cf5ce7c", + "positionImpactPoolDistributionRate": "0x5782204a4d7215763ce9818c1c71e9409f947ac3e8542efad13a1658f971a405", + "borrowingFactorLong": "0xe7ee153c641b6c49f24c410b940b6eae3d46484ef940a585463669a43757df61", + "borrowingFactorShort": "0x73e179df48d0393d75dd8f30e2493a571f7fa45839fcc075f997298cc57cf111", + "borrowingExponentFactorLong": "0x608fd64f0e3e019c8f5d5d6edd52cd0e9cb9409ff273f5527a1d0a3da48db084", + "borrowingExponentFactorShort": "0x26968863b56afc960a8ec6e0613620e69af721448c9a34c55f9ca217748e7491", + "fundingFactor": "0x337fa540b742dbde8379744cd9a9c600667513c368190888413c1b0cadbd5aa6", + "fundingExponentFactor": "0x6bab0993853f26bc2b5538fbbee06070da7f1247436d8336967b61e39d4d6b38", + "fundingIncreaseFactorPerSecond": "0xdf004b8338ab8f6688fd0713491d7f519320dbca354782c149d31882f251461b", + "fundingDecreaseFactorPerSecond": "0x8270b724428f8f67dec92495a8e386cd21e3c4f4ff9d73da6fafa5cc84d77bf9", + "thresholdForStableFunding": "0x45e630d4243f115a1ddb1585410701abce5fb12b2c589c8c0cc7286a685bf21e", + "thresholdForDecreaseFunding": "0xa7b437d63b38b4c5c62d6228a8da1a8cf16e2d2e016bfa6700b01fd767db4778", + "minFundingFactorPerSecond": "0xd7de0cc56512098410c15d59345d1ee7a27b4447125ed0ab0a1c5d7332d29809", + "maxFundingFactorPerSecond": "0x5d86ad2a0ee3b0f58abf8bb7c1aa17dc35b005d746a5b027877a3d0ef626ee1c", + "maxPnlFactorForTradersLong": "0x23941bc4b4dbc0978d113bb410060704c55e1a0adb646b54e5a3de1c46715451", + "maxPnlFactorForTradersShort": "0xa854cfc761aecf46ad9aba88804d4ea337d88de6716e057ee78c6774832fd66a", + "positionFeeFactorForPositiveImpact": "0x8feb0270a20287d1a5124b49803492bfae97c6b5638dc765bbf3114a5439b54a", + "positionFeeFactorForNegativeImpact": "0xf4fd4b73132ab0990fec091ab4316539ebc88b4981c0449fdb89f91d0cb90b49", + "positionImpactFactorPositive": "0x495905a35817f5fff10ae3f21225d5e5522efded696273bf51f1669dd880ca91", + "positionImpactFactorNegative": "0xd9f43c76d06fc8135a75b267ffb77032a20aed233064fe4a1cdace0201339441", + "maxPositionImpactFactorPositive": "0x01e8f1ec1cca444aff7fb4841c5e04551eca12a3e3f40d802057aea21b946eec", + "maxPositionImpactFactorNegative": "0x428bc3887bc7489c9485260579d0e0763d783139851ee3f18a14d55cc74cec96", + "maxPositionImpactFactorForLiquidations": "0x309b153983005d88ec9b50ee2d382f58b3d94dbf502ebac9a1df9200f806f7a4", + "minCollateralFactor": "0x4f281cdc49e1f75ea1a028c8c23e00c1331011026e794caf8547cdcfc8afbdd6", + "minCollateralFactorForOpenInterestLong": "0xb41bba385bea8b61ee3a31a77f9b22ca93ddd1ddd4c0b2122a1479c41245a918", + "minCollateralFactorForOpenInterestShort": "0xa3cfc4f602f38bf736284ff16d11b328ba89cdf571d87a27d801101fe18a89d3", + "positionImpactExponentFactor": "0x4717cfc01a1a24ef675701768beb7343fad800404065332a016f33c3fec290d8", + "swapFeeFactorForPositiveImpact": "0x712f5742039b496858cdc383ea6f4f6db9dafd98bd4bc0682e8bec1036758869", + "swapFeeFactorForNegativeImpact": "0x39ff0ec8537e6c67dc3aeb20d22f14835a509939dd4c2535b1d83677bdb58dfd", + "swapImpactFactorPositive": "0xf36010feb1e7e5bf88eba48c62b7cdc9a00bbd23007f4afb33cc373619624b2c", + "swapImpactFactorNegative": "0xfb915dffefd667c9f6211dad9e8b7236026971701504f4c5b591c964d750c9aa", + "swapImpactExponentFactor": "0x368c32963de4e32ea01c9f7356e2a1ad5fe2fc223d6a5d0ae3e497e8928dc90b", + "virtualMarketId": "0x239e7661fb9112893ea39f1024aadb5768d31f7d444409e21dd781b95db99d9a", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xFaC5fF56c269432706d47DC82Ab082E9AE7D989E": { + "isDisabled": "0x25646a41fe9254c2880e3790804118ba933c018b24e2fa434d4460aca7ca7a83", + "maxLongPoolAmount": "0x9419b71035533caec74e87bb22763256ecd44c68d378f8aaecb0e90b9d4b9f86", + "maxShortPoolAmount": "0x860b099489a59689951b42a48f00c9c912c6429ef0b1e1a35bd9465b2d87404e", + "maxLongPoolUsdForDeposit": "0xde70680e9810ab9af9e03e3bb330bb189349021946953a1bde5b418cab1f70a7", + "maxShortPoolUsdForDeposit": "0x9d8895c2bce35e2f85a92036a3cd2ae1a4b27c7788c419e3ece51e7893ec855f", + "longPoolAmountAdjustment": "0x5b8dd28561d66ab419ee6803fc51f53116c71c196672b9cf421f3df1380a5abd", + "shortPoolAmountAdjustment": "0x108a5c2e613f70762353a5c80513058df9e02a538ab97e2be8597e32852ccaba", + "reserveFactorLong": "0xfafb263fc988f11c17725a6ba61f2a7d8c1d8c1fba62e57b3be638aa5feb9684", + "reserveFactorShort": "0xf09bb168ecce42e29b4d0f0b2b8fdb343f91153b15c8c1b20211ffd854efd1b7", + "openInterestReserveFactorLong": "0x2baf4eaf8f5ca8eb68a92e788adc1ee6528d018d1c6b723d33390b25b0481ed1", + "openInterestReserveFactorShort": "0x47f6fe05bb9ca862c0a2f6bf0b1b2d4d0a0b3b6165a009a7cd76de63dcca9879", + "maxOpenInterestLong": "0x4e3b71d169923f74d5e85a09821b292a5630699bcb4d3ff673eed0412dbdf181", + "maxOpenInterestShort": "0x9d8a8c66608d00faa3e25cbf0ac9049c8375e59927c5b5731341e57e34c3f372", + "minPositionImpactPoolAmount": "0x0706c180507788cc5ee9b99f780662fa0fcb6f573285478f278caf4798d92027", + "positionImpactPoolDistributionRate": "0xa7e8f841ac4d1b9447990dba9b3d661b05df398c14486b6aab6066e04ad6fcc4", + "borrowingFactorLong": "0x760a8aea5cd9e6efaaf28ad46d5a110f209119d958f6d142506f6a949f807ba3", + "borrowingFactorShort": "0x45d1a710f7c79f34a25bff77e8febe8a2e5a0cc3f2711e0ff5199338c1ed3f13", + "borrowingExponentFactorLong": "0xfeb654919548c53405991da7705997de3814eb132929b357f406b5df6d7d8e56", + "borrowingExponentFactorShort": "0xcdaafa7e010d6c01143cac30cf4ce88ba9e730c745221e9b6d803e025fe623a6", + "fundingFactor": "0xf4bd33be677cfc0a321b2a0fd4a8d72c5e47af4815151a995b0dc22427337e74", + "fundingExponentFactor": "0x53a6f76014845e17c8d320c0a9c0f97035fa437ba1ced626f6eadc4de50d9885", + "fundingIncreaseFactorPerSecond": "0x7bbbb70e76d20581bc5ea0a560d30889dd4563ccb84c7233179eed949b8a7f5c", + "fundingDecreaseFactorPerSecond": "0x0071b29e798e2e8388e404db750f50414893a305fa9c36f44c66466ee18e6e13", + "thresholdForStableFunding": "0xb80ccf7315b0ad43a8ad7dfe4005e1c4a4e67717b0e59504d70cec74d8af880f", + "thresholdForDecreaseFunding": "0xa89d2080ac6f60b7b06235c43f6ef6036bbfca3bec882540ecfa60d790886f88", + "minFundingFactorPerSecond": "0xfe986ee40a2221f0b820cdc9ad13d722be4526390ffc556d429f8f63d26b2ce4", + "maxFundingFactorPerSecond": "0x2f69beeaf53db976baa8d119d7c271708c4813cf85476d76004568544ef32779", + "maxPnlFactorForTradersLong": "0xa2800b3ce78a5d0389732d81038e88feff40e3bd49f09ffee56811f40ee38803", + "maxPnlFactorForTradersShort": "0x1450231125af74d89355c10b08e1244c6930ae82e7c6a43f541a02c87e85b32c", + "positionFeeFactorForPositiveImpact": "0xbc139966b077397a4c0f20ac3b08651b6c91952888bf60fc6b03879a297c4b4a", + "positionFeeFactorForNegativeImpact": "0x4dd266ff9795afbab0849ca9b10a61a56f7b9b3df788cdd4a427a615d9ef59e8", + "positionImpactFactorPositive": "0xb5dfa58ab68838cfab396a23a6458a19b08332f7a04cebb1c6f71f2821947e9a", + "positionImpactFactorNegative": "0x56823d6116f0891a5d4838c542ef05dc745c9ae5c68f9a99f22a8b55b4d230f7", + "maxPositionImpactFactorPositive": "0x1ceebfd867b9918efbe8423ec199d06ce78ca441d305aa9662d3764ab7a9faf5", + "maxPositionImpactFactorNegative": "0xcf7ee5b0a80d4662ffda30f4d157d17612195104d15bb91bee6de03ae3e3599e", + "maxPositionImpactFactorForLiquidations": "0x930f7239b83bc0b01c885d62e1739adb7f47483b2f95d68cb6ae0586991421d0", + "minCollateralFactor": "0x6e2e2d9c129dee202f1002e2c7b8fa62b854c04ed92b2e84ccc8d7874d1d2b82", + "minCollateralFactorForOpenInterestLong": "0xc777cb82bf5fcf2085423ebb02d83a2e797ee69fe92e28bb541585d6d3ef9776", + "minCollateralFactorForOpenInterestShort": "0xea1786adf77d76ecc08ae1ddfb961397bbf8037fcc1f39f407ca682bd0cd31d2", + "positionImpactExponentFactor": "0x9fb394e7a8ca562a80c61ff34aafa3780f223eae1c7bab55bdd65f3e74d7c10d", + "swapFeeFactorForPositiveImpact": "0x8fe25e4cd1a3645c942c5754cb52f61d884f867f40c795ac14d8c0c4cb5a58f0", + "swapFeeFactorForNegativeImpact": "0xfe43f1671a9753bc846216959f80192c4bd06d228525f64f1bb0ec0b21616e08", + "swapImpactFactorPositive": "0x79e2b21fccda79427457db054b84bc2dd39d6e71e802603330463debd9e2cf2e", + "swapImpactFactorNegative": "0x3fb93539d5a21b0bfb035b684c90c976559174c5b3cb61a31eda7052cd0a8df8", + "swapImpactExponentFactor": "0x9545c1fa52965fed0922740abce09210eaf7584507acee7bb1360a4d9e1f2ed0", + "virtualMarketId": "0xf06bc1c76184711dce12891c4c427594295b8acb4611ed63f67f959841339acc", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xe55e1A29985488A2c8846a91E925c2B7C6564db1": { + "isDisabled": "0x689d334d377977381b2a899f0b1dd7398b033160ff1678e6554bcdd1c9c0981a", + "maxLongPoolAmount": "0xd5fed786a29744336d9306c66484307dc2ae9d7ce619f1a2ce3430f7cf13b314", + "maxShortPoolAmount": "0xc522cd2cc3aab97de8b4b6bef4c721666db2f0160251cd8bea561b45c102b54f", + "maxLongPoolUsdForDeposit": "0x35dd1b0bc08f806fb946b944e00057df4b3faba4d7b01f11e898c6f70a8c9115", + "maxShortPoolUsdForDeposit": "0xe6467e7f23670c517ea118df256d82ae26964ab6df069d02cae65e5d488ab1c1", + "longPoolAmountAdjustment": "0xc8972d97e544d38052eac848d1b3785234234ddbb693c2115fe4dff01e2c75cc", + "shortPoolAmountAdjustment": "0x0abab9170372dbe2c2cb903eb390556881f3951038a32c39e1c28f63948bacba", + "reserveFactorLong": "0x79eb8bbaefd5c3b54dd03bdcc99bdcda650ef0eab4ea2096cb6ef85e80ab3dcc", + "reserveFactorShort": "0xce32182cc7f00aafcdd28b36c93eef501912f96da531eb521473f1b424657fc0", + "openInterestReserveFactorLong": "0xdabac9c9897d22aff8fd56888a3fe190042ff10dd4104ed9b6ad134cb25efe8d", + "openInterestReserveFactorShort": "0xef2a9706152e2e770aa62b7d377348a4a37f53abdaf07d21de083cfc3b5b54a7", + "maxOpenInterestLong": "0x3b33780cf7d7534802e5c9d98ebf930fd131a493bbcffae2cdb11f4abcac70f5", + "maxOpenInterestShort": "0x1f9ad9e8cbe9e579ad882c2b711ea37f883b19156f8f9a7f0d4280038a191a66", + "minPositionImpactPoolAmount": "0x746162b17220b4e4ceb9af497ad55bc62832d1d73c4af7d352ce0d75ef1fae58", + "positionImpactPoolDistributionRate": "0xbb8a00a1b6f452222a202b9516fd3a2a78212f3fc925ef76551b57b8af985412", + "borrowingFactorLong": "0x9c407fb8a9f28065d80726419651f9c670dd3509ce909589885d1225e85cc22c", + "borrowingFactorShort": "0x546c2ca11f593235b2f7bd521a6110c7d27c2b8a3962114e941e5cdb9376f4f0", + "borrowingExponentFactorLong": "0xa6002213a8185064b0b612432844a15e7fe6777de315ccd1fb99054fc87bd2aa", + "borrowingExponentFactorShort": "0x6d44dbb3d1dc14dfe2746718e62108cf268fe83c98e3cf7baecc93eefab560c1", + "fundingFactor": "0x070d2fc854c8dcf88210a8e8983b45d6ff2db6ecb06ea5fbef47b2a02754b265", + "fundingExponentFactor": "0xb726992dbbe913e61a373900f2473e541e7073032fe0d0f5a8c478bca0759865", + "fundingIncreaseFactorPerSecond": "0x122f72317304bc6f2c67381cfb11732b72b776038cf0480c5df2880f746cc62e", + "fundingDecreaseFactorPerSecond": "0x09115f26582b1743a5e7a7f8d080fec6d3537a3c82ce32e75267559667287ce4", + "thresholdForStableFunding": "0x1146b75331e7a6cd3e53c7351116dc4f28557bbf98c72f84fad33785c96e3786", + "thresholdForDecreaseFunding": "0x8553e438dbedc68ffea45bcc7d26147f7ce855f184a5578bab832d9bf3de747c", + "minFundingFactorPerSecond": "0x44717a28da1a7d2536cc7dc3e690ec5f52642cc5de14c248a185051e31e112b1", + "maxFundingFactorPerSecond": "0xc99b408fa3abdf793c7508311103c10f75b6459450a8f7ba205fbc854f11848e", + "maxPnlFactorForTradersLong": "0xdec4bd5c55d0af82123c937bd7b6f886e517f0c7e1c940459a068e346a47fa1a", + "maxPnlFactorForTradersShort": "0x99a75d71a9aa0d00fde825a755f89eea3f4fb0c905591fdfe52f37099e98c49e", + "positionFeeFactorForPositiveImpact": "0xdde7cf99fc26d3c9e7e5ae67f7558d1d21fabe5b5881f645ecd574acbc1e999e", + "positionFeeFactorForNegativeImpact": "0x5c6320bcdc9efacd98b6a01febab34934936dd529ac3c8158b58232b6692cdba", + "positionImpactFactorPositive": "0x12350a6709e67181b6145c62f115ee66069858250ea4eb2b0dec9ee9da2f1a49", + "positionImpactFactorNegative": "0xc7c8e8dd75f9b18d858379050bfcddc53b2f2d1f7092df2a35e079bc529dfb85", + "maxPositionImpactFactorPositive": "0x66f52be66a69bc53a3985ef3c01c7c7906e8b0ab5b51f155f5fb827401b8c716", + "maxPositionImpactFactorNegative": "0x3ffb5d3349a72f3953a21481cbed2007a44e98153f737f733789c1fc3db6109b", + "maxPositionImpactFactorForLiquidations": "0x47b22aaab270336bca023ac06e6b5231bbb44f56716a9387e91e99241870f616", + "minCollateralFactor": "0xc27860b61b54460909bb28e4c88e66aa1d27de104b8b444fba674362795a4068", + "minCollateralFactorForOpenInterestLong": "0x3e352a600ba2709aa41ad9fe571943bf3119a5d4e2ed56b8d9c26f6b61c24df4", + "minCollateralFactorForOpenInterestShort": "0x74cd50f69586972d5835b60030fc59197abcd83dc5ed4952cf7211769bf9303c", + "positionImpactExponentFactor": "0x5be4f5dd05e107edd86e920723f94647246b593d1e08b704e42721024d182c3c", + "swapFeeFactorForPositiveImpact": "0xb7614344f2d22e57b6d2476711c7aad17d112f92c7f0b87606553bffaa0e7588", + "swapFeeFactorForNegativeImpact": "0x3c744c1515881778c9d315637561923c3d185bb0922e2816b2672425cf9c942f", + "swapImpactFactorPositive": "0x88f491f2b910faaca2409fa56898c9873596d94f61459a799f22aed18c3f0024", + "swapImpactFactorNegative": "0x063d716f2663e42baa3255283db6cadd96bc6e066eea5397683e050758613f72", + "swapImpactExponentFactor": "0xe15802d95e8f9fcde01134de2f73e873fd63c2038546f54c4734358dbf9d24df", + "virtualMarketId": "0x2a1907659d4afc6a54a0a01deef0c35b880da7344edcb626745819dd50792b64", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x71237F8C3d1484495A136022E16840b70fF84a69": { + "isDisabled": "0x1d8cb0c5491bbf7e6aa3117532498dab5ac718db90696b7066cd4ad3a71ca788", + "maxLongPoolAmount": "0x16425250cf9467d1646c6ef57833b5ee22975d4b9fe572fa79be9b48f2378ba2", + "maxShortPoolAmount": "0xf4923e22d8d2ed5bae6c1ad7acd69e4f87ecdcaecc3cf1f18fced7df99f29322", + "maxLongPoolUsdForDeposit": "0xecad1e8f73e980be296099a49ced054c19e2f7de0e50b1a9732d5ac2146a7115", + "maxShortPoolUsdForDeposit": "0xbb7c10c935bfbe117112427615ce0075ea60f81e8fbcb6156d797e712e939841", + "longPoolAmountAdjustment": "0x7d691d45c5a5589ca85823a7dafc604c107b1920a2f64d0ebcb1efe61b2f867e", + "shortPoolAmountAdjustment": "0xb39fb491ec016e32151077a364b4e003b1c0513674cc5618cfb0a0a1e72fd1f9", + "reserveFactorLong": "0x12ae2b86f2ed60ffb51255dce288e0b5817c5e29a8b9f396c898588cf13afd9b", + "reserveFactorShort": "0x4dfb4002f479e5210e1716840c1440fc069b9f061fda1f6df035141a2b530cd7", + "openInterestReserveFactorLong": "0x3f0226c07474ef33c1a97de9268b6c6a0d9343621789264195e13c765321835a", + "openInterestReserveFactorShort": "0x1e33dbf2471a8555158afab9087cc3e370a04d87fe42a9098c2e8dc2d3e653b3", + "maxOpenInterestLong": "0x985a4937eddf8dfab4587c1b7251038e474a8b12a9d83d14d8399e4a38fdbd98", + "maxOpenInterestShort": "0x25b191cf6c3daedf4d58c59b1a1926d6d47bc32b45d50d4ebb378016b9d93d4b", + "minPositionImpactPoolAmount": "0xe63715e6d480f24fa3565a67eb23fa341b5dd7888404e9f8257d5193dbf066f5", + "positionImpactPoolDistributionRate": "0xe7dfd27a048074da06adf10df10634194133bac261a72010a6f24cc9a1b068d0", + "borrowingFactorLong": "0xbae95568c57eef4c33cd3e88528c8690f1be4b6150e3c06e5fbbb6653ca5d505", + "borrowingFactorShort": "0x62ff8f71a5185ec4c22c6d4665b20fc222b50d45e198782ded5e8142edf32a55", + "borrowingExponentFactorLong": "0xaa090bf1edfd7ce16fdadf71f15c87c6fde1530d2d6734ab9e68b8d6085ad970", + "borrowingExponentFactorShort": "0xe87872bd22399842d536261fd9f2c75a974183fbc31e15e8fdf1bb064579e8a1", + "fundingFactor": "0x4ce494f4602f37cb4c45c87245957c55d336d11268d2955348a9a6d6a6b40b16", + "fundingExponentFactor": "0x6892db0bc7f71c6a53b2f09cbca46583ac441da03730febd7b04216f9d5089e7", + "fundingIncreaseFactorPerSecond": "0x9adc97e2552d704be1ef854e58e12b6afbae956fad6f4eb351fcb8a7765bff73", + "fundingDecreaseFactorPerSecond": "0x5abc94725026f5a840c5b832b7fd0b0396069f2572a59a4e3a1f54b824f9713f", + "thresholdForStableFunding": "0xd6f7ffac079f2ba85e243aa2ae8794f01e14999982a3730dc80cb54c351d7777", + "thresholdForDecreaseFunding": "0x4d6f6acaad1b78ed9304f4283074123ae5cc77cc293978072f49015035ff0abf", + "minFundingFactorPerSecond": "0xb7d0acd381ea34b56cedbde52da971e6d882f1b9d1ad7468953da0d27282c253", + "maxFundingFactorPerSecond": "0xe567c9d6c7b881eadf4a419a3f7a800435fac673e27db053fda52f9513755994", + "maxPnlFactorForTradersLong": "0x9cbacb634cf93a6fa613b31a68ce1ded9aca5143679ab689a82e9bbfc7c8783b", + "maxPnlFactorForTradersShort": "0x8de9a79752873cb14006e67313ab378ec606bb658c2d296b165bf145345a2593", + "positionFeeFactorForPositiveImpact": "0x8e33a75ecab6ae62818b3a34b74cecec08237ff1bdee24a6df2afee80d3cf513", + "positionFeeFactorForNegativeImpact": "0x5fc7dc3aabe90cf80ba4506802d75ca1fb6af53d099cd8d4526168b0ccd7db5a", + "positionImpactFactorPositive": "0xfc9f106532cffec12b6d284757fb145910b0ec592a415c981d5fe42f068d661e", + "positionImpactFactorNegative": "0x6db1edf5d6b901c21934667c8dbbfe802f182c1572aec99759ea829a18554844", + "maxPositionImpactFactorPositive": "0xcdbb8852bd100d2a2c9e96c3df6c8a3a1fa5166d2b0e6c0a026ff47efdfcec3d", + "maxPositionImpactFactorNegative": "0x02b2d57b10ba38e67b996de41580805338380c5a38991b67cca1d5cd26ae8245", + "maxPositionImpactFactorForLiquidations": "0x60a9b69a9726114c020d44750e3d51dfa117631eef925c2e5bb7d90a8bf0f16d", + "minCollateralFactor": "0xaf43ec1b76b9c6c2c5167932b08308377bec48ef36aee9e4f40bf44013315ea6", + "minCollateralFactorForOpenInterestLong": "0x1b990975b2ec9cb3d7800bdcf4c2483ad891a580d9bb318b533b40c52c2f9ba8", + "minCollateralFactorForOpenInterestShort": "0xa7ab6290b680865cdb9d52ee69ecbff08162372ac6787a60fa23c1576752b9ef", + "positionImpactExponentFactor": "0x4e8013515d6c6158dbe6773d5523bd3aa689ceca388b13daebe66b8535a1141d", + "swapFeeFactorForPositiveImpact": "0xe7891c63da843b7666b5eb17a233335244d607ef5e28491ff80a739409753cc1", + "swapFeeFactorForNegativeImpact": "0xff76682edc62a55d824fb3027104a8eeefc1aedcefe710468bda4a16e940df65", + "swapImpactFactorPositive": "0x914773be0246bae3852f2415f162581641c3fcbff05d9f9968dc8831bf8182c0", + "swapImpactFactorNegative": "0x736841319b2b2e9d22670e879ec64651e9e2ffd751de069908bc1edbedd8d0d7", + "swapImpactExponentFactor": "0x0ce9dd673cc4800b8a6664251479bcb647068469074cbb7839160b995624bab2", + "virtualMarketId": "0xdb239419e310d0cf2769e39b9ec4c5a5dea293bfb4f494dc31a7f041337c228a", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xfD46a5702D4d97cE0164375744c65F0c31A3901b": { + "isDisabled": "0x353433aeadfe42f457ab5bdfb5a4b69de9ee3c2e8a056c99ea26eaf560c85b03", + "maxLongPoolAmount": "0xffcde516a9ab5a839cd2de4cc0a4d7cfc69ba13dbc80eb3f7b5edb4ad5fe03ed", + "maxShortPoolAmount": "0x8e619514e37f188f03450dacf216fc5f1af0dacc111a5538867ffb1b1b42c035", + "maxLongPoolUsdForDeposit": "0x95aead2245b126c2242eed61f1eec4b55afeb21464aef1dd3f21910d3d109a20", + "maxShortPoolUsdForDeposit": "0x725c0eb40d63c87e959d7c66f9568f0b9b316bc6dddd4d1d457b240b7abdc1e4", + "longPoolAmountAdjustment": "0x16d9d79fdc1a11cf9663fcb7bc8f8d246afc860901381a995343e21a1c5dc9c8", + "shortPoolAmountAdjustment": "0xf17d6cdee17e86a931e201b1052b0f292ae26809acab2acfb92a2abeb874be75", + "reserveFactorLong": "0x81451ed96083c74b7ea4b443265191ce63fa709bcdd3a2ed07ebdb646800d817", + "reserveFactorShort": "0x7913a6bc232993645206c85be5adb594da10c46a5ac466593cf84ad008693d52", + "openInterestReserveFactorLong": "0xec71c897c5a1afc2803d7c66a4a3f4c134b8c91bd7b40610af82d549ed871a49", + "openInterestReserveFactorShort": "0xe265db4e6ff534bb18b69cff74711a466b4f971c897de573073f095ea06eeef6", + "maxOpenInterestLong": "0x88236e8a397c8b4d35ded55134597b1f35fbf9c37109644020105cf1713240ba", + "maxOpenInterestShort": "0xf05e3d1621d28eaf6599ba6976e87975637248508bad7ccc511d027061825ff8", + "minPositionImpactPoolAmount": "0xb9bdd635277ee9d903edb0e11dae426ddead569968a819077b640762e3d1bd42", + "positionImpactPoolDistributionRate": "0xa26d64f48cf802da2b8efdfa45aa7c9ba87679cb24881a1406f03a6688370ff7", + "borrowingFactorLong": "0xbdf03ef15aefbd2044db421c5371cd1d66812f64ee892e3001e14c6b55cadcae", + "borrowingFactorShort": "0x1f61e7757d08b2c043e6fd91273fe3131871dc26ebe023cb3eb9bff238b2cd36", + "borrowingExponentFactorLong": "0x75afd7bcaf621a87a8e5aad5d0e3832e4cf0126f7464ee51bc4c0a44ee58f4eb", + "borrowingExponentFactorShort": "0xfd0e2b15c278797ea603bc4bca27fec408e188d3c36be26be6521e1f7e4915d2", + "fundingFactor": "0xe37d6971f046ba3aab9ef6b4e7a2e377512d0db9b20cbf93d253a018e7dbcac0", + "fundingExponentFactor": "0xa50345c0a638d2f57861e6991ac36288518749e1e0974fe7bea9c4af7193ec00", + "fundingIncreaseFactorPerSecond": "0x39746fc835aa964dd22bb5ad201b5eb9ba5d71a748b788b1f71dba6eb9489955", + "fundingDecreaseFactorPerSecond": "0xd5f926685309caf494e0dfa4a6458c2cfd962ea0d397fa3b0b054ca94f1e846c", + "thresholdForStableFunding": "0x7880c0e0d1ff5dcf12d6fcc71d8e115169438ecaf1903267399a7eb320a74727", + "thresholdForDecreaseFunding": "0x7fcf1b8aa9a40ad733fa066249959b7963ec22c871258bd00e9ddda5650d9fda", + "minFundingFactorPerSecond": "0xe58d73dc7927988138dd3079fa604d81f8f2ab00786977c9fd6a1a348d3703c1", + "maxFundingFactorPerSecond": "0xaeb94b425d4f56f779214c9f9e87c4ee626cc51a74837db1a49b47432059c161", + "maxPnlFactorForTradersLong": "0x1faad52e65ed438f621fcc8af05068c362aa4ff4c660f93606ad9fa95d5aa83d", + "maxPnlFactorForTradersShort": "0x23729526acd13b670a94585d21a25c4293bb7b5fb8f1ebedb8af840b2d984b4b", + "positionFeeFactorForPositiveImpact": "0x25c6091da422459bf8e56ea2176383d6a14ab920c5a588df462db76cf3da7d69", + "positionFeeFactorForNegativeImpact": "0xe8c215ead248d58af1e22f00e423ada0096f747e49179f83f4c8bcdf9bb010d7", + "positionImpactFactorPositive": "0x2511daf43d5a9e3063f5e74f46def864a7d94cac6b5430bde3553e0bf2f920d9", + "positionImpactFactorNegative": "0xd994d099044c3dff63fb5cd824e94e19ed41dbf6d984c2635aa607257de07f56", + "maxPositionImpactFactorPositive": "0xb6030074cf76d818b5e23fff7d930392bdfaff530804a4c269f43ea0c743bdcb", + "maxPositionImpactFactorNegative": "0xf788cd2f0dbfdde4498546dbbf8ae4c3d7f72390ee8ea10079f0a24b88ecf064", + "maxPositionImpactFactorForLiquidations": "0xd9d7a07c1d5606567f0366e489c3262b466af8fe55e8608cf926ee705da17b6f", + "minCollateralFactor": "0xacfac03e8ca9bc9ba4e4139fb22189ce60223a4acf5fcb1c52fe6f5720c8285c", + "minCollateralFactorForOpenInterestLong": "0x7aba0e66c4752d2788a33b21c7156bee0a7e7db1ddec971a23e4745cb4af6a44", + "minCollateralFactorForOpenInterestShort": "0x7877dc6df20ea3c1896337e048ee1dad2b313d2753a43186a3d574f71f06069c", + "positionImpactExponentFactor": "0x15f86469a0ce25e4d194855ed6445f3c23aea50cb148f365967050da0ce93cde", + "swapFeeFactorForPositiveImpact": "0x4db5b6b4f93926225227f3e2887f72c9730b813d441fe6ce335cacd22f2461d4", + "swapFeeFactorForNegativeImpact": "0xac158b78400849537bf0f83aade16c435943f4194a4767e602aca8c41e366e77", + "swapImpactFactorPositive": "0xa3b7813df6db3b7ed3edef24c4e1955bd5e9062c80ff1abdb528cd2c550e8abd", + "swapImpactFactorNegative": "0xa77511e977f042648b2b03ea93d721a59db658e5437b141a25987849ea22dea2", + "swapImpactExponentFactor": "0x348400b3425cec4370585aa38a068c75cbe896bc7a7865020fdacf3cc64bff80", + "virtualMarketId": "0x3f997e86143f313e40fddeadb0f61dafbcd44f8a2d2b0dc121d733eeefce9368", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x6CB901Cc64c024C3Fe4404c940FF9a3Acc229D2C": { + "isDisabled": "0x622362f2888a253730c22ec88cb7844de99717ad830113ecc86fe3fe13a35558", + "maxLongPoolAmount": "0xf654350bf6848eb82ad90232423d284e344756492158f86a56dacb3c471b4f87", + "maxShortPoolAmount": "0x9a3ab597cce842498002cecfebc2f7fe373890e371e192d85242432ba81198bf", + "maxLongPoolUsdForDeposit": "0x259c62a58dcd674d9dddddf47b0b741b777dc6814612a279987bf724f6a6cc84", + "maxShortPoolUsdForDeposit": "0x41b41f4e919cdb5bd02517f6939abd60fa637dcfcf68094a38280399802ca744", + "longPoolAmountAdjustment": "0x93ef2d62a56763bd20159108effa00cd5ae8c9ed807c8d9b385639391fb57e50", + "shortPoolAmountAdjustment": "0x44180b4be0420c0abe15d0e17dcefc6362b4674104992699f800af31c209f335", + "reserveFactorLong": "0x3b4a3f101ac2275dfb40d8325b66d95d28ce09273e48d3d36f8ab5341200e572", + "reserveFactorShort": "0x04d6b353ff58226947f19a1e11229c143790efe72b7bc9203fcff1ff2da03a29", + "openInterestReserveFactorLong": "0xad29d6f619a9027afe1b9a84379c49be593fed500c17424b0748ee5ffe8247d3", + "openInterestReserveFactorShort": "0x931e734c8506729c062e131bc64ee38203bdcbcf310e92a2b974fa5f593bc7bc", + "maxOpenInterestLong": "0x2ea185ada87b69eaf675ea3af9116c1f8f419cdab8021d0fbea1efb6d4b5a799", + "maxOpenInterestShort": "0xaa5dd0eb0aa1e6e86b7d4bb79683925738ff5ee7f8f5397a4956735bd2c611c0", + "minPositionImpactPoolAmount": "0x1211215bc4e8c4244241e06180b4d3a502407e9fb189805e2c485507490a6b41", + "positionImpactPoolDistributionRate": "0x138f991aaa74dd1d70a172c75bbd06415bd344a650acba26e91d2bab6769b6b5", + "borrowingFactorLong": "0x9c95ded3a15fc1dc7b3677b4e3557c051a9e4840429bd31218bf4bf6557d9282", + "borrowingFactorShort": "0xfc9d57cc6dce6a1424f1717a5e9dd6358d2b469d4026202a4ae46a7d5cbfdbda", + "borrowingExponentFactorLong": "0x47916521a4fb39c933281f234659d6cfa2186adaf7c5c4654770664bd70e3c24", + "borrowingExponentFactorShort": "0x803f3f67152e36702b82bab2650e06a22fca5fd0b797113950cf7a1450848155", + "fundingFactor": "0x1913fc3a2e3342682226be4c86095c8b5d15eb020e88dd1829480b99d002971b", + "fundingExponentFactor": "0x62e95e91684f102842a264a77dc3f2344a2389b60ee4e71ef10083ac56525479", + "fundingIncreaseFactorPerSecond": "0x4f3b3df77c8b78c11a956d5c1df9893df67bcb871bd0f765b3ad3588e72e325b", + "fundingDecreaseFactorPerSecond": "0x13fd1e786d038054076299712fa89f5323556e55788a6608c3a2eab08bae9483", + "thresholdForStableFunding": "0x3da559e06e4aa9e774cb7c8cc2bbe71c58bbe0f4d42f6e524642a62ae105988b", + "thresholdForDecreaseFunding": "0xb1dfc3d89d08bfa92799a40dd41cf393073ee88812bbbd5f73c2cb251795fa6e", + "minFundingFactorPerSecond": "0x4d4a4cf2438bdb162dabe9b20e54fc8470cc81dad41c3920bb5b6c0d9bb8df08", + "maxFundingFactorPerSecond": "0xa738498ce60a1e9fb8a472d19570e7f4d00f74c31c36a97b171f906801db7c7b", + "maxPnlFactorForTradersLong": "0x47aed923299f3fc09a40d6edc10f33df888b0ad47bfb0310fc4c733d2ca23d69", + "maxPnlFactorForTradersShort": "0x5869feb1e30115c20d820201f07c0022f6c4fc17de5dbe34fc6068e433873514", + "positionFeeFactorForPositiveImpact": "0x89539fbe79008640ad6cb051248458e02b54818bb63a2d7ebb190095335b23da", + "positionFeeFactorForNegativeImpact": "0xf21f4e2bdd357839c21dcf6d38fc0acc4342a53b79215e4658eae1d6cd4c775b", + "positionImpactFactorPositive": "0xd28bfb3ca08c7494e67067bf0119c7bdba424b1387c306a28aff5dda8b377789", + "positionImpactFactorNegative": "0x39f461176d6cc8c5c445eea54a55500c067e773445570b228b27e5493c720160", + "maxPositionImpactFactorPositive": "0x985ded2301ade7f01d33f689a689b151bc07de2912a960554b32ff02786eaeb3", + "maxPositionImpactFactorNegative": "0x9f08921887c462f296204ce4faf11345ac3175e596f6d544cc8b93fef3d4d0a2", + "maxPositionImpactFactorForLiquidations": "0xa7b0973d0ec6caacca6e19044c9914fa639d36bc97ce2751e18c9ec3328bee16", + "minCollateralFactor": "0x6dc630ed9d38eb4d509bd15a962a8f3f3e85c305ed38bd87b5a691f8e80c6718", + "minCollateralFactorForOpenInterestLong": "0xe92ef25b6ac87cf0fe6420ff0b94dedb1dbcb99afdf6c01f4b0db2532a75bcfe", + "minCollateralFactorForOpenInterestShort": "0xb35e315882bf52eca4d8f8a1c1d0d0e47e8bf6d2e607efee31f62929e397ad33", + "positionImpactExponentFactor": "0xfd23c3422c995f8918ebd2dd7c73eeeff142ce0c12d07195868aa9d28d66cacf", + "swapFeeFactorForPositiveImpact": "0xcb64f5f3f45dc3723f11856db5925f30725fccf1bc1b2a79a60b5604b7b28fd6", + "swapFeeFactorForNegativeImpact": "0x440a1479e78766ccba8b1bda85ea239877dfbb362fc1ca7e790944538d1b11f5", + "swapImpactFactorPositive": "0x45a4bf705485557d4d27f88259722f6f264abf19c6067e7e7c80cdc45091f812", + "swapImpactFactorNegative": "0x102f11c727669364e295911cf2eeec0f717be0aa5c2954b9271ab9f497dd878a", + "swapImpactExponentFactor": "0x56ad8a94a99b9fb545af26dc677d20f81628bfe1973d7899ac0b1a7838db010a", + "virtualMarketId": "0x23bea52933bae5e3f00fd2df309b665c3cc4c09c4097d0b33c44990b28ef2037", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x71B7fF592a974e2B501D8A7a11f5c42DcD365244": { + "isDisabled": "0x47ea4fc78f3824506f56abe2672b8ede59cf65ce515f2487d0f117419c8d55e2", + "maxLongPoolAmount": "0xce5d9153ef198457e364cc207cde783d70bad4ea4f36724ed9d7d20366757301", + "maxShortPoolAmount": "0xe6fd3ab5bffa4e3a8119fde1409e5248ac69ae76fe1d7482d8652b130e33c2f8", + "maxLongPoolUsdForDeposit": "0x55f4ebc1737a2dd8810835427b06e83cf8408140f69e21287749af681c7e2a82", + "maxShortPoolUsdForDeposit": "0x266beaceb2c86230d999931c6f243a63bf0bc6064d33a6465391cd3e3badf609", + "longPoolAmountAdjustment": "0xa21f76a9c452ca3164554a5f12c7635c85cf90ef9ae4aa78288d1a978046f912", + "shortPoolAmountAdjustment": "0x8c7e6ff7b85400f03c601336c7883456c4e3055cf8c71179ad59da24479c28a8", + "reserveFactorLong": "0x614a8504d25f3e3326c1e00dd296ad7ceae6cf7b69a680a7c2231a471bd404e5", + "reserveFactorShort": "0xd19e4594c884391eebe42f90f30798ee18f1f466ddd8415df933f54ca565191f", + "openInterestReserveFactorLong": "0xb701c244dfefd9ced44aa1a3ccf6cbdfa32b5d78bbe7a670f2f81f8a641e4f10", + "openInterestReserveFactorShort": "0xf4b88f13ccad08670107022fe56a68deb3e0ba88772a05351db285212dbaf627", + "maxOpenInterestLong": "0x4acb500cff34fb37cd95789fe2316362805fe3fd6c903d8124fccedd96e6908c", + "maxOpenInterestShort": "0x502e846233c863a2a51d11406af0d3d13186568c4d228773ee4f65e3ee0a9666", + "minPositionImpactPoolAmount": "0xbb3c9aad5b77de4c5574bb4d337a15a2cdc03f71e1b215609ef87089ddd7c572", + "positionImpactPoolDistributionRate": "0x1b826aaeee10cf317e54e6d2deba52e64fc61136556eeaf1aeb4a518a3f1df76", + "borrowingFactorLong": "0x95de09076d74bfc57d04b30e870c503ffaa005314544b4fb4e3239de442a69fe", + "borrowingFactorShort": "0x07e135051dd9b60cca6177121064d07c96286710af630ec362a95128b767b939", + "borrowingExponentFactorLong": "0x5a9ae4c7f0810d391adc283ae62ff9168d5be2f050c9d0e9a021cf6e9beff89c", + "borrowingExponentFactorShort": "0x89bd31e33eb07c71fed7bb845554f9faf5baa088627b8c726c9073a298a98bd3", + "fundingFactor": "0xaaeaf85b378d4460cc0cec4cce8e638fdc9021d472b0a335f8eedb0b0a2f2745", + "fundingExponentFactor": "0xc2b0b5f2433ca67605a8c3637f64c79dce50405f237aaa304373fb4a040d2e63", + "fundingIncreaseFactorPerSecond": "0x68f9982ed4c95858c4f2f4ea2b79fc44ba98d8abd38e88acd572564ebb1178e3", + "fundingDecreaseFactorPerSecond": "0xc618e27d7b2ec01ee3d5d255d6ec72bac863d4d6d57d6ce671e170609b68cb11", + "thresholdForStableFunding": "0x3c5c82f9f43e530d543d645b660efab3d56927805d314a32db23a21377f01697", + "thresholdForDecreaseFunding": "0x52420b193617578b3ae4b1e2fa91a523ed034f8d3a91461bb7d8bf11e173ed8e", + "minFundingFactorPerSecond": "0x8f65e78f7fee35a370d45dd7215ead48a91073ba301adc5b64b690a6112c556e", + "maxFundingFactorPerSecond": "0xeb92533e6e161f74bf676c89ee359ec5c068d6c778fdb591257e578e71d2454c", + "maxPnlFactorForTradersLong": "0x1a2f6559d9f91c12210d3b6aff192fadd82f4cc3d8b2909e8c279bb5f36331ca", + "maxPnlFactorForTradersShort": "0x5bcc0c5f30cd53d5ed94d21c9caca0f4759ba82e89ae1dd7338d58ba3c46b0cf", + "positionFeeFactorForPositiveImpact": "0x69452664e040373e176a46455a6c69626760edcf593b9748b6e49fcdb9207a89", + "positionFeeFactorForNegativeImpact": "0x821b76dbcb68243ea72fd9f2f17fe6b225854dda300a06e396d151a436a4bfb5", + "positionImpactFactorPositive": "0x2478343077084acd3c7216ac2b5c943c00327604671cda4c7972e45006652fc9", + "positionImpactFactorNegative": "0x6cf62baa4a882cd293413510ffd531011af5693c6d0581ea345c50272f78bfe8", + "maxPositionImpactFactorPositive": "0xd17fe776c6710be10212b8230e5bc255c13cc6af2b50cac277a13f8c4d6cd675", + "maxPositionImpactFactorNegative": "0x9516040fbf31d98a9814482b56244c126fbf03066c9b2d2c2f8a456b1453fd77", + "maxPositionImpactFactorForLiquidations": "0x3e8a22ffba6968744d62efd7de40d2472b6624acad87770d5dd4ef10357b4555", + "minCollateralFactor": "0xde6358bbb99972ed5e13eab04486dbe4a4fc8610e3b7c77b120e6bd807cd78b4", + "minCollateralFactorForOpenInterestLong": "0xe51ceab2786b6da44608fcf1c9da64d1760bf55d57ff7ea1f9376b82886cbb20", + "minCollateralFactorForOpenInterestShort": "0xb0560b186b7882b503fcbe17a89c5103ccfa322beb5d1f323dc56c929db3ab3e", + "positionImpactExponentFactor": "0xb5eece59faa64c0cdbc8ee882453fb67959494a8c73137a924d203b375a1468e", + "swapFeeFactorForPositiveImpact": "0xbee33858c2f53747681135515053cc556c047320c641ae43bf2ff98c77b29113", + "swapFeeFactorForNegativeImpact": "0x0bfde157fd2ee3277abf7b7ff6c1c7fab4f935d0af6f51626219ff39a43792c2", + "swapImpactFactorPositive": "0xd4a5ae415f77d62783af1a2f28e78949cc864fd201805dbe149f5ba71a7bb5f0", + "swapImpactFactorNegative": "0xfca9588687c74abf7fbde4beebb4a829136a5a82f3f370b2de4e0c73e1579aac", + "swapImpactExponentFactor": "0xcc0d3d97121bf02f0c85acadcb5e1374d48fc36af6657caa2fc4147b1cc61ff5", + "virtualMarketId": "0xbbfeb7b134fb97b884e7c7e17388257b479d9a8f088e8fe3f7017b811c5d89a6", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xbD48149673724f9cAeE647bb4e9D9dDaF896Efeb": { + "isDisabled": "0x9d2e891674684321d86dade9ba2b650576063f76cb0738948bcff9961f624796", + "maxLongPoolAmount": "0x95bf6540bd25ea09b264b8a74b5a8d14a3acd735ca9a764d374a5f6fc4785996", + "maxShortPoolAmount": "0x95bf6540bd25ea09b264b8a74b5a8d14a3acd735ca9a764d374a5f6fc4785996", + "maxLongPoolUsdForDeposit": "0xa39a4d3bdfef4484a4d399dc47a1a665561c6de3af9dde531e325af5ffa66c0e", + "maxShortPoolUsdForDeposit": "0xa39a4d3bdfef4484a4d399dc47a1a665561c6de3af9dde531e325af5ffa66c0e", + "longPoolAmountAdjustment": "0x2b6039e3c06e13bd80fd97921827c6546d796fd7a07a427f64e62f67af7d4291", + "shortPoolAmountAdjustment": "0x2b6039e3c06e13bd80fd97921827c6546d796fd7a07a427f64e62f67af7d4291", + "reserveFactorLong": "0x159a946f21c30480a4e0c3c8ec2e371db4f1238b9c7e5824f1170286a8919603", + "reserveFactorShort": "0xd33a95b5d4cc0127ed1aa84aba6ddd0b049a2ba37c67c2c9d84c844e469e3aaf", + "openInterestReserveFactorLong": "0xb5e138fb0c4cafeb4546b5344e8dcc03c4c691ac43c823cd6b5874f9f4ff25ff", + "openInterestReserveFactorShort": "0xd21b97e46a3855a320147bb30acc2fcad93a9ad74df3cd87c9d5c07f89a44816", + "maxOpenInterestLong": "0xb532629316c57f7f3902efd1e31323329281a41165f48f28bef0469dacfb75a5", + "maxOpenInterestShort": "0xceef0ca62d694231efd4f7a1a65d8e1e71a5185331e016454311951ca750262b", + "minPositionImpactPoolAmount": "0xe97fa586de8e4f945f2573f0db7df97500f4221b1f2c9dc325ab65cf0643323c", + "positionImpactPoolDistributionRate": "0x140f13593b3126f73214f3e0c12d735c328ba532f1763c604352ed15f08e6772", + "borrowingFactorLong": "0xd5e1c866637c0f887c52cbddd3737307b90685a1265b11f2ed6c97c83be0c1c6", + "borrowingFactorShort": "0x3dd0164867ade9d1081171edd147ef220d19a7a65469b28b179e3df2028e49f5", + "borrowingExponentFactorLong": "0x4797a9d47eb0be6a4f3b314b48e58211733826f113f6b928cedd827f4cbd915d", + "borrowingExponentFactorShort": "0xc397f232f81734e126280b32a19b365c074d64bb375ec31c9d7ab32d57d7b168", + "fundingFactor": "0xcb08feda74b249d217e355ed4b32f0ab9083caa4d6173a8bd8e8a12c8fc982a2", + "fundingExponentFactor": "0xfab9fb785673684560720735c5d729d1519d4d1aaee12617861e58a9cf14eb6c", + "fundingIncreaseFactorPerSecond": "0xb3a9b6ec0f3882968752295f6ef85de359da94d69d30b5b275c9a9f1aefd4d6b", + "fundingDecreaseFactorPerSecond": "0x8073d4f202e21f904c74b0ded7158aa9f6bfe1dfda42920ea1a953403566f95b", + "thresholdForStableFunding": "0xb742d109e53b663f3cb972e1b5fc3d154f5c72668588683b2b81290a51c4a4ce", + "thresholdForDecreaseFunding": "0x30e33f5142b0b13b4031ca405df883e6194948a579257e98ad19116ccbd7b227", + "minFundingFactorPerSecond": "0xfc24e5a08e6af3ecfa6fcd8afd257fa4f6615f9cdedaae74b5ac71dec9f0cf5d", + "maxFundingFactorPerSecond": "0x5a28cc017bae74342dc55e0306a1689f0ebd446d7a5fd1e4f69c62e6bb7d1e45", + "maxPnlFactorForTradersLong": "0x7ee64b10ca3672add3b5595621a0a85b1464e5baa88109cf21dd92d2de7b37f1", + "maxPnlFactorForTradersShort": "0x44444fe884bda49dea6f16541f03a6f19bc4816a798201061bcc080868400340", + "positionFeeFactorForPositiveImpact": "0x4213ddb8b15cfe22e449464885b90c34587d1348102935814128d4f93564924d", + "positionFeeFactorForNegativeImpact": "0x24284ef4308f320d77eabb3547f89f1511230c1f7623cd72bcc5ce402ead1526", + "positionImpactFactorPositive": "0x7f3f29d1890b46600da48478685b3d055d9a4d094541f910d3c572bd6ffbcd18", + "positionImpactFactorNegative": "0x05fc07d81775825dd074d3658bb264d33c01c3ca320ebb478359e5d42f42e10d", + "maxPositionImpactFactorPositive": "0xf859b25857e23b61ee284c499197fb6f73683db766cd2b2637edd28191f7e629", + "maxPositionImpactFactorNegative": "0x0e36c4bf7768cf3820f171278211a65d274cc60972a4f72ea6c28f3836763f53", + "maxPositionImpactFactorForLiquidations": "0xf74bf32733bb1d7982b56ad9de64a3908e498950b3f5dfc5014b11b0a824c574", + "minCollateralFactor": "0xa8f02a22712a973ce74cc208414ed1f87bff38cccb528fe8aa5dfaaac33387ff", + "minCollateralFactorForOpenInterestLong": "0xf326ae64850d57c362abbe3e1a2223c94f4a69b17e96139800b5016fe434d4ba", + "minCollateralFactorForOpenInterestShort": "0x1140f50b1bdc82bc058279354f46501bfbec07ddf4351360e7fa48c5b974f4f5", + "positionImpactExponentFactor": "0x024d5e4b55579b3102b32e4abfad4d3ea602e20e4ee9e2f3c8b64f3724f0f580", + "swapFeeFactorForPositiveImpact": "0xa18cd10451678dd24a842554853984bdea8ee65419c7424c47fbdacee4ada0d4", + "swapFeeFactorForNegativeImpact": "0xb49a685327e0d1c29eec16feea9c99a0d4d0b5e7ed7de8c46fb83c37ab54cedc", + "swapImpactFactorPositive": "0x04d496484fc2cfc2e5031d2700045b81467c218ed0e70e99c4c5964389cd3fe2", + "swapImpactFactorNegative": "0xc7bdfaea94692f0b55dbdaafc9983db489cbc376bf88b3776f57f175713b2ed7", + "swapImpactExponentFactor": "0x18b3c48e49fb23c5a671425c0b1af3954268b0036dc606c5226b29e608b09f8d", + "virtualMarketId": "0x8d9d74b6296b77082205d718116175b560354c67b525e2c42bb79265f422c586", + "virtualLongTokenId": "0x383a0fdd5ebac620fe9349688ff6922600f2d5659c01c204e11f3181114b8700", + "virtualShortTokenId": "0x383a0fdd5ebac620fe9349688ff6922600f2d5659c01c204e11f3181114b8700" + }, + "0x784292E87715d93afD7cb8C941BacaFAAA9A5102": { + "isDisabled": "0xe66255cc386743eb1f47212fb016329c33080d4300c5bcd4f6ba12144aaac873", + "maxLongPoolAmount": "0x7ed15191c04d13ff9e148129dd00696547d9d7e329fa20d126259e919413ba63", + "maxShortPoolAmount": "0x437c6a21419b93b9ab4d0bb866fca1f97edfee7c39f85b84001f3cd87f8e04ed", + "maxLongPoolUsdForDeposit": "0x454a5f808bd713d1a3f00464f33f418580b2fa8565b1d7240f0f1328a69c15ac", + "maxShortPoolUsdForDeposit": "0x9869c5933cf5a4631929789cb2cbaf75a36eb19475462eb411e57c41c974e33a", + "longPoolAmountAdjustment": "0x823d0bb93d9a17c2ecd0b0a6be1cface5411ddeaec2485c9b489efec894315e5", + "shortPoolAmountAdjustment": "0x0b30f97590d9943d5c5ef6c042b1d038cc4e879ab8b98e69badc36fa3823609d", + "reserveFactorLong": "0x162110faff0b19e79c34a9483c9f49b3b80ddff250abca9f3b80a10c8887d3ea", + "reserveFactorShort": "0xc57aaa74ff0d1292e432aaca38f62ba000166df3bab75d1c49569a61325c513e", + "openInterestReserveFactorLong": "0x64ea0bc85411edb24abcf28cf9af0c38cb2c3f861af70f7b2842cadfca33c1f0", + "openInterestReserveFactorShort": "0xef66e27c13a9278930de29148a8fb3437724052f7edf9e5d929215e56772853a", + "maxOpenInterestLong": "0xafbeb47bff239fa939b283e87e8c072b70d2caa525c870cb1849c25093de74b0", + "maxOpenInterestShort": "0xd3cabcd3158ea9aa4222efc4d8805b4fc9e2aabea5cd0490d75ceed3d908ea88", + "minPositionImpactPoolAmount": "0x8fdc72693e0fc1a3e508fa376096ffce4b2ae6d9a3d1c9c9c6913e7fa6fa65f8", + "positionImpactPoolDistributionRate": "0xe70dc43909042680ec6991afc544aec1c1d95b9035fd25ea9498921f8c609047", + "borrowingFactorLong": "0xf89e1681036044ff1046dba91a2b77fa07f81d4e020e3c90ffcc6ce659c81f73", + "borrowingFactorShort": "0x66a1dd31544ca8412c1948ec575de7fff14dc9c494b68c02cbf219546b60a42c", + "borrowingExponentFactorLong": "0xae88be7bb701d8f9d70c917d46092b6f826483fb910ef6534608428e19c54ee6", + "borrowingExponentFactorShort": "0x383df541115c89e542e30c97f4b50c1622349128a4897c4c5452879d27ef8aa2", + "fundingFactor": "0xb92376d1aabbe6692489e5cd637a4cc20b94deded49df0a8e524a6721d616f49", + "fundingExponentFactor": "0x84c5ceb2ddd8aba5fad6e28b288b64f7e0e01b846f4723b74db087d39f357a09", + "fundingIncreaseFactorPerSecond": "0x9445325e2cdc9caf12d3200e24487d96d91a6b88acaffa4440e33bc7b1df1b7a", + "fundingDecreaseFactorPerSecond": "0x406cdc4a24149f82df450eacd4eced49b7d0c582de1f9ffc77a3273c5737312f", + "thresholdForStableFunding": "0xd510dc7200aff3f160bf3191fb666767a570ba054ae7a3f7eece484cd5c18a22", + "thresholdForDecreaseFunding": "0x549d8042c3dca844f58887930c698ee5b47cd032d33b25d323a802a8c043505e", + "minFundingFactorPerSecond": "0x2ff0dee159588be7c3fbfbb1332b34b0c08ea72393229fe6370d106454006c4f", + "maxFundingFactorPerSecond": "0x2dd5ac4c1223f9d1263588914bea5e89f3e0e779408819eb63989dba9e247547", + "maxPnlFactorForTradersLong": "0x247c69fdf78c9dfad71d03fc086389723570353fbc52843b757c314410b003a3", + "maxPnlFactorForTradersShort": "0x7cc5c8fcda211a9b92cd626a408e3fbc393f0c4ea81281a504770dbe89999911", + "positionFeeFactorForPositiveImpact": "0x9f42b71783cc6ced4d228c3a1cdb3ee53eb1c3934339f151155df532bb4d1a2b", + "positionFeeFactorForNegativeImpact": "0xf9f088871c68a5c744fa762744110706e273b6e17c512b9c7c683fe3dc9064c1", + "positionImpactFactorPositive": "0x10eb2d755e495c24fcd89f3a54b10d05972c0f759d2424c2d6fab44d8cb6e626", + "positionImpactFactorNegative": "0x48e3f3213c6b90f6705565760463eee86b3cb17c6607f33593ae8eee66567f8f", + "maxPositionImpactFactorPositive": "0xe24fe8e0a7bf583053b0850fa5a89ae870e0f4c7f1056a941f3c5119e9b626de", + "maxPositionImpactFactorNegative": "0xea48c7733e09bd6c42892be2c6c63cc52eddf6bd2414e6454843803c853b8a98", + "maxPositionImpactFactorForLiquidations": "0x1047ffbe213559d8d5e64a95f8b790cf9b5f58837998080930284ebe9d5d167e", + "minCollateralFactor": "0x381baf1ffa3e7466635bafa799da30f2b9b7d274d6c5373aed1627655f1c84cc", + "minCollateralFactorForOpenInterestLong": "0x7c973b82d160218ec7405501b5ddc34bb772866294bff340a0046a665e2247d3", + "minCollateralFactorForOpenInterestShort": "0xd3f8f45c87c1735b5bd16535061d0f4515b1e7f673b9877125011e406f02c6ee", + "positionImpactExponentFactor": "0x2987c92bacb9397e9b34e5f025f773730c282ee0ee4d7af7955d65f401508660", + "swapFeeFactorForPositiveImpact": "0x588f3720f115097a80ad6bce732ba1b277c43fd71d9bd09abb31b5ec5ecc4244", + "swapFeeFactorForNegativeImpact": "0xcac53996c0bcd4b4376d5cca41f5ec9258a4d089c1b0362ece54643a97a16547", + "swapImpactFactorPositive": "0x2a5710804a712f5b0eb07536474d337dc633791ed8ab8adf49ade86114305f9d", + "swapImpactFactorNegative": "0xbc15a6da3861fdc596e77225e3d77376b10df0f3f60809dee735fa659a3a094f", + "swapImpactExponentFactor": "0xe14778e61202b7041ed3f62be736053b6b0bb768dbe225f6b6593f8d04c89c97", + "virtualMarketId": "0x3868a2839dc7caede5f8b49e95791d78be3f9a9a1f8511d56f6a8ad687706f34", + "virtualLongTokenId": "0xa4c6349b14de45f6b5d19ee99a08ce0f2d4d4862edc6c04a7d302e941045bf8a", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xcaCb964144f9056A8f99447a303E60b4873Ca9B4": { + "isDisabled": "0xa75415e7190727b561c2f546465f499c86261dae843345015a8abe5f104d787b", + "maxLongPoolAmount": "0x889d96b472ff6bb0fa7507194968741cf53891b50d2490589ff970c1287be661", + "maxShortPoolAmount": "0xaae9aecbfe227eaa6bf8f5e3a3e42028d4b0a77127c4fc44e37a04a78936ed68", + "maxLongPoolUsdForDeposit": "0xd03939629a6f58fee46e02c2a6e793e5b265e65f6a7f44e1d13649853d67f407", + "maxShortPoolUsdForDeposit": "0x9fe3767bdceb2357c8a96beb22aa1ffaceb174d38d46151e073009f381c3a4cd", + "longPoolAmountAdjustment": "0xfa14e17cedb847cf0d73436ba1432a79404b6b5acd8bbd71c5698807d84e101a", + "shortPoolAmountAdjustment": "0x0de117e57cf9e40151bff492ec02a077790da10de5e19b9dad9f0902370e48a0", + "reserveFactorLong": "0xe6b65e41c0826da8c229fd0e00b315d2c3a5591b6cf66e346ee76a46dd3788f1", + "reserveFactorShort": "0x20df0c31fc7a5814e98ac2355cee918cfd34d4737dd704adfe1fa14ae3a9a0ec", + "openInterestReserveFactorLong": "0xdb9f593080f96752e7919cb49c6861ce1edf5bfa8aa98af6bf0bb2432d351aa8", + "openInterestReserveFactorShort": "0xd055cbefac475e982c49ee2f62f4ecdde000606c9e4db4d6aaf6dd74487feb88", + "maxOpenInterestLong": "0x9710d8b101125ff5c881a6af3a2c6c829a651285962c429e2119b156f7bdc977", + "maxOpenInterestShort": "0x6510ebe20341eaf3318ded9f2c29f1da51f1a85be98e94712cc0e8f20768b114", + "minPositionImpactPoolAmount": "0x507587b360a26976f24136a5749d68f15167c52aeccc80f3284fe2b6acdf8385", + "positionImpactPoolDistributionRate": "0xc953afbc38f49661acf9416496dace09a397d262e7ab8b222c1950f1f35c687f", + "borrowingFactorLong": "0x6a2364ac9e52f07b035016c7e935d78826bc3e243df19b1a7b21b0d487274b30", + "borrowingFactorShort": "0xe2b20205eb13d734a7ec2dcbbdcf7aca91d1dd36baa3f56602f4f8225cc8fe21", + "borrowingExponentFactorLong": "0xb605cae70172b3ef567ac2b95f55829731fa57b935cf0d2f30a744ce74b1d959", + "borrowingExponentFactorShort": "0x84f2afe793ab5bd8fe771a5b5ed8d69d1ea171e43b1ddd32f8a4c4c6227e29d9", + "fundingFactor": "0x62b189ebabc314c3baa20c5661968f0b8624864a21feabb407f4c9fea469e3ab", + "fundingExponentFactor": "0x8e7922d0a0855fd95e7381d7824c8d3efd4b175f99e969a1192929c509a47231", + "fundingIncreaseFactorPerSecond": "0x93024ef6762d5da2125da9a0f4bccfd58083a4962ce5dcd7e9b7f5b0e90eb0cf", + "fundingDecreaseFactorPerSecond": "0xed48da3ec25ce90fb62bd93b21383fc7da86fbbbfc29c920921020e393ba773e", + "thresholdForStableFunding": "0x5df8f19812143b00ce51530dcf21e5a160a8accb3ac110b177f5d4b21f03c237", + "thresholdForDecreaseFunding": "0x6d1954010bd1f7275d8ad458e9d8dc3fad256a935bd09b598837916b2fc76b2c", + "minFundingFactorPerSecond": "0xa3f220c34993f56582e8cfae2eb89cd9b5f87fb624f8252e322868f4b71c4ea4", + "maxFundingFactorPerSecond": "0x3f5f9c81a311ffb195588d8d2a1406b6be0843e754ead6c42d4e3a9a228958d0", + "maxPnlFactorForTradersLong": "0x50f46e76f53049cbfac213b70bbaa631e0b7f6ec49d7e8f4ceb2ae193c7e6686", + "maxPnlFactorForTradersShort": "0x90d010e60b9c6c085d351ee1bb8b290ccae5fbf0f488a39c8425d8996cc7b7b0", + "positionFeeFactorForPositiveImpact": "0x3a1710a087639aa8cd40aa7622d69edc8b5aeda3d09b2050db1191033990a818", + "positionFeeFactorForNegativeImpact": "0x3def1740be201793d19f1907d81f57467fe3358a18a0f657b2c26dbb7633a398", + "positionImpactFactorPositive": "0x55ade57dff077ae0cfbc8e7e87dac0abee5631f5854005f418ee719fcd9a1de4", + "positionImpactFactorNegative": "0x1574bbdec27482f6cd0b9503c89d23f2ffb3fa62ea5c2409cc0f453213464031", + "maxPositionImpactFactorPositive": "0x9e02885d6622621808b0428cad1e6f86b729d3743d3f4917ca6887d62137b8a9", + "maxPositionImpactFactorNegative": "0x5fcadf11f64a3fd603c4947b84d914fcf8213538b9a8108cb154f3826d849cb8", + "maxPositionImpactFactorForLiquidations": "0x6215ceff639dd1317d038fbaaef7e547ab0a4bcc7797721073a0d8aa4787df86", + "minCollateralFactor": "0x20d8ab78d0283316afeab33bf731344b07da86f7203514d76ee23baee753707e", + "minCollateralFactorForOpenInterestLong": "0xb67d83d1aa168418e39a9e63db05fc226ef950870c88cef6489ba60614555ec3", + "minCollateralFactorForOpenInterestShort": "0x3fa9ef62043d4b2c98b738e3e792a2cd7dfa6a906403619d068417f199d3e51d", + "positionImpactExponentFactor": "0xf40ffc6279286522266a0f262193cd2f2e3ab58182dd4ac525ffa47de5d45fac", + "swapFeeFactorForPositiveImpact": "0x5e06aa364ca3ec60ae841d9563ab289f341be788b71e1195751a1f5a6608d83f", + "swapFeeFactorForNegativeImpact": "0x379a330b77e5901172434cb0ea61bccadbe9ccddbe4c4b44574312ca7e8f9cf4", + "swapImpactFactorPositive": "0x4dfff87fbccb5b88103d2c18923fe113cabf5ea0683519bdf5aaa014901e5485", + "swapImpactFactorNegative": "0x948eb486fa79aecc31b6f33201e895a7a280dd196b0d44d58826f51052959432", + "swapImpactExponentFactor": "0x473b14d18453e5f6b724e70e5f3d9a89099d805d920a15c6bc678e9d4432d1f0", + "virtualMarketId": "0xab7e118a2f48a981792d85e873cd9c26d455365e8cb4c53f91bd97c59aa5052c", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x62feB8Ec060A7dE5b32BbbF4AC70050f8a043C17": { + "isDisabled": "0x56d220943643c3b776825e9350ee897b402ec6fc10944e9073abbf3abad6da1c", + "maxLongPoolAmount": "0xbe9c08850378833c2ce4f43695675766ae77cbd48cdf8e3e107404d83f735c0c", + "maxShortPoolAmount": "0x40583cd78116d2949dc391c627f8bef5bcac00ae5a4bce293a20414fb2eb3888", + "maxLongPoolUsdForDeposit": "0x30e6b13361bf17deaa9833b3130066e682819455a1688d579e3c461ff6ea2d25", + "maxShortPoolUsdForDeposit": "0xfc81519c826302ea5d6cfedc0432e2ff4fe5652f35946058be6c2277a564deaf", + "longPoolAmountAdjustment": "0x7d7929559624bedd43ae155e4c99d251b0bdd61edadb983b41ab5587b7785ce9", + "shortPoolAmountAdjustment": "0x47f8e7073cfbe07cd2f6daabfa3618f22e702acbc77e5b2e19139475963dcf4b", + "reserveFactorLong": "0xccd416a2129e6d2787321b3e83c4fe1d303272cae9beb26bd8954d5c18b9e609", + "reserveFactorShort": "0x278ae4969357672755fb74a4201eaccf61dc43ffe1e2154d28336940c4937422", + "openInterestReserveFactorLong": "0x2c0f62467f5a326ff9d98f29d23ce080d4741b7db1fcaf0ef0195dabfec78822", + "openInterestReserveFactorShort": "0x4e3198558d7ff836f3e34661f75412300fbfa18c4b82329d28eede80473a662a", + "maxOpenInterestLong": "0x3cfc0093e2f87627dd50c202e94f78d541f80507fe5ffdcab836b1e19d87815d", + "maxOpenInterestShort": "0x00bc0116aa72b10fdf1a6becfc19254ee805a42d0d1a3557825db8ae17944b80", + "minPositionImpactPoolAmount": "0x592ad8131ac93dbe1da6c891c22f9ce7baa7f85baf2a8cedb59b805c304730e5", + "positionImpactPoolDistributionRate": "0x6956a69d9dea4942db856c03abdb17b35fe2ae277e92a19f9db076b48ee0b5bb", + "borrowingFactorLong": "0x6cbafe65bd34bc2f2e8ed643fcbd882479d0b35d842a06722d92ad259f35957b", + "borrowingFactorShort": "0x7d11c676102977f7af0b8dcce48e97fccaf8a11b2f086b0ea89699b2e34ddeb7", + "borrowingExponentFactorLong": "0xf2111db2c35e3ddd6d28759fd228370c7bee44ee2824c222dfa03079504514de", + "borrowingExponentFactorShort": "0xdd65db1fba3cfcbdba1f567237519ba77f9cb3763e623a6f0fa6e8a1880aafba", + "fundingFactor": "0x63a0d675c93134f72ca34280c28383c470b84e62c884d4e75182abaeecbb423d", + "fundingExponentFactor": "0x330522e6e62a2fe24232c4037bd63d891c004d4075a944b834d56a9b118efe55", + "fundingIncreaseFactorPerSecond": "0x5f6d721ca90b43dda1a526cc8a1b5330c5965448140cc231f053ace9f25935a8", + "fundingDecreaseFactorPerSecond": "0xcf81e4f05d0e701e31cc67237e452c6f8555d056ebda6d593edd2bfdfd90045e", + "thresholdForStableFunding": "0x07205d4f67c92f49620daa3bdf442e9651605349a6f6b8379636f3a34f1c8b8f", + "thresholdForDecreaseFunding": "0x8a249cec07f3b190303862a49f5be63b2dc41411e8b7f29ba620fb159e3f0ba0", + "minFundingFactorPerSecond": "0x3ead72bc14f3aba202ee70d82896ec560d392f0cc93537e73e86f142ded0087c", + "maxFundingFactorPerSecond": "0x4ee72ac3d07cc7996644888cd430c9b2af6663ade143269b0f163c30e60711b1", + "maxPnlFactorForTradersLong": "0x2007ac1281a64c05a58188dcc4746347dc8baf24093eae44e9d0adf74e2aa161", + "maxPnlFactorForTradersShort": "0x258ea651931bbfbd89ab1b0c50961f9af713c552128cd62335d38f7454fb3e7c", + "positionFeeFactorForPositiveImpact": "0x7f6b38e2af31f0e1d6193d5cafffacbf10ce3c9e34654d9a6d8e012c3d23dae1", + "positionFeeFactorForNegativeImpact": "0x9ee47e77eb16355b9e0f26f0b3d35d3007c23828886d90fbbfef792d34c83613", + "positionImpactFactorPositive": "0xa6b8dc22fae5a3a3d30c9dc1fc679924822f3ce06151f15e5a699d28f4c5090a", + "positionImpactFactorNegative": "0x2b7ab6b910c3fd27027b1fe63a7d384342777c75bfa768d924743b609662362c", + "maxPositionImpactFactorPositive": "0x68831a394cdb16c32bf312f5c948d383c58754a438caaaf51383d97ab6c97e4d", + "maxPositionImpactFactorNegative": "0x18e0e262a34ad1142f0be76b66ed8c655241d4b2d0e4f2d453b1fe347d1b21c7", + "maxPositionImpactFactorForLiquidations": "0x190906736b8dfbfb8905e01464105472a332ab43303122acea7d280f99a89e58", + "minCollateralFactor": "0x464c137d7e96e96fcec38af328f9f2e20e1ec3ca751b7e347850ba39d3c519c2", + "minCollateralFactorForOpenInterestLong": "0xac1d1a8dd04b4b1ce72264801861bb8c24d7085a54a992bd00af1c678dab9606", + "minCollateralFactorForOpenInterestShort": "0xeb291f3c33fe4214bc3c2127cb7b4e5531517e60b055d0cef9f35e20144b85ad", + "positionImpactExponentFactor": "0xe2a98a7ee53e527429ff24a4bc99e39428f49da9eb48d9cce1b3814e1fe30893", + "swapFeeFactorForPositiveImpact": "0x7c8c38c435c69d053cda438aec9ba9b3b04cbed369c8ebf00855a4e5fe237e1c", + "swapFeeFactorForNegativeImpact": "0x520be5e89bd1667cf2473019ce4efe8c6c8844418027fbdb89c72725fc7c87f6", + "swapImpactFactorPositive": "0x5c8a37f30c9ecc13ee46d77b70d4331b6132fc1d387d3d6c8b4874daa9e45ee3", + "swapImpactFactorNegative": "0x728f7a1b5e5c7393136e513b4f434934682e69750993b9eda930b21a7aced4f7", + "swapImpactExponentFactor": "0x03c6473283fff9db0ddb65c7c99aef8132d1fb0ec5ec7bc0b2438ccf1f74345d", + "virtualMarketId": "0xca19aebefd1d090826ff846903d82e84d0c00f38deadc5b98f70d701742a4a98", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x7B2D09fca2395713dcc2F67323e4876F27b9ecB2": { + "isDisabled": "0x5ddc9e7a7860b3187569c971dc6b006165c90414d7986eab4e852bbcf0b92a25", + "maxLongPoolAmount": "0x81d920f1153041f65925f9b775458933257fcc13c2bd47273714782ed199dfef", + "maxShortPoolAmount": "0x51c9504dfc6e55d63706996bb13e6100f2ca0ecb735fc8240046545051b7b4ee", + "maxLongPoolUsdForDeposit": "0xf4b89e7ef6479e7c30df4e8742828acc3dcd24439c299ee5d7bb7340d73679f1", + "maxShortPoolUsdForDeposit": "0x60d207c8fc3a86d9fefb02273f002a05e703c690d86c853524d62f3515bf649d", + "longPoolAmountAdjustment": "0x7e12b9e658b2ad611f022117f06dc364b3fe2d6e3b1a87f5c64d2ad63f3bc10b", + "shortPoolAmountAdjustment": "0x4d5659cd56d7f7e1b5c985dc814e12d18106617f410d720f4b185707edb8e668", + "reserveFactorLong": "0x8e74c3dce19bd48799eb59fb1cdc6b1526c7f0bde326ce3b3dac438fe6e5bfd0", + "reserveFactorShort": "0x326407fde26890efdf6bb5d96ead450d79ea75610d5d55825c5edc69ab3bc579", + "openInterestReserveFactorLong": "0x67cf11ae334480f8dc66780a7ba265163b187ce8789af2911ab0116ea7d2d02d", + "openInterestReserveFactorShort": "0x626b50d5e7df0c0cf1d6a2dfd6bf74933fdad7a5c28e182561ac8288912f58d2", + "maxOpenInterestLong": "0x09a711f92b4349601680dbb11b289566f8c71c8aafcc97cdf733160efcc38681", + "maxOpenInterestShort": "0x9be8be9f15d25c8c2446f993e275ad9254351cdcaf33813d9fd20d5f8888e533", + "minPositionImpactPoolAmount": "0xfd9cde47b261814608d4e99db26e85567431ce59cb09075105c7e7ede0fb1280", + "positionImpactPoolDistributionRate": "0x6fbd7d129b9580b3e856da5e803e47b98c05bab516eea104531e5bc0b82ce50b", + "borrowingFactorLong": "0x2d388e5ea78606766af78263d980ac0565271d43cd78055d598b85889a9c3268", + "borrowingFactorShort": "0xae96c583dc6a7ea7813e15a9428372d26dccda184837b2aad0b1c4531e5c4b43", + "borrowingExponentFactorLong": "0xa69207390650abd1444c3ba345cac9a2e4323416774a927040278aef287f88e6", + "borrowingExponentFactorShort": "0x47237c63c7d4bc0446eabc67975b50aa2ce8a8f419382f532b4bf5617c922e3b", + "fundingFactor": "0x2f17f499deb32fca71fb1becab9898f9376a7151ace799f7efc9448772c89a20", + "fundingExponentFactor": "0x74f0db5b6addc0efd2be29338dc276dcad8906117a60fe3bc1d06b756f56b6e8", + "fundingIncreaseFactorPerSecond": "0xd2bd7886338385051c494186a8bf92df8205a14e287516eb8a259d6baaa777e7", + "fundingDecreaseFactorPerSecond": "0x424cc08340357b3d38525aa91ea2cedf855afbb7f6e33d0efd2d637567bc1659", + "thresholdForStableFunding": "0xb4f69f32f5feff78bbe605f6dd30b06b520ae983072b0fc01b8b631fbd541dbd", + "thresholdForDecreaseFunding": "0x49a86c4903368c37d5a58a69a65b2b84df1620b4a6bab661427ad41dcc993a40", + "minFundingFactorPerSecond": "0x75b7b24ebf922c34f0715898be0f8bc97b341597efeaf393f4d5bbb541c3ceea", + "maxFundingFactorPerSecond": "0xb00a848de94a4e84ad04a054b52b29dbeecffdded85d5bfe0937842fa610f9c4", + "maxPnlFactorForTradersLong": "0x09bf3a2601ed70a79d530344658e77d36302a0255588684fb388734a57452389", + "maxPnlFactorForTradersShort": "0x3cd79d723dadb79c31c7239fed102b724ce23ffe698a6df53486cfcf2bc4e980", + "positionFeeFactorForPositiveImpact": "0x8d56dcf0c488d0b86f23175f78a65a0c4b91eb4c7781b4f4c0c475159b64324d", + "positionFeeFactorForNegativeImpact": "0xd1af617cd6a3e2647dc6d7425372ea0a453f414ae9e49b372f3b1cb97cfff5b8", + "positionImpactFactorPositive": "0x56832fc87dbbbc799267fec5d6f05ef0d548d625dfb016efc230a8ff62dba3c3", + "positionImpactFactorNegative": "0x75fc8c5f45563729360cb9c59219ae3a7ba5e7fa35881282062efd1bda8ffa22", + "maxPositionImpactFactorPositive": "0x4830dab4380c54ddb0ef53e357ed6fa3a58a90317544a59a3a4672828f16a9c6", + "maxPositionImpactFactorNegative": "0x84a8dab8863b30af4f8f17deeb4e8e04e13f946d4486fa1865ac74974b5ad824", + "maxPositionImpactFactorForLiquidations": "0x2a86139fe39821bccc6fd82f93be035edc70f4cb61cdae30917956b8ffce8243", + "minCollateralFactor": "0x68a19f588c4ad0d3e1ee1c870ff0c3d4600a57e7be82732621425395992cbde1", + "minCollateralFactorForOpenInterestLong": "0x3b95e2164fa00e54a136f46ac7791ab382b33ca305385943a18908b26110b691", + "minCollateralFactorForOpenInterestShort": "0x92f543ff91b7e17ebe09b0a5632ba8fe800907683b0400e11b507585b22485dc", + "positionImpactExponentFactor": "0x0fff84ee08b85a7dc2f7064113bb23bba06f731bfb6fcaf0b0924fdb86198310", + "swapFeeFactorForPositiveImpact": "0x10a5906caf61db02617a22f487386bcaa73018c7170652ac5f829a8d9fc61204", + "swapFeeFactorForNegativeImpact": "0xd9cfb7f87d3d639a348d35889198ee8deab2cf9d84a50e57dda704d84fd6e960", + "swapImpactFactorPositive": "0x1ca2c01d2280bd5ce2953044135a4ac1612cbc1e51eb4789094d5277695ea547", + "swapImpactFactorNegative": "0x12d72f558e812074fe92ca12d0b09ec2fce12f75ad277ade95bb96d90d0d5feb", + "swapImpactExponentFactor": "0xffff85ac1f617e96d26113e10310a0d3c45e80b4eddf6522fe7c3ffaa18483a5", + "virtualMarketId": "0x4e45586413090d60ceb0231799707630a0f3475e3b42847f054746ccbffaa8b8", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xdc4e96A251Ff43Eeac710462CD8A9D18Dc802F18": { + "isDisabled": "0x4574cefef76d4897fae3631b2b0c7fb81d1e5cf5f1fc144e727fe9123d234ce1", + "maxLongPoolAmount": "0xae8babf906828d98a0daf0866f02f8a8c980d0bb5b6b9622454b6e52178723bc", + "maxShortPoolAmount": "0xb484be058d259e7ac293be10c09ce5ed59a0b5b37671bd37571f412980acf232", + "maxLongPoolUsdForDeposit": "0x0745c29f41e9bca1917cb438fcadee17d80b5e4930e87307084b3f88d16b2903", + "maxShortPoolUsdForDeposit": "0xf9dee183d448b8b0bad6a1b4f687c13d467b0f4f900987f4756a6bc67ecb52fb", + "longPoolAmountAdjustment": "0xab2deea690a29c6bcd9a55e8999bfd52ea06f35f9b3ea888d1c210dfd88a923d", + "shortPoolAmountAdjustment": "0x480d24c0c8df4e155ca8c3f9b17a2b406626bf79e447469edf4605c3b4b3c481", + "reserveFactorLong": "0x099b738b5d7783c9d7698c25e7ff482a7b9974d0d04e121d671c1a6cabc3ed1a", + "reserveFactorShort": "0x633a22f36b8ee0f33a91e020b175f110780a91f50f2c1b534cc101618539c83f", + "openInterestReserveFactorLong": "0x242383d341f4a5f8dcf99194840b17ddbf1ca09e4cfa3beaeda08a3b438d6959", + "openInterestReserveFactorShort": "0x67e8203441b4f887ce44ae3544bc163132d278033288ee340da8601790df3975", + "maxOpenInterestLong": "0xf5af74d0f6b7521c476d859e0a00b9048d9abb83ec456caf409a460a32da45b2", + "maxOpenInterestShort": "0x98d66ac85edcb0cd7c29c7b400bd1e6b7dbe34bc4c21d2ee1e0d4f23346cddb4", + "minPositionImpactPoolAmount": "0x2f4795a0af4f07543e1f870de02c8ed5d245ae71e339b8445fe0e0bcf87cee4d", + "positionImpactPoolDistributionRate": "0x1927a9b17b1398352ffa535769ab0964710033c90d0184c3e3594250bbf5463f", + "borrowingFactorLong": "0xfdc9fa178f5f2563ab59a05b8a09645d332edf9a64a6af75ee59567da7e17019", + "borrowingFactorShort": "0x363f4824059d9eccfa5138917a18dd773119f3b1d7912f1795e3a7a4656069cc", + "borrowingExponentFactorLong": "0xcbfde1958323ef97be5fc301bafcb293a68e50983dd2da509cf9286baa92e7b4", + "borrowingExponentFactorShort": "0x045440b933ba6bca8a4ac3df831b87315953ac913c9dc531d3a9b0422b6091d5", + "fundingFactor": "0xc43e39e4d57740fcb4bb38f663d3fcfe7bf8d61ca0a0ae1e102e3ded2e2d988b", + "fundingExponentFactor": "0x415df43d0167685d9ecade99d63552c9780fc84631320a05e4cf628c7eea66d6", + "fundingIncreaseFactorPerSecond": "0x29dae0d30b7feb729120824635126e39c8a87b24c2169cb96fb0b2c4c183d989", + "fundingDecreaseFactorPerSecond": "0x4a5ff61d6e8d50f9c76dc3f02fdbc7ab32561525e806a49e9d4d92b86f872f64", + "thresholdForStableFunding": "0x1e2bc8bb1960e2d2e6e1f9096aa19ee15e4568b7a58c93a2c2075aad9c563c94", + "thresholdForDecreaseFunding": "0x9de98169cb3733aef355a5660c092a42a56e8e643ae926b389dc4afcbf428d9e", + "minFundingFactorPerSecond": "0xbf2f75f51464cd0f307aa7bdf96366cdb617f0eddf4626c85171406f29cf68ac", + "maxFundingFactorPerSecond": "0x1221c040547c0b2c832ae1ae21ea71b6cfe703bbcce79da15d6bfb97b8fce14d", + "maxPnlFactorForTradersLong": "0xd0c316afb75722d83ac95f036d09c9c42e2875fd6ea447493e057d14d21cfc83", + "maxPnlFactorForTradersShort": "0x556e053b351738204ceb961c323050c2dcb5b167160fbec74dcef7ac665ce1a8", + "positionFeeFactorForPositiveImpact": "0xaccd9226cb98a1157f4dd7aaa3bca3867c8711717f02e1024679623e69ef1267", + "positionFeeFactorForNegativeImpact": "0x1b389553bcb979e53eefe32cf5b32de096277c55c6a9fb516e998e1d29483f8d", + "positionImpactFactorPositive": "0xafeb1e085d75e737b9082bafa645b5ff9d88c86101ce1eb9bf53086eda79fce4", + "positionImpactFactorNegative": "0xeeb2de5e802c7deefc7506ee2ed78ef90c42f81562339b7ac4dbf9989c8c66f6", + "maxPositionImpactFactorPositive": "0x951fa1a7252ce2217d6e71fdf8b445f94f389b7b73ecf1297df051acf958fbc3", + "maxPositionImpactFactorNegative": "0xe7b058ca894961f4f40dc9e2566920dfce773f64c438b5d415c1176f92a8b4bd", + "maxPositionImpactFactorForLiquidations": "0x6aac356dc62435be1465f2f736baa23e6ee3db9636a0dadfa42494493729693f", + "minCollateralFactor": "0xf57f95847b05863e3bb30297592097fcf7c8b2a2e25dec83ec531b914747bb4b", + "minCollateralFactorForOpenInterestLong": "0x7ee7a2ce8cf97ae51b250ef153c4e47b752fe2a51865364cd7e5e0d96213560a", + "minCollateralFactorForOpenInterestShort": "0x038f5c86febee95ef8fa08667309942a2242cce1fd1b73e5c9f889fb199e8bc5", + "positionImpactExponentFactor": "0xf20108440f12472008e2502eb559780bec72ab8a376f5f4ce9d978642f37134f", + "swapFeeFactorForPositiveImpact": "0xa3be727905b20731888cc2db25d31e4e8a41bbeaedb036c2aeb9570b03eade4a", + "swapFeeFactorForNegativeImpact": "0x73f6253a8128c8d5eb5486d65b6bbef9e92a29d142827a94e16d7c1e0d1c8c78", + "swapImpactFactorPositive": "0x21b32f554b31bdc78df56611840c5b22c3f83e6cf98ccfa40a961b576bb8f27a", + "swapImpactFactorNegative": "0xc2d2bcf31bf9a8344f5325216298aad7e5db29a9da562598e268aa22650ac8ae", + "swapImpactExponentFactor": "0xf370325fe03991f22b1bde52e04e37ce1e1f4889f89a8f7de3bc014392280388", + "virtualMarketId": "0x3bab1d667724c9754773158ac51a2b99d91543631412280d57981d4a3b100922", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xe902D1526c834D5001575b2d0Ef901dfD0aa097A": { + "isDisabled": "0x9d5e65be3348ff935a07d9e0f82a6348cc8aaf1c94d7213a0ce56b6f9d8ed64a", + "maxLongPoolAmount": "0x7d028f404eb2cd5a2a359f407dfa32fdc44fba2ae2c915bc90f270773f5077c7", + "maxShortPoolAmount": "0x6c32af1d98dccbe798233946044d43c7c963d00b16dbaaac5901a6fa99802b4b", + "maxLongPoolUsdForDeposit": "0xfbf6ba3a153e6e633ad3eb8fdae1ca409d639ad08d82daf0128dfeb1dd0823aa", + "maxShortPoolUsdForDeposit": "0xc339d51223852a8d6f9af901321467f50a2a93d2a83bea1c1e8bfbf54636c3c3", + "longPoolAmountAdjustment": "0xf57e89cf24218a46bc5bdad507a5cc56a424a1544767b5b01b4ebb8fc1eba5fd", + "shortPoolAmountAdjustment": "0x44b1531e7567b8cb08499928450c8742053c0cbf3817852f2e3c019616aa90b3", + "reserveFactorLong": "0x9752c5910751e6aa2c522ce6b4a2bf3ae10ab521226729163abab23a4cadadde", + "reserveFactorShort": "0x930aee0a504c8e451c59c80ce2e3b4b03db639376b37b272290ddb50d48856cb", + "openInterestReserveFactorLong": "0x1c5df85e3ce9ec81ce4b0d5d4c8223e8fe8fbc86be970e0f2b04e7513d433492", + "openInterestReserveFactorShort": "0xc51e5c8d9726764cd0c96c3e1cbd57e0af2a5c6d8da88fccdd0ac65d488bdf55", + "maxOpenInterestLong": "0x818064f899647786231b21c176c3f145ed65ebdc622903f81fbc7eb6d4367ebd", + "maxOpenInterestShort": "0x18da00a4269baa3c259c6b8039eed526e9c256e5356738f4f180204ff7f92991", + "minPositionImpactPoolAmount": "0xcec5a1e00eda3c259e759bea1b2c0181cc3e4e573295dde169d9a5a67e2e25f0", + "positionImpactPoolDistributionRate": "0x5dae922a4eb878d89a20b16c351d1976e54c6ec8c3dd1371858fc2c591b00bf3", + "borrowingFactorLong": "0x4d730946e7a2ae28979817de5615460137ebea81ea96c9334dda9b81902d26f7", + "borrowingFactorShort": "0x1581dd444142b8382837544c0f30144b5cfebe5388dafd2d6d8b87eb1ba7137d", + "borrowingExponentFactorLong": "0x6dc5f8783413805c9a0765669749e0ce7261cd0239e91b14d5c1318ad1843e67", + "borrowingExponentFactorShort": "0x0992bee3a9c136e06b52482bbf0296210927464950350eccd31d2a5af7bb4fa2", + "fundingFactor": "0xaa9c8e1ccbd8a3b07239a6905f7ad0b812b71e3a53cbc7e2751323f222fbf91d", + "fundingExponentFactor": "0xf8552989bbda4877a17f884691ac93cc662691e47613dc0aa48a645830b47963", + "fundingIncreaseFactorPerSecond": "0xdb747fc6248be81e81a09642ef407614bb74c9177b294bb05ca5ced362a8224a", + "fundingDecreaseFactorPerSecond": "0xcaeb8f734d4796d74ba459c562e38326cf4eda0d978a34bbbc99c605043ab5fd", + "thresholdForStableFunding": "0x6ee8e75de98e2f99fac19587824f969165e6384dfd8f2854250a1e54158a51ad", + "thresholdForDecreaseFunding": "0xc22021b936a86ceb59633e807feb3ecbe4ae560c87e6b88ab04305c9da164aaf", + "minFundingFactorPerSecond": "0x98b76394bd627e11dcff0f6ec535e53ca7b707cabdf295163efa384ff30d4ffd", + "maxFundingFactorPerSecond": "0xa716fed1ac79547e9a76aeacfac182f569aa0051b9adce527be60494b1970788", + "maxPnlFactorForTradersLong": "0xebab50cf54031c7f5a039b99599bd02c6ce508826096b21939bdd5404531adac", + "maxPnlFactorForTradersShort": "0x739d43d5c438663669936efa064b6da0f27b4cba3025b28bc441d48f9ab5a4bf", + "positionFeeFactorForPositiveImpact": "0xcb5daf2eecf37ca9cfb7d2b481dd87a9f2ce982e0f9246e6343002ad028cee96", + "positionFeeFactorForNegativeImpact": "0xfa33e9a8d5a686dbe77ec54459519c9f4eb83f3e948e4494952afedc0bbf5905", + "positionImpactFactorPositive": "0x660dafad2e4c7acef21088d044cb91771c793f9ec1ab1ecc89905e726a703017", + "positionImpactFactorNegative": "0xd5146ea76962da49c37a3cf7cb089ff75f8ac2593f10c4acddabb68005b6e686", + "maxPositionImpactFactorPositive": "0xdd5137f15d530282126920738b90327f8b0900665509f7244b3f790125559213", + "maxPositionImpactFactorNegative": "0x2240a4aec542c64a8ce2af813d9ffcce8a3cb53c501e67bb56c19e292105d1ec", + "maxPositionImpactFactorForLiquidations": "0xa4fe55cb4ba68ec434258ec31884b8f617ae8d1c8f6d0fff7fd9ddb535812722", + "minCollateralFactor": "0x876a4e9018e1ba1655bb96f13e4ca16365b7a5ad565f3f2005205f84cc1df97f", + "minCollateralFactorForOpenInterestLong": "0xdbe85b764eb648e48f9fc7ee2ca91b67515bd3c9e5093fc110b0db61825fc00b", + "minCollateralFactorForOpenInterestShort": "0x90d4beb803fbe580d51f0aef508be25221595bad32eead1bbf3c93bd37e876e2", + "positionImpactExponentFactor": "0x1a0c0dc2b23888100da389151b52c1ce3fc7b82e3e5347ff425be72c6fa91b05", + "swapFeeFactorForPositiveImpact": "0x18e4dfabef67599963a713e17ab75a97ae9a856c7f928a774b55a854d2e8271c", + "swapFeeFactorForNegativeImpact": "0xbcd1f183a9fef531ff9db7158ef135533c7dad2c76a4539fa8ffb261613b5941", + "swapImpactFactorPositive": "0x8678662699138feac68d6aaeb7318df4d064532ecb21d27591c5329cd16e1df5", + "swapImpactFactorNegative": "0x37fb6cda1dbc827e2bed64832211f7e3b22fd76d68eafc898864d33e3d28f7d7", + "swapImpactExponentFactor": "0x3407b3ef7c9e1614bff78ffb8563587f128252bad9a1e0549e50a5f85963b51a", + "virtualMarketId": "0xd62d50909f2b9f6559f1e5b6cf9001c973e894952e5e0196ef6922443225eb17", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x4c505e0062459cf8F60FfF13279c92ea15aE6e2D": { + "isDisabled": "0xde2afc8b062f4d537c1c08bc0c1048d32654d3d4048eca5858abd1812ba05ef9", + "maxLongPoolAmount": "0xe461c35f2615107dc56dfb37b931deb50b2febd8ef36b125e9e9f3e66a086cca", + "maxShortPoolAmount": "0x00f586b9860e502a2a745ac8534290dc96fbaa0b9f04293f30088181e8e9db8d", + "maxLongPoolUsdForDeposit": "0x7e6f75720b266acf29762282bf41802838d5dec989578d81e7036d59fbf400bb", + "maxShortPoolUsdForDeposit": "0x00023f85215caf49fdb17a4bad8d1ef7b3fb38e75c079a6edee3365ff4a2a9bc", + "longPoolAmountAdjustment": "0xa066b5ff6c5d0b119840cfe1dd1283039bb47b1d11f8a8da69e12362261ed20e", + "shortPoolAmountAdjustment": "0xb28dfd7bb38d1fb9ecfb5339346eb29bcce57981d7a1e5bd8d1046aae0484f11", + "reserveFactorLong": "0x4657e49add2de1d05ce31764c40a6d8acb51dc032923aebf58119f044526c4c3", + "reserveFactorShort": "0xf670176e32652e1b064d56892fa84be52db14b8d0d8c8c70b5994a28b7501077", + "openInterestReserveFactorLong": "0x9a7aa31a06769a2be330c69eb697a3b28a8ab5c3194f13549b923e41bf9b89c8", + "openInterestReserveFactorShort": "0xe387e5ef02cfea22eb3e6b391ae46fde8750902adcfec3d8e62e519ec21c5751", + "maxOpenInterestLong": "0x8d710fcc8ec4f9a5eac50ea3829fccf631642a05bd8eb7b61b9b6b1a2457b6e9", + "maxOpenInterestShort": "0x20fcb12cc7d8f1e304fd98ce87123da9150b26d6232a6abc89ddb0bc6174f36f", + "minPositionImpactPoolAmount": "0x60631f1522597713884484037e9b5edc534b596c1dbde71fb90ac1203625434a", + "positionImpactPoolDistributionRate": "0x775703db491c05f0f6181183595b3ad5870a6bf45e159cc1f9321e46309bbcc0", + "borrowingFactorLong": "0x6cc16b56d7304a4405bb33173c3a85c2edcc54b04d53db0695dda43afe950ebc", + "borrowingFactorShort": "0x62185375206a23267004973602470ac340d56cb407856768e186b9ca15caf3dd", + "borrowingExponentFactorLong": "0x46a9550b3e642cc3042081b0dec1c07a3c63ef2324c6f0292e62b97ef644357e", + "borrowingExponentFactorShort": "0xbdf420af9b810856beb8db321e3b60d7f0d73afc3a1bb9317c8b3de4c5045dfc", + "fundingFactor": "0x8fe9cb250bc1fd8be0802c9ec6ffdde4a3230c58f0eeeb0884ecba60c1fce282", + "fundingExponentFactor": "0x7bbb2a98e17a3801432e0e5090d6e1966cae80de4f0e98e1238aa812280d6d11", + "fundingIncreaseFactorPerSecond": "0x4619ab2e8b068d0c81e7eece4bab0cdd6c6df408c909d78ae1ea8be5dce04906", + "fundingDecreaseFactorPerSecond": "0x78a92d342b9ef21ce4aacd795e03ab89c1c31e1ba37985f4571e828c993a550a", + "thresholdForStableFunding": "0x65093f316a05210749fee0793e50917068a2ee2d93873e5b5031289bf61fcae6", + "thresholdForDecreaseFunding": "0x0557cb182584df996af9a294212cfd7f8e8122490e04118598204ef340884fb9", + "minFundingFactorPerSecond": "0x05bb4a9017d1a16bd2f08249b50b7672cb346f7e7ada094d0f7810404960e853", + "maxFundingFactorPerSecond": "0x5d7e2d74fcbc72cc8ac54171254ef83eeaa67ea9384263799cefc2dea798ff7e", + "maxPnlFactorForTradersLong": "0x2dd25d7a9185ab192d7157198769a10d3bc22b4adf53a49989ff8b5cc9f22f5c", + "maxPnlFactorForTradersShort": "0x894227f8a19303a369a7d58c20474e716b64d037c5344c283486f994ef540be3", + "positionFeeFactorForPositiveImpact": "0x8de3360a74370e5a1deb4c0584cd2b2a8f370807bca4a40dd63c6bd13677e148", + "positionFeeFactorForNegativeImpact": "0x24abce2c1fa286b1f26e955d5c9f81027f81a3e969fe6ac068954c5c7020d495", + "positionImpactFactorPositive": "0xf0377e82644972b454a3b5daed12bd739ac82c6c2cb07157150bd15940e0fb31", + "positionImpactFactorNegative": "0x240cdb280108e1b493cfa7a4cb0e18c8b7958c63eaaebe43f11044f3799ff0d7", + "maxPositionImpactFactorPositive": "0x16df3f537a8c0c960d6eb333e2954d65c3ca572a594869e3d2e770d2ea872c69", + "maxPositionImpactFactorNegative": "0xf73adfe3484d77447f9965114289574d908d3939379f298a8b6c60c3391f4a70", + "maxPositionImpactFactorForLiquidations": "0x603199403c207ee830b69e57605b19208e115487aaea260ba310330df2976383", + "minCollateralFactor": "0xf8b84b1cf5ca5b669e90e9fa97bc22a784f39654433ffaf839591bbb9fba803d", + "minCollateralFactorForOpenInterestLong": "0x74c0a14f2a215ff8ff5908b12fbaa3065d35c06a533007ed5e577223ebf46e4b", + "minCollateralFactorForOpenInterestShort": "0x94f50bb5bf06625aa0686259c5aaef25ec277ae0d18952431e8a79c424b16c4c", + "positionImpactExponentFactor": "0x19d95eb25a54270fdff0e791d1ebdbd32acf1ee56f11502fa019a1fad987c154", + "swapFeeFactorForPositiveImpact": "0x0b4f9aafd26ffb34fa8ed5f7ac3afcaa2fa8eb3bc6674abf977dcc940b58fef3", + "swapFeeFactorForNegativeImpact": "0xd57dd2fb2b0d6bf254f2c7ce4bc34f29a69d0274fdba121d2678558e6aec1ae0", + "swapImpactFactorPositive": "0xe3b67132e0f4393269e4b1a857cf64173c3f439061273ecf56a280f4c93de89a", + "swapImpactFactorNegative": "0xbb17be4a833e071fcd118fd099e5441fa4853dd41297654cc57483bad2c4ad04", + "swapImpactExponentFactor": "0x4583b3c42805ca8a4569db7f9c7e4f9c2afc4a1029672b2c9f1947794f2ea2b5", + "virtualMarketId": "0x0e4b2db9c58348cb77edaaf87970fadbdaf3c78fd3e14bae1302a30741c7a84e", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xf22CFFA7B4174554FF9dBf7B5A8c01FaaDceA722": { + "isDisabled": "0x4ea60051ea831649459e3e5518a827335732a0964736c1279e62a7daa0ba3125", + "maxLongPoolAmount": "0x440e6f58742ca9d60fb6af30a08c28b9788ddca006730b04297852680a657853", + "maxShortPoolAmount": "0x440e6f58742ca9d60fb6af30a08c28b9788ddca006730b04297852680a657853", + "maxLongPoolUsdForDeposit": "0x2447021ad5cf2cc23b05dd1aa74ed8c91e28b4bfad2c2084b37425b2f02476f9", + "maxShortPoolUsdForDeposit": "0x2447021ad5cf2cc23b05dd1aa74ed8c91e28b4bfad2c2084b37425b2f02476f9", + "longPoolAmountAdjustment": "0x1c1e003b4f63f0e2ae08ac185e4940fa3b0fdf1c8ccd8fd9e0502b807ea8d87f", + "shortPoolAmountAdjustment": "0x1c1e003b4f63f0e2ae08ac185e4940fa3b0fdf1c8ccd8fd9e0502b807ea8d87f", + "reserveFactorLong": "0x57caa92d4203e9eae30dd581b37655874fcf15da6cc23a2112c7bddf5d1b2d3b", + "reserveFactorShort": "0x5d2dc6864c499bfecf005209f5e191831b307edcd788c4f582893ea7308a3bf7", + "openInterestReserveFactorLong": "0x233346bef094718b3ccdff0be7dc808217d616629c2208da3f2c452f5b8f9c4c", + "openInterestReserveFactorShort": "0xcc10427c120b91a1a4bbdd00c920e4f27433caf20e0b9101cd42c91e405a21e4", + "maxOpenInterestLong": "0x9134df7fba1d92ad42aa1ac5125d0bedc32822716ace4ba3b5a562972249591e", + "maxOpenInterestShort": "0xf2cfb0beda7fb56ac0a23efe209ed1af46eae43a12d7ca2dd0c517b54e1bce36", + "minPositionImpactPoolAmount": "0x66abe7de9e50050340bb80c2625ec387c6fbbc1ffcc38cc29f528024753445e1", + "positionImpactPoolDistributionRate": "0x8e7dfc9eacb335a97e44784d434de889808bec6f42b8f875d6ac60f1fe64f951", + "borrowingFactorLong": "0xc1b2544b16ae22bb769565677c48d8b4b0a684efab1253ffc4ed9867c21d55cc", + "borrowingFactorShort": "0x43553b83e6b587f2a5377eef13ecd190e58e1631a0ef05509199b24bd623b5f8", + "borrowingExponentFactorLong": "0x7cc4f76c3d1a41ceec6ccb78e29f8bc91cafccef3af8635fe58f52393c3995d5", + "borrowingExponentFactorShort": "0x42887f69b43815985ee676c07f1f82fffbff9b7267a693e4f13f9d9ea51dc7d0", + "fundingFactor": "0x0f7ee32d5f3ef8545c1696f3bc734d9efaba242e7233c242d19622b986248c33", + "fundingExponentFactor": "0x61c7ae4a22c54424af86623c06bc9514e2c7c28704b607a65014f5f789542f40", + "fundingIncreaseFactorPerSecond": "0x4cbc8a012fecf5da3dc34e85c93923fe4f533f0be8323335e68d77aaf5002e79", + "fundingDecreaseFactorPerSecond": "0x145789094921b360cad7fdfd1b9ce5c0f3347e6451a41fc850028d7fd70d91ff", + "thresholdForStableFunding": "0x625349dfd96a38b2586c5b362e1dbd9851a3336dab6ce1797bd4236ef92e28fe", + "thresholdForDecreaseFunding": "0x63da106c4eebb78b05ac7953c385ae734c2fecf1c285b6a764a160c6cfa7bf79", + "minFundingFactorPerSecond": "0x4a7192e440527fafa46a103333dcec73c7aa910e77c4bb302d154fbc68a5187c", + "maxFundingFactorPerSecond": "0xefc3b2ab35080c2dbd038bc152b9a74d5c3b8bdd2fc6bf5dfa1f31e8caa7e985", + "maxPnlFactorForTradersLong": "0xe75fffd4d448c87a46cca3a9b7098d406e8f3bc9bf311da298a989b6d7d7976d", + "maxPnlFactorForTradersShort": "0x6c91f5580ab490648e285bdbf7a64d395f922610dbeb6bd3476696c0ffe94b74", + "positionFeeFactorForPositiveImpact": "0x246b89f9c45166ddd8149156fc0378e4a85ba91a41847d89e589c775b613f608", + "positionFeeFactorForNegativeImpact": "0x2fdd80b2d1a7b2ba121fcc94d39910377653574bb900257f8f16822f91cf36ea", + "positionImpactFactorPositive": "0x2a0b4b3beab009559d0ba4e7ebc3ce46814186fa089bceee28a8cabb128b8734", + "positionImpactFactorNegative": "0xee45a29138dcd27cec55588b13a476457b6f59098697700e870f332212b00ccf", + "maxPositionImpactFactorPositive": "0x96f96a3dcbac9181d1291533d01cfb863334e4841412fd3bbb89fc252fca1590", + "maxPositionImpactFactorNegative": "0xd2ec0dd1d422983089f9f513b3ee1983a2771a7d3420becdffb6ecbb6b07e82d", + "maxPositionImpactFactorForLiquidations": "0xab08f01b9295494f0d6e576dce047ae84eee136a8c3b2c5302812a75c65b018b", + "minCollateralFactor": "0xe9bee751eeaee778244a0b05e5dea9741d42b8f60a6527812d559db10378364c", + "minCollateralFactorForOpenInterestLong": "0xa588997b3b52f45c5ae3dd23491184ecdd8c73a4a3ad208d2d9b4b83d653cf2e", + "minCollateralFactorForOpenInterestShort": "0x5b71809f9c6cc7c5456b1a517e15e37bb710f1e8f8178edc89be82aa6922432a", + "positionImpactExponentFactor": "0xd6579b433a10d66cea53361ab3fd4b674bc36ae60752875ea1bb45c8bb96460b", + "swapFeeFactorForPositiveImpact": "0x02db1c795da4d08231be629c36bdd0b0300c763404833b049786d618d4c5cb3b", + "swapFeeFactorForNegativeImpact": "0xafc8b06e138caf77b195ea98c6b1454b3d1a80d39a3225b2ccb155c31a8562d8", + "swapImpactFactorPositive": "0xd8dccee431a28e96dad6b7fe8268ab59607042762992a7833e78b16764e5239b", + "swapImpactFactorNegative": "0xbeadf9c02cf8cffd063af197414f3af86d3691554a06b63f4130db8e86501697", + "swapImpactExponentFactor": "0x0d4f19104c2224d407664311bd165f0ca2089868a3cb81583973aba03af74014", + "virtualMarketId": "0x1ee40b7537bdf0fd26a566e83faaa901756983d19f549a403a4deb29725a3a96", + "virtualLongTokenId": "0x8f92ebbddf51de9f1607c3d6748a858fab29822d139ddcd3b8f877241ce75e70", + "virtualShortTokenId": "0x8f92ebbddf51de9f1607c3d6748a858fab29822d139ddcd3b8f877241ce75e70" + }, + "0x262B5203f0fe00D9fe86ffecE01D0f54fC116180": { + "isDisabled": "0x6dd4c97ef952195145a40799d60a5a1bf8fced20fff163dd96bc95843d7c27f4", + "maxLongPoolAmount": "0x03d7402f73bb1eb9c0d0b9f02a4250497c99793f906dd591f2607d4bd6f88948", + "maxShortPoolAmount": "0x9b4ece24931dd25e81b16f9b2700df76f1d282ac1c4beb256ec8a5013fe90299", + "maxLongPoolUsdForDeposit": "0x4a4137a960aa4797a57ec8a8a9bffec3800a0419971dd03427373de39457c6a8", + "maxShortPoolUsdForDeposit": "0x059a0e6696c968abb14a5cd079590cb93937fb8087ab6bb1a3a101201985b634", + "longPoolAmountAdjustment": "0x5fc05a685199771dc59b47a7afbfa9a3c9e60146e7c25616cb4b2ea58ef97dc3", + "shortPoolAmountAdjustment": "0x90771367196db0c5a4e946fbac64035c1511949a5815e9832749e458b197bf15", + "reserveFactorLong": "0xb91882e618a8a3e415adc7a39cdbcfbbe2cc26b1c3888c5dfd5ab68acf5969ed", + "reserveFactorShort": "0x7771f3d16b8dcd5a6d8a8c1c56428ae338768650501908b7cb67cd0b6dbd59b0", + "openInterestReserveFactorLong": "0xa8300e8f4b6caacbccc392642d709c54a3783d49aa519740b73b85bc7d8df7af", + "openInterestReserveFactorShort": "0xf086015ce85ddc9d444013e30ed883d3dd0c266431067d946097d23e27e13dce", + "maxOpenInterestLong": "0xa971c16db1da843f543e7f5a694dd41e6c68462b26fac9b88b52b27c08117945", + "maxOpenInterestShort": "0x30f3bc4782352ce1c463c281352caca3c48de99742562063a804c1be3503ccdd", + "minPositionImpactPoolAmount": "0xf6b8d4b7ba1e2cd3701c40e2de875879dc0df18d1398349e0a9305e08f757998", + "positionImpactPoolDistributionRate": "0x38cb1f359009fa81bf0112ad10d348713d1120b905d83542fa2b68936126956f", + "borrowingFactorLong": "0x9b26b259f5e1a6d82603e9e4647cbf98818f47c216e80f8f900a0ff0c3304df2", + "borrowingFactorShort": "0xd236d4a3213ef815eff586128ef7194e1232035cc5b56ca04d6ca0a2fca5c4bd", + "borrowingExponentFactorLong": "0xe9b1458717e1ac60e3c7fe6c272da8b2478d6d93d50b7a50f4eabf2848042d1e", + "borrowingExponentFactorShort": "0x28eee04bf0c8c4a40d5eaa39c85073c933fbb5e3773107e4887166cee023ff93", + "fundingFactor": "0x5b77f0881517b75eb0f8795489b10e943f75fbe0975f5e595f88a37aa62d8305", + "fundingExponentFactor": "0x08e17bc5aa0774a3eb0c94a1d869a65c35041771a1a0102dafb6110dd05a9e5d", + "fundingIncreaseFactorPerSecond": "0xe23631c8e3177717cb971c0b8519ed6c368d39143e0e46911e62be59f6d5ca8a", + "fundingDecreaseFactorPerSecond": "0x5d6fd20e6671cce3b24499ee6467f8db3b29a7ea0a378bdeb0d8fc3e85652895", + "thresholdForStableFunding": "0xac64d4a497efdac49c34d014532af0aa557869dcab7f3c8791ff036e4a126d05", + "thresholdForDecreaseFunding": "0xef715c3f683831072bd4f14143a1072033780c182ef9d4848a0dca1742ac45e7", + "minFundingFactorPerSecond": "0x117e5115774af6796324153839ba7c28920d1ebb0457c8cb274307e0354f977c", + "maxFundingFactorPerSecond": "0x571381c79d99d2433da47300740ac2cf56d5f573288d81765d1dcfe1d5509f98", + "maxPnlFactorForTradersLong": "0x1bc7dcf41411799ea846b1e435d7207e87bd8470d6bcabf006e773c3ccf650b1", + "maxPnlFactorForTradersShort": "0xa10652486af799bdf9fc52fcd7b78bd2edeae561dbd6921f1f3f01b5a14944bb", + "positionFeeFactorForPositiveImpact": "0x485e5ba479fe14d7297e82caa9a6dfebdd1090537a5f3ebc8595a0a0a3e24143", + "positionFeeFactorForNegativeImpact": "0x85691dbbbd49dbc8267640716d91d7101c592ba4e5af6e7309067de0bfd2a092", + "positionImpactFactorPositive": "0xd807ea14f321cb31d2d947d5ff941382054f9569c4bc7424ea5fb53b7691c4ec", + "positionImpactFactorNegative": "0x3163150b4a2ddbfc6e2d00a08e2d3db1f1a08878af03cc5f906e4876b7d9412a", + "maxPositionImpactFactorPositive": "0x82fd63cb2e91678055b06933cdfb846823e9c3b1481501047881465cb095afc2", + "maxPositionImpactFactorNegative": "0x300e239bc48235396d1fd413d2c8ac9564271f998a2d6d8c76168d4a1a33b3d4", + "maxPositionImpactFactorForLiquidations": "0x81f46680fdbbaf55d36de372843c18dd236a048355c44468a8e675fb7ef344eb", + "minCollateralFactor": "0xe62544109042c59f4f79a7aaa8e44233eb129115b7b113a691ecfe81d6cc82ed", + "minCollateralFactorForOpenInterestLong": "0x23d5a4de10d52ac5736f00723cb93b596ccb210a54534daf46984afe304838d6", + "minCollateralFactorForOpenInterestShort": "0x1a58e0ba8fc5c636b76d61a8c60ec71c99b9f3745706c79766c8cf0dcafed224", + "positionImpactExponentFactor": "0xb9cae052e8bfcce30a99ba0cc4f0812cb630723820d72a1110b112396114aa81", + "swapFeeFactorForPositiveImpact": "0x49b65dbdf43ce39b69e841c6230ae6627ceacc9334c4d819b206a8b0ef2d8e6f", + "swapFeeFactorForNegativeImpact": "0xf2ba731e689b507ae2035884b13ec6c67d222f165fba0061d615a11954f6e421", + "swapImpactFactorPositive": "0x9978b4eb0dfa425718a72f52aee70a622401b0ea0398043e50e286fade3369df", + "swapImpactFactorNegative": "0xe602c87380a47190b95ca4de2c92202818d7e26fa1ca73c8e1005fe7f1d2ce7c", + "swapImpactExponentFactor": "0x481f384180edf110580d4f79f24c4799599a39b2213198381bbe972e1d64d8a8", + "virtualMarketId": "0x056468869fcbcf8bbcf7b726adf30aea71c65d61a2dde85829d025ebd638b67f", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x467C4A46287F6C4918dDF780D4fd7b46419c2291": { + "isDisabled": "0x6f3365eca94c4988056075630326d3e1c377e2ab66c8143882c92be098d9716e", + "maxLongPoolAmount": "0x70e783db2dbfb9f8386ef938695fba15f20d82fdab616ce3265f6c6dcf8acb7a", + "maxShortPoolAmount": "0x05598ea0252f22e4960a4e49ead7aec4aeca88f2419d24d4c2f1e716feb44486", + "maxLongPoolUsdForDeposit": "0xb6caf755277c13afd74a5462065520082790b272ab64597cc64fbc4bf37a655f", + "maxShortPoolUsdForDeposit": "0xe7bdc6a2c661f4199305e3406f92307216f45eefb0effeb89ec39c2637af6007", + "longPoolAmountAdjustment": "0xd942467dfa81165590c0580a3a64033941b1dd90c26bbb54c18b42b92fa860d9", + "shortPoolAmountAdjustment": "0x764480ff473502e42b573856ea6cd47b4180560aefa0d06c654033b74a15f20d", + "reserveFactorLong": "0x7031f30e0b032d9c2585344dfa69075d500cd77f054df747614786dfb02c9218", + "reserveFactorShort": "0x79f2662f5af9a48ed9fc6632789164d0f88553348da1c665bd93fd78e61c327d", + "openInterestReserveFactorLong": "0x646efd7060f02bde654b8b3a32cea4d7d77d049f04a1b156c0462e329bbad53d", + "openInterestReserveFactorShort": "0xce92b2ed972f29c42b97fcfba7a6804b9fb432937543bb45f0dbede2f9e8d227", + "maxOpenInterestLong": "0xcb3e3ddac689e96245b0585e82abc3d5bbf7a72e0e6f9dd714558c97e5405b1d", + "maxOpenInterestShort": "0xd8a8b33a1b9ef5626722637e4c2aa25bf70d58f53420eba9f4950a0ae4094004", + "minPositionImpactPoolAmount": "0xca10e0f0e6426b4364e46b53b7f941d913d356ed0c1cd6ca2763586b3f71695f", + "positionImpactPoolDistributionRate": "0xc9c2d3378576b591400b454b49e3e89b66548a963c76957bfaa8c58b1118e6cc", + "borrowingFactorLong": "0xa2d1c70cad9d2191543bdae7210024a64578f411ce240ae38d941be526a8bc7b", + "borrowingFactorShort": "0x215e38e7657cc20889a58ed67cd23496e5efc09653af1ddaf46f4d872263f390", + "borrowingExponentFactorLong": "0x3166f16d2dfcad51d3d1f8c4253b2bfebff0749fc680f60a746aad3eefd300de", + "borrowingExponentFactorShort": "0xb04b5b494d07cc905288b1cbe2e0a6a582c792cebafe4fc8f87696d14bfd3b78", + "fundingFactor": "0x1c930ab75664d8f2db4410f3819cb6e46f58ee2dc97d37b33aef159ccb3040f2", + "fundingExponentFactor": "0xfad3cad6ae5c4734b621bfbbfefbb0a924a03efeef536d76865f6da3adec7f2a", + "fundingIncreaseFactorPerSecond": "0x4feac8b1e703644821adfd4f92f92fa492729b39a15d13d57b88cd5a13fcfbf5", + "fundingDecreaseFactorPerSecond": "0xed54d1f0f6afecb754c649a41d67fc609997527087d11ef7bc901d436235da51", + "thresholdForStableFunding": "0x34c41d8ee40a3a5468750d422308a8b8f631d9db5f3ba441eba7315139e9c3a9", + "thresholdForDecreaseFunding": "0x30c538df069cec73a5ef197585b7199cabea52ebd492d80c7734678073364cbd", + "minFundingFactorPerSecond": "0xd452e450c06605620af3d7febc6e9fd774d5355ff913436acc7ba2b977a0b306", + "maxFundingFactorPerSecond": "0x958ff648969e44b4659d79a393f28042f97cfcfdc8fc698c9010fa1da452fd3f", + "maxPnlFactorForTradersLong": "0xd8ccd387611f6b39a5f16eb0f13c0835179bf58208af7938f7a6ea98ffcfbfae", + "maxPnlFactorForTradersShort": "0x626e1b71533247a7b932b107904f1433bbc09b1de4bbd51932958fa8d444f613", + "positionFeeFactorForPositiveImpact": "0x3ba3e82158ca7a20ec5ac93874ab157c9467cb8ff224e0b0a1b7e1e2dc21f874", + "positionFeeFactorForNegativeImpact": "0x699524c62e892e3db59c9a3c858ed04d9f514dcb47513187c9aad9ae3815269c", + "positionImpactFactorPositive": "0xdc6271c18394b8a7062c7e9b84361c35e34e920fac4f7e13f9ef1a4595aebb9b", + "positionImpactFactorNegative": "0x156aa170f4820ef2479670eb20af8fc7ea2e5491f603493dbc2b9070cc948e52", + "maxPositionImpactFactorPositive": "0xeca13146281a419baa821b94f4498cbc4276ff0992e34aa2737f8fb79b508223", + "maxPositionImpactFactorNegative": "0x7c36e7cd53d579958cb553bb9fd79face0c9a226720cf88b05c3620ad9c54dda", + "maxPositionImpactFactorForLiquidations": "0xe1b63d9189f4f9f092128feec975a80cc218a5078db1338445d96c1bf9db4526", + "minCollateralFactor": "0xc119284ca99194e4d943a6af90e4dd7fb4bb14b050a974fb83142774cba81786", + "minCollateralFactorForOpenInterestLong": "0xdc7d2b11c98f133ad856f4e38b92fae525d6a2ae80ceeb3b420e240dfad9849a", + "minCollateralFactorForOpenInterestShort": "0x5c5f8d9af53545a1214654f78ad1e9a6ab37aecd5469c2e5c4cbcf8cd2e63551", + "positionImpactExponentFactor": "0xcc823670635973134c5087c8d47979affcca515532603cc92ebc945c51ed08c4", + "swapFeeFactorForPositiveImpact": "0x014fda6121726da59e193a952cc3a1cfd31b925febc198a559b2cc1e4d27f819", + "swapFeeFactorForNegativeImpact": "0x1a0c447e52ff673b57162b390edd27e8040ee4be5e52ea646e13630bf98457ba", + "swapImpactFactorPositive": "0x2f10e629b89a4e353d8d563afb62870a006f03e0cbd77759101e3e646d7f9631", + "swapImpactFactorNegative": "0xe6988279f833b1014b0483425d0eb061c1b244073b18b54d1eebf3a9de1f75cb", + "swapImpactExponentFactor": "0xd4eea362f0a2ac992a6ede6c2defb41e3416cef42c033d97ff2ac8b70db7e3b5", + "virtualMarketId": "0x773ccb8ee7deeaf0b761a6290f2317392066dc69ccf0e6b019722007598c5a9a", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x16466a03449CB9218EB6A980Aa4a44aaCEd27C25": { + "isDisabled": "0x421193dc127795dace90f01dea0586f1c183cfd5695f15f8e99b1ee000d852f1", + "maxLongPoolAmount": "0x028ead75d5ed15329febb14a355ecdb3ad8ba66c5ba3ab59adebc8f018c7781c", + "maxShortPoolAmount": "0x60fd8899e9d8c59873eb62351943fa8353d3cb5c01e4e4930ee8f9d2ca9494c3", + "maxLongPoolUsdForDeposit": "0xb1829172c867cbafe0e28440454f76d6f8fda2f2081740553bd75e86c75e93aa", + "maxShortPoolUsdForDeposit": "0x689d10c40af7eae5e82b72140c22943c59ef5b0ebb9f09d8ae2daf96295233a9", + "longPoolAmountAdjustment": "0x0f082d041e3ae2a85bbb0310fd76ce5a4bb8aed09ca7cb8d7694da35512277b5", + "shortPoolAmountAdjustment": "0xbfdc51f7f2cbc1d9c9e36f96e47a7a06b9ab80daa6514749759fb6dc78c9dc20", + "reserveFactorLong": "0x8ef363631a21ed0e5c86e8d2efcbb11571959f31b2b630c13e8803980a2f93d9", + "reserveFactorShort": "0xd8da6bc0e6fa20d0641dda4ac9982576e311714f9526df49fa3c050c742d0564", + "openInterestReserveFactorLong": "0xf2e0a7c7820ab0405f366b8cb2c9de19e3c3180562dd48bce308d9572b84eb1f", + "openInterestReserveFactorShort": "0x29231a90857f720c2d6d49afbe2e320870cf78807fda02dd0d07c53db879c523", + "maxOpenInterestLong": "0x1a52b88b58b5648cff40e22ce3873acaba7f95144836bf685eebce91fa61a0bd", + "maxOpenInterestShort": "0x12fd44cdf72d58efdced9ae25f2d23b5b52e6a80075309c70b5bb175c69efb18", + "minPositionImpactPoolAmount": "0x0b04f17eff6632562f5b25fc2d97e9a4374569b62331e791aa80c01da4109393", + "positionImpactPoolDistributionRate": "0xfcaa17a583c8b4f640e61641a84f3d61034075a88d6f90a3022087f5d38df399", + "borrowingFactorLong": "0x911d212f44f3b4d1f532f52cd6ec4e3227159961d4aea9d6cb432f67ee5596ff", + "borrowingFactorShort": "0x6f250f42f90ad6dad8f85adb80f1337f515e3526f48678d6f89c17e81de30073", + "borrowingExponentFactorLong": "0xb7fb1947aec2f9904cfdabb2ded2b633faa20340e94cd35e0c920c149c2d027c", + "borrowingExponentFactorShort": "0x6ab1ceda067d94e4a61a9dfcc1e4d0823781d4f8239c5fa720c56e5cdb80a105", + "fundingFactor": "0xcb0b6f93301a6ee4cf48b4d5a7a7fee29894112aed033f8ba179ed426b4cab89", + "fundingExponentFactor": "0x50fdf17406706f8e95f48e3fa8af6abbfe8f698fa8f5f3d63995cca28f79ba42", + "fundingIncreaseFactorPerSecond": "0x0d4e7ddd68f22aee486308112ccd42605c1ef072fc136687468a85794732c6c7", + "fundingDecreaseFactorPerSecond": "0x024b837fa1884678e64395af495daceffdb1cbd31bd15f135e76a45f69b544b8", + "thresholdForStableFunding": "0xe36c265a5b450ef48a22ed194e730d7fe9782223579082b589b26ad364a81284", + "thresholdForDecreaseFunding": "0xbbe56c818c14d5e594a0a64feb8f5c91ae07f8671ace0ae776f65efbd0601d2c", + "minFundingFactorPerSecond": "0xd32c84184c6daa18a6784539ee7c201369216316a7d2b368f32b47b62789fa5d", + "maxFundingFactorPerSecond": "0x2ad9d83577d571a8ce3521912811bf5b7c2770021a2c8af368fe8848a1bc4395", + "maxPnlFactorForTradersLong": "0x0f01b59ae43dd839e912fd5b24f5406c50afa7c2c37fce4f2268023e9c569959", + "maxPnlFactorForTradersShort": "0x46626df8db05a87d31252ce589cf2d44633ae1b0a2593ff6e43642ac83380acf", + "positionFeeFactorForPositiveImpact": "0xa17412d9fb8836576acf564f6b7d917e2523edc2b22e54160bf847b075938f12", + "positionFeeFactorForNegativeImpact": "0xa283b96249bd91fa6bf8027982b11be3b157850d5a7a9409a1bd92993b352d34", + "positionImpactFactorPositive": "0x98286b1d1ff96f67cba51e90d3335fa9395fbffee6ea6d6188f2f4d785fa5730", + "positionImpactFactorNegative": "0x8a2e5ca0fcd5b03675d20b12386f3b185a06f71604235ef8d305d427e65161cf", + "maxPositionImpactFactorPositive": "0xc81436f5558cb283c8c590d8b08d2685f138a0a10bf14cf46e547a0bda68720b", + "maxPositionImpactFactorNegative": "0xb375a902c092145cac64c3a449027132cd12c0e9cef6b72d54024276ab1fd84b", + "maxPositionImpactFactorForLiquidations": "0xfd8dcd34d1379f246478a28f69d7ffb710935582517b883cc2114ccd8e574e5e", + "minCollateralFactor": "0xc3b683211f897fd3d5139249aff11aa9339db2b59342fb4dde8b9f241ac744b7", + "minCollateralFactorForOpenInterestLong": "0x632d6bc9d36199ead3660e1d54803d97147abc31e2cac1b18dd386d250f44a2a", + "minCollateralFactorForOpenInterestShort": "0x03289b688ce32f30e096f9f305f6f1e4d654785db89ccc5a81812876233e02ab", + "positionImpactExponentFactor": "0x6af5e63b59afc60c71a45a325ded80a245d81947f6c9a9bff20d5f97e402fbc8", + "swapFeeFactorForPositiveImpact": "0x4f5ebafeb87725474637f4b264962f556c830765f047576f68ff7e5dde5ba384", + "swapFeeFactorForNegativeImpact": "0xec05b3db52f1252fa492f3bfd694cbe7c6b86bfba73abfea88f0a55026e61f3c", + "swapImpactFactorPositive": "0x40d4a5c09e6e2f7d78e3dccf44cdd2813b205c5f57942264bda60aee2add42db", + "swapImpactFactorNegative": "0x60918f5a146bcc03569cbf6e35e786a85e270d98a4db0043a431be58ecb5a3fc", + "swapImpactExponentFactor": "0x5c57dc3f5ad0d71a0263608d9d0eb53f3b54328e7d41e272393409353c21bc90", + "virtualMarketId": "0x2e1b50cd933617e9a08cda4f3cbe390c1f17523a16453e477dd04fb28c7eb61b", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xFec8f404FBCa3b11aFD3b3f0c57507C2a06dE636": { + "isDisabled": "0x9b47479681779232136bff94191786b1a054bc9873bb45f7f5a2753167144872", + "maxLongPoolAmount": "0x99ed4a7805dddae47b955be8182650fcb70c7ca328c6b7c8726478c8427f385d", + "maxShortPoolAmount": "0x7d89a3943e209b3732d83ebc097063729100d5a708deeb56d5028c361aeaeefb", + "maxLongPoolUsdForDeposit": "0x896dd418321aabb4c997192f624ffa2deb1f4b09cc72083e355c1858e84ec19a", + "maxShortPoolUsdForDeposit": "0x4927dec4b937cd32bb0a8e9ad5e517409b85984dbddba57b2e32d51b039af929", + "longPoolAmountAdjustment": "0x5467477977d60019f4cfd11a4cbda8339c1f0cf9714f99e1385bcc6706cd14a8", + "shortPoolAmountAdjustment": "0xf5ec9ed33c862935af38550fbb934dfea0bcb41c87f4b5ae09b2323f9e5c95a8", + "reserveFactorLong": "0xa4ce7688ed1a6a0002839ae78a5d098729f27751a20beaa7de493e47f2e25593", + "reserveFactorShort": "0x3a1c03ace65da032ba0b103b4c96a76c9585c7fd0884d51c0bc127bbf3512fd6", + "openInterestReserveFactorLong": "0x2ac1acf85d8502d449765acf34d804004066504c07d19e49b3ed0b0943602223", + "openInterestReserveFactorShort": "0xcf27f78a95962ce94a02e60c9212721f77407230f9cc612fe0a171fd5dbbdcc5", + "maxOpenInterestLong": "0x87505cb1f0997073955a12d59cfbe0ce5de2ad476f04a7b535187b61049d0a4d", + "maxOpenInterestShort": "0xe88eed3c32694849ded55dc980f782c6f25a1f0840dd2715ede79e005e168577", + "minPositionImpactPoolAmount": "0xcf50bda0a8870f3b5c946dbc98a5b8dd9ab4ad5803bd797da11467e090514ae2", + "positionImpactPoolDistributionRate": "0x152f231921f570d7b4ce9c48441b89477062143ee0bfe0cfb7c71f95fcc8e68d", + "borrowingFactorLong": "0x8767b852ff544d62336a0d63a6900f3151634095fe859cfd1dafcc0eb18b891b", + "borrowingFactorShort": "0x297596fb94bb890b7e12332d8a63cf0cf33de65f1a827691abefa5e9936c3ddb", + "borrowingExponentFactorLong": "0x134f58cfe70f980be19812f1ec844a6fcb4741e7f07b54121d3dc2bf4b9dd0cd", + "borrowingExponentFactorShort": "0x233d1eeac10d4dd07e8180a87ed6a571e983b1a3200f3c9182f29300ccdb162f", + "fundingFactor": "0xc5fcfce0724e225b6ea5f4e9a9f67ed640b9684495db65cc6f8820430a27491e", + "fundingExponentFactor": "0x503f7d1438df5d7ef64d0a4ee554bf90bc473c12fc58e62cd3559ce2fd71f5e0", + "fundingIncreaseFactorPerSecond": "0x9a20119644b5fed68f7f876790641a4a504772b5a3e5f0eff13f06ac3ddcaa84", + "fundingDecreaseFactorPerSecond": "0x3ab530c8232d976221f21ab5dfc3b8f86cc4674d4c0938deb0cd2c095325f523", + "thresholdForStableFunding": "0x195a91157c55bde27022576d243c186616d55f171c00b3d3ce0c0e9917f9da87", + "thresholdForDecreaseFunding": "0xab14434be42c66656bf3c2118f9c3acdb8efbec6b30916560153a72b5835d0bb", + "minFundingFactorPerSecond": "0x1ccc2a0dc32b50d2e58375905741f605cabc9bbc242db460da6b7ae1bf7ffb47", + "maxFundingFactorPerSecond": "0xb8b59b8e83c4387f3137e1d93b17e05ebb5ee09657a23e38be51a0b166871b30", + "maxPnlFactorForTradersLong": "0x0db2cfd5722d5941892740a8f929ca0005e95b48a333cede62a8e8baf05312c0", + "maxPnlFactorForTradersShort": "0x227e06582e069889ac13cbb616d3fdeeae60ecf7f8168d1c6735b88a0e1d43f3", + "positionFeeFactorForPositiveImpact": "0xd25728fc562ef369c5f9ca0569746770730f799eaf63c4b0eaa0ec16a272b652", + "positionFeeFactorForNegativeImpact": "0xe22b635fa6d9a5d645504462c7a6d08eef0c7bd5fd22a5c51e6fff32ab045a34", + "positionImpactFactorPositive": "0xc6dc725a1219aff8e142a456a399c768a7ba63b3cf8c7bba44991324511dff23", + "positionImpactFactorNegative": "0xc4425eddf8a89bbd5df8ec5c5f26ef4066769441bb055defcc4171293450155d", + "maxPositionImpactFactorPositive": "0x8cc4653a53206f190ed9e6141322f03b880455663553ae906eaea51d7f7f9593", + "maxPositionImpactFactorNegative": "0x8d6cc7722076a7f7c3481a48edef3eb7ae0c3857f46de999989aa6e26f76eb2c", + "maxPositionImpactFactorForLiquidations": "0x6c6d07eef5df4c62d9a6814f48a7dd355fc4cbef5a22b7cd055286f4c4018eba", + "minCollateralFactor": "0x74ff3abbabfffd3a5805a7c152e5b6f0d38444c6b1cf3684540fa3faf6f7bf57", + "minCollateralFactorForOpenInterestLong": "0x635e26e9daa2510e295f35fa17f561563e7428351b9282c13d5c56878aa57f83", + "minCollateralFactorForOpenInterestShort": "0x632cd25d22c65823f350addf0c66e3d333b599100702c61f455fd6404350eebd", + "positionImpactExponentFactor": "0x3d6458a712d40d0d9feba464a4d7cc2541ceaca6a3cd139baf5acedb67490c82", + "swapFeeFactorForPositiveImpact": "0x07679aa91501709e499e12f6f80e0ee1b50c26cf4fe198f1d57b702626c8bc62", + "swapFeeFactorForNegativeImpact": "0xe92bea4730d8e0aeddb90dc9ab5aaaa8c2ca3f9602b8cd47d3e73008fc60315f", + "swapImpactFactorPositive": "0xe7ce551847a9a3c438d4b9e7a4099b50291bf4ab3242383a4b621ac959238f8d", + "swapImpactFactorNegative": "0x599c414476937eeb2a4b91d90d9ca824d874a17112d7a5b7a7a7a6f6aad5628a", + "swapImpactExponentFactor": "0x83b84faad6af2797827d5c92195c971fd812696ebd930863f80db617fab45f4f", + "virtualMarketId": "0xd54671270c840ff5ed17ab95ed334f51e9ee4ffaef0500a61bc52a9e35e363f7", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x12fD1A4BdB96219E637180Ff5293409502b2951D": { + "isDisabled": "0xc3f1372aa6b53a795238b7e580f33fd8dcee2077fcadfa4c7bf46d2f44107f73", + "maxLongPoolAmount": "0xae64216ea7539ffaccb42b4cd5ea52b7cc16ae7da81088fccdcf8bdc9fd3efd5", + "maxShortPoolAmount": "0xd5d1a7c745f4d692a822f527e619e90959ad2821eee7d9cd64982d08422b0e78", + "maxLongPoolUsdForDeposit": "0x9efe51b0c461330aec22128fba3ba9377798a90cdebc4478df6d65f2a87070a2", + "maxShortPoolUsdForDeposit": "0xd16917d939da1f83f49d1c86e1fe7292cc4f155f3f4f37b4fd0d4abb503e812f", + "longPoolAmountAdjustment": "0xe7d14921534785e32c27d0047d068a68549e0ca412e0960b4d102adcd7e4b4ce", + "shortPoolAmountAdjustment": "0x973e6424f122e9294ddaa1f9e481e7b1bbeecdd7197328c8cb5ce7ac3a1a7284", + "reserveFactorLong": "0x477d2d6888b0ec9422789f3d32564bc1b86f5c2276baa005d4fde7c7f25bdbba", + "reserveFactorShort": "0x7b735e731231a020494a8b826986c141ea32c5fee7ca0bf3bc1f40e695c7a76b", + "openInterestReserveFactorLong": "0x022e75996f1bd151d4125e7fe4dbb0302c1a492b3996ffb5735a509c28895297", + "openInterestReserveFactorShort": "0x14335cee78f69bdcc0a61d53f73e4d058fbd2f56800cdd5bf04383370d0f1039", + "maxOpenInterestLong": "0xf545b1668223b6d96764be242ffd6efbcdcd672c27f461fcd8631b511990897c", + "maxOpenInterestShort": "0xf97470d0ced3899175333c5b3609410a0b8e712c6ed749e8e0fe6c98b2bfa449", + "minPositionImpactPoolAmount": "0x1bbdcf87eefea4fc836aba3be92272741ba42f15aeffc008fda97189cbeaa7e2", + "positionImpactPoolDistributionRate": "0x5457ab06f316d588262c1809b61bea7539a8cbda501a8c16ab84b652784449b4", + "borrowingFactorLong": "0x82ca08518117886d1862cc9c041feee61cba0fdf3ab0a7c42c28fb78e344dd91", + "borrowingFactorShort": "0xb287d082710f70d45e3cb13c633f88314d2a064133bccaf6982a2422cd36e511", + "borrowingExponentFactorLong": "0xb4c87ff5c6696a171d29c56a97dd691beb3b87fde6a0de385f28576b37fc4aa3", + "borrowingExponentFactorShort": "0xb794829e522b3479a0ad659092369064166d504e6c5d0ab0b85ddcfa26952e33", + "fundingFactor": "0x22328656126629d5b7ea10bb428f5262ffafeb16da4051d6366e0928a0effde4", + "fundingExponentFactor": "0xfa8cdfd8e27aae8309723b91e895079f90c48d88a6be786ac7f8e3e26d8a2b92", + "fundingIncreaseFactorPerSecond": "0x33929296a94dbe0571ac9c6cae165ef65718d489566c4c45119e7a2c91ad1249", + "fundingDecreaseFactorPerSecond": "0xca5e774776bc138e72bcafa39640ef91a21959753b7ac5c0ebd608e813b5f1e7", + "thresholdForStableFunding": "0xb749f39391d1e71a0e6ba00a97c5bf85d9026d101d2a7fa3361f5ce310200cb7", + "thresholdForDecreaseFunding": "0xeccab6f2eb5a2fda1903bcf0c97e03a4e7cc5cfd7b178dce0c564a013cdc20f9", + "minFundingFactorPerSecond": "0xc2fd4760c999d21fcc12cde33b107710c3ed86219c21f177d6a64c3068da79fe", + "maxFundingFactorPerSecond": "0x165feae3bd1ab2eb1c9b96390f8e1fca5e9672ef7dfba842db1fa1ef6565ea1a", + "maxPnlFactorForTradersLong": "0x77b27385bab5c8d5ed0fa84f2066e56cb9e87c0ba5ba36c35644129d849638dc", + "maxPnlFactorForTradersShort": "0x0571bc79d5f2e7ac963ef77dcc8db61ab10117ece969811a6111959a54ee76fc", + "positionFeeFactorForPositiveImpact": "0x988dfbd600a0d356c99e2d7cdb6472503b3c188edf670ff9baf49bddba8da86b", + "positionFeeFactorForNegativeImpact": "0x97be254933fc6763edb5aba3e16fd3195f269f9344ffb3477c65e2557f1b8cff", + "positionImpactFactorPositive": "0x2ae31cc08f53dccf910ca8d14bff6f143a1daeb6308c48417e93dab69ba2cf37", + "positionImpactFactorNegative": "0x939bf505096c7330665342c1763b56d68b607607ea69f5afcc92b2bc753e28db", + "maxPositionImpactFactorPositive": "0x9feaaedae8e2a793d61085d2d1545f6b03b5ddc48e06a8a4492c2c66701797b9", + "maxPositionImpactFactorNegative": "0xd2f75c6291a799c429b9fc0ead5e7e999583c93ae7e7dbcd94c693acab115f98", + "maxPositionImpactFactorForLiquidations": "0x0dc9c6e1420908930d17d95aa2f6b86cbb245c6c47f36b9f8bd7a51a3d82344e", + "minCollateralFactor": "0x331419dea97f8be91933915bded722dd38f3b607cffba6deabf347336fdc3141", + "minCollateralFactorForOpenInterestLong": "0xbc8a5091e0c1ff7f8b613fe045ad5ada27f7f46e2025bd0365840c89e99bbdbc", + "minCollateralFactorForOpenInterestShort": "0xf612745ffdf98a5dc5d3c7043463ad56ee7554569609b8329755e5dac407e1cf", + "positionImpactExponentFactor": "0xb9f2ac464580caead32af83210f8ec22c484b3987a0f6a817ed0cb94f08e41fa", + "swapFeeFactorForPositiveImpact": "0x8607c2a1d0ee1c4c21a541044c8adb91d9a89509c6c861cd6b9a197f272bcedb", + "swapFeeFactorForNegativeImpact": "0x67659dc676411b9d0f40e02dcb934b664abc8f22a45fd6934a1dfd6cfcd9deb1", + "swapImpactFactorPositive": "0xc99541a0a2b9d346b58261c0f9438a8b0406a64d5bcd334a1b4671a81191c4a0", + "swapImpactFactorNegative": "0x6d6b01ffa99d507be49eb5b27911ed5c7682570a8105329a96ac502a102003e1", + "swapImpactExponentFactor": "0x9bd8fd6fdc873ebcce7344f40df1fe423538ecf2de56154af9d701051d301c29", + "virtualMarketId": "0x9544673f4807a26db2dfb80dd6845aefcabe4bb94e1ab66f453ea515a8f00cc9", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x9F159014CC218e942E9E9481742fE5BFa9ac5A2C": { + "isDisabled": "0x0deae7449df45fbc17e56fad107f41fb2bfebb55684884a01e6244b754012a0d", + "maxLongPoolAmount": "0x55a4730afaee19dfc4d298d39d14233a3337c7d7d7d8f7ab0d78f6a987ccab99", + "maxShortPoolAmount": "0x25b5d66509391f4977481197a4eaed6f9659ee5ce490d9c54ac7973e513ecc9c", + "maxLongPoolUsdForDeposit": "0x3c60fe1df18a072de21f5a2f64e82b02451cc165f7ab02d176bc391f86e01a2e", + "maxShortPoolUsdForDeposit": "0x9e87d4f51e0c5e1c25aae0cc569dd7d96b9455283d70b0d50cd2c623e16e7d69", + "longPoolAmountAdjustment": "0x578c471feff376eaa16354a173fd676724686a5dd699dc88185c270e4b381dc7", + "shortPoolAmountAdjustment": "0x80e7f8c4e4b5dc50ffa5eb908c9e536dfb63ac4532fc7fa31d610feb856324c8", + "reserveFactorLong": "0x13ef4fbcd19aff7391aecff05bfed2df79e539ea1dcad877944a3afe67634774", + "reserveFactorShort": "0xce5c029134fed3784bfbb439edca29c887b0ccdfb688c1e95b96fef1be6142d1", + "openInterestReserveFactorLong": "0x5a14ba46de95f0808d08c3bf813876fdbf48fcf1583e42c57043b0562c2b6330", + "openInterestReserveFactorShort": "0xcf05ba5920ee87ca218f43e1cc8fffe917db31d6a4bf53e5505c92bc1fa55f5f", + "maxOpenInterestLong": "0x9f6efcdebdf8df53f76b87f37e3d8d19132bd84b420911986a3961ac9e3cdfa5", + "maxOpenInterestShort": "0x261bd37a7136246b599267872098b5ed76d3bcf6f8b4dc0832a4c8280707a2bc", + "minPositionImpactPoolAmount": "0x4a236e6d546fc95c53620c4dacd712711c9db665b1e0d52ca23f55da8141bb85", + "positionImpactPoolDistributionRate": "0x6cc3b96bb5636f465d2fbfbd0f081e2429df31615c3cf3fc88dd306af7476853", + "borrowingFactorLong": "0xc92a8d8f5d158c9432b9d8d3279131b8f535c675206ef96a80193e8d7e18d3e7", + "borrowingFactorShort": "0x5777bea13c112134b7f3b5a9f82a6afa6c3a3a6f7276fa4c8e308ba45ea9bd1c", + "borrowingExponentFactorLong": "0x8ec2e1a0d06398d55b014a769374726a516977c197c293c38effe9e336a2a998", + "borrowingExponentFactorShort": "0xd3994c9991fae7b06a237105a1bccdf40dbe98d794812bdc6b253f8316379a7f", + "fundingFactor": "0x43b25bc8be4d89d9a393a3ab66a9a40b50255041fbeb1047e1e79b5faf1de8a7", + "fundingExponentFactor": "0x37cc017427a3eff4015bdc03cf91f3e0353edd4afeed49e4baa4b1f2523074d2", + "fundingIncreaseFactorPerSecond": "0xc387c6cefa0f1b8bb35a69b6325b77489d417967ed2edf600c84e54fb8546676", + "fundingDecreaseFactorPerSecond": "0xac8e56a0eaf9542a41086a4b38bbe5f98c8b1ab89318e4ffebd72dce596c57b0", + "thresholdForStableFunding": "0x642b0c0dfc3f6f983e25b29494c5a10e50324d37c0ac8fa22e8eaf0e4de65eca", + "thresholdForDecreaseFunding": "0xd1acc4f16d12d8701966fe7fd448d3d469f2a0a49fe1c8743b194173786601bb", + "minFundingFactorPerSecond": "0xbc52562dcca2f5bb719a4c9bbcf4095df5a815c8be2de77bae6e258463d7d5f4", + "maxFundingFactorPerSecond": "0x58ece9ebee476c6992b7e4411b02419d81d20383d2f311d307465a9f9e00aa56", + "maxPnlFactorForTradersLong": "0x0f923bb0dd0946e1050b7ba75dd88bf9967278e4dfe561715889540d385495a2", + "maxPnlFactorForTradersShort": "0xc9fe228bf6e22c68a23fdd312a66fd5ad61f9ba483081749b95cf2996d66e476", + "positionFeeFactorForPositiveImpact": "0x2dfe4e7a40a54d4735a5af55c781797d9b9a06190405585b6df4df42a0bd00b6", + "positionFeeFactorForNegativeImpact": "0x92a73e06bc1f50304c5efd275d352907f5e631cb1894e723d750b208b6eb231b", + "positionImpactFactorPositive": "0xfe23009c84d86851927ecd97ec6347799ff32715b0fe20b75501e126ef8eb443", + "positionImpactFactorNegative": "0x824d020df218432323640679d977c7c98fe3f3029ccafbd63195aa2422eaf290", + "maxPositionImpactFactorPositive": "0xb50a00942d131a9cdc67aeb2b021f253c5f7770f1a1ba680495a485f25d9e13b", + "maxPositionImpactFactorNegative": "0x93e43b69e532e6d6b7788fb09d13d70e2c6e5b1cac594fe1af51e466f3703af7", + "maxPositionImpactFactorForLiquidations": "0x355b4df66f1c85fa3f11ecb95ce5e55103d0ed24f5670379791a0e82b88352eb", + "minCollateralFactor": "0x14f519d670ec6e5b2cdef769007dfcac09f7edd6f64da52fddd8a2160f7c51fe", + "minCollateralFactorForOpenInterestLong": "0x12be7656b291987a3022965d8be409d4ed7feb1d382eeec36e6d67225d120789", + "minCollateralFactorForOpenInterestShort": "0x5c18aa8765ecd905d817d6f09fc2d40fc0793a5b3e88ef7e071dea5e352eea51", + "positionImpactExponentFactor": "0x1cda6cde74b36b50f765db60993e7a63bf269f5b217d1279cf5f84cefc42ab75", + "swapFeeFactorForPositiveImpact": "0xeb2fab73e9fdff0596c8c72b854279382d79404b4aade537b8b8c1dbf352f45b", + "swapFeeFactorForNegativeImpact": "0xf589ab4da11879eaa7be922fbdb14ad14e6be45d55021a50ed0f509c5a5ac0e5", + "swapImpactFactorPositive": "0xb87eba0a263b57b8d2a7dff56d73ab92c164811cd1e56f479690b134e73821ce", + "swapImpactFactorNegative": "0x21eb71230a7c89a8134055d6cd127bc1cbd69041800989e1a5ee25ee1186e241", + "swapImpactExponentFactor": "0xbd575e96df4fd1e6eab867ee69312ea37c3b7ee3685992ad7b8c05035c439459", + "virtualMarketId": "0xbeec1284ffea7738c9ba03703c385748b5107e01a45de9ab112945f3cb5276be", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xD60f1BA6a76979eFfE706BF090372Ebc0A5bF169": { + "isDisabled": "0x77fa3a0b100c2faae72a8fc7a682b2eda254f850c0be37a9ad9d0222b822df5a", + "maxLongPoolAmount": "0xea9cd67e0f71fed5571ee859c1375d1638edb11f4557ecc892c9a13e6fb95cef", + "maxShortPoolAmount": "0xc1c52f638aa5f71519cdb8412f44651bc5018b4c58409f0fa6ca86e1ad326822", + "maxLongPoolUsdForDeposit": "0xe30424e477d263ca3d1dd3b1fd71789bbd3cf9a49d47196dee35bc6d8aa35d11", + "maxShortPoolUsdForDeposit": "0x73a8ded6124100fdc99837e921c0b05ee5d44eb12e7645a9e65d2f47870c8c58", + "longPoolAmountAdjustment": "0x9e03d910b8af5d0fbedff8528c8a2eb48f170d9493509e01e113eb510a77b67c", + "shortPoolAmountAdjustment": "0x09ed6ab78c27a42b643ee402c986160ffd6de77281354695ba33d2a52eecdc88", + "reserveFactorLong": "0xd50dcd2aae20b7a38b8f0c5a8f1b1b9937013eaed4ab8dfac6eed811bf4475f1", + "reserveFactorShort": "0x38f10377348164230341a22a0b758594bdc6f82c715810800c9e6e0b291a6214", + "openInterestReserveFactorLong": "0xf4174d318288df4f25a24f2c6c2982a51a7c48fdce4163edcd4ed339c4d27430", + "openInterestReserveFactorShort": "0xd07767f5a37c7adce05917e145d86a4ed85f1dd82a46812058342ef4ae75b769", + "maxOpenInterestLong": "0x46e113da0ee0aee9b74060d6c31237b56c4bb7b08fc277013203fd057d9a39cc", + "maxOpenInterestShort": "0x4304ec269d22497d83581145a9bc0f6b6c53d9f4b896bfec23bb9f404b5739b2", + "minPositionImpactPoolAmount": "0x0609cb5aac5579c4dd09d87e82baa70b5f677fb4e948cbd854b133131cca45f6", + "positionImpactPoolDistributionRate": "0x65e6563d086d7b970426db938992a1c994484e1a007f80ef90402b77de869d8f", + "borrowingFactorLong": "0xf508bff680d94b371d87f74a51d847055938996585ddf7e5cb8812e58a81956f", + "borrowingFactorShort": "0x6ea1959ac1991c76a114c94492564e9b179fc3327cd706191ba226b28d04b1c7", + "borrowingExponentFactorLong": "0x703a79a7c03b16c4335da68add4857ab9515296bfad3a53f8514ec3f32c728db", + "borrowingExponentFactorShort": "0x5c417f1567f66a90ec69270f469d0462d166dc3ff7b7744d0464abf28e1b55b4", + "fundingFactor": "0x0c54b4fb2485341f2227f8aaa05147b19afb9a07f7a35ab41668027f1add98e9", + "fundingExponentFactor": "0xf2bfefd48d3dd0a8de7c2ef91b56d65f86fc5aa6078f3f6452ac1bc718745219", + "fundingIncreaseFactorPerSecond": "0xa14f5b22e340e508d8dd93d9f9b0aae3c47f4e74607f91fe830c5e42c9dd7afc", + "fundingDecreaseFactorPerSecond": "0xd118948bdee15640ad0ba90590b760d4a98c45d1e87b58624a2c7f4a5b324e1d", + "thresholdForStableFunding": "0x7aade32ca394825461bf7cc85098db21b9b099eb4fb11f9db46aaabe29a04617", + "thresholdForDecreaseFunding": "0x581f61a5b3e16ef80c9608439577da1aefdf6c465453c5bb7f177326af1d721b", + "minFundingFactorPerSecond": "0x57903402964f09355c92fd2ee81f8d8ee6418a0c7245905c94d5775975fb5ead", + "maxFundingFactorPerSecond": "0x54fa90bc24f8ec4d11915477e376d3a3ba2eaff68805cc56f3010ee26ee58df4", + "maxPnlFactorForTradersLong": "0xc096c65bba34dae39facecb48ff0681b31d49086bb6d5de9b06e8ccc7a4d683d", + "maxPnlFactorForTradersShort": "0xf52d306b64f46f2b063e645f3774377ec308c0968723bb3ab0fca3423c4d0496", + "positionFeeFactorForPositiveImpact": "0x369579ab28cf003f555199fa0ad696810a2b5ce6c6b99b68c651421dccf9eb51", + "positionFeeFactorForNegativeImpact": "0xa8007eb5a7381de3671f24aa819ea3b3a78aee7c9af638c0ed219f4a94e006a3", + "positionImpactFactorPositive": "0xf2b3a944c7ff519fc4a0e90e963750bde57de840a4e834a2bb1c84e7c3e3536c", + "positionImpactFactorNegative": "0x5d775398a3a1d3decdf0c0b7ff2f38c4245a2585a4bf7e2414b181c550825889", + "maxPositionImpactFactorPositive": "0xef1ee058e62d2940f4c6bdb5d4284a74a47fdfd67bf40881d81675898d995c53", + "maxPositionImpactFactorNegative": "0x6ae25f9f315f358886ff70b307f9d4c7642e783156df77121699c12723850724", + "maxPositionImpactFactorForLiquidations": "0x962ac7fc3cbc4fd8d0aa8dbb670ddc393d37a7f65e15ab52a5324a7d7ec99145", + "minCollateralFactor": "0x522dce74cbd5b4d440202a34f633bc1a0fad761cc20ccbfd6a6ed661a8e22601", + "minCollateralFactorForOpenInterestLong": "0x561ab444da9e0a84f33004689eaee0620921f53832690234974beadbb2874c16", + "minCollateralFactorForOpenInterestShort": "0x9fa2d3d66e68869a791c2035796e490049a5eef5abb51228c8c92aa66eb2abd2", + "positionImpactExponentFactor": "0x96e4e16197024832d8c5faa031a256a9ce1bc452407a2f713fbfb49a4ea1eb38", + "swapFeeFactorForPositiveImpact": "0xa6143605375dc242962140d0c9e0f878d85c68e51a3d8e88fe5a56ca06960270", + "swapFeeFactorForNegativeImpact": "0x412275642d4466535fa1e10c5215a27411e8188aacf2c49e83198b5cdf636ebb", + "swapImpactFactorPositive": "0x697ece2ce23e93349986cb04edc1fd3fb4307a573d679f243701ae39bb87132a", + "swapImpactFactorNegative": "0x19c2660bf05157a6c1248cb90af79be47b7804b52b52bf200a7732aa186c43e0", + "swapImpactExponentFactor": "0xea094e8717554b6c479bc2c54a4737c25970e30aec419bfc4eb801ad7ee57268", + "virtualMarketId": "0xc5e035ea1642e8e8bb5c391b503ade9bab3fd8596fff695f0a2b81c646dc6f48", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x5707673D95a8fD317e2745C4217aCD64ca021B68": { + "isDisabled": "0x1aa2bc2f8870917ecea7a7da21cfcbd8e77718ae8cd2c085075a1f8494421d9e", + "maxLongPoolAmount": "0xba217fe902155c96cafcc25980c8c19cb8b8ad61e6a7bacb49b0968a37b84fe4", + "maxShortPoolAmount": "0xcce6024decc60f28248ac1e4dee9b701458abfee2defac304fad042920e7a08c", + "maxLongPoolUsdForDeposit": "0x711e3fa6b2561089864104fca61ec7b5d9cd52e93347b707666459256716aa1a", + "maxShortPoolUsdForDeposit": "0xfcaa4b308590a27c0f027c450db3a5e9aed2be7f6b857a4b29187855420aaace", + "longPoolAmountAdjustment": "0x6fea69394b97f6eaa17dffba7728778af32ca17ea5abdfbd12ac940167683a95", + "shortPoolAmountAdjustment": "0xf27dff609c59c893d95114d78d91a7b40918dbae93d6eae4160304e583da6974", + "reserveFactorLong": "0x753227b46bbd78810d1378b6120b9b598cfaf35f39426be240bd7658769542d4", + "reserveFactorShort": "0x149b460d5cad420f45f0985b5c77c2ee3c5bcc86b6992517c73eb1553d9e1f1f", + "openInterestReserveFactorLong": "0xf3894d46b0b42c69d870c5a8ae144c9e53f57f6947a8e9888e6edf1fe9a3d86d", + "openInterestReserveFactorShort": "0x5f583868723219429c28b573b1e5194e43598a67060baa6e2142f33009ee1bd4", + "maxOpenInterestLong": "0x990e17cd52d76bfb8879a35345441eb91655be2ae0dd03f8fe77ca278319f6f7", + "maxOpenInterestShort": "0xc8443c88791b0b7dbbeb09315a833127a2451f083fa4b91c6aa34b7353e84730", + "minPositionImpactPoolAmount": "0x051f79d6f58a2291d88af29dddffbbd5208ebf879531c78bea64993d189133e1", + "positionImpactPoolDistributionRate": "0x728f4f75b18c980240e0592cc22929c709d32d1f5e24c4c868483fe510b50ef1", + "borrowingFactorLong": "0x10bc32480c919e72166001fa26a8344a62b4f697aab29e43f73b799287d26eee", + "borrowingFactorShort": "0x5bab2bce8c713ddb8fab43bc50719275921f5b4a2a84e03230abbc05f11da574", + "borrowingExponentFactorLong": "0xa4b8918977494f485748335ebbaf749b032410957c50275c6bcf64be35344afa", + "borrowingExponentFactorShort": "0xbd0ddfaf460ae749608330e9fdc34c71433f6d8c78dec56a9007afe3b246ab35", + "fundingFactor": "0x778a6ee7bdf0f7bdc0e2bc41046361220cf50cb38c5bcf3fd4a67337d7405872", + "fundingExponentFactor": "0x68ae8f7e8722a0a129907b75ca6f6d5f8ae75ff854db679da26da25fe7a3ddad", + "fundingIncreaseFactorPerSecond": "0xad0b193d07f67d5debee60dafa64ab3261a494f8cc56e0b562cb3d96b6ff3847", + "fundingDecreaseFactorPerSecond": "0xf6389854a280271e10c00dbe84530e6df28e7e9ce48cc9941b1f6a2b6a5f9dd5", + "thresholdForStableFunding": "0xcd7d39c898c4c8082952a529c122a8501d7215b43cbcfef44f4314ceb47cabb0", + "thresholdForDecreaseFunding": "0x6e9ba10ebfe04fd204e860d819274bca159d2c796b82ffc9512e9cf4b7ed8a35", + "minFundingFactorPerSecond": "0x5a759b75b2d35e18d080a1898ba3db7a7d5c8582b4152f7ee376b39ae7492870", + "maxFundingFactorPerSecond": "0x5c4885506d3cfcf7c3c3df4da8ba4c32705fbde03ce01fbf66ca63641f5db6e5", + "maxPnlFactorForTradersLong": "0x878e83953134a8b7aae4a5eb5da30d033850a7ea4d2fdec59d0637637d767f7b", + "maxPnlFactorForTradersShort": "0xba6beb80a04dabea3486aa3f32e902bf27f5bfbdde4e3123993c5c17e7900097", + "positionFeeFactorForPositiveImpact": "0x50e88ebd0aa012a81bca5764a77610505af3166c0f8ecfd5ae63b6357988f677", + "positionFeeFactorForNegativeImpact": "0x40f2441d2587c304daeb28a5bdc047acd878b49efa716575ffc8f4a77374d0b6", + "positionImpactFactorPositive": "0x26b2e3333bc77d9220de66a9684adafda830b2dd3984fc0135d832c9c9aebda2", + "positionImpactFactorNegative": "0x1d33b34963c591c09fb0dc2f8250ffbb341eb9eb1dd6498b4148137181d6072a", + "maxPositionImpactFactorPositive": "0xf3bc0955f963d0405f9e49d759d533014c9d06e7e60049c1b11ad3cf51b02cd4", + "maxPositionImpactFactorNegative": "0xe8584089e60a1fe0f7b9dfd3064915a786668ee667eaae8ab4344ce463488bbf", + "maxPositionImpactFactorForLiquidations": "0x874f76b33cc43ca63e6bbbccf8d5c047081f0d93bc3c8969584c39c6502afbef", + "minCollateralFactor": "0xffdda94c552e89c37aa851adc7a18e6bc47663010a27d83661a2e2fa8492ad71", + "minCollateralFactorForOpenInterestLong": "0xcb36c8d66209bda963fcd3a7029ca669b114218607d825722851aa897eba7ee6", + "minCollateralFactorForOpenInterestShort": "0x53c5a6626ef4a008718fb02907498f647eb955e8d2e9db15607b547a0e9e0d66", + "positionImpactExponentFactor": "0x6a63ed472aa0faeb03e4fe460e669a1671d1ca63f2fdb32c39f1c11786c97460", + "swapFeeFactorForPositiveImpact": "0xea517b49e33c27e75463e484f6c8b1fa64d533a6148e33a64a825cce02e3c6ce", + "swapFeeFactorForNegativeImpact": "0xa7d5519d3e5d0ce9c05ec4df62c4b00339295007b40272ed1284c5a9e47bd77a", + "swapImpactFactorPositive": "0x42aaaeae3f86b5e671a389d5b004816565f03a19ee4da5165ac22336d040cad2", + "swapImpactFactorNegative": "0x33b9b4cb5a208b266e11de020970e508843c67544b51565d15e87b65c6aab0c1", + "swapImpactExponentFactor": "0x06a8eebde08a6c76b4923730c450d72f3f7ee3bf564be64d693a846e46d222b7", + "virtualMarketId": "0x89441a9b576778a926aef80b72afaa689c63a0202d5934c75c4ea696083f09ef", + "virtualLongTokenId": "0x6b7da6036245b3feede9511d4da4d25d9e6cbaa9041162aafc3d471509efca83", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xe2730Ffe2136aA549327EBce93D58160df7821CB": { + "isDisabled": "0xc5188efdb928c9ef9a91c305b6412ef515099a135e1e395f6dc858725a95cef5", + "maxLongPoolAmount": "0x990af5dec47bfe6d42823c938b38208b7f19af38dc8538578fa369a615f90264", + "maxShortPoolAmount": "0x41baa48207d91feee2f83ba99d58371ca408f44e3df0d657d9df2ac54ab87f76", + "maxLongPoolUsdForDeposit": "0xac57d0b40ac6e18b25a0e9531a6d2850f88bbcb97326dd6dc06f4990d3e2e8c0", + "maxShortPoolUsdForDeposit": "0x719c1ca037a0d32a3896f1e0d42929901f2cfd7e6865a5017736cfd8293e108f", + "longPoolAmountAdjustment": "0xb4c24cb68eb0c84e4bc0bc213a2ac6c51daca21fedf799632c3a35167d25c043", + "shortPoolAmountAdjustment": "0xe8122768d1707f3812c50a66c152c2b6d79858af45c4694b4d0b24fd256b4fae", + "reserveFactorLong": "0x26d4c109df93834941aecf91476b2c9d2b0ca9824914e914ae63ee047ec6e4b7", + "reserveFactorShort": "0x5b4180d1447c018ce62a3637ded3a4a3dbcec311567dc7cc935d8e3d397b0281", + "openInterestReserveFactorLong": "0x64e41694d8d14893143612e0712e980d0f9bdfb03fbe2fe5f88d6828358e47b0", + "openInterestReserveFactorShort": "0x68cb07c8dc40e471b126b1d0ea67728285fb268cdc181f8b416097e09146d9dc", + "maxOpenInterestLong": "0xcacc8e1c33de17bae5faf2fd2a819122259f57180a7f43ac30b56e68310daf27", + "maxOpenInterestShort": "0xcba946a0e2bfb1c46d9966c4bd622b465147719a0850157f025298ae654c7cca", + "minPositionImpactPoolAmount": "0xb81484ac1120b1f94c52d68ac95ad148210526f4415fd595000ce7e7e3de3ee6", + "positionImpactPoolDistributionRate": "0x6bebcc266c6a4a1db819c464324913bdaa537a4a84a5c50923f7961a309bb716", + "borrowingFactorLong": "0x4bbf060b6024240c3dfb63cfc78515cee6d60846ad869610538410e64ec3f408", + "borrowingFactorShort": "0x813ed0150249f5972f20ec7e780d938e8fb790e8a12de348bc9682345b0b50b6", + "borrowingExponentFactorLong": "0xe61c71ccec4d82c449ec11f16863bbbef025b19724288306d1fc9a5554ad9368", + "borrowingExponentFactorShort": "0x51b731d9da3f1c8140d69b94eb4729fa6463dacc1856d79c53f89b4c5340daf1", + "fundingFactor": "0xc5bc0238db2222a9db9296c14680629113fdb24c3787d7b5e2951050cf2bad13", + "fundingExponentFactor": "0xf0892f18a7871fcb256f6024225bb1599b964d57752967b473f4155307fc6c9f", + "fundingIncreaseFactorPerSecond": "0x3eaad9dd25473d371c7f13fcd73cfd509933602cb63198de2551e3a56217a70b", + "fundingDecreaseFactorPerSecond": "0x5b9856a070be1a4a4a1c1f90ba43760ace68026a14d93fbc743268afcc53948d", + "thresholdForStableFunding": "0x33bcc75e4392ba2e7d2f9453f062242287c8b74b3620e02de1a7c0b8b5c84328", + "thresholdForDecreaseFunding": "0x622b63dd12c9cd22458f3ce6388dca19f0131f426daffc6d84cce2c6428f1d1a", + "minFundingFactorPerSecond": "0x00f523a5f578d8915cd4da0fd179656c8ad6fc39559623253971e3726a79a98a", + "maxFundingFactorPerSecond": "0xb24d1a91550b99c973ce6afa96c6ab8b46696ae228ad5f7df4b9e79527211acc", + "maxPnlFactorForTradersLong": "0x10abc2fb3642e6b77e373d7feb742ae7b4f43b8d165ccc63ed20cf7be3a38ff4", + "maxPnlFactorForTradersShort": "0x36f7436deb57e87fb5231f1e926f3c374c28799403850aea708cc0a0b7a13be6", + "positionFeeFactorForPositiveImpact": "0x230d558789cdeaad85855af6d57dfb2579792b0e4bb659a8ca77e13403775717", + "positionFeeFactorForNegativeImpact": "0x85d3d3c8408ed4186fb1d31418526ce075322c262bd78196a82be5f47f263d5f", + "positionImpactFactorPositive": "0xfb4ed8070ac47be8f9c3ce03faf5c8f0842e961739cd65e3b48883aa4adf73a1", + "positionImpactFactorNegative": "0x14d2c5a86f041487eb054bdc08827a46d9eef3a079e8275e703ec0b3ac5d7639", + "maxPositionImpactFactorPositive": "0xd13f53228e8d8bf025faddd4631cc12fd68e4d48f5aa750afad8589402adfa9a", + "maxPositionImpactFactorNegative": "0x9c35cae350439063045993681f2c2e12a3e12aa11f77d56d357e3ceac618617c", + "maxPositionImpactFactorForLiquidations": "0x814777913dda7bcd8fa344525f60a2b92045904645614e796279a2a12a91b43e", + "minCollateralFactor": "0x8e3bed4f25e62e79d236e7ab4e5603e7622ef2eec8639585e4244725d8f409bd", + "minCollateralFactorForOpenInterestLong": "0x9b60006748c20ded25ebeb6cb5b8b4fa1637b243173d9721a4ccfbe3101e7de3", + "minCollateralFactorForOpenInterestShort": "0x348e708289c489fd0cf6075ef11f4fbf37d202d578080b4cd5b8ca83b27d8dff", + "positionImpactExponentFactor": "0x5069bbbb356975f0360cd8b8e434e3eef837db18168ba1a35726ab20805420b8", + "swapFeeFactorForPositiveImpact": "0x2870d390da5ab2fb9809a727bb1edabb063250342120237e7333410a6c0685c7", + "swapFeeFactorForNegativeImpact": "0x066947ada18828b53962d49069334357efc7942ad48f56a49ba67ad05f1492cd", + "swapImpactFactorPositive": "0xbe6bf34b093a711520a573026f4af33708c3df6b22ab11fcb08a211a8f3651e8", + "swapImpactFactorNegative": "0xa04e19482a64c2873c80eee75fd5e05a21ea68458c3c31ba6514ceb2e6683954", + "swapImpactExponentFactor": "0x4d2d86e81fee52bbcadc9b241d3f95a44696c92d2c6d839ced2571b341ecf432", + "virtualMarketId": "0x7244e412b28a762651a838cdc1faf93f6c8b43dbb4a2b2574a0fb29f60c4ea59", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x876Ff160d63809674e03f82DC4D3C3Ae8B0acF28": { + "isDisabled": "0x15ac8cfcc06371dd6c173772a57996370e6fbc331e39df80795e71c1d4ea5ae5", + "maxLongPoolAmount": "0x46282101b2070ee3ce54cdd18f4fdad073ec1f4c7d4d5df2e2f35ea41e00df73", + "maxShortPoolAmount": "0x3a397269d0d05e003a1a6cdc27a9ad5a13b5e39f81563719691dd1f6d5482012", + "maxLongPoolUsdForDeposit": "0x854e7f3b09663e3de3a1dd79716b6e9eac8009390192f992f208b65ca6322827", + "maxShortPoolUsdForDeposit": "0x3dedd822b609da233d8d6f91274c723784ffbc43ce9d6fff2708625d5a69fda2", + "longPoolAmountAdjustment": "0xaf37261e50fa6cf7ebeee3d299cca99beb49ea7495e79ba0fd0f4caa9cf24dea", + "shortPoolAmountAdjustment": "0x8a3816a9536bc9fd99799a86e6ad050ab3615f07f9d5e8eead6d2b9b7fc13518", + "reserveFactorLong": "0xb7a54ae72992282bdb12e0f0e7e6bfed87feacda9710e6eb335dfe69db3a5aaf", + "reserveFactorShort": "0x240b7f3e894933052d3f4cabcbe633d530e45b4e6cba6e83eec40fbec642af7f", + "openInterestReserveFactorLong": "0x534d9c08e4ea67a3cf35f840e06ac64bd86801d9692d3887d463721c7a7a31fd", + "openInterestReserveFactorShort": "0x0e5b1e07aa2fa5a319880dd8fc5cfb9a1abdbedbcbe1d335481b1b4120a5305f", + "maxOpenInterestLong": "0x867fc414e08907fc7785f594af2407999db7a98649e45bea9d79203dd37ff1d8", + "maxOpenInterestShort": "0x2ce982ecf7eb80634371ee88f28885b12d2ecf263df32ab573c4648de1b50b09", + "minPositionImpactPoolAmount": "0x17bc6cd7e5b8c78a025775cc66ab72aba89cf6917a773f7ea2fd7f83304dc3cf", + "positionImpactPoolDistributionRate": "0xe19443fe7b03be3b615b3efe23183597912c0364ba2958b5ac2ef9e733ed7b66", + "borrowingFactorLong": "0x10c1067455bbb39c29a51c61ec63bf935e1d17ce88e2c59bb3c2a3a3568f2528", + "borrowingFactorShort": "0xaae1a293dc0767e5e3267aad8a61a54cf7fe1a0c2f2aaa7d845836efcec86c17", + "borrowingExponentFactorLong": "0xc7417d599cf71373a0fb088c86493e13fe7ace816c48d7cd67de237090487bca", + "borrowingExponentFactorShort": "0x04a99da38fa28b131ad5a2f6f522d55796bc2c5b55ae6248bd11c77bc60bf4b4", + "fundingFactor": "0xa6ae9abc1aea8c6632f53e2709dcf16d971549b90a3ea7cdf60547b32c47baa4", + "fundingExponentFactor": "0xc22de0ca1c8b7093d72c102d74b41f626c4cd3fe84e8eca088a70a0f356eb7c8", + "fundingIncreaseFactorPerSecond": "0x384e55524acab0ce65e111694d66468ce32476fa6b6796906e9714ba87693389", + "fundingDecreaseFactorPerSecond": "0x68cdf09e7caa2d11fb1061b81ac8698331f427c03fc138d346168c2753e879b3", + "thresholdForStableFunding": "0x85ef0c6b0805dc4c87850bd225a64e403b692cca78263b61ceee465834589254", + "thresholdForDecreaseFunding": "0xb3ef81d53188b24b196d18b4ba64219f6f5f96ffe47f58c15304ef316e0a9622", + "minFundingFactorPerSecond": "0x58803313f4b27c4539ee441c4531cd4e644945ad14ec37ecfb3c38169244f734", + "maxFundingFactorPerSecond": "0x080d6f647980e27c4c29eb0fef0259e35b78776eb12952361b643a56d7467a88", + "maxPnlFactorForTradersLong": "0x5b6bc87065748793b2c2f058783f46c620cb13862d8f7be9c625d32ad3ffb1aa", + "maxPnlFactorForTradersShort": "0x5df3f831541534cfe8b567244ca81a1d1c17a339c5c44dd9ccf847dd420840ba", + "positionFeeFactorForPositiveImpact": "0xe52a6cdd4d02804ca2087972e592e75b4c8448296c882ec0a5bb57428684b465", + "positionFeeFactorForNegativeImpact": "0x8af552f6423c82c053f9f9a49d8976fc5bf979f90ffcfe60e48f75efe78159af", + "positionImpactFactorPositive": "0xd4030afb92b751b6cd3e4c23d70e48accf8185636083706bc6544769347ac75b", + "positionImpactFactorNegative": "0x4e56928b8af1c4dccfb8cc4fe83564a16bdbd4c86962b7cbd71ed3974d449937", + "maxPositionImpactFactorPositive": "0x81474e9f281247217a132604837f1a17c01f9718727675aad11a63ff67d7f77e", + "maxPositionImpactFactorNegative": "0x071ddcdc5940ce06318c56b5bdce3a27847f535f8f0eac190abca1a73af7d02f", + "maxPositionImpactFactorForLiquidations": "0x65a71358652e1f3f1de3770fe7df2b8400da9e60f8d814ca9a4b13022bee2222", + "minCollateralFactor": "0x679fb485dc1559e6adc640756fe4740ee19dee07b8badd48976bdd28a87879e1", + "minCollateralFactorForOpenInterestLong": "0x84677935537cfc967f4cc379eda203039e555599457a5abe92b8d3be4ff80edf", + "minCollateralFactorForOpenInterestShort": "0x2d128850ff4630e5e64b78a9cc6f155791e11e268c1ee76a65a21a989aaeac95", + "positionImpactExponentFactor": "0xa5c274264328d204dbd59ba0c0c702d8968334ba38a54e107124afaacad4e265", + "swapFeeFactorForPositiveImpact": "0x308a352f40b9c052ce7816de933a0a33bf97cc8e380329add568c24e7266721c", + "swapFeeFactorForNegativeImpact": "0x9f6e5823120af6d9685bdd76e8b3305529cf50e322b43f7741bd5e944250a6fb", + "swapImpactFactorPositive": "0x6e393cae4a648e5c019243aba3839b664048e7fe1cde4d352859420fd07959b4", + "swapImpactFactorNegative": "0xc80a493f181476d72d586be4a7737108ccc7e4814d2219f4eff178a556f26fde", + "swapImpactExponentFactor": "0xf6ae011706747949bc1e24692131acc79ed1463181bfde4014a52621ff41d7b7", + "virtualMarketId": "0x339bfb15a41f866de28c4889a9d44418a6d8805a1510cda7247c81429938f692", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xE61e608Ba010fF48A7dcE8eDd8B906744263d33E": { + "isDisabled": "0x49ea27e2ce2eb5b3c9916779475d7293f26c17cd0327ea3c2174179f39a4aa13", + "maxLongPoolAmount": "0xd0bc6e4222944ac67340f73b6e94217e3255e1c5010fe46b158d991154318db9", + "maxShortPoolAmount": "0x0d8e8348bbb7a151c21b401593372aeacdfdbb0a2ff0c6ac4545289ab3fc822c", + "maxLongPoolUsdForDeposit": "0x39b702d82a7d4db0a908523e42e88ce80de37afc78349411541ec111e13d6ce4", + "maxShortPoolUsdForDeposit": "0x298d58f72106eb55a9175d1cd95cb1662b709c390a732d7d1b68a2b282f08459", + "longPoolAmountAdjustment": "0x311639bb3b1ec814202ef36466e39a895b5d15db046536aaa536bb6ec1a7d9b9", + "shortPoolAmountAdjustment": "0x8be076acdf59e313036c9a98dee918c004155841c1250c66b3ce4d8abd43a093", + "reserveFactorLong": "0xc4ddf46a291b679bd1f9524d7a402cc8c0e696f577868afbe1fa359ac09c5cca", + "reserveFactorShort": "0x93b306059aa8aab2a8c0a909c53d0bad97216e7e65bd2c0cfea3e9b73959d7a8", + "openInterestReserveFactorLong": "0xd65fda38be5b1523b6035cc75263efcf1a178d61719b2c0238921ab4d0e15f06", + "openInterestReserveFactorShort": "0xd21395fb26b584b97559bc1714254e884bfa29bf90781d9c0ef257cf1fc7e740", + "maxOpenInterestLong": "0x995c25b3760c1fdc01516a0b1f2e67ffb1469dd5bb2dd1e61432bc7b4246f845", + "maxOpenInterestShort": "0x32aebd84087b6713411488e94266b040c174df756525adceb10d78dd110e3559", + "minPositionImpactPoolAmount": "0x4298bf7e99d44c0011305e16b86fdf609b8f08544a03bf3c6b94f1eb19786b0d", + "positionImpactPoolDistributionRate": "0x1594eed845229d9106b58038e44b3efe162ee4868afba218c51782ec92da09a0", + "borrowingFactorLong": "0x4c7822d8034d2a9b85704c142fec2da716b8549ddcd29d958a3ad18b8ee2472c", + "borrowingFactorShort": "0x5cefbf4adaed939f121989bb176f574ea4dad3242c84bdd597f2e3d26375f5ae", + "borrowingExponentFactorLong": "0xdb295d7b6a7880e68bb8c61679ca0a2eaaf51355606b261fe0e7398d4be19299", + "borrowingExponentFactorShort": "0xcb1aac3289dc006c8342a8af4e7a039f45d11ffa60936d65fc805d7632d66683", + "fundingFactor": "0x3c4ed84881f12f42671cd26ca705bbcea2bb937b701535513431848cc5a8c5ac", + "fundingExponentFactor": "0xc5a0702c3067460308098d7b5f2a8fdd56f52cb539a96a6a03ec770013128713", + "fundingIncreaseFactorPerSecond": "0xc18f70ffd3d1e66e2fbf80ef310601d9fa9caa585719dd7c596048982b591f4e", + "fundingDecreaseFactorPerSecond": "0x3649f58d8f2609c298d90da84ee4a3070ca6da93eb291e2616dbe66c066765ef", + "thresholdForStableFunding": "0xfe3fe23b071aedf541d81f8bf62ba754479564d48e099bc0348c8d0854068e89", + "thresholdForDecreaseFunding": "0xe47fef5ccc586c656d7dd1d2614195c31869cbc9939ea90e071035df8dd74960", + "minFundingFactorPerSecond": "0x6e462d4f2e4d32ee0bec2e64a29ddff595aa58495907887f4f47cf7271a61734", + "maxFundingFactorPerSecond": "0xf41eed297201b32337b5015b04637412f8c7cf877d9207165824065b9ce12642", + "maxPnlFactorForTradersLong": "0xed40a6622b17aa7f593f513d6c523e1394c152e8444f7d60fb9934ff0a0b3b36", + "maxPnlFactorForTradersShort": "0x3fab9e7f459753e306a6757c56d8494284da59067b34a6dd4e52c4bcb218000c", + "positionFeeFactorForPositiveImpact": "0xab8c6a651eba9a48ac235d445205bbca5713698e9d67bb5ef0dc2f9426e6aa78", + "positionFeeFactorForNegativeImpact": "0x032ac540578f841c629bd3639d9e6d77baf2627b1904afafd787db565f967ecb", + "positionImpactFactorPositive": "0xedfc5f812a44c154869cc9f560a95108879fe5d9e62f9412566cc073e134fffd", + "positionImpactFactorNegative": "0x354deb6c75877b955292480f888e8b3234e16f3f0925fe00ee8498a4d2ba2fae", + "maxPositionImpactFactorPositive": "0x1eb9f2b1fe7a5cadc30bf113d195fea531766a1f93c49e2aa83237c6608dcc7b", + "maxPositionImpactFactorNegative": "0xc82616a5adaf7157ed23d8b6e8bede28a99be8cb7856e8eefd9db0176ee5ac92", + "maxPositionImpactFactorForLiquidations": "0x1a672707fd488daa1eb12975ace82f66a734b02e01aa1301289bd08f8b8f7879", + "minCollateralFactor": "0x3fe844c40773c125c030590d8b180fc7e7eea4b4620fc68b8933bffaa4c67b4a", + "minCollateralFactorForOpenInterestLong": "0x6e86a14a179aecf4b9c5d905c249fb4e36fcdaa1976cbaf81acccc340311036d", + "minCollateralFactorForOpenInterestShort": "0xe4d366912356c807f7849ae1df3147f1e7d208e9fc57e01fa4c2013876d14b79", + "positionImpactExponentFactor": "0xa3bd98ef7c63272fec0aae30edea3e455dd7d50b81934602367f7325466365d5", + "swapFeeFactorForPositiveImpact": "0x13b14819e4af67beb4e9eebd58f4f859b45e51fd720169f4875c52069eaa93eb", + "swapFeeFactorForNegativeImpact": "0x041dd49ae33ca7961f20bb8147d5da1eb80300c220f91b5bf5acc56d5ae6aba8", + "swapImpactFactorPositive": "0x3d6d4c367caf6195e2e17ccc844e61bfa11362e807edb31ed40c950aa0778457", + "swapImpactFactorNegative": "0x630de465fa6597dfddf3012c25720bad36ddc1f3887a52037a864fb66dc66366", + "swapImpactExponentFactor": "0x00622b30979575d1f66479e09f2f571d422345b18b2408762ad6506cf007dc77", + "virtualMarketId": "0x63bc24412daebd15cd8f7892a4b8759778fcd669c83c2d1ccf5c2f70b87bbe77", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x75F190E0Be6E8B933A01423EFE398c6C721A5CfF": { + "isDisabled": "0xe15756484c6e484323ecfc880afe29f18afc3d45c5005b243ebe55fa586ad4e5", + "maxLongPoolAmount": "0xb8384f257a1623432c95e9d172a975114bdb723736f4eebc171c7a57d4ffa6bf", + "maxShortPoolAmount": "0xcf70bdd4fbee8bbd4654c2ae4af5f4fd7e251c9f5a862f9a2481959955b0b6d4", + "maxLongPoolUsdForDeposit": "0xb5d88c08b31c00ec5cc87b19db5a1852eebd7c4b01fe9efa7cc3476b48f138b0", + "maxShortPoolUsdForDeposit": "0x9a57eef25f7a0a3ce2890da326bc8b81c1101c0d981bef4d18f4a9fcad957321", + "longPoolAmountAdjustment": "0x6ea4d7c5fdaa905e444e63987d874fa0fb5cb9f4c019f1f3589b8d106e4d9a01", + "shortPoolAmountAdjustment": "0x8d8a6fd38d13f89ce794e01f95aeb6ff12d99f4d7c16dfae2e75b2c3902438ea", + "reserveFactorLong": "0x37b873e996c7845490907e4cf943bd6a392730996e7fcc21334c4d8ea874d9d2", + "reserveFactorShort": "0xef4935f61b86c4ddf5b716993cb89eb5ef9ea61a084d9c939bac218db6d3dac8", + "openInterestReserveFactorLong": "0xb568716da5fd1eabd2357f07c5189d96ff8297ceef13e80410541f4adf8dd139", + "openInterestReserveFactorShort": "0x0a7e08d5e0fc7aa4077768cf7ff20cf54958a4cd2aa6e6d6d860328ac7d4c0ef", + "maxOpenInterestLong": "0x3979ee9b40fbb7b865954d637598d9405c883f9ec9d9d0a2c951e38d08954587", + "maxOpenInterestShort": "0xd470bd213372dcd9383f70c4b3194bc920797045a10a4e786bdc5d1c8446ca41", + "minPositionImpactPoolAmount": "0xb61c9f201172b41ef01466067295cec49b27bf7231d3dd373dafc36d6ba4e3fb", + "positionImpactPoolDistributionRate": "0x8ed7411cc322adde7b013216bb8d09c13fa5e2b099d124f522abbafb0eed75fd", + "borrowingFactorLong": "0x720a417449a1fcec9d3dfe100c4a4ddc5443d1584423437dddd0ceb73ca2b0a4", + "borrowingFactorShort": "0x7138470addc60fac84a5d5bb573f3b1a7bea0897e7376d30728cee806768686d", + "borrowingExponentFactorLong": "0xd3fb2b94f7eb684717bc31ee09e2d3096147e504192e7693dfb8fb6af793db10", + "borrowingExponentFactorShort": "0x1eec898c7494d3369f1f4970dcc00a043e66d23c8e56255d5c201bf7915c325b", + "fundingFactor": "0xaddea96d33fccc0a0a6aa17e7ed51c72f11415db6afc1433376be2d91f940e23", + "fundingExponentFactor": "0xcb92af2a600776ead5189c51ae1a08ff72545f186615910b89f40dfbaa988e9e", + "fundingIncreaseFactorPerSecond": "0x84f9c6484a527d3f1f584c53a1dcb8b996a939aa6e01ee7ab5e75bb233917fee", + "fundingDecreaseFactorPerSecond": "0x88194b1e427a4d0c7ce8b74aa2493e973ed3b8ee2b497bf7cca1865e2d96085a", + "thresholdForStableFunding": "0xc9f59d03759ac9526297de85cc504d90f75a8e83179310cac86a6388115a4b88", + "thresholdForDecreaseFunding": "0x2d35394ab3cd73688db0dccb553f9d9b874c762324199351d8927ac278f19a5a", + "minFundingFactorPerSecond": "0x74511774722860d1a5e05ecf94732618016a4fd02ac4f7f4363a77297fd3a12d", + "maxFundingFactorPerSecond": "0x9100124446cae7a4786e50ca6761bdf352fc6a3d3204f14e120094302af3f3be", + "maxPnlFactorForTradersLong": "0x91d5ef2c1dfd5cdeaccda6be41c0e81b5ff5ca1cc70b18964d8838371a1e8b8f", + "maxPnlFactorForTradersShort": "0xc2e47e1d5f976a489e1e02f890681e390a7dbbb1a75c22b20e8b96fac15f6b7c", + "positionFeeFactorForPositiveImpact": "0x17a1a4c5c12a42f5051a147fc90f77a01c548f6fcac70763eabbbda3a65cdd65", + "positionFeeFactorForNegativeImpact": "0x76fe7348053bd8f758cd8e4789c39906eeb5d5ce84205afdd1eb44a7a975a9c7", + "positionImpactFactorPositive": "0x64da39f22293431948db7537bad61f51ad1777bf4d4d6d4530bffcb919749832", + "positionImpactFactorNegative": "0xeb28da7fbe5a9e66cfaa0e19a9cfa3f394112a3fa0f8faee75b2f47ac283675a", + "maxPositionImpactFactorPositive": "0x7420c427b32409f5e82da6c15ead871dd919fcf1e1e92f384802d5bdb4e8c8f7", + "maxPositionImpactFactorNegative": "0x8503fee7cf10b36db3a5563c313bc4517f5165f26a758cc0017f9ed63275fbbd", + "maxPositionImpactFactorForLiquidations": "0x95f09f9b51350da41df77fc76f4eee0a9d0463e1594b8cc5f7370edddb01cd61", + "minCollateralFactor": "0x477063fcf3dcb2f7f5ea4dbfa8ebd08b75668e951d64c79c207fe225a1c7d3bc", + "minCollateralFactorForOpenInterestLong": "0xc28f780855330cd16102ba6fdb7ab47699efa33c0df3fcef42a44026ab9cceac", + "minCollateralFactorForOpenInterestShort": "0x563eda60ad895862bb3e4b14cfeb79a20588ff0aa5e3d5bdfb2ac34f5e66d398", + "positionImpactExponentFactor": "0x3db4ca02007d0bcac3d2f0cfd17c0750e24ba25b8c5eed37cf4cc5eca26ad574", + "swapFeeFactorForPositiveImpact": "0x1f03c21ebeb7b5ec284e3daaecc7cee0e823b4de3dc555fb313bc64f6e1b85fc", + "swapFeeFactorForNegativeImpact": "0x79d8564cf98ebc7211cbbb5b36fa9ec46a18bf9b41c3b3ecedfd3adacbd145dd", + "swapImpactFactorPositive": "0x64e9abf3ebedf7ff2796a8a5fa366a70364fcd4f119fb9d15666e657f73eb729", + "swapImpactFactorNegative": "0x2e08c5b1453619c4951c31850c9f89a154d538c544a90b73e73ba2ef063c9f17", + "swapImpactExponentFactor": "0x3e9cda3aa0b96b0b39289b63ac5d0926a101a403958094fd676b4716658b7a77", + "virtualMarketId": "0x5682928750f0e11d168db1a63e768c09aac514d4f41b13e933e0054b65df218b", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x0c11Ed89889Fd03394E8d9d685cC5b85be569C99": { + "isDisabled": "0xa838b3b36629d46955b9a398b2829c0cc771e4dbf72a13346f8a7134b3cc3302", + "maxLongPoolAmount": "0xec08017824be15a156efcb55724925aa79b94b20658c04082a0288a099521890", + "maxShortPoolAmount": "0xfbabb5f8725416281447fb92203a8fe5cd27017bc7b84dc4f03189509be92d4a", + "maxLongPoolUsdForDeposit": "0xe6546e01b3314c96965a50df900699f70796b2765f5b966640a86a2b6a5f6967", + "maxShortPoolUsdForDeposit": "0xdd9bbc7bf11c8e85b97fda762de57fc9c09bf330dec48f93aa50fa07604e4566", + "longPoolAmountAdjustment": "0x4eb9e76937cd4726baa493720dce4e74ba410a1888225593f06758267121d7df", + "shortPoolAmountAdjustment": "0x6413b581d4bc16b927ca842f927440360bc5d12104122dbb7c90bd165928ed76", + "reserveFactorLong": "0x053a5d0338c5ca5d0e3eeb229e67d63720a3e31cd605745119a2daf5dffd9a5a", + "reserveFactorShort": "0xec6f4cf53cea546a718be9f288679c80445a2b61d16e5bc33912a3bd771e6e0a", + "openInterestReserveFactorLong": "0xa36d469b744fe0fd27e751e61ea6f8f16b54e13e339e90a9018beaa77042ecf1", + "openInterestReserveFactorShort": "0x33668d50d7e495feb5ceaea48e1cd5887cc18f670e7a260dd4a90756c74f9300", + "maxOpenInterestLong": "0xfe20e4424ab28461969f04ab2a0ebb03aaa4bada3d9189ab46e87b945e4d4eb1", + "maxOpenInterestShort": "0x7342cce1c42dd167df2bfab2a6748d465a8dc331ea7c792ca06acd41cdd70ef1", + "minPositionImpactPoolAmount": "0x6708f8ddcc56cd78a007a9a82f3b7152563dc66883e84b61ab3e14c73010ddb7", + "positionImpactPoolDistributionRate": "0x93e11f302f6c308f6fead5232c01260b4ae05a81bd2c093b1c5cfe4a3273a461", + "borrowingFactorLong": "0xb9b4349086138196078394e44d7a086e4fe3058c8db29a0e8603c48218b6e476", + "borrowingFactorShort": "0x0020c82652d1f87569446871728f92ca324ac5a095878ce99ad512d8a6ffe14f", + "borrowingExponentFactorLong": "0x68ad19449dabcfe255bc948b440ad1a6d1e0098a992ae5d0282d50601dce8b2d", + "borrowingExponentFactorShort": "0x3633765dcaa25f2e2f756d393c68920604a7d1d7b4d7391aa344a660bbd64610", + "fundingFactor": "0x0e80a72bf9d77bcaa96735f21e065d9a054a85bd05029fb12ffe245a10165979", + "fundingExponentFactor": "0x61f5ea682e039c6d666e97b5908a8370c257c49f9f5876a2029831a622ad3a8d", + "fundingIncreaseFactorPerSecond": "0xda8256955df7732726d3636f7afb4b0401a4f31322fcb57b71fa2626e78a4d87", + "fundingDecreaseFactorPerSecond": "0x5c207cd8175ec1f398701fbe6c2b6cee5cca451813ecf86a39eba44ba4d4ff8e", + "thresholdForStableFunding": "0x4c460cadfb294633902d6138d4476d41153654a2c456a5d3e2fb972aaf409c02", + "thresholdForDecreaseFunding": "0x90d5149609fe53da9b2f64882d7dd0789f6bfc1171610811611b290c5be015f9", + "minFundingFactorPerSecond": "0xa626a4fecca592c4115a9c4f21509b35c8e45d1a03bfeb7b9631817431e07b90", + "maxFundingFactorPerSecond": "0xfd17448b7052a0f4b2202a701bca57f6b687c5a0b7dadbebfd8279f57ddde32c", + "maxPnlFactorForTradersLong": "0xbd4594835ab977699226e141d169ebf31221364cb1e8c00ea02158785a1bd1e2", + "maxPnlFactorForTradersShort": "0x55bc4828ede3e74ebbf0451569d6e312d1109fe3e9a6bc5e40f2699cab82b71c", + "positionFeeFactorForPositiveImpact": "0x1c2b58fd5a66982e684fc09abb9ddb006bbb7bd04b22776103837b4d22fb88dc", + "positionFeeFactorForNegativeImpact": "0xfd77db7cb72af668ba7025a65dd934661476da45b8c10e28be6932247f634c66", + "positionImpactFactorPositive": "0x7baa57849b07319aaf8c28e1b5d5212e6a673612f5769a366628a21473d4bbce", + "positionImpactFactorNegative": "0xba9cad4f66ee0de01e2762feedf92579733e81433bc367ab173a6d69bf710416", + "maxPositionImpactFactorPositive": "0xe82f4b73da79de37c6d8828c855bc39363701137c4aafac1e50dddfb3a9841cc", + "maxPositionImpactFactorNegative": "0xe66a60afb8061060957daf068784bab70e61cd6bb1ead11c3f81d4e60551076c", + "maxPositionImpactFactorForLiquidations": "0xeca113ccf913f2b135ffc65612d8208716cc437352f94db4492778dbec26b3b7", + "minCollateralFactor": "0x66de3ebde9679ad0d1d7422384e7668a59308642f21b6ed99843bc6333dcfdbd", + "minCollateralFactorForOpenInterestLong": "0x979afa01e39a53a0ee59cb19c28a83db1f5ecddcf336a44541738671ea529f07", + "minCollateralFactorForOpenInterestShort": "0x6bd77d36ae31370d9b5b25f1b1a1301f9af23bfb9b7afbe1a76a2575570499ad", + "positionImpactExponentFactor": "0x94c1d7ae56d6ee75a8fd07d00a806ad9f19aca4164c883661e618f7bc589c887", + "swapFeeFactorForPositiveImpact": "0xfda93cb94b8c430cc2c6a1e727953c276b7f78004466a98723415dc018dfca6d", + "swapFeeFactorForNegativeImpact": "0xaac48c0c555c2263a72df8ed6ebb170df9a43485c970f655c433dd9bca37c935", + "swapImpactFactorPositive": "0x380f0aa935578c5e2efc586f4286a0954ecb8de9f0841a9369d5577638949f0b", + "swapImpactFactorNegative": "0x24a92c575b4320d859d42a38cd8c94af9b78339d66e79ecb7423c253d8bc732e", + "swapImpactExponentFactor": "0x16e0ff5fd356504437065f1903596bcc576bf46181ec5763a9f90411eec60b28", + "virtualMarketId": "0xa4f6bfa2fc8974342c9acf364a7787fc9b5fb8904c3e545e9f70d97564846b38", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xa8A455Ed94b315460CfF7d96966d91330f6A3bA0": { + "isDisabled": "0xb3bb943cd8da79ccd41ac1b07b0886de0fb8e862338f56ebad0f1a9e521d08cc", + "maxLongPoolAmount": "0x576151c00c2cf0dfadfe41d7195cb989a2f7e8dfa2d6d0623f562e00e103d359", + "maxShortPoolAmount": "0xa2dc51365abf28bddcaff13d103e4e8e68bffc8b5c050aa88618847b659a15fd", + "maxLongPoolUsdForDeposit": "0xb4c743cc8f6aa489645f46fe23cc4baad77ec26fcc593897da083203475f975b", + "maxShortPoolUsdForDeposit": "0xb79d4d297dc6d4ffa7650b975726bcda43908baf1ad1d80a88b3e77d7f8cf30e", + "longPoolAmountAdjustment": "0x2283a4250a9826709d4f792efd00b3dd793f68263eca522f5c328582d7d747ce", + "shortPoolAmountAdjustment": "0x58be249e0fe9c0863e91946be75293f0f0682b3d47156bf9bf90d9d11420a8bb", + "reserveFactorLong": "0xd012ce8a6ea32dcb8b1e351a2da5a9bd5020bf8166bfff6ef778c69b3dbd82b7", + "reserveFactorShort": "0x5a09a6f2dc43572d27be233f1612989d14f8b3c96280fdf2d5f386566b6c7b0b", + "openInterestReserveFactorLong": "0xa33ce36254a1f12520bcd6e570bfca00074b25d64cb50a847e6be0f513686b55", + "openInterestReserveFactorShort": "0x6cfdc66ad2906d4c5c2c1e8f78b9cffad986ec903dcbfa6599de3bf4848e67ab", + "maxOpenInterestLong": "0xc034266b0a42fada401bef3d47b68e369ea3fea38152720fe06820745d3abd99", + "maxOpenInterestShort": "0x89f9ca12cc58245825e7f463144a7984fa9636daeb75c148ed81976cb073201e", + "minPositionImpactPoolAmount": "0xce31a6d4e70760e0c1a532f016fa9a79268b32af984e99734ef6b50d04a47251", + "positionImpactPoolDistributionRate": "0xd8537ba5c142584a30574492add69dc74dedcc0073dcb9446c728f7ffad96c2a", + "borrowingFactorLong": "0xb54d17ddb74c67b0854ef08c22c90d32f41540a125aaab7a457790fcad060282", + "borrowingFactorShort": "0xafda34361207dd70c2cc8f9a22d9f87f2901b9cfde1b798fd09e33d4e27f50cf", + "borrowingExponentFactorLong": "0x7bbcda7cf318bde39a81dce986330e8798249f0433ea49485c586438c89fccc0", + "borrowingExponentFactorShort": "0xa44793f40f2b9c63d9545f17b5a41ba84eb0591d934c0c9b32a7a45d969a85f5", + "fundingFactor": "0xa0070c5311f0c9f95807725ba328d6842c355dfbb9c7728f8eef44338e9e5628", + "fundingExponentFactor": "0x3cbb5701f06c320ec8331b042b0e0c2a512dcce36f77205c72b01837de17f4ca", + "fundingIncreaseFactorPerSecond": "0xd5075ef30241b2dd8b1b9506e2bfce0c4187765f785417ff8ce73a9e7e4fe1e4", + "fundingDecreaseFactorPerSecond": "0x45295a32c130432b3d11476a937e1e2030036fbbdabff05bcc53a3619af2d946", + "thresholdForStableFunding": "0xcac4a5a87b04accaff5fb67d20049551805dd8c0179e6a0c0e543b8a7769e283", + "thresholdForDecreaseFunding": "0xfb08d2afd505d6b6f19c6330d3515bb38524612431d45c952eedb8fcd2564c44", + "minFundingFactorPerSecond": "0xab7dd0e96c51868f86eeecd7c4da310fd68cefa9952100aea5309a0ae07773b7", + "maxFundingFactorPerSecond": "0x1fdb4813d9578c34eba7d40e8be3385373c685a85ba9d2937a79ca54b533f862", + "maxPnlFactorForTradersLong": "0xcdea350cca22a37c0bee2fba1a00922504ebd7ecad69e18d81ebfe1cff20bc3f", + "maxPnlFactorForTradersShort": "0x16ccdaa5770845bf1770f898bb130a218207a1abfd694b328cbca0447eefb23c", + "positionFeeFactorForPositiveImpact": "0xf89efb2df265c4bda64726efa91d82dfe2447cc6e1982d0a5df80b1a6c98e7bb", + "positionFeeFactorForNegativeImpact": "0x094f55fa807320bc8c19374bf714f9e2fc2eb9909953c31a142756810ed90bbf", + "positionImpactFactorPositive": "0xa1c42743459cc18584470bd7fcf394f287cbcd2426ee98e16b750c0cbe1843a9", + "positionImpactFactorNegative": "0xff8af72e7c6be7bfbf7ebd7235d6610b6495c46ab493997b3e98e6e8c31b8a02", + "maxPositionImpactFactorPositive": "0xd26604e096680008907eda5411c8f65b79e898f7fced8f2e8f3aeb2e113b2146", + "maxPositionImpactFactorNegative": "0x78f8535809a6190aeef4e5fadd69800c7662133aaa6bf621f4acfc377ab01935", + "maxPositionImpactFactorForLiquidations": "0x551b4069fdca4d0563164496a8b8865893dc2ebb3644af484c0ac7b5a6d9b382", + "minCollateralFactor": "0xaea2afd33c6d2466b226b95971101b0250e5a558466f3e688135e606529cdea1", + "minCollateralFactorForOpenInterestLong": "0xc425f5ca4051c07b0ef0a474ce087918aff548677159081ce684e1832a0dbfe0", + "minCollateralFactorForOpenInterestShort": "0x6bbbbf6814e4de22856022d7020a208a63c369ae1fea354d25df0ff0deb385c6", + "positionImpactExponentFactor": "0x528ceff820b2cc4de63f384e46d279050c14c12bbe069780248ca35209c7aa98", + "swapFeeFactorForPositiveImpact": "0xce4933def7de695772ebb91c5f48e74ddb76b3948fad48b878dd02ba9caec3f5", + "swapFeeFactorForNegativeImpact": "0x98ead5e154c29c07125c1e4e8cf110f5a0419cc47ddd938b394d97e787fa587c", + "swapImpactFactorPositive": "0xde03a55a07d901e98210970ac22f0cdf4cb6bfa89ac97a87aeb924e7382d4d8c", + "swapImpactFactorNegative": "0x295a64c0d9cccfd469c2db10ea4fa9661c3c1630db9f753eb6d33eb59a7c34d4", + "swapImpactExponentFactor": "0x27f090637cc766665ce9a0290f9ab38703f834afcee2cb6ff944556b43b9c60c", + "virtualMarketId": "0xedf48a26848c0291644a13152b4543d18967392cc784b3a61e6c2e99a7594133", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x970e578fF01589Bb470CE38a2f1753152A009366": { + "isDisabled": "0x7bc7787905c6d731811002e0f8c3c4da324f564aefe012e88601f2465aef5094", + "maxLongPoolAmount": "0xa4cbbe29efe3e49fa57f9a326436872ff0536c385b377e24ae10ec8390b38dad", + "maxShortPoolAmount": "0xd7c329a347bb5bfdde958df486b777ea2fd01b1dab01c74215347dbafd56ffbc", + "maxLongPoolUsdForDeposit": "0x88eca08c39a9759a46bf868ab4f648800052ffa6737a247e79b1a95022ee789b", + "maxShortPoolUsdForDeposit": "0xe7935e20020cee0ab309c8c2556dfabdfd22dbb76e98bd44ef62b1275de65e78", + "longPoolAmountAdjustment": "0x172b75916fd19d14a2b77d29a5ad1211ef4fe275a7188e6b9c8dcbcbd1821d82", + "shortPoolAmountAdjustment": "0xfc7b344a79f0d4fb667b7e28ce0a9e7fbcc85073c82c6007a31570cb0732321f", + "reserveFactorLong": "0x4f0fd8c73b2a1ed98fa99b1fd7508e2dae67c7015e72f94395a5a8bd5994e972", + "reserveFactorShort": "0xcc7ce90de8f94adbacdadc3c6a245ee6e0c41e7f57afe19f3335c9e7f2e6a10d", + "openInterestReserveFactorLong": "0xcce242c87b41ffeb295abf352d70ad2238bd5b92e0f3c7f1d87c66c484c46a70", + "openInterestReserveFactorShort": "0x91d7a9b7899166be0458b21ebca5d5422b8693be72578ee8821da963c6b24632", + "maxOpenInterestLong": "0x0964a7ad10b77af97364176cf9e721f8ee345174878c47d202334817e10c258b", + "maxOpenInterestShort": "0xf1217aa20ffb704fa5e6b0919b94a3d103964f8536bff6b0000ce8ee35e34028", + "minPositionImpactPoolAmount": "0x0694e63ba527f47172e5704a465eb68f53de7a896402e85d5da1520140962df1", + "positionImpactPoolDistributionRate": "0x1c17bc2dbac426b7b782b7383aa32492be389daabc4d5c787038f580385e17ce", + "borrowingFactorLong": "0x585f50a19948a2e22801196472114bf9d3d8a80f4279cddba9e2415341c22d50", + "borrowingFactorShort": "0x1190ee305af949846a5f767f477779db6dc232c4f30b07ef5314d09ea49832b7", + "borrowingExponentFactorLong": "0xf538245ef656266ab4d1a505084adf19963553aaec1e8320b5c414dd7f5e8282", + "borrowingExponentFactorShort": "0x749cab199a317e2d92d509edd23d50a4bbb7aa3dec2de88b3ae6a467c3d9830e", + "fundingFactor": "0xaa5e140bdd2331832a859ae413c38033ae8abb5b6860d37648df1064b509772c", + "fundingExponentFactor": "0x73eac496aefb5458d11b4c7eed06ef7661c44f82d20d8467ecfa031b8533bdbb", + "fundingIncreaseFactorPerSecond": "0x0c82f5734486b2661dcd21a7730e41a01a57d74c0ab743773b52a483d44f2726", + "fundingDecreaseFactorPerSecond": "0x6df7446de04a108cf48433c4c15a39192d4b7f4cc91d06cc2cc17a4b5e72953a", + "thresholdForStableFunding": "0x7e864affe7fb4a4980b7d594c79a292a6289cd205338432b9af85c67eeb26cae", + "thresholdForDecreaseFunding": "0xba2df0a7f6a9e0870313910d53202667efddddf82dd8af7fb833c0287f7c5c3d", + "minFundingFactorPerSecond": "0xe7657f91ebfcb457617211fdf6f256a084cf2b144134d5b0371dc89ea97725f6", + "maxFundingFactorPerSecond": "0x3d07c1c798dda7f35e115b1f7b3294455811db0f6b332105e6cd7640ed8d2979", + "maxPnlFactorForTradersLong": "0x0643ab82acd1da935dccdca596b2467d15a15578392c8c1830c74d95cdf56bb5", + "maxPnlFactorForTradersShort": "0x161cd5203040492bf6c154ee5a97667b266446a4a5ca70282f126ecd7616f1ba", + "positionFeeFactorForPositiveImpact": "0xa2642d8d9d5fb8e2ac0409d2db33e187719016ff7bf134045ae6182666bb05b8", + "positionFeeFactorForNegativeImpact": "0x23dcc4cd943557ef8ccebe9232754e9ffde52c137f085598ac91e7192a17ac59", + "positionImpactFactorPositive": "0x6c77776d5e1445193adfe5b04337025ffcf54bdb11679bf34d87f421df699ec5", + "positionImpactFactorNegative": "0x2565ee54946347b057bf1b32306485f036062453defc85ae44d043c9cff511c4", + "maxPositionImpactFactorPositive": "0x1b5120ca944c5a33e540a1c6e406b523ce921000a984f97f95fa699d520cb7ed", + "maxPositionImpactFactorNegative": "0x5296af9bb7d06b0cd08eb201218d7f1e6a2329be82fe448fdfd8b8fc39fa68a1", + "maxPositionImpactFactorForLiquidations": "0xfe947f5fc6293d31166df3a75f524470845c7eeef041f8a2e420a094c3fac1cc", + "minCollateralFactor": "0x0265939bb7d88fea6fff26636a6858305b038871546f1414e5701ad669d5dc1a", + "minCollateralFactorForOpenInterestLong": "0x50d84922790ede06558e4ca6f2e96902c570c45e4f427cc6fcccdd32dddfecad", + "minCollateralFactorForOpenInterestShort": "0xef11b410c5d53d8e576c956acea505ed667e5d34bb227625e99d6514bc07de92", + "positionImpactExponentFactor": "0xbbea29388c648439a26a387b35619908b6b708893ec6e3555a1f26de057e27ea", + "swapFeeFactorForPositiveImpact": "0x8ef96c28cee73d45619581b8a28340afbb3e3f7d496d55e1ca67286de61e5f95", + "swapFeeFactorForNegativeImpact": "0xdf8618a78eede905a9aaa8a5ae18211a6a6bdb3737d54f794c8a999f091c0729", + "swapImpactFactorPositive": "0x77668158274b0da81643c91786fdaa3d98c20ae3ed3bef765d11798b06b5f5d8", + "swapImpactFactorNegative": "0xb4e19689f59f1f7a32a01249c2fce76b3af38202f0259d90af683019f13690a3", + "swapImpactExponentFactor": "0x0a8ea7ff9e9e32e140583e2600c881c51c70a415f40a8d918b040cfe77219fb2", + "virtualMarketId": "0xdd2ee378705b487a897a21ed7ec30f62e045230a427ef6ef9b7d0fa31aba68ff", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x04DecfB37e46075189324817df80a32D22b9eD8D": { + "isDisabled": "0x5a796e56fbc6bf94143cf0a7d1e850fbb042249e485c62cf653fe07fe303673f", + "maxLongPoolAmount": "0xf5026d8d215929110ccdd42aa60f6c37258617befaff182f13ad4140e8e0787a", + "maxShortPoolAmount": "0x76176d228a5f526f628c587b826fc3d409c7473a2d7627aadaeb570918fb5f4b", + "maxLongPoolUsdForDeposit": "0x766745711a9ef89a684e014f9b87c12ccd2a286004a3c611d43098574f45c04c", + "maxShortPoolUsdForDeposit": "0xbf3bc1a56a2c0531be27bbbc6425a9ae98b577c2894f2aeb7257e06ab6cc896d", + "longPoolAmountAdjustment": "0xde955879d330579017ac8c9716d0adb9d111694d1e6ca51de3d494662239c1d5", + "shortPoolAmountAdjustment": "0xcab5fb532e3dde4133a26cbbd7aae6c93a65ebc1c3ee181d25826f1c71e55d33", + "reserveFactorLong": "0x51549fb28586d2ac4b51476913dab8c54ed97ae0845a441670ccae23f25ef10d", + "reserveFactorShort": "0xfb5378663ac7d1be37cb63de3ca0a46b8fdc6de1495a8c9e104a9ac1c16586e3", + "openInterestReserveFactorLong": "0xf211dc25b2cfecf8c8948028c14157eae856a68f94247a9b530d826d31287440", + "openInterestReserveFactorShort": "0x2069553750f5426f4326ddea7884ec62e858b0da348e3d9fa51a137a35f92cab", + "maxOpenInterestLong": "0xebb0c194a07be77deb58d148cee1cf98072f77b18bfcf61f14f0fab6a46bab64", + "maxOpenInterestShort": "0xd289d58a654b2db3279fc3dee1b2e81537cde2f78ebb53c398a503b710d8bc7d", + "minPositionImpactPoolAmount": "0x778e0e32cef5640c6211287185a7c0c2d9a03767aa50a666fc60f28b2b4e8aa5", + "positionImpactPoolDistributionRate": "0xc870cb6154bea17110f9bd05773a9588fefd5ab669d36b746d03da30d8f141f3", + "borrowingFactorLong": "0x848c40eb35880ac660a6a3851a52d524e8e11a560de7d247095eb77b1edf0f2c", + "borrowingFactorShort": "0xed812605d1b25085750061ed4db7e80ec3a47b6284bc20b5e61553c09d36db00", + "borrowingExponentFactorLong": "0xc0f08edbcd81cb385ee224dee86d106834454309eb017515e169c0ad1f925dc4", + "borrowingExponentFactorShort": "0xf0afac3d5f5add6fa54909b34aac0d679ac726c2a19443112fa8c08f56d1ab78", + "fundingFactor": "0x4587683376ae70a7cd0e9af166db3679d1d74ffb75f60b67965822c91eb9e4f7", + "fundingExponentFactor": "0x9e92893dd7629c3dd368f658e16107f898b9136d3c5be973a54981ae568c55d6", + "fundingIncreaseFactorPerSecond": "0x4c6275380e47ef1166ecc464864e34f729373b4ee6f15050ae1f7740efc5c3f1", + "fundingDecreaseFactorPerSecond": "0x7fa6733724ae791d6078303d8e596555e574951ea9cb2ec8e45893d00004da97", + "thresholdForStableFunding": "0x4509c00555c4fb98bfdbe3d7fa784514820441518f98bec169f66b9bd6bc5e97", + "thresholdForDecreaseFunding": "0xd49cf4ba41f96a14717d6b878fbc3a93a8f9367e14c2378ac33aadd46a38d579", + "minFundingFactorPerSecond": "0x12d352769b6cc5d96cb26430b3f8ca2594e8ff0129d598e0d150e7d9f06add62", + "maxFundingFactorPerSecond": "0xc4150965d758d86afdcb22b1c6849fa84e8966c11a134af851b682fddf33e4a6", + "maxPnlFactorForTradersLong": "0xf3320cdc63c3a7d6f78ad9986ddb409c5134677e3ad4a0174891020a22b24fb4", + "maxPnlFactorForTradersShort": "0x228b126e5894d16fa46757d3a5a5b6d5710a5b23ea94753de3f9737c4d2c5b9a", + "positionFeeFactorForPositiveImpact": "0x19a2a68bdbc66fa5dc4851a9378ede85ccdafe9acb99e62c017676872e343a6b", + "positionFeeFactorForNegativeImpact": "0xd8d7ebb0ecd47d813c8dadf9c1af95bfe460bf83fc2315e7c4ce9f6d63f128c2", + "positionImpactFactorPositive": "0x85203630052949e2750737f79f8d56725368a5c53228abbd1afe481db132006a", + "positionImpactFactorNegative": "0x1e7f9610ae2f0862b2ec16dd348ba826566595be72f4492f52ff26c34d673622", + "maxPositionImpactFactorPositive": "0x2de659890a4e8d1963570ff9b59d26e46be9b33cf7e136aacfcb2bb200550ccc", + "maxPositionImpactFactorNegative": "0xc1bea97710f8e10627534a240eee6f82cd830e63d7b2c2dbd76556ea4fd033f7", + "maxPositionImpactFactorForLiquidations": "0xf63f2b50f2ecdaa28b16771a42a2b5cd380e09f6de782cecb71e839cdc32f851", + "minCollateralFactor": "0xfb841e5374643d23b05f191cc2f0e1148808a7f71da91675b9a3d8c64b016544", + "minCollateralFactorForOpenInterestLong": "0x6d7fcd1f8264f3f59c707af933ec7782df25287b0b6b5f420a319b58b4886f7c", + "minCollateralFactorForOpenInterestShort": "0xb605b4ef503f9544c442f94b2ac131cf5ee8da1d4e1316784bb9d7cce6d79138", + "positionImpactExponentFactor": "0x5d9ed32420efc0bcbf1596941636a999f62042da229abce2fdd8c931da675f9f", + "swapFeeFactorForPositiveImpact": "0x062c0c2d730d24aa33c37d80bb065f727dbd4301b42a39c8d2459487d066749c", + "swapFeeFactorForNegativeImpact": "0x00a2196092d604bf9fc2ea751e06405e37f231e0fff627ce7be4cabc40bf6ca9", + "swapImpactFactorPositive": "0xe317742a7019bf37820ea41ad199bdf4a6252562c7fe43a71abfce8e85ab80da", + "swapImpactFactorNegative": "0xa8e910e7748bd5c02441c6d1c9a77e48c61af20a8e089b02a61a90f7b6678acc", + "swapImpactExponentFactor": "0xb6ef980b459b0fe90605c30cdb2084285dd6c2b7ef578e2d4bbdfe1ca5cf4fdb", + "virtualMarketId": "0xc67db77cf7a84bb62e7714b446b692f84e692abcedecac64f168f18ee95ba178", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x4d9bA415649c4B3c703562770C8ff3033478Cea1": { + "isDisabled": "0xd10955d37297c8901456fa9c9d555224221ed3c5777b55b5d638c46f97dec0e5", + "maxLongPoolAmount": "0xffcaf0ea730386903baccca44af103f99e3efd8f6aedc008035e8face6a1b80f", + "maxShortPoolAmount": "0xb6b9b0f700803cf50aa6f3166899fb1918c715e7fa1a79519643e60aaa242285", + "maxLongPoolUsdForDeposit": "0x38b6cc3d1fd13c0c0228aa674329cdf313962c46aad99509de9c4f13531579e2", + "maxShortPoolUsdForDeposit": "0xbb3613942913787bdaae0e6ed18f48ea73fd1e9fc7dcb618d10f46132e411116", + "longPoolAmountAdjustment": "0xd17f4a098114eca68358b4178373804e9a436a267eae107fea945d43cef6e697", + "shortPoolAmountAdjustment": "0xe931b2d08a415ad900c942077b10ef77c869247f74f5a434fa6c1d386d16f259", + "reserveFactorLong": "0x6bbeca02090b626c246d62fbfd3c04c1e4f5c8bfe5c38ff3381b721ea60a462a", + "reserveFactorShort": "0x5611cd4221dedf115921bd249cb788499f3447d929355c5ca386d03230b791bc", + "openInterestReserveFactorLong": "0x111e11e591db9036dd6fb599ef8eb4d9f36ace2a197e182340215b75a783a3f3", + "openInterestReserveFactorShort": "0x0ea94aa87482e97a95a1fb10ad4871b9d454caca7fa5b8ce5d46ef7a0321c72a", + "maxOpenInterestLong": "0xdea664939d8863e8795055dd721ac42669109abef8ea185201c459d8ca744413", + "maxOpenInterestShort": "0x16079014e0d5fd4b9189e5484efdd1a1d78dbdb363d98eb262b8424cdd93e541", + "minPositionImpactPoolAmount": "0x94e7fe5a56429f59ae278c9c8ae774eade33535e18ba272c5b41411bb8136e42", + "positionImpactPoolDistributionRate": "0xc50b9966b269fca11d0f7e93289e7b29123c7ab2558370ee37b81aa519d4dbca", + "borrowingFactorLong": "0x32dc7306f13f338404e4704eb3c1fe04cf38beea4e35d038f1325052a54153e3", + "borrowingFactorShort": "0xe1c5d3ca95c0bea7d01756468766622fdfbc6d3f99960f2acc802ecc1378272e", + "borrowingExponentFactorLong": "0x462e45871226f5f19889b57e6ac6624a81d3eb569c4387b8beebee0966b227c7", + "borrowingExponentFactorShort": "0x74594aa632f7bd1365dfaf45cb1eda7ac4a5baa98827ee2fb72569f10333ba34", + "fundingFactor": "0x3b2af8deeb70d292cdffd85040d7f5badec776ba64584cea0c6f645c30578d37", + "fundingExponentFactor": "0x623daa8e596afb0b4303b46f5733e12a4e1113f7660428e7b043fef9590fb8c3", + "fundingIncreaseFactorPerSecond": "0x0a0747d55813f5c2bb6c4e5ffc57fab2e95594651bb0531b04a3a68beb978854", + "fundingDecreaseFactorPerSecond": "0x4ddcd0130eb5362f380d4e529d1532b1fff2572d4604ab46d92181399bd9c167", + "thresholdForStableFunding": "0x06fed3f8def2b93d68b1ed139ac8ad67d4252100d03c5125133322d8f4e85091", + "thresholdForDecreaseFunding": "0xd183e87b5e28f6f552e98972736719b4c7ecf1782b9a86f3325862f9324b7c9c", + "minFundingFactorPerSecond": "0xf4c23aea9d7ac745db5751bf4b77cd2564f9f386bb958b1215003b46240fa457", + "maxFundingFactorPerSecond": "0xfa6364fb56a11345b92d4983b9bd8ea66cacd614eb3b7520137399f55d354b09", + "maxPnlFactorForTradersLong": "0x13a27a353c7776ef31a2a496bec36eb5dfb23d8dcdde1c4873ac3c1e35e4313e", + "maxPnlFactorForTradersShort": "0x0b3a39ad3f7d8d1ae1a553ad21654b2fcfd1e55feb8c3efecdf91d53200b45c4", + "positionFeeFactorForPositiveImpact": "0xfa2c3a7f66301b3059290169c87e11fb20c062c65383b5740c7d3b090bc98e04", + "positionFeeFactorForNegativeImpact": "0xd3ebf9538ef9ea88d6f7ef51523bc2cf6669cb01aee98f1de1fec0fa53b4eda9", + "positionImpactFactorPositive": "0x3daf5ba49e3d385f7036de1ad15a6a638d9dd0a17a2cb765e1d772d5dcd7a91e", + "positionImpactFactorNegative": "0xbe0d09f14005110d076128a12f6a0f4cc2ed5f0048479ee1d1d2658480d07c11", + "maxPositionImpactFactorPositive": "0x07e3c045a079b6ba9dc07038336e09bce8c716941b675d352a7b05ba5b59ce60", + "maxPositionImpactFactorNegative": "0x84e0600c16972b29f7da354d54020464629310f597f791a8dabe846828986384", + "maxPositionImpactFactorForLiquidations": "0xfa799d4aacb60572cdac1ee643f9cd39f700a4b389b24222533c7364f308f5be", + "minCollateralFactor": "0x3a6062579846cca4b922db1cf9688c3f8f090eb5448600fc904bdf4b4b72bd22", + "minCollateralFactorForOpenInterestLong": "0x94a978d635ef737465b195eec16b7f19c6f1bff0017c978ca61a17e5fe8b7808", + "minCollateralFactorForOpenInterestShort": "0x2688ed464f128f747c02828d429a6aa3dccb40e2071454408f3296fbd87a16ec", + "positionImpactExponentFactor": "0xae78eeb8d250d69bc9255def1e262c819c19b3aac6ed2626248730ada04b108a", + "swapFeeFactorForPositiveImpact": "0x50bf015e1af753131c148a7f0b5a8de5e482f08b30460d48e358105925cff626", + "swapFeeFactorForNegativeImpact": "0xe248339af6d57cabcbf56a435449881c63af9318e4a9248d8d230f1596d112cb", + "swapImpactFactorPositive": "0x1404bcb3b37fd6c73c429f0b67f0326ab072e3ed1c832a41cb8b3ed7eaf9047d", + "swapImpactFactorNegative": "0x5b5cb62ae90c344158744facbd2041a7a9fe2104d068c90945d76de7c5d7fc7b", + "swapImpactExponentFactor": "0x6cad51d8abbdc78def03b61c8b995d2f4f8ffbfbdd71285b0bd2218f4fd2a036", + "virtualMarketId": "0xd31374b133f13e3512248d1d43dbbd7c418cdfca1de9cef16428625e0a1aa2c6", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xdE967676db7b1ccdBA2bD94B01B5b19DE4b563e4": { + "isDisabled": "0x5db9f88459dcc75cd7853b1f827433dbf1a1e4b52bc8b753300e65ea97b40e08", + "maxLongPoolAmount": "0xe3d9810981ff3513d57a9bd2d3d2c0ce58f426d87b9b98d90c2d19319ede2329", + "maxShortPoolAmount": "0xa429e9cb87058f1fcffd10d718424732361722ca87e775091f6c548a8ae91bfb", + "maxLongPoolUsdForDeposit": "0x33f8dc6bec4e1a26d78efa033acf9860d7aa89ff023b6b2e0f95d87676f11be3", + "maxShortPoolUsdForDeposit": "0x2caeebc8cfe7811254efa312179c14b811a2ef4a1af24e46d7e7a4159df53ee8", + "longPoolAmountAdjustment": "0x80119f246ee87582f1853d7fbe2233c99802cb982f71df42bb0d18391b417f1e", + "shortPoolAmountAdjustment": "0x3089f95b2287218a48cce98e10e20e31840bf7b85e00ac0590e88cd020c765cd", + "reserveFactorLong": "0x2dcbab083a185a84f79cf5b808498385a22101a657043e8d83cadb1d89b06071", + "reserveFactorShort": "0x21dd94b5036f2104b97785fa1b889bbedb0bf993d2bb377f0df485f89d5dcd30", + "openInterestReserveFactorLong": "0x91c71d24aa72fe5ac3e67205d8b0e3542531d9b0cfe71d196001be625e674fc6", + "openInterestReserveFactorShort": "0x504078bf604e125f9c8612a9e935b49df475ceeb8d6256669320c4066cd796af", + "maxOpenInterestLong": "0xbbb145ef6043d25f57777bc5366d0dd46a1f55136aabae274d1d63743852e339", + "maxOpenInterestShort": "0xf375862060f2e2cba96e13418947f1e06483489ce451e9cfe5f8bac63b87e6f7", + "minPositionImpactPoolAmount": "0x6ebdbeb0a32e6b03b42bd3d93de9cff9226b64b83b856df748f4ae427919d6d3", + "positionImpactPoolDistributionRate": "0xd403004a7719f7ee7eb84e0de4c9beea64aa27639256ce33972ac117c23cbf3d", + "borrowingFactorLong": "0xa76170863138b03b788c94af75fe302e1abbac7d6bcf2bd21c06910a78369f3c", + "borrowingFactorShort": "0x02d23be38e7130919c1cc90967c49a677f1ed102cf7686d2b9296f5fa6275520", + "borrowingExponentFactorLong": "0x8e0dae5d6a4479a869170664927b7649699b72573b0fbd2f3b4e9e29e968808c", + "borrowingExponentFactorShort": "0xada17b5280aec84fe689e8f18598c6d57a194cf5735f18c35783a28f7987a296", + "fundingFactor": "0x4ba37b429e9fda49c0a14b26a8ee634c40f0a285c9e4b8b35d86da765d6854b3", + "fundingExponentFactor": "0xcd896ab0a438bca476fa3a4179748b3595764dacc48bf0556f6cee85f0201a81", + "fundingIncreaseFactorPerSecond": "0xdef68651100914c5340dbb27331d267eee58f24afbbf259d9220b279cc2a70ae", + "fundingDecreaseFactorPerSecond": "0x1f6d3bf3b098e3cb7f41eaba429b81bf8e589e7307c1a8d24a9ef36912f253be", + "thresholdForStableFunding": "0x21830c0a6f864f33911ed14e5e861e5d6befd0117266bcbac092c59463bb4114", + "thresholdForDecreaseFunding": "0x0cfb7153d946da26bbd0a41abdbfb50a09388c2ac0ef27ab07f6019625758ff5", + "minFundingFactorPerSecond": "0xcc8f127a19769114c316993ad4f56df6435a7331e74d9e02d8206185a6833131", + "maxFundingFactorPerSecond": "0xeae47123e370dddf6c9579930918a34f59c44b9945b68afb8a693a9444b9e6ac", + "maxPnlFactorForTradersLong": "0x5bc743b0161813f436c45d2bc88a64de29d05cd30d9c1f6e1924f0b138328f57", + "maxPnlFactorForTradersShort": "0xf95dd4ff89517f2fb139ba5f72e2b18bf7aa6ce454abbde2e24678c5e8c826e1", + "positionFeeFactorForPositiveImpact": "0xbbaa199810a58a8b632296eac0daae34a5f24fdf8013d5ecb0c269f5e9fd4430", + "positionFeeFactorForNegativeImpact": "0x668119f4388e461b52d33b9119d5fe66bab6e1612657d134841606b722fe5e21", + "positionImpactFactorPositive": "0x82d8a24ed60b8b954daaaa4afae9b80786c1a1d3524000b6e8fa2616c79af74a", + "positionImpactFactorNegative": "0x8337e01de60f85dc0a20a5f6c2e0bdc5e8bfcdaf3ac72583acc8a80b1ebeec32", + "maxPositionImpactFactorPositive": "0x2a25ce604cef5d4243bebc4f18af4f6387cbbcd46d1293e23fdfe810cd6854b9", + "maxPositionImpactFactorNegative": "0x9a452777e6806271ad8cc47d6d8bd0a79dcde5bba1bf5fdb99b0c9056a752510", + "maxPositionImpactFactorForLiquidations": "0xb4e94d1b92745024b727c7bcedcd895ed2e00e2ea2ccaf2eb37d50cc590131cf", + "minCollateralFactor": "0x0aa8885df89de8ff34563554e6069a4ad8949cd4e6f77d4e7e5fc6eed353b721", + "minCollateralFactorForOpenInterestLong": "0x4434267baa673353b931f72b997d623a8dbb24ad019fb1012b523e3445a9b522", + "minCollateralFactorForOpenInterestShort": "0x6b1db050ad4883d52b32633aa49159bddd02262af4439b457a32cdcc5988fd43", + "positionImpactExponentFactor": "0x79bfdbb2346f830a4c8d80f29a006b0baa9367418902e8b3c93a1213c9eed125", + "swapFeeFactorForPositiveImpact": "0x0faa1337b525b28e6422cd472df6548c0da443bc9077ed0fe6fa694f8ee772c7", + "swapFeeFactorForNegativeImpact": "0xf9975025f98c1742bafc5964493e42785f56e6673592097971feb7aba4729a0b", + "swapImpactFactorPositive": "0x107517ca8068a2882de0bab37ab86b35e91cfd63473089cacda01bc81f1c7daa", + "swapImpactFactorNegative": "0x1e7d0f85278824210a3ce74721f888e34dee24c518278d80952dc9f1024b7f65", + "swapImpactExponentFactor": "0x5c85d1cc64d3b9efcfab44480ef94a71a4456764663fdea9d64b006f2c0d809b", + "virtualMarketId": "0x0655fedc3f9cdc09685dc2e0128e0d9d4b005fac6bdf26b24115db2a3c3b12c3", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0xBcb8FE13d02b023e8f94f6881Cc0192fd918A5C0": { + "isDisabled": "0x7740f53897451f061d806e9a7fe085af6824c1273314d31e1a23cbc3b964fcc2", + "maxLongPoolAmount": "0xee8391e2d41d8f3dc1a3be589f57c887985ae3c007eb96d653aa78ef4b72fa40", + "maxShortPoolAmount": "0x16222256639b4d6ccf3a6b03597b59ad3bf62a506082fb69bea3637885ee4c97", + "maxLongPoolUsdForDeposit": "0xd0307de55836dbdb6a47d81b8d65071b0f9f55c25f20dca79d3e5c6c083ae95f", + "maxShortPoolUsdForDeposit": "0x47cf4be50b21bdb7871785368fc3cd780d0201bb04e60d361dbd5796e2f3ce4c", + "longPoolAmountAdjustment": "0xdce35ff080d31a35866b938d768a8a7ef0b577564dd53135dec25593201a8a17", + "shortPoolAmountAdjustment": "0xf214506793f28beed4ab9d0b561eb19319de31dd9dfe92749762540270d1c031", + "reserveFactorLong": "0x0fb39179f678550ec8cd78628be345911f0dad3de6c044cb2e1d1e3af7cb70ae", + "reserveFactorShort": "0x70a5633c8f3a5557e05c067668313f542cd62db233c68535380cd6e6ee53b0dc", + "openInterestReserveFactorLong": "0x3819a2a46b58995b468d90fd858a9ae720c8eb54b374a63c6c7b1139ea222763", + "openInterestReserveFactorShort": "0x28b53639734d2d89d0d02b88f39e7fe57eed5dd576bba1c7a10b57885eb93a7b", + "maxOpenInterestLong": "0x660bc5eb1f423df737146dfa5f4e54617b7e0387a80be464a7fae03e39fd06d9", + "maxOpenInterestShort": "0x93df819bfaea4e9307142fb95dc595028d6843fe1a39049e6d135f8543c92746", + "minPositionImpactPoolAmount": "0x6899b1ca95e1bc0f72affc99389682688212106666d90131dc14f0d894f6a17d", + "positionImpactPoolDistributionRate": "0x1a317cc2bc34a6f84c4c4d25656439698a4352e5a16ae11a061a26724f02446d", + "borrowingFactorLong": "0xaa6954ea291a5b9249ed3bfbf2e67f103a22867cd0ba19fc0671babbc2561326", + "borrowingFactorShort": "0xc3348191eba9966819973984592aa0d305f049c9c201f525dc46299675c19b64", + "borrowingExponentFactorLong": "0x7ae6c9f49278e000e86cd2d57d5ba3380ec7cc1483466c0b5a69a37db65bdf26", + "borrowingExponentFactorShort": "0x74e6ed192bcbc480f0de977d12226c6ecf1e8ce31e335039ea7f04373b65c0b0", + "fundingFactor": "0xee41d1f28ea1fe7a0a68c3901d0d14ee2a52e11b25ab069690d857e04a9a87bd", + "fundingExponentFactor": "0xf6b056bc03582f4ab93b254806574bed7012050f5920266797714842de7bf080", + "fundingIncreaseFactorPerSecond": "0xd15b3dd010f8d26c9073a08b041db3ac3a78a9cafd8a8dcb49d3c45bb3215298", + "fundingDecreaseFactorPerSecond": "0x12573abe009e59a2a791685b45a24f9528053d79023acf4108f9f4e45cd6c735", + "thresholdForStableFunding": "0x7966592a1e5fa31a9005593f25d117d3867baaf9e682afd7ea6fa284ef1d44c1", + "thresholdForDecreaseFunding": "0x4a8e77a5dc5757a4e624fe4021fc213d443d3bd9332a054df17861974aa6de78", + "minFundingFactorPerSecond": "0x0b3197df7bdc78d5fff5a7b97061ef49f6d1c73ade71d6aad083907a671d8b7e", + "maxFundingFactorPerSecond": "0x0fe3f71d3f4e380ac4bd1d45ec26be57ea2ec86a9e893c45e824fddb3233e5a5", + "maxPnlFactorForTradersLong": "0xd9ccc9e84419059f691fdd180aecb410ad79540c2cafa902da62d54128d754e1", + "maxPnlFactorForTradersShort": "0x88354aedfe906b9fb49ba2f728bfd0ddd470c9a1cc85cc055f0d716a3f2f54fb", + "positionFeeFactorForPositiveImpact": "0x5e34672fc4f42ab23d23213fa1d40cebe0a3e7bcf87eb11b76d2fcc1be32e252", + "positionFeeFactorForNegativeImpact": "0xf8e3dafc3f767e6295802eac15d1b04db4698328bcc74af85b81335b8ff21c99", + "positionImpactFactorPositive": "0xff8e09a7151d33fcf5165e2ccf6ac14c30d229f18ee3a60a95abf260d1d243ac", + "positionImpactFactorNegative": "0xed76416203eb5df0eae69591d057f2870fc448171a7e014906c629b9e71cda12", + "maxPositionImpactFactorPositive": "0x5dae48e6dfe9c144cd58a6e4b90c070ef559116c76518323bed64e54cb43c85f", + "maxPositionImpactFactorNegative": "0xf43b9ca73005afa930d529a7b5e512a0b072819f3addcdbf14fdd3c65835f385", + "maxPositionImpactFactorForLiquidations": "0x63855710f19d2605d4dc599aac16e0d6240b8336befa7f7f0f0de89ca8fe48f4", + "minCollateralFactor": "0xb10b7742e2b3281b2f4c6c986ee610bdaae744a102b587ed040bd5a26d0cfcf6", + "minCollateralFactorForOpenInterestLong": "0x24d067bde87a33817afba6f9159b1f879be5f907de489107e0e32433665c7c1d", + "minCollateralFactorForOpenInterestShort": "0x970902c830d69c75cf173a1493daf4144604122b2f7b75fe359cbe15ea3dcd4d", + "positionImpactExponentFactor": "0x099e85a8f05448a4731818fa874d8796b78a9a46cc87197eef4bb972b10e456a", + "swapFeeFactorForPositiveImpact": "0x440a965a2877911c4c99d8a22338d137721fc202a2d1e7ca75cdc9f094ba65b0", + "swapFeeFactorForNegativeImpact": "0xc926687ddd09ffe9ac71036d2dc7f560dc5b6ec92d888c1cf3e6195288dd6e80", + "swapImpactFactorPositive": "0xa49e8eda8b34c14886ad044ddd88d3fa227afc72878a3c40e5d79a9528d0828a", + "swapImpactFactorNegative": "0x5faab11fcfbefb319520e36256399baa608cde5c8dd19f2ca05aedf022d92b60", + "swapImpactExponentFactor": "0xa6d25fa3b92b5de1e23bb759c281b102c8128053e311848ea83974e5c99e5567", + "virtualMarketId": "0x0a8df72f4de9281998f57d90942851f4a2600c041c072d7b058d217325b3d610", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x7DE8E1A1fbA845A330A6bD91118AfDA09610fB02": { + "isDisabled": "0xe4e9fa4a45216d90988c5606dc14f45b92f1d6b5b5cdd8e4c06c7f245ef2ee56", + "maxLongPoolAmount": "0x30e4fd9d3fcc59a7772de2fd8d23c86b39926a6801d36edb0c270b2161ed1aec", + "maxShortPoolAmount": "0x8a414c56d4b3d487e18be6cf6ef7e942080e1b822d601511fa87a0e2325dbb88", + "maxLongPoolUsdForDeposit": "0x295a953c777d120febbcbc87af83072d6504b091de3ab4ebdd8cfdae4489f4c9", + "maxShortPoolUsdForDeposit": "0x308371b6da9be4802b977d1b404741fb1da2b96f72eb8651e291c686a0476869", + "longPoolAmountAdjustment": "0xdd19916d28bfe8203811341677c01212cb6d1d154d6d4a69fc6962da3e94c3d8", + "shortPoolAmountAdjustment": "0x2a55e5ad31e305a7e94028efaba44a970dcb0ccbaad2a8b9f9fab51f984ba162", + "reserveFactorLong": "0x500250b31c8be66f652ed4fc1eda3c0bdfe08c6bf69cbee8a8a00e51d1f3eb6c", + "reserveFactorShort": "0xf99bde5fc23f7c5d7106bc811944645305d4106b98b780030dfece42b8d12d7b", + "openInterestReserveFactorLong": "0x85ebe3489e41e91ba4a992c33653b2a1464cbb3e8b03bed5bc2e4cd8abf69aee", + "openInterestReserveFactorShort": "0x21434fee79b05788ff4e4b04ff924d91180ab559e4b2ef4cfb915c72f5adc0ea", + "maxOpenInterestLong": "0x7b59f78dc3c310b3ffd452c57eb88b2aa582a8c82a9eafae7e2bd5df8e56af9a", + "maxOpenInterestShort": "0x0a6b269f2fd3513f9786be3786de609a36ae21ec95e9e1141327c830a2612057", + "minPositionImpactPoolAmount": "0x9ab800347948084166ef8a9d65c8a52ab99bb2e15869e5a11ad37ef9f6fc60c7", + "positionImpactPoolDistributionRate": "0x2addeb4e94a24c6c3bf0916ec01e5a0571adb1e35069623bc0a60eb8fce75489", + "borrowingFactorLong": "0x71aab16d662e1795973280aa7bb07fe678bb86a633e5966d3c6103e4b7e19355", + "borrowingFactorShort": "0x3bbafbe4fc715079781c8a62dd586cedabd95bdd093d81bc30cedc66913e0396", + "borrowingExponentFactorLong": "0x7cab9cc8142282acda4b74d9844245bc27368bbf0bb7830c71735efc9c624a40", + "borrowingExponentFactorShort": "0x7fabdacd3efb8f440777d784f13325660de1a2235995ce554a38e9b76ca16789", + "fundingFactor": "0x879bf18dd2395512c08c597ff408d3aec828add330a6669999bd0b0780d51e78", + "fundingExponentFactor": "0x98ae127fbc084483b3d6d70c243e99872060e293bf4fcffa23e05a0d8d3cadda", + "fundingIncreaseFactorPerSecond": "0xb06b9e40fe85d226fe15e6aca2cd9b513d9f50b84697c3d5efe93353dbd47631", + "fundingDecreaseFactorPerSecond": "0x8262f5fad7fe4f754c4c5be9d2b6948797f893b29247fdf5f134cfe0b2fc81a5", + "thresholdForStableFunding": "0x0508da13a8400f6d51630cb75b84df5e7aee16eaddbed992b2c901edb95be5f7", + "thresholdForDecreaseFunding": "0x9046c5df3ac84beccc1098a28e3444e07915e746cd588c23bafe0888ce63d378", + "minFundingFactorPerSecond": "0x62fa20f05314e55543c7bca30021d4989d05821eb2de85c0ea0391c124cddd18", + "maxFundingFactorPerSecond": "0xa8772b6fe3e4bd1d145d63b633a14f0cc582e9e9e82d9f70afd965f3a00bcd03", + "maxPnlFactorForTradersLong": "0xc778833983adf3aa53bbacdea870efa89b5919c3541f7446c37fb4400a12a024", + "maxPnlFactorForTradersShort": "0xff7edb9cbc1b4d90d770d471c02a00bee32110e8343ec2fba13f34c52d474088", + "positionFeeFactorForPositiveImpact": "0x0d3420aa928b1da5f586478312c805f7ae21afe9e7baa721059122518ef67f63", + "positionFeeFactorForNegativeImpact": "0xd4ade9db9240512e1c696eb045235faf299ceac74180cf1a2027c662628aa3e0", + "positionImpactFactorPositive": "0x5ce30f4b82ba55df0e987029ded936711b6d1aff9a7aaad80a7edaf4eccd1603", + "positionImpactFactorNegative": "0x05bfa4d4d178163c174ca600f23edd2beacb6251cc497dae969209ba7a28d586", + "maxPositionImpactFactorPositive": "0x985a11ed1a8a61ba0836724b434483e8888ebbe9e30d8ac70cf036fc4e7685e0", + "maxPositionImpactFactorNegative": "0xb5d03aaa44f4e51f4b5735ce62f55c1a038c064d10f3dbec30b1594f2bc2b5bd", + "maxPositionImpactFactorForLiquidations": "0x26340ddf9e54bffb55bd5cb1470652d3b32960f41efa886140a723a2349d30ba", + "minCollateralFactor": "0x80cc450de3e38bf0842c74de08feef0c83bbd4bd5b057c6ce752db74e8fc2004", + "minCollateralFactorForOpenInterestLong": "0xf2505508b048b3a9f6cd5d4f0f28decb75a374a948a988d270c8da823ffd628d", + "minCollateralFactorForOpenInterestShort": "0xc3922e36cb2027c649f679b0f13d927854201b6e8c96cf50c664679c9ff837c1", + "positionImpactExponentFactor": "0x8d9148077d210c110220baff03e054b10b421a3f985a98fd1db1545c7318a3fa", + "swapFeeFactorForPositiveImpact": "0xef5f72f2eb9555a8148a2e1401958032aacc197c1da4022f0ec23590e253b6fa", + "swapFeeFactorForNegativeImpact": "0x95126626376b73774a4e8e523fb0db25be1726d1a0c5b08723b2efb6276b3561", + "swapImpactFactorPositive": "0xc131b1e245ee5a6f5be3d03064d8b0b6510fe566b50f6c0c7e65a42270eb68d0", + "swapImpactFactorNegative": "0x20f8d97e59061e27885e0d392886682d392172249b499132c6b686874c2353ed", + "swapImpactExponentFactor": "0xa8ce35d21abd4702c2a6e0dc32684d552eab6ec32667e545a36a4da5b5c3643a", + "virtualMarketId": "0x12d94e68f87fe646b48f6039c97a5869a30a9b85e2999f20b92a2d143cbeaa3b", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x2aE5c5Cd4843cf588AA8D1289894318130acc823": { + "isDisabled": "0xa112281b34c11778744642048fb0625b26db91ea5701aa629bbd496f80f272b8", + "maxLongPoolAmount": "0xfc6a98141db55be4895bc977b95e06927091e60557bed4625c1ad987f966bcb2", + "maxShortPoolAmount": "0xfb7c89a81c5a16dd534dfba4fdcfb0dfd505bfba1cd93017f43b118ae832add9", + "maxLongPoolUsdForDeposit": "0x36a5da3a9ff7c0e36420581b664a695908c2ea24c33e533274356f1790c94dd4", + "maxShortPoolUsdForDeposit": "0x39a0dd1b3a62bbaeaa409d231b2fc7acfd2a3b7d468f604eedb11d51b08318e9", + "longPoolAmountAdjustment": "0xceb97f365a708e666492827462b5d1992cfb8ed8fc38b4902225587ed64d482b", + "shortPoolAmountAdjustment": "0xc201bf04e1cfb3c28a23ad5ced1e59432920e4856ff5d11bf95c03eccb408ac4", + "reserveFactorLong": "0x9076bc8f3b3cd2e13f2ebac765f53a5dd696e4d30e92fd48e83873bc3159c2e3", + "reserveFactorShort": "0x9b73c8c0b6006722e300246d44f0bf1db66d83d0b67048a71ec8f3952315a7b7", + "openInterestReserveFactorLong": "0x4967e41d1a742d367ef9de80f9c0aca1f4b2dc16cad71cd566031cbeb6531fc8", + "openInterestReserveFactorShort": "0x0b82b7d609896f4539e9fedc263e0d8caac67db1f4580c27422648ca8dbc38da", + "maxOpenInterestLong": "0xd3e0ae42793489dcb8fe7c4cd3e6a838030aa83992acc1db321655122d9412e3", + "maxOpenInterestShort": "0x085d5319cf9a50ea315aac5571a79d539864ad12f2c1e6fd18f027d54c0b58f4", + "minPositionImpactPoolAmount": "0x6ef9ed5daa77f6b56152c6f9b904aae8229130b1c3eaf61b33afdfc4a97bbd17", + "positionImpactPoolDistributionRate": "0x5912da023dcb190ef25937e734d9ed14498befecac6c5b72eb45fc812b42e83a", + "borrowingFactorLong": "0x16b92f7bba3de8939ae5d29fa3b3bb8bff1159d24e2c320987ee620654f1d412", + "borrowingFactorShort": "0xc2a9a99d1c8f55f08b5462d33d2574e34f088bdb289011dc53ea94541dc7100c", + "borrowingExponentFactorLong": "0x68a56b559c47848a87df7f0c9d27f968930d893a3f12c8194e13058fac13d129", + "borrowingExponentFactorShort": "0xe59ee4db1fc481f77477f263e679805b22156ab619e5e8dc8e1ff8279c58115d", + "fundingFactor": "0x2660bb3b505bb8678b1bc7427915f8569fb471eb885945b5eeace456b6002c64", + "fundingExponentFactor": "0x221de93b11d83243c620533033defc57f6908ca2849b83dfbeda199623446f64", + "fundingIncreaseFactorPerSecond": "0xb20b0e492b2199293c6d57aaa3fe1bfafcabd3323ae91254a17e6c013577ded1", + "fundingDecreaseFactorPerSecond": "0x7e91f3270dac2cc79ac8c4bae7747dd52aabfddb334a1070ba937c98f700dea9", + "thresholdForStableFunding": "0xf099a1812ea6d48d70b1aa2c6eba3c314d6ec26711e743f174f16ef310382d43", + "thresholdForDecreaseFunding": "0x42ff2035807f8c3fce9fa7d2a13f027f6171bbc41af2daf74524e7adf4e697e4", + "minFundingFactorPerSecond": "0xb73acf684b82d6d526a2ae9bd91e54f0af26f05fe61db6b3ab64a4f17c434ae6", + "maxFundingFactorPerSecond": "0x8daecf054a29b3068ae7b310026a2cfc33b6d325a507d8f38600c0cd4533e22b", + "maxPnlFactorForTradersLong": "0x5b696c70bfe0b7b753a58b050c1701e8d0d2a17895c180b9436a9b9a00072830", + "maxPnlFactorForTradersShort": "0xb5d1ce491c48ca9730b200fd60aaf94f616beb58f1c082d860911c0a8f7e0ad7", + "positionFeeFactorForPositiveImpact": "0x9e7af6bbc811961fb58a5140293e936a7fc8e62662a854d73e063fab60dbb7a0", + "positionFeeFactorForNegativeImpact": "0xcdd1ad112670f69342d21f543b820df3250e6d0b243b1b8aefc8345b89abb2ab", + "positionImpactFactorPositive": "0x7fea51d79d1e76d3cb89da3577667440e794d696ec37d7fc5f7f921a8bbfe41b", + "positionImpactFactorNegative": "0x03008449d0e3cf33fed94b24e8e058423e91206a57cbdb0b0f228173099744da", + "maxPositionImpactFactorPositive": "0xae8761a60ec47c251789ab4ba75ff174152d05306b538265b50ed7906a9edb99", + "maxPositionImpactFactorNegative": "0x3c35a9293aae318368124f14e86c5967640ac6767c0edd9abb2830ff3cd4d534", + "maxPositionImpactFactorForLiquidations": "0xbb6d346ee918ea745aeb83d09af9be9a441249dd326421e57e19e0bfe338d10e", + "minCollateralFactor": "0xa5d93c751fd967d449430928a31c30b819fd3a1123a0e85297dd2a15e1975187", + "minCollateralFactorForOpenInterestLong": "0x4634662dada17c503986cce2faed9f7fc072f1051ebdd20db92b238c9f9ca03b", + "minCollateralFactorForOpenInterestShort": "0x55718911d60d30d9b398b5790a01cfd8f83b42419d8e02cfaea4d5187c3f4b5b", + "positionImpactExponentFactor": "0xa44af56cb9b277271d9b9a56b3650c87c94903e5f5405288258716550afa72f6", + "swapFeeFactorForPositiveImpact": "0xc4ba621aee7406ad5aee070791330082eca4849f02c5b02b28c722866a81e489", + "swapFeeFactorForNegativeImpact": "0x3a9540bbf96991551bb54d2f395b5549386da9efb15ea31bd2b2324ffeb59f1c", + "swapImpactFactorPositive": "0xa8ef70684dcb1134f6786ae9427f62a50b92c4aef310158cd0f006bd34075508", + "swapImpactFactorNegative": "0xbf74a7204ca3863044e31f33237488f15c51f51ce170161904e97f6076dc6f6c", + "swapImpactExponentFactor": "0x56e72f39cd45b35e0f8ccbe4c6b62a5952afde048a9fa2656d1e9ca3a67da094", + "virtualMarketId": "0xd28c03f1a6932a52a0bf127b7dbcf62a023ff7dca52d44151f419f6657a4bf07", + "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + }, + "0x89EB78679921499632fF16B1be3ee48295cfCD91": { + "isDisabled": "0xc6282401c18944f038f2ecf5d183b231c5ea0831e31f8a8439c1dc3dfcb3d165", + "maxLongPoolAmount": "0xd6248bb915da39fa588dfffbb085214f4eb5ed68e36f21837fb1c4f683a57e35", + "maxShortPoolAmount": "0x7945ae548f6c69cd8dc4eb8c10ce0e7ef5ce686ab5e57f3c30f83f6b5e477786", + "maxLongPoolUsdForDeposit": "0x1e89398e87f44d32fddfca1eb96979781452ea2a29bc786be0d13e8321a1314a", + "maxShortPoolUsdForDeposit": "0x149070ed3a374d05f811d12010ebfd3db295dc975cd0c1c1616025a4926590ec", + "longPoolAmountAdjustment": "0x707911daff2effcc542d098a4f54fd1921922bdadf196613e845883fa11ebcbb", + "shortPoolAmountAdjustment": "0xe5d08867ee39ec8c5cdf6b486d524333534d638fa7b6de1db6c1a92de6a76cf5", + "reserveFactorLong": "0x4e5b293f4ce2c2d27af2dfe4db6745525128dc458155f7451cf44a8a942109eb", + "reserveFactorShort": "0x7c42cca6a3574a8d43a219da9a4b3b7d699cdf80cc2e74f825b21eed97137687", + "openInterestReserveFactorLong": "0x6aa1c1d808a95d15f588c1458265a4e2e2dd6ec7043d902591ea1e54fdb484c3", + "openInterestReserveFactorShort": "0x79571cdd061ae8d86b19125b92ff1fca97cf98d5814bbeaa8786fd08a35cfd4d", + "maxOpenInterestLong": "0xc83f47ea30e52f9e5468653270ff260813d580db720be8804c093ee86904c5a1", + "maxOpenInterestShort": "0x25e3702a81dc0de55e9a5e7565b0d9850d2324b1028f2ee89b231557a3ec6516", + "minPositionImpactPoolAmount": "0x1b314b80bc7e4bbd05520ded26582940838f3c622f542782afd29fc79ca16ad9", + "positionImpactPoolDistributionRate": "0xd4f026a50c88c6cb44b8d782ad79a24d67fcb6fdcbf3c6289b64d04c750136cf", + "borrowingFactorLong": "0x59786a7b7c323fba5407d836f58a32203c477b177bbe173f081f81604e4f6208", + "borrowingFactorShort": "0xcec0dd0f05c9d43433cb1ddd67f936cead4926b55364eb2168ec72c553fc2d18", + "borrowingExponentFactorLong": "0xa3aae2750f50d1ed07733dc062f2354981739fa04b0308ed16a4b98f7e4f8e7f", + "borrowingExponentFactorShort": "0x0a625b7ba6484d25fe3f18db43fa40aadd0343de9753534afc009ddbec1d0e75", + "fundingFactor": "0x8e24f04cd57ea89a7240f3e11cafc11266d4abd0ffae277e6da42a189eeb3468", + "fundingExponentFactor": "0xd7c79790d637ff482ff95007cce6f63de19265945219f80bdba0246e9e3652cb", + "fundingIncreaseFactorPerSecond": "0xb9b3dcb359cdaf5c086826015fd6c0ae77257a8d1417fce2352ca916e49dd09b", + "fundingDecreaseFactorPerSecond": "0x1762a81246ee30b073058f7f2647de7cf1adf51fb1c4cbef8d8284cb496af38d", + "thresholdForStableFunding": "0xe8cf96efc87c2c2c2ad92854851c95733e64799fcddc72b979ef4314b01af2bb", + "thresholdForDecreaseFunding": "0xcad756978a78f3ca0cc149338eadd1ebbe9ab7b71584954fd3da134f7f974889", + "minFundingFactorPerSecond": "0xb117d7c812a64dc051549c1cd0a32d1a7a7981dcc32d285f843c66e898e422eb", + "maxFundingFactorPerSecond": "0x9fe2c3a88553e6c8f1a937d605937e19ea8b8d768dfab0313ad6b0c4b727ed25", + "maxPnlFactorForTradersLong": "0xefd0786c97fd0c1e5efe12c265540afe49357b5ce9410f203116ef97dfcbabaa", + "maxPnlFactorForTradersShort": "0xef485852c8c3ee8c55de7e52d063da274901d0045a61839f7a8ffb2edee2037e", + "positionFeeFactorForPositiveImpact": "0xbbedf3f173f1ef4c451104ab8d9e85c4a8668255fd6383313da5e39c7e3fdf8b", + "positionFeeFactorForNegativeImpact": "0x2ef8737317c51e79612d985e398958d73119e5a3d176530ac7b67a2008c9176a", + "positionImpactFactorPositive": "0x46205b42a73fde3057a08e8a43372557878909432252cf53a39eb8b568acd1e1", + "positionImpactFactorNegative": "0x3fbbd6e4687059e8cd17798661898c1e6ac18c15305a69cba17f6aadb716996d", + "maxPositionImpactFactorPositive": "0x09ab49987e86f02b3648e2765ed1d4d25bd1b0112530f62e0a33b726318fa816", + "maxPositionImpactFactorNegative": "0x35f4914c65363c6934dbb5398de816f6e5ff326bb435026c981067b9481850d9", + "maxPositionImpactFactorForLiquidations": "0x7922e33897dbbe67d00e7d6d23a286eb854b047a28ebc0809460232346fda898", + "minCollateralFactor": "0x57bc7d6117c01150e63f7d6376a598ee76432123b0a8f097c2b2e3acf36805c2", + "minCollateralFactorForOpenInterestLong": "0xb2a7bec849de6c6b7a38d4d561e876a210dbebde36c0a50dc37aad9083f73647", + "minCollateralFactorForOpenInterestShort": "0x08927937fa841003e009e8b483a7c0c26168f27b686c4bd9d2d6df5e5a0ceca5", + "positionImpactExponentFactor": "0xcfcb8341caceb9af4665161bc4a5585b88134830d36019917b0cc166b439155a", + "swapFeeFactorForPositiveImpact": "0xd18573dc8f2a53bf9106216a900f943172999abf8f4b78c32a02ffb16fc9bb1e", + "swapFeeFactorForNegativeImpact": "0x6c9413f2853edd95a6752ced7c2bc05d4a59510e00f373d505f141630abbc5e8", + "swapImpactFactorPositive": "0x0466561a2291ccd4142344bd5609995bd96af67dda47cc7c6477b160d5fa60a4", + "swapImpactFactorNegative": "0x463b2d08a99a0fbee14d053a2dbb048bf69fea6fa054f72852401d083cff1e33", + "swapImpactExponentFactor": "0xca5db13289c957c3b79f07e49d87b20546ef63217ec61a192141de7e9e0663f5", + "virtualMarketId": "0x9bfab2b19467f690a2c7d7a2ff79f023153dbf5544a93501c14c5936fcd75632", + "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f", + "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960" + } + }, + "43113": { + "0xD996ff47A1F763E1e55415BC4437c59292D1F415": { + "isDisabled": "0xaa6d8208f5518bb575df6bf378b76ca320a96952160ee5544406850512254676", + "maxLongPoolAmount": "0x7d98ea2f7639278b931db6fa37be33e26dfdfe1472d97aa95050d2f0dde536aa", + "maxShortPoolAmount": "0x44630fa5d5c083995307eb4e511374be8eb3681fb47659637f5d47084c9f0fe0", + "maxLongPoolUsdForDeposit": "0x3c382f71e9e0cde61d1a3ef465ece64c438eef564dd9ad2991fa364b1fe59448", + "maxShortPoolUsdForDeposit": "0xb9425baf97cae56d24eace541f53118601642821221107e564568ecbf09184ba", + "longPoolAmountAdjustment": "0xfbb2742785fdaede3abee57c2e0f553f9200ba41b2548a450edc6782b0c21537", + "shortPoolAmountAdjustment": "0x4be90e5cab76b40146e60fb7a4883d8970207086cc810611c51c67b4b18095aa", + "reserveFactorLong": "0xdaa590cd4f8986624d5f6ab46eb611270e4aaa5b9eda91c0a2ecf35b382093af", + "reserveFactorShort": "0x3b28007f1fefc8345745ad01db9423ea4ebdb56c68b71c6da73d1accb50f317c", + "openInterestReserveFactorLong": "0x14185ce19e572458d85ebba467127ba7d0ef06c3694d3f3aa85c588bd7369553", + "openInterestReserveFactorShort": "0xe2f7397b6b78d2e32fe571b0cb1d0205456f80f6117bca303d4debdc37639c63", + "maxOpenInterestLong": "0x45a158ab5b540497ef10766b4b8e04a10002e9fd417c42c8ac7b423589939795", + "maxOpenInterestShort": "0x4c303d2bde1242432f575e80719307e6321447444810464f8df0c37c048f226f", + "minPositionImpactPoolAmount": "0x65a21077ccc43dd7a48d2c927894a3d0f2d92c44b6acfaf729c15bba8315bbe3", + "positionImpactPoolDistributionRate": "0xc5bac903008b32a71846d75abb8bc593d46e711b5933101da150fa9221566acf", + "borrowingFactorLong": "0xa3972902f00a40e810e92620d709b3b2d9920324016401b8ac8371fbf6908d0d", + "borrowingFactorShort": "0xdc6e1bf57fc64d0d7a2d6fc72752ca0552ca23a7ce6dede4a5c4720e6a746b89", + "borrowingExponentFactorLong": "0x12bfca385537e7d7d75247d12c9b726fd6110323863bd13ea5bc1c8f9fefdbb9", + "borrowingExponentFactorShort": "0x79f80b536ac405159ad8495d3953b7219eea1564d3c2fc3077091457c453fcd2", + "fundingFactor": "0x58d34b486145469f940ef20c3fbb14c632f250f708d9f0aaa554de79ff554dce", + "fundingExponentFactor": "0xf2bb557f4797a26c915f57d36a58d86b305fe93eb641a9dd89f7d9a70100519b", + "fundingIncreaseFactorPerSecond": "0x45ef72281517b86809558ad8f6d5396f92a954003c23db79e736f19c8fa1b62f", + "fundingDecreaseFactorPerSecond": "0x17bb3a86d105baaef7f0fbde6581a38f1dd1a059dc448ac28d00c4c1f6cb743f", + "thresholdForStableFunding": "0xf09beac56ae168985a325b56226ec69f376e4fb0a3550fb124f0163aa5f4154b", + "thresholdForDecreaseFunding": "0x9d95210c10b79d348136267edd3d9a42c97cf2424ec7fe031212841e93ecc08e", + "minFundingFactorPerSecond": "0x58e18f829134545687ff636051167eae5046da78b8389a85ce7ad24168540884", + "maxFundingFactorPerSecond": "0xd1fc06210a074798a3d8507eaf9f700de175c23098526798515da3d093ae3644", + "maxPnlFactorForTradersLong": "0x36decf951766da747b2bb875b646c43c9f4548d1db9bd2983230b1cef12460b1", + "maxPnlFactorForTradersShort": "0xad102f8399fa1b92ae45845f95f896d5bf61d8b53e3904b35d0bca50f2d16de9", + "positionFeeFactorForPositiveImpact": "0xebf23a62b9be6bd236fe83a4a7cdaf4a0f22063071a2045354032286b1d0c088", + "positionFeeFactorForNegativeImpact": "0xeb54a7af740d7a9353478e56d3482cd29b9c3afaae2669b1a47ccbc6ae975b96", + "positionImpactFactorPositive": "0xddf60db455866355beb69621cc530e07d254c81adc27b15a564d05b388f5ee2f", + "positionImpactFactorNegative": "0x456efec2eb744a5ec841bd0d4b515de7274f1ca8557472a4de5c42508c4efef2", + "maxPositionImpactFactorPositive": "0x3be668a8c7be13b0a349732303c4b95a907bd0e9668a4bbec4dc3f1ed5e7c2bc", + "maxPositionImpactFactorNegative": "0xd8d979478a3b8bceafa8a848b25784dd00b64bef081c4c1dc9dd60bff7cea798", + "maxPositionImpactFactorForLiquidations": "0xbbfe96bfe46f446d24be78d7bd2edd34334294e89048f8882360bb743584cf7f", + "minCollateralFactor": "0xe910b1cb7c36fa1e005d1ce213e744ebb8e19c07f0e934605fb998fb518ec4c0", + "minCollateralFactorForOpenInterestLong": "0x3a15736cf99d0f99680260b5422bc87fd69925adbb1387bf7048191f19cab935", + "minCollateralFactorForOpenInterestShort": "0xcf4ade53abb36ffbad4b0f4ae1379faa82afa998f3a47875c9986f82cedd274b", + "positionImpactExponentFactor": "0x376b7203a91e73beffcee3efd325eb4e5f07101811d7f211fc36009ca3c95b91", + "swapFeeFactorForPositiveImpact": "0x0f8107aaf93b9fe210573d13194d9f77eaceb15b8771c42c821a0046b76f94d0", + "swapFeeFactorForNegativeImpact": "0xc6659dc00cc2d64bc22cd4217267efab7bd990328add0b4bc154feee535e0c6d", + "swapImpactFactorPositive": "0x915a610544b2e035a83207d2f281b51c24cd0d652142267d6d4eb3690a449afe", + "swapImpactFactorNegative": "0xf38fd5205d6308e37a289083eb9bf290becf831331de85ae14d6b8e2c0d9c839", + "swapImpactExponentFactor": "0x9762e6daac9702ee4052c875bf12c8c18afc24669a6373f713b6d5f3b2988a4e", + "virtualMarketId": "0xa40b31b9a01422e45d08c3d561f062dbfb67d96188136b0ee46c5337855ac5cb", + "virtualLongTokenId": "0x9ed6fdb2c97b9163ca317ca8473fb94090ec4a9ffe05873e5f5c7c1a9635a4a2", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0xbf338a6C595f06B7Cfff2FA8c958d49201466374": { + "isDisabled": "0x65d55cf63607d4ca48baeee706a12cb4a2a1a1145601ddec3e69ceecdf3b6ecf", + "maxLongPoolAmount": "0xe41a551b402a99a4ed16a91f03fda8759941728c836a80d59da7c2cf4636f110", + "maxShortPoolAmount": "0x16b67511f143d0e1f102221fa69ed28480fdb5df7ae0f0eb03ddfef54f16a7f2", + "maxLongPoolUsdForDeposit": "0xd82bd1478b369050f2281c0855c43cf386d12972cbd0973b52e896b1f1646872", + "maxShortPoolUsdForDeposit": "0x4fa317a09cd123c22503eb8703b7ef6415a7393e2ef84c202ae091844d3d85f8", + "longPoolAmountAdjustment": "0xc6133b07c95d1cf379c29a4f30041c12479ce5a34aa09140b6a4a4c2606220d2", + "shortPoolAmountAdjustment": "0x980f5fb209239613e3a66cedf7a56d4d11c59241000368c43d7eec4494b0ee16", + "reserveFactorLong": "0x11d484baedd77a99cea8e16f616058386696edb29833947f4405c66924781f16", + "reserveFactorShort": "0x516b521f2987f42eb4ae7c40f93f56c03f58d2a2b68e259ff2ef34694962d69b", + "openInterestReserveFactorLong": "0x08d2e6d1ecaeb61b7651da137e010adca74cf2c1ba5b660d85658d843af45791", + "openInterestReserveFactorShort": "0x9bb648dfb099b26de9769c805e77dcb7e523753acc3d986251aa7e3004039ce4", + "maxOpenInterestLong": "0xf8de3855b3dca80f5a2a3dc277166a9328a5c6376695060750c8986c4bd54dd3", + "maxOpenInterestShort": "0x33cc0c84e5d05460363dbddad3acddc8a0ffbd32a8bcfd66c7a05569320c31d8", + "minPositionImpactPoolAmount": "0x6716e89098eb086ac7143d180eee1cba05c14a27c91f880a2f1adb5130b67d44", + "positionImpactPoolDistributionRate": "0xf3dd3ddcc418355b063111d552194e85ae36401fa38d867e4c21da1e47e6fd4d", + "borrowingFactorLong": "0xfa70609a3d7bb943d0dda9d1acaecce158150312657799a0b31896df6ed8dbb5", + "borrowingFactorShort": "0xf8d6060c68e6035d3e97e86b9f31031b7b01565e5ee3fdacc817581d4da17b99", + "borrowingExponentFactorLong": "0x74ba7c3f4a008447ad5921a77ae8be43556bf7f4c27e0cdf49e540d2d7beee88", + "borrowingExponentFactorShort": "0x148cac49f77c0689aa39124cb4746040479d04a43b9129052bc7594df9d1297b", + "fundingFactor": "0xbfb75097bc95c63649479aa6c44a12b7fed8ba0cb77f18f9098ead5fae76728f", + "fundingExponentFactor": "0x64a61bb7d208feb87d0f91ef0ed07ec9ec450e84e9a53d6621ee154b01f78456", + "fundingIncreaseFactorPerSecond": "0xed5a97a8ff6b76bddbc5cf2e46c9de32e755a731f6c2884caf654125ca87f6c8", + "fundingDecreaseFactorPerSecond": "0x0f6bc55beec76484dc48b996a4523e371fc11d3386364aae521d1b8a4a9d647f", + "thresholdForStableFunding": "0x8ebcaf193a99adbac93c26a51504a0bae308ebfbdf118635596bde18973ed18a", + "thresholdForDecreaseFunding": "0x7678d72a9d00e820d80791094fd8219adf2172981ce24108b4f2d4a9c68827df", + "minFundingFactorPerSecond": "0xf9618d8fdd371bb9ceb7f4a97f72c279c7926a7c9456025cea6de47bbfde71f5", + "maxFundingFactorPerSecond": "0xb91853fc411f43eb24c1a9cb597ea51291798489477cf5983c01a385db812d62", + "maxPnlFactorForTradersLong": "0x8d750459295a168d231d34ac38231e1d2ba6dfa008a6d164ff6a72509d095f4c", + "maxPnlFactorForTradersShort": "0xdf531b55429ddeadb59af967cb730b299076d579cdb25bb1cf017a0326f4284e", + "positionFeeFactorForPositiveImpact": "0x0d325124b70072382ae96a7cd97da4d8a5a51f68468d67f742addfcf4a4f669a", + "positionFeeFactorForNegativeImpact": "0x6fa4e6c42336bf8f1d32bb48964ba1c24df421fd3d1072a63b1528b2a8a4b609", + "positionImpactFactorPositive": "0xc3112e11103bfb1a728062fd6fb789086df6e7819d99cadc56161673ec2f5747", + "positionImpactFactorNegative": "0xbcaa544b510afd8e66299f43b2457e58d68d5ee44a0e71314a9c54ccda29166b", + "maxPositionImpactFactorPositive": "0x885c542053b7fa77c9a4a2dc267dcb133edcfafd7c93d3e34b3aaaeb84d71e15", + "maxPositionImpactFactorNegative": "0x6a5409f88cb735d2e2ff70cc0c5738c19422c5543034d1bfc997cb4e8e0ff913", + "maxPositionImpactFactorForLiquidations": "0xb6f88dc723473750a0b961170270d31fba437679f22bfde4b267a55325fa5f57", + "minCollateralFactor": "0x2bda0f19bd0a9c7a0bf9e89a4b1bcf0d06949d290d084f094d1f2daa73890e18", + "minCollateralFactorForOpenInterestLong": "0x6cf8feab7ea0d8a785b057c390baee97be69e93f87bd3b5ef1b32522ade977e0", + "minCollateralFactorForOpenInterestShort": "0x0b5cf2a96425f12b6771217757ad7d3eef0e1a618e0d28884219088615a51649", + "positionImpactExponentFactor": "0x54962ade4b4aac31514ded3d1b37063c949d3579f0ffb707be0d92b66cb3279b", + "swapFeeFactorForPositiveImpact": "0x620fd8da66402524c473af3d4496c67b9d787ee9a73d0b1ebc33c2ca501999c8", + "swapFeeFactorForNegativeImpact": "0x8b76d4be7c26e5330ccd659b7b84869b2521aee30ad02c0f64dde54d33ba740a", + "swapImpactFactorPositive": "0xa6ac9172d7f7529d6a77a02977721eee7008f596226749c98b3cd137f49b0309", + "swapImpactFactorNegative": "0xcbd4c14cf1648fdf9f19d309a2d11d4ac497544d25f3a913d864cb326abcf08b", + "swapImpactExponentFactor": "0x4f79dda5d67fa79de75a32bbb31b26de722b1282d3e32860aaf16aebf440459d", + "virtualMarketId": "0xadd9722dd1c6cea4b2cc277e2966f1b2d03b3e4d50cc598ca78869fe75ddd533", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0xDdF708B284C5C26BE67Adf9C51DFa935b5035bF8": { + "isDisabled": "0xc9989149bc4457f2ca4464bcb66519f58f4a9988c9700158950534c048052257", + "maxLongPoolAmount": "0x7d3206897e5ea06e717ca2f7ff3f46b4451718ac5b9738a22bbb338cc62b0327", + "maxShortPoolAmount": "0x136d61fe4080e805e09b3aa3792428f02a67fa588fd379c1fb7442e1c1a1cd9f", + "maxLongPoolUsdForDeposit": "0xaae75c711f42022d91d34ebc08a9a40645cfecfd0fbf618549bf3f640a5842f8", + "maxShortPoolUsdForDeposit": "0xd521e39583719ca6e281b4578ebef0df7f40698691f22a9365247e0369c2697b", + "longPoolAmountAdjustment": "0x646ed4749ef962bf35749f47d8a4dd396e7b9e3d4d2d6a6c422ff228b94da0d4", + "shortPoolAmountAdjustment": "0x961d6e9b5e3d510d485b78e398d9e6e21fac2a36a2b3a69a7e33c9425be94918", + "reserveFactorLong": "0x460d17ecd760ffb06dfe59433a915ee0d9a94deee52c16332e92164c258d8887", + "reserveFactorShort": "0x3db62a6245ed8110a2e6090183a3a5bb808fb33ae3e3b153816e484b91991a4b", + "openInterestReserveFactorLong": "0x18503bb67bfeeaaf6f315a430d531bb8bd8c649bb1d87f93142350aed23caf43", + "openInterestReserveFactorShort": "0xd6f62e391e343b8cd049d00c451828b8edb0a34c19c27a3cafbc49dd2ec906e1", + "maxOpenInterestLong": "0xf76792f5349c4218239e6cdc892d7c4294ba005fccd850302e966fd6146d7361", + "maxOpenInterestShort": "0xaabb56cb07e6b4c29c47ea07b070653a3241ebf0abc89a9fa49fcad2d7aee4e7", + "minPositionImpactPoolAmount": "0x2dc330f67ab9df9112a4c10ff16fa2ad1137b7d2a6d8e0e85f07e77c65b4bc26", + "positionImpactPoolDistributionRate": "0x431c60fbd69ee696d6bf7d3592cc67431fba6a291ebe5c35a67b6278b721e74b", + "borrowingFactorLong": "0x757ff0fc19f3776aed07618eb3c339807771598950b1e404700e49112ef5c0d3", + "borrowingFactorShort": "0x9a05a99d6ed9ad7c8993fc16d0cb8b5a1a52b42e12a5c91ff470ebbb300861b2", + "borrowingExponentFactorLong": "0x928227b25da23cd9e2ffa2eea29fde0937fc4b72d32ea05d6dca7c0edb621e9b", + "borrowingExponentFactorShort": "0xeb0f01d72ed09c90e3c58c142d23cf0e37ad821fa3d2e4ea0bd3ee0892cd3f7c", + "fundingFactor": "0xe96d56536feefbc74d819c8b3582382133f60fac926136f2ea9d6e031f7ad2b0", + "fundingExponentFactor": "0x3140b16bf1e818ada0254b2631f4ce6ff586512489ce550878bcccbb2c1d56d0", + "fundingIncreaseFactorPerSecond": "0x569c52b34ffbba3f230d9fe7bb3a28ee2b85f1613af59adf4fe3ef6fbd0aa82e", + "fundingDecreaseFactorPerSecond": "0x7ab1fd6b439af449a57b63d0b1e420d836af62d8131bdb9d84ca785a6dcffff4", + "thresholdForStableFunding": "0xcd0bd0e3072d742bf5650e3c3c7accb386e75b72ec258f82069c0af60abd5ebd", + "thresholdForDecreaseFunding": "0x827a855456d109cc19e7aad83ab4222d25255f5de87cca963878c13dfb701195", + "minFundingFactorPerSecond": "0x508d83ef2e31c37a52e6ac6e44d4ff2ccf7d5c1f98b86ac9655240e9b6bfae4c", + "maxFundingFactorPerSecond": "0x2830ae0739c9163de9cf708a6f6c32f662f2ad071c3499e9b12c675056298d40", + "maxPnlFactorForTradersLong": "0x36fcc2dbb30808ebaad7f8c9a844eb1b4689f9a62d90e552adbbe4343dfebdf1", + "maxPnlFactorForTradersShort": "0x3d08433ff57f425f4721425d4315941b31adf3f673530845a92056ba70004ace", + "positionFeeFactorForPositiveImpact": "0xac00be90a0f05763ef66e50ae8ca9e0ff056b82fac3f307ce8a14e91af0899c4", + "positionFeeFactorForNegativeImpact": "0x1a3121c3ff93d3120708ecebb47afb56c49c4c1363ea731e7b0bb8a2e228d1dd", + "positionImpactFactorPositive": "0x850a0dee7de0bfcf04be51d47c2f3668bc4fdaab5e29e2d589984376b5dd86ff", + "positionImpactFactorNegative": "0xb9e817b94ea5ac97ad5125913ad2807a275718730c2498740fc9c888d6b43a03", + "maxPositionImpactFactorPositive": "0x06870bc32614718b265349bf6300294056628d60ca10f5d35c63998d55a41f8a", + "maxPositionImpactFactorNegative": "0xe68bf971e0e02267b79e78933811a5fcbb67012ffb373f57d08e6053bf50d2eb", + "maxPositionImpactFactorForLiquidations": "0xda655d82bdfac7f52574b69be3faba4684029b4f692b4d6e9a27e9ed0db5eb18", + "minCollateralFactor": "0x45d92c625d74a031ce8338d168d2ec1699f338ca8669ad7f210c98ef9461bc43", + "minCollateralFactorForOpenInterestLong": "0xff9fe8e3365a18b999251316da505a550055626be033cf34378f1afd550a4f5b", + "minCollateralFactorForOpenInterestShort": "0x770be0a07523fcc86290097d7261ec89c9c2e6b811a5abde348eec9b6afb5bf8", + "positionImpactExponentFactor": "0xc64593f64cf0192c99b011e0843ca58075f1d4b6dbc285f91e812aef624b75f3", + "swapFeeFactorForPositiveImpact": "0x4ef7984fde2237fdd6c76d410cd45733e29a8208a1a444d416a4cf2c552455e2", + "swapFeeFactorForNegativeImpact": "0xe14d026478c114bfabffde611c4387b3c1ec943f2fc6b1304d98755239ac4946", + "swapImpactFactorPositive": "0x4b1439a3ac79073d516183f0266a7545a2d55413d776d8837dbba0d3238f3744", + "swapImpactFactorNegative": "0x15e3223c9f47dc35339b9fcc3a24b9984db33d7a74d7e949f62e3f082f005e20", + "swapImpactExponentFactor": "0xe8bfbaf25ed510be1d648f3cfc47f80928dcce48b8e3de792bcce21079984ee6", + "virtualMarketId": "0xda53e89b74c9a98f95f79f47378029e3e834e1f8ec6f9802f85e7355e2de0d95", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0xe28323955C05B75E25B56C1c996C1354Eb5Aa13D": { + "isDisabled": "0x7a841e09782f3de8e7726244c2ea1d9b4342d86347abcb4f907de15f2305d8df", + "maxLongPoolAmount": "0x3eb46f37e14421ddf480a6cdfd5417a68936ff6bfad0e41d92dff7459271c149", + "maxShortPoolAmount": "0x3eb46f37e14421ddf480a6cdfd5417a68936ff6bfad0e41d92dff7459271c149", + "maxLongPoolUsdForDeposit": "0x829cf781c1cd9e1da6914abd9f99f40ab11117ef46fb6150e347a09d7c5cf87f", + "maxShortPoolUsdForDeposit": "0x829cf781c1cd9e1da6914abd9f99f40ab11117ef46fb6150e347a09d7c5cf87f", + "longPoolAmountAdjustment": "0xecc5ed201011d3de950fb42ec5f55d874a137e880b5afd6808208ee29f4285ed", + "shortPoolAmountAdjustment": "0xecc5ed201011d3de950fb42ec5f55d874a137e880b5afd6808208ee29f4285ed", + "reserveFactorLong": "0xc29df4e6e9a08cf4a3d62a7adafa0ee23d05853c519599bf7e76e8ea2b5c314c", + "reserveFactorShort": "0x80fed72cd59f82f7e20fd2c5baff0a857dd44b634b09cbc89745308afa8389db", + "openInterestReserveFactorLong": "0x7cabba2a6613a79a3edca7aa08c1f951653ff90bd2f1582595e6bbd603e09203", + "openInterestReserveFactorShort": "0x4df057fd32f4d0c26eee81b03afd0aa6b6b3acf51ea750299485f5464ec1fbba", + "maxOpenInterestLong": "0x3e6a1e8bcddc22c16f5b7175afb28aab456927b357ec0603b775e99843c1c6b1", + "maxOpenInterestShort": "0x69cbee6ab70cf097d821eaa10b9626a378de5736ac384bfcbd2f55a8d68fd8c0", + "minPositionImpactPoolAmount": "0x5964f91d8f6d0d653b8a36523a4fd8245261cf9408452807ebb3dcbd1e3d91d5", + "positionImpactPoolDistributionRate": "0x7453d763d51b0f0d6c585062ffbf05004d3ce052d31f80d1e0817b015a4a3ccc", + "borrowingFactorLong": "0xfc2603f5e735c0a90532707ae24fe8e35224c444c45117b1f6470a99090cd8da", + "borrowingFactorShort": "0x00bf1aecbd28cba84ea90dc43769f598af2ab45a61a4ce669fa9516047347a84", + "borrowingExponentFactorLong": "0xe8b98d62d250a82fe7a59c8dd90c596b7d685886d1ac403e3754d3c0b47e3471", + "borrowingExponentFactorShort": "0x1f677288ca599df4cd5ef9a20d3ae631017749c14ef066d64b38482bda41ac5b", + "fundingFactor": "0x3c72969d17be8ae710e5f12e4de2f3bfa9a147171a55987dd200c93a6bdb99cc", + "fundingExponentFactor": "0x4ee83448b2b4cd5843b8e5820cf25b993c93ec79174d5cf8a555760baf02835d", + "fundingIncreaseFactorPerSecond": "0xf1ac496968301ae90f8ad81a934edaf301cb2d23b80f22c5992cc59491aa4f41", + "fundingDecreaseFactorPerSecond": "0xc0e505882135b027f78a1ab73fb37f68977088de4c7316a35e87c092342de03d", + "thresholdForStableFunding": "0xe8cb05b1657a3bfe044caf82d61ec4bc5a5ea660f9080829a5645ccbfd1ad9c4", + "thresholdForDecreaseFunding": "0xdf3698bc92c6b3f1e1bfa62cc79124b3cf9d917592998564c3a5f257643d9059", + "minFundingFactorPerSecond": "0x9fe504a97fab6267d73adb33eb7736c9d141c982f2087a029deaa7e2fa034a4a", + "maxFundingFactorPerSecond": "0x2c064f54afa3c1d6d05b856843db27379f139cb7e88aa826aba60051b5a0c9bf", + "maxPnlFactorForTradersLong": "0xa8005a0f060de7da9b23e9af19cfef87a6e232331d9f356a74ac63f8df764658", + "maxPnlFactorForTradersShort": "0xc532b70d99e867d7eb5cb21b12c09a281e800f89ef7a7477438017caec63b4db", + "positionFeeFactorForPositiveImpact": "0xf44b4bd2efe1f90144b6e87f9f83928ff11876ba474225b551b9728f684be6d7", + "positionFeeFactorForNegativeImpact": "0x3f12c9cb349f4feec74d2fcbdfff7757fe630c8d65b95af0f23dd5a01cbf7f14", + "positionImpactFactorPositive": "0xe7e37a77797c58eed5479a474355840c4b068f56e66f1fd356518754d41e8d71", + "positionImpactFactorNegative": "0xaea38fd5a23fbdf8e436805ba7d16709b9587de0e613614a27e241159c532cc3", + "maxPositionImpactFactorPositive": "0xe58eaeb5cb769661e5812ed30888816663d04e418a2a2294a60dc183998bc24d", + "maxPositionImpactFactorNegative": "0xbdf2714c7cee0ba4bc78512846368491218658bf4506af2c0a5560c5d2ccb98b", + "maxPositionImpactFactorForLiquidations": "0xb0ea1a8a442d94107fa9d601c8fe41c3071a4f6a212f6ee8cf5d2f3af03af9f3", + "minCollateralFactor": "0xbaaa90a41b92be436a5c13d02137ab4d1da57a1256942b29ff1122f4ae3910ee", + "minCollateralFactorForOpenInterestLong": "0x8cbab030e059e5061c5844541de54fd884103976d5748b1afc27800eb6956781", + "minCollateralFactorForOpenInterestShort": "0x964f5425e2d87724d0e98f792e7d202ad30cd08d5b28a305041ef1365fd64c24", + "positionImpactExponentFactor": "0x1a4921b5ca5088e7e780e76a9b8c2cae1f8c46ad9238eecd0677d65eeb88c8a1", + "swapFeeFactorForPositiveImpact": "0x6f04144bb368e6acb012e2a47ebfe5802a7aeb1a89c990f21c1c805091c45e74", + "swapFeeFactorForNegativeImpact": "0x62632c19dc73e4144e7d5c11add032ee54ca6c78c5bf178800e5fc530e3f6c5a", + "swapImpactFactorPositive": "0x0b7287e535216c5171cff8248a990ebfd8cff085af5f7b8d599679ad5642795f", + "swapImpactFactorNegative": "0x2a313049a3fcf67138a26bc513f4c9fdd1b9585276633b01dd5de9092ab96423", + "swapImpactExponentFactor": "0x3f4613e8874352a37ea67ac77a3d73f85f46d1096e67f9ab6e6003f28bff3ca3", + "virtualMarketId": "0x74ad5c27fb248f871bb15fd43edde411d458427fe8910c5e072faeb19dc946dd", + "virtualLongTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0x79E6e0E454dE82fA98c02dB012a2A69103630B07": { + "isDisabled": "0x5371713d0dafdf81e75cfb132f425a731f8a321d0fc884880230c93d10b89c8f", + "maxLongPoolAmount": "0x9137ad69be95bf081c63e6d38ba5e8a480f06f91401ed476bcacad79392e94c5", + "maxShortPoolAmount": "0x5fd99b3c855f1fa93572b75c823e8f297d04c7b77b1498612959078ea051908b", + "maxLongPoolUsdForDeposit": "0x50f956592bf01608aa711fa7d545ab5b8668ac441fc37c357443a22b1befc938", + "maxShortPoolUsdForDeposit": "0x996877ee0d696e9d0a7e15c32ed26733454b092026ee7cfa96e3c5e7e05f6583", + "longPoolAmountAdjustment": "0xb83d50fa0a5a89d58bc7951014a64c869c3d22d962647eb1a57edf13489b1ac5", + "shortPoolAmountAdjustment": "0xbbd3ffd81fb11c3c726eeba06d80aa51e1cd320a03f72eaf4a6cecc1cea45769", + "reserveFactorLong": "0xec489f58be7fad56494387415a7b47b49844bf5c10956bcaae915f8e54e960d9", + "reserveFactorShort": "0xd9ba40720349eaaaace6e4a720ffbebcec58b3dba451d609054e2a5a7e9c9658", + "openInterestReserveFactorLong": "0x92767f35f9631f8552da59fe790b1e4fecc5cd5da745726a881f02b1ada8e59c", + "openInterestReserveFactorShort": "0xc547ce8b4517b2708aa8c56b4fd95731946fbf9aeac7caf2ff77f6d3136e6841", + "maxOpenInterestLong": "0xea80a5c10e24ccacc9f06d38f76c3db4e53e31939c8ff8e70cb2245444fb1999", + "maxOpenInterestShort": "0x28917c5093ccf6761ad4b6c84036ebb48381f6f5d1c84f59eafb00d089a39aaa", + "minPositionImpactPoolAmount": "0xa0547b5f88b0065d7516a31e408fdeb28f01735107d4ed62663b897c05e7cc2b", + "positionImpactPoolDistributionRate": "0x765697b5cdcc370330ba7cb4f02320c3731644e20b3dec038405658d8b9e33c4", + "borrowingFactorLong": "0x7af893307bac9944792f18798c02cd302f462b828e0e1482ca7ce623430913ba", + "borrowingFactorShort": "0xefbbff71d58d55ddde35960b10599dd3cbea43bbc7758dd19ef2b165fe1d6a47", + "borrowingExponentFactorLong": "0x5c0c94e7380d0af3a1a26ae745675e5fa8395fd7f5153794afbd23364e0e3d07", + "borrowingExponentFactorShort": "0x5cc04532070ed4ae189c79958c57dc94569aa0a54083685c6f3ce4c303dba185", + "fundingFactor": "0x945089d7e2da1094343670c986b57aeccd3a0c67c3e191692be538405fd082ee", + "fundingExponentFactor": "0x0f67b42e6fd736840ebe101cac7682f2eb3c03807e1323b41bc59bf252215599", + "fundingIncreaseFactorPerSecond": "0x9401ac46f75503baeb51f586cfcfb16fb4a3fb57f5fac52e2d951615227e4e8d", + "fundingDecreaseFactorPerSecond": "0x5fd3f9438b96ceb1f927d697492906dda3267b4e0ab773b5c17d3e19a0c74e7d", + "thresholdForStableFunding": "0x0053477ea9e73b11fb14148eac39aabd7fac071dbb0957d6d6ae046a698fde56", + "thresholdForDecreaseFunding": "0xdb5360d9fea723914fc8a348e1a75ea2668909237ba7cb7d933815e82675311e", + "minFundingFactorPerSecond": "0x6cb0ad8ecdc033a3bc0c2b2cd0c3a33f93d4d75dccdca0dfe3e5b2790ab5bd6d", + "maxFundingFactorPerSecond": "0x53278f7d22214bd9097904f84ff59ee91463aff495cdaf5e810dde8564083b73", + "maxPnlFactorForTradersLong": "0xe5e10ecab6bc07b943b0913ee1f61ca27256d563b5375b5c695809a2b59d0fb4", + "maxPnlFactorForTradersShort": "0x55ad52312b9a5bbcf07832826e1e59f7dd60ba801769b7e2b9b3e2278fa232df", + "positionFeeFactorForPositiveImpact": "0x571589e332241341cdf027492e3d4374b2a93ef06874b73075cb7947f93534d1", + "positionFeeFactorForNegativeImpact": "0xa5f763cab3d8762f2a7027c677bf7c9f5786542d01a7f59c96bedc648bb035ba", + "positionImpactFactorPositive": "0x9810f2d2e180503c8290af9f276347ca3ce4791e1479fd6532913e67a424ba69", + "positionImpactFactorNegative": "0x95e072ed96f17673dc5ebc6fa2fdd7737b58d4200f69f9fe06451d81ede06b1b", + "maxPositionImpactFactorPositive": "0x7bb5f084d55a70ddca3fd48f65cca1a09c0709f02816844610198577d9f41498", + "maxPositionImpactFactorNegative": "0xb581b24a566d8407faf6b940b547885f670884caa28552f4c4267ed3e292f0e5", + "maxPositionImpactFactorForLiquidations": "0x5ab50ee39c6a00792a7a8994d4881f8b946180b937ebdac34e2d199a9b884c6f", + "minCollateralFactor": "0xae80dde9ed11f8ffd789be3583df9e79a38f49ab1ba4dbe01fb87936545f600e", + "minCollateralFactorForOpenInterestLong": "0x3ee6bddafa71cc4e83b9278ef2f015a79ffc105e946f4b46c521388432cd9939", + "minCollateralFactorForOpenInterestShort": "0x02a996d1421fa2442a1f27ce3c7f58aee300fe3089fc26ec58f76f12d1faf28f", + "positionImpactExponentFactor": "0x8ed469b25e2d0ab97824ae5523c62e7010f10d1777fefd34b5035c6cfc03a10d", + "swapFeeFactorForPositiveImpact": "0x4ca3b7aa799d579bba5612492862b5bbf5f22db53b16b6f664e01e2089fff96f", + "swapFeeFactorForNegativeImpact": "0x7892b0a32c16b5e6569488049b577a75dc35440887bd5ff698747b8e8b09e079", + "swapImpactFactorPositive": "0x1feef3112a12fa7240eea516d9c5fc70ea06e89d908422e4232c8bbf77d9bf65", + "swapImpactFactorNegative": "0x5159d374359947b125e79c43605b0fc3a99c2ce395723b046cea6101d0c2cc6b", + "swapImpactExponentFactor": "0xf8a49893dd52d401bc8615640b9a0b489fc7d0b89dff990a52d2b2d4d718670f", + "virtualMarketId": "0x3ec099aa949140537caa26666a53dd7eb5d2d5e9e54bdc1c905347ec27c80e9e", + "virtualLongTokenId": "0x8ddf9d8fb09ce58ba879fb48de730c9c3cb0ccbf0475f4e71be16ed6c1d3e22f", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0x4b6ccF6E429f038087A26b13DD6ab4304F7E5DF1": { + "isDisabled": "0x350979310a70df75464212b400937a39c67900538939cb4880e161ffbb02189d", + "maxLongPoolAmount": "0x0b752ab6e7aaac9ab2f4b6589341a7f9af03d37cd5d01676fbc28c8460ec75c2", + "maxShortPoolAmount": "0x481e51709718432b80fc71458185546ede273b5d41c30bd953ba4e8511e90581", + "maxLongPoolUsdForDeposit": "0xefe4e54c3babf378ef188428f0a0f478142487543cf7216d75f28c2327990081", + "maxShortPoolUsdForDeposit": "0xae897d8a420df0f25e1bd51d1c4770e4b59e6f0f8a735eca65688b9f89e06a5f", + "longPoolAmountAdjustment": "0x3ffb950b7dfabff88254e8ebeeb5c936a182c7aa976a1c1af0c2ca18f2577139", + "shortPoolAmountAdjustment": "0xe5e19b732e25ad83e9dca6b03d7b77ff5392ecc54fc741a566a2154048731172", + "reserveFactorLong": "0x92df9fc0af7642c4dfba13bf0ead450d06aa35c420f17862a5dd41d18158e137", + "reserveFactorShort": "0xa63a00c2d62e85a41a0f44b3c0d7aa7603b17d97854acfc53a54623592a1c5fe", + "openInterestReserveFactorLong": "0x8210ef75f7f143e57056a03d5b0f21c8e008f3000704924b36a6d7bc8e8f1af5", + "openInterestReserveFactorShort": "0x929a19ef5392e824a9039b67f286600b54eb8174bdb58fbb7a30d7e4fa968ad1", + "maxOpenInterestLong": "0x55a02127098c525c5452cbc4ab759441f86504d277c2a0c94b8854b849d0eeb6", + "maxOpenInterestShort": "0x659e4cbe0b841837f9b54ccebc43757591066b505b8a49d58d9e9df14c2890da", + "minPositionImpactPoolAmount": "0xda01c92382bafe0f0d95e56f28135cdbb0a993405436d97d84dfef6411c9163d", + "positionImpactPoolDistributionRate": "0x8576583c16885e110708ad91735f83ecd931cdcf9e5f723cca6c1ba451072d26", + "borrowingFactorLong": "0x480e73f8234838b4b6d09177304b9eb0babb467e1498fbe13748af532c695052", + "borrowingFactorShort": "0x1c50760a46babf4ac5bb51a9884d3a5344e40529563e91e84df2b4def18fcd89", + "borrowingExponentFactorLong": "0x2647e2cd054db9b5339d3c668d273f78104dcfe234b8a5bfc6834fd0331b4acc", + "borrowingExponentFactorShort": "0x74a5d4ee140279c310fabae297ddae5160571342849902404ec597648f49d3de", + "fundingFactor": "0x0e78c8eb4e7ea090a1e9599950a0fc49836d68f148c45f777f36f89dedf77e20", + "fundingExponentFactor": "0x0ef2b6fa27a8678a78279fa3596fd9e8d5b3f7d919bfbcf7f9d4f16d0467efc5", + "fundingIncreaseFactorPerSecond": "0x5e541ceb34429c05307b791723d9790bdeb3643a59c0e7276ac8132bd9b7a763", + "fundingDecreaseFactorPerSecond": "0x7fe589d0a7512817cf0b415cc85ed5e526121dc7bc86eac6b7277d894e6f5ab0", + "thresholdForStableFunding": "0x36f1befc3cb1526dd78f7b38d9ca1a90dc75e3f3e65ba319b5523d95f62c46eb", + "thresholdForDecreaseFunding": "0x41efd583ef4f2548cd2375c3f79205b6e558b7ecb98e1a5d819a465e4ab9fe51", + "minFundingFactorPerSecond": "0x794fb75427e7089c999baef574c4a66e4177c5cf38d9be7d2a98c930408380ed", + "maxFundingFactorPerSecond": "0xa1d6b04d3383638cf84863ad9e37716f8c576f9000d419ef9909e4131ffb5fe5", + "maxPnlFactorForTradersLong": "0xc84854c769b03060ed2982322c35b638313b98d6884e5485b4a55ec74c8767aa", + "maxPnlFactorForTradersShort": "0x0f40ef579c4fbf10923b92970b0dd1ecbbaac182f90856a23bd4ae629f9941a0", + "positionFeeFactorForPositiveImpact": "0x7a63c5bf1f71d763ce6eeca7382fc999d1fb9cf639ee124990e6d6466e40f06c", + "positionFeeFactorForNegativeImpact": "0x36ca219c1c81bea677d62e2b2e5b22206cd385f69e1544fa978de4749b2f18fc", + "positionImpactFactorPositive": "0x851dde81ea8d4ee781c8694a717fe043ef8d687bef17d6f4ed67a0e4b068dc8c", + "positionImpactFactorNegative": "0x5a4d44557ccbfc629001935ce839c93d7e73deecd01bd5d529c6c637e1d075b3", + "maxPositionImpactFactorPositive": "0xda40b2f3412500cccbeb10fe49e074350c9332e85d7f2ac70b628198eb5cbe19", + "maxPositionImpactFactorNegative": "0xcc72fedfb67e03fb6e89c35995b133c60e72ebf835ceda1ddcb11dfea7cfd9df", + "maxPositionImpactFactorForLiquidations": "0x12e5eff138fee8a5165e1120e527f7fbedb647b60b8003214942ea80a27eb245", + "minCollateralFactor": "0x458441692f08c6fd6bc9096d6c6a85c9b30df02b3f2956d04603b1d84b5823aa", + "minCollateralFactorForOpenInterestLong": "0x2397923fc51dfa26d6dac95bec87e8d79e15cf9c934d9cfe3b26e3462bcc2145", + "minCollateralFactorForOpenInterestShort": "0xcce46a44d5608dda488c9313a4ec985f8c2102f31fd7c96fb91156aae3911ca0", + "positionImpactExponentFactor": "0x707aa723bf3a479a8300aafd64736f2425a181ce672a79718ad6af650ff87cf8", + "swapFeeFactorForPositiveImpact": "0xa90535e679944e8be6065b015c62d6a51632451ce684f9e398c1544929caa6d5", + "swapFeeFactorForNegativeImpact": "0x8cda7ab8513c5de3476aa7c0474266c014d1298074d525ca18f1f04002df6891", + "swapImpactFactorPositive": "0x5ba4c56931ed525a5b04e368b7c85d09ef955a121f1a28906a13a6724b5d8cdc", + "swapImpactFactorNegative": "0x45e04b88cc7e70f0735c51990a40628b581844ad76c1158d93ce57505753ce24", + "swapImpactExponentFactor": "0x49a3c45cc6fb8b327035f5165a13336c0a22c057e7ac09b9eafe737518c1a180", + "virtualMarketId": "0x6a961914d499474e2ad7339a6791d059d32e6c939315f0d2384d66d76d917406", + "virtualLongTokenId": "0x8ddf9d8fb09ce58ba879fb48de730c9c3cb0ccbf0475f4e71be16ed6c1d3e22f", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0xEDF9Be35bE84cD1e39Bda59Bd7ae8A704C12e06f": { + "isDisabled": "0xae384d5b9ab13961a7e0af9a2224bb5dd492ecdcdd806ec9a628ac5a24e154aa", + "maxLongPoolAmount": "0xb2ae19b296f0e0257a0d9c53f7038f876676fdbd6ac6db3c9460e8831903426a", + "maxShortPoolAmount": "0xee38c9193b56f2817c0e4f868f483b69204a2a6324cfb8b6a88be19d36ab57a2", + "maxLongPoolUsdForDeposit": "0x87db3dff35e64c188cc1d6540918f9c740251b153ea66edae6fe3c9c5ef7cb61", + "maxShortPoolUsdForDeposit": "0x40b97829d28799ee6e5b104e34623920245b0d30a2fb6e0dd637e2dcf40cd005", + "longPoolAmountAdjustment": "0xef3931ac781dec8902b128ac19a63a1cf2322da9e390a19bed1f7427cc37ed85", + "shortPoolAmountAdjustment": "0x569999d5866ac4294dbbf08cc9a377afa46cf9cf05d74f6d8adb0aadbee1c898", + "reserveFactorLong": "0x9f9403fd1e1edf3086fc7850d035cd01fe03894e093ab728c691724f3df1fd2d", + "reserveFactorShort": "0xd2382ebe15a974a600de04c8b2a868efb4a66b262a7cfced1bd5922216b48f5c", + "openInterestReserveFactorLong": "0x504b7b55249d28fa161236e751d139acd9164c1463621836e47ff2899c32a89d", + "openInterestReserveFactorShort": "0x747dc221696c4f1fc20e0903b928d506ba5bc5c97185fda285071d62a959e9d3", + "maxOpenInterestLong": "0x9df34316cac327213b371129c96678266a1c3a36ded026a9094b307a51f80595", + "maxOpenInterestShort": "0xae0a3b13f7897cf8e2d37786faec0bed8e0aebe7e3e83023b75db30f53918c0b", + "minPositionImpactPoolAmount": "0xacdb9ab5cbe190e297a99b5e8335c496188640238dea058c9fbe93c56c23f8d6", + "positionImpactPoolDistributionRate": "0x7f30d2654aea0acaa1dcdbeefa9fb09ea5c9e3efa34f9d40262d356182ff7b95", + "borrowingFactorLong": "0x12eac29111625345585fd4c81941e58a2e5b85be73a602dc39af8521365c698e", + "borrowingFactorShort": "0xcb365ae6460f67f4833e8d99b522c7b7fa91b6ee47eef4e003ce7970f8c57b29", + "borrowingExponentFactorLong": "0x1df6ce440c4ad8b9eae7c7919d8f10ad4b35f495ff0a5422c986246beba315a4", + "borrowingExponentFactorShort": "0x395110031ecdf1ee8c14f7060a1215b015135bc0b021da787d1d81f9e331fbab", + "fundingFactor": "0xbaa7caaf7ff89e194d39ba8ded45e65222974eda6d9188c903f35358e5b92949", + "fundingExponentFactor": "0xf94ef930271760887d7a9566b4449c8d20940a0d2b12e403631385136c15fe5c", + "fundingIncreaseFactorPerSecond": "0x8bd7780572475faa12d5c1d313f889f8a098f207edd89f55885dd7b75a545155", + "fundingDecreaseFactorPerSecond": "0x968bf864a4a082a2f142c8a68038d593d7fb8cd9089352b0bf3102b9eaf47600", + "thresholdForStableFunding": "0x23974c7231c9a0508d6250045f1983e6ef914418f2e59e39b7500ed660b776c1", + "thresholdForDecreaseFunding": "0x442d6e8248efbaf2b5fcb320a263f9e9abc827da4cd00e7f38a7987bfaf97e97", + "minFundingFactorPerSecond": "0x90c78f24bb68eb9adb75a0859c98f0bcc8e2a623192f4f86e809292a3064a7f8", + "maxFundingFactorPerSecond": "0x47105b65f791d1f40086a1d5a655bb4666efbc5229212cec0927bbabf56ade3e", + "maxPnlFactorForTradersLong": "0x0b29dfb8a7685ae6f9cf9b6d3a2c914d24bc484bea6fbf87ab472447e77e2b26", + "maxPnlFactorForTradersShort": "0xd5e520348bde318f79a2b259ab5c1dd90b414994393279c9a8e729faa3e20ae6", + "positionFeeFactorForPositiveImpact": "0xd0777dcb9da47555ce8b2b77dad364d19b48c036066ad3aea8237e599d73865d", + "positionFeeFactorForNegativeImpact": "0x88d8852e314bfc2cf80165d339483901a2cc40302b93d830ae9f5214bbed895f", + "positionImpactFactorPositive": "0x2991b8b03f8bbda42160bf02d03729611c46a37dc975195ca27fc317f24f5434", + "positionImpactFactorNegative": "0xc38d57490f22112f54b2f4af3fc063982f98dde1580822c4491a4d068e2e2dce", + "maxPositionImpactFactorPositive": "0x14edeb4f5ee66980440cdfd82bc36b526d86225c9d23444487094c41da526a25", + "maxPositionImpactFactorNegative": "0x4d7a0c4c14200e8f4572eedcd3e0d0ecc5d86504661f9f1390478eb7a7c52108", + "maxPositionImpactFactorForLiquidations": "0x5522503c2d885644e228ff626074c899a79689cdd05bb8d67790e462358751b5", + "minCollateralFactor": "0x97ea28d35e02b8862fda306e39a8c77858b4b942901171d778184db29497531e", + "minCollateralFactorForOpenInterestLong": "0xdd677dfaf255e6feb915781df3a369173f1ba6a2fdeab9b5042ec3fe4f996930", + "minCollateralFactorForOpenInterestShort": "0x54debf477ef3d09f2ef162dc9e624468c36c8e85f1e888837f6068c67b7aaf66", + "positionImpactExponentFactor": "0x5133495a189f1db6dc1f6e752ad0ec22aa469f193c9333ba9bd2fcd99903f55b", + "swapFeeFactorForPositiveImpact": "0xf6498bb4fa2f2989961e3464a3947df93d9cac0bbce132a839479cdf8e09267b", + "swapFeeFactorForNegativeImpact": "0x142b92fa5d0cf4e4757c0eae3b63d0bb49d6845429c32cc3dbf57eafa62d388f", + "swapImpactFactorPositive": "0x4c21de75900510998632752943bdaae846fb3cd120da605ec2704287c27dae45", + "swapImpactFactorNegative": "0x97a9546d0e8771e3f65b56eb7a6faf815f6d257777ae8d7b03473eb0e1246ab2", + "swapImpactExponentFactor": "0x50eb756d6759ffca7723754dcf3ff56c2525bb49868fc2d0e52c4f642d0da36a", + "virtualMarketId": "0x8e967bc39a00855c88ce6825d1b4657ed1c37630220751b3fa598b8ce6401ed4", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0xeE8827D67C054cAa89C9d6058Fdddccd1C499c74": { + "isDisabled": "0xdd7a16c9213dddde4e0b58dc0b480cdd56628837c6ace417a9d51439327f6ace", + "maxLongPoolAmount": "0xa891a471526664bac802e6dd087d58fd5d2dc56c5e2a5d327486761ba2b3c629", + "maxShortPoolAmount": "0x98251498335e12deb5e8a2d4ec034058afc9bc021ffa4eb04b7298d449b4fe96", + "maxLongPoolUsdForDeposit": "0xd6290ee45e23edf05282774c7e330d4ce7d96407876c9ded9c1b6e879519c1de", + "maxShortPoolUsdForDeposit": "0xec30d84507cfa6427cd1fc2914816ed6100c2d85a16dba98ce3063c8a74cd653", + "longPoolAmountAdjustment": "0x45d830cfcfbc445b81163b0e80136968014be29b9035382d9940290ad8bc9fed", + "shortPoolAmountAdjustment": "0xd5e34df9d23774e3b97c0af940d1da712e1bbfe2d160416f5562a7a9d9a5042e", + "reserveFactorLong": "0x9ce7bed473003b4aa7a51c622d6fb75d4ec9001bb43f54ff943b84701dbaff95", + "reserveFactorShort": "0xa715537fc643695fcc24c5d5817a9e283e49c349cc8f493d89b5912c546fd3fa", + "openInterestReserveFactorLong": "0x6b15102468d5ad52e0bdfee9fe17643a51812fddb8fbb3034fbc503c34909fb8", + "openInterestReserveFactorShort": "0xb753611149707faae001e396cf29c5c2aa074fb5e2f292dafd28cb53a7a20b33", + "maxOpenInterestLong": "0x270aa33c8dd90a2b7688301ff1c2b7a96dd6497e82af09b54f93f2a067946afb", + "maxOpenInterestShort": "0x5b0d66613926d4ddbd91372775340a2467bd5dce9db7d34f5f8a6fb3472fb2e4", + "minPositionImpactPoolAmount": "0x50ed37e73d226ce0766952c34bcdf2eff463a04f02bb4ca3ce85f655844be459", + "positionImpactPoolDistributionRate": "0xe1621b531409aa2da773b215fcdf7a8eeb61073f353adff7c4d27d947c5ab0d1", + "borrowingFactorLong": "0x381dba0d466bdacccc04b7f06345f06b4debe6cb027b70307f8d5ca3741c2ebf", + "borrowingFactorShort": "0xff779e576e011f26268f8396de841e6879f11b1ec25c3e320b2a8f969580cd59", + "borrowingExponentFactorLong": "0x5a1d2e32dd29ea0667ba0e5fa89a1cfcfa0cd7ddb849ce4378c1488bf1a753ba", + "borrowingExponentFactorShort": "0x361a16320d380be56feed10559b393f101e9fecf5120fe056e0568b32f6de696", + "fundingFactor": "0x9721810ea87ece7c06ab904c615bf8fe8c12a1bac9d3b3876c7ae1f99946b5d9", + "fundingExponentFactor": "0xbd23887a79422d07149bf4eefaa76b26951b33c1f97e4f62c9cdbabc9bbd093c", + "fundingIncreaseFactorPerSecond": "0x94b3edfcfe2c54358d6d770dcfab4938bc51e38b265f93601b588a6f40ef12e2", + "fundingDecreaseFactorPerSecond": "0xc0149522d94176cc9f6fe26211e459e889b2f70062fa4e0877431613ebf7fc14", + "thresholdForStableFunding": "0x2a46615ddcb1dd9a4a2a13486e9910ba185ef293da401fba7826e0090ba70880", + "thresholdForDecreaseFunding": "0x709383056c1f7a573ba743592b352effdfa6c9c061a426a3c3fc60a21b4796ba", + "minFundingFactorPerSecond": "0xce8f0ec9fc028431e4c2ae66fdb1c7272aae454101321a59a9a9fbad191655f0", + "maxFundingFactorPerSecond": "0x5cf677b3b1836a5324b2a974c9db309322a2e9ac6335f3a82639b1915a4daeec", + "maxPnlFactorForTradersLong": "0x1cf2cc01138a5b15358c77d1bb3bc7726748f718951ac707bbddb05d169d85ac", + "maxPnlFactorForTradersShort": "0xeb9383656f42f363d792368765a94c2b9484ea2881c93bf05af173918d33c5fc", + "positionFeeFactorForPositiveImpact": "0x53f43ebe35bb75a4ee867704637ce5d443464239fcc35e163497e387be3ab150", + "positionFeeFactorForNegativeImpact": "0x50fc727f8f54290d02a7258554829d16dbfd870ae3e74e06ce8188f6186073cf", + "positionImpactFactorPositive": "0x25e7d425bc1d7d56be537e4b15f50da3a4976eda1912e15a52e365447948b3d7", + "positionImpactFactorNegative": "0x0881517f1b4fb63898040c1a3861d9ff6f924a0abc44917078dd8a38f9522e12", + "maxPositionImpactFactorPositive": "0xc0e44af408c1c79ee19e0fef8f6b9c8307a67016336daee3621b3f615c652fe7", + "maxPositionImpactFactorNegative": "0xd2ef5fd6cd84b151dc6b5328579738856c7d99d53c98fd5795aef56623c303af", + "maxPositionImpactFactorForLiquidations": "0xcfded09cfb3bb784b53a06ed6b95c34d3ee29481a0e8166668fbeea50ab3286e", + "minCollateralFactor": "0xa9476f3721a3ace0e929e1ba274fc72c6d8db29cc1d9e2c0fc2bd49bec67b197", + "minCollateralFactorForOpenInterestLong": "0xfab6fae41bc596b1bfcfb94ae9584c0de545d379cd225cb9c25c487d0503e4f7", + "minCollateralFactorForOpenInterestShort": "0x4c1326fc073e6b1d85be6a3d20e1c8ad4cbb9954a3705d9143e1c9245907cd85", + "positionImpactExponentFactor": "0x01843a5efcc528e9c8ac7b8cd268b5bacd76a50ab8567b7642f774d15aaedd66", + "swapFeeFactorForPositiveImpact": "0x88018f8220a21b3917d43ad26912e52e3b8ca361da3d8174be35567b0e24af1d", + "swapFeeFactorForNegativeImpact": "0x548929a4495accb9b6cb141f314517f145ce7ea2b032738583b964b3c67b20c5", + "swapImpactFactorPositive": "0xd4a7c4f352139efdc20b2198b165d123a241d6de0e2dd735b8acb612c061d0e2", + "swapImpactFactorNegative": "0x7f18362928b7b6e3cfe488252656020e312b67e2ce13853c49295f2c527cb640", + "swapImpactExponentFactor": "0x545b4c56631b0395a4578efc12493a09fa5d60f69389a8fe615faffa96085a57", + "virtualMarketId": "0xa41d65a1f8e794f8ae9417c17bce2598bb897a44316cd2925773de41b086edbe", + "virtualLongTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180", + "virtualShortTokenId": "0x93fe7d6e41dc283f2425ead19918d1c540da5f63bdd93a62c6f33303373edb1d" + }, + "0xAC2c6C1b0cd1CabF78B4e8ad58aA9d43375318Cb": { + "isDisabled": "0xfc0893bff55430e930ce2e59a642a0b34af9d011af4007050c8d945111b173a8", + "maxLongPoolAmount": "0x9dd89d3d62827ed91af7f47fd86ce782a5141c5525d5e48c9977f0ed297ee31c", + "maxShortPoolAmount": "0x2244f53c1a6ae890c8a6a4e6a4d13c7b81a6e25c7120358473ad1f778e64bb50", + "maxLongPoolUsdForDeposit": "0xe99644f91e7d57ebcf25a2b1ed77a7d34f440b32007c9b4db2456b8c848e80c4", + "maxShortPoolUsdForDeposit": "0x9c3de87147b8bc46af27cc21a9f781b5411349473b0fcec44b353e110382e114", + "longPoolAmountAdjustment": "0x5904826406435de06b966f6b6b36cf0b379d2fcbd15afc298172d4a67fe514c1", + "shortPoolAmountAdjustment": "0x8ebf4186e2cafb53363d4bfb555e8079fb0972d9ee570b1cca177baa12b2b8bb", + "reserveFactorLong": "0x82679e735ce72429af827174905d1004dc86bdea2356d894a2e17c587c9bc538", + "reserveFactorShort": "0x0d92aae032a3a6110b1eeda655e72090ecb3c35bbe137b79529c31f311139cf6", + "openInterestReserveFactorLong": "0x106077b00fdecefe52bc85eda4760beede0a7a1323870e11aabef8ed6de3e4de", + "openInterestReserveFactorShort": "0x056462b815946c0d3bd4c9d79b30f82106217547487f0edbf4998789929e23d3", + "maxOpenInterestLong": "0x6bfdc7f28957f91a2f0ae50028264662614065a49cca8b19c104dbef8e773e3b", + "maxOpenInterestShort": "0x4ced8217b11c8a27e65effb3a2aa2d18a38ced19d09883fb320e1b018fa51d7c", + "minPositionImpactPoolAmount": "0x6abe285bf9b80ae24a3d333ec90a6c8a50d496b594d915672b3531fa42f75777", + "positionImpactPoolDistributionRate": "0x6d3f9e00a0cf939ba60274e030301756d507e6cfe4b727c91700d4faf87164f5", + "borrowingFactorLong": "0xf3338cf3385ab86e8a70e57fb8d818191d70d1554ca836cc455aa2bb549e4023", + "borrowingFactorShort": "0x53054e3861b11b621dab049cfd3f2837bf93b610164e4b23746fb93c89f15cfb", + "borrowingExponentFactorLong": "0x5025b5a99d5d9f38fd70367a84de7b678278f36055697f98b797661daf4bee10", + "borrowingExponentFactorShort": "0x7e90e2ecaca77b3823d464aa2419ad15f1b0a94632b074ad15792195c601d96f", + "fundingFactor": "0xcfe0b1bf016c446e5f8e62da9d49f01b94109317778c2c57865e97c634dc0e05", + "fundingExponentFactor": "0x36b70a1a2f4d380f026d90c028532eaa4f67ec4e0a575e204b7ebd34198c5f2b", + "fundingIncreaseFactorPerSecond": "0xc56afab74da5a627efc41c3b9c4fd3aaadfdac789743a889885c7b12619e083e", + "fundingDecreaseFactorPerSecond": "0x30711314a4c21db107d759c0692fb337f84caff5622a936ef7f532fb0d92d443", + "thresholdForStableFunding": "0x6562035f525704e04ca3fbbdbaf919945600e1f65920a033c639de54387cc238", + "thresholdForDecreaseFunding": "0xc8b251abee69295b7ecdd0da252051181c20128ed37e75c8312ea9093ebca1f8", + "minFundingFactorPerSecond": "0x84089a23ad038385630608d92e339b436c879c188d304b698489f746c20d3e47", + "maxFundingFactorPerSecond": "0x2f8ed037f4b86f410d55251a6e584e5118efd5645d4865848bc87ed7bdbaede5", + "maxPnlFactorForTradersLong": "0x76b2fe888bb64d0008c3995d3a6e048f9a303bfae1767930b7fd0eea879ac4da", + "maxPnlFactorForTradersShort": "0x923022b22940da2aa68b4cb6005d691ba6233e080c3623e941e43f2c430955ee", + "positionFeeFactorForPositiveImpact": "0x05831240f177dd0955fadc960829380bf92e1c712f1859a742e5ea2ad4d4c05b", + "positionFeeFactorForNegativeImpact": "0x69767d4f85a4b4005871a2809886deaf3f8b09d3276f87cb1791b2b54e520e3d", + "positionImpactFactorPositive": "0x47b7d1855a247fd82c8eecf0d326e5ae988891305f3a710e6c4561d05baf35d9", + "positionImpactFactorNegative": "0xc5c1a6f5484e0f94cc872be2da2b7cf82d5be7c99fd12ef686741b633eeae6db", + "maxPositionImpactFactorPositive": "0xbb9a2a0e8df90d35b1ecbc9a6db7bd441a601352dbcd99cdcbea0056619d0f0b", + "maxPositionImpactFactorNegative": "0xc6a7c94f56163dbe9158b0b91e27abaf66020e9938d9f8d0bf0daff073b208ec", + "maxPositionImpactFactorForLiquidations": "0x56b55f2d38345ee5f7f194546671a92848327ddc4541fe1da6d8128892c85820", + "minCollateralFactor": "0x33951e7ffe03288c836a45ddfaf69495b239d3c884d18c273d65d3293fd82492", + "minCollateralFactorForOpenInterestLong": "0xe7dd7bf273ece58779bb00ae9a2e4ab2d1f6e2f112ee752f0a84ba30faea843c", + "minCollateralFactorForOpenInterestShort": "0x43b427a16d943f601dd6b7698573380c2a7a77ae99d8ef7cddfa8abdad16790f", + "positionImpactExponentFactor": "0x77063961ee3e498fb05ab39858f824d05c58816f9e207fe4bf16657af84815e0", + "swapFeeFactorForPositiveImpact": "0x632b360e31d6b7c0caf0657bc4b336b0a87afd7750cfcc4f10d835b6874ccc13", + "swapFeeFactorForNegativeImpact": "0x56e3a25432533027ea1aea296261935fb42abbf8d7511bf774f09b39b1b6af92", + "swapImpactFactorPositive": "0x2564b478c28569a694e8e1fb47b526f33680c4f7655cc4899f1db2f21620bf68", + "swapImpactFactorNegative": "0xa57b6e86d1bd0290122b20c59ffec9cccc1f57d12b491a54bb852dcdaecc99ed", + "swapImpactExponentFactor": "0xf0bc83626090efa1a26c684a05571eeb18eedd79b19922960cd956cb993c328c", + "virtualMarketId": "0x1da4c07527f36916f2710c73802f51fafc0d34b2651756bced81c09ea030ddd0", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0xeDf53322e288F597436f5d5849771662AEe16A1C": { + "isDisabled": "0xbcebcaeb6963dd33bb02cd393c3ee2e6475e931aad7ec64c96c6cb6b1c96eff5", + "maxLongPoolAmount": "0xb491780348d406eba6ffa8d1a97656b7309c0a526fdd0373b6e2ce0d630da717", + "maxShortPoolAmount": "0xd1bf20d66a6cf87111cf04ee3a4ee7d2299be87f9682ef5595d1e8963204e3f8", + "maxLongPoolUsdForDeposit": "0x832232da26e8a78bac9d0772da0e2409b43ab43f42d626eeb96f5dba39acfc78", + "maxShortPoolUsdForDeposit": "0xdbd4f0be29b917eeb7ee7aa7f1ca0bc0de28a9e0eefba304cc1ccf8f2d09c141", + "longPoolAmountAdjustment": "0x1b80fc128efa6013bfb8a5a1e90a20cdc777b13c06d2f95094e23ad2336ee97f", + "shortPoolAmountAdjustment": "0xa037659cb9f4690c2240982aea92c18639c3292cb7cfdbff28e5c4daf692a193", + "reserveFactorLong": "0x0944cb11e9a1770625315d6afaeebc23e3669eb4b37b37271d767f78de5ba59a", + "reserveFactorShort": "0x3fd2040f1d3ea3d6dbd711c9744e3afa83ff2ef9f2bafa07f8b8f25682c4705a", + "openInterestReserveFactorLong": "0x8cc64831f25bc97923318bc240aa1528451c5c25c98c47c18f0dd7c83f55f378", + "openInterestReserveFactorShort": "0xb364724f243ea88b6872439c556d238843f051dd3bcecea60b29e767188c8699", + "maxOpenInterestLong": "0x637f4c6c0ebd3fbe58d817853dbcf2ac9c2101da93ee2835a8feb4e939bdaa18", + "maxOpenInterestShort": "0x9d1bf67eac9868c48c76bad0ad701d1a8cb90765656e13e8154f651f2c7ccbad", + "minPositionImpactPoolAmount": "0x7ed2a30c6ef33ba6869713abfa3f75453ed936ac7d9fec5e4e714aca25aeeb83", + "positionImpactPoolDistributionRate": "0x070d438920eced2f440d9f8db6c747a2b84849e7021cb478401fe98fd51a99f1", + "borrowingFactorLong": "0x8c01cd7c645fd19e36139f92e02b73968388ae05caca1e92951904355dbd9924", + "borrowingFactorShort": "0x98a0fba22f370c962f885637e63e64cf94aaf59d32c2abdb0906ccf767e59394", + "borrowingExponentFactorLong": "0x5241950afc75dd1ee3ef64bf27899a971ba81bafe6d7d132cec3ee1dda0f7d6e", + "borrowingExponentFactorShort": "0x7092b53c0eb72eebf704b357c0a15d559aa88c321ba9a93a1fdcedef0fa240a1", + "fundingFactor": "0x5d089925104fac958a659d623e730f7ef3db50fe3e202ab363f609a2ec5d310c", + "fundingExponentFactor": "0x0e678143a326d3f6441b63b7b09fecac7a659af251284c81e56bd5c7fb84d68b", + "fundingIncreaseFactorPerSecond": "0xd92bb6d342610436ee32fc742367bac94b80130ed417ee215b6606821c067697", + "fundingDecreaseFactorPerSecond": "0x8b80e2a20cf1c828417589b69bb8881de34765c919df6740ede7c35b94efc064", + "thresholdForStableFunding": "0x0aaefa3a79aa5ad5e518d5b191c5be69d819d2360ebdea083baf01fe40320075", + "thresholdForDecreaseFunding": "0x0eee21e1325889ec306872d2b3ee03a9a461db7e8e936c0305a93c12d1757ace", + "minFundingFactorPerSecond": "0xaddaf9f0127e6711032b43aaac9760eb29360f51da505a7f90b00570597b3759", + "maxFundingFactorPerSecond": "0xee840dbdd37dbab6e21bd9dcdbcfbfe5284ae1a501fdabc50ce4150a97dd5770", + "maxPnlFactorForTradersLong": "0x5e6bd97d8b67a79878fb401aa439f382c2ce00faa792ff3bda9997bdf9f49b83", + "maxPnlFactorForTradersShort": "0xff4d30a24922db985d3abe365f9ffe5089d4bf1e0a0e28281658864067e11c9c", + "positionFeeFactorForPositiveImpact": "0x003f9bfe07251be94e44da647dfc5ac14b546d29c05120ec71d8b78bfa305bb4", + "positionFeeFactorForNegativeImpact": "0x7cb977b054e40ab743916d35fcc4f033211b0cdb90e910e4d092f141fc80d168", + "positionImpactFactorPositive": "0x0278a85160a96126d4130fd831ff4c5a9a5836e4fe2d3d568929efb9f3d40d32", + "positionImpactFactorNegative": "0x529d29bf23dcde0de61a3835c8b66c977a5e2bf880979c2865b6ea725424e99a", + "maxPositionImpactFactorPositive": "0x483000e66191fc8c744699dddee741439f87f05f61b1b3b300355642fde81ed3", + "maxPositionImpactFactorNegative": "0xd86f1bc409f50d72733d15fd7c61943af6eab714ee4299f2c00269bdf58debd4", + "maxPositionImpactFactorForLiquidations": "0x08d87760292cca5a5f69a8b95583423ad1be6acc521c68f8b152ccd1283ffdd1", + "minCollateralFactor": "0x9486c729d2726d090319334bf0c997eb6d988e6503abfc033835f3d21e5369da", + "minCollateralFactorForOpenInterestLong": "0xd7fbf50ca354ff2b3f6828cd7e94d4ed7aa174e32264de0c0aabd07a70d52335", + "minCollateralFactorForOpenInterestShort": "0x895bbd377e9a108c1b204b937d4a844252362e5be220248efe30bc9b8935381c", + "positionImpactExponentFactor": "0x28d3ce9203477c09d7c98c67792a73495a0073c0d280ff8ec79e13fe5054e79e", + "swapFeeFactorForPositiveImpact": "0x52e150ad8d5dc548a6fb24c385f9a05225f9bd42eafa9af93b25572a445156b1", + "swapFeeFactorForNegativeImpact": "0xb4c438e9e70648650f3498d02748bb64d17e2b4f7231db82ff4649ad5289e8f2", + "swapImpactFactorPositive": "0x7ff382731e8dfa0db35f01ee8463833b919a2b6b67c270a7a120b70271e46f39", + "swapImpactFactorNegative": "0x32a66fa15048d75d0970f64a82100bf289c0de735a0e68eb6d26d2f4732a4013", + "swapImpactExponentFactor": "0x9baffdf906867bf9114fac9e614d47056e935ef5cbe673eded7571c8b58825bd", + "virtualMarketId": "0xbd203f66daaa9e3125798fe87e5a9858227d509113852a73dee7b9f454857145", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0x017de90B0fa830C592805C6148c089191716f04c": { + "isDisabled": "0xfb3766580770e4b0809de779720512027b6c7e1e105eeeb01e60daa7c9c7b127", + "maxLongPoolAmount": "0xc973cb306dd366b7e26ef7447c8e31df4e791bae029c9663d6631cd147a0599f", + "maxShortPoolAmount": "0xa5551cd7034e7c90a11af6d9eaca47b87eed92a55a94fd6e89633265ba5e9659", + "maxLongPoolUsdForDeposit": "0xf39166503178a0599cd7a8ce6f0d5a6199cb2238a2ce36782825dae1e55a8b2c", + "maxShortPoolUsdForDeposit": "0xf979c892e771d78a0ebbef15c15b41db3ec275bc816bd24f8be83f3da3001d38", + "longPoolAmountAdjustment": "0x7d2f1b502b3173a3de94a1c223182bef56dd115b44d6f76ea0da274d35de71d9", + "shortPoolAmountAdjustment": "0x0b6f0c1b08173fd17d6e35ed8b966606c484b3aea20a49ff74b73c084d2af58d", + "reserveFactorLong": "0x9b1f96dc1093c8355529f2b1e75240c6c2d90ed971718bad2922e0346889bd5d", + "reserveFactorShort": "0x8bc89cbf2899ee6c7e1083ab26a91d61008542cdda1c6a647066f800e954f4cf", + "openInterestReserveFactorLong": "0xfd58a8529f2d38af7456e468f9dd9469d9110c26d8c770c976c9270ffcff5479", + "openInterestReserveFactorShort": "0x4b0792f83399b6615509b176c3f760f7700f074fed30cc8efa8e14c513488db6", + "maxOpenInterestLong": "0x08dd8cca8744b5d97d0dc511ddda10da9d4709e16399b821a943ec4382a147ae", + "maxOpenInterestShort": "0xa16d36914c800c27f4e6ba220f7578a3498a9ae6b81a2fab454cf741f1c9161b", + "minPositionImpactPoolAmount": "0x5359c02c6daa931b19ee16c8ad8e18f8f97de8ce6e697dad3d47ea7c9bd6bfe9", + "positionImpactPoolDistributionRate": "0xf6709b51e178d7d86cbbc0c703229ad81497edad1e2b315cd235cd2cf0d5fcaa", + "borrowingFactorLong": "0x3c6f26ff56dde2bf55ab38724ca56d2b281a81c24db15afa968fdedd83e76bf5", + "borrowingFactorShort": "0xa76a8ed5019664e31cc11ae8161cb750d63d2c82e44e41a1ed56c36a96462047", + "borrowingExponentFactorLong": "0x2a4c328b2d14896813eedadd6914abf3e916e4ab53a2008bd97881c4759ec29a", + "borrowingExponentFactorShort": "0xca23c27423f1baadc7229eb9ad5fe7c2dfd35b8ba25a47597ed07414f47d4a3d", + "fundingFactor": "0x97afb51008be51d4fcfbd887e280172c839584286759ddd9c3393233d4aac811", + "fundingExponentFactor": "0xfea8d2fc8682aef5466810394ea87aa55c1970388391db0079eebd6aabbf19f0", + "fundingIncreaseFactorPerSecond": "0x8f64c4519c7f8d01f78663308e6db27fa932b206958ef15710c93a0e5eff3038", + "fundingDecreaseFactorPerSecond": "0xe683db0c2eb6d1665614b48ae9ef201a544693acbe9953881457fa1756bc5803", + "thresholdForStableFunding": "0x49c46f5cbe8e1a6dbf90139a61361d431bb1ea84aae5545746d27d780270578e", + "thresholdForDecreaseFunding": "0x06b596db3d5cc28a97539d5c766761ec4420d9c8a41ac34144f07585f93d8dd8", + "minFundingFactorPerSecond": "0x0efbeb9bfe0bd789aebddf88563d3327689f1656db48c1b759b0ec9deeff12b0", + "maxFundingFactorPerSecond": "0xf5611db4775347e39747ed1c456b96e740dbcba6d01ce0979b9cfc4b5b80780d", + "maxPnlFactorForTradersLong": "0xf80fbd5a69a030c28a382e7651f4fb41c03f68d90aa1de4cacba5b2859b41682", + "maxPnlFactorForTradersShort": "0x270f5d9379748c17627fe9488d62cc5da2408ec415db81d38decac01627f4464", + "positionFeeFactorForPositiveImpact": "0x570d2910c810c94dfa7f44eccaa32dca9b9f8171f3cf3c503b5da5918d780611", + "positionFeeFactorForNegativeImpact": "0xf94d71fba5341183b697cdf3d1d488cebb016b48961b01f37bd045a5fadfe955", + "positionImpactFactorPositive": "0x9a1ba3f8a56c233e194a6da5424ed1fac6faf15b32579933605ed26debab95ab", + "positionImpactFactorNegative": "0x2670b9b3cf284a0eced68cce887acbe4ccdb7d12b689a5bbea55e9b035daf01b", + "maxPositionImpactFactorPositive": "0x41fbf5bebd182b215d84d8a6cfcd739da1f102035358c8e37161c10bb23bb5e9", + "maxPositionImpactFactorNegative": "0x133b02ce85d0279230305871c5ed18f9a1a995cf1a08c58d84da047224e911b7", + "maxPositionImpactFactorForLiquidations": "0x4bf31804c08ca6629d17e8f51e28fb15a7ae9748960415407accdd4b886bb1ac", + "minCollateralFactor": "0xa5212835c9f726f03f4cc8e303e120a1f7cada099661ad2c42cc57dd28a7e3c1", + "minCollateralFactorForOpenInterestLong": "0x7d50ef920428f507294cd36c1782f6d973a2fe06024c91df3cde7689c79fed96", + "minCollateralFactorForOpenInterestShort": "0x11f7e8e55c8b9b9dd122a4b43e86c521b1c348c5f813cc016f22cdfd50f834c3", + "positionImpactExponentFactor": "0x815c6fefb00b14bbddc0e03e7c0f220de918f46c3dd67b8fd755edeabae8ecc4", + "swapFeeFactorForPositiveImpact": "0xd87f563eee35ff644bbcbc81c285b4b9ba3c76774d5a1529bd482c790240b52d", + "swapFeeFactorForNegativeImpact": "0x10af337efb0891fdc93cfc3f957b35e6e8b478cd80dc1dfe84fab10aafedc81e", + "swapImpactFactorPositive": "0xc0cb03d2db382d5e9290eece3432fd194293e21ef1f83ad1a08567da811114cf", + "swapImpactFactorNegative": "0xd04dc2dc10cd11ac26ed96f19c2994147a753b9dd0645404de4d4f3ec46342fc", + "swapImpactExponentFactor": "0x0bb5e3bd16263d02f75dff55677c009d9b8aa9a24a1912ab72536173b2930658", + "virtualMarketId": "0x1ac08cdda4a98254b0e23742e93fc289434ce535fd22d719ce6f5ca332ad0106", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0x695a07d3DD551b0E77A348cC6A873c1eb183FA98": { + "isDisabled": "0x28e8d8fa3229fcdb6b02ea503d5779c611d174cc3d6ce3e722d6dfa0ccf42f3a", + "maxLongPoolAmount": "0xdfdf553fb93e6a6fa0955ff02d5268c0d04487274f13f62731fcc79836bd4da5", + "maxShortPoolAmount": "0x0b243243015a0b522496c946779bb001f2e4a1cab92466e8f8256f7ecd5b143c", + "maxLongPoolUsdForDeposit": "0xbe4c739e75c298ab8f608f0130881fad222ae967a4cedb4322a5d7aa74489080", + "maxShortPoolUsdForDeposit": "0x530383b39d88f06600721f4bde03f000f22cc246f549390445866c16ec172fd3", + "longPoolAmountAdjustment": "0x825aa7c2c150a8cbdbc5dfa54eec3d108449631d7e9a156d700df025d0faed08", + "shortPoolAmountAdjustment": "0xa4730b6f7a37740663217e623f5bb778c02ad75f1a942c2f2796d0faee4e553b", + "reserveFactorLong": "0x5bb7c1022fcd76ff4a59dbdf32522632dcef55f0093ae36baf9765d86a37bdc8", + "reserveFactorShort": "0xe52bfe3973b404538fa9d3c6560aa1e5f9efdb79be82aba8b01c196bc3599a11", + "openInterestReserveFactorLong": "0xb6a75555c04ef267c24a5e6d6f6e6fca434249a5318671305c258359295a906e", + "openInterestReserveFactorShort": "0xb5afc10681444962e248bad02ede5b450d33d0d7d1a007d15e9de999bf03a43b", + "maxOpenInterestLong": "0x81d657099c6bf86997d62dd0744f3332d05cb9e18ea8c366ec3659a2f82618b3", + "maxOpenInterestShort": "0x98f3a5bcb385c80213a6a08ff5fe8089befc2d1ceffda870abd42536fecdd0fb", + "minPositionImpactPoolAmount": "0xe67fd49ad1d8e192c5ecb34296986e3f9cfd2be28af888dbca0a3706bb5513c1", + "positionImpactPoolDistributionRate": "0xb6005610d68592bee6ecd38be2ec15f7d7b62c7eaedaa4ad1bee0af6594596c1", + "borrowingFactorLong": "0xaaebc05749e320a588284cd144de99f9c84a8443698f1328883a7dece755d297", + "borrowingFactorShort": "0x56deba8d5298b3dc091eccf5292ed8ea2a4c1dc7fb3310360d6743b2a537396e", + "borrowingExponentFactorLong": "0x08e66dfb99d48cabc6d3be6f1bf806d237ce14fe683cabd58578ed9ccfe0bd7f", + "borrowingExponentFactorShort": "0x42997a95fe1eda8792a78b1ed5f88c33b7104e626d1bdf522536319fe66b4f8a", + "fundingFactor": "0xa642358bf3964e620d5a42355c5b0147ac0d929235e643587f91dbcd4c9d91ed", + "fundingExponentFactor": "0x641a31bab067d53f70a980a1002f13b96bd788405fb923b0a468fea03d32b9d1", + "fundingIncreaseFactorPerSecond": "0x971dbbc45deec8e303349305e95a4be04ff9374d3bfbe69523afbe3746f338a0", + "fundingDecreaseFactorPerSecond": "0xc5ea6afe687280ecc54e7854c0780a34b27c0dccd9da8d5c6bb43a4f775905d4", + "thresholdForStableFunding": "0xaa3a4444bd5796dc9e4a57e501154dc3e01fb9e544387ead726df60ba1fc8b2e", + "thresholdForDecreaseFunding": "0xe07c6179d7fdcf2d93b1d30c344af9c41db246fce197b78e4f775d7c741f498e", + "minFundingFactorPerSecond": "0xb81ad7ceb2ce2895a34ca98c3af4f5240d6dab459dff61a16d666d61841d548f", + "maxFundingFactorPerSecond": "0xb720d8c81a84ac462d6ad8ea0a9ccc2523ff17b5e0c0f15a8aafaf55cd6c53b6", + "maxPnlFactorForTradersLong": "0x4cf830df61af03df6e23af106054f616cb9a7ce443aba0fbd0e816de8b7d7f37", + "maxPnlFactorForTradersShort": "0x36314aac4793617375d3c0f447920154a9e0677c0a73deb623acb486bc5971ae", + "positionFeeFactorForPositiveImpact": "0x3c6f2ca5835a333de5eeebc176cb9b6f23bd82af006ee38e94d499e3aac81d15", + "positionFeeFactorForNegativeImpact": "0xca27165c5c39f5ccd9e46ccb45f6c09e7a534d3a375800993d3ca026f9c97bbc", + "positionImpactFactorPositive": "0x81715340e5d4867f20c0e71ba4030c88632d88ebfaf0326c105e9389501597ca", + "positionImpactFactorNegative": "0xf3642a309bc16d8b2f0543b7719a7814ad020625035d830a111faca0a5cd5d73", + "maxPositionImpactFactorPositive": "0x810d342c12f39497d4bdaca55af877dbd05f964e4a6d626792683c2bb37ea46f", + "maxPositionImpactFactorNegative": "0x38aee17eb1d3a3866869b91987c0516326292ccec2a7a87dad70b74fd8ce82ee", + "maxPositionImpactFactorForLiquidations": "0x1383bc6b5727ae22703084ef3665da3c3000c20a53f6e6ab16dd9c1435f2e30f", + "minCollateralFactor": "0xee85c017db292f5a8eb09973adcde4bc15ebfd93d8fed7acc24ab19ebd74b07c", + "minCollateralFactorForOpenInterestLong": "0x5ae759fed69d3b0c091d183c77af7e0a17e8e28bf134058733d7e4f6c65a9803", + "minCollateralFactorForOpenInterestShort": "0x6b3ee35f5d240926128b2cd6d6e06959f849b8be18b92b74cccf3092dc4f17ea", + "positionImpactExponentFactor": "0xe567e59cfea800eb361efb60841f05c69cb32e748be6262247a2a421f040c9cc", + "swapFeeFactorForPositiveImpact": "0x47ffe2b682a8bf31cf63778aad5f0eb07789da2a14cc68b4b2d225150807fbc4", + "swapFeeFactorForNegativeImpact": "0xcc012787e83c0b903b1eb1aee64607e237da7ad41657778ff1cfafe6e680b371", + "swapImpactFactorPositive": "0x46909c5fad97c43653f9d5f3368abd6fbebc393ed3e03cac4b1e929beca08746", + "swapImpactFactorNegative": "0x09a07f2403de8c394c33d6b5a4546bd1c717e0b5b73b7a4093e0d8de38068017", + "swapImpactExponentFactor": "0x3523cf94456f655920bded4f975e92a883868ac996de759eadc368f6c7e65cd4", + "virtualMarketId": "0x8b4b2ecbbd9ae1092fb18829261d6d140c468c8eb5950328743b19623f24c71d", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0x927f31364b8836021e4F73B27a5d0EbB35C74679": { + "isDisabled": "0x587a3d5ccb55fe5ed91240222810368ba2c1ed6a59ed36c8344e18d9a2d5c2be", + "maxLongPoolAmount": "0x5d8605356a8c8fa711531379d5ea42ff444c942d73b503242a3fbff5632d7d1f", + "maxShortPoolAmount": "0xc3bb2fcf23ddf8a72620a527a8471a2544f5111c62d8001c9534f2e1ac3e6533", + "maxLongPoolUsdForDeposit": "0x500ab367baf4680cca8a727576c2b5a6f9d1bee8590c2ce92d4c1166a3ab32f5", + "maxShortPoolUsdForDeposit": "0x283d83bc1fa543123fe5026a5b9791726896bde6a9f4f41b2e39d56bbc0e9cb4", + "longPoolAmountAdjustment": "0x68d977cbc5d2f43b8d9eb7c8282d0c3a8c20d797c563dd4b00a6cdabc639398c", + "shortPoolAmountAdjustment": "0x51a6e4698fa52c14f8b6e497f93b48a061ba2717f1ce2528c624487c49b1624c", + "reserveFactorLong": "0xc6a61ba8167d006af620f5c1010172fba0b22d157a31c87c1c5df5585d83a718", + "reserveFactorShort": "0xae61bbdddc314cb1af178211f64bf75cfa67ebd3ba531b64eebf95bd751d148e", + "openInterestReserveFactorLong": "0x97ceffc1647445fc36f2d6aab61bfce5db5a72c01dcc0ce8feaff6f8676c5d99", + "openInterestReserveFactorShort": "0xfd0607102295f908730daca86de86281a2316fd5993abc3465ce69f68edacb3c", + "maxOpenInterestLong": "0xe6b52ced2449bb763f1500e319cd3cdaa1ce381680d630ca433ca7cd232409a3", + "maxOpenInterestShort": "0x9015e0e5b64902048f0ee6db7be41baf6bfca97f77f493ae8ab512489695cd0e", + "minPositionImpactPoolAmount": "0xa8489218212d6a53c5068cfa23bc559205ad74456dcd2284574a0b17e1cc9c53", + "positionImpactPoolDistributionRate": "0x776170c2a62a4f6c0164e8d6b495aef38d09dfa00aa1b0f57d3bdcdfd53ef963", + "borrowingFactorLong": "0x7c630619bc5e1ec6a00fc410d93cd2f7a89fb6f57542eb552fc314561ec71759", + "borrowingFactorShort": "0x33799af1990f52bf59fc0079e3285e83703a9a71652ad3eab387524072225c44", + "borrowingExponentFactorLong": "0xa2681e635819895467db4c5f12f27aaea1af2043be3d147cd639dd6715c52979", + "borrowingExponentFactorShort": "0x93b3964a5abbb5915438410c5205f7beda32fcaf7d5a0b53109a96f0bf203609", + "fundingFactor": "0x094697b6576d94fe08b2fd7390c19d2196393c2a81ed0dfc907d7685bc657c71", + "fundingExponentFactor": "0xf3ac04500ee0673c85c204e284f5ffa9e1c120205d06d309a26af5b35fad13ce", + "fundingIncreaseFactorPerSecond": "0xe2a3d21dbe26bd65e4bbed3ce3c319516b0dcfefec1e977888a5f3f0ac1604d1", + "fundingDecreaseFactorPerSecond": "0x3907c767126948a0f3e0b2a9e8f31e9a0d12ff2c317227d03d1a10d4c1beddb6", + "thresholdForStableFunding": "0xbeb05884878b92fac68d5c630757b4d9285d1f5215abeb9fcf3e9a0f6c319b13", + "thresholdForDecreaseFunding": "0x14ffcfcc1f6534cd1e5866de56af561c5f527db13b4893bffb45ccc82cc75a04", + "minFundingFactorPerSecond": "0x268b7f65d219fceb8892fa332cf16dc0bdae7aa82e6a650fabc534094359f62c", + "maxFundingFactorPerSecond": "0x6549b6f8d7b08064cb0485409e72f4eb7a42fd9ed8e2fd25cb26ffe0d98dd323", + "maxPnlFactorForTradersLong": "0xbc279e968e78308cb4557b820b21e00749855574d8379d85706f1306e896f2de", + "maxPnlFactorForTradersShort": "0x7456fdb6d19e2d4c7d61b6c7293cb3b71b9e8e26eac6d1a6b44f6ab0537e768b", + "positionFeeFactorForPositiveImpact": "0xa1835230a8d851762c1c01d2f7e523fdf1f5b85f8f0affb93b0feabbfcdbe56a", + "positionFeeFactorForNegativeImpact": "0x4a50364bddba2784ddc1aab575088f8f740d30343b8e0b6eaca6fd68bc6cdbd7", + "positionImpactFactorPositive": "0x9873a18090b7c56c11578568a8d0b49769743ad165bdff83f1f8aec8241a0736", + "positionImpactFactorNegative": "0x7160368f4494684e7a4d5086f623cb1cc84b4b05f87c2382e9d5110187041096", + "maxPositionImpactFactorPositive": "0xae1808bb11b54e6d0fe2b85630feb3c2ded4eb5fc8ac820c5178e8038b90ff71", + "maxPositionImpactFactorNegative": "0xeaebc7a49d460ddf770f6014464e36e8b242cba8e657fc32a4a68717108b7309", + "maxPositionImpactFactorForLiquidations": "0x4dbc4b65a887e96a0525c0ed58fe21806d349f7f596ec1d1c66d1020abb11cce", + "minCollateralFactor": "0x0f3ac78bcef32cacef7f434288d1dc395406249bac71ffd1f153ddf1aff1cb18", + "minCollateralFactorForOpenInterestLong": "0x45eedbc7142301fe4c59155e6ebd1653a9ff0c9a978099ccb2e9d707967adbca", + "minCollateralFactorForOpenInterestShort": "0x2903f6e84538e5373d1f54d464ba5df3df4b3588d0d14741fece1716eb35f9a2", + "positionImpactExponentFactor": "0x8844c8b03bd3eaef0764ca1ba1b1d78473ea2cec2d9e6a21b41b938f1af0bae2", + "swapFeeFactorForPositiveImpact": "0x2b6b19422df17ba8c28fced3c7d789005d1a0356b44c1c4c4c0164cc39331e71", + "swapFeeFactorForNegativeImpact": "0xbc5189d59edc722196387581523527cb1d98b00ea7da4f20aac7c20e08b72a3b", + "swapImpactFactorPositive": "0xc37e7182e1a56e126c4733aecc60d53d29e2b3f102dcfca70d3a86ca928e8814", + "swapImpactFactorNegative": "0xc26f85c9450226223a1d4af07280496abe35a15674106503cf26c2c1b7757ff7", + "swapImpactExponentFactor": "0xeab458e24e12f3d09444cdcdea113b9f7374871735d166318fc9323552ab2bfc", + "virtualMarketId": "0x3fed63ebd03d185b3e77f4f11e900eae2d324aecd2f96cfc894cb21c5f685fb4", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0x62408de4cB1a499842EC53296EF8dD99A825CcEb": { + "isDisabled": "0xb293e7ac9db31bbf33c8c821412054fb4616232ead7dca9b514ecd6f00700ab1", + "maxLongPoolAmount": "0x1074ac0657a006c286e5df59c68d721f4762215d24c74437a09ca99d894282a4", + "maxShortPoolAmount": "0x1dac05cb03e52dc5152a6c241d0cbe75582a6cfc1194bf6daf7f929b7bd7f56f", + "maxLongPoolUsdForDeposit": "0x90eef587dbf56d4eddbc1b0b9feb44776e548730d202fb846f1ac177655bb76d", + "maxShortPoolUsdForDeposit": "0x54f05e75ffa538e60a2f6b666dca1bd62398d499dbcc7b8663118f695a21cf0a", + "longPoolAmountAdjustment": "0xafdb8cf50f47efd31458596436aa1c4f6f549cba20a449c9bf3cb1556c055547", + "shortPoolAmountAdjustment": "0x0e5041dbfe32e5456887fa3686f8cd21e1ca1c37738d4e53eb12b21adb58f190", + "reserveFactorLong": "0xd57b02bf1e96f23379ea8ea5dedea7cf37221ba2f12ac1c327612e9b6a4c9c63", + "reserveFactorShort": "0x6311532499ad1a50f55dc0a5ade3c90b379bf4738176051b436a19d61bff63f7", + "openInterestReserveFactorLong": "0x7475aa3226f8915420114542060a5b834f7a692e4086dd17c8d044c257455e18", + "openInterestReserveFactorShort": "0x0c68ef63942475a2c4bd76c8c1973cc78c69d050f774e0dffe9e04e77d20b77e", + "maxOpenInterestLong": "0xf03f470ba010abcaa5e760c080eb4eb95efa67951a7e23775026b49dda939888", + "maxOpenInterestShort": "0x134c9960d7570f71b09651b64f64657f9e71c7d23c7ed8b223d482c015cc645f", + "minPositionImpactPoolAmount": "0xf6c8d8084cbf4b8bcdf2b910ab748dc114762300205b9e9138676c046373429f", + "positionImpactPoolDistributionRate": "0xb8837acb7c3e9d829e0ef52e29fca93f95d572d6b2387a801cb06a0494c00938", + "borrowingFactorLong": "0x5e831ae08da0ca5ca93586a16dfc6103260e5e722304be1d717b463072cb7e85", + "borrowingFactorShort": "0xc47d488ffd104a1256f2142f473b9d475d4ed5f0f50f6a10954093a1493caa11", + "borrowingExponentFactorLong": "0x0065affd467bdc510050dfe01726da518898dfcf866676732e7b1ddfff78e727", + "borrowingExponentFactorShort": "0xa21b5fb07a471b46387a0e2396f9a53fe4fe772dc5e39236736d406422142188", + "fundingFactor": "0x09feb74d4a6a6373ad85a9a1bf0e2378769f90852a58b55147ba2d6fc958bd20", + "fundingExponentFactor": "0x5ffa218b09f16c671a929e75baec62ce35e11336fcb0de03e3565562ecf89808", + "fundingIncreaseFactorPerSecond": "0xefe113ac6e71d20cf6488be4655efa035932c625f002050e9542fffbae95e3bc", + "fundingDecreaseFactorPerSecond": "0x317dff3f8e77c30e7685c5d33395f68fb14f70f7b8a51c0aa90eed3ce6de308c", + "thresholdForStableFunding": "0x102e7e75e8f1ab9da44e51ba2605b339ff84b75cb1e3cccf811d579326043125", + "thresholdForDecreaseFunding": "0xda7b17b78493de6f3b558b2186b8dfd04edb8ae2023d3125f4e46b003acbd8d6", + "minFundingFactorPerSecond": "0x562cf21613411cca148e631b70cad446765aa0ffbbb18081f34c4d145bb3b2a4", + "maxFundingFactorPerSecond": "0xd542499df9e7d24699d8ecc8f75aa401549a3b0ae9e80d5c6fbe14864ce032af", + "maxPnlFactorForTradersLong": "0x986987a2297981d099e91af2872dbe813e25706c4a933026830723cbd2bf48db", + "maxPnlFactorForTradersShort": "0x113f7f83548aaff453d477911793de665a501f3a279fc4dba114df9d1a14d422", + "positionFeeFactorForPositiveImpact": "0x83a5a35f6638777558e5ce07e52e0ffdb233fbb2be93bd388cad801e523b53ba", + "positionFeeFactorForNegativeImpact": "0x592d834e78e74865f3eca09aa13a218982d8f685c5efeb92cb33847c99851438", + "positionImpactFactorPositive": "0xab8a73b8fe33ad230ba513a905a375d42d0a091419bb26f2652dbef04f62f039", + "positionImpactFactorNegative": "0x0c08812385bf9ddb26fa10c909560b93bd3b346dcc7bfc0552d34c8bca9e73de", + "maxPositionImpactFactorPositive": "0xe22c34e3ff7ef7fcb54504b4c66044899d1a384b96d04624c1dc5dabeb6e24a2", + "maxPositionImpactFactorNegative": "0xdb06d0ebe3729da81037c1999fb1b027ed37550201bd6f4075ff5e2d6f56e550", + "maxPositionImpactFactorForLiquidations": "0xabce0e14b6bed5cfb566df3ae082320a41e649005e3fc70da278c9f5569ccee9", + "minCollateralFactor": "0xd0e0e53e9fcc4b8aef885995a8c93e42395bc1bde27f72958c9ba5ceaa17b797", + "minCollateralFactorForOpenInterestLong": "0x29db49c2d35032fbaa6998ba219c6b02284f74bfd0acc163ee051df95ed68ca3", + "minCollateralFactorForOpenInterestShort": "0xa40cad44d05c973096a2efad341a66060c01fff6f46ea68b91b0b2bf3fba6c08", + "positionImpactExponentFactor": "0x756f45fc0ceffe9e5d95fa382724d0f2e89ef58b1420ec60110167e98b8eab13", + "swapFeeFactorForPositiveImpact": "0x65de51630b94a759ff7b7fd83e2592f29f091279d19914ccdf27614d77d6bdc4", + "swapFeeFactorForNegativeImpact": "0xee0edaec66c781a5fbc4bc1a3309d734eb0f66eea1a501f5db8b418e4fcddb53", + "swapImpactFactorPositive": "0x84849cdedb39593852cf43252cd82e46a876f305e4ce1d974ee08fc8ec59d9f7", + "swapImpactFactorNegative": "0x09ecd5127f93d7213f6c1fcaf8804ee66808221cf2bf57983e1953fc99bcf9f3", + "swapImpactExponentFactor": "0x2d0e9c34fb6aba09c0d97799dcb19419b140516c7a10e3c58b4049a74c67e293", + "virtualMarketId": "0x7b563213b397f929ffcb55fa1a92b0fddd7690a85100059a4e4b74b994bc1b9e", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0xCc6AC193E1d1Ef102eCBBA864BBfE87E414a7A0D": { + "isDisabled": "0x10d8e349e7e559305df3250483706ed0b9fe43cd1b5b76656aaf58f82f54fb1e", + "maxLongPoolAmount": "0xb96c3aaf679aa87c6b9442d3cf3ebac18f86eaf8eb0feebb0c79953cb3ed2fa8", + "maxShortPoolAmount": "0x99d0c4fb42b5283c3fb0cfc70df40a740ce3c8c0aa6a649f33bb9808bd57456e", + "maxLongPoolUsdForDeposit": "0x4490d84af673f699f41c9f2f5260b73cf664f52902805eb847de61d7005d15cd", + "maxShortPoolUsdForDeposit": "0x04e9410332058dfde6421b1b9990879982b97fc54a99f5d0e1d7a0aa15886789", + "longPoolAmountAdjustment": "0x4e00edf6e42f558b7df775462d58970aa49364c86afff7d9543179b861cdb003", + "shortPoolAmountAdjustment": "0x420fae20237ecb267ee3b10a6794461faefb77bdf6fe56917a0ce22ff59cdca6", + "reserveFactorLong": "0x40db48457c1ae9f870082e2dffd93ba2ff574e454108e5d292f0080c892371ad", + "reserveFactorShort": "0xd900740390e36c1b2023af05aa878969ed197c211d145d6e735a5aba25fca70c", + "openInterestReserveFactorLong": "0x968c6d8adb16727b440f329db2fe2dad31db19a5c18d6760747ad796474aa043", + "openInterestReserveFactorShort": "0x3eb6981f2833429a7fe3753ff52c389e8b9114be5aafb0fc59045e18988531b3", + "maxOpenInterestLong": "0xfd684338764c42ad066cc4933c508e46db38f226d67c0985d2c082cd5ab4df0a", + "maxOpenInterestShort": "0x95b2d448b2918b02092420357bbf333812195ff8f8682e427cfc3882b58f3092", + "minPositionImpactPoolAmount": "0xdb819f77240e247deddc171e66f5bbd64424ac02862e1ac7200e7500d48305cc", + "positionImpactPoolDistributionRate": "0x5d3590429d7feebb80d757a622c2d5939fb65afa4426b66774322326cb0a568a", + "borrowingFactorLong": "0x53bafc4f6f30aa4f360928140dbed6527bbff0c957c9824b5ac9cc5d7ecdc10d", + "borrowingFactorShort": "0xa41f140236c9c3302058867e750d9edeae95fe048e171f04e56a6d87d7b3cb33", + "borrowingExponentFactorLong": "0xc26598a94cf90cc9d48535abc9535edde9ec37631c94ebc9e912d6a65d295fa6", + "borrowingExponentFactorShort": "0xa8cba9611cdb88194a0ff2b8eb8746430ace530e9a854b285b9399b97b05b9f7", + "fundingFactor": "0x3fb2eba6199def4e0944b18cfe159ab3ba21f4b2aea7081f92bc979fc5812e86", + "fundingExponentFactor": "0xa12eb0be201501236d8e8eb177dcc2ca7c2a8b546a6df1ef383739c785589200", + "fundingIncreaseFactorPerSecond": "0xa0eadbf74410ce659c3187937303fe9b1a0bdecb35b2a39b5af339c23a61e509", + "fundingDecreaseFactorPerSecond": "0x2b33a2252f05943e4413272b6225c9c62fcb4314f1b8dccc33dab433b6c4828e", + "thresholdForStableFunding": "0xaf174700b9b99ea039d9776309a55781b90c5c6395117963cafb8a6553634f13", + "thresholdForDecreaseFunding": "0x0625f0a59fe026310b16fb3c71c0e12de3c797c3b58565001bab604f92554c47", + "minFundingFactorPerSecond": "0x8f78f6b805d12365f3f1e89ef41065792082de4739b0d5973fff64c72af28ec3", + "maxFundingFactorPerSecond": "0x55d695443c4b50290b2c35ab4ae3670a19023d27d4c7588e6838c3b254970f70", + "maxPnlFactorForTradersLong": "0xa79de625f455941562c64463d65e8ccde24b967c7891abcf10a84ca42f8768e2", + "maxPnlFactorForTradersShort": "0x6411fd75d22e56aa0f990c53a99acaa487bf7a7260c253aecda50eb063d3cc96", + "positionFeeFactorForPositiveImpact": "0x480caa020e0fe99251b3c9ab63ec9c6300cc5f1bdfbcc7893ea0b68d47aba2ac", + "positionFeeFactorForNegativeImpact": "0xadc6faa886ee5047e61292441d823e4e0473167e7d00c08187cd3fff2d470328", + "positionImpactFactorPositive": "0xd0558f405ea9df084ccb4faa357f969f7ccc3f1a5681fef8022ad1fe8f331079", + "positionImpactFactorNegative": "0xbd84cae6ed3696ea71d13a21fcc8382099cd628f1cb5cdf2590b86018f9bd8cf", + "maxPositionImpactFactorPositive": "0x0555a94ebd0aca297889436c37ca360b21d9a1867d3413495097a4271eca412a", + "maxPositionImpactFactorNegative": "0xe2865315d05144575e7ba076bda6b3e6f1d6a62cfc85b71e54d9656b6806510a", + "maxPositionImpactFactorForLiquidations": "0x8b55985ffe6a807094924998522579cd88bb81f293c1c18cc9ebdd31c0f673c2", + "minCollateralFactor": "0x40dde6825fead3925144ef7d7985c7eabc5f1c3989c554c16f0a6750ce8d661b", + "minCollateralFactorForOpenInterestLong": "0x8f3f572e97c9d9c670333b644f13a2d0f6e539e9c061ee0a857cd9792672d22e", + "minCollateralFactorForOpenInterestShort": "0x34f3aabf9a0899301758ec60b458136eedccf8190f866a24fb5752b22f439232", + "positionImpactExponentFactor": "0xb2ce75652d03556e0bc3788493523ca7fdebc934c6e54c6c632e181236ffddd9", + "swapFeeFactorForPositiveImpact": "0x0589c40a90c42a9ebfc1efeb4b92aade95b9b797d8aa1d5a3157bf122b7d4c51", + "swapFeeFactorForNegativeImpact": "0x1a598b463e1879679db300d3d2984300793cbf7707c66a39bbdd2d35d13f732a", + "swapImpactFactorPositive": "0xd1e65efb757541f80edfff9551b4826043c8e145abe10ae3ef3541fb538f07d1", + "swapImpactFactorNegative": "0x7cf01dde2b8fa10b9187d30fd71c411dcdeec784c219d8650622215ee0595300", + "swapImpactExponentFactor": "0xd44bd1c8059198d34bfc8874c1651224c654429e4ca93c43743a04c165dec81c", + "virtualMarketId": "0x424e90987ea6ffacf6e97d87dd8356ab9fba46851591551846abfa0dc2f91c38", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0xE446E8f7074c0A97bb7cd448fA2CC3346045F514": { + "isDisabled": "0x8f5aee16f24b748da70b02be4bd84a9389c7db237baf23756b40ae870bd19fe9", + "maxLongPoolAmount": "0x2be3929ad203b980884a5cf3ddf53fab39ac9e19de194bb977c352d384d398cb", + "maxShortPoolAmount": "0xa1eda2da8aefef3bd9f0d0ca9a99e79dae2f41b5ba6f10627aaf2a0c25da80b9", + "maxLongPoolUsdForDeposit": "0x76a6c90beb18fb5d83cbe24f2f25b7b5b7e1fad300d3ab82f16188f7e99c1b51", + "maxShortPoolUsdForDeposit": "0x2bb74b5197923cf4acf49d34ae72ef34b673287b72a854678fa9a3746214ee1f", + "longPoolAmountAdjustment": "0x02612bc0c90ab605621d19c129606e82f639c0d6364293dbc63e4803d300a772", + "shortPoolAmountAdjustment": "0x7c898c63f68d14941af128520e02ead8652794616d48cd297e1c119101336096", + "reserveFactorLong": "0x9b319e914cad608fb01d63059104dc529fae055f918ad5d908f2b30fd0dcbb22", + "reserveFactorShort": "0x916fab03caca683c19209fe13b60bf337ec4f9e1db741cb68ac21645a177c22e", + "openInterestReserveFactorLong": "0xcce474632931a8fb75e183806fb17ae4ea41f8a5287c49456e7fef9540b7a026", + "openInterestReserveFactorShort": "0x3d699fc1df433dc62c2bb00e13fdabbcbcc4ace240154537aa9a31697cccc205", + "maxOpenInterestLong": "0xfb0c55120c20f071b9cc580963151b52eca679dd7a16a7cac05ce07f13d559e1", + "maxOpenInterestShort": "0x01450d7daa244885e0ad776964ba487d6bcf6d6df72d2ff9babb10241fbb40cc", + "minPositionImpactPoolAmount": "0xcc48878d203183097b3ca63f173269748f7b47c1a22355aceea30d9d11a83532", + "positionImpactPoolDistributionRate": "0x1907649be767bb9d2b5c4af2d16b0f9e96f1a17be4f4c61843c427006cec987b", + "borrowingFactorLong": "0x37a5a8df844ad54e9a0f2236863678b31f76c34914d90fa067aca87030eb6712", + "borrowingFactorShort": "0x44fd585289b70ec1681fb6de84bdf3cbac7d126cb5783e239d825c44f699cbde", + "borrowingExponentFactorLong": "0x61f1784283b348902634e47649902beff19200dff90e88b0d032dfd0eff84955", + "borrowingExponentFactorShort": "0x2bf9672afce2638743168dde156bfdbb63392430399fba152d19afc3c9d56eef", + "fundingFactor": "0x947c8b02cded66f4ef17db1b41688e376867618906d1428eafa07e52e7e00551", + "fundingExponentFactor": "0x3f450e5b0750d18cb6c80aea56023a0de6808f05e4d89818524367399282f199", + "fundingIncreaseFactorPerSecond": "0x26cf7e381ec11df3de7a236347a1dc1555cd59439e00734dda8bd3a1c462da83", + "fundingDecreaseFactorPerSecond": "0x68a8b4f7695dcb8c4625a543607baae154a1b72957e73bffeeb2924219b2b39f", + "thresholdForStableFunding": "0x620de5b9e4969251f967a564b57e721749b908a0af3ff27a1ee33b1035d17054", + "thresholdForDecreaseFunding": "0x6fd08ce5b024b750620167f409e01e9a0df2bac8d546a360be12d1d2bd9e7790", + "minFundingFactorPerSecond": "0xfd5b81b8c24d890d34b4324b36d3a24fb22ddb4895ab1d9162239b5f85ad3a29", + "maxFundingFactorPerSecond": "0x89da6ffa766e2bb3ff8a903aeb5e5317b11be4f883d2cb321a1d86d04dc167f2", + "maxPnlFactorForTradersLong": "0xcfc8c3f8c13b2c4398d6120c557c104931e11c73a21992df116452c5d2523914", + "maxPnlFactorForTradersShort": "0x66f86df6730745dd50e417a44bac9675a815fd2b0cff011e7d4e49d0f8f61f8e", + "positionFeeFactorForPositiveImpact": "0x09ef3e68667ac1932aa3da09c082f3521ca03280960d931ab17c5fc2b610bd94", + "positionFeeFactorForNegativeImpact": "0x8d2011dd8f0c59f59b6d50bfa9ee5e8128c82d9b0906177241687ed9b76ff0e0", + "positionImpactFactorPositive": "0xa762537645af98f083f258eea26bb39c97b5d6e2b7eeb7d008838577587a2416", + "positionImpactFactorNegative": "0x7af4efee5f0f9f89b838201e77ea1a99c065a8c3aeb2857c9dd06453fd16118c", + "maxPositionImpactFactorPositive": "0xc46b18667cb5e79692a544765cbf3b008b009c084a840f0716f07e49ffd33a82", + "maxPositionImpactFactorNegative": "0xb374e022a3912b6738b5afb8398914723c91acf6fbd33f1375c0a62d1def494c", + "maxPositionImpactFactorForLiquidations": "0x04560594fff18fe74dd94ec976fe48da33f3ccd2fb5522b10afba7ba587d69e3", + "minCollateralFactor": "0xceb66e48992ccf002db99c948b87853fe88fb25d3d2f5639955fda193c33ca22", + "minCollateralFactorForOpenInterestLong": "0x583df5e6f1edfb745d316e7bcd94e72ca9b5ca746577c020be7c18dd7dd4fe06", + "minCollateralFactorForOpenInterestShort": "0x36351baa910c7a93b9275819cd9a2692a2cd3a2e6ba054c08ee6b21a35de4d33", + "positionImpactExponentFactor": "0x7ce20313f86d1399be6c8e5a879b0f8444aadf143db8d96c0acb06d082131e5c", + "swapFeeFactorForPositiveImpact": "0xa23ea26f349b7feb83ddc8a2a9fecd42486e44e6fc12a1801d13effd3586b489", + "swapFeeFactorForNegativeImpact": "0x6426e51a54739e518248dcb47aa6a5ef9663cd0c4882d6e49f2c4a9e4e13fac1", + "swapImpactFactorPositive": "0xccdda93d693c2b04ac36cdd1fcb740da6b9a9b761375c4315e1ce1b8474ce507", + "swapImpactFactorNegative": "0xa2277bc26726f7bfa667b90d37019e338cd90877358ef57a93296d388daf3b67", + "swapImpactExponentFactor": "0x97522d4a4b0412dd7c94149fd9517707b9a13df61108a0fec3f05f9b7c31e9b7", + "virtualMarketId": "0xa4fa7171d12d0955f6b4bca5eb0c384db243a4cc34969aacdf2fae64921d3000", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0x1d9dC405CCEFA78b203BaD9CCe1b1623D2B25D9e": { + "isDisabled": "0x440c695a1989e113928a323a1da30c12f693cad6043c77cdf3b6fdff9d62798a", + "maxLongPoolAmount": "0xda8037a890577740ea1f6f2dadd842369e12d6c60252d32337e8f6e56bfc4df3", + "maxShortPoolAmount": "0x7e5144c4da3be1c21eddbd6ab2da4964dc7a7223acbaa5b67b5c5bfbffc40828", + "maxLongPoolUsdForDeposit": "0x840740d0a642747557469ada9ca2d6c8499840c5e5175420143de754805cc960", + "maxShortPoolUsdForDeposit": "0x3c746b8eefb28f5fd32f4fd721295064cdba60620013ee6d317100864fb3b5f1", + "longPoolAmountAdjustment": "0xc65f56eb39ab69178f2a77c56e4e75edb1bedf6ad98c79deaf74343848aefe49", + "shortPoolAmountAdjustment": "0xdb1d50fa2282207bd45452311a33c4a0db8aa3bcae0bf657b288b5700be82d8f", + "reserveFactorLong": "0x6e9648425370906bbacb5e68051751c951d0a07645eea7fbd143964a07c150fb", + "reserveFactorShort": "0x45cc22983aee531309bd571032b9a8a7adc5be49fc41be54d307cd3c52aa15ea", + "openInterestReserveFactorLong": "0x3e27ac03e5770f47ed85192a0bcc9baf4339f2c766e65c7cd406c069dc269de9", + "openInterestReserveFactorShort": "0x7ec16a84da851406338b06863b0bcf413571745b371b1ea5641ff9008be536e1", + "maxOpenInterestLong": "0xb44a69abf257dd7a6819619ca02d031d5d5919d5b2af384fb4e4a019c4c3e9e9", + "maxOpenInterestShort": "0x32a3343d370d75a4f73dfd5bc950101e414d6d5224265c198b03f35f1ea95eac", + "minPositionImpactPoolAmount": "0xd7b84231e3e6d09a66e3140e6c3b18366e3e574a9a3e78ae6617d3e839dd4175", + "positionImpactPoolDistributionRate": "0xc3f7fc77063a734b4b128f9c3fdac820f8b62f0bcf2a4b1427add319f04cc303", + "borrowingFactorLong": "0x05c181469f2ce52da9db2c0e56ee7ab18876f88dfa47b1e21d176752125af9b8", + "borrowingFactorShort": "0x4c7ae5f3b55544d790268006908e5fcf345c00812cc558455c986852a88ff455", + "borrowingExponentFactorLong": "0xc4dbb2f4ee64f908294fc35ff95e46b48c67d74afbff8208c3131ee59b1a1fba", + "borrowingExponentFactorShort": "0xd1748e71452a34aee600f8b6d96fb60a27c07bdd6deed1b5f48c3c28efeb6b51", + "fundingFactor": "0x902658d8af2098fa7144f36da86ac45b8c6d03499872628496fed6bd244f71f4", + "fundingExponentFactor": "0x0c26d338f1244a4c952d5cdd1522701e43b9af4e609b2b19c2839be67dc18d21", + "fundingIncreaseFactorPerSecond": "0xef41366f138561e60dc4bac1a2240b500b68660ca7c35a1e5630282dd2a6387f", + "fundingDecreaseFactorPerSecond": "0x9db13ebf7377a0984958d808dc3e6826142ce8f214378ec905176f49f730f3f1", + "thresholdForStableFunding": "0x4a7de7d372106be16363f7b93ad9fd9d70f12856683c6092ec451329b36d5e35", + "thresholdForDecreaseFunding": "0xcbbb9c032a1fd893bca8cae6b54638529ca8cee84a68fbabe2555f60633c04f5", + "minFundingFactorPerSecond": "0x71f49dec3c8e1a7bd93b89ebe92110a0804057a5d9b0b0ba8e80ae78170e3050", + "maxFundingFactorPerSecond": "0x80005808724cc96e2a097ee4c2a7f82e47d1a320388b4dc63476035d8973d9d6", + "maxPnlFactorForTradersLong": "0x8f32f5ad7e284bdbfeeeb70ebe1ef991953f55095e79351d35ca3d9497976253", + "maxPnlFactorForTradersShort": "0x274a6b8ec92a0bc3ba50a90e9f19dc2252961f33485ade4ce0f822cd5bc1b0cb", + "positionFeeFactorForPositiveImpact": "0x81bd544cd8ceb46ea99b4bd10d6e56ed02222dcbed27f28ad372cbdc124a1cf9", + "positionFeeFactorForNegativeImpact": "0x2d8a55901ecd0092c6089b9d517ed1667d3e1847c1694ed8f29c7ace94df16a8", + "positionImpactFactorPositive": "0x5a05266478f4928dd9cde3872bd527fa16309411dffc0471ebbe70c025c0aa4d", + "positionImpactFactorNegative": "0xe1eae2c4d281cdee0d161a428cda3065b406412fd953c1f82db82b2691a9a9d2", + "maxPositionImpactFactorPositive": "0xf99eaaaab16734840b8d4300ca590da487556dcc8db34a9268d847536510b97f", + "maxPositionImpactFactorNegative": "0x6535c04d5a63e538f6f562f433d7c993b32f3bcfe19cfc4d3da90a725fdf88ff", + "maxPositionImpactFactorForLiquidations": "0xbc6a63fc5880d67cb592c33676d51dd81ea8b5f48ffc5113afc459ae7186280d", + "minCollateralFactor": "0xa46adf9b6edb48c1ef2b4bbb2aca842015364a5f80ef06c351663fbf426c409f", + "minCollateralFactorForOpenInterestLong": "0x818e5181980953fa609b761f0ae96c7ca154f7f0646efb32703b8b00f9066681", + "minCollateralFactorForOpenInterestShort": "0x5755b8f70ab34aa48a6f09e98b3f0ea7d53f481a51bf3c43ea8eb29e944c99c8", + "positionImpactExponentFactor": "0x3b971039415093ccc226058fec1bbf78b3120fcce1cc233615f3e18b5360ebf3", + "swapFeeFactorForPositiveImpact": "0xb843072f0f5a7464d8d1f7396c97cb7da8af935cae8e33176c8d5f175cc9a55c", + "swapFeeFactorForNegativeImpact": "0xbdb97358626fd42e2914f666f839a6f60265e9ec51dccd6175f3c83aa463977d", + "swapImpactFactorPositive": "0x901b3d05b703f3c40f99b34c4ff2cba75269582be15a402353f187ed49ff5165", + "swapImpactFactorNegative": "0xa0e259f65f79fca5bec4d5341eaf9470dba0fc4d48ba1defd29a7572fd125ebc", + "swapImpactExponentFactor": "0xd14dd7875505bc9756a4e613d29ed6582f111ab4bcdfff9cf4753558a94802c1", + "virtualMarketId": "0x4bd15e6a0fd03dbc2bea39c43fc79d398aef82c002d008feb4d1c89fedc29eb9", + "virtualLongTokenId": "0x1197dc1f26a5d09df65747e701aa5c198f33661b36a49a71e27bb33cbbdd6794", + "virtualShortTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180" + }, + "0xd783EB54407d6d3A4D5c94b634eC9BAE3F574098": { + "isDisabled": "0x9ee6045cfdc858efb21dbcf47bd175ebc6a951025789d220001d332b97b4efcf", + "maxLongPoolAmount": "0xf9a17759e4812c33a2b3be0cc7e90e706219b3db2357754051df1a2bad3f00db", + "maxShortPoolAmount": "0x5ff5f41bd87b7b1775827c269e4e9be866329f7e04d093669fe759aa9ed6d961", + "maxLongPoolUsdForDeposit": "0x7ea137edb528f577a4657512a9054615635c687cdaf8f7bbff77a411a9afbd35", + "maxShortPoolUsdForDeposit": "0x7e7ee6ce82ec5fc73e07b36f56cb8049f783b99d31ac69f2fea2c55948537463", + "longPoolAmountAdjustment": "0x50d3c71bdd36571e46aa46ec5ad941e33f888021b2f9885c19f1dc98e054ef73", + "shortPoolAmountAdjustment": "0xacd019a5871a4b0021c4f87ab15aab4c1f97575bc8f3f91f9c82c6aa4bb31b32", + "reserveFactorLong": "0xa4c086cf425a1aa4f038549b384e31e909cfe2e3d21ffeb43d60775adcb088cc", + "reserveFactorShort": "0x121fc194ab5da8fbb25a15160d0f85c785cd43fd6029f18ddc976491bb8391d1", + "openInterestReserveFactorLong": "0x0e6625422d55e85c5f336091c8a069fcc7a200204fa39e169ab257f1437960a4", + "openInterestReserveFactorShort": "0xd0919da1426d321cede1625b95af697f699e55b841f24f885437d6a21cd7fe9d", + "maxOpenInterestLong": "0x1a95924969930ddd03dcd3354541fb6b60536eb4c0e2fe5484c274e53e233f91", + "maxOpenInterestShort": "0x081285955d46358b0ee75cb50f2301f80ac5fd1b5722a96976b626c53750cb6f", + "minPositionImpactPoolAmount": "0x4814532a80b745a7b543d39ba33c13c9272dd3c764c2c3fa2942c0893ec0b454", + "positionImpactPoolDistributionRate": "0x471fe7b71dca5dcb68d0e30c7350d78f8e46960dd80eba5b0baef785dc36443f", + "borrowingFactorLong": "0xd18368512b4036c6ef24e20a102b848253392c3922ca6d4b3f57199555bbd4ad", + "borrowingFactorShort": "0xa3b3cd727ed4f5850acaa976c9bcc1a63a70a929c6301cbf83490ce8410623bd", + "borrowingExponentFactorLong": "0xb853dfe6697c75d65f078e523bba2078715cb19bdd373134438339bf9bff6983", + "borrowingExponentFactorShort": "0xeaed62dbbef3cb3426956922c64bde5bbf9047711e44b6f837a8e81af2405787", + "fundingFactor": "0x7b9e4ea5a342e8585c6c15ade2bc8bd98a6b2fdd22ed4227ef42d0982f6e8bcb", + "fundingExponentFactor": "0xbc34c6fd6056613dd6d389104117fa6d0f4bbd6a52a190a0c868266a7ddff47e", + "fundingIncreaseFactorPerSecond": "0x5066dc7cf5da1d7542eb5e46ea17bb5a4c2d496718819a6fd3f47ffef2a03788", + "fundingDecreaseFactorPerSecond": "0x5a407ebfb779c6ab1e467e04432c97f971083c2f920d45a82dfceea8bdbb3c2a", + "thresholdForStableFunding": "0xb92f09e81677138739b3b0e4f9fef8d0e09a2240eaa7ffa711a7111c84d2de44", + "thresholdForDecreaseFunding": "0x7d6cf70fd22cf0db22c7044bd72a22548e9c2f030fb38240f6778516ea7b8d8e", + "minFundingFactorPerSecond": "0xa00d47153398af0dc6354af54a69c9009f377b999e9f73f4fd07d7f32ba9d940", + "maxFundingFactorPerSecond": "0x2f9dd902a53addb43038e9d24efe34c486a2911e7f672bb79365aa927e257c78", + "maxPnlFactorForTradersLong": "0x47c6b942963abe1930bcb6cea0d32323d424e1b4981f35c33c5bd81acd296b8c", + "maxPnlFactorForTradersShort": "0x0790c0bd1a893408eabd1ea57630663590c62ec1d13a4858c77460a7fafd2ec5", + "positionFeeFactorForPositiveImpact": "0x633594b09c0e8b31be3792e4ff37f2252f8cc94b768efee52d747044f9a55dfb", + "positionFeeFactorForNegativeImpact": "0x2bcf6671743d299f81ef6291530ecce27d3429a6fb61494a9ca8944a5b34c582", + "positionImpactFactorPositive": "0x221221e7b50c289b02ea5905c1f2379370338250693b13b8fd1087ac9e901b5b", + "positionImpactFactorNegative": "0x0954d88366713719281605b30c385e1b10b87ca6ef69733491e7e22dc4cea296", + "maxPositionImpactFactorPositive": "0x53277309fab06bd5cf4cd915cecab1990fbd08f2cfcdbbe96de2eaca6d3795d6", + "maxPositionImpactFactorNegative": "0x8d19baf07e1b3da292b4f4b001bce49c60d0372a4fc49f934c5ca3c9414dbb24", + "maxPositionImpactFactorForLiquidations": "0x041392716702b20c5a401b7fb483b82cce6c4f4b59876f8f36ffb3c32aa1db80", + "minCollateralFactor": "0x660d36995d7842d65142957335204b2f5a47ee4ef14e45e808cd2a558ee1d64f", + "minCollateralFactorForOpenInterestLong": "0x27e803ec18d5fa51715be719542a289f7423ac9ba9b20f576973d66b2551bf5d", + "minCollateralFactorForOpenInterestShort": "0x5258e3c070aaebb888fd398d917ecf80832a6656f40d50a745b124f8ccb7e254", + "positionImpactExponentFactor": "0xc51909a330c2401736876b71a8cfd7c96f42890319cdb371a3b9dec9ecd409ce", + "swapFeeFactorForPositiveImpact": "0x9102f6ad4161a08f0849b3c43c223e364bd4aff8f481d198a4eebeae069553f7", + "swapFeeFactorForNegativeImpact": "0x67ecf17e7395492331fb10f81e89dea078a77a9e46f2fceda54099cc9797a959", + "swapImpactFactorPositive": "0x1e345ec4f6a863e7ebe4e075da4fcf31672a9182dcb21cd591068f690f2262fc", + "swapImpactFactorNegative": "0x4a493f0dc59ec102f37040fb63e5125680bdd15a0fcb2ff76badbcdf3db3fa86", + "swapImpactExponentFactor": "0x9e82099a8967147ca78b2ea77f8668503b02fd34e8d52886e684f211da201bba", + "virtualMarketId": "0xb1d9439ffc87273c4ea830bb2ffadcda183a37ef662c4099c8dd96ba2bfecd3c", + "virtualLongTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180", + "virtualShortTokenId": "0x93fe7d6e41dc283f2425ead19918d1c540da5f63bdd93a62c6f33303373edb1d" + }, + "0x6d72D2787107c32a48bbA4687Eb8F9C19FE5e29C": { + "isDisabled": "0x4b8b30e8f00af9ddeec939a984c8a864c2cb05c30235a2f21c29bcdd5727de04", + "maxLongPoolAmount": "0x15c78a7b250489252a41d69d6084aa599dd5881ba5de761aff828a3effdd1c1e", + "maxShortPoolAmount": "0x9d3ea25ddc8cc8e6a3bef3698ac8d4ce7dc803134d35565732a0dedcee881852", + "maxLongPoolUsdForDeposit": "0x263151f9e0875b3f499c943889f6ea61bc363e8b97cb06b863e32a81e61c349a", + "maxShortPoolUsdForDeposit": "0x400dfba1286afce72f62caeda162cbaadadaf39cd8ceced8c906feff8a9d574c", + "longPoolAmountAdjustment": "0x7f8d362e80842eacbd600c1ed81dff992a5722ad02dd6742d47a3dddebba28d1", + "shortPoolAmountAdjustment": "0x609f9cabbfdc4e301fd9cdd02cab98dfa674cc84a77be3b594e4b4c2b299f8a9", + "reserveFactorLong": "0x200ad5d74b542ca618ac58a7629b4b37f13496ccd97d11324b346ac444d10373", + "reserveFactorShort": "0x8aed26415d2fd2c3bcb36ce534ba946d95835cae8dd57c099bec215cda268c24", + "openInterestReserveFactorLong": "0x5132bb9e9a337b26caf58520c1b17bb4f544249f24dce232a886f49dd307b8bf", + "openInterestReserveFactorShort": "0xb34ae1a4c6b1d64b52b28982b3b531607665696b678108ca2c44718393fbae12", + "maxOpenInterestLong": "0xc6b401e0802150abbedf065d8cc1ec9d263c29732b993f9c18476a341e922095", + "maxOpenInterestShort": "0x7cc55f4118ce720469e762013a1ca407fa2f3036f25900be064bc0b63e6d20e5", + "minPositionImpactPoolAmount": "0xdbb94a6ad3b2d67d72764a6ddde7fedaf035dbf92a4e591b8aa1448d15cd5c31", + "positionImpactPoolDistributionRate": "0x4438c565fee6d8898281a10208f1d418ffdad72e8ebbecfe15afc4e367dd0b72", + "borrowingFactorLong": "0xcb1147af73762f30af128a00e7345992bf461a6eb49df8b985a11825a0fc20c1", + "borrowingFactorShort": "0xd981abe599e47eb8aae9257f78e5e232eab2c397ce8e8a9ccc05abb8baa597ca", + "borrowingExponentFactorLong": "0x84263d936a8a7e52b41968107c120ba3da4d36114638b7eecf5a8b704c87e961", + "borrowingExponentFactorShort": "0x993ab002b268bf70a3f220b3ec7b578bc5d4c93c67173a4ff478b7439423f0ff", + "fundingFactor": "0x81c458a55624cb2064237e2cc276b1cbd3228d58af680d379af2717d423db5e5", + "fundingExponentFactor": "0xca525d48c831c342cbdd91cbb44b97d11b9e7a9b664835d8e155df11dde9f3de", + "fundingIncreaseFactorPerSecond": "0xe5e6fa46a0f24bea7746002c6176919c0c465b4792dbac0f8cfc7fe9fc892f3d", + "fundingDecreaseFactorPerSecond": "0x09fd964ed1d32d6a1770fd6e2e7c753cb3f7940c66226cd367a5715e2f29af04", + "thresholdForStableFunding": "0x245e120e034811b135743ce2d12cb0ff35d391ceba9735286922e146d55d8e9e", + "thresholdForDecreaseFunding": "0xdd19e24463a5709d51a255bb0d4ef0f0a42f8adde8abc807a9eb2ad17501958e", + "minFundingFactorPerSecond": "0x145a49891c776c9e95a0ae090cc8f15e864790fdcfb6d52bf808cee504c24ac4", + "maxFundingFactorPerSecond": "0x6cd221f1fe702a065c3d5d488eb64b15023dbd5ead70c58a0e8b1a7558e5b16e", + "maxPnlFactorForTradersLong": "0x164ea8b6a97c0ffc267213ba294b3058ee4387ecc19b87e31ffd5700554ee028", + "maxPnlFactorForTradersShort": "0xee0486fca5c436f99d4772832e3457cbfd2afa0eb06e079f5df49b1c68a287f3", + "positionFeeFactorForPositiveImpact": "0x645a45b8c2066831a700ed199d13dc8dea613b7154569b827cd1c384062ee908", + "positionFeeFactorForNegativeImpact": "0x1e7a0738deae0fdb87f558226e5bbafed021fc35d1e8a3cc8bb5f41227fa5fb5", + "positionImpactFactorPositive": "0x4ab1412183e3cdf2bc0183be8ce586927a7514a7c59547650caaec2deac8a23e", + "positionImpactFactorNegative": "0x7dd1eeecae673aa27159de19e7f7dc5dad8733c52b5f2d223e2baefde25790fc", + "maxPositionImpactFactorPositive": "0x0c431c9f06de832473be0ce2b10621da8568de58d41a129cf8dee1cad68e2d31", + "maxPositionImpactFactorNegative": "0x70801029438f48a6f9e93c6c346b4662b7237c7f8956c67f6ed0d6f078a36766", + "maxPositionImpactFactorForLiquidations": "0xf3f9f58a52a4fc1c974c701e5465340061095f605b37e589d1762386d409d1e6", + "minCollateralFactor": "0x47c761a326bc43721df008dbd681a56a95f967c8782f6c5627c44b0ee1e28d09", + "minCollateralFactorForOpenInterestLong": "0x8e08f3f7be11c7cf1e417bad78b67816cc018466d09dbc178cbf14e775ec84fb", + "minCollateralFactorForOpenInterestShort": "0xbdceb26bf2f98e5cc12acaa3f849b8d4b55bdda9afeb7ccf0290238518f1db47", + "positionImpactExponentFactor": "0xff24652bb0828da1596a0f12cb00abede91225f771ad892955193da803cbdf7a", + "swapFeeFactorForPositiveImpact": "0x31e3930b9996b14fe6f38568e44639ccc50e56787240e19e98310ddcd4a92fda", + "swapFeeFactorForNegativeImpact": "0x79ffe210749a415402ab9be45d30efda2ecb18e6812b20adb226da48d4ca5f02", + "swapImpactFactorPositive": "0x2cab7d169dfb0076ae18bbbcc61065aee049442b6a4625d90829f74f1d431f17", + "swapImpactFactorNegative": "0xf62851c1a6f64e7d365044132259a31dd64a680ebb18db650df5aafbff986aa3", + "swapImpactExponentFactor": "0x386e3e54e4848c60015711213f37290b3dcc77280b39dfb0a922b780b1126763", + "virtualMarketId": "0xd444324b90fc43f702cd262062a0d5db4984473eebfec16830c3c6f480a0f10b", + "virtualLongTokenId": "0xe725e5be11641c39c76c9c4632887409d48033b482cc32020bca3dd6a846b180", + "virtualShortTokenId": "0xfcc3d486e44df648e291c838d8a9375bf61b0dd765ecb45bc541a6d6797caf0b" + }, + "0x3b649015Fe0a4d15617e57aA11c0FbbfA03A9e11": { + "isDisabled": "0x3bf4e36aed4e078e809690feb250d4f2d22cff1c080a7dfc15cb35b2237d571c", + "maxLongPoolAmount": "0xf9f8ba976b516e56d078527730c7540e65356bbaaa36000b6fc60cffc5ab4526", + "maxShortPoolAmount": "0xf9f8ba976b516e56d078527730c7540e65356bbaaa36000b6fc60cffc5ab4526", + "maxLongPoolUsdForDeposit": "0x076f2d7faa3e25d45cf265e98f78b882229c689f58fe6bcf046a9bc696da1dfd", + "maxShortPoolUsdForDeposit": "0x076f2d7faa3e25d45cf265e98f78b882229c689f58fe6bcf046a9bc696da1dfd", + "longPoolAmountAdjustment": "0xfbc989cc1f9e2342364524bf0b748cc73a83704afa4af644152fb57fa6971897", + "shortPoolAmountAdjustment": "0xfbc989cc1f9e2342364524bf0b748cc73a83704afa4af644152fb57fa6971897", + "reserveFactorLong": "0x8ef31df4b5738c1e7c88d44e1072e7b11c32bae0bc3324ee1be9d3ca8a865404", + "reserveFactorShort": "0x3dd7e5fd01b7a5ab747b2d599618f5ec0a9932ef8d67f9ca9d4ac196ca6d4bf0", + "openInterestReserveFactorLong": "0xd34a1c4440b3360a1b834c1f3e73189ab5e88e286032159e73b519efaf82bbb8", + "openInterestReserveFactorShort": "0x31b00a3557892fff951a2189e8a7f24ab1bb9435e99e62c64dc3facbefd703a4", + "maxOpenInterestLong": "0x0cb53be9a92a38c5dd93eae47a52bbe81d0eb0fbf39b87bdd67f17eddefec462", + "maxOpenInterestShort": "0xe574d9947126818709d4ef46c33278d36c9d4745130da35227b635a710f22f2e", + "minPositionImpactPoolAmount": "0x7da54e662c79c63574adfb0d3e136dd01ce3ca911e8093d7f2fa530cb66781d7", + "positionImpactPoolDistributionRate": "0xad137b722a71ef8092f7fe9d0f1302a0126f336c5dc39d42c66ce79bbc37509e", + "borrowingFactorLong": "0xeb95d4f8e16251d9cede16b694270cb396d94729a15480c95b58ca38f0459e42", + "borrowingFactorShort": "0x8cd88b12d1634d93c38172954473feff8bd15936964ae791bafb0358bc4743af", + "borrowingExponentFactorLong": "0x962008a9227e4a8eceec59b42a91e7429a8880a00199035ed6c674af8a8eed59", + "borrowingExponentFactorShort": "0x3e06e2ae3aa7fb8758c04bdb2e61414f12cc987647d96cb64f440aa8bf00a9bd", + "fundingFactor": "0x1198983fb63b77c8af43199a9fd9c2c3fe939de478aa4847cb9291184db5c468", + "fundingExponentFactor": "0x07155b65d43ad6468b335b42fd399b3d6d3bbd9f8c2e5497e43810757f6be206", + "fundingIncreaseFactorPerSecond": "0x43df598fef8669e3028a88a75b85de850db495ab98d431801c32d3a91df5fe54", + "fundingDecreaseFactorPerSecond": "0xcdc4328957855eda6e45ac4fe50c4b6e425600f329b93865a61b84a057791e5b", + "thresholdForStableFunding": "0x52bae450623dac73625d2243274a96b256878e4c4612f799f671661dce7308b2", + "thresholdForDecreaseFunding": "0x4c28551f872cd880955686ce8d628690432f86802155aa4dc4c088fb23cdd495", + "minFundingFactorPerSecond": "0xca290d7a3595842b8a47d8061a1c553ddaf5692c949b79d18145e64b89c817b3", + "maxFundingFactorPerSecond": "0x5f65898b6df057aaff1a80e1fe7b4459c8bdbb538e96f4952cba9f5c29c547dd", + "maxPnlFactorForTradersLong": "0xc5618ce541d1aeea5346d6164351ee7f983bbcce8eecc05f8bfba0c314e57cfa", + "maxPnlFactorForTradersShort": "0x9750d780280359bf0a2069730d38874a1fd839050a59255fa453aa8515935bf4", + "positionFeeFactorForPositiveImpact": "0xb6245117418c14e0b4c75a17449ff7390ff57f8a6b0afef0084679dfac296fb5", + "positionFeeFactorForNegativeImpact": "0x4a7b08d27f8e7a95ea2a14564163d6f42a663ea247c9f297a278fd26b35514c8", + "positionImpactFactorPositive": "0x58529c64a00bf54d5a13ded16f36034aaa7dda5530f74cf23d46aac19acbbff7", + "positionImpactFactorNegative": "0x078d064d98101201466c1c551b0ca6a8a305140a5696dc99ff74821392d97c8f", + "maxPositionImpactFactorPositive": "0x6a348a258a1098bae9ec5b403d66b4e0b14d27f5ce1fb2b13767d6655c4ea428", + "maxPositionImpactFactorNegative": "0x3119b21aa76ac0e07b2df9300c392b6156a893a2bf6c75c785dd67b8e3dcc8a1", + "maxPositionImpactFactorForLiquidations": "0x74f32194510fe6d7b037bc0fc902159ad98ec50b06317ca50726ee5695ed5920", + "minCollateralFactor": "0x70d8296fff44280d8f08d21c4827e88e576995b4ba5abe74057005597a25366f", + "minCollateralFactorForOpenInterestLong": "0x1ad4a9c2b4ce935ef436514c8854eedb430a2d63208a46b5b4c1a539c33e3d09", + "minCollateralFactorForOpenInterestShort": "0x9e8636270bb17fe8d5dee385bf6abb8ecc53da1f4a98c52ccef3b75eaf4895b4", + "positionImpactExponentFactor": "0xb6d3bd408c744959ffd59a568819258af55102649edb14de3f8c525ed02f5568", + "swapFeeFactorForPositiveImpact": "0x9be51f5179ba5927f3ec2509daf80d5ccb06af86cac7f814d62123fdcd41cdd3", + "swapFeeFactorForNegativeImpact": "0x8a9fe3c474ef4ef9d9693f2e0fbc6765169ed2b19284ae93a0ce93eb09b6e2fe", + "swapImpactFactorPositive": "0xab8e032738aa576a838476c84eb601e7e2f2a8b34e5dc5c536aa6f1b9264bb00", + "swapImpactFactorNegative": "0x89dd570058416dd9eabb37b9b0572fe09e54d9096bd0805a622035cd5858e426", + "swapImpactExponentFactor": "0xacbb4a823d8b7377146f586552852bef3ceca091776f5b319e655537bcc21ceb", + "virtualMarketId": "0x5d464316e1950bfd9d813c2ee8d225be592408ce5a65c0eb039fec20c0718644", + "virtualLongTokenId": "0x8ddf9d8fb09ce58ba879fb48de730c9c3cb0ccbf0475f4e71be16ed6c1d3e22f", + "virtualShortTokenId": "0x8ddf9d8fb09ce58ba879fb48de730c9c3cb0ccbf0475f4e71be16ed6c1d3e22f" + } + }, + "43114": { + "0xFb02132333A79C8B5Bd0b64E3AbccA5f7fAf2937": { + "isDisabled": "0xc56c31f168d0de45bcf0d30a990a766a9ef94c7548991d80cb395f4abf4813a2", + "maxLongPoolAmount": "0x1f69e4c8075d93e7fcf88168263f2c0bf67880af97e0317fc149e1ecfff4f82f", + "maxShortPoolAmount": "0x7725940bb4d9bc3c99b1be2223db8f4318a5807dbca6044e5bb5858618d9b648", + "maxLongPoolUsdForDeposit": "0xf00fa90dfa028e9fa6e850993da4f38c9d1528854c0530146d9a84fa87cca1e7", + "maxShortPoolUsdForDeposit": "0x591e3ae07a9a9b6cb353d6c2f56ea5f341effec64d5479156fae40bc2128b92d", + "longPoolAmountAdjustment": "0x074ac905db8f4aca729f8d62c11ce97830bf6709dc93573f2fcf54fcaa50af76", + "shortPoolAmountAdjustment": "0xd893a2d7b611be6980d113436be018e919864dad5e0588dbe9af4967ca238b9b", + "reserveFactorLong": "0xf6e6b1d4a861e49afb8ee2f3b05c3a648ddacd1070855e4130856a722d24b192", + "reserveFactorShort": "0xa641aae10d5c32ce63a8edb1e64c8f355c1fbb07a6a2d83ce71e80110028dcfb", + "openInterestReserveFactorLong": "0x26e5ed351e617f8529da834e366e5c2b90f81abcdaf2cd308aee8dd471a65161", + "openInterestReserveFactorShort": "0x01fdc2810935d429f78d9722d62cdfbb1fec75f0104fdfa1f0c65a14083653eb", + "maxOpenInterestLong": "0x4c109133d73c37ca1f1eff80691ec697a9b297327b6ad4f91aa670b41eae60a1", + "maxOpenInterestShort": "0x353cfba16636aab07886f00514542c8afe5bf177b892a4fda915494f31a52a69", + "minPositionImpactPoolAmount": "0xe2f9d37ba16a727218603761726c996e66412de6be4826674cbb627f4f3ef506", + "positionImpactPoolDistributionRate": "0x8abddcf39c294c09fb2c0f2b430c0ae8896c93a638cad94554c763fdb4f4e24b", + "borrowingFactorLong": "0xe02f7a6fbb995dc40857b3a4c4b598fa610340f36038eece66ad5679db9b19db", + "borrowingFactorShort": "0x67801d74edea56d7d55c1b38c8ef701cc9dd66df4b873ff26fa87322de834b4a", + "borrowingExponentFactorLong": "0x32759fda35e514f7996759a27def5f989b2075ffdd4552127d62a5bf96b02ecf", + "borrowingExponentFactorShort": "0x530993b5f35fa854077ff979c7f9d2d5e9d14955f8a8d18862e35dc970b507a1", + "fundingFactor": "0x19ac9cad066f34052993af3f73eac6821705c32dd7f6e68528086f5a2238046d", + "fundingExponentFactor": "0x7d03b270256088e97d1c8dd5f18061694db3b33b5c091d0a518c6a92a19ccd06", + "fundingIncreaseFactorPerSecond": "0x2636878e86cdcf8505fce95f076f295341c230b510fabe3735caa4310567dfbd", + "fundingDecreaseFactorPerSecond": "0xd5d7a5bd6bbcbb4582a7c61f57c8a632629f03a81f5035ab615e7f0916640237", + "thresholdForStableFunding": "0xf56ca41ce28c1eef9623da43b710fab16bd64e5cf1354146e819d74fedaec2ee", + "thresholdForDecreaseFunding": "0x594004aa855d9b10b102f6a77e4f00e003b38e2d229f19319534558e3ad51e64", + "minFundingFactorPerSecond": "0x288dadd3a7fb47b262a1085bdd7fa13ff8ba8e5b0a078dbe78901cb47985ffe1", + "maxFundingFactorPerSecond": "0xfbca942b223f41bd0fe94b280cf01a8646913b11864a69ce11b17538e7129cc6", + "maxPnlFactorForTradersLong": "0xcca14cbe5461dd8604717dd723e8fcb2511a1c803ef6b99d5fc49368a88f8a22", + "maxPnlFactorForTradersShort": "0x66ad3a6552e212142e97a1ca0e9f38be81f997c7c15016254f1e805c59387874", + "positionFeeFactorForPositiveImpact": "0x3f73aa8aa2902b49a18adc8fcfc80f673b7fc9234a14b2206dc5076920fc3fee", + "positionFeeFactorForNegativeImpact": "0xeee66d741c66a82695578446740ad96569e35f6d461874a00d2699d9e5e6b133", + "positionImpactFactorPositive": "0xfa4c51cba11d6919e4e3d3d0afdfd0f1d395c556e064f8d3d4a57e0ab392ab35", + "positionImpactFactorNegative": "0x9bd82d60d6308707faab3f5a82e1a88387143aa9dad017bc8895f6d7e675065f", + "maxPositionImpactFactorPositive": "0xc6e8ff82b7067dd8ba4d505f65921fa7ef232a09369691b1bccb4f36a5fc478c", + "maxPositionImpactFactorNegative": "0x505752b0d40ffae647798a4bd22d80761466d2a05ccd57c64c55c65e96c46beb", + "maxPositionImpactFactorForLiquidations": "0x2ed4cb8dc5a833446a21721d3415cc0338c637436b0d9dd5800b6493fb998b36", + "minCollateralFactor": "0x79c16947dbddcd32e966cec7dab3ba71dfdcc0024ae40d2207d271067d727681", + "minCollateralFactorForOpenInterestLong": "0xa4bfbf6c0ee876da9dcbfee32442a86b0f70ea215d40f50d6136531dde67e999", + "minCollateralFactorForOpenInterestShort": "0x1155b83e2cfe76f46bd264febe8e7e2cba6781f6ae11885ebbce9ddfc94c3d50", + "positionImpactExponentFactor": "0xf7ac92d06cfc6e497db204105052083fb5fbfb4ca5eae120a960a9a3ee379273", + "swapFeeFactorForPositiveImpact": "0x9ff68505a5a6a99d8fcfaa7feffaf3845707beef48ea8496c9938dcc1c8cd659", + "swapFeeFactorForNegativeImpact": "0xc122e6184657495f1328c62b42c211b809ac9f91bae19dcbfa431ea1ba12345f", + "swapImpactFactorPositive": "0x76e9a37967d0130ab2ef994e9eb21736904cb97869b42ea63c2ecfb00b01f743", + "swapImpactFactorNegative": "0x782fdd24d86e31774c77cbb4cb2ccb0841cb0ccc392d2863a9ee28a52fa8dac8", + "swapImpactExponentFactor": "0x7f06ebca597ee9e3171b8bce637b368ae38f9832a9b69b7b9182ad85232d5dd2", + "virtualMarketId": "0x70772da3d66c09f0258ec93567467284138ce0c476bd39c033323a63c13e9843", + "virtualLongTokenId": "0x024e60601109020acd88458d1d543f3e2345a3f7cd30aede0d5ffd5ef9f84cf4", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0xB7e69749E3d2EDd90ea59A4932EFEa2D41E245d7": { + "isDisabled": "0x13826a9ee123e8a9c47bc090f66e9f00bf049fea47762322948edc1806cff1a7", + "maxLongPoolAmount": "0xba43e2118212f21fc5a7a5dce12528887b0970531025368bed1846901dee4b9f", + "maxShortPoolAmount": "0xc617029b95679ecc77d2f288dcc6254bd9484eee8f2966b88d2fb51f604ab211", + "maxLongPoolUsdForDeposit": "0x1582a8e78618b4ddb5c24f64383abb8a8d4dff3e87c08917caf87573fa43cfab", + "maxShortPoolUsdForDeposit": "0x009e932a527aa0ec44c5c6b1a4307cbf54d88d8c900b0f13dde35c35b823df44", + "longPoolAmountAdjustment": "0x61fe949abf04c95000a7c20f0b5390ceb4e23a98bcef126b8f7d7e604cb2c924", + "shortPoolAmountAdjustment": "0x267a9dc9f5b6a3bfe637786f9db5c39b78629f242f3d8bcd176cba96a8eb23bd", + "reserveFactorLong": "0x12e615b6607dbc90c9b6dcad281c29c75654e31c449bc0a90990c47b5dc0b90c", + "reserveFactorShort": "0x1ab92951ddee335c05b68ff7560ccd10c02bd3ea340064c64c723b096b3de30a", + "openInterestReserveFactorLong": "0xba760c9f38509f843d82c5d23471e3f340ec863c0a7add861487a99d88ba1278", + "openInterestReserveFactorShort": "0x931bcedc534134b925741109749ae3665225b537786deb1302ed6de72710f94b", + "maxOpenInterestLong": "0xc5cdfbaca4104d94b7154373b430f5007343f47def850549ac14c0e1f9169a18", + "maxOpenInterestShort": "0x6abbaf40ad42016d66793b1a5407c95be97e6a968e0cf12b10fcd11786d929e3", + "minPositionImpactPoolAmount": "0xcfab08c11678a6ec622fe8154a5feec23a111b55457e10191920169414f6ab0f", + "positionImpactPoolDistributionRate": "0x4d7f646e8a4187985fb68dda7724983f00c320b001633248ee3e6ee42fb37cf7", + "borrowingFactorLong": "0xedeb934ca0d6ce5439edaf6091eceb2dc85395ae4ee2ddb46762d2f9d5092e7c", + "borrowingFactorShort": "0x10db37b163615962ccbd0ea3325e6b06ee38a95670bd41e3fb909c4276bcead1", + "borrowingExponentFactorLong": "0x6ca3b11a4160400dd7b3cf15233d65463b86e25659fbcf91981cd24c8bd8c024", + "borrowingExponentFactorShort": "0xd712f49ccf0a7f76cf8a27ed030ff75df026c9e87213684ef4bfffad3b249aa2", + "fundingFactor": "0xcb2a62c8c9d6767f518f7ab1ac69e407a000d387618fcf0f01622f687a3689bb", + "fundingExponentFactor": "0xd7ef2ed8718748cc34b7ea6aae50d60061e39d577a33a832c793fd839a6b42b6", + "fundingIncreaseFactorPerSecond": "0x1636c921c7b361d37a0c4314c1d90bf8a7d2801176f72c82d4db4f79ed20ffa6", + "fundingDecreaseFactorPerSecond": "0x06959fc5cce137bb76a13da93584146a5a5df767abd3a121efa65fdd19f5037e", + "thresholdForStableFunding": "0x41b6f92c6dcaa31a382ad1ec08e97e98fd4a45754fe68ce742fc36ff7c1bca9e", + "thresholdForDecreaseFunding": "0x6880747d73f31c824fc0bfe34f072aba22853eeef7cdfecdece5b1f7bbae2eae", + "minFundingFactorPerSecond": "0xb20211e05157ffa9ad3665208d5d0323cf2c91cf938cf74d7cf6068f2c54792a", + "maxFundingFactorPerSecond": "0xcc699ede2997c9256b1197a6b45fec1044e2a5f5cf19b6c5b0c1f6fa998cf188", + "maxPnlFactorForTradersLong": "0xc723c6695a9b5598af4de3e27a64e8bfb5c1079334ae20b2ac01a5dbf3fda13b", + "maxPnlFactorForTradersShort": "0x5bc9090529cd94bcbdfb42182bf165d6024d177072db492cec78c05bab9b00e9", + "positionFeeFactorForPositiveImpact": "0xebe11e396eb1f9b2104202c8d05d730f6138cccc95a5a7cf183b235de07df730", + "positionFeeFactorForNegativeImpact": "0xb0db1387c147d7aead4388becf2c94d3f2fa2e6f8960908338a21fbab5d12eb5", + "positionImpactFactorPositive": "0x1eaff5142fbc691c04970ca9b0a261acfbbc76e2f052ad3b534055a8726b61aa", + "positionImpactFactorNegative": "0x80b4b7fdc25c6bc930765f247486bf3ca062f8b15113fbab0d41e05f1c13af98", + "maxPositionImpactFactorPositive": "0x30e99c791acc5aee7b6dc78ac7375ce3f9edf7745062239ee1b6fa54793ec829", + "maxPositionImpactFactorNegative": "0x2eda01c71a69850c6bc77ec241f94fa7dd2b3a5663a8e91c7d881a9b376c8dc8", + "maxPositionImpactFactorForLiquidations": "0xc3f4605a72bee84cf508210e7cc38fb8ec214af45a27fb5896bed941b4295358", + "minCollateralFactor": "0xc2edb3063d48246267159dc0decbc6ad303c34d2ca3dfccd5f22ca671ba417a6", + "minCollateralFactorForOpenInterestLong": "0x21af53e3b857539d49a91f80cd682c8386a7536bacee74a1e3694fcd304a8e46", + "minCollateralFactorForOpenInterestShort": "0x49e09964b342ebf117d63182ee4a5d8dfd68db919bc3246e63d6efe220a8936b", + "positionImpactExponentFactor": "0xfeab5aa4b409a9a9a3ac990b76057d6bc1959f9ee2fded5fcf41f952766de901", + "swapFeeFactorForPositiveImpact": "0xff7943d5848e1ae0a03982cfab38f79b5e09eab5e5f62e140ecc2c6a2f85f271", + "swapFeeFactorForNegativeImpact": "0x5a429e1ede60115ef530a2ca58fc82631d68c05947a67ca99fcc7620b9f5ac99", + "swapImpactFactorPositive": "0xc0cfe1a7954d25ec07bce3d66dab98e0e6f267790c569760cebf1bbab2261402", + "swapImpactFactorNegative": "0xfaeadc81caa528d9ef2ad32fae0acfde6fcd2b7caecb02a1636dd457cfbf8a6e", + "swapImpactExponentFactor": "0xee2501baa786d9721010c6fa98e1110d7eee82eb1f0e9445b705fd718bc9ebc1", + "virtualMarketId": "0x2d80a21b29895e87fde496f92f11c00e257ce81598b6fc6b10a23dae34451031", + "virtualLongTokenId": "0xa232c25fc2702b7379fa2865649cdb29aaf502ce1d0bdc6ce0a5bfb86d89f3aa", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0x8970B527E84aA17a33d38b65e9a5Ab5817FC0027": { + "isDisabled": "0xb63cfca5030680a7c2d749decea08686dab912b4044ae37fab7dc6151c5c0029", + "maxLongPoolAmount": "0x0ee75311695bf3d1ca19683bf8c99f8789994bbc21275e96ae556cfe6ec066d2", + "maxShortPoolAmount": "0xacbe8c391546281fc6bad991177377ab0fd7a156d1d243db72372e7b6b1e2bc4", + "maxLongPoolUsdForDeposit": "0x554f39ad937e786c332e6edda5475e8c63174232cbd784a5b1c1bc8060ee071d", + "maxShortPoolUsdForDeposit": "0xecbc498848ee7ea12a248377ea5048ea4de80a06a3489bb26f3ce851a4a35a46", + "longPoolAmountAdjustment": "0x4624a403792483e3a328c2f7ec8b7f8855084fc574a090b8eb9a49a93126ee87", + "shortPoolAmountAdjustment": "0xdfe3a3f0cc130afe1238c08f442d90b2cb91a2487d8607487640b176cccb7075", + "reserveFactorLong": "0xe0dabccb5c9a770b1ded30cd35164fa592cceecf0425ec0afc1c88d328dedeb3", + "reserveFactorShort": "0xc36d3ecc169f6f355d4c2c305393c808769b5a3e3e0029e4b184daec9d03c548", + "openInterestReserveFactorLong": "0x4583d42ca986d7b116ec69a3a1fbf8842f097733e3a18007d19fd216bfccc92e", + "openInterestReserveFactorShort": "0xdbe0abfe403834d6f5a3342e702013383c372e8b32ff1c595c04d0354d72fe47", + "maxOpenInterestLong": "0xf7b003b8f20212fb481fa02777c33986b043c387e670acf03a8294dbce3861e5", + "maxOpenInterestShort": "0xf1c9d4ad3d8604901139b388c4d5e3bbbac175f19717d377500461c454b70994", + "minPositionImpactPoolAmount": "0x4cce238322ed493ecee7a1011c18b0ac4b5d6ef10faf45d592bf5b3b57ce3219", + "positionImpactPoolDistributionRate": "0xe6acf683243b26e095be3923ff131c273afd5bf02b1584e0f3ee53421baf4348", + "borrowingFactorLong": "0xa9af27b1e526e62661a7c47c13bd7d12fd69152d80b73b5b03df2379596403ce", + "borrowingFactorShort": "0xf7688e09f851a57f8caeeef5d1ed3fbd564f9311e35420bf72b3e25bd12da973", + "borrowingExponentFactorLong": "0x749c038f4129e8220590bbec1934f5dc5e907f1e90dcc6967f93c9f4e18f40bf", + "borrowingExponentFactorShort": "0xd4cdb69750460c10851e28640ee0effe9cc09df1d8193aa2f390933db3cf8e98", + "fundingFactor": "0xa50cbc7a1e6f39c5d4285d4207f5a6156eb1e083a92f2a8e55a5c560872cb411", + "fundingExponentFactor": "0x2f128f147b01a7d0f27f3a795ccda4105fd8a5676fefcdaa06f972f78b2b51d4", + "fundingIncreaseFactorPerSecond": "0x30b177be282f8573ab8f9e31a7556a4d9166d324488ee793a380daf413f8344f", + "fundingDecreaseFactorPerSecond": "0xe26d4dd7ab435c45846b9cf0bf354c6fc95fa3b906df4122e6e2b14f954e4a63", + "thresholdForStableFunding": "0x47c92c576c572c1ed7a8a97a3c9cb01ac19644807ae10bad038499f9c93ba8d8", + "thresholdForDecreaseFunding": "0xa42cc0a3ece05f2315870b2e88b56a10d9291de4e7ce96b9b5b5cacf37331d75", + "minFundingFactorPerSecond": "0x640bef78a6b8e430cf1a9bbf8fcaffc5ceab463cc9071d3c494f476158cce624", + "maxFundingFactorPerSecond": "0x339531b45d58d8d4022581103de344aa555609a986dee2271d571fdc908f4e33", + "maxPnlFactorForTradersLong": "0x503ad4b2fad7874abfbdc32026d94268af5857b707d8ccd6cdf5fa832772675e", + "maxPnlFactorForTradersShort": "0x2efd3f2a4ec3819cbf55352c533036ca3d65488c891c79372dadf02092df0fe7", + "positionFeeFactorForPositiveImpact": "0xd0e35efb814d9ca4f45fdc44baf063dbcac15b6908cad3ee66c1cb92db7bd080", + "positionFeeFactorForNegativeImpact": "0x03c3809639c69d28aa9ed9966d12d8b3fd8f6d025724c3493932916bfe67f32f", + "positionImpactFactorPositive": "0xc344ccb8fdb0aa469744b8475e04e2635b7c780d96ed1e179192285000262875", + "positionImpactFactorNegative": "0x718de37c3d799a6004ef0742bd5d880f70abc00efce52e69a73701299d42b272", + "maxPositionImpactFactorPositive": "0x87906bb7a0d357d25f8ed21eabd489b025c321b2916e03f8694f319053bf1361", + "maxPositionImpactFactorNegative": "0x127276fbb55e276a0f1b3be9f0ca36b656d46b87215b98180bfa14e78471dbb2", + "maxPositionImpactFactorForLiquidations": "0xbacbc40e853def28c8e96ed81e0d395d1a9aa1e654a6e35b590a66b26cd16b15", + "minCollateralFactor": "0x44602657c72e1dbb7ac480657ba83e69528e0b3d1cdcf2232dc8f37156fc4d71", + "minCollateralFactorForOpenInterestLong": "0xcf807ed6fdcc8664b593225fc63bb816add4008d891a840fc6af82bb00f9bf3c", + "minCollateralFactorForOpenInterestShort": "0xd1aaec1d623b1045cdfb9e5e91e9ee1667fc872a64bab967a18ed039fbaf1c97", + "positionImpactExponentFactor": "0xe50ebe93dd21ce63048f6b6fc748a98f88786e0b798aa7bf3f8c594b729e06b2", + "swapFeeFactorForPositiveImpact": "0x4bfc0ff68b6a51da4cd8b290dbdca223e00ed95be57f4ec4d0387d80893f6042", + "swapFeeFactorForNegativeImpact": "0xd1f0eb18d1b70fd022efbaa081a9d9d49f5a66041f12a9ddd7d542b91dda9500", + "swapImpactFactorPositive": "0x419f18d9a5b531da198a09ba7ef2476b5eeae9c3a16e5c3d739aeac467d6a30f", + "swapImpactFactorNegative": "0x0959316b70af2ad02e67588267776e3771423d4755a6eec179108a4455b6703d", + "swapImpactExponentFactor": "0xbaa3866145a17207d0e14128c5635d797994884691d43aab2b26b0d235af844d", + "virtualMarketId": "0xc0e2e4d56b51293503332020d7b6d52bed703017fb82c7b29a5d05ce29f3ecff", + "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0xd2eFd1eA687CD78c41ac262B3Bc9B53889ff1F70": { + "isDisabled": "0xd594e20165bf058243df4495f1a9290c6d155a51f79d98b81ca408682af3a1f9", + "maxLongPoolAmount": "0x09e9c5470532a69078d67b80b4ada65ac3c445527e3483f113059c34fb5f1b66", + "maxShortPoolAmount": "0xfad5881227ece31b04d4542a77f6c6612e83574aaa4353f679d0d70bc186105c", + "maxLongPoolUsdForDeposit": "0xdac030f8a6d1fde6b8c00c4f071d570b72a2a8c2524ef2b5dd70c953c46329f7", + "maxShortPoolUsdForDeposit": "0xfa752292e654525d5ef45029c34c3769ef82cc490b70b25800bf95d9a35d8ba2", + "longPoolAmountAdjustment": "0x5dbfe7edb846d8f607f5acaaaf5460ce8a2b8e8d4cad30fdac286895aa8a1efd", + "shortPoolAmountAdjustment": "0x42dc820eaae0b3f0645b4dc2b23852dbeca5baad2a19945f1d7009b00689e642", + "reserveFactorLong": "0x2d4063190a06ec021239c1bc9bccf8aa894d27f8d3492dbe6bc2fce767b8ac4f", + "reserveFactorShort": "0x083123c6a54ceff4123ab5ba2a2c05deee5c5f34af274aeca5b3becdba0e3cb5", + "openInterestReserveFactorLong": "0x9947b50c874397f027501f3950c708a14cfe032ae3b8a29bc93e42d29a33149d", + "openInterestReserveFactorShort": "0x8037964892bac7384b6f1a43fc6e62c18f2df99202464d31acb6a9728893b955", + "maxOpenInterestLong": "0xfaf079891df722180d6351fbd45a3e6a0a47390ebf8a75f5f4685033856f2db9", + "maxOpenInterestShort": "0xbc5f02de8328378de1a8f3268fc7835320345c1f4dcbc0c9e2f13e54905ad697", + "minPositionImpactPoolAmount": "0x5ee526620c1de3c1a782bb7685bab74336fdf058ecf09ce11f87871534292ba4", + "positionImpactPoolDistributionRate": "0xe4591fb76d21ad7dbb3c10a48b19296a6161d47e8954ca4a6b24d2871833580d", + "borrowingFactorLong": "0x67cbd87da2de7b57d8b26fa5eba1fccf988650d8d348668f80bfd7e088037d7e", + "borrowingFactorShort": "0x38913398d5caa62645b900a0be74b9418bdb2a8be5bcefff5de095d13b5ac097", + "borrowingExponentFactorLong": "0x27cb153e10395dc82b31e5bb2762f8aa944f21ecbeab89ca3361a59644f2eee0", + "borrowingExponentFactorShort": "0x1c639409103fc4b57211c9ec7e543c00f0cd1df9a965607aecc96391ab21f1d0", + "fundingFactor": "0x7042e03cea1108fb39b70ec7d5cac82f9ff238786a712e8dc4b10ccbc6d6db37", + "fundingExponentFactor": "0x39337f0b3f9bd84d2240725d1ab2dc8fed9d5156f6e1eff0dbd5df8b94a6b97f", + "fundingIncreaseFactorPerSecond": "0x4e3cd5b1e36cc1ff3b8ffe829485949e536bda309615465c4371edffefaa69af", + "fundingDecreaseFactorPerSecond": "0x67932c13c8b109c184ad7eb29e6f0f98b465ec752d97059c87726f6f095588dd", + "thresholdForStableFunding": "0x9bce05a223998e127388f430609545a920efa5bb00e603c41c5aa51dac2ed3de", + "thresholdForDecreaseFunding": "0x3bc3861291d7b3deb3b63d05c16af2fa44f170f4636ae93f081a14f332bed584", + "minFundingFactorPerSecond": "0xc75e20a839b5638f5e07317e245fb458c8ccee406d69911b005c8017405c95cb", + "maxFundingFactorPerSecond": "0x4363b648ca091537e2c5408897e3c34bb6380b0c8870eb250431ddd4d9cf0fe5", + "maxPnlFactorForTradersLong": "0x3657770ac232bd911685198e77896550ac98ea07bd3be93000066572dd1fd8cc", + "maxPnlFactorForTradersShort": "0x2b6639dc74e8755ba6784ae540104e3b1c785ad41deb8ef4acc35eac48946a9f", + "positionFeeFactorForPositiveImpact": "0xd08ce0583fe23ac92c70660cefeac56bbefd6b54b303dd1cb722c3fcabb538f9", + "positionFeeFactorForNegativeImpact": "0xbe8cf5d2f567f1e7d9660088308c5a52b20c8068dbd2fe57c168ebed0d2f415c", + "positionImpactFactorPositive": "0x50bf2b50d5afe0943511cfe7e7f889efa38cc054fb783ba2e8c6672921681c81", + "positionImpactFactorNegative": "0x19533b0de3f3027fdb5f002bdaa315c9dd4cbf24b6a5fe39bc1754c1066141d3", + "maxPositionImpactFactorPositive": "0x2482cb95ad826a33a01a649439805f9295b2bffe6efe7b22a5b720cf7dfb7adb", + "maxPositionImpactFactorNegative": "0x40f507260eac6d8ef3148a83c4bbb9f3027b8dd0705c25cb0d87fee8f7f2f23d", + "maxPositionImpactFactorForLiquidations": "0x65f16fd2b957f2ebbe014e43740b694eceba4c8f42c90ace60fe4757d7585b0d", + "minCollateralFactor": "0x03257da2786063bfdd152d461897826eaf6dc4b2694b0b10710a6537e478ccdb", + "minCollateralFactorForOpenInterestLong": "0x958a0b1e22336db2aa2a005c0f60bec36679d2f78effd8393d8faa699cb6f401", + "minCollateralFactorForOpenInterestShort": "0x6ec70b5f9ac71a65136fe6ef68e9cccd1641597d35bb772801bffd12156232f0", + "positionImpactExponentFactor": "0x2067b76344d2ef6c31a16da6d9c602f6f0b6c6083b623dc415b7c54e9227b51e", + "swapFeeFactorForPositiveImpact": "0xf90922ccdbdf7bf5da782f778623194f62c4e1a1bf2feecd9c5d65cc21a052a4", + "swapFeeFactorForNegativeImpact": "0x19b9bf256fd0b1fd3cb363b592c1a5f6fce3898af1562c22259551a5325fa8ad", + "swapImpactFactorPositive": "0xf5aaedb45293401a80c2272b02d76b9e9aaa280cd4b02ea183b8e8e8dd1ecdc1", + "swapImpactFactorNegative": "0xcac9b44754232c7262bb194373f9b73d63a1d935f0fbb466fac538af440f8ac2", + "swapImpactExponentFactor": "0xf51d1fed9f0cc109d834f2868958a9c12cef620aa1a089a6878be5cd5b0416a8", + "virtualMarketId": "0x1cfc55f83c330e611551f5021ea4dd39c813ba02a7e0f70a8a55a6329fefede1", + "virtualLongTokenId": "0xda49ccfa12cf1ea3524e26695e8fbdb9fb312bbdcab838a1c14770e241241eaa", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0xA74586743249243D3b77335E15FE768bA8E1Ec5A": { + "isDisabled": "0x65e29639f68046df4008c5a0a2680adfa3f1e43e77d2331a262611a5145698a3", + "maxLongPoolAmount": "0x60f2c704829d8249fa88c49d4d8f0c866ee0b5633a943b93be5cf2f1a05ca653", + "maxShortPoolAmount": "0xbfe311b142f38e87c0429d85ad70b6e52cb339b415b3bea000185f7187440535", + "maxLongPoolUsdForDeposit": "0xd14ef246afcc9bb5c01ad60ff8d8759b553fb185758d4502156f02411c59b11a", + "maxShortPoolUsdForDeposit": "0x9a994a0d163257194e5b39755a77ff918519dccd11d1920bae4e49849fb66ffc", + "longPoolAmountAdjustment": "0x2f82b5ff7249f1971e857ef3b533a4dea90ace57fa35d40c24defa460a54f919", + "shortPoolAmountAdjustment": "0x4d1dcd55a421bced119df473fc45a401ac3f5067091495afb19670f4348eea35", + "reserveFactorLong": "0xc7b8eba7dc2cd86b5e29eb562ee6930fc4f63acee034404f40c081e4c13f5933", + "reserveFactorShort": "0x8cb5f9c7b8d5e54eaf836bf43dfd609d9d3577b9f2398f0cf99a67b49a33decb", + "openInterestReserveFactorLong": "0xf6bb18bd634133801cda5aea1e49e18f455e364801d54b262ee69b1f925fb532", + "openInterestReserveFactorShort": "0x751848fb1272546a60781f9fdab6d63a01ddd36a420341c3d7cb5d2816df3036", + "maxOpenInterestLong": "0x1bd4a12cc94f099dd17157635ba295f822038318e5c5062fd8ccdf1bca1743f7", + "maxOpenInterestShort": "0x2922165fed89a8d794f11ca1ad87858aff4957ab50a4df6298118c5c744dca3e", + "minPositionImpactPoolAmount": "0x4fcd92bac2260aef9820a682893a0f32080c89f06c7242e409f8c2daa53843e9", + "positionImpactPoolDistributionRate": "0x2a1c4ebbacc6cac9e24ed7747478df9aa7ae923f764268fd7823e2c77adb1380", + "borrowingFactorLong": "0x3b8308cafd02e0aa56ecc16d5e6d51ab799e75ae57ed7d39a0cbbd7bd2e9d133", + "borrowingFactorShort": "0x12235bf77f9e755f80c9f374ff73e05c4948e0dd88269c63fbdd503f8f58f6d6", + "borrowingExponentFactorLong": "0xcdc3606632ca1660504489c50490719a2d0271b60ddcb212d1a39b83a2124c1e", + "borrowingExponentFactorShort": "0x725f3ee7762e5154b80c191585f6c0c2c18f23a038de1c30342cced177d39020", + "fundingFactor": "0xc728de47308d2df7537118929f5912a35f816bf763b9b7cb6f3f80a6c5a37609", + "fundingExponentFactor": "0x294290716f040253b37709dfc3bf015393809a3d9144ce24ba38935090c83158", + "fundingIncreaseFactorPerSecond": "0xa979872922dbc7e08257f4f7e495b190dc1139852d8eae54b93453e4776f039e", + "fundingDecreaseFactorPerSecond": "0xdedd0e36fe36e3b0ba8ffbe1407d6f3375154756c8fd14369e793059f9f272bc", + "thresholdForStableFunding": "0x38894ceab632b916b8952c34357800ba528c8c4b7f59fd8d5fd929a683822424", + "thresholdForDecreaseFunding": "0x7c721dcddc422f4b9e712f1412ddd12ab1a10782a14488e43f99a711e682405a", + "minFundingFactorPerSecond": "0xd4714a43e072db2e4c2ab2d64afc1311028aa02e0e165103c5040e57e8e385d0", + "maxFundingFactorPerSecond": "0xc60cb8ec9c7a2ddc7592215b67a9910c4a5e809a0a941acec4dbac6c84a710f0", + "maxPnlFactorForTradersLong": "0x4004e4cb4f7de39fad349b0ccfed00751e05dfb34548abbcd5315e41f829d125", + "maxPnlFactorForTradersShort": "0x387cb59e244352f770fa55d46004fd6f25bfa7184a60c4c0bf8d1fd120968064", + "positionFeeFactorForPositiveImpact": "0x007d917567b487df00776907fbf3909e6e58e8bf6af6c915a571971d74fea386", + "positionFeeFactorForNegativeImpact": "0x2a9bf82d99539da12193636e2446af64b47b5c20d7277629a281dfef45ad8efc", + "positionImpactFactorPositive": "0xac6ea7f431089b9b98dc614c7fdd3090046b6c7d38d70e6f824e6d62fc09d18c", + "positionImpactFactorNegative": "0xc520bbf5ba1eb0f504168529d37814d8b0f495e3d27ab587043c8901c206642f", + "maxPositionImpactFactorPositive": "0x48932c41a37bb5d92ced58448a95e809e96961bd3f7832a7911e3041246e1be7", + "maxPositionImpactFactorNegative": "0x191b0a45795e7aaed845f26d2f8773c8257d42e64cea8af9fda6503f523441c0", + "maxPositionImpactFactorForLiquidations": "0xf36d46d20e0c1d149236595d78dd3ddd30347332890a251c867d61ec30100141", + "minCollateralFactor": "0x03ecbc69da5ac390ea111fe758b31fa45985710c5a9c25586abb760798bbbf9c", + "minCollateralFactorForOpenInterestLong": "0x5f9b7158e11769003f8be017ed1bf645a37c93d2c7f1a07fbcef8ec7f04cbb6a", + "minCollateralFactorForOpenInterestShort": "0x1de376a03ba431c6f254a42ac66ba838045ae552f87f4894d0ab5c0854f94ff1", + "positionImpactExponentFactor": "0xe4d2b50abb09343c53a1dfa74b24cbb4c5aad66c8e94cae1da7a611c0e637eba", + "swapFeeFactorForPositiveImpact": "0x1e5f4c350cf2fbeb7312594b741013cab6f982ba880e400fb00a410cb3abad5f", + "swapFeeFactorForNegativeImpact": "0x56c6c93fd5ef836406270f67fb0be7246f7414db276316b34265d269283dcf0c", + "swapImpactFactorPositive": "0xccc77f870ba42d778057d944e6c80fb332320084fea7acffec3838cc2c4b84e6", + "swapImpactFactorNegative": "0x581d1441b56c1e2c8de4ef60d65ab0f3ee119350688aa8214bc1f3f19f629eea", + "swapImpactExponentFactor": "0xc6d4eda05e33dec48a6acd523dbd21543dfdae520576087b2de5a6b6aaeb56ad", + "virtualMarketId": "0xca20066cdfe614d4256ea21d1c4be2e921d928fe96589d6ef330c2da92edef1d", + "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0x913C1F46b48b3eD35E7dc3Cf754d4ae8499F31CF": { + "isDisabled": "0x22b88879313baadc8c398c4238d14ee65f8324c66b28d046689697477ced4ec1", + "maxLongPoolAmount": "0xce879349bc886571b8a3351fd213b00e5079d838a11fdde0ea09a165b3e8fc32", + "maxShortPoolAmount": "0x64e7d4710a11185dafc270df33bbb127940c2b16c2084e42b04e347abee57e4c", + "maxLongPoolUsdForDeposit": "0x2d4e0e2fea17b1da5f94f6a4a5e6bfb0628d683279b1eeb3aa19043f5a82e916", + "maxShortPoolUsdForDeposit": "0x00fe56a7cf85e1c5b10d4ec9a14b15635c8cabd35335830a8262f73f4bf3c317", + "longPoolAmountAdjustment": "0xb2201b8ade078c545fd39888f7b979ba6da6e1df7ccc2f2c2400d95305d08db7", + "shortPoolAmountAdjustment": "0x1c206315dbcd00466f36d70f056bd44fc58f1d846198ef5c01bef57a7a5ce484", + "reserveFactorLong": "0x3d95bca9d182e31e667bbd28b7cdca72f0abeba45e9b47abf8472c18cd8ff662", + "reserveFactorShort": "0x08e88473f18751500ada8502d2823bfb7469a63ed60509f5bc281451ee3a7af8", + "openInterestReserveFactorLong": "0xec652e22e54520429c4c66bfa241d129469e5892b58ad950ec52473aad9d1da4", + "openInterestReserveFactorShort": "0x2e065990698f3664f136dfdb4474ca6a5ae7ffd23a4e7070024cce4e7a19ab73", + "maxOpenInterestLong": "0x232f67e0e3bdb84c9e666040965b6e7afc32d73e21df119c0ce09c8b161058e6", + "maxOpenInterestShort": "0x3ad62b9905b620d0d83000af842e4ab11a1b54808eeb216ab8540b7b7918f7c6", + "minPositionImpactPoolAmount": "0xbe8d046d34e481fb943b7d3ba82a8a88533ab76822777b7eacf5b8edd13cf8ed", + "positionImpactPoolDistributionRate": "0x50b8981ef5f576f3dfec1d4813944a8bde83e0a8de0045b11a2aebb2d1902490", + "borrowingFactorLong": "0x938784b5ef9a835e16d15e780449b614cb92e0e8cf4edd09b22127e545f922ec", + "borrowingFactorShort": "0xbf27df8ffc45b0ebb46572e8b68e2fff978caae7eb24321a9de4a81bace993e9", + "borrowingExponentFactorLong": "0x80b075bd993b75fe7ad8248fd674c83e46d850565712c09a96ad40a35d3f1e55", + "borrowingExponentFactorShort": "0x51de1a1dbaf72eb74d5d63fce54962304fe4ccdebc57346e4fc781c138beab1a", + "fundingFactor": "0xad51f27db3372e1361349d9c6b4fc7c2c0affe474cbdfd7ce71a5381d0cf9124", + "fundingExponentFactor": "0xedd81098c9826e18b53a9c63cace68ec568eadcde1ea3d2dcf1b94c415d1bc88", + "fundingIncreaseFactorPerSecond": "0x152b2d9a075a4d0444e27bd87f9f5a09b4a25aa2cf85b6ac5b765bec24bc3b67", + "fundingDecreaseFactorPerSecond": "0x29e010019eb64a66ee1b3414a3adbd711ba9ff1bdeeca09d0cc3d0a36815105b", + "thresholdForStableFunding": "0x279803f5d3dcb302dacd7a3786b0f00fdde2a5231709e0d14007c550f4b80197", + "thresholdForDecreaseFunding": "0xb158be4184358c7892d24fe957e7f5cfc4de63174e97e1093a06ff450d238a4c", + "minFundingFactorPerSecond": "0xb47df6840e8c441b355b931a1989d4f8d44bf8fb8693402b2c93aeb679fbe6d5", + "maxFundingFactorPerSecond": "0xe583c28fd1a56971b89b5ebafef4b397c75a891ecd2f3597eda555c9babc451d", + "maxPnlFactorForTradersLong": "0x260b5157f577177177d6e74a07933ed6d32ffd849c45791a0d8538ad1babb03b", + "maxPnlFactorForTradersShort": "0x43283c63738dfddde878706561d7fa7f4bb18ec01f2d9308279b83d303f0e4c7", + "positionFeeFactorForPositiveImpact": "0x7ec81b3e05aff0463fc38a88e0778c5e06266089c1c1c9ff80375db1c09d0ad6", + "positionFeeFactorForNegativeImpact": "0x5de7369530849ca490d75f556ffda8ccd56ba55bced76157c3810980600f0339", + "positionImpactFactorPositive": "0xc2527ce6d7f8c869e87302ca90c44863224f17dd52e949cec5034fe7d6d1b506", + "positionImpactFactorNegative": "0x3f918c6ec9c1980cebaf33b83d31c052e45c7ee570447898dedf2860a7da2bfa", + "maxPositionImpactFactorPositive": "0x44883af09d61a5b41c7deb568c97737dc232031443215f6042ab1fa0054e99ce", + "maxPositionImpactFactorNegative": "0x8d3d65312060d4e8c2e1ef88e1b12303fbb03e94b4067d2568a696aec00deacb", + "maxPositionImpactFactorForLiquidations": "0xff0330b70a4077634b40ca74c3933d6d7815a91a542082add3fc1ebe41273d50", + "minCollateralFactor": "0x27aae14bd281c4cad2e25eb7dddf2056cf33fe30c92334b6c1908e33603a594a", + "minCollateralFactorForOpenInterestLong": "0x35b24de0a1a1af62333ba0be24b03cf0639b0e1395d94c4cedec839ca221b0e7", + "minCollateralFactorForOpenInterestShort": "0x7a3010bd5329103b10512f4947b9d5ac36e6bc5677729ec4f8f68f35924f787c", + "positionImpactExponentFactor": "0x337e63e32187ff3fc173f5011397d5eabbdc507646d2393fd8fbeb287fc4b868", + "swapFeeFactorForPositiveImpact": "0x1d62b36458b3597ca93c501028c3de5017918bd9aca0ee3acd919329b2ff8ae2", + "swapFeeFactorForNegativeImpact": "0x5cd08eeaa4133f740cfe2c8d7f4ac62db55fbf503024a0c08b306fd39b48c935", + "swapImpactFactorPositive": "0xfb399f4414b807428dd2340b923793f8e3e223c3758d217c66c320265786db6c", + "swapImpactFactorNegative": "0xa7583e74286befd226ba820f162caca16ce41291b51dcf4210b99a53bf8d713a", + "swapImpactExponentFactor": "0x943c4ce8ee656546292d9a194c061eea37683b344e34d71495cd4555edee883c", + "virtualMarketId": "0x0e3547b9cf7cb8a1f155129657846708bfcb1d81d78835b7a4bd56ea3a22e29d", + "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0xf3652Eba45DC761e7ADd4091627d5Cda21F61613": { + "isDisabled": "0x515b593234825619c0e0ad010bed5b630133dd19e11b7b3e27d33d010d90fb83", + "maxLongPoolAmount": "0xf991eb31fe182bb51d89ea73cde4d7b6c217ddbb026c202f38269af62f61f131", + "maxShortPoolAmount": "0x269f1fae3a7b65896d9c02d0c07eaf30d633ceba04346ba62452dd4b4cfa3dc4", + "maxLongPoolUsdForDeposit": "0xb689c6b5a6fcc464b0d39d73b6303573b6117b1aa700b20f8f0bb87ed4e22b8c", + "maxShortPoolUsdForDeposit": "0xab46c37382eeb690d58ca27c0a176e88518985a9a7cae7c59b69666a08ba0bd2", + "longPoolAmountAdjustment": "0xee88b1fa8ce60960a1eba0ec28edaa0d964b7ac8fa4a418e0ea12718e5a16afd", + "shortPoolAmountAdjustment": "0xbaaeb3938a75f89df770df6694e06017ca9803679b0c1bfb8c758a9b211f5bc7", + "reserveFactorLong": "0xd605046cfc87a0b3589133bdef2515bcb09136534f1f841330c571d0d3346f5e", + "reserveFactorShort": "0x57a18137fa9fdda8b3b1bdfe836e3dc26a5c7b05ed37b84eaf034a5222e53d8b", + "openInterestReserveFactorLong": "0xbd8246a53141951996ef354ce6e8d9edd463105a58c5561787dc92460f81d067", + "openInterestReserveFactorShort": "0x5107bdbab62ae9cdafa9362423a08490e8360d7259c8f62014219ea239b68438", + "maxOpenInterestLong": "0x119a6889996fb0df27e7ff777dd97d6a5aa238259a3d5651612f4b2ba89d2d75", + "maxOpenInterestShort": "0x6b48b8751a363ba63e4fbb9da608ac59f7e0ac5751314d7c34cad31059b60d2b", + "minPositionImpactPoolAmount": "0x6cc01656778e79227a6beb7471c29c22d263fe83ab3a0b3e6bf285c63016dd01", + "positionImpactPoolDistributionRate": "0xcb5ce7603844a9ee73ecc988f220f02fdd75e7f52d2dfb7c29c892587f8e2070", + "borrowingFactorLong": "0xedca8ae9a866a3f8d1195371ca83413590d94668b5c59f9a73f6151d7b5f278c", + "borrowingFactorShort": "0x2a9091e6ace486ae5e44988d9543c984245ab8f5df1faa5eb873ae447caf485a", + "borrowingExponentFactorLong": "0x3d5cf84a406ac849ad12fadbf12aed8fb5c2f7e49055be0b06308d82cdc3091c", + "borrowingExponentFactorShort": "0x2f78884069091cf5dd177c377c54da0058ad8b45bfe0f01cfe9431c074b9f8f5", + "fundingFactor": "0x780c209fa55c6e4bb94ff26a964f113a651c3e5a008f83ce766ed1d2d4ea4037", + "fundingExponentFactor": "0xdee64d60e0196c58f30edee869e8103cdfa161cd8732132a7cd04cd4967f3981", + "fundingIncreaseFactorPerSecond": "0xc2a02c81c081e9dd998aee2ad4d573ea16f1217aa5060f1349c00e625dac4970", + "fundingDecreaseFactorPerSecond": "0x381c7ce8ccd0c0567ee5ac53de502389d7ce0ccc21217c1342c30cbf1002e9d1", + "thresholdForStableFunding": "0xac6d34c9877d3720bc955ae46780c13db61e2ca510cbded13a9e067b04074fab", + "thresholdForDecreaseFunding": "0x4ba0c7be1a37bfa9875e57a7bf7e47a4428bf8cde383617fc59632b143fbb461", + "minFundingFactorPerSecond": "0x3c6a9c6bf09316512873fabd84e71c83a6ae106c188a4c1d5d5be24cea6d81d4", + "maxFundingFactorPerSecond": "0x9c399ce61641bb1f0de20944b462410a44f2d09642ccf0a04c6d0f5d066aa031", + "maxPnlFactorForTradersLong": "0x4bfbce99eb77139d55e6df621e0cf75763a4593d151d8150bb501c048935acd1", + "maxPnlFactorForTradersShort": "0x242cc33a4317819d85f507e8d122cbaefed1ae2eac046c9dcd77511b6a3d023e", + "positionFeeFactorForPositiveImpact": "0x72816d892a8d960262b4fe693b71a6b9de0ac694a154cd31dcd7284bf516cdb2", + "positionFeeFactorForNegativeImpact": "0x6ba910a9a74e758085688e794fcbb3b0915c9b0cc0b288dff018b306dcad09e2", + "positionImpactFactorPositive": "0xb2c83f915182511fcb38344c11c91765c4152fe820e172cd68400029c8b937c0", + "positionImpactFactorNegative": "0xe6d1b89ac6f2ce52f9e9071a251b08d41ad0d7cb998360a09141c49b6bea4156", + "maxPositionImpactFactorPositive": "0x9a594d5ba6384739325febf4bddd5b6cca6fb616edfd9088afbee47fb41ff533", + "maxPositionImpactFactorNegative": "0x1fe2b6e82973868d11b609eaabb2aaad17824947cf596b31285207b6a783a402", + "maxPositionImpactFactorForLiquidations": "0xacd16f5d1fc4dbfe6e4d7ea04482a833154d53ee9158fd4bcf814a3c152c7968", + "minCollateralFactor": "0x698b96cd3a094ea412a7628c971920e715fe06bd06e200035b367b3dc046f745", + "minCollateralFactorForOpenInterestLong": "0x58330b893e1565ce7732e4b4d3255dc018500d7aefd5d58946144d3067508cc0", + "minCollateralFactorForOpenInterestShort": "0x2d6e8b614741229e997e7f625533433018db60bb050980a288071b2228df61b8", + "positionImpactExponentFactor": "0xbcd5e535b6b2461dd01c0915177b85bdf2ca0974c38402810a2dc5ca974cb8ed", + "swapFeeFactorForPositiveImpact": "0xa3ba4d614e29505bac315dee9664716cfa96cadb6207c8ead416299ebab8b69f", + "swapFeeFactorForNegativeImpact": "0x8b990fd6ef7a24250b629c7fa3d3e965f2ee10c1b17c15d9b072aaf0d75d11b0", + "swapImpactFactorPositive": "0xdb794233f573199e11b2568c3c92f38a3744dece73525f013a685e528bdc6e00", + "swapImpactFactorNegative": "0xd579ac5d1571cd61c69c378ebd76a71638e7312306b99fbdfeece3fa47ada36d", + "swapImpactExponentFactor": "0x29711b33c281e649cfa71890aa153b28782df34f91a2097dd43f8e75fc408262", + "virtualMarketId": "0xc8dd68fc490d88c3c3f4216f19696bb65ea304ce12cc32244656eabf754ee4d0", + "virtualLongTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6", + "virtualShortTokenId": "0xd76fd75c4452939b009a75d63649d6832a008e70cc237b16267c9be01be30308" + }, + "0x297e71A931C5825867E8Fb937Ae5cda9891C2E99": { + "isDisabled": "0x302941e9e98f2f9655ed3245cbcac54c716decd01138428276986d56a0c718fa", + "maxLongPoolAmount": "0x5c30ba77746a1a5a37b2636e225307dedeac99aa73e77a1bd0c5d9065ee1cf34", + "maxShortPoolAmount": "0x52a75c8582d44cf8c19d102d9f0c4f2128663e326960a8d2340c7891c2f63e06", + "maxLongPoolUsdForDeposit": "0x131b3c2cff98aed325d1b94f27b7a40f32e087c71bdccade1c6be7415dd86cfc", + "maxShortPoolUsdForDeposit": "0x8a121ef39dca2279ac44cb780b1bc5269ad97e5239df51ee855b7f808830ebc1", + "longPoolAmountAdjustment": "0x0c5d09c59ff7f61a65aa5addc86d1f2dada6c02a5315a87f5ae0efe847c8163d", + "shortPoolAmountAdjustment": "0xf309a338c0573788b5503a881606fd30381abe09e972cf894d7474a4fe713ca2", + "reserveFactorLong": "0xef0c63acac664a4a7cd1c920ef7ccd729ddcb6691438641fe582f319dd998d36", + "reserveFactorShort": "0x94d7e9afa99a67aab5a3b3b920caa3454c63d34623572e7636c2ab929ff1cf9e", + "openInterestReserveFactorLong": "0xc342533c0332f891defcde3416aa8794b6a2a839b69f6d74bc4f5eedecfd7f12", + "openInterestReserveFactorShort": "0x9cc5674b78d45d706d15f8f98cb25c633f8742236d0ba1689ab5d52d2639f22d", + "maxOpenInterestLong": "0x9cd198284644232bbb0bcf3c9ddfb999e0b041da3ade37b755afe319e91c3ecb", + "maxOpenInterestShort": "0xc7f94ddc2ed32d2a88d5313b204d67bd6e170cbdfc8514ac615093d3e9acec8f", + "minPositionImpactPoolAmount": "0x14f54b1176e55e3d72c4a688a722fc527878403c706c7c5581c6a0cf38d14627", + "positionImpactPoolDistributionRate": "0x58f638d8f6cf7d37afe24e85c251c951d0475119f08d372ab73cd459060a239a", + "borrowingFactorLong": "0x82b47a5363f5cbcc4daa2f9995f47e1052c4f4e331a7c9cea03042458cab46bc", + "borrowingFactorShort": "0xa9095d1017f09caa7506051c387b38df10dabe7a22f0d26111e4c0335a30cfa9", + "borrowingExponentFactorLong": "0x8c289c50d6124a7336b00339d183c1eda02f88eb9f09224b9ced8b5c8b7d6431", + "borrowingExponentFactorShort": "0x708407eba7b8bc8724eeada40dc7cf2f1e63c08df28878c1220a30e7b9eef405", + "fundingFactor": "0x8265d9e2c36482f93faa255f12e5c637f21197d7065499a49a6b9601dc662785", + "fundingExponentFactor": "0x7a1d8aca6efd186cffe32f09ef3278bc7df0b78c05e557173002896ba44ac9c4", + "fundingIncreaseFactorPerSecond": "0xdad138c26a8d92e1139b0056d7af95763f6e1340927da7125f753379fb547c10", + "fundingDecreaseFactorPerSecond": "0xa28d22d158edccac07f9af73dd35ca937394f2fa236f862d494f7641846fdda9", + "thresholdForStableFunding": "0x1cb3c817c0862e204182544cc25fe1f7da44ab3e44ac8e3faf7f63b7a3359f96", + "thresholdForDecreaseFunding": "0xcb02a2f6277ac02e74f6f8f24ce466a1804a5cb1b667340b9aea35962540c7bc", + "minFundingFactorPerSecond": "0x68109071d230bda5ad5709b01b801c20ac45f0e42eb9d6a70cc7f2456c9de6e6", + "maxFundingFactorPerSecond": "0xe7e734e4c1ee8b93b86880b6848f5b207f5b234caf98b8bc386b7e79ab7912b2", + "maxPnlFactorForTradersLong": "0x8f7a05cdbf1b297c4fcea4c609f84320afac0ebf972c4f616e17c44655115971", + "maxPnlFactorForTradersShort": "0x2a71f9cf361d204760610fd760b56d5b35a843c78755085077c75a48b6df8e1b", + "positionFeeFactorForPositiveImpact": "0x3ff5c2fda86cb6ac7357de79b9bca5e1ef107ddab75f57c0e867404f228a60d2", + "positionFeeFactorForNegativeImpact": "0x9cd7ddbb8e1b8f130805f1cffd550815ce4a4c2d07b961c3051da5f11f0669f7", + "positionImpactFactorPositive": "0x5c0251c56debcff9b65ee9d854dbf08d1c881deddfbe7ef48d37e8d18fa17989", + "positionImpactFactorNegative": "0x5840e8072ec9ea74977c498a91feed3c815d61b5f3062818f45df2b9d7b363fd", + "maxPositionImpactFactorPositive": "0x030f83905621bfd3cd25bbfe083e31bcb71db9826b067f346ee05170950136dd", + "maxPositionImpactFactorNegative": "0x1926d782940abb168cdd50e7c4a4db14fb213dab129751ff6b6cfdda7a1153e3", + "maxPositionImpactFactorForLiquidations": "0x72bbd2b2d9d41e43f87c725279a503454cf2ee59430cdde4b5c8efc5d07f0aea", + "minCollateralFactor": "0x3c8e9a2263e7b3aaed77f397cbb78c154d7df45c8fd9f3293610e7a9499f3bd6", + "minCollateralFactorForOpenInterestLong": "0x68db012f561515480190c5a28c8b7c8bff8bcfefa9f2329aa4ebb00a64dfb027", + "minCollateralFactorForOpenInterestShort": "0x3e66b9a84db4568cb7137ffa35aae284f2ee5221724165a49f4fab30490c337c", + "positionImpactExponentFactor": "0x71f13bfb0b47f4087378469ece6811760e36e271d52c8b788af0871595bdb4b5", + "swapFeeFactorForPositiveImpact": "0x82120bfaf43c7c864880c85bea94c8aed5961dce6c788d1b372783676253b5c4", + "swapFeeFactorForNegativeImpact": "0x9d43fe0c42b447782429e2c237376e87968a70de628212c5900a269da92a6c55", + "swapImpactFactorPositive": "0x5ac0772f7d1d01adeca5890fd7a12efb194b042a949ff9676956a1b18a6684d8", + "swapImpactFactorNegative": "0x1fda8752104b3cec09d2f3deae9a845297c27bf555787375a5095da13b00a0a0", + "swapImpactExponentFactor": "0x67ffca46672ad8e81a5ccd1f83a1b5ecb12177ef0235a68e15c3aba5f7e6d588", + "virtualMarketId": "0x6549f7db555b5b5ef63dbee7e89c8bc50bce7a187771064df386943c5c068520", + "virtualLongTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6", + "virtualShortTokenId": "0x3586bee7d2afaf337c8c1f94d514ab219b0472a7999137d2cb4c956a5e191ee5" + }, + "0xA7b768d6a1f746fd5a513D440DF2970ff099B0fc": { + "isDisabled": "0xa33978e8d9a992cb20162b4199ff580a04f581eb99c31ce412fc47591fff5f71", + "maxLongPoolAmount": "0xd87a8f1a03eabb7833a2b515e8e5c1c818f28eda6b9edb77d12c9c097e691128", + "maxShortPoolAmount": "0x387ae0c6d506bc857483030a7599b079e7dec57b6859e729b437b880fa38963a", + "maxLongPoolUsdForDeposit": "0x5355b103ac95cdf38b0dc0cae3195dc92531b5537a31685caf67f3fe6647a777", + "maxShortPoolUsdForDeposit": "0x70ba7395410d5b64982292466699690b6fe377710829ddd4e836798d80eb741c", + "longPoolAmountAdjustment": "0xa0321763c79ce7acea97dd13192879e06b88a43c0455df385d4553a1a9f569b5", + "shortPoolAmountAdjustment": "0x4b0481000fdc3c15cee3beafd494353c73c8bdea87d6e319b0930ef79a979691", + "reserveFactorLong": "0x74e0cdd80c0285b5738c374ce55ec59a452e654e244523be17e778b5091cbff6", + "reserveFactorShort": "0x4dcecac5bb0791fa2891dad919663e3e3944aba0a67489986209b6c5542ddb89", + "openInterestReserveFactorLong": "0xe7e09efec9568c23ff6c13d6fb2c457d4f9eaae157588d58d3277d521ac828ca", + "openInterestReserveFactorShort": "0xb133ac6d7faa07af3f13a90f40eea0a1213f73e3e7e118142d47e9692c784af1", + "maxOpenInterestLong": "0x9556f7c06a3d711b0bc40b4c53a09017b56726827e44253064898d4a04bf9b5e", + "maxOpenInterestShort": "0x08185e9868dbb026bcd7d1b0972e338089372444cdacb24ec392e217ce166b1d", + "minPositionImpactPoolAmount": "0x5186842e0c528bf7e9e0978fc9cd6e2ae2991fff2d6396fc2ff3551029501a01", + "positionImpactPoolDistributionRate": "0x1605cf238e9a1e12f705b4ca949f1332df310c64533307f3dc328c8198c687a2", + "borrowingFactorLong": "0x54943b1699bb9c551eddd3835662d8c527f4cf8c1c4c633a2d77ec123f47771d", + "borrowingFactorShort": "0x216d39f0c2649fc38232eab95d961b6adc2f9f054a200ef3e0cd9d39a3d9db6e", + "borrowingExponentFactorLong": "0xce4e0b6c89f503ad3d781c5678987082f55f1825d5dead4cd044de0d03d17002", + "borrowingExponentFactorShort": "0x2039a41e9dc5bb1feccfdf1bb7932008887cf65b2f38137dab8f8f50af155572", + "fundingFactor": "0xc6daac25778b26bd878940fdb7812659d7b0b05f230e8c97ae8fc423c8a595de", + "fundingExponentFactor": "0x51f55ab9fc38dc90989e55a2bc161434b23426b59a56ff3fb3ed1f0f0d447dcf", + "fundingIncreaseFactorPerSecond": "0xd1d0ee1c2b9071d59d94f0a8cf6ba05291111a1b4b14a9cb24759de39506c48c", + "fundingDecreaseFactorPerSecond": "0x95ac9a1948085296b4744303769e1562f5b0dd149efdf5f8b8af404461892616", + "thresholdForStableFunding": "0xd5e057b100362e82834904ea7cdc8bd9ce163bb197697ca50c098189b7c48b5a", + "thresholdForDecreaseFunding": "0xf12e633c08cec3fd555aecef7fc8c6ffd65af8b28f64a2b0af72212bc75dbc38", + "minFundingFactorPerSecond": "0xfbc054b55c5892601ece270aeb13c016e20b057a18b2f0f6c9ffaac09076a5d3", + "maxFundingFactorPerSecond": "0xf4a6e146dbba3de83c2a8aabcf4b4534960ef8f3dc3d3a65280175e9fee6ab1f", + "maxPnlFactorForTradersLong": "0x9273a00d6ed482033b858572f916738237adaabfde3490be6d0b711a5dfcf512", + "maxPnlFactorForTradersShort": "0x5a4471cae0c0e536aae769ddd3bbb923858fbc28cf44b3f334d627fde16722bf", + "positionFeeFactorForPositiveImpact": "0x6a49a1b6a150b462c7840424e50779181c431198c05864aa79c2c0297d288f36", + "positionFeeFactorForNegativeImpact": "0x34c8eee3a2807ea0c00ffd49ca20197cdbae2767ebb1b4bf906f6e4ee05b62c7", + "positionImpactFactorPositive": "0x72390a7575ebd481acb4a269886445b8b8f18624dd31366204ea5f052a5e0249", + "positionImpactFactorNegative": "0x1dc71efbb909b75009ef1ecd28f125af6248efb7cce08016373e95750fb1a492", + "maxPositionImpactFactorPositive": "0xefc0e6f13b3331a365027b599cb8bceaaa44eba98e35841da10f95042ce2ffc0", + "maxPositionImpactFactorNegative": "0x3f0f9566fb6f301b104bbcdab7775e865df1cffc16a345bb33f8807b947431ee", + "maxPositionImpactFactorForLiquidations": "0x75ecfa326eed4ad5245c1e4bfdda62bd8cf3edf7460afad031192c187071cf70", + "minCollateralFactor": "0x2c1b564020448b09588e27ce484dac4ed1e5788851545539ed25326726fa047d", + "minCollateralFactorForOpenInterestLong": "0x764b0b370f16745c38880c82893b0b0272f2631f1298984dce74474631a139fd", + "minCollateralFactorForOpenInterestShort": "0x0341fd2b324b8ef1cf6e9c3df7335e1ea580bf8a0dbeb293d36f45ccb4e7cd76", + "positionImpactExponentFactor": "0x6ee59d63c0332b05fdfd3c9c24565b31a667e9634f594ec3454331863bb0bec7", + "swapFeeFactorForPositiveImpact": "0x2b53b9fd42b44447585ad140436a690598b97e3a3ac95e23f5fb572474e47b91", + "swapFeeFactorForNegativeImpact": "0x3768b6cc037ee07054b27d75caca82f3c4fed7ad75cbb2cf6309c3bb6b558a1d", + "swapImpactFactorPositive": "0x4d2ba8b5784292dddf36d28528876fe8c70b2c1a23eba9b543e83fe6ce4fde58", + "swapImpactFactorNegative": "0x98753b02e57caff21ef4bdd4d67181248ece31553487ccb8d253684f83680156", + "swapImpactExponentFactor": "0x89f9737019e4ed3d7fefca8064ca1c1f1c2eac686143ba606cf7bebc80a84660", + "virtualMarketId": "0xee55fcd3a9c8f4786238e3def3fadc7f3ed6ed40c71c8fa94c27d23e9ab19f87", + "virtualLongTokenId": "0xec72fbd52db927c6d1c8a079da3496965cd1f007a9cb861600facc7dea1a2f02", + "virtualShortTokenId": "0xd76fd75c4452939b009a75d63649d6832a008e70cc237b16267c9be01be30308" + }, + "0xDf8c9BD26e7C1A331902758Eb013548B2D22ab3b": { + "isDisabled": "0x5ff9865d9c23947b4a553837068210e7fd1b0be85f20b312bff085e41e7b9637", + "maxLongPoolAmount": "0xe3d136ab93724398a3424aa3007206915357e930fdfe9cd7e36f2feed133ff8e", + "maxShortPoolAmount": "0xde187a4402526b6d5709e7e719c3f83e215fbd275e61bf1c4dc6e6e30c2d3c39", + "maxLongPoolUsdForDeposit": "0x42175f37cf91f0468b778ce041b5d74595f875e56c091eba5ba76ff505eadc45", + "maxShortPoolUsdForDeposit": "0xca413aefd04e44fc63fba9f965ba24b673f7248414e195491b16c659588097e7", + "longPoolAmountAdjustment": "0x9c76ae6d18457612e95d72ad17c7075cfade07edde25bde2d1752cda2e84b9f2", + "shortPoolAmountAdjustment": "0x87527a7b8ea5a9d617c275b0e00d072a28d2669515ecfb1cc4bd6fb86d741161", + "reserveFactorLong": "0x8f4fe9e8ea8066f68aa3bf86a73227604a58fd5255040812d5c7969e81d373ed", + "reserveFactorShort": "0x4b84643c9a65c65e4e92a59fa7f2052115c5fd7623c04a5d41965e2dd964540c", + "openInterestReserveFactorLong": "0x2215170206e10cf96cd6bbba4b34dda14005d9a4a9efdded7838d53c8a358d37", + "openInterestReserveFactorShort": "0xb38904d4029dc8fa7670acc6bb931c261a6bbdd0cc40381a57ad4d6e3049a5a4", + "maxOpenInterestLong": "0xd729a212508e22d6844ba29d0c9953439492043cb2de474686203322bf5a7b0e", + "maxOpenInterestShort": "0xf9264a688caf16ef5c319d6257eff2db3e7794442f39ab41164f8151daa2a370", + "minPositionImpactPoolAmount": "0x855dadd53680d51a9a8a20e5daee98f86f454fc40d4bda7be40ad59f3f4c350e", + "positionImpactPoolDistributionRate": "0x8ad3847563f0b81d6098cd66f11833f8e7f5ec33be66b072d0eeaa2ff86a7ba7", + "borrowingFactorLong": "0x2d88bccb89f29a7a56581e51367176569510825c5530c6f6859ba5032251b9f8", + "borrowingFactorShort": "0xc75753f2ac6cd8615ff4c613a0d7220f965badb0da3426360fa59d71e763574a", + "borrowingExponentFactorLong": "0x78afa82be0ceeec21db2d22130a754a9b4ea420012f866aa7df8bdcdc2eb6d20", + "borrowingExponentFactorShort": "0x1bb87bc0fbd95cbfafaa5fb995ee70e3657bb5619b0e813901dc8111ba8f9740", + "fundingFactor": "0xa035f79fcdc2de7ff9afc59c4272a3592c7d2ddee06b67bd022613933caf0abd", + "fundingExponentFactor": "0xf5634a4d1df5f3ab54623ac7173fc6b6e28d3867ae8e225dcf57e2b1cd8090e8", + "fundingIncreaseFactorPerSecond": "0x5701ec95ca7b6576e709286b500a8adce37e307b3de51939b51c987454e3993f", + "fundingDecreaseFactorPerSecond": "0xa36ab080d55ca35f5bd160f704710e95c09003488797741cea966dddb302ca51", + "thresholdForStableFunding": "0x690b9db75e2270c553b3f969dc06b922f85cfa5652d75fd4cf89247747bd52ab", + "thresholdForDecreaseFunding": "0x00cb3fef64523b2914d7a441554366892f23f4085e2b235a188c6d56c38beefe", + "minFundingFactorPerSecond": "0xc73572b91dd2b03f75d39479379b303c29ff95e777b8a2e3546e3777eb2ca442", + "maxFundingFactorPerSecond": "0x4f793acfb9cb975268489ed8551b3f2f46d2d0f8a3cd7a43491cbf8acfc364a9", + "maxPnlFactorForTradersLong": "0xe5ce7dabbd210f062e994ea004dd7f12c8ea4a7050eaed2faf3fb9c82e210576", + "maxPnlFactorForTradersShort": "0x8b3ce0762bdf8219d617fbff36144b7969b899768039a47a4a8acd6fa666a696", + "positionFeeFactorForPositiveImpact": "0xeb9630d085c018891245c6e5b7ae66ce78e43855b5d70fa82f19b150d6f85846", + "positionFeeFactorForNegativeImpact": "0x4511e3199a94aecfb03cf6734ee8dee591ee9f2a524325eb49e6c28d63292314", + "positionImpactFactorPositive": "0xf995c6a210011bc0300d3d784ceba4deaac6ece23aff73df2e74273d16483e3e", + "positionImpactFactorNegative": "0xa351ffcfb63dab651a9502901937d3e0c389398b5201794bc8150b8ff163ea6b", + "maxPositionImpactFactorPositive": "0xe94e46b223077a3dfcfed3014349de0924dbcafa5d5e12436a179b1148578c09", + "maxPositionImpactFactorNegative": "0x1240bf4cd804c59b4d70c5f53273a26a1f66d6a2a3b041c7eef81b64b2e64e7f", + "maxPositionImpactFactorForLiquidations": "0x69b5edc246570d7a59c97b4b024398d7872e5e809881f97e17c7edee0d084877", + "minCollateralFactor": "0x8c07e19be90a3b67ead909350737c6f60ec7994cf1284b8de1374a905df4782b", + "minCollateralFactorForOpenInterestLong": "0xe1a895360341ff2c180e3c4243d98086f42adfb2b9d2e5081ac3a5f955d63d07", + "minCollateralFactorForOpenInterestShort": "0xc71812a119761c33f9b4103ee133e3ccc0d55fadf484bdbabb43cd21eb503207", + "positionImpactExponentFactor": "0x9431bd8b3347a4230288b4bdb918b609eb1a647bc3c10c3db5e795b420ebdef1", + "swapFeeFactorForPositiveImpact": "0xa8d9f9cff183b65b7dca088651a8baed5af77625298af1a905ae91969311ec55", + "swapFeeFactorForNegativeImpact": "0x93427d77b84c63793a2d92dfa0d1f2129b49307b109fdf789f92d4dfc3eba264", + "swapImpactFactorPositive": "0xd4d4fec3dac5d648af883c5241e322bb47dcd508044fcdd52b3676e7a8609cba", + "swapImpactFactorNegative": "0xf7d514343cd53634029821b1b23419bffd04823ee244f6403632a85290c4fc68", + "swapImpactExponentFactor": "0x6598158e286f5d7fb1e33ce7d4d6d6cdc134811b72f3166399ca5f0683005f9c", + "virtualMarketId": "0x3a64ee272a461e24d42d7ec7a3457b2a6c46bf8f114b1dd0e9c80543ff93950e", + "virtualLongTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6", + "virtualShortTokenId": "0xd21809bbbaeafb84cde5c437ba0897bda019a417fac4e29387ef19cce3d07cd2" + }, + "0xD1cf931fa12783c1dd5AbB77a0706c27CF352f25": { + "isDisabled": "0x477bb0f0f06c70683ead00b1326b3eceb4275cfecbc4d8abc99f3efc884486b3", + "maxLongPoolAmount": "0x615f027c2592393f811a4b9758a2155bea18de2a1dd959b56c15a1f377f5bfff", + "maxShortPoolAmount": "0xa451bdbb4108beec08e1419387a5c95a8046d0c810de6b24e57b55adf7b369f2", + "maxLongPoolUsdForDeposit": "0x19e88dd652377c62aee339fbd1b4aaf894223ffce80c64f093d34ec0dea07a84", + "maxShortPoolUsdForDeposit": "0x95ac91e2d7cf026d6f6b5ce5e19f676d2f2dd28a32349a230582824a8b1c8911", + "longPoolAmountAdjustment": "0x853e0da44666bf300399d572df11d4e24f5b87d7e2577542af041f35adf0d1a3", + "shortPoolAmountAdjustment": "0xb70ef5d0fba0c7fbbd660d1deadff7c019daa1470ad4c55e9c29eb404e056180", + "reserveFactorLong": "0x26e36ff8dbe590da2c39e2f349d0e5ea97f374dd41a773a5a18111194583148a", + "reserveFactorShort": "0xe6a405ef7c83174bfe0769aef2ae2c24210c04fb584515d3d1d3f404f8e32043", + "openInterestReserveFactorLong": "0x2b4bf340e03fb526dd1b3fe625078357c42f3a486130bd903a622bfda506a0bf", + "openInterestReserveFactorShort": "0x51e7de0ff5bca3615ece7c9da528bdcc22b37a54cad9389fb51cee2cd50028d8", + "maxOpenInterestLong": "0x6c1c21c1d4f814300a9427680c6b54267849aa3e6dc2ed158f4c60efb3ce3035", + "maxOpenInterestShort": "0xfba3d6507914fc4a249c2184d67f8ec2647ea3fd71e10a96d67ebc9c0b6f9671", + "minPositionImpactPoolAmount": "0xd95c1cb820ab404bc52eefeb5223314044b1cd502bef7f5b2bed32d35b37251d", + "positionImpactPoolDistributionRate": "0x7335aa74e15984c046f2a6342d871dec5c4e315e4c7a0176d9357d5606ac2823", + "borrowingFactorLong": "0x975c5adc1dd144736ef9867cdb9ef42908c818bb13dd04e04ba50a82d40df8c7", + "borrowingFactorShort": "0xb2cdfa188abf3598e87becedbd694463d5d8cfcc63ce56268d3f6c9a14bc691c", + "borrowingExponentFactorLong": "0x13b25ecffc8c7acd131cc071a6c03e0c642546c4d541c6eb0d67682e4a362295", + "borrowingExponentFactorShort": "0xfa4281089a69ff0bfc485d547d4fdd24a4b31d516b8cd5eb1e490f760d319eb5", + "fundingFactor": "0x6d9d5e54721a9a7aed80afceb72c8aad8d7e3fc26c10ace636abdf97e561ccb1", + "fundingExponentFactor": "0x37e3630fab0a1ca15edd04a55b93ea87c5ffd97455ed2f12172e7370eb4c0519", + "fundingIncreaseFactorPerSecond": "0xa18f8097586dd5526ab7fb7644ed1181b79923c49cb7d4deea067d655815922c", + "fundingDecreaseFactorPerSecond": "0x37fd585ead5edaff3bfc4e9c10b6a04c13436674c52a516faffb4eb69cd65e51", + "thresholdForStableFunding": "0xfc35a496e1e710d91d922d9bc1a8c3b30fd2707b01763727cfda443b914094eb", + "thresholdForDecreaseFunding": "0x2fd52e603289e3d5f029adeee8a5f44e3e1a0d3a893d42bb6ae66287dcc88844", + "minFundingFactorPerSecond": "0x95f0c9df0f0e39e8981a1d2a6210791312ebfa1e682325730beb4fee0006886f", + "maxFundingFactorPerSecond": "0x87cda574200426b085d0a9ac4bf0126dfc9c003d1b5e856664fb881d2d2e31af", + "maxPnlFactorForTradersLong": "0x5547985ce54c37c2d55099fa306cb53b663eeefec986166283ffc78a99ddb3f2", + "maxPnlFactorForTradersShort": "0x30bbab14c6e9a74e4f0a9c331552123b1a1ed09050d7049e45a068cff9e3945b", + "positionFeeFactorForPositiveImpact": "0x52f75e2b52a2be4cf30bbe37ac74de800099d99c85ab644ecaf2769dcaeab408", + "positionFeeFactorForNegativeImpact": "0xeec77ebd209895b9b469d59875df04a8166aff79665dfa4815544afd8d7eeaa1", + "positionImpactFactorPositive": "0xe7488d5212884b2cd7c31a9d55af9caa7298e6bf97a817fa559aaa4ef9933438", + "positionImpactFactorNegative": "0xc4f2ae062f8c381b7c2c2ee80c24f8f49553e36fb19ba199947bca94109f3eb2", + "maxPositionImpactFactorPositive": "0x56f3bd4b6832379e513140b9c350ab03da7cc63005fd55651e65d0feb9784906", + "maxPositionImpactFactorNegative": "0x26ccc2913b07c97f219cfb9a1f1f5ed65318c3504404e547bde20c6c7d816310", + "maxPositionImpactFactorForLiquidations": "0xcb6ad3df6f86f0480c0f46ecf12b617607347bc774faf8840d30565f0006fd78", + "minCollateralFactor": "0x6e0deb754cc255b60e296d94475feb89ecb013d88a5091c3d9784547a2cd00ea", + "minCollateralFactorForOpenInterestLong": "0x39019addfc2617caa7a3c788332ec013a656af5eeb2726791dd869e978b6f0b5", + "minCollateralFactorForOpenInterestShort": "0x39fb129d3f05dd00fe0eaf0d95008439a0067785fd383e421191678b13db471a", + "positionImpactExponentFactor": "0xa7b30afea3af30a71b26148e633e26ce9280e6a9b0585f0bb857a52208354a90", + "swapFeeFactorForPositiveImpact": "0x4f4d5219acbebf609e4d3f6dfab866ab875b7493b5ac846a466dd651bd2c238e", + "swapFeeFactorForNegativeImpact": "0x78661a123a93d91d906d41c15c007b19ab8687ce43ae33bed9698de1fd05e9ed", + "swapImpactFactorPositive": "0x9b3474784c1a93dc2d0f8f721f7efefb15a584887583dfa3e303ce08249ae5bb", + "swapImpactFactorNegative": "0x8fd022a687a7b4da97ceb03d51c39824c1f0669ab078f69b9e27d1f044192986", + "swapImpactExponentFactor": "0xe32d18703e43af3e655c210a037d7e7e68a985884947ccaac21eaaf0f08d89b0", + "virtualMarketId": "0x967b7941411562788a55b8fbdf395c2c3a8be7b6296e0e170ea2f9d4d6c70f54", + "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0x3ce7BCDB37Bf587d1C17B930Fa0A7000A0648D12": { + "isDisabled": "0x81fd75655309d894ccead7f7d0bd73a16547cbe04d394353b9f8cff2098c8877", + "maxLongPoolAmount": "0x22a20531538b96f40f34405243b55c18bc03d308aa7c4337d74c90298f6e4ecb", + "maxShortPoolAmount": "0x22a20531538b96f40f34405243b55c18bc03d308aa7c4337d74c90298f6e4ecb", + "maxLongPoolUsdForDeposit": "0xd67e4a31d6a082198f959649d918f1132d5c2f4b17be7b201d41c136b4b35f47", + "maxShortPoolUsdForDeposit": "0xd67e4a31d6a082198f959649d918f1132d5c2f4b17be7b201d41c136b4b35f47", + "longPoolAmountAdjustment": "0xbcd50fae38d160909645505eded935455b18be4c9f51319daa8fca3c193ef3d5", + "shortPoolAmountAdjustment": "0xbcd50fae38d160909645505eded935455b18be4c9f51319daa8fca3c193ef3d5", + "reserveFactorLong": "0xbdd0d3306b1d702cc1fa0a8dcab90f1b86bac7487161ff21c0f281e5e995976f", + "reserveFactorShort": "0x89dd70a1455b7fb7f451f5aead81c9d4ed27486053a658eb7f726c296dd58929", + "openInterestReserveFactorLong": "0x58bd0b46b4206aeaf5d0bab8c5b967bb919085bbf9749e01039304dca3dff8f3", + "openInterestReserveFactorShort": "0x02eb8897a3b9d5ee58a35f1e4d9ff8f7591dad9f636995f311d9a38e6143e7c3", + "maxOpenInterestLong": "0xbf9c3a59d0b6ec10854c58246251580101c9e10e30a2fdcf6d9b3371df13807c", + "maxOpenInterestShort": "0x8319273ebbac883850ecc9af999fc10b77b7fa15fc3faa8b198c71fcd084e26b", + "minPositionImpactPoolAmount": "0xda4e1e9e70a681c4085ef673068bca76104abd4a97eb6a4f1d625d3f0e925797", + "positionImpactPoolDistributionRate": "0xd5ff08169e83462abb9cd85d66df11804789eea5f8eca824690cbffda4b246a0", + "borrowingFactorLong": "0x0ce8c6db8461492ef81fec9a6cb4a26bea32b26abd52f7a25820ccb480af2f95", + "borrowingFactorShort": "0xf6ff4cacb22a76a1b9dc5192693a64431951893b6370503331d6edca190232e6", + "borrowingExponentFactorLong": "0x55c8986ca7d4dd6f23d9a3776e26f45d2b43c649205dc0a46c989cd7e3fe25c8", + "borrowingExponentFactorShort": "0xbef1b92ffef25e4fbcbe4767d89bc7094da7ed78aab554e41185e8e3fc3c75eb", + "fundingFactor": "0x4cd52807709a8602dde5328c06c2710f6cbbd3be2248b2664ae9a5283f393a6b", + "fundingExponentFactor": "0xd49fcb35768e1d4b3266caac932df4eeb62d02d4c1a6459e2d6ea7cb3702b394", + "fundingIncreaseFactorPerSecond": "0x8efdfc0109f2d5fd3f3500fddfb3193574bf90bee355d4688a392503ad2cdbf9", + "fundingDecreaseFactorPerSecond": "0x436ca9ca057fbd87b38fd45ca55aa8dcd7a622d9c6c8c8a3da02b4deebe8b159", + "thresholdForStableFunding": "0xf28a822b624fe965a71f52a485c72f5d910c8b15b2d5bb1d834864f49bf7f5f5", + "thresholdForDecreaseFunding": "0x81a7f18d0095a67d6351ebb760c1749c3c50c2402df8574a016c4b5868e781d7", + "minFundingFactorPerSecond": "0x32396b0384d2847c8599c333fd27e382b85c4b6639a8fc259f3c867a979fd5da", + "maxFundingFactorPerSecond": "0x004e278e7702bb56eea4b7bfa829e24caf2f518450986ad173e546530d2e0b62", + "maxPnlFactorForTradersLong": "0xc5e37a7383f04094590554537fd623f3f5e2dfb0c1ed990e050d311dec0b4db4", + "maxPnlFactorForTradersShort": "0xee9e62068284a18ed2aa3b418994b275c3bdcec92ceaf9df9e5424cce221f64b", + "positionFeeFactorForPositiveImpact": "0xadcac867fbe2a8921851835e116067be9c8cb80a25e3f9dc8605f42936c0a6d5", + "positionFeeFactorForNegativeImpact": "0x77dfa60716036f7a00a2b0fc133c1fbf8a019ab698205223897a482a4285000b", + "positionImpactFactorPositive": "0x7a07316499b40f0073431796eece11c8912bfd12dfe2996258ff15f97531c120", + "positionImpactFactorNegative": "0xc20c88d27b7d859c64ca0ebedb1966de23dc1f690724efe32accfe87c5a6861b", + "maxPositionImpactFactorPositive": "0xe9bbed667ae52cbcc22d8903f5f3c889e17cc0b4a6fc995a26385ef189bb8c68", + "maxPositionImpactFactorNegative": "0x3c09dbea3b5ac087cac8f9c8f775aeddbdadcb2be2d04ec6e7353bdab8da7635", + "maxPositionImpactFactorForLiquidations": "0x8e295cf7af601901120e22edd2c3ae17b6fa8e0fcf16c1744f374054ae457b1c", + "minCollateralFactor": "0xd2a56837fd65e7a57ec1b4df363df080248a402cdf8e4e10d32205f1299315c9", + "minCollateralFactorForOpenInterestLong": "0xf7423212c3b818bdb9261de36121cde34561293943f7645be9b61f0c35d8a996", + "minCollateralFactorForOpenInterestShort": "0x4940911a4ea682a30fc360ef3c5e02a757e3602a50c2abe4c13542699a19566c", + "positionImpactExponentFactor": "0x795f98ee94796448bf3c91698960e4f41eda771cc887322c8157f4ab66fdadf0", + "swapFeeFactorForPositiveImpact": "0x8051fea8c9ec4de78eb316a8f6d57c8d0b9d3dac08c8a31160bdb0338a464696", + "swapFeeFactorForNegativeImpact": "0xd4a1049e6ea909adb6b8b5053de089ae6d2daa94063b181bde473d202ffdd8e6", + "swapImpactFactorPositive": "0x22637b36db12b76a57e8d2282175608a9516baec885472a076edde09e43cc8c4", + "swapImpactFactorNegative": "0x61bc53940189842d15da4f36e1a347872fbeeaf835344cfcdd930d6a2a9f7d69", + "swapImpactExponentFactor": "0x89d217876518450d1fd8f2c44713331334b39b926d37e7afe8889a1bbdda8164", + "virtualMarketId": "0x77f19898cd1a7cd3a2373f07ce7adf59726704da9419de76c0b1a965a6ef2c19", + "virtualLongTokenId": "0x024e60601109020acd88458d1d543f3e2345a3f7cd30aede0d5ffd5ef9f84cf4", + "virtualShortTokenId": "0x024e60601109020acd88458d1d543f3e2345a3f7cd30aede0d5ffd5ef9f84cf4" + }, + "0x2A3Cf4ad7db715DF994393e4482D6f1e58a1b533": { + "isDisabled": "0x1a5aace098fc7bf1e77a1d223817247a127ba3f895bbf0cb56b6d486a38ece17", + "maxLongPoolAmount": "0x02db896e224fea134b65ed9c13c6e8efbbf08befe6bfab67e3d55938f0a90d01", + "maxShortPoolAmount": "0x02db896e224fea134b65ed9c13c6e8efbbf08befe6bfab67e3d55938f0a90d01", + "maxLongPoolUsdForDeposit": "0xcf3333368ed0e029fc2e4e02d8f82df3f94af16e595ca98f21253f09e1e6532a", + "maxShortPoolUsdForDeposit": "0xcf3333368ed0e029fc2e4e02d8f82df3f94af16e595ca98f21253f09e1e6532a", + "longPoolAmountAdjustment": "0x9789b14ef610305867428dd962c931e9de4b8ae754a0288ce14f74f731c55a8b", + "shortPoolAmountAdjustment": "0x9789b14ef610305867428dd962c931e9de4b8ae754a0288ce14f74f731c55a8b", + "reserveFactorLong": "0x1bcef2dbaf481692ba329fc3dacff57c36c8b84eedd3ae0739b9a7a0abcf3204", + "reserveFactorShort": "0x95e41f03674aa8cbf6d91749559df826d410fb6ed0c748bb0af8adbcc588bda5", + "openInterestReserveFactorLong": "0x952524dd872db28a942cfe8bc9105898096a748b0833c517b90a6738b9c74c03", + "openInterestReserveFactorShort": "0xba9ab2c9267d098edb8ee96f56f00b244526ef160d9997c064c9bd4a41d84e7b", + "maxOpenInterestLong": "0x2a61c9b86c6416f2a2fd7ee25e87a6bd3982dd4e92205f4ebb7c130d00f9287e", + "maxOpenInterestShort": "0xebdef5ff891b682987a9ba61926618962b1e23618714474fbd589c56dbfca7b3", + "minPositionImpactPoolAmount": "0x816dabc15fbe80df2401cf9cd30fee4f080dbae48e36acf08de99f56c026e0eb", + "positionImpactPoolDistributionRate": "0xcc211a3a382441464d4b9651faa9289a90d3892bea898df55bb7b430a0c4d510", + "borrowingFactorLong": "0x52e14a12ad838c69d9cb67d3b8db0d418ab7bf9197139734767d3d8766fb2a11", + "borrowingFactorShort": "0xee0dc5a664655adc12c4c75c308b1da0275ed608f1ed9ce9da0d3a0a4983f762", + "borrowingExponentFactorLong": "0xd7df9edd7038e2c8db48039cc4ef0bba44b9037aed3a2f98bd97ae3603f4b261", + "borrowingExponentFactorShort": "0x66aff815180d8e711152d5cd44f4480566d10093fb5057531518257e10361a9a", + "fundingFactor": "0xdcad92cb5eef233d27f943f5211dedfd1ccee2444b1f5bb8450ca0808b5a8cd1", + "fundingExponentFactor": "0x90383179045de5f5dc98f932849e75ebd0f89d11c31048f6841e1a8a99c80c7d", + "fundingIncreaseFactorPerSecond": "0xa443ab703e59cdaf764a12260c1eb204bbd4e0df138a8f34cf382f2ed1fb3609", + "fundingDecreaseFactorPerSecond": "0x7327c19f3cc45b228488780a301c4bb4747d7ccca68c65b96c58686b2cd0bba0", + "thresholdForStableFunding": "0x484c880a4620d981eae9a7c2f92f2e0c55cd810593c055d6ec6759bb29158bec", + "thresholdForDecreaseFunding": "0x0fb6419a4815ccd3c946374cc952ddeef570bab97762b484728ca8873ea59f21", + "minFundingFactorPerSecond": "0x8d927e0078b66f8ad5396174ce5adbbab7270c40fc2effa0604094140ea7493e", + "maxFundingFactorPerSecond": "0x5e9c13af5bd51073d690fcf1d92ce4fbc5a18fe616d0753b9b8089f080d46d2f", + "maxPnlFactorForTradersLong": "0x111c54fa8fa9b8f89c04ea2006627602fd015c62512f1c5e61d432c1fe942968", + "maxPnlFactorForTradersShort": "0x5cb4e4a6d83ca3d2868a466198d3173d458c899f7555f78541290b9f644f23f8", + "positionFeeFactorForPositiveImpact": "0xd7d0c01acab1ea6cc465b2701c6b5e5c5292c6ee342c478556ca16265a760d0d", + "positionFeeFactorForNegativeImpact": "0x00b6dbe9a37a2707f1be21a552e2463cfbd8db4a5e35ccd714b5c0bb29e97eb5", + "positionImpactFactorPositive": "0x6f94cce3663de546a3528f8755407b57f03730094ba6f211b0e42a6a70f8eedb", + "positionImpactFactorNegative": "0xee2c38b11e133a53650fbfa980cb4bc36122945f2602992ef66fde5e64eb72c9", + "maxPositionImpactFactorPositive": "0x5bf9efed9d033d8b3d82ac1ba1702bf49d60d7777d313cfbb63d8526acacde52", + "maxPositionImpactFactorNegative": "0xa072463b5208c63f61e70635833da9e17f4c8b309731674dadd4b5ed2aa2d6b1", + "maxPositionImpactFactorForLiquidations": "0x4c6abc8a7e55f93dbe98925db44f441c8a6d58ae4c30f1c292d2de9be2bacc8d", + "minCollateralFactor": "0x2f63aa6789d2240d4a5aad10ba4b0c0db02e4972c9dd4ab57f67efec5028c9fe", + "minCollateralFactorForOpenInterestLong": "0x8854c35c045fa4645e96d74bbd69b2e0bc8404a342aa528d70cdc0c015026ca9", + "minCollateralFactorForOpenInterestShort": "0xb0c72eb9d2d10ce537aad4e5cd5d143f5b5c48dd97242bbf412e9389771dcb22", + "positionImpactExponentFactor": "0x64355c2777d71979de9e4cdfbad1d22d2f3c0162f675b37da17c3f912c43d52d", + "swapFeeFactorForPositiveImpact": "0xa84ba5835f870711f5395ff91353a8b6cad4f3c91c427a56d5320d1a1e73df7d", + "swapFeeFactorForNegativeImpact": "0xd2ef95e30885f11501ff5474333b4ddab4a7c3348404023f250f4b4cc35868c5", + "swapImpactFactorPositive": "0xbcf53b75dc064d05b8bbae7a8a9024400149ad81b3ccfb631fdcda0458c165f4", + "swapImpactFactorNegative": "0x3dcb45d69a8bf6040e48ce2cbb0331be6eee579fa2332e638f0399c4b36e059b", + "swapImpactExponentFactor": "0x9e8158dfdc3ab305b80ec742213b82433923bedad9de6c23ef432f9e4dd99126", + "virtualMarketId": "0xf72da44ec773ac1dc4cacc096bd5da89a67f7b684430092e1c2360069d5318c2", + "virtualLongTokenId": "0xa232c25fc2702b7379fa2865649cdb29aaf502ce1d0bdc6ce0a5bfb86d89f3aa", + "virtualShortTokenId": "0xa232c25fc2702b7379fa2865649cdb29aaf502ce1d0bdc6ce0a5bfb86d89f3aa" + }, + "0x08b25A2a89036d298D6dB8A74ace9d1ce6Db15E5": { + "isDisabled": "0x4a039a6cd4656d0288d14eda84197a57169e304ed6228d62d4d9c31762649fef", + "maxLongPoolAmount": "0xff7de4db9925bd629829487babdba8eb0ce1a2429f4042d3c8054ac2600b02dd", + "maxShortPoolAmount": "0xff7de4db9925bd629829487babdba8eb0ce1a2429f4042d3c8054ac2600b02dd", + "maxLongPoolUsdForDeposit": "0x5fb4fb3c94f2fe7bff54d460cfa27d94461b8d54cafbc2cda17b4c1ed343f832", + "maxShortPoolUsdForDeposit": "0x5fb4fb3c94f2fe7bff54d460cfa27d94461b8d54cafbc2cda17b4c1ed343f832", + "longPoolAmountAdjustment": "0xddf8f7919810570f7483a3325c90d58f153d58a1a3538173e93f9f08f6421a4e", + "shortPoolAmountAdjustment": "0xddf8f7919810570f7483a3325c90d58f153d58a1a3538173e93f9f08f6421a4e", + "reserveFactorLong": "0xe562fc3eea980c57f5ebce4a284674d37bd4c82c0cc8b3136bce6e65526c70ac", + "reserveFactorShort": "0x59921611f2f054a6c8f02f29e741dd6920044ad197cab77b5ad7c1e7046bc202", + "openInterestReserveFactorLong": "0xf223494ca491eeb8879ede7b08de4a37979b6a1dbec431a7171cf11217534166", + "openInterestReserveFactorShort": "0xd789373e6d44bf003c256067eff52fb84cbeecd9ce3abf67f5782b379adc3b95", + "maxOpenInterestLong": "0xc113d495fd2f93d9769d6221a1ae31b9eec1f7e7c91f5193bfe11101c7adc3c0", + "maxOpenInterestShort": "0xa837f82463125617556a56508d83fd7f0693907dd116d45ed1c527d938a00afd", + "minPositionImpactPoolAmount": "0xf3e6f88710041944063793ae92c5ff44fb6c71b1bfd9620d7944eb1e0b537de0", + "positionImpactPoolDistributionRate": "0xa2f25a3e88a66c90424ec966a5501917b971cd78a57d070f6657dc1120e65acb", + "borrowingFactorLong": "0x4b01bb639c107b621fdc1a3453514af227b88af50f66807ef850ba612aaa0f13", + "borrowingFactorShort": "0x80a72e1b34e53ad2829a7cbb5598518cf1f441050ca745cf8fc4e93a79a6d274", + "borrowingExponentFactorLong": "0x41ec51696557c763ff8c0bb1a1e0c112dbc868a11233feeeb778793ca8eaad51", + "borrowingExponentFactorShort": "0xf9a74442ed6dd9c4e1bef183850a722ab862c35b45208c4b4649535f43226da9", + "fundingFactor": "0x2f38d99ee7fa8d273445c99b6a7f80cbefbea1f204b8d1fe521321881762a00a", + "fundingExponentFactor": "0x95026c3ae356497d27c541df8011b2c1a8adf41bbe4e5471baa9586f32385093", + "fundingIncreaseFactorPerSecond": "0x1217a7459ca450ed6c29f56d328ffc8b69ed6767abf7da976374d21b2dfabb5b", + "fundingDecreaseFactorPerSecond": "0x71e16a0ec0ad84e826b9b909443de3eb472f5b557f5e84e1d2cd449404269018", + "thresholdForStableFunding": "0x2f617bf6d42b7958dfd52f5728df94f165d7ba5455007a2adfe8f6abc8acfc4e", + "thresholdForDecreaseFunding": "0xd1fadf6abd5d2859d38751854a712809361237b829ab0fec7287400021dc708d", + "minFundingFactorPerSecond": "0x67fb007b047bffad01ab075fdc9cc32114a635ececa2469f60be5f6f64967121", + "maxFundingFactorPerSecond": "0xd1c75d99d1e0d55fed811ab7109f61d2a5fc5dc753395161e0a250bb568f1eb7", + "maxPnlFactorForTradersLong": "0x5178c9558eb7f0e67cb317eb0f0db1bd5dc31e9af20d0431221c62cebd6c0f43", + "maxPnlFactorForTradersShort": "0xb9d62f806f60de1776cc1a1441f3166ff0f040f1290e9f1edeba9e884fc29b3c", + "positionFeeFactorForPositiveImpact": "0x85da364e330c83367e0ff53a8201bc1233422ba6defc548390d2fb6a93fe02b3", + "positionFeeFactorForNegativeImpact": "0xb8a86fe041a22eaf0cebba2f98c6dd1a531187f598e901dd6789bac6b2ea7e77", + "positionImpactFactorPositive": "0x64d7622ed8e794198faf8ca31ceb147ece9c26b6893932e57df76a33c36fcbd3", + "positionImpactFactorNegative": "0x0fca63fa41ce47cda279cb680774b4933f5ac163bd047f18e91981cc047f107b", + "maxPositionImpactFactorPositive": "0x3f0459921f4e5e61cb8d446dd272e0bfd9f48cdb07d56369dbbc483b2722412d", + "maxPositionImpactFactorNegative": "0x0a70f20878f3ebcb0412780dd074651d29dd4e33564801af749ec1b219e3ce86", + "maxPositionImpactFactorForLiquidations": "0x0c38e8b8f845b3cc6c44e36ddf308aead734dee480d32f423c9e7e77f9b0c20d", + "minCollateralFactor": "0xd38d20369d10ff1ed3db4eac4f163d02310aedcd18a1d8ffd0e6e3ebb41d3907", + "minCollateralFactorForOpenInterestLong": "0x09d4ab823430791729510b7468eaaabcb5e8c00f90ecaa1c0fdcffec4c8aaa0a", + "minCollateralFactorForOpenInterestShort": "0x579b51b3578168574b5541908b2b4d2a82f61c2e826c25afabf9d443e128d5ad", + "positionImpactExponentFactor": "0x35d0a868df28094966b90e68e435ce14766666913cd4ac19de3d2f6e17f350d3", + "swapFeeFactorForPositiveImpact": "0x33a28ad90937883abb9dbc045d6711064d05be93dc5f2805878a0fc4c3847fca", + "swapFeeFactorForNegativeImpact": "0x671f1f5b7f0621951ea9fe875c9f5d648343b4f77ed6ade840a32b4caf223378", + "swapImpactFactorPositive": "0x780903830a9905f560d95f984e56ca7a535833e0bc89c7c2de42ffcbb432b0c2", + "swapImpactFactorNegative": "0xdbe58f613a7e4a83dd8f4f2ba745c6bc2a0c8f5d5558b611dbc0d06a12f8d934", + "swapImpactExponentFactor": "0x6056e3873031dae6bf9c4ca9cc825412671792c122c3ea69a648c5cf3ed93be0", + "virtualMarketId": "0x86aa973b70629617ddd3d6184ccf9da90412d10b17c1ab38ec6fceea9a7b93e6", + "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", + "virtualShortTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520" + }, + "0xfB626c4e3E153947A6A94041814c25E449064dAD": { + "isDisabled": "0xefdf0a2950665bc1a8caac7d7a4716400a29ed16132fee4e61889f12a5644c70", + "maxLongPoolAmount": "0x9251fbb1d76d0ad063c7e538f1496058fd6eb17ae5677d12ba4910b5da7f8ff7", + "maxShortPoolAmount": "0xebabb42ace11d5b2cca07d5b2eaf951dea33fd55ab67feefb6b942afb5bce136", + "maxLongPoolUsdForDeposit": "0x215a065bdc41b5c2f60be346d66ec17766daeb5590d7e6e3265b3c84441fed67", + "maxShortPoolUsdForDeposit": "0x231bfabf34e58600544c372c2c9a633e34522a7a8902749767333dec39dabb2b", + "longPoolAmountAdjustment": "0xd45cc3af266884c908cbf1e9135418fe8e11dd00a9832699fe75e9049da2a840", + "shortPoolAmountAdjustment": "0x836682f04df203c39a87209f85a42f76e2c28ecce9d6cb5d068329a35e300d38", + "reserveFactorLong": "0x7ecedbd96dda9fd60e0ce1e8f59604ad8a6d8e3e92433d5990cfb020f5fc9d66", + "reserveFactorShort": "0x67f19a6fc1cff925425cd3d9dfc83ced7e5c045d973b5f4e09edcd3909ba520e", + "openInterestReserveFactorLong": "0x10f7ec7584c6ad4139bbf3ce1669833ff2d9291662b1e12c05d2659f3ebe0bcf", + "openInterestReserveFactorShort": "0x2db3a6dac9dba48ee72ae9a2551fd8212909508ff9dd3ae1d509889e98794b43", + "maxOpenInterestLong": "0x9479bcdfba37bc6c2925b739acc57d4c6d419cb2b6fc157ba0b05d8af1fac0df", + "maxOpenInterestShort": "0xfbf956fdd89eb093afadcab0ffe136c6258db7a049e82f523547bd5881d2a9ff", + "minPositionImpactPoolAmount": "0x9535d5116f061f8cafef466b74f5a45891df6a9bdcc3d087ff4efc909b236615", + "positionImpactPoolDistributionRate": "0xed79606f6c463ad9d735aad655b3d34ab63bc809fe63a475364993567cb147be", + "borrowingFactorLong": "0xcca09906806d9bce9c4db9e260e71849b0bee9c4093de12cc02e3d1b36bb5e61", + "borrowingFactorShort": "0xfa7951c307bad78503594c2a1a636f9b3904c985b928223a83acc294fa957683", + "borrowingExponentFactorLong": "0xf9f4d096ddb675dbbcf5bbad205151220f0ec7760e3c6a509f7e75faa247abf3", + "borrowingExponentFactorShort": "0x8664aa099e02603d2976c091bf09070e910a89c930a04fb6d1a89dc053d7cc9f", + "fundingFactor": "0xd16f70d5cfb53b46eb8ed9ae7b60e5e5714920782be4f3a7def495c133db40ad", + "fundingExponentFactor": "0x8afb9ec0f95cd3fbfc2712dadc84601b952d4ec89722db43a43721c583d148e8", + "fundingIncreaseFactorPerSecond": "0x78717a31ef614a3f24dbf9f6aedaa8375b931a588cf63de2c1d5672b7a899a92", + "fundingDecreaseFactorPerSecond": "0xfcf604a88ff1c01f4584ff6bb345b8e6a7b328ca6f1ff821d063ee6505f24fa9", + "thresholdForStableFunding": "0x8f0995c7d8692f917ae65d8fdf02ee72c5e17909a511bdadd4817897dd485a4d", + "thresholdForDecreaseFunding": "0x90d7a6170a90281749576ff739af50b1264acdcbe865f0356c33ad80fda0978d", + "minFundingFactorPerSecond": "0x73d3fbb6bb943ffbd95e8edf4640a71b7303abcea617d99c237e009776bc0cce", + "maxFundingFactorPerSecond": "0xff6698495092f6f156e88af5173fb3d86e5c4f0a72e74984b560766b186e2c1b", + "maxPnlFactorForTradersLong": "0x5c1093d84b01a746d4b8c95544831ac2638da23ddf64e962929c4bfc6ffc7e29", + "maxPnlFactorForTradersShort": "0x1bc4eddcf3728b1855ea78bebc5b067fbf0de2f3fb75cd873d2e248535dabb99", + "positionFeeFactorForPositiveImpact": "0x38dd2ccc17adc9a4c4b524f6bb1a4dcda13fee1268a662f46e935fcb59675902", + "positionFeeFactorForNegativeImpact": "0xdd10c7fd407c5f9532e0f265c2c62c58b473945b96144bce0a6a7bdca076532f", + "positionImpactFactorPositive": "0xbacca2d52482098f69dbbd12e34d1dd2e74acbc5110dc2a9683cd6cc3daffc4c", + "positionImpactFactorNegative": "0x9733b0f659b3c23d37f2e2ed58d0bdf22b880057ccefdc4db9c7183bfacebdac", + "maxPositionImpactFactorPositive": "0xf89e8a9d7805cfff27c4f5ca38fa2661cd2173227d018b822c254d982665680e", + "maxPositionImpactFactorNegative": "0x43e3fef6d75c28ee36b8f8df12f375aaee95018a1bb6525b40c440a85e40a724", + "maxPositionImpactFactorForLiquidations": "0xa20e5a211dac98b89ee7dd23830d4fef0b911bc430588d4e4a3ffbb443ef888e", + "minCollateralFactor": "0x28b8c6de3b16af893d3062b3c6dd997355b0571f574d9d3614932a2aee60c2bc", + "minCollateralFactorForOpenInterestLong": "0xdfad34850b6f15e9790e144784adf3e0dbe917690bb3f58260b5e578ff17e8c6", + "minCollateralFactorForOpenInterestShort": "0x94ec591967c0c2e8b041b2a28bdefa3b898eaa8cd7752278ac568543a7d600e0", + "positionImpactExponentFactor": "0xc412266eb7c2ad47ed8f8e8466b3f28a9cbbb8c1a1366f702a948ef7de625198", + "swapFeeFactorForPositiveImpact": "0x0e1fd9b3a95146e9c5fa9bf8f76c80ba91f3ddc271c5cb43a2b574fb4150c557", + "swapFeeFactorForNegativeImpact": "0x6b9f269680991ffdd1f95773dab02b0962549ff15150976518a739e333c551dd", + "swapImpactFactorPositive": "0x59346f9a4a1b766c626faf5a262d7c4682290eafde924edaccf4793b5aaf9ff8", + "swapImpactFactorNegative": "0x7abecb50f1f40514c8910dfdbe2c77053ce52f786284e6cfbb103935052858bc", + "swapImpactExponentFactor": "0x67a8eef04a49c1b96d230f1b3113bb32a730fa1868ae6e307b8fe2f8ff5615bf", + "virtualMarketId": "0x5569764266bbc663a0ac2f620efec79cf39e019cc8081b9313d215717bc06870", + "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + }, + "0xe19da27Bf9733c429445E289B662bECDCa6ce10b": { + "isDisabled": "0x2791dda6f6e72e5b0f5a698d41afdf86fc418d27d1a383d2f8dabdc8f3bd1fd1", + "maxLongPoolAmount": "0x11890b303d0bc381ad5ca189d9b2572e5cb3076cd89bc610a27f353c07163437", + "maxShortPoolAmount": "0x2863e6f3d61484e45e8419b22fe805a7d9f8aaa26c8f4ec137fe4773ebabb133", + "maxLongPoolUsdForDeposit": "0xa4a6578e66ccd0e5f5fd54086cbf4452ccc8eac1a61c65f939e421aa8c7b6783", + "maxShortPoolUsdForDeposit": "0xc8b2e124197c1a6ef15346341e145a30f656c3bde7af244d41d916afb6056b67", + "longPoolAmountAdjustment": "0x5b3323506b8c7955b0c42ea1c545e6548bca963632c5de29773b2395fb69b7e6", + "shortPoolAmountAdjustment": "0x4dde22ea292d7917867de6b5f684eb59117799109420a236ef156c258e0abba4", + "reserveFactorLong": "0x02aa3b2e23c093ede45c1cba22473cd95faee115f42cc414ced213a0fa2718f6", + "reserveFactorShort": "0xe17407a3f33f25baf58a073b77069e7caf1502b06de1d1117faa252a14e8d507", + "openInterestReserveFactorLong": "0x8e3a5e8aa659854dc2949e4b9b7c592e23aa1353dfdacdd62fe7a40b6a93b0d4", + "openInterestReserveFactorShort": "0x3fca20fae444b6448577e931f6382e1b7315d9a6cb3476dbe217245d87967a6b", + "maxOpenInterestLong": "0x35b5597ca8c88c5b68e0c7d017ae5d483bbe1b88efe34f4606e8a3c4b883a014", + "maxOpenInterestShort": "0x4b22167d5d4b8cc6becbfd31ced5d8f1bfab12dae8c06cd4fea8f09b96dd6d22", + "minPositionImpactPoolAmount": "0x72ee3f9afe4ad46fceaa26b04e55f693f348ed344c24432659217c8c93078a7e", + "positionImpactPoolDistributionRate": "0x43bd37c9e9c6528b52d57101a2380cc190c8dc4741c7cbaf4e71bad06f6ba223", + "borrowingFactorLong": "0x98f0facf97ddccc65b997b3b4264c5409d2d309f0db072b0eb68d2867d411ca9", + "borrowingFactorShort": "0x2cb602f0fc443d4bf6c57fc1dca3fb6456679b9e0f95e5d6282a64c402642df9", + "borrowingExponentFactorLong": "0xcd07146f5d79e38e0237d426d4b57e83daae580a89db0e51abec1aec72ff500b", + "borrowingExponentFactorShort": "0xc5ea0566e9d0c908e805d534e68b83b9d2a283ff70477ba4d8a926291e51f4bd", + "fundingFactor": "0x023be487b42eb321b349eaeca5b391c5165cd1353f38d98d14e88ea2ced12f59", + "fundingExponentFactor": "0x2cc4a40d9bd360fbd67c9858484ce1767b056ba60db3644ac056d7ca51f92d06", + "fundingIncreaseFactorPerSecond": "0x1a2930cf44bcb05b9674183c87af682f0b4bf464942098f259abf99fcb555bf6", + "fundingDecreaseFactorPerSecond": "0x60d5d80ae90c000d4de2c97a6b3a62d331fd7896ac133f11aedcf5eeb0c982a9", + "thresholdForStableFunding": "0xafb906d1b572b318b51e46da67623cfdcee70d673c9e61f0a92aff12f946926a", + "thresholdForDecreaseFunding": "0xc17459f6f8f414514cbdb126d7ebd171219d19e43103772aa74995ce7ef1f7c7", + "minFundingFactorPerSecond": "0x5d225f4bab8dbcd307001b1bb460fbc86e5fb2e91f8e0ed99284462c0e7ebb84", + "maxFundingFactorPerSecond": "0xcb59ee5ef3be4bb3dcd75afcf8cfbb66dfae23d6e9f836ac3da808d3fb18afd6", + "maxPnlFactorForTradersLong": "0x35cf80c1d6ca70828ffd5850a8470b83ed4be705cd4c53d5e31c7a71c13acd5f", + "maxPnlFactorForTradersShort": "0xb3de355071ca623883ad8e9625132c0af60f04bc5d015b6222463bce1b564dfe", + "positionFeeFactorForPositiveImpact": "0x6b96cff86524d5625bd57c852413391a7e705a4c7f4f4510ae95963142243b1d", + "positionFeeFactorForNegativeImpact": "0x16ac8268f70816ce91541a0cce16bde38ea509432b182bd8925799d34f35479b", + "positionImpactFactorPositive": "0x7d619479b2efd31138f8d97c5b621b759c6c66181d9957b2308864289d1d5a3a", + "positionImpactFactorNegative": "0x525cf3807a5f51ee9eb90b96c15535155064117ca8b01820ac02a7ba105a48c5", + "maxPositionImpactFactorPositive": "0xfa7f7b8a323dfc202971fc487699fe4182f7bea1e938000a0ac5cdf2e3e4d08c", + "maxPositionImpactFactorNegative": "0x0f8d93bbcd3913979a10b97c5c35c0ac9422be88b98c33f2a2ac7883626c8c46", + "maxPositionImpactFactorForLiquidations": "0x631c0c8acda0aa7818ad99ee375e50d8c4275aa073e6b3dc0861797d835ab103", + "minCollateralFactor": "0x31ff077a89a32edefaa4d80de3855e73eaf6a40cc50f32ebe71560a577c4afba", + "minCollateralFactorForOpenInterestLong": "0x5adf64aba368af76710a5ace26141cbcc2d482564ff50ff73428a666445593c1", + "minCollateralFactorForOpenInterestShort": "0xd44120b8a84afe8d59f0398a652e9af48d30ce0d68ed753e577d4ee474ec59a5", + "positionImpactExponentFactor": "0xea5bbc31f9ad83ef0b26dc676f4badba0dd7967b8c2fdfaf5fcd6e378541d5b9", + "swapFeeFactorForPositiveImpact": "0x3528ea3c107c290c0787944fcffb8dcab5c79eb99749ef137cb4251321c05bea", + "swapFeeFactorForNegativeImpact": "0x7f2d20dd6425fb3deefa3d5e2fb1421b98021539f97c248ec897a051737b71a9", + "swapImpactFactorPositive": "0x7994d0769514a0f8458062cc3ec7ac46e35e61a41837ef95de31499b096f6afa", + "swapImpactFactorNegative": "0x51498d6010ec706431bb43497559c424d46d5a4732ae654c0f8010ada52e32a6", + "swapImpactExponentFactor": "0xd0855b4e2c4b463a9d8ef095e149f5f4160bbcf019518d19088398b85d20b0bb", + "virtualMarketId": "0xba31ac4f17f85fe1d4f13f98606a4d6795476499126baf4091154165b41ba171", + "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", + "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" + } + } +} \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedMarketValuesKeys.json b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedMarketValuesKeys.json new file mode 100644 index 0000000..d95c4ff --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/hashedMarketValuesKeys.json @@ -0,0 +1,1763 @@ +{ + "42161": { + "0x47c031236e19d024b42f8AE6780E44A573170703": { + "longPoolAmount": "0xc97d6ba9e3cbf19c2bdb3eb671109e97cbbb0c4684ac5ea9b34fffbf3fff84fb", + "shortPoolAmount": "0xf86d8be1f8a7b9fd99471eba5c9d770bce1c6723a038f4e35b333abbf267340d", + "positionImpactPoolAmount": "0x79a3eb6b9901a75f1cf9795d572f8a017efacc3fd9d0a33a2c4c985959e9b4e2", + "swapImpactPoolAmountLong": "0x6dd5bb78cbd8ca664f5ee0c98697e19e163140f3ddeeea9141360a248ad44a84", + "swapImpactPoolAmountShort": "0xda76160e7e77fef4f1bfcaa60a25da06273e0f8dd3b4448d18c333c148e58246", + "longInterestUsingLongToken": "0xaaf79028722fd65633cdf994a4a10b0bd349761062506c4bb6a0489956ba5d3f", + "longInterestUsingShortToken": "0x40dad997139c47372d1ae990ecf25623dee34dc65401ed3aad14f344f4577e61", + "shortInterestUsingLongToken": "0x0e0453188aaba28b788ab0a97ff05543c38cf88d2742cc85f689957e41c8ab39", + "shortInterestUsingShortToken": "0xe95b181e49c851802d3ad428d2fe4597e4e2cf2f44001115ba44292ae3ba220a", + "longInterestInTokensUsingLongToken": "0x75296845b36a5901aa4c9ce4caad19ff5fb7eb1c419028af5982fc395ed67da4", + "longInterestInTokensUsingShortToken": "0x786f29c6644d5e68f2f0e30700df9f6e4cf594da31bb013c59fd350ec7173e7d", + "shortInterestInTokensUsingLongToken": "0xc520adeafe7df0c66d377df2616c65cdef70b66feff02aef7ea572e19ec036aa", + "shortInterestInTokensUsingShortToken": "0x37d30c2219f77c5b3ded6368ea2aac4fee0f693146fef8066e78807bb0b1c59b" + }, + "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336": { + "longPoolAmount": "0xff0b4cfe8dcdf388c21daa548b07a401cf7ee7c64087f47b0849009486ba0af4", + "shortPoolAmount": "0x5b04b22d97863d6484a7ad72fd6b6ffbb1803bce27f5d839aa97def98d8604b1", + "positionImpactPoolAmount": "0x4e8abdebb1ac95be23a129261980f4704835530793360d86a6d03c3d3044bc58", + "swapImpactPoolAmountLong": "0x485c0c3052f29694131e08336acc0756b4fc4e45bb30758f8865f1c48aefef2b", + "swapImpactPoolAmountShort": "0xdead9e0b6458c6693fca20ec40b59f77f0be0fe0c00d7e3d82937c1f8281136a", + "longInterestUsingLongToken": "0x39b1ba9baf45e2c11e202da432a2c21fa5d136cc112015896e024c20c339a6ea", + "longInterestUsingShortToken": "0x81fd350222849df2df97529b003ab475f1bb887e8bc0efd91bd68cec68ab7671", + "shortInterestUsingLongToken": "0xc00f0c27b5efefbbe1eb63ae8d2f35450f7ac54fe081cd0429f28274a954a341", + "shortInterestUsingShortToken": "0xa2e49070d1a92211074fd9493c4010ad1ea0e07fe42d1d6853c845dd5ce91212", + "longInterestInTokensUsingLongToken": "0x731d0e3f099505d38d8b4bd317293986c5d508b5794e89dfcd8cf21db057eef9", + "longInterestInTokensUsingShortToken": "0xb29358c7b4cec591d8617ca7ed8db509eaa1138449e6aef8b85fd0d3b8bebb28", + "shortInterestInTokensUsingLongToken": "0x2d362c965a171fc310ec6aeaddf9af5a996e26ad79dc0010675dc6808889eeef", + "shortInterestInTokensUsingShortToken": "0xb2e38bb49cdd8a464a80bc33b668e72c105d3fee146c9b26d644cdbd22ed7dff" + }, + "0x6853EA96FF216fAb11D2d930CE3C508556A4bdc4": { + "longPoolAmount": "0xa8e03b2af1dd708da24d558140e3cf2eb06c2af2b4ac49be4ad437c5a3155045", + "shortPoolAmount": "0x602b4f3bcc5b505af0f2982d736f4485b10d1def4481ecbcb11919cd7689b03a", + "positionImpactPoolAmount": "0x10d8f769919bc8b7e75072bfd103562a8452a52a3f1e7aecb59578ff6a5e4eb6", + "swapImpactPoolAmountLong": "0xfb895ea8c974487b0445bac1210d3f5d81cd424c290a16ab9f5ab802aadb34bc", + "swapImpactPoolAmountShort": "0xbbca9db772695c7f950f972d4f4d85ef98509f4dd37a7512d6cf86e941c4db06", + "longInterestUsingLongToken": "0x803e42d772720207636ccf28de001aecd7371f2637e573a2f5be344299314b5b", + "longInterestUsingShortToken": "0xbf2755345de06cb8945a442f03949781afa66f96f62b648407b05979de96c5d3", + "shortInterestUsingLongToken": "0x8177813dea0c1ed7e515419771d77c81367701b12fe97df996987ba4a86783f3", + "shortInterestUsingShortToken": "0xb629b35d1f81768d1c71056fae4c6c4ec419d9fa15001ebbfdad29e7d030d522", + "longInterestInTokensUsingLongToken": "0xd10a03b699e9f8ba6eb2c7a507066218bbb1a50d003358d9ddfde7d31724c113", + "longInterestInTokensUsingShortToken": "0x96ae498de17f8d497060db437ccb9e755b7b0fbd74ffdbe07dc9c6a8fb57777a", + "shortInterestInTokensUsingLongToken": "0x02bde765412e10447c77ca071a23d087450f9b0b41b952bb25462de51a565f1f", + "shortInterestInTokensUsingShortToken": "0x00a167338fe44d05cbd7cb486e7081397b7d688081e2233edd840df13688c7ce" + }, + "0x09400D9DB990D5ed3f35D7be61DfAEB900Af03C9": { + "longPoolAmount": "0xbfbecba187570cb9f1b8c4784e5a1a7e11a501327737473ef2c9572d453a5752", + "shortPoolAmount": "0x1a46540d4cd17be2e83e461a3760b258c4206a9199a747b9c9159f450bdfc031", + "positionImpactPoolAmount": "0xd3df1d152a54618cac79336662681544a3cb9d5cb8a512a5715ab41379150131", + "swapImpactPoolAmountLong": "0xc3ef825ca52a4ee45b978ba14ad8f6c54074630c4be8b67ced0514b9681361f9", + "swapImpactPoolAmountShort": "0x953134e3672ddbdbb1fc1b26352f7dfa8a146a593ca08471bf33c92c6daeab2f", + "longInterestUsingLongToken": "0xc32df3db74b6e94f9714b80fa5a982119139af2d2007d051680e4d37ddb2f5f6", + "longInterestUsingShortToken": "0xa693b695fc8ee008fabb6bd458764d04028839a0e4562c5a4bdad2f23a633f98", + "shortInterestUsingLongToken": "0x7ac98888aa26cfae177c6b4cbfb3ae4aa6ced7cb9cb138e9ff8ec3e21c1fa6dd", + "shortInterestUsingShortToken": "0xe8f3a481c54f097c764ebe829161d0d824dc1730a32fbdbff2e7fd36d494a8c0", + "longInterestInTokensUsingLongToken": "0x9c6d5e6724b99256d7c8e88a87d7d727bde578f7518afe90439964d9c1803c1b", + "longInterestInTokensUsingShortToken": "0x40ec31468f421bf157377d62d9fa3b21f73444bbe5b1a2ade254792c7aee408f", + "shortInterestInTokensUsingLongToken": "0xe6a79c49a3b959357ea8a7f77f95a8e07246700e90c8af7c925d4a507a0b7c0a", + "shortInterestInTokensUsingShortToken": "0x2348c64e4ec4e43e5ec69696283db9f1622c3a8b4d450d3b5f34501539fa9853" + }, + "0xD9535bB5f58A1a75032416F2dFe7880C30575a41": { + "longPoolAmount": "0x1445a4384e1543d0a5dcbaf796635a774ef2b09c47b9e293e6eefa6e3aaf2c7a", + "shortPoolAmount": "0x5c4356848f787769df79af41ac68759934c9ffe430a00858a2c9cea807e6a148", + "positionImpactPoolAmount": "0x07d51665eb180c270fa80853de36e03e0a2c5882228bc743bb84e2567948c4a6", + "swapImpactPoolAmountLong": "0x15d77caefd6abd1963b6e93575246711753584f618994a755ac6822932d75957", + "swapImpactPoolAmountShort": "0x6ba277ca079e7398fd5395a3fe3a9cc62cbe8abba7e95d180f3d9a1802e90571", + "longInterestUsingLongToken": "0x9757fcb688ba5a068a6bc983358135ed9903aff161b47283fcf2eb6649961ade", + "longInterestUsingShortToken": "0x60f0d227796928722b6e4459cc1565ade91a60ee036e9bef8cde8246b53aa235", + "shortInterestUsingLongToken": "0x82690d46bceefb01e4cb7c2931dc00c0f8af31be51e0200fe6dccc6e4e2f5dde", + "shortInterestUsingShortToken": "0xb2d4e48c35f248199b1e281e65b4686ba29baa195eb02ab1bfccbca949d19acc", + "longInterestInTokensUsingLongToken": "0xfe52872b29da94390eb149202b417f14c16dd0d594a57983fe1730df907be72a", + "longInterestInTokensUsingShortToken": "0xe2437867bb42e3579f3b074ce34837fe06b8f52e4f0007147cfdecb0eaa5a8cd", + "shortInterestInTokensUsingLongToken": "0x3273ca3717c1c7b429b51971e61a8d3b13bb8452f3fbe0c594bd41ae15721b94", + "shortInterestInTokensUsingShortToken": "0x259b86b363cd7c61f6e78f907f26941772e66ff1c15b45bbb59827c034b7c5a1" + }, + "0xc7Abb2C5f3BF3CEB389dF0Eecd6120D451170B50": { + "longPoolAmount": "0xe7cf52d240a089203276bb01032bea2b89668274957a5186a5d37ceb95c5b591", + "shortPoolAmount": "0x43a2d38c98e7d7cb84d3d17805a72ebfd08f9f84f1715adf7b79c240ddcdd177", + "positionImpactPoolAmount": "0x653a1345e8bc5630c66a4def959467da16e0d9bcfea747829af83421eea4c2ff", + "swapImpactPoolAmountLong": "0x382fe60b4d0d153674673c43dcebae8d3d5b702c61b0c7ec1439b0d016a29f3e", + "swapImpactPoolAmountShort": "0xd0570070f2eedd109e95adb99b5097698087f635d071e3fd933c59be9c64d72e", + "longInterestUsingLongToken": "0x95dd001ff2fb2e3b0ba377f245bcaf78b0b61424935c1af9cdadd3794bfabaaf", + "longInterestUsingShortToken": "0xdc263d57e3c8a3937c126287c74d9b4f74c30491429ee86c90216d5ea329439c", + "shortInterestUsingLongToken": "0x72869f1ca2a193c26300fcb6d1ebdbd1849767ceab9c8707be24d77ac564ea98", + "shortInterestUsingShortToken": "0x697c479bf928bc6a04fc5e53a529a1b3b19d02a23222fa00bf0a14bd0ec5a0b1", + "longInterestInTokensUsingLongToken": "0xae534cba40dd6f0b80ac1ab36c15ba7013a1e943e2b5bc0689e28df371574542", + "longInterestInTokensUsingShortToken": "0x1df3848401f2d4af56ea76324c2254cb8b8e245eae1b36bc52925ab0a848b680", + "shortInterestInTokensUsingLongToken": "0x1f557bf3949dda5df3aef9c48fe94f7357b92dfae2c3addea9905eaa1f8b0b08", + "shortInterestInTokensUsingShortToken": "0x72d8f85055f69537e7d0015f6127f3709abd45238cd8f29315692355ccb2a94a" + }, + "0x7f1fa204bb700853D36994DA19F830b6Ad18455C": { + "longPoolAmount": "0x3be54f0eac4621335efcada2318b539e374df9148359b7b5219d4752dca287ea", + "shortPoolAmount": "0x5ba6ced06a14a3ec1f9d4e8b7498f67e40e8fb1d0b5242b4980f2704b712a304", + "positionImpactPoolAmount": "0x2a12f69d1cc0d24b76a233956d40f4200aac76f5c9ea0835aad5e21d4c62b314", + "swapImpactPoolAmountLong": "0xebeb79cf4bd4f8ddd2044aa645af41f673f687e034562d13396147ef0b050c17", + "swapImpactPoolAmountShort": "0x4b498ce8d141da810e713df0bb245de409a05fe8d46a35acc155eeeada601fe8", + "longInterestUsingLongToken": "0xb039f73d1d5b7be8cccea9ee69157fcb35007c098146a428740ffcef4a144563", + "longInterestUsingShortToken": "0x69a6a3fa811ffbc01a4dae3275f89276cf68b1348f86bb19cadda86d6c4f557b", + "shortInterestUsingLongToken": "0x63e9f5caaf1a63cfc4ed365990ca27b6a7ef68e57ffd026a8dc7dff09ab53e31", + "shortInterestUsingShortToken": "0xdf0560123f096d6afe54197e03f89497806c818508ae80cd70931e7af9d7200a", + "longInterestInTokensUsingLongToken": "0x21ac031407b3be05cff24ae337c2265f8b4f2259f8239dab4beb9e3e75b4dc84", + "longInterestInTokensUsingShortToken": "0xec2cdc9da0aa726b0b2cdc19fb0dc3b8d2074c1c67c2352582e872bb0e867fbc", + "shortInterestInTokensUsingLongToken": "0x9d353794286767733a5e69a8228d43fdb33dfd23b2768549e9e3d323f253a5ba", + "shortInterestInTokensUsingShortToken": "0xb017d870156fcfef2f3393c1d7b0918624ba61bbd3362b1045d5c837b403b940" + }, + "0xC25cEf6061Cf5dE5eb761b50E4743c1F5D7E5407": { + "longPoolAmount": "0x7e10eb326f33383ff6c064038a6d98e1a3de6b89de729e114767af9712f9c107", + "shortPoolAmount": "0x19532fed75fd7a66414dbc262ba18d9c0c8957aaa87cd1060ecdb785aa0dc18d", + "positionImpactPoolAmount": "0x5effce4ad38113d5ec12c19410377b1fc0eead0a7ebd45d4a7ea601a19be0bde", + "swapImpactPoolAmountLong": "0x4fe5a7221c18285cd5b953e53bbb28c9be1544c6e7a0f612149669d2285080c7", + "swapImpactPoolAmountShort": "0x96bc6411ca7571960b07219d0542af5caa768a0801f30f05ff1b52737b986781", + "longInterestUsingLongToken": "0x00773c9b4edc76a785d521407891cc435fc23819fa3668e398ecbe34ebf2ad6b", + "longInterestUsingShortToken": "0x2b7e74d62825d42ea37f554e2a07ac81004d656c7e4a1ba799240d5190981232", + "shortInterestUsingLongToken": "0x4954b7805bf1b21196dddf0932b96a781c1341f593640578663fcfb199e29ec9", + "shortInterestUsingShortToken": "0xc678516b7a355d05e635f7dae12b6d193223f640e4d7cd5f97c0fbafe70c6569", + "longInterestInTokensUsingLongToken": "0x1a402099c28265d9e613d36b14f1244218fa21d8aae38842d5c08bc36f315af5", + "longInterestInTokensUsingShortToken": "0x36eea6a57a03af9a929fcadc7f0e5712414597d4e8266b616069504459fc6ae5", + "shortInterestInTokensUsingLongToken": "0x8c934322957ae354fc75083df7688733569e93f4f7fa8adcd32f2ebbdb3815ac", + "shortInterestInTokensUsingShortToken": "0x31de6a9c5779f504ecb8aefdc3173ce221672840efbce76f01216034d84fdc25" + }, + "0x9C2433dFD71096C435Be9465220BB2B189375eA7": { + "longPoolAmount": "0xbf497c3c227386bcfdf3f1a02775f7c71a9fac642617cc999f75191b8c6d5688", + "shortPoolAmount": "0xaf4c87e0378389d9bc45827778451e0d5624674d7beb5c56fe5a2b23b8fbd126", + "positionImpactPoolAmount": "0x0a6be3555a162a2988c8ea2604143713957609fbd1f720f692c0d05e03d298f7", + "swapImpactPoolAmountLong": "0x8423f553bd93a86e2f67cf42b90e09e584543e952a7e9be17b876889901f7866", + "swapImpactPoolAmountShort": "0x230cbf7a854dbf4b2b3d0020f20c8b5d6da2d47109670b1a4bc64841fc20ea57", + "longInterestUsingLongToken": "0x284fa7a4bb1f0b34ab10db27bc5b836dbfe2630095f46ab2e18e393231e80970", + "longInterestUsingShortToken": "0x6a06b586c1c4dbaebf6d16fa10b7f5a8c97faf2bee352c7f4535506637c68a7c", + "shortInterestUsingLongToken": "0xf643cc6df5a9a74a0df1fc4c26ad01b4b0bc0f4731ec62ce3717a20ec86e1ae1", + "shortInterestUsingShortToken": "0x39338f8956f00040e8256ed0ef052b84b52a88e0aa24bbb0db3c9090324ad8ae", + "longInterestInTokensUsingLongToken": "0xd721867814240d1e6f117187371652d9d67f57184e9fa931f35c971514cd4535", + "longInterestInTokensUsingShortToken": "0x75d084a4da18a526e6ad132ef2449d76f7b87c9298a035da394feb9b79add310", + "shortInterestInTokensUsingLongToken": "0xcce881e29951278f4ac674857c0fcae189b59980ca9f98eaa38504f8b02ba07a", + "shortInterestInTokensUsingShortToken": "0x3d8dfc8d7f8c060566078598cabef73200382eb689fe26c05d0b548bd1c0e3d4" + }, + "0xB686BcB112660343E6d15BDb65297e110C8311c4": { + "longPoolAmount": "0xd5abc31c15076d78bf21c985180f0a3b550c33d8e7c290cabd47f755d36cb4c5", + "shortPoolAmount": "0xdc0ea810015cf12d37aebc3280460ff0506c680657f3799f436b3ac739815048", + "positionImpactPoolAmount": "0x671fefafccec3e852239f74e7d9cd46805c0c215f89087d82e0e61504b084082", + "swapImpactPoolAmountLong": "0x77de78541dcf17768b42bcdf1ebe81a286973c72c91068388cb82fe2a0746764", + "swapImpactPoolAmountShort": "0x9be0f29934dd30db2315d90f77d1bd9ae96ba42a39931fc6640a79ce623404bf", + "longInterestUsingLongToken": "0x1b03bdf189516883f3a23a55dd9e038f2b48e9fbfdf404546a68f51f308e00d5", + "longInterestUsingShortToken": "0x4aca6f6b72b0ce0c0eeaea6d51a6c782e9b8d37b5bf1bb5afb4a15501ef92e9d", + "shortInterestUsingLongToken": "0x9d0969c414e26d52ce9ae5d7d5e83e38d360789de7ea73b9b062e39d35b143ae", + "shortInterestUsingShortToken": "0x5643847214c1182b29b494a35853eaa0642ebde24e51b7ddb8000d9be952596a", + "longInterestInTokensUsingLongToken": "0x025c53e971e63f5d51346b3945c36279adb4b8eb9a78512bab189199046eca61", + "longInterestInTokensUsingShortToken": "0x255bd12327328c2e2675d80b84b05200f90973faab54376e6e436c371327845b", + "shortInterestInTokensUsingLongToken": "0x6570bb9e35dc0380a652327489dfeea94b924dc573726977c34befd986bdb12f", + "shortInterestInTokensUsingShortToken": "0xba86d4caf44d73e34588ef62ab32457683cb57759a939fa0dfa1bae385cf562a" + }, + "0xe2fEDb9e6139a182B98e7C2688ccFa3e9A53c665": { + "longPoolAmount": "0xa9acacc99cc90fa39007d837520e15f8323406ea0a829ce6f5012d06c6746d43", + "shortPoolAmount": "0x059c06af790ad9eb203678b948e568626fcb07907755bd64dc78931f8dcffe37", + "positionImpactPoolAmount": "0x02a3d575aa6fe383513b3a09358667a76891c821c0e7ccea13fc840511aed705", + "swapImpactPoolAmountLong": "0x15618de121a1dbe0850b9821ef214538bb217ee0e2ee226621391e7ae74a3c2b", + "swapImpactPoolAmountShort": "0xa40beb6ca63512c28671631a2569fb26f0b76a5bb5b28f6fed65319643c32e46", + "longInterestUsingLongToken": "0x85f4666cde674480f8804c88d7f9344fd31663cd0c2dd78c7d58a1244b80120c", + "longInterestUsingShortToken": "0x4e7b98b5f79eb70f826cadb8b12c6eeb331247f15187bc93391d608547d2ff43", + "shortInterestUsingLongToken": "0x8ad928c59d546dac3d3e46422593f530cbcb414ab1ddbe701dd2128120c6772e", + "shortInterestUsingShortToken": "0x1ea0d312ed28393ead1176939e9d94c6667785701548810ef2b28bd14d61e6d9", + "longInterestInTokensUsingLongToken": "0x2ccfeac1731442a03584eba916545e7768bceb377152a02818959bfacdddfa89", + "longInterestInTokensUsingShortToken": "0x1736eac5aafda0c04bb3f998ab3543d157d0cd0c2dbf9b8288982e8cfa2393d5", + "shortInterestInTokensUsingLongToken": "0xf9d50cf5c0cff3d2119e0be527e60796710905050511bee8b1bf939ae4b67078", + "shortInterestInTokensUsingShortToken": "0xd9b5776dead40b190447976a4bc11f3900a504898f7f816f6edb363ee99af383" + }, + "0x0CCB4fAa6f1F1B30911619f1184082aB4E25813c": { + "longPoolAmount": "0x162e128ed7d7e87a743e0a07745c4861b3f1a52133825ddd86c4f40cc178c535", + "shortPoolAmount": "0x9f5fd95e5680a30f8f6eef52e2c6d9b02dd47b2503d24f5e96d7115f083e98e7", + "positionImpactPoolAmount": "0xa25c23eb710bfdb16f21db0ce08297c6b24ca760696c8b9ca48376cec76ac385", + "swapImpactPoolAmountLong": "0xfab4fb0f74dd849796cd1820cb1dca248d50dcf59d6d12561d92b7ef9ffdc6c2", + "swapImpactPoolAmountShort": "0xf628fa1bbdb3645fa29847536f1879dc047718ad74240f8143df351eea0bd007", + "longInterestUsingLongToken": "0xeac9c2252d017460be3f860855a94cd16d776ef4977f896f6e0fd8e4b569f653", + "longInterestUsingShortToken": "0xd601846c1043ad55f26260ee2926352380601e1e33f2366087f08bac80d3918f", + "shortInterestUsingLongToken": "0x5acf26720f37b2c1ac85bf8f49c7ff58de8f17527046ea516238ba1a77836813", + "shortInterestUsingShortToken": "0xd1458fdbbf038b94ef77c72814dd5b1fe848ec3dcfbf9bc9158d1ce83998d6e5", + "longInterestInTokensUsingLongToken": "0x05b1f9e8a0b23480936d3553385806611799d0a15867c3d72bc4876ff6289637", + "longInterestInTokensUsingShortToken": "0x0365630c97752ba6391f907322f0f51a94e02900a9d73e13b314543600b692aa", + "shortInterestInTokensUsingLongToken": "0x11a781cc7d4d119dfea34b4081f818ba3816844bd1e912637c1b3bff3a28cbe7", + "shortInterestInTokensUsingShortToken": "0xf7b2a70ceac522a3a297cbd1a7407d8a7d11d06893b27f9776be34bdbe3e3267" + }, + "0x2d340912Aa47e33c90Efb078e69E70EFe2B34b9B": { + "longPoolAmount": "0xb01a02674ceec2bf4b3d3221a800b02e993026feb55a9b98e7f1b4ec096d73e5", + "shortPoolAmount": "0x07488fc5341e46307b3272614f7d78e599d9f836dcd3cf40f2f939da2f44ac2d", + "positionImpactPoolAmount": "0x157e5cb2ec61809df4176022dca1e93ecaf46c95c3b69203cbffebf4343b43cc", + "swapImpactPoolAmountLong": "0xb91a32725774baaab40eb7ea83c37cf6f08d69e7406c56f3e9faa75f499038de", + "swapImpactPoolAmountShort": "0x5323bca976340f4e198621817ac57118d1b54f014eccafa5045857330e20e015", + "longInterestUsingLongToken": "0x2e06148c5ea2c660e7e6771b187af490d248e6e3dcfd266901e1fd727f31bbe3", + "longInterestUsingShortToken": "0x53070e07e851072046636656c662796654eb4d75a712ffe6dfbb1b7b0a836ee9", + "shortInterestUsingLongToken": "0xa9407767862edfc62832f6ecc895d105de579ac5163e49d8159352d670062e78", + "shortInterestUsingShortToken": "0xb7b406bb543f124d31055569c395031f1e23960f67a4ad086fd81276b20b2aed", + "longInterestInTokensUsingLongToken": "0xded94c8f814dd5a98fbf797995353c5a11d7ef063487aa9641fac3da0130b4b2", + "longInterestInTokensUsingShortToken": "0x53e4b509f2b1e55e4686c80b990043ef4c4b0d15b811005af9c90e7804d0912a", + "shortInterestInTokensUsingLongToken": "0x7a6b167f3a0844090ed8e45ac9a029cf9cd3673123360635821058070c099880", + "shortInterestInTokensUsingShortToken": "0x7bbfa0c0470fbf6257fdfd7d6d407ac7b19c005f19adc1d911fa1a87483f1bd4" + }, + "0x1CbBa6346F110c8A5ea739ef2d1eb182990e4EB2": { + "longPoolAmount": "0xdafe0928933f8c329480f33e230ca3f555bd8f932b33920b65c02692812bf135", + "shortPoolAmount": "0x990be4124ece6dada46f5e9e096c006202518161da1109945ba0eef67e620b41", + "positionImpactPoolAmount": "0x4f018bc91a6e38a32fa8a3219ce9bdb3d9156324a086661d74ad97d1c692a8de", + "swapImpactPoolAmountLong": "0x80108b8899f0bb3222e1c901cbc2de622653a5724b79280d652c8b199cf3fefa", + "swapImpactPoolAmountShort": "0x708275b4fcfc110fc518cb09ece37eec17f5d577efb5c1933481b67576a87e0e", + "longInterestUsingLongToken": "0xde6b2c704495e4da9200eefa54306c7d8eeb5fdfebb7354ccd917e05305d75d1", + "longInterestUsingShortToken": "0x51b9e7c53dcb1d29202e9b012525628fb2e5ef74ff296dba432ce000fcf48373", + "shortInterestUsingLongToken": "0x9270d6ad2bcd2e29ab4c9f0a583865c35c28f7a501428d5ab578f047a42bc49c", + "shortInterestUsingShortToken": "0xeaea0ade96ddc0f16be6622c269b0fbe27a0e00527a335cfb6c04353bced0036", + "longInterestInTokensUsingLongToken": "0x5a85041ad5fb01b6d5206730a1183aa245e78f099916dd3ee93a31a45f241268", + "longInterestInTokensUsingShortToken": "0x71d83c4044b5dc60c72d1fa95ee9c838331654392ddc2a0bb9702f77b0599af6", + "shortInterestInTokensUsingLongToken": "0x6a1218266e500c5d8a88eb67250e8aaaf07ab27f17b0beb62793e384378f02af", + "shortInterestInTokensUsingShortToken": "0x17d54d9e031554c4305cd029b2687ad6d2aa1a309946125997f4f746a185c7d5" + }, + "0x248C35760068cE009a13076D573ed3497A47bCD4": { + "longPoolAmount": "0xcd12daea074a5dff980977bdf609fae1ad3cb3cff86b2c3cd32fa619de6d599b", + "shortPoolAmount": "0x6bb95f92b7415e0646ecf584f9283ef54f1a58bfef7fa1ad637d72c2e0507bd2", + "positionImpactPoolAmount": "0x8c2dbc597225b9eb6cd0f2725cd63c89b1315a63ca4a7de9e48ab0b3dffbd778", + "swapImpactPoolAmountLong": "0x066eef78c129c9ee52c021563cfe3ffc2417e6ce9d8189fe0ca73a41968cdbde", + "swapImpactPoolAmountShort": "0xf4f8d60549bbd52cdcf5cef3f24cdd2c7a7a6d43bfb1062e4c6b2a97a31ea392", + "longInterestUsingLongToken": "0xd74534dfecd7d84eaeea268fdf1496d67bfef2d8daf6809fe2b8de1247f883d4", + "longInterestUsingShortToken": "0x4d151c41b16ff06e727d2ac633d07397bd085658119e0b61028ddf5041f8bea3", + "shortInterestUsingLongToken": "0x098aebac5c46e39ce4347f939e11f06e4ed2902bf679f9a74825503cb5b803bd", + "shortInterestUsingShortToken": "0xa04f897d09467d48975d46d4c76e2774a11b7755ae7eb654b7987c72b7aadefb", + "longInterestInTokensUsingLongToken": "0x2b779863111f19ab87ec102b0760317e0e020efed927bc4c5b1f453d9f6bc584", + "longInterestInTokensUsingShortToken": "0xd3d186bdbd0b37c40df68626bb1e1d55efcbe686f254abe86a3fe202f1713091", + "shortInterestInTokensUsingLongToken": "0xe6db6541b13adbf38cbaa28116c235533f7be17d6e31c541c48a7c13d1354257", + "shortInterestInTokensUsingShortToken": "0x31868ebc44d62b9411da4ef6c64ce3313b6ca83961bf35a5249c9957865e9860" + }, + "0x63Dc80EE90F26363B3FCD609007CC9e14c8991BE": { + "longPoolAmount": "0x0c7ed603364e136dd642e890a1368bdfa9b16ec42dca0b4a73900cd045a83725", + "shortPoolAmount": "0x9205d9f86188139db990b049be8de4fdbeb464eb94d5ee5dcf28584246f694c0", + "positionImpactPoolAmount": "0x9bd63eb842401cfac7678dc0bab59c9b924375c7806b54b6872ce31d6bc36745", + "swapImpactPoolAmountLong": "0x5b040b6ae6d4bab8e3b6f9b863a20df19026944a0a0ea9fd54ab5b8696afbc3e", + "swapImpactPoolAmountShort": "0x0ed05bd869a1461184f3afe2fbe36650489dc9668b90901b5fc6f46cb65724b0", + "longInterestUsingLongToken": "0xeae920ece94c0d44f4f87a95f8aca43394956b46823a6dfe03a441f9a07fc44a", + "longInterestUsingShortToken": "0xe9a0e8ac805006ca6a0aee08fabd43b1fe6b73a9220af7a0c15d054c7992121b", + "shortInterestUsingLongToken": "0x783978c10cdfbb256b9827e0908e516828513a8324b6e8ad1e8875f70b64c0be", + "shortInterestUsingShortToken": "0x233b335a93940eccbd71e31e278a35c26365d06ca74b430325c03333a9212127", + "longInterestInTokensUsingLongToken": "0xfae04bbcc57e01f2d9a471cbb081d7d518c735494c40843f1da56df76009eb81", + "longInterestInTokensUsingShortToken": "0x76a58e421f426a55be12fb2d1b89ad13f0545e82444ab24f37efb8be6754ef23", + "shortInterestInTokensUsingLongToken": "0x094a090e3b862aa2a7306ff78115c15b7896524f417baad635920828064397da", + "shortInterestInTokensUsingShortToken": "0xc8b3585a20312d87490906048e5ae90c4ddcc4f5d48f6a04b3ca6b67af36d9b7" + }, + "0x7BbBf946883a5701350007320F525c5379B8178A": { + "longPoolAmount": "0xf38d9d336808665d9e816eeac7d42e3788ae2d9e312f28c0237cc42fece2a2e8", + "shortPoolAmount": "0x064746fd83c624e5534e3b3eab563607df1d922e489932a0eb5f4dd56ac44e91", + "positionImpactPoolAmount": "0xe3f26e825f76214ab0c7c99535bc12c87061ee1f8d799488584d4cc0674f4f2d", + "swapImpactPoolAmountLong": "0xeea45ff77b9abf6cbb9f5f5d2bdf38145ea0ba690af0fa3c9a28d0c190000860", + "swapImpactPoolAmountShort": "0xd865cfdbfa6836318d3f702b50fc0f64387c70582a099f8d3e2d5f3df4382cd6", + "longInterestUsingLongToken": "0xc5a05fc7dffcb5e8c5ab847777c3b0fcf39b92682861b0b33c9a968d478ea882", + "longInterestUsingShortToken": "0x0fcebba8d1fb79a3a41ad548531d7d63ff10c5e02ffe7ad0f4de6f1ef3351f84", + "shortInterestUsingLongToken": "0x73ac336f73bcc69edbfe3cf757bbeae7a3469668ed25b06af61e9530cd7eb81f", + "shortInterestUsingShortToken": "0x78fdc3e0340c99506c7425c6f2512369ea086c664163fc3182b1261ab41d70d9", + "longInterestInTokensUsingLongToken": "0x4a523bc54a64f6c4d0cccdc04ced5034611f28ae4096d5e47d3c19fa8e991ff1", + "longInterestInTokensUsingShortToken": "0x0b6b93203750dad76900500fb99c143db5ba5fd77bb5616eb6a9484bb6f93c2f", + "shortInterestInTokensUsingLongToken": "0x2ed27ac4a95885db918f5daa16714aea15b98b8c14f6ab74d2636d5ce241d61f", + "shortInterestInTokensUsingShortToken": "0x70fd311d85d4250234d0f1f25bc3dbebbc85117187595c220a482969ff67b02c" + }, + "0x4fDd333FF9cA409df583f306B6F5a7fFdE790739": { + "longPoolAmount": "0x8e8db35e0dbd89865e95b89d3436fc6f2ac82c6ba032bca3ac4ee8229b50f400", + "shortPoolAmount": "0xc6a9a7bf6692f5a50366c3eb34316d46466e5dc95d7aedeb5ce6c5bfd2681bdb", + "positionImpactPoolAmount": "0xb759cd7638ea9c86edadd27a4e54e72444ecb5b702a690f37a93d44f8e14dd8c", + "swapImpactPoolAmountLong": "0x7ed4ec39ed6463bfa4cbd257130e6591193d8710e83222f0ce648c78370d67ae", + "swapImpactPoolAmountShort": "0xd471bb7ae282f8b43462a25e12d8fb51d7a1646170385987f4fee2d5afdb1bf4", + "longInterestUsingLongToken": "0xc727524556a6bad1ba32e02d56240c0b0fb789ed86d54691ec43b3cea0e7a7df", + "longInterestUsingShortToken": "0x94c39cb2791e8886c7da98c00888b402fca49d83e7823ebd1ebdcbb8f2d82541", + "shortInterestUsingLongToken": "0x3db15fd09a1da9df8d2cdeee3dbfb896f6aeca4184741ffe5651c74094b89914", + "shortInterestUsingShortToken": "0x8afe614f87b107d50db49ac051f7cae85671d52466c575bcc9594385e323db04", + "longInterestInTokensUsingLongToken": "0xb6e094dca1db999966c2f038ae3c6bf3adc982a67f743831a3d5897b269d555a", + "longInterestInTokensUsingShortToken": "0xeab6c1477eca85958d142ae7eea04ee704be4418245672d45aed7d4962c2e831", + "shortInterestInTokensUsingLongToken": "0x53991c084903a295ead3977c7809dc92863d7b515ab58fbecc4e0726c4733d02", + "shortInterestInTokensUsingShortToken": "0x83238b54cf7eb0849a3ba32e59e6a6dcb08409c25dfb643cb24c85ad4b1a4d42" + }, + "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77": { + "longPoolAmount": "0xfcdac88337d561a2ce617bc3d2118d2e415b20e94b5e2206a1a00c2ae4982969", + "shortPoolAmount": "0xfcdac88337d561a2ce617bc3d2118d2e415b20e94b5e2206a1a00c2ae4982969", + "positionImpactPoolAmount": "0x54f7cf9f5bd8d6aec7f60fb92166ef61761e8258b354f6baba984fe1a4d74b96", + "swapImpactPoolAmountLong": "0x1317c1d423f449947601b89851ac236c3887f0633665467e5075a383d311ad0e", + "swapImpactPoolAmountShort": "0x1317c1d423f449947601b89851ac236c3887f0633665467e5075a383d311ad0e", + "longInterestUsingLongToken": "0x9eb431a8682f4229bfe56da1eb8a0bfbab809e1ab0e51325542551e5a63fd65c", + "longInterestUsingShortToken": "0x9eb431a8682f4229bfe56da1eb8a0bfbab809e1ab0e51325542551e5a63fd65c", + "shortInterestUsingLongToken": "0x2adc2b7ecdc640969dede0bddf00021f43531a3832ea1579bbb695826576b4f3", + "shortInterestUsingShortToken": "0x2adc2b7ecdc640969dede0bddf00021f43531a3832ea1579bbb695826576b4f3", + "longInterestInTokensUsingLongToken": "0x1e42b46d2a594b8936b13829f59a9bd155c059d02cdfc41f94bc5af0a9d83d23", + "longInterestInTokensUsingShortToken": "0x1e42b46d2a594b8936b13829f59a9bd155c059d02cdfc41f94bc5af0a9d83d23", + "shortInterestInTokensUsingLongToken": "0x2eabe340ea53f228c0287adcc754e91a05b79ba309bdfe69143b0f41be6d2a9f", + "shortInterestInTokensUsingShortToken": "0x2eabe340ea53f228c0287adcc754e91a05b79ba309bdfe69143b0f41be6d2a9f" + }, + "0x450bb6774Dd8a756274E0ab4107953259d2ac541": { + "longPoolAmount": "0x5fc01fa6dc5fd8a23f79276f7837c863afa42adc43184cab9f01aea4c7ae695e", + "shortPoolAmount": "0x5fc01fa6dc5fd8a23f79276f7837c863afa42adc43184cab9f01aea4c7ae695e", + "positionImpactPoolAmount": "0x45adab12269a091adc6eb7220af6ab173c7a9e1cf701c930a1cfc98f41c82122", + "swapImpactPoolAmountLong": "0x6c72ea872975a1addd5c0864de406dc019bc716c50166a7022f1ca33e3d3066e", + "swapImpactPoolAmountShort": "0x6c72ea872975a1addd5c0864de406dc019bc716c50166a7022f1ca33e3d3066e", + "longInterestUsingLongToken": "0x2fb76b062401e7b52ce73015f4cee12157e51119dfb844d4cdd274cb8299d747", + "longInterestUsingShortToken": "0x2fb76b062401e7b52ce73015f4cee12157e51119dfb844d4cdd274cb8299d747", + "shortInterestUsingLongToken": "0x3f57ef70949a77a5b48e6f9bff62899ad1aabde89980c67a6f4a33ceaec4152c", + "shortInterestUsingShortToken": "0x3f57ef70949a77a5b48e6f9bff62899ad1aabde89980c67a6f4a33ceaec4152c", + "longInterestInTokensUsingLongToken": "0xb1da7eacd92175afff35600be3528830573d92f07db6002618e6aca5c2410d68", + "longInterestInTokensUsingShortToken": "0xb1da7eacd92175afff35600be3528830573d92f07db6002618e6aca5c2410d68", + "shortInterestInTokensUsingLongToken": "0x5fbe97bea123c957f97b0bb967f1dbaaaa59333de62d758a2b228b75f289410b", + "shortInterestInTokensUsingShortToken": "0x5fbe97bea123c957f97b0bb967f1dbaaaa59333de62d758a2b228b75f289410b" + }, + "0x55391D178Ce46e7AC8eaAEa50A72D1A5a8A622Da": { + "longPoolAmount": "0x7e26b816faf4add32c579641a024a7c7761c05e664e78522a71153aab44e134c", + "shortPoolAmount": "0x5baa604e3254fcbffdec0d7fbfc0cc1ff7e8ed1431204f4cc81a18757719fa9f", + "positionImpactPoolAmount": "0x62852a15d987b5320c7d5dd89b3c58f67b74e1b3516e0d70f29b535595947569", + "swapImpactPoolAmountLong": "0x90c9ebce1fcdb7ff1d083a099aea20dd4bddc4eacfbf6114a7e031da901b4d13", + "swapImpactPoolAmountShort": "0x22f03848660c7989ab015e83739a6b249ca250f117efbc78f15048e844d96b42", + "longInterestUsingLongToken": "0x47042adc3bc051b0abb612ee2dbf558f6f9c7f0e77972163bd7394a044f94b9f", + "longInterestUsingShortToken": "0x6a324615f090510a918bf260bc5aae2bb386d794975c2f54bec74b112f50bae8", + "shortInterestUsingLongToken": "0x3982b8f7523ad74e8f54ba8bf631a775cfb518784da63d398623b0bf2d22adf1", + "shortInterestUsingShortToken": "0xac1fd9fd1fa0ad431f10d06abd15edd14fbf5410e698bb5f0f8d67998d35e1a0", + "longInterestInTokensUsingLongToken": "0x979fc2d11428c9c7021efa0809f1aa6fce864ed9952fedf8122214ec63a307c2", + "longInterestInTokensUsingShortToken": "0xa25d9cfd62d2ede9ff34a3b74d283a3234fa2331a585996d60924ab4e10a7bd4", + "shortInterestInTokensUsingLongToken": "0xfc7d73d44cd1f3ac9805040971654732154dd99337c3c6941478700da192f53c", + "shortInterestInTokensUsingShortToken": "0x6a439a30994c0c9d98220b52bc16983fedda68429484d48de49271b175236909" + }, + "0x2b477989A149B17073D9C9C82eC9cB03591e20c6": { + "longPoolAmount": "0xdb4dcfdd3377718923920416934586a13fb1c4ab6caec126f16692a929806118", + "shortPoolAmount": "0x2de1f935fd5108a6de074324b806e2476fa257c21213b0026b323a434fd35e88", + "positionImpactPoolAmount": "0x365fab3eecb4deb4dc1321abc5b21c73b51f37615e51f1dbd77c58d47736bbd3", + "swapImpactPoolAmountLong": "0xf49b83f78cfdf99fc5076fc6757a77250843cd1e5195c503c0df814ade02fbb4", + "swapImpactPoolAmountShort": "0xdc8789f0b50f11eb03e58fd0dacf8a3f72f1e6a7722673703cd3621a868c755e", + "longInterestUsingLongToken": "0x59ba3057fa9ce53ab916a6aa23bfdfd765ddd40ea64a1dc1d6569872ba4bcfae", + "longInterestUsingShortToken": "0x3b4dc2b2a9960dc68d06d078ff0f27f85288aa5741e856fbe4b314d665258059", + "shortInterestUsingLongToken": "0xcc93e178158938d00e596c35b990a2049fb6a22096dcd07d3a3a565bdc87545f", + "shortInterestUsingShortToken": "0x2372925b7bccb7d92e274e5d799c10d86ce3acdad8bf362976277678fc063ad2", + "longInterestInTokensUsingLongToken": "0x200a8381deac2b50cb2d7d0e25cabc935b910dc4ab23179973e09626729dd28b", + "longInterestInTokensUsingShortToken": "0xdd66516cc98865eab546bcf996ddff13cc9a6cf964ec93c9c55aad68cbc0ab0c", + "shortInterestInTokensUsingLongToken": "0x49d9a922900ff263325f1363942e0c290b5b2fbc0167a4b99ba6680821c9d348", + "shortInterestInTokensUsingShortToken": "0xf25e678dde0faaaed94b6bd8ba21457e9a203075ca24e361402729d5882156f3" + }, + "0x0418643F94Ef14917f1345cE5C460C37dE463ef7": { + "longPoolAmount": "0xd73b3208669c05e0668e35390e02294742e51293f2fa68791220534061606612", + "shortPoolAmount": "0x7d3645cb8041bf9a00e47e9ef3899f206e9eafe88bc2c623cfdfa492106e6ff3", + "positionImpactPoolAmount": "0x7fef4ea911342fbdf849ef6fce4fa80f1db6664f09f09ae49d52bd94e041a849", + "swapImpactPoolAmountLong": "0x185b6b2744fe9fb8e0461a6665514e36694af12648a57296557a6ee9e2f205dc", + "swapImpactPoolAmountShort": "0x89eed98489b08431bef4010936dfecf4e8c4c1b2f9abfefab47915afe173ad1d", + "longInterestUsingLongToken": "0xb9838b5ddf80867ad90ce3e90cfcf15c684830d54106d0b07f9426c76ea3ed6f", + "longInterestUsingShortToken": "0x7b54a64b7eaaa0cb01caeaa2056e31e8ce5a7d3eef40388620df0d852bc47fb7", + "shortInterestUsingLongToken": "0x679a5a56254840ebb42013b1c01dc183a33683f1bd6a8e03791345e360030654", + "shortInterestUsingShortToken": "0x43f090931073aa42d39375083149dc5ddf12b938cc819983bcf8ddc75630a3e5", + "longInterestInTokensUsingLongToken": "0xb8e1098dca1a6eec0a14fa5ad85ff6fbb81f13b951b2f97d7ddc470c07d860c4", + "longInterestInTokensUsingShortToken": "0x7cc8925bf3553de74d606f5b490db17ba4aa8e897b039d1d4e27fca2286d206f", + "shortInterestInTokensUsingLongToken": "0x41e3b79c739d3e836910657d8a83696cbdeb369b81f79e6678150bbccc1d864f", + "shortInterestInTokensUsingShortToken": "0x5f470ef4838a440309e2a832937a4c031db5e3a45d9842e2c1095881b861d11a" + }, + "0x0Cf1fb4d1FF67A3D8Ca92c9d6643F8F9be8e03E5": { + "longPoolAmount": "0x075d62390623ddf7230b040019bf2b783079aff59682af644355ab9118e7337c", + "shortPoolAmount": "0xe66ae1dd365b03b41ebfa4a4dc8076a0e6a1b2706b23a8febd91c2317914b8b9", + "positionImpactPoolAmount": "0x8bae739a4993e79a3e78e51eae355ef7f3aa8c0b6155b3b0c42146fdd459cc75", + "swapImpactPoolAmountLong": "0x38fbfc07281530121c71e33e9bcfd75490678024bc2f794bc654cd06189890ed", + "swapImpactPoolAmountShort": "0x640705184abff029de057d30f434e80a5de5c91a7d0a8bacb00497e3cf3a22f5", + "longInterestUsingLongToken": "0x68ca2e59dcd9148cdda2a56010643ac2254429527b350dbeef6c61fbcdbf7c21", + "longInterestUsingShortToken": "0xbb9a83a28f8ffe295cac681730d60c0fcfe94a3f430a9b0a08dd5369cd18d7fd", + "shortInterestUsingLongToken": "0xecb5c9b3bdce544b259fab6c7e090323f516cdf36f9076bc97a10e799a408778", + "shortInterestUsingShortToken": "0xba17542c83872b3e87a6dae070b56de5bf0a8f0075b227dbe4ba44ba41e6a15c", + "longInterestInTokensUsingLongToken": "0x3cbec5e6bc8ff9f9c84c660e7cca5d69857c3e27c8650455a2da741b9806aed9", + "longInterestInTokensUsingShortToken": "0x5e6f24cd16749c5c74ea6b9c8fe653c095ce62eb02c40ac7b3a93dae2c472444", + "shortInterestInTokensUsingLongToken": "0x44e4780dd7b15f42e5cb1315395e2cae459285f29dbd8ec92b4ec722bbcd04c4", + "shortInterestInTokensUsingShortToken": "0x648e9d6e23e35f72fc7406c9191a363019169d49a21a3cb5965a27d24e8aca30" + }, + "0xb56E5E2eB50cf5383342914b0C85Fe62DbD861C8": { + "longPoolAmount": "0xc9aa29cd33110830adafd75c706b6e947d362102ad36512376b4e9a4e4605366", + "shortPoolAmount": "0x3b40ea06737c63448dda4b650fcb113a10c70884fe064c7ce613d2096f8af07c", + "positionImpactPoolAmount": "0x806bf467e06a08a689d6082d053ee0f8bc1fa9552b860417408bbd4af99c6634", + "swapImpactPoolAmountLong": "0x8ef37142f0e20899011c45d06f00bea8da832b727c34553de8da4c0de5dacfc1", + "swapImpactPoolAmountShort": "0x91314b1d4533561530151364545085b78f4b142d9c6ff1b12a465cf3f97645e0", + "longInterestUsingLongToken": "0xff7c59609caba4135751777e9522ddd968f1ae0c6c5f93a3bc91f9bd2cdd1fe7", + "longInterestUsingShortToken": "0xdeef2b7798dd9e9b271864a4dc8fa5784f8c5fa11272b7032dd6f2aef0b29416", + "shortInterestUsingLongToken": "0xaf4786809cbff54bf14dd70bb7c49ef5898d8dad34ff1793dccc04db886c411d", + "shortInterestUsingShortToken": "0x1d7de275dfbaaa96d1ef11319d180fa22404f48289023fd7a7222fbccd30b115", + "longInterestInTokensUsingLongToken": "0x527a304324991e35679dd6ff47c44055118363d4ea7141a93a401d6873b09073", + "longInterestInTokensUsingShortToken": "0x638f0e6567c5cf4f80c7a200915aff89707c893e849d3a63aa9474c3110d74da", + "shortInterestInTokensUsingLongToken": "0x86dc7a152906121ecc73e3d6a1f95fe397969a0a74eb978ca4bd144393bb6a2b", + "shortInterestInTokensUsingShortToken": "0x303f58cecdfacd1f3b942a352eaa21b2a950c85cd4027289043c454c831742fa" + }, + "0x45aD16Aaa28fb66Ef74d5ca0Ab9751F2817c81a4": { + "longPoolAmount": "0x1d4ea67f0060ad4c2b717ae6fb215ddd3341eb2f6b08eb41e53218d892c353a4", + "shortPoolAmount": "0xa498318729dd61ac91d1e75da9e6e06f26d48d3fe850216d28c0cc14ff7fa869", + "positionImpactPoolAmount": "0xa1bd471af80682cf94808e3ece3beb3a5935fc1cca8862d46a5e7b21dd2404c8", + "swapImpactPoolAmountLong": "0x163d719b6969d341aaf135e9e66a8050892489eef1b0fe1d0f5a8d5426caa909", + "swapImpactPoolAmountShort": "0x615d5ba4377b0af3fc6e305a520ecf7d818df4e87c5052df161e38528ae3dd7d", + "longInterestUsingLongToken": "0x747474900511ecc8e7c5d9c567634f8dc6daff594d2d834675581e048880d448", + "longInterestUsingShortToken": "0xad663c84d1cbd6d59df7d39e1671be1487a004a020afeef72a04ff4263f2aacf", + "shortInterestUsingLongToken": "0x1ca46f703853bbae52186f0e571fc2d7ff850439233eb97d1642666c0a09bb6c", + "shortInterestUsingShortToken": "0x760c2b8ef0fbf85b0c89cc6c773444c5d0d5fe7ad834d360f2780c2f5d869661", + "longInterestInTokensUsingLongToken": "0x86023aed47c4c53a7695dcc7a74b3557b4f652cb482e600e4d322da097fe0ba4", + "longInterestInTokensUsingShortToken": "0x4bcae46568957c8898f7d6bc3b7f7a404185b84f72051c257b7d8749f5b02f23", + "shortInterestInTokensUsingLongToken": "0x17f309259e59f64729bf233c42641346abae369ac7c5633c7f34b28562491c99", + "shortInterestInTokensUsingShortToken": "0xb3cb9f0ef50310c9b4df544082487b6659389456261efc3e75ff7514f1b8fd50" + }, + "0xB62369752D8Ad08392572db6d0cc872127888beD": { + "longPoolAmount": "0xa4131aa803086954643d410d43c6dc25174ebc66038ddc5ec580c4c87cadce78", + "shortPoolAmount": "0x746c446770e57610aaf8ab208f4994dde5078fa30ca67238933b639b0e081c91", + "positionImpactPoolAmount": "0xcf9129cacfe38553828bae09806d4e6521711f4863d9eabef5439f8d38a7b813", + "swapImpactPoolAmountLong": "0x627b336a001cf6eb4e28d0abd139324bd4d82b16fb8c0dc30efa254d7bd695f4", + "swapImpactPoolAmountShort": "0x72b515e6d2c544a823b6c7465563cee8dddf58b087d8b8853effa3cd07cc35bf", + "longInterestUsingLongToken": "0xb61609daaa551c8f0249a2285456d645767aec2a95f7e40418cc83a48c392ddf", + "longInterestUsingShortToken": "0x8b5eb6a5510416d844b4684e5e69ca7bf35f1cb412c523a32ae03e12af375249", + "shortInterestUsingLongToken": "0xed5cf2e98607d02af0b3061a14ec3cfc1433efae939c2b1cf93267aff3c46432", + "shortInterestUsingShortToken": "0x472180f8e38e690c810613a6e1a46bb46c1e0a07300735b78f2ab0ef43bc44c0", + "longInterestInTokensUsingLongToken": "0x5d20fe8125fd861ba1c32235b276268a6624f13b0a39e206f10774fffea8851c", + "longInterestInTokensUsingShortToken": "0xac59a2a29b7733e95947fa6aff21b3637980d5c4943d9416f85b7edb57368023", + "shortInterestInTokensUsingLongToken": "0xf4dd0f71273bdfa14336d19e6cc2cc1e94adc41a61db05fd3b1033a7e44ef2a8", + "shortInterestInTokensUsingShortToken": "0xdaf6901cdc73c1b998244e56959831331e1d1d75d9463c0ed08517f4a134a739" + }, + "0xD9377d9B9a2327C7778867203deeA73AB8a68b6B": { + "longPoolAmount": "0xf122c7e6d0351093f7d1e0fcfd69393bf080b2f123b5770d0b254e679be65a3f", + "shortPoolAmount": "0x2510fcb6409c65d58482eb5db217757746856acefd9b8a3fada05aff8577fac5", + "positionImpactPoolAmount": "0xe2ea1656d5f2192131393d1ff6241140222eeb5933080071e1e4e73886129085", + "swapImpactPoolAmountLong": "0xbcd03b3bc910f49aa9773852d73ce05b9017e80061cb721c5f79b0c01eceef57", + "swapImpactPoolAmountShort": "0x685dfc8dda5b57cceceb4a174a22db7b47edf55f9240b9a863c2e2bb16f11a7c", + "longInterestUsingLongToken": "0xa01aace829bc77169967e69b3d6a2d4bb169476efd27ecefd7a83b563d0cc470", + "longInterestUsingShortToken": "0x685eb8e71d1e05784e3a78108683e269d852e9a0ddc798f135cd5533a573f9db", + "shortInterestUsingLongToken": "0xf7761b2355cda54d03540bec92a64d38168b9bdf3b476a32290d1fdcc1910273", + "shortInterestUsingShortToken": "0x605c1ddd6b164b06be7cc90298b01df10ee225482f9788ec7f6e242d5c774c99", + "longInterestInTokensUsingLongToken": "0x0481a67da357b858a6cc09afb46ec4c49a599a83f0bff5b69d59c527a7b5f304", + "longInterestInTokensUsingShortToken": "0xf34d20df9636f3d0481701a04a489866f4fae1c9cfce08699333b624f07c1245", + "shortInterestInTokensUsingLongToken": "0x5c8bea020aa9fa77aae2e2c21d50a17eed21673e372d4382bbf993059638ab2c", + "shortInterestInTokensUsingShortToken": "0xbda4b62f2d1b6b81f9398e396999d6483bfc27b6168caa24cab3e536cdba12e5" + }, + "0x93385F7C646A3048051914BDFaC25F4d620aeDF1": { + "longPoolAmount": "0xfda9b7f8837db679b73c1e9e58b20b3ac7cf7d224cb78624c0a0a5bb3e5eb2b0", + "shortPoolAmount": "0x68ad8c38b21ea742a0c9ab94b46f81d32af19ee007549f01f443be89765890c6", + "positionImpactPoolAmount": "0x7b452d9478bdedb62b01809e8cc6e6e486c3fdc573871a348ae2ef14535d2afc", + "swapImpactPoolAmountLong": "0x58cb89b11a3f553be6411e7f9ac14e5deff5893205926d63c599a6de55e4ab54", + "swapImpactPoolAmountShort": "0xdac513df3e6ac45c591faf563678c686f790841ff808331185656f135812df92", + "longInterestUsingLongToken": "0x00bb4580ff3d87e80b9897c45f15c83e105ed2726a23a301007013f2a8ebd73d", + "longInterestUsingShortToken": "0xde335f63371867cccdcb23e7c202de3bc43bd12930bd4e7e07ca7cada0cb220c", + "shortInterestUsingLongToken": "0x74943c63d3fd59ebbd91e31856d9d9b5daa3fc3a891a4bc080a1731eca342ae7", + "shortInterestUsingShortToken": "0xaefde88b8b129e74ad0f8b8d56b2d48642d685707f665ca80b5e397c74d73514", + "longInterestInTokensUsingLongToken": "0x1df31a1893a51c0e4287e93962db9865a84afcd379cd8878f6b9a845fb5d8a18", + "longInterestInTokensUsingShortToken": "0x2e3aa54e81fa3c628dfd8af28f2c8bddaa2a804d15b6c375b41e589adf74dae4", + "shortInterestInTokensUsingLongToken": "0x7cd23eb1c52098a226c7678616a4b37e4276b494b97538fa169810c6c6ece557", + "shortInterestInTokensUsingShortToken": "0xd4be88008fb454ad3f3fe07227290c707925b2e3e992031d4a15227950557b52" + }, + "0xd62068697bCc92AF253225676D618B0C9f17C663": { + "longPoolAmount": "0x09aabdc916a85210badba72e4a1bf40333708c59fd142e47b40a6b1995e142e1", + "shortPoolAmount": "0x09aabdc916a85210badba72e4a1bf40333708c59fd142e47b40a6b1995e142e1", + "positionImpactPoolAmount": "0x7ea5b4e1f07764767511a4f8eb213ba871423a2c5bf4ecc534ed3d3767ca0ad5", + "swapImpactPoolAmountLong": "0x87e7757ca7d1ee8cbe360a68cabb7637c918fb908dd67c43db3a4eb652941c23", + "swapImpactPoolAmountShort": "0x87e7757ca7d1ee8cbe360a68cabb7637c918fb908dd67c43db3a4eb652941c23", + "longInterestUsingLongToken": "0x176ec1006792838a8311d4f317c2fac1754db701e2ca747df1ab17ff5989ebec", + "longInterestUsingShortToken": "0x176ec1006792838a8311d4f317c2fac1754db701e2ca747df1ab17ff5989ebec", + "shortInterestUsingLongToken": "0xa29e87105f64b3a77aa412e5319bf66d5f80647432a31b7e2142483fb755c0a3", + "shortInterestUsingShortToken": "0xa29e87105f64b3a77aa412e5319bf66d5f80647432a31b7e2142483fb755c0a3", + "longInterestInTokensUsingLongToken": "0xb046cd5a60e7f57c9a0d9c052d1b5addefceffe9cc742beed71b973ce31d4d66", + "longInterestInTokensUsingShortToken": "0xb046cd5a60e7f57c9a0d9c052d1b5addefceffe9cc742beed71b973ce31d4d66", + "shortInterestInTokensUsingLongToken": "0xabca42c4b216559a8e99b1217eace0cbd2e9d60969e32f343d09fda2ecb3571f", + "shortInterestInTokensUsingShortToken": "0xabca42c4b216559a8e99b1217eace0cbd2e9d60969e32f343d09fda2ecb3571f" + }, + "0xD4b737892baB8446Ea1e8Bb901db092fb1EC1791": { + "longPoolAmount": "0x0cef2bb24752e470462d0d9aed2e2b8ec421e323c1fa26dbc85014565df10022", + "shortPoolAmount": "0x744263e4b4cd0c2ac0bf6adbec709114ca6350c51e3b165292d0577622088175", + "positionImpactPoolAmount": "0x21ce85509e53ddedc24b343045487fdfb391e5438ddf72deb62d401ea6682ac0", + "swapImpactPoolAmountLong": "0xf9bea466c8da9cae0dc40a8b1a05c18ff89800ecadee5eef31039201052d1e7b", + "swapImpactPoolAmountShort": "0x6a61e3399b53c67569d3abe44c8eb4aa122f0abc72d3c30ae60e5f55dc578cfd", + "longInterestUsingLongToken": "0x1c0db7cc562ad87714dfdb68d455656eaf87de67f4ba86487c2463bec87e4101", + "longInterestUsingShortToken": "0xbd21ca76bb6b0adf8b468297cad42640c8a6cfe37ac0815086e57240d405a816", + "shortInterestUsingLongToken": "0x4704679bdf6f7f7029e401bd8e5448b9c014dd79c187388d955cc8c95ad0fac1", + "shortInterestUsingShortToken": "0xd6ba4c93bbbfa2edfe7ffae072f1807bb88f1daa85d579a5697296092d574e43", + "longInterestInTokensUsingLongToken": "0xc3b1ac02cbea3bc7a62ff27bf43424d4075592048b9eed739e2c89eaa2c86220", + "longInterestInTokensUsingShortToken": "0x171d21a0a4779cff034f1e9a497655cf9259e0200ca82ce1438d41f5892b6ff1", + "shortInterestInTokensUsingLongToken": "0xd70f9dddfc1978445a2c909c92fdee229b335782dc5f262bb5d159a35283aa19", + "shortInterestInTokensUsingShortToken": "0xafb41b454953caf3078e1ad97889ab4ff8ccb29655fa54a18ccb60752aa5ea3a" + }, + "0x8ea4Fb801493DaD8724F90Fb2e279534fa591366": { + "longPoolAmount": "0x1c440ea97d0201e45690ea6015a900765ad30558eed89934e2c1d9284ae1d786", + "shortPoolAmount": "0x540080e9dcc4817a6470b0dd1170dc87acff8462a980d220eca8eb00927b8421", + "positionImpactPoolAmount": "0x9f23a2dff7dbbcd7e2e08b096cbd06b9c65adccc5e1764bfff9a4e5f5fc4fac1", + "swapImpactPoolAmountLong": "0xa3e993d5ff678e7c741ed8fafd580a2b8bfeded13f420177da76767b623683f8", + "swapImpactPoolAmountShort": "0x1b5e4b83efb8614309e690f02a5d56e6aeff3aacbad0a7f632725fb8449a2bb6", + "longInterestUsingLongToken": "0x40209ae2f4e5e22a7bc931b42cb8df89a6d76d47b4ea3e3f00f9245ee060b2ab", + "longInterestUsingShortToken": "0x1fa542ba174c6c29082f16c20564b05c25fa7efd7a518492a8745ccddd522efa", + "shortInterestUsingLongToken": "0x3d38f11a91cd1272987aec9cf4dd304ead5c78ad73ddb362bf63f9b8905e9e78", + "shortInterestUsingShortToken": "0xd4e88ec02fbe8d773b0fc4980cd105196939364ab96f81f17fbfb32935b96cc4", + "longInterestInTokensUsingLongToken": "0xbd0cf81d15dfaef5fc87c5f72571a69f179d3e9c071077e54293c739d2e862a3", + "longInterestInTokensUsingShortToken": "0x88206642104566806a96c84bb7153c73b4e025d4edcbe04bff0d2a2f18c4b79d", + "shortInterestInTokensUsingLongToken": "0xf7fb2ba937dc31a6eebc16bd2eb399d3aa01d4f9192f39637035aa40ded3b975", + "shortInterestInTokensUsingShortToken": "0x3593dd23e301485c8a3f2de404729eb77f0c73f46fcc6285866053a2160d4386" + }, + "0xD0a1AFDDE31Eb51e8b53bdCE989EB8C2404828a4": { + "longPoolAmount": "0x2b116b0c9e9d237022dbb1b908c2bce290d453845b7ca69eb9df3820a3e5184b", + "shortPoolAmount": "0xa9112255ff0ebf49a9fe8a3e80feb59b5a2edb4e99d4844041985ff429f0f65b", + "positionImpactPoolAmount": "0xd0e761d5b706752640c8a28acc7b7c5b690966f5b57a7bcff3df0fe456235aa9", + "swapImpactPoolAmountLong": "0x731ae6d174d7c4fc3ed8ce4576a55da3102a90869df2b73522daf2f2febf0e58", + "swapImpactPoolAmountShort": "0x3324ac6bb6b963f15e090a9e2cbebf849acd05223e1961850a7d1b40499c683a", + "longInterestUsingLongToken": "0x80bf188fd9ba38a37fa6cc7bd478c782908d13a1ec8cab11862f7677030603a3", + "longInterestUsingShortToken": "0x6cfa0fe58ced681dab73dbda16ff94bdebf090482ee2197181b4fb6c32a45c29", + "shortInterestUsingLongToken": "0x856188fb8aef37957dccb32c9fcd10b6d25b7e97a10ca1b16cf0fd1383a57c85", + "shortInterestUsingShortToken": "0x1a09d049b91e0b7564b131d39437f53294c2f27fec6816808aec1a5bbb25158d", + "longInterestInTokensUsingLongToken": "0xdebad8cacd9886c5c54566d2ff0cf979d9f211511b0cc550ed7fa50fde125066", + "longInterestInTokensUsingShortToken": "0xc5adbc733fa5b002cdd4107739cd6840424ee61e596447823cc6aed10fd5c7fe", + "shortInterestInTokensUsingLongToken": "0xbe166d07a0161e34538dba361890419d03f0186a34d3d09a5c98e9055f520294", + "shortInterestInTokensUsingShortToken": "0x4855795ded427a462d3648f3726dba3d88d215c6939acd3c4aa4a2c5da6362a9" + }, + "0x77B2eC357b56c7d05a87971dB0188DBb0C7836a5": { + "longPoolAmount": "0x35878d3714126c01db527bacc5ee454a61130d08fce1e42f1139fc59deb1c6c1", + "shortPoolAmount": "0x7a3bdcd412688b61762893a1a9bc0b616f722682a11f232625958b7b3193095a", + "positionImpactPoolAmount": "0x08ce44bf96564f78bcee09189ec39f811f8e2c27fe2be4fd796f61b2caabb814", + "swapImpactPoolAmountLong": "0xe7caefab1f86220727ffc19dc6042ccbfa62156af631480aa99884e441ce3466", + "swapImpactPoolAmountShort": "0xc25a8875916ee7e695671291da1da2dbdc343dd6495f1006cc91dc39e409653d", + "longInterestUsingLongToken": "0x40f9c1f03878cc2e6b228d0e3d212d964f7920a5c99113bbce099c90e172286e", + "longInterestUsingShortToken": "0xd11ad3f89a967bc3c796c7f6c406fb7d309289cc77df76e3aa00e51f2f25b303", + "shortInterestUsingLongToken": "0x48636dedce9a58172eea7e0df7ebecdcc61cb35e464b88220d1ba515bc6e0791", + "shortInterestUsingShortToken": "0x8be4ad75c1db381dfa59f344aa63710950f53c8fa28d51dc14b4c913a28a3f06", + "longInterestInTokensUsingLongToken": "0xd3835e5129023a5a06c920029e4a1f18141221dc305cec23579f19e1319d31ba", + "longInterestInTokensUsingShortToken": "0x57b0480ea840eb774d7c783741261c864918d808c51a6e511dbcdd497a292a8e", + "shortInterestInTokensUsingLongToken": "0x7888231712567f256c482756feba912667460e2f40bc5124635cd8a045ace8a9", + "shortInterestInTokensUsingShortToken": "0xc074d1337cfeef91aa9825fc5a116c7b4729725351d7ccfcbab89f0490e6e118" + }, + "0x0Bb2a83F995E1E1eae9D7fDCE68Ab1ac55b2cc85": { + "longPoolAmount": "0x2e00101f3110704f28bc8343e5ebbac5e55199c63d2b708a657858e6cd0cb968", + "shortPoolAmount": "0x550b839be6275822d2b1b21ff7a9f94021058192c2a8666e7544d51c32da7567", + "positionImpactPoolAmount": "0xc484552b4126df6fcc3f50ba9396ab06148d95d5653488106e831b401a80504b", + "swapImpactPoolAmountLong": "0x6fcd757aa953044c43e6bd6bde6ec7bf836adb97e7a724ed1cdd2cb213f068ea", + "swapImpactPoolAmountShort": "0xa3c749355dd3e8b61f6ce0f5c8394924c2ba6e7fed5b809e574d425b40866b6b", + "longInterestUsingLongToken": "0xdf55341c38a18759f094963d765ad9b10e67c52bcb2b1c71262de029583ab0f4", + "longInterestUsingShortToken": "0xab5f58bc53ef7c8b96dea97e63a41b1b0dc6e84879edc3e685e0eea8996aa5fe", + "shortInterestUsingLongToken": "0xa198965bfcf366dbe19508253f7bd98317960909c8d06ac0a5b8e718d1f36b28", + "shortInterestUsingShortToken": "0xb74d9e3e000e0546c84b9a64ec882ad3feb32dbe8167686df8c3aa9446a145ff", + "longInterestInTokensUsingLongToken": "0x4d2c39cdee83ac83e0562d496be233c4bb49176e2e238d1acd76391c570d6384", + "longInterestInTokensUsingShortToken": "0x68db96a374d36e36c9f145a7de6d4bc0b7039b383a10a5639ffe82ab83f7ac31", + "shortInterestInTokensUsingLongToken": "0xb587f2f336a480b5159aa79147d10abb6c5b05f91408783711fae2d4af243279", + "shortInterestInTokensUsingShortToken": "0x78df225ad5d193d2a72736774b421567b3d2086475657fc93e8ee460b062f1b6" + }, + "0xD8471b9Ea126272E6d32B5e4782Ed76DB7E554a4": { + "longPoolAmount": "0xa39d269a432f0516670a81e5fd3044a13d4693034ab541184618c6e1452c3f2d", + "shortPoolAmount": "0x4f851d5d719f85cd38ddd03ea24ab4c39bf7787b5882c00df6718031cbd8f3de", + "positionImpactPoolAmount": "0x3b65f0dfeba1da8f177ee60d5d4630a864cb5376b8d066381387ed6b61ea6e25", + "swapImpactPoolAmountLong": "0xd2b0530ce360dd8c772c40fddc6d253582263ad35bce0073c0d4914b1a59911f", + "swapImpactPoolAmountShort": "0xfecbd4d6b7cb1661e5098226d9411f6182be7226a9d659c358dc9864cb16a8aa", + "longInterestUsingLongToken": "0xa5400a8b14bc320bd0e35cd7322278606fcdf47f8c69b2a57535fe6e9ffa7c2a", + "longInterestUsingShortToken": "0x83159b06c0dfa4e170df54a98902312bfe858eb465d6a8e7b5918ded70fc1dd7", + "shortInterestUsingLongToken": "0x1a108add4b49637d869c2a3678e2583d067995b5d5e04519435e61894695a2ad", + "shortInterestUsingShortToken": "0xb8dc6b1712ed70f5ace1625848a74e5f1dbfa91f0e9441cafdd5bf796045134a", + "longInterestInTokensUsingLongToken": "0x9be4c2640d0abf474a817ba3f968d57c4953170279b303ddd8aa041631dc1505", + "longInterestInTokensUsingShortToken": "0xdc57c86f2d79dbeacae7a233566707e2853acae5085c19674a109323528d3ef8", + "shortInterestInTokensUsingLongToken": "0x843f93a0f0e31ff9ef93a1eada6653009a93ce9d33c749f48924c46a52bbe0e5", + "shortInterestInTokensUsingShortToken": "0xe1e66944b688e82dffe787423099f2b221d84d8a32679b7707d79f9c8b1311df" + }, + "0xdAB21c4d1F569486334C93685Da2b3F9b0A078e8": { + "longPoolAmount": "0x9107de9ae489e8ceb30034e75ad93fbdc73c29324eeb36f694c0c72c30394f4f", + "shortPoolAmount": "0x85c54742f25e158307c5d2f1a85953020340ce56842e237009cb2285a25dbb7e", + "positionImpactPoolAmount": "0xf02ae9c1a2359a32d844411a7ff1c3e0f126102a6857e346dfff6e8018d5a083", + "swapImpactPoolAmountLong": "0xddb0f3c1e1e93cb61c10bef9cdff166ac2ae26a2548472a8b340c2b33d3f922b", + "swapImpactPoolAmountShort": "0xc2c0b670bdfe2339ed0224d9d0cddaf836908104c8ec0f6fb6d596ed323f46e2", + "longInterestUsingLongToken": "0xbff1ab2a1a7f98d10c5bb5493d2eade5912a5396b83962d54939b937ba4fcad8", + "longInterestUsingShortToken": "0xd79cee37155dfed24bad412bd0078d51750cd45059a3d1913cb514e07af9e193", + "shortInterestUsingLongToken": "0x59cb115fde5456b104558b4778b30fbbb1185ba593de49c76406444823477015", + "shortInterestUsingShortToken": "0x335cd3183d5afa2fc80394246acbba9c519718a2995527394b3b8c0d90d2fefd", + "longInterestInTokensUsingLongToken": "0x061b5ff56e18423292ed657b9c24bdc9a8fd88fbf22257163461e0c320d6afc9", + "longInterestInTokensUsingShortToken": "0x74956aa38b53b5f5dc8934bd27f469fe241901e87d4bee6f3780121adb7830cd", + "shortInterestInTokensUsingLongToken": "0x9ca7d310a2555240b79cd166b61658bb34a90cf38bd9f6f25d1ffca14ee7ae78", + "shortInterestInTokensUsingShortToken": "0x3244c808e34580988ae5544e68641340f3d44404a90d49bd8e293fc5601d6bd5" + }, + "0x6Ecf2133E2C9751cAAdCb6958b9654baE198a797": { + "longPoolAmount": "0x87cfde7a4aab92f3a1ce5aa8929f5a557e5f2d7c0c197b6e5100f2ddec3a7ad7", + "shortPoolAmount": "0xa08e13e1983be90bf052ecc299278a164b902ac8ea2f067a636b3be340d20511", + "positionImpactPoolAmount": "0x8a13bb75ae8ecda2372c77707a4751449e77230d7f3a7ae2d3291aafa33507db", + "swapImpactPoolAmountLong": "0xa1e15b9a2f3b6517cc2c21762c1c7b2a0597e41d64c0f8d4673f963cb8dce922", + "swapImpactPoolAmountShort": "0x66d5e010a072579981fa3f10851afee533a15679c3b9295305bd3e6f8337c358", + "longInterestUsingLongToken": "0x18b03149d3af3884029c86eeda3672f5d98040c67b284289b3cdc1e216d07043", + "longInterestUsingShortToken": "0xe0defa3fc7bef48c5c9378ee27667574d61f806ec51a799f17e724a0359df2fd", + "shortInterestUsingLongToken": "0xe35cab158feaca99df0160efe8ce927f4c25b520f110bb319d4107165e7cd6eb", + "shortInterestUsingShortToken": "0xdaf15196330c81a174f42f5f65836f3246a368d093e99fd77b2c35138a90e5dc", + "longInterestInTokensUsingLongToken": "0xbc6b8b70040872ed3604971d2a178be42d44cdcc783963f425683dc7a7119cc9", + "longInterestInTokensUsingShortToken": "0xdb6f0a3aa8e27fe1a12308a773430ae8b9e642462bddf011de8ee7da0fb2cf82", + "shortInterestInTokensUsingLongToken": "0x45b13370c0d495ec75c692e651c415f8c762aa86839f0f43cfa52ce37c6ca8a3", + "shortInterestInTokensUsingShortToken": "0x50a8a7b2f5505852eaa5d3938573a5a67462576779f673a29cbd55c10c6906e2" + }, + "0xB489711B1cB86afDA48924730084e23310EB4883": { + "longPoolAmount": "0x75e678aef0ec04512b8f3512fe22b824f3c301b2c308f34850e79e533557be99", + "shortPoolAmount": "0x79e6aad5ed05a93e32f9bec7ec85e7f6a9245fcb94ec8eda23635a7d1b912134", + "positionImpactPoolAmount": "0xc68283a3c85421a10beea9306a69cc289b34c01ce38f052689b012407ca76226", + "swapImpactPoolAmountLong": "0x35c9b6753092f5a7d627dd9a373d8bb29720b36d404efa3459e2f79f6d504b27", + "swapImpactPoolAmountShort": "0x51c8fa2d7964b662e5dc8eda60db38e970b53e3395451c1cd7b5f960541a9b37", + "longInterestUsingLongToken": "0xe6ca617d35c9ef2c0496bb234c373ad3dceaa6648f361c28dcde91f0130bf8ba", + "longInterestUsingShortToken": "0x033cec27406ccf3468deb6b546e45e6f2e01c4226005a9f6fef57b3debd79656", + "shortInterestUsingLongToken": "0x1ee4b616221c934ff829088468248ddf54a01baee2e64c8cc0ea36b3ff31e32e", + "shortInterestUsingShortToken": "0x7c72cb36e2e1ba4acafdd38a2d0f42576f3e80577aacdf707aee67e0f8b90428", + "longInterestInTokensUsingLongToken": "0x933c9ba263ef5f910fa4433922b8485c4d58f33be880ef0d29d3986d66127925", + "longInterestInTokensUsingShortToken": "0xcbbccf7b71cbe239a1e5be1bb8382beb4b98643d22a0ff23512528dc537a8884", + "shortInterestInTokensUsingLongToken": "0x94c63c6d921ef8a81c8cc60a2ffd9c31632e36c1266df3b07eae1a4f5a9a0770", + "shortInterestInTokensUsingShortToken": "0x6460a2f6ca0b07b0d48dcadde72e3f203d66487e0ed23ec53455872693c6dc83" + }, + "0x66A69c8eb98A7efE22A22611d1967dfec786a708": { + "longPoolAmount": "0x315a32ccbb1ee8b182192bd59dbf05ca2ff075ea7eda93c38eca8d902f63fb8f", + "shortPoolAmount": "0x8eb45a3f5a8b62a1ce0a026519fe782547fe05543416a240893db61444868a62", + "positionImpactPoolAmount": "0xf97c6d74653305a96dc69b8c90d3a91f4d8d1c096f471b93cf966c766f3737c3", + "swapImpactPoolAmountLong": "0x3a514f4178f5fb4e75a5ef4de5271d0dd04e563a84a5dbb9e7dbdeffedbea854", + "swapImpactPoolAmountShort": "0x12f2fd3ed1fd05258a17f6c72d40ad0aabe8acd4f0ffc280124af14c5d1ca399", + "longInterestUsingLongToken": "0xc49508e51dde41e2f20c7c534ba425bb96a42a5e537b00a0c8f118d4ffe14d75", + "longInterestUsingShortToken": "0x1b11939d1facd9ea2c389b192bb5d7efae9facf556dadf09e9c4586e39a30803", + "shortInterestUsingLongToken": "0xca2fa0187a59428fc4f1804871e66f0347a80bc97da4ac06715c1935e3e5d9ff", + "shortInterestUsingShortToken": "0x538ea40fe657259fd5b8734cb84be58c3c1cda3060487daaa92acb0afba65e39", + "longInterestInTokensUsingLongToken": "0xc3b432ce1140c5f56de6332a6bf81062d7db32737d5f2be3d47d10c7191eb2d9", + "longInterestInTokensUsingShortToken": "0x2839943c4f5a2585032d4b480589e0dc7febd6b22f960a2faef2e0188f108a69", + "shortInterestInTokensUsingLongToken": "0x8893c868357f3d3a621aa0e2541f36e90c15ba600bf5dcc5b7898595d6b85990", + "shortInterestInTokensUsingShortToken": "0x7e79c0247e1bb684dce1cb9daf750e555316b54b4d6d084cecb4277030f70b89" + }, + "0xBeB1f4EBC9af627Ca1E5a75981CE1AE97eFeDA22": { + "longPoolAmount": "0x7a783c8d5dfbbbf856d3ed3e6f9fbcbe6ee74b6482c9592e711925ef0670c993", + "shortPoolAmount": "0xfd2469c97672449d793a09d830658215435e1cac9bc1bc6e7b42eb03ef8ccd1a", + "positionImpactPoolAmount": "0x5a2487fbc3eafc4d91da85f198a26991df83903376ac29f2c7d0e344ee4f0ad6", + "swapImpactPoolAmountLong": "0x59ce99e2c745bdc8f20d0dbff8d8083cf7642a16cf4cfb674ab6c4eee077b414", + "swapImpactPoolAmountShort": "0x2285e54d88c026acfa1af2db5a3bac1a5804cf565f5376afcc2f6031f453448f", + "longInterestUsingLongToken": "0x5519a301641e80a3112b6242a4e93908310e673455a040e8aa0ad4e3417ec7c3", + "longInterestUsingShortToken": "0xcc0fd019154a76764a544978e0120eb242df76477faa1ab3272fc4c2fdc9af81", + "shortInterestUsingLongToken": "0xaa2f88ca07a8dba32157720d0bf08e90ac482e616804bbf5133f456ddf9bc7df", + "shortInterestUsingShortToken": "0xe75b1432ed903a821ea3ba120ecb95d1e9194d42e6e2fec338d45b353ec7a028", + "longInterestInTokensUsingLongToken": "0x766df69c39b951e877f53cba38118bc5cd9d6cc9a5f5a1758c3313950701e964", + "longInterestInTokensUsingShortToken": "0x6d53a38dcf5fbc0c133956a28a5b128fdfb72667d0823bced27e430c1513fda4", + "shortInterestInTokensUsingLongToken": "0xb243e546c659a8bc75f841dd7e9416e8c3a6ab61573cba78ce724192c85a97db", + "shortInterestInTokensUsingShortToken": "0x4d54ab40b4fdba830b5657bf95a5e4a6d0591c775a995def3a52b65fbef45a38" + }, + "0x3680D7bFE9260D3c5DE81AEB2194c119a59A99D1": { + "longPoolAmount": "0x843ea38b4d3e57980b2de909f851fe93de71addd9e293ce0a87ac9378492e294", + "shortPoolAmount": "0xb8416c8f477dd3bbd110700bff23b93f184744a22255dfae535305080328ecd6", + "positionImpactPoolAmount": "0x6cd0228bc718b7b0efec3edca2b5ea6fa273c777207c7b7e0978b8181aa18310", + "swapImpactPoolAmountLong": "0xa620cb1cc2421aa7fabdecdfafd76eccb9a1ce76821bc41378f951a4edc75e49", + "swapImpactPoolAmountShort": "0xfa988077da73d950c8c0ffa9b32dc48b0a92beac9bc8f9775031d9849cba0b31", + "longInterestUsingLongToken": "0xe5486881110b2a5f603e904c7273bec0574cc5e629658b102c04e53c7fedbce7", + "longInterestUsingShortToken": "0xbe3d176d635759628b0e59c097104f7637cbf7412e4b4c69785339942e0d64f7", + "shortInterestUsingLongToken": "0x5a7fec14db4a463816addc1e42061e1a37f33d42387655ede7b7cb39086ca6d4", + "shortInterestUsingShortToken": "0x117f0db18a1993cf63cdd5728e9d8ce5ad508dc9ea3e7729358ab0c3a199e8b1", + "longInterestInTokensUsingLongToken": "0xe795e40d60a64514cbe5896f1504e6fadb38a7ccaab1676271c4a60bfd14f7a5", + "longInterestInTokensUsingShortToken": "0x54e4faf2635bf90206d83133fa01a278baa33a9ea068f5788e589b30a46e9f8a", + "shortInterestInTokensUsingLongToken": "0x7fe74e59d085e3bfbdd5213d5b701124601a057276caece5b6f67837da248497", + "shortInterestInTokensUsingShortToken": "0x22fa75d056087860d450b7041ac6b53bfbc1071ec51fb3aa1ffc1bddd995dcbd" + }, + "0x15c6eBD4175ffF9EE3c2615c556fCf62D2d9499c": { + "longPoolAmount": "0x1cd545c92a01cf6f7610f44d0b130abd0d18db5f62d25803c51c81bdb1a10ba0", + "shortPoolAmount": "0xd3c4f1b65e57fa4b1e3bf550bdec44aafd35d1137fcb2277ffb1a93b24fba0cc", + "positionImpactPoolAmount": "0x9c20fa6331ed8865e71ac6eced5007f953c78fdeb3fab05648282fa64da27574", + "swapImpactPoolAmountLong": "0x4080dfade389ee13df35eb4921f8b71276625a9f32ea78ff30f16f56c41e4b67", + "swapImpactPoolAmountShort": "0xd99446ec75b48edfe9721181b974c3184623985c8f94bbb429c1c52fac8ea6d1", + "longInterestUsingLongToken": "0x2969b08330c934afadc9a40142f927cf387000be3f281defbfaa9e3e5322222f", + "longInterestUsingShortToken": "0xfe292a85a29b5c208218744fa8e196584f67a5dab648fcf02dde50cbdfcf7724", + "shortInterestUsingLongToken": "0xb8b0f50ca8f165880ce1c6540c806e9b678725434a57e9e172b57e42126d1c2b", + "shortInterestUsingShortToken": "0x6c28d3ba5c3de878a1bcf7d61e595c2e998bd94c8face807d186e06fd4454c51", + "longInterestInTokensUsingLongToken": "0x4a76085b1b592d7af8b87255fff361001fb6047e1266684a1c895fcc4dc0a54c", + "longInterestInTokensUsingShortToken": "0xd37bf995a9b64aa42c1a5d90ff3fb46a283d3f8f7ad38227b71e41302e885fb9", + "shortInterestInTokensUsingLongToken": "0xec03ed0c527f0f91fbd6be3038d9d989e17d551d3f7c43d7a51020990db759c7", + "shortInterestInTokensUsingShortToken": "0x2c2476051043229fd2198ee6a970789b72a1bc488cb13bc4c7554f9673a11612" + }, + "0x872b5D567a2469Ed92D252eaCB0EB3BB0769e05b": { + "longPoolAmount": "0xb70c1d8189f9287ce2c45b58fa581319252d073df36204681ba746d118a866c3", + "shortPoolAmount": "0x4504d3557219b31e3d988f78c7e2da8d025c52f74f973673e2fccbe139fd8f47", + "positionImpactPoolAmount": "0x7f7c00bd157a8ddd14b454a59eaa2a16f4f9523df1c990bdd2679d3c185a8b0b", + "swapImpactPoolAmountLong": "0x8168d269c6867ae56959456f175bceb819a1573f1e790cec01aca754ef715c69", + "swapImpactPoolAmountShort": "0x817a7d95726a285bf51694625f48b053157fce05b3d5bfcd781d5315bf197750", + "longInterestUsingLongToken": "0x119d28ec4b03e3ee157565722695e55944da35d2d86d41d90d69e3348b6cfaec", + "longInterestUsingShortToken": "0x264a0978bc9c7e3a451a60e5f617941db4621076c706780f507468aa80ab485c", + "shortInterestUsingLongToken": "0x121ce70f147ea3fdaa1b7e0cd67d7c012954ae25349f12bf9fcc42427bf9a940", + "shortInterestUsingShortToken": "0x10406713b50cb6e6b802c5f74241d15054983206edfe04de03d4b318f96b04b7", + "longInterestInTokensUsingLongToken": "0xac95008ef685c94d41ce1afbe5f3e29e4d5836f0da9c991a130494bf476f4323", + "longInterestInTokensUsingShortToken": "0x9ff9dba90aa06d538e73b2159ca2df1dcc67b61d804bdad52b4ba1050746b0e1", + "shortInterestInTokensUsingLongToken": "0xd961f4ac9d8e0df364e8115a898320f727ea2a7b2424cd46bf172be82f65f6fa", + "shortInterestInTokensUsingShortToken": "0x8165a1c47e0c185c81cdf82710c335663d2758ecb88132c85b7d93e6309a5efe" + }, + "0xFaC5fF56c269432706d47DC82Ab082E9AE7D989E": { + "longPoolAmount": "0x3ef77c538ebfde2dd810575baf5696e320a26f4440aed7f3d66b8e30b036fcd9", + "shortPoolAmount": "0xa7583523b2f8df86019579ca4fe21d8fb47537b56194d5b2a8e30cf6e3b73c00", + "positionImpactPoolAmount": "0xffc926c6dbd0f861e4426a59ae101f3673a79ba916a89a45931abe2e44b4bc48", + "swapImpactPoolAmountLong": "0xc21c780646992eb09e2867ed07835ca75ede413e118886a6deda7b4bc2947151", + "swapImpactPoolAmountShort": "0xaba55e0cbc4ba835a975a8b3424fc999d494ac4b716cd27ed2ff4518faa84b4c", + "longInterestUsingLongToken": "0xd12303b5eac1206fe35dd8b76f09438693cc451c8ec8ca6bdf1cf1b12d303507", + "longInterestUsingShortToken": "0x9546721e5e2762728327dc8986c078584bc3e52d86c0986f3f3744ddee4732fa", + "shortInterestUsingLongToken": "0x3e9dc78aedf8b4e23723be185ca57e7e15043be55bdd886719814db309b91c67", + "shortInterestUsingShortToken": "0x58d3bec3f5ca3f803ed87a846f98b8916086604677f2611411bce1f6c37e1cbd", + "longInterestInTokensUsingLongToken": "0x095df08c9170c076b5a5e7847ae90e9142e1985cce2de83061117ce323958041", + "longInterestInTokensUsingShortToken": "0x01a581eaf05aa1846f2b0e026c9ad01e9e22159455e16f8fdc93eb427d7e8311", + "shortInterestInTokensUsingLongToken": "0x30bf888497c9479e7607c17def2114049079b5acfe3be34fc7cb39d32e83891c", + "shortInterestInTokensUsingShortToken": "0x61551b38a8f53636a0f8a29914428ee0ec6c172624c145b50a81e664bc7fdc66" + }, + "0xe55e1A29985488A2c8846a91E925c2B7C6564db1": { + "longPoolAmount": "0xb934a3ed8d7850cd3fcc424abd440f6b77cc5f1d0511601e13d9b18b084ce8c4", + "shortPoolAmount": "0x4b9091b79ca6899d32e081e724a66d2465ab878032b31ce006953f5d4056a0ea", + "positionImpactPoolAmount": "0x2427154893282bc2707e38e907df45d48bb4829de76513a48a7ab193c9a449a0", + "swapImpactPoolAmountLong": "0x75b5425fc12eeab4b42d7fe658391aa6f2c1efdb3bdfeb67e1d5c45110f6d7ed", + "swapImpactPoolAmountShort": "0x2db559f6cb2079c3257b05fefcc96699f805d168df3f92ba38fb0bc749152304", + "longInterestUsingLongToken": "0xdf4598200427932a83a6c5affa5ad515df79c43d225178997804286385dc427d", + "longInterestUsingShortToken": "0xfb8b76580328d50c809b7b401a4efd2292b0b1df4282ae55464c56ebe0ab6759", + "shortInterestUsingLongToken": "0xce86981a34b885a60cd247666726e696d613fbebd37c86581f8dc34320e53b9c", + "shortInterestUsingShortToken": "0xe7194ebae1923661c493655d2f8cdcb49afb3d44ea3f1cc5603d8837264c0c87", + "longInterestInTokensUsingLongToken": "0xa552621480e367888b3b6a4ba94ed4f05cb84968b30bf422a5046bb4878009d6", + "longInterestInTokensUsingShortToken": "0xafd508e632d1a1d463a0c91a631d4dbf6ea510c98068aad86c9d1fcc8981a045", + "shortInterestInTokensUsingLongToken": "0x0badb6f36603c01a7df11e75ac562c73a62d4c125d812b25dd996829585a7a0f", + "shortInterestInTokensUsingShortToken": "0x2d0373093852a8a1ec070337183b0b0e59502132b8827def7384863cba9352d1" + }, + "0x71237F8C3d1484495A136022E16840b70fF84a69": { + "longPoolAmount": "0xc75ea9fa5c7ca908323f45ea91ecc262860a1a61f879ea40384f52d05168d174", + "shortPoolAmount": "0x46fc19fb93b105e0aca46a28343e4413c0f37551141faf9e8fb3307185462854", + "positionImpactPoolAmount": "0xc7d568bcd650ecade2cb21f2acb6c938bea082265719e9b3b2416972bdf02f4d", + "swapImpactPoolAmountLong": "0xbd088cb6faa3bf68c53d934dc9ae6d878bc2792b5b82e3a1206411dc79be5467", + "swapImpactPoolAmountShort": "0x6a2f9eaebdd1b3c2178a3dbf2a07b2f5c055d6262905814ca730850dfd517648", + "longInterestUsingLongToken": "0xbf67327833f5ecee262f9b9f2877fa8bb8860836bc51025f532be712a1e4f292", + "longInterestUsingShortToken": "0x19ae6ffadef135e9ed81eea102596b9174c5f6e202c1dbb607af028a74839b94", + "shortInterestUsingLongToken": "0xae6fd568ec2e4151a3fadaa62eae6cfbf41efe5312b794b1b70d06103ba89c88", + "shortInterestUsingShortToken": "0x9bdfc54eb497b57125afef180de9c838d03463253b8ce189c9258acb97b17ef9", + "longInterestInTokensUsingLongToken": "0x0baccf21571bcc0c39bd0cfd8872d7cf33b3730d9ef83da4efc7981cd3ea8fc0", + "longInterestInTokensUsingShortToken": "0x5cd16d36afcff31361d6f557f8f07d548387dec69d40f95080cbc86f82cdc32d", + "shortInterestInTokensUsingLongToken": "0x3de552f02deb92d45436c8650fa605644a0727ab4decf31e5cd0f7a7b1a3ac43", + "shortInterestInTokensUsingShortToken": "0x35445a95899540aac44a59629fae5a988cfc38141dee6a059223c81ff38c6406" + }, + "0xfD46a5702D4d97cE0164375744c65F0c31A3901b": { + "longPoolAmount": "0x9ea23b6f860732d52740086cc982b9e0a97a09afcc3b9e0ec5af7a452b4b490c", + "shortPoolAmount": "0xd1fa5f9b08adbd1a96d73937664a5299ceee5818bbf9105db9b5bee5a9e42b50", + "positionImpactPoolAmount": "0xda69a8849408a2652e0f4561e207f6e23cb5ef2ce86c564d22df729daed7d0af", + "swapImpactPoolAmountLong": "0xadbd4296952a90a989c56a0e5ee843ffd73f4549b477c5fa35776e8a9274d17d", + "swapImpactPoolAmountShort": "0x2d35cfd5845bd7b2c36aa5fec710f461160c70c330e17c859cf1eb8e094939f7", + "longInterestUsingLongToken": "0x397149852e67c5072753bd08d53c36de50b9b75a16a15bd77f63956f17aa51c5", + "longInterestUsingShortToken": "0x095d5724766b2554af37e47e4a4b6571af65c6a80fb336fc7fbb9872ef892909", + "shortInterestUsingLongToken": "0xea51e43db63fdc0d2a250a711d3d2084d3ab5d4e7c539e38f96c14cc6d6c5f4d", + "shortInterestUsingShortToken": "0xaf06e19848ebe83dc71a594792fb12fd982bcd686173106bfa4a1dd5350cbb67", + "longInterestInTokensUsingLongToken": "0x6f3d05f754a592ad95de055ee8a9775978ecd8f6207fa2bc3e55a2b20c59c31e", + "longInterestInTokensUsingShortToken": "0xe08ce54d15203fd218e811f51085b5493e4ef0f1f0a127a31a1894f2a739964c", + "shortInterestInTokensUsingLongToken": "0xedf86a57ea75352dc183fb95c88256367ef2ed4c99936b26163e7b65850f1f09", + "shortInterestInTokensUsingShortToken": "0xb2b1a38a4b287d56224cab395b95c4a17a212ff1a16612a36b4510ff1ade957c" + }, + "0x6CB901Cc64c024C3Fe4404c940FF9a3Acc229D2C": { + "longPoolAmount": "0x1c73f5e054e3af4da0a02fac5a7048c46ec9cd1528a25b232fce342678e7f771", + "shortPoolAmount": "0x1174c83110a6ba7e4da38122b472fcbfb6c11502ca7c77259e28d6e3dda75ec8", + "positionImpactPoolAmount": "0x97953cebeee1fe8b9f7ab25d3a269241db133ad6fa3aa3c9dbee5e647db41813", + "swapImpactPoolAmountLong": "0x3f75281e1f04b2ef2ce727f8ed9fd904e67c5a431d2b82444c496d4d45ba4c1a", + "swapImpactPoolAmountShort": "0xffebca0e5dd30ca361e6d209c9bb94787c06a3c61ded9eff8a48dbeecd848571", + "longInterestUsingLongToken": "0x50d115ccfb80f8efc2c6324cf4435bcbcf106e15299f6d7b8e9ed7394739683d", + "longInterestUsingShortToken": "0xc75a5ca3a7e958e1005dfbeb17dbdb491afcd18079e7c10edfc80e465c66c4d2", + "shortInterestUsingLongToken": "0x21c618fd83ab3421b38599a6bec875203f5916e147c4072a4178a8e8645c2d46", + "shortInterestUsingShortToken": "0x23b362f563aa84bb462803e96249ac4b5bf60d3652be779bb2530ba97b7f8b2c", + "longInterestInTokensUsingLongToken": "0xd4ea379662b212739d9f0c45c79e313913be1bc086e4aa9897b458197a60b45c", + "longInterestInTokensUsingShortToken": "0xbb777c6bbaf8f292c79ab5f85d2fa8aa6dda549cbf91a2c300721cd3050773d0", + "shortInterestInTokensUsingLongToken": "0x81ddd54b533285f8cdc863c88d5cca57ea6cdc1dc7ed99fbf1aa279a34c07b13", + "shortInterestInTokensUsingShortToken": "0x8db5756074e694b7c472d806aeb7545057cb1ca92d60b4769d6e7301647ff53e" + }, + "0x71B7fF592a974e2B501D8A7a11f5c42DcD365244": { + "longPoolAmount": "0x5d4e4f2678bbeb6f19e69dddd3c68211b28f5ebd31de547e4891e923d5d834c0", + "shortPoolAmount": "0x4f44001338ecc8439172be5f4ee868f754f7631ffe311b44e405ad8bb6cf5674", + "positionImpactPoolAmount": "0x980955f7b7f4957a0a17495c533005b0e3dbb56a53259fca283dde3d35eef0c3", + "swapImpactPoolAmountLong": "0x844b69129cca724626329554f87296c0f8c5fd957491a3886b63fb73eae0862c", + "swapImpactPoolAmountShort": "0xfb28bff873542cabc1e2744bd3af50236627843bc372bed8cc117bd6e51eb667", + "longInterestUsingLongToken": "0xac717cfebaa27b90112605c59f3d70b685521f3a08384885be5c823b246c18a6", + "longInterestUsingShortToken": "0xc06e9e78fb348a433334047a33cb124348453f754a58dec06a4cb8ca8f193566", + "shortInterestUsingLongToken": "0xb7e2663146c3a156a7d3c80fe28063b2e7be12b9928095a18ec9277f45f785ac", + "shortInterestUsingShortToken": "0x0647011b98a41f7e1a1386b5c399d14f25e018f83fd7dbf70e5f7171bd7e66ae", + "longInterestInTokensUsingLongToken": "0x83ce5f730f02e7fd050a562f85cd0f721880cb32d0386cbee12a8f57c4bc3ec0", + "longInterestInTokensUsingShortToken": "0x3db558abc86ca4cfb69f61870063eda6f77f3a04af083dc2b4e7486747a46c04", + "shortInterestInTokensUsingLongToken": "0x8b9635c413aff022f12ca4e62298e8ec09d92472a8e4ab566b998e342d823d3e", + "shortInterestInTokensUsingShortToken": "0x9662b112c6c7f79d87b37c646380f742215460c45ec8a64698e7af8fcfe6e337" + }, + "0xbD48149673724f9cAeE647bb4e9D9dDaF896Efeb": { + "longPoolAmount": "0xf897f8cafc8e058a105be43424c639853fca5e3483a2b04fc3af4baafa5372f6", + "shortPoolAmount": "0xf897f8cafc8e058a105be43424c639853fca5e3483a2b04fc3af4baafa5372f6", + "positionImpactPoolAmount": "0x53bbdd5ffe14c52e6c0f0918709f6a1263cb297ea4386bd7535f44bf781a1b9d", + "swapImpactPoolAmountLong": "0x6e889f53f338210a09a8f5e107cf1a4b4c6bcd0c2874767ea0775a11319b9ccd", + "swapImpactPoolAmountShort": "0x6e889f53f338210a09a8f5e107cf1a4b4c6bcd0c2874767ea0775a11319b9ccd", + "longInterestUsingLongToken": "0xf97838f448b213e06c5c32ac5c6e5f3afde5db2f40db253b66494ef7564981cc", + "longInterestUsingShortToken": "0xf97838f448b213e06c5c32ac5c6e5f3afde5db2f40db253b66494ef7564981cc", + "shortInterestUsingLongToken": "0x277a02779e60cf9fd9ec01e9aced36c5ff90e77c7c0876a46450f6d3e1c1174e", + "shortInterestUsingShortToken": "0x277a02779e60cf9fd9ec01e9aced36c5ff90e77c7c0876a46450f6d3e1c1174e", + "longInterestInTokensUsingLongToken": "0xb8f8bdab112b9ba39ea434d894cd72df024541f5545cfc8db6b668f44350edc7", + "longInterestInTokensUsingShortToken": "0xb8f8bdab112b9ba39ea434d894cd72df024541f5545cfc8db6b668f44350edc7", + "shortInterestInTokensUsingLongToken": "0x8b9b7026d459adbeeda4211ac8a081cf90799260dfb625ba509cffad126a991f", + "shortInterestInTokensUsingShortToken": "0x8b9b7026d459adbeeda4211ac8a081cf90799260dfb625ba509cffad126a991f" + }, + "0x784292E87715d93afD7cb8C941BacaFAAA9A5102": { + "longPoolAmount": "0xd87c927192995f4bfa7330502810de95241986aac55eb403a926303f13b3fcdc", + "shortPoolAmount": "0x8cd6f61f208538b3a052f34d5df4ece136ce1679382ce0eebcff8bc82a33c933", + "positionImpactPoolAmount": "0x3cf004e019d8ef61564425a7a7334246424f4bafd754f8bdbd8c0e3cb29c59bf", + "swapImpactPoolAmountLong": "0x64f7ed8c8bea5b5fdb289d52037c8267f09934b74f0ea8bb5903449bd801b7b9", + "swapImpactPoolAmountShort": "0xed91eec5b8de6b26c4463deb815c11e7ec392fc987ca2acf0034e4c052fd36f0", + "longInterestUsingLongToken": "0x1b7aa245534dcfb26eb9e49c4b77c4c660bd8c5ce75b08f930382b909f8fa1ca", + "longInterestUsingShortToken": "0x10435a8aa6c6da06c6940b949db0e6fbaab00d4b2b9275c030e5f1b95a05b814", + "shortInterestUsingLongToken": "0x4529af22abb50a73e16ee51e514f55d19edfaf00225d771ccc518f59a0f53670", + "shortInterestUsingShortToken": "0x34e1d3d86f07f597c4857fd617f89490f327d8a49d4f075265c89e1558f14ac5", + "longInterestInTokensUsingLongToken": "0x9517197c2a913a2ca0bbc20af4a669c93b829ea18feda84034cb7f969c48da71", + "longInterestInTokensUsingShortToken": "0x82ea25cb6d5c485bff92c97c002c90a20d1d9cb98b9b39b7821c7d988f23e8fb", + "shortInterestInTokensUsingLongToken": "0xf6edb24922b240f9da628d3d3b1b1ddaa36c49791f03b9462fde4ec84af84c05", + "shortInterestInTokensUsingShortToken": "0xc4509ea8aea39f46bf2a3a6ddd153b34113715b63778ef9c84258adf8c5387ab" + }, + "0xcaCb964144f9056A8f99447a303E60b4873Ca9B4": { + "longPoolAmount": "0xba41a2d1eab59461df2eeaf430bebffa4ee202638dc4684f9531744eae60d5da", + "shortPoolAmount": "0xd42b1b0ee5f74c1f8df834c0870f033868151c7ebf9c2a60dd016cf607732c3f", + "positionImpactPoolAmount": "0xd4ae82c32320ea5488a2570d0498b5f9c30180eaece09e70ec380fec3b92a801", + "swapImpactPoolAmountLong": "0x106919ee4d121f2c9caef136856e63bebce80465bc89f53be881b7e94c6a2096", + "swapImpactPoolAmountShort": "0xb7b2fc39accb68485d6d8418eb0968b240911e357acb1fc4edb35041ed57905b", + "longInterestUsingLongToken": "0x0b27dead0348b924f3468b1c995c5790e37e5ef2f70625aa7c29cec6632ca1ba", + "longInterestUsingShortToken": "0xe606007385d62e949ec7ecaa2365623622e89cfcfd5d51128baec6849fcf4a74", + "shortInterestUsingLongToken": "0xd70baa0718e0dacfd0eebb4e70f5cea09607861ea9f3813609f0dc58c7ec288d", + "shortInterestUsingShortToken": "0xe8e53ee9a7052e2ec9eaa7955dde4ff0f7280f8e044b57de0ab4bf9cdd5cdfea", + "longInterestInTokensUsingLongToken": "0xd2b450db3c2e42266ddd2c2dfab52915144fd6468ac4f4eb9e913e817c207521", + "longInterestInTokensUsingShortToken": "0xfd0e6749e44afde4ecb7f67716a736c0e3da390019338009f49b72539c444fe0", + "shortInterestInTokensUsingLongToken": "0x13a211661eb38b0ba59bf3db4f51969dc709d456ea776e90bce50e7a509f1fb6", + "shortInterestInTokensUsingShortToken": "0x6c8ef6d88ccae1a529e5a3d06fa3311fd36084183cc8312dea627bf99abe046e" + }, + "0x62feB8Ec060A7dE5b32BbbF4AC70050f8a043C17": { + "longPoolAmount": "0xf5057ced6998302db94ba9922320cf196ae2746981a7da23e6708ddcc76e4cee", + "shortPoolAmount": "0x1e61b7426ec0d00da8ed8716121fc8d82c0d4b815a0282bb4a18e6fcdefc84ee", + "positionImpactPoolAmount": "0x38032d2be0a7d79c013c5654981efe95a3423eee9263e71d0bbd986599cbf65e", + "swapImpactPoolAmountLong": "0x2e4dc631f4f641cc08e294e3ab54e7cfd2e5d769d47962b0d5793bff5c67bd4e", + "swapImpactPoolAmountShort": "0xfaaf08920f2447775c63ecbe94d2309fb63b25d83702bd2ccd3c07e4634080fa", + "longInterestUsingLongToken": "0xabffd0e3ca0f4095db14d04c6e8a8b134106b81e569e4a8a2097ad7746a01fa7", + "longInterestUsingShortToken": "0x77cc5699f4bd52f3308aa5e18bef2b5c59bdfa9ae65a0cd1007d187e31b4b30f", + "shortInterestUsingLongToken": "0xa921e7a064c13cf9a25642183f9a76b62fb5d5104504c21600808eb6f9dc9525", + "shortInterestUsingShortToken": "0x6543bf93038e5a729e595a657eca1f9825dfe2ca5e3ba99eb1e8f09f2f3800f3", + "longInterestInTokensUsingLongToken": "0x41d3667a746c9379211fa69ce8136b126b44a99d5c78aa501d6c73e8663bb675", + "longInterestInTokensUsingShortToken": "0x2396baf24e75014175eb6414c826eb64c23bfa156e83ca7f5a8e2fb266aac403", + "shortInterestInTokensUsingLongToken": "0x1669702c5a98675e9d12163e7781793f5f7bfda43c2c8af9ff1128b735bf0997", + "shortInterestInTokensUsingShortToken": "0x304ab8ccead76e2712d7c43d6b491d21b76731bc93c21a7edfb40278b8181e58" + }, + "0x7B2D09fca2395713dcc2F67323e4876F27b9ecB2": { + "longPoolAmount": "0xb18860544e17224dd557b0d759fb5dd289a4969cd5eb89d505992304a40c243e", + "shortPoolAmount": "0x2fce84e380a1ad56d2690c1746d73f8553633b748d843ae7f6757579abafc701", + "positionImpactPoolAmount": "0x315ee157398ef22b4238e4c09d4688ae5d2d7885065e89d23d09ace26ec62767", + "swapImpactPoolAmountLong": "0x89fe29c2885a2c3c8524ada2114e80f6716467c32b2f7525e01252aa4c1ee83e", + "swapImpactPoolAmountShort": "0x85b4e5562a6cb435b9c5b74626e0d2b78dadc4c61783f4978cf402fcd843ab63", + "longInterestUsingLongToken": "0xcf156ee7a85cbb4856e6ba455b11b1eb1f1a453a0d7709eb0c89ae4c10d07c4f", + "longInterestUsingShortToken": "0x817809eac63b06c956a223a0b304f53e187d35e3b212fff71a88a3dc1c4e159d", + "shortInterestUsingLongToken": "0x8b9a133a3a1ec1f80ec0e5d013215bdff8ac633a93f6e6c06b5ac18de0cbcc16", + "shortInterestUsingShortToken": "0x94c220f4df7b6ddfd0cf5abcd770be6ad4d81bf669f9470b336ba376631ef0de", + "longInterestInTokensUsingLongToken": "0xf655590510bc01e37dc308507f053444b28ee8e818f565fa7ed843c381d6e57b", + "longInterestInTokensUsingShortToken": "0x0098ecf8092706f1b9e32954c06b592632bfa32dccb3baf442ef541c963398c8", + "shortInterestInTokensUsingLongToken": "0x21bc8fb851e1da2031bbd914a82ba2a6dce070c902ba5beeec1bc370c3873df8", + "shortInterestInTokensUsingShortToken": "0xab7264e1586e36d6be4c632ebbe47c1c3d3610c6a6b9be9b5ed5ef90d4eb15c8" + }, + "0xdc4e96A251Ff43Eeac710462CD8A9D18Dc802F18": { + "longPoolAmount": "0x074d19b279a69d4df03b8def18c5065b9fa7035d30ce98d5a28c205d8e8731b2", + "shortPoolAmount": "0x447fc1337c9238bf385375379ea4377091330ecc6cc5978c8f0399852d8eb6f5", + "positionImpactPoolAmount": "0x85e9dbc6674b944072e37d1660a7040ff580f1c40704aab8c56b118925ddcada", + "swapImpactPoolAmountLong": "0x8292726590be38b1c5f067f20d2287b5f73d564b4ccf3c9aec5ed9d297931266", + "swapImpactPoolAmountShort": "0xfb257e912c524bcca1cdba522565a7bc6a3ca560722952628320da94a0ce249b", + "longInterestUsingLongToken": "0xd39e4b5ed51b0b3eebd15e418694c3d8b102b2b5325e028d3c4294a246aeaab2", + "longInterestUsingShortToken": "0x85a3e578860e86547bb805a4c35a8b3e9596ba30cdf8bfd38c68d4ca0266a032", + "shortInterestUsingLongToken": "0x545f4c6d87c3b9cb558b54453e5d0263da70a582905858fa820440e1fd55007d", + "shortInterestUsingShortToken": "0x6579226aed371d1eb623369ef1b8df88809fb845a0bd7d8553f5c91d2c3a8fa4", + "longInterestInTokensUsingLongToken": "0x15525483bce9b2da4b7ff9a4a675dc43e741bdd313bd868276ec273152d93ac1", + "longInterestInTokensUsingShortToken": "0xee3dcd85d18870c61e8967d84c4adbc69eed4e08200f46d92bb20a15585990e7", + "shortInterestInTokensUsingLongToken": "0x3297ece5761ba1c6c3b338e1ea065ee04c320f27b7534c229c6f6c57e061b5fb", + "shortInterestInTokensUsingShortToken": "0xdc4f3945eb7d2c8ae4d24348b5bea1976e51f7e7df2a8326b376f9557dd490df" + }, + "0xe902D1526c834D5001575b2d0Ef901dfD0aa097A": { + "longPoolAmount": "0xd738249a08638dcd887c722a2e17757e9ddf15a427cd4765c0e109193ecbe3db", + "shortPoolAmount": "0x7650babca97c8931b351c748e83b790639721e09deea78f4138f8bd5168f4f46", + "positionImpactPoolAmount": "0x1baaa7a7e24630a01ccaff642bb9f1523b17b21f8b06336087ca7352fc84745e", + "swapImpactPoolAmountLong": "0x7ada7c0cfcd911a9fcd8b41adfea67906bc6e9ba3472721e5dd40c357c94eeb9", + "swapImpactPoolAmountShort": "0x8a9a1a6a44f7608db84945f7afbfecfbcaf2a614d3499941c874fd1966280b94", + "longInterestUsingLongToken": "0xc3324d1cba171cd1db7b8856a89326c7abf2804a4203910e4446506806ff83b1", + "longInterestUsingShortToken": "0x380c1d485ff0517a7d46edc7f44d47d83b4cb66d611f1a2d4db23b36fe300b51", + "shortInterestUsingLongToken": "0x195d8c7fe92335193498406cc7878879981e025f5faf883bfef93ca065467cbc", + "shortInterestUsingShortToken": "0xd695c1a54dba8be8b413cdaf73308b249e6073bbb5ffde64eeadfc260f75593e", + "longInterestInTokensUsingLongToken": "0x7c133243d76f6632e31c3ae74d336f8edb4d7743c80eafd2a3a6496bee7d011a", + "longInterestInTokensUsingShortToken": "0x7df09a41caaa6e0e80d2e22adfede47e21b725d180c7c3499de76076af052ec2", + "shortInterestInTokensUsingLongToken": "0x7a5c1f08f134a1cde4c73a94bf812d6e8e2027ef52850248f73fb06877bc118d", + "shortInterestInTokensUsingShortToken": "0x6c5f8d068e793028f0273830e29a070a7465c4095bf7aff2fb781e243973b0b1" + }, + "0x4c505e0062459cf8F60FfF13279c92ea15aE6e2D": { + "longPoolAmount": "0x58d104ee9694b2dac56a8282f9333a0ec0ca835ad4b1703faa6231a836a299f1", + "shortPoolAmount": "0x40b6bd8964bea74036bee572959efae3255dabe253038d518ca45cd0911db7ff", + "positionImpactPoolAmount": "0x8a68160b41463c01e2cc59c3e1175ad298c476d3ba624d649994c66b39484b20", + "swapImpactPoolAmountLong": "0xc96f522321f20163f7fc98afd072f101737fcd4724f8954c547a5dc06ee80823", + "swapImpactPoolAmountShort": "0x35e7f17e8f3c77e6e9b6ca65169e80c1808bc9d844cf40e183847f6a420e12b7", + "longInterestUsingLongToken": "0x8b97f00d71a5b31c3e8e42d69fe6d89f49ab23d39c80c94c76a25191c34f9e25", + "longInterestUsingShortToken": "0x535425c022f3ef7b99beee735e16677b554a9246ff9b115d9d7b94480c7c394c", + "shortInterestUsingLongToken": "0x0427aea8db9ab2fe8df1ca0ffdbf614e3bac4092198e6678417507cb273ded96", + "shortInterestUsingShortToken": "0x24bb0155f938dac8e5043901b3bde5fc754d80f04444d069bf83499a18871cba", + "longInterestInTokensUsingLongToken": "0xd717655fbf3721ee73d1886e61e1d6669e5851778e76639806f132f8507372ae", + "longInterestInTokensUsingShortToken": "0xccb0f7fa1b27162994f8e0c9c38fe4d345d4df689c8f972e3c09b7fd234f3c4b", + "shortInterestInTokensUsingLongToken": "0xfbccc80945bc9b71ffceb5761a21c713d337831970609a0def4153662be81701", + "shortInterestInTokensUsingShortToken": "0xfbe24d9b16096412e052e6a55d11b7735a1f606bcb3f17ecd44dca062d57eb0e" + }, + "0xf22CFFA7B4174554FF9dBf7B5A8c01FaaDceA722": { + "longPoolAmount": "0x1f489be0ff56b401de7c0fa9ad7d4334a3586a65e2fa63558f637ebb81a0ce27", + "shortPoolAmount": "0x1f489be0ff56b401de7c0fa9ad7d4334a3586a65e2fa63558f637ebb81a0ce27", + "positionImpactPoolAmount": "0xcb5d185c3bed671bc7a51ef9a86022a5bcd518c0b1e35ebe1682a6b8ed26be22", + "swapImpactPoolAmountLong": "0xf2d7422a372d36f819482d7ac2bc3f2ee0dec76f12341d2f1b5cf12339ab51f9", + "swapImpactPoolAmountShort": "0xf2d7422a372d36f819482d7ac2bc3f2ee0dec76f12341d2f1b5cf12339ab51f9", + "longInterestUsingLongToken": "0x0e1386304c7e669c9a9e65ac2570486dd95103a4a00e22c479ee76e076d63d85", + "longInterestUsingShortToken": "0x0e1386304c7e669c9a9e65ac2570486dd95103a4a00e22c479ee76e076d63d85", + "shortInterestUsingLongToken": "0x00f57e6805757aa5ee5ffec6a79c0aae4139eb14808bba49d416e19145f548c1", + "shortInterestUsingShortToken": "0x00f57e6805757aa5ee5ffec6a79c0aae4139eb14808bba49d416e19145f548c1", + "longInterestInTokensUsingLongToken": "0x3b3298a9ff062485b4aec5e29fe817392b126b61660a6ec493466b37de36ad0b", + "longInterestInTokensUsingShortToken": "0x3b3298a9ff062485b4aec5e29fe817392b126b61660a6ec493466b37de36ad0b", + "shortInterestInTokensUsingLongToken": "0xc66ade048fb04f592c54c2417ebd4c4b7e98cb3d07cc7b030e3dd2475db5a9c1", + "shortInterestInTokensUsingShortToken": "0xc66ade048fb04f592c54c2417ebd4c4b7e98cb3d07cc7b030e3dd2475db5a9c1" + }, + "0x262B5203f0fe00D9fe86ffecE01D0f54fC116180": { + "longPoolAmount": "0xba6dc84524be53a7b3b68cd771c134548a5b3d1a62496d9638e93b62f53e2237", + "shortPoolAmount": "0xff705e5e3bfd05ee07040655e4a121acc268d463b5ce83e72e39b24eb8839856", + "positionImpactPoolAmount": "0x595febce6cbc5d114f40b60ad14d8cfcd5c7da2efc7306d52517c73e520d75fb", + "swapImpactPoolAmountLong": "0x05a7a1a6235a08145268e0b80c92bc834b0af977046df77018217954879f4886", + "swapImpactPoolAmountShort": "0x1277446dd8a247f4cfc7c6eaded8fa8d5731888a9f36e3c581899e8f19071d94", + "longInterestUsingLongToken": "0x5a05ae6104663496ea6883e8a8b87a2a7663bd778c4a55d701e16ffd2690a8cd", + "longInterestUsingShortToken": "0xa46e6ca09cf5099c0cb35a6041e4390455b8921fdbcbad6915159c60aa1cad19", + "shortInterestUsingLongToken": "0x256f57a3b822c7fe57032572913dab83712111401a855a29be384bda6f1137df", + "shortInterestUsingShortToken": "0x6a348affdd733253296568b8f73d9458c0f2e407794d7193bc025202bb20a746", + "longInterestInTokensUsingLongToken": "0x96677dbaf0ab264323b6ac38be19ce7041c18addf6e331235dfd4d50d5989154", + "longInterestInTokensUsingShortToken": "0x14f339c76f04621b9ba15768d956b9a222125ad2b853794298c5c7eecd4e22f0", + "shortInterestInTokensUsingLongToken": "0x781c00d9f9a188b6173b99ed7a04104754daf7bcc9bda9f9227e5cb787c0e0cc", + "shortInterestInTokensUsingShortToken": "0x62d44383e14f1701c86a8900747d74284de95144d266b776d5037ca0d0426b1a" + }, + "0x467C4A46287F6C4918dDF780D4fd7b46419c2291": { + "longPoolAmount": "0xed2a44283e5b723607e9f2024b3502e6bb8f61b2ac3245978b0da7f63636970c", + "shortPoolAmount": "0x3d7a43632386c44a5981a6cf24522d343f823868ffa05fed04f75d49e0c97907", + "positionImpactPoolAmount": "0x471f73a9671f6887a87a301e2f2bc1ab883b21c4d1035801225fa58523733756", + "swapImpactPoolAmountLong": "0x687a328d60932d3ac69f7810b263b1c07ec99c0e37bfd01a9c17c666bc8c6110", + "swapImpactPoolAmountShort": "0xb84694866ac2a61e4d84d7a354d0c7dc2d6760b5bf2950afea404b1c31e8f0f2", + "longInterestUsingLongToken": "0xc2dda98062f969440629a5c6f6a5fca3222956090f5f315648356101a49c1a87", + "longInterestUsingShortToken": "0xff2966344db8d78bf4c02adb695514d0163f84dc5fd9fb67f497982de8dfac9e", + "shortInterestUsingLongToken": "0xf93df38dc031f2c31cf490c394f3ea19a0c293992e57985602feca70834d0811", + "shortInterestUsingShortToken": "0x5bfcd9e0bb32a72c0012b1bca0285e1e1a7539da1f65339e05597d35006a4c9f", + "longInterestInTokensUsingLongToken": "0xe4391da2db8603da20de593ef4ffb4942ca7f2a7a68d5c5153334b483272d548", + "longInterestInTokensUsingShortToken": "0x85c979ceff7627c1dc697698ffb801cf4e43cac7aa41ebb02a1cb2f9c44419d0", + "shortInterestInTokensUsingLongToken": "0xb7de073113438300ef9d0b4e24149ced70eb5d04c644be98e268469d36d389a6", + "shortInterestInTokensUsingShortToken": "0xff62257ef67048abc448c8d0449eed2b8f08edd8dc0a7dcc5b167a2f54bc28f2" + }, + "0x16466a03449CB9218EB6A980Aa4a44aaCEd27C25": { + "longPoolAmount": "0x0ecb8edaa2832d50c0c830f32e245070bf349ba6743287a175038b6bc6d00683", + "shortPoolAmount": "0xd7afc9563364ce8a2f36a288be6fa8ae7a81b573115e4d6d53b48360adbfdd35", + "positionImpactPoolAmount": "0x4aeda8ea6156723440606890aa6c5757bba22d3a8eb9409513eafb62567c4f90", + "swapImpactPoolAmountLong": "0xa6c434f9c2d761c4d4f15da3a91f737c23148686c0d80cb9960759cbb0a8ab07", + "swapImpactPoolAmountShort": "0x64db2d4159c309ed40e72fb7cdfff533995ef96e76e8ed0cd94ea75901fe4fbf", + "longInterestUsingLongToken": "0xdd3adf73d0abf54fd9abdce40a85a186d67332c9243489e4dbbdf934434ef807", + "longInterestUsingShortToken": "0xdaa066ec159484d8c956dcf395dc82088712d34ec3075ef91c5b7b2900a2fbc5", + "shortInterestUsingLongToken": "0xfbf3063e9909c1b72fdea2c6874a3f63797b959c5543f7e119ca53d2b130b11b", + "shortInterestUsingShortToken": "0xbe8c41944b45076535be05314622ea6f2b8d86cb03befb01aed93b529bd7fc8a", + "longInterestInTokensUsingLongToken": "0x59712b99752c154054e328b264eab231b6217ad70be24ad017fe1ba6760e9d92", + "longInterestInTokensUsingShortToken": "0x60bb5a56bfec8db56c94c97fc1fa228a87523379609015edd2088d97afd1c0fa", + "shortInterestInTokensUsingLongToken": "0x1793772d09dd54f5c5fcd10d9ed7b33e03049c07c9b5005292ed5060cb72a90a", + "shortInterestInTokensUsingShortToken": "0xaa4b8343388d5ecb9e0e7659c31dd342129613204041f28a3dcc9c5a85791850" + }, + "0xFec8f404FBCa3b11aFD3b3f0c57507C2a06dE636": { + "longPoolAmount": "0x73217b63b4a69bee4c252852083e99804bca3b471f01f3f2f3edaabc47a03643", + "shortPoolAmount": "0xe9c70149ca7f02ad97d85e91874d2e70b54dc59969825a85493d9917b41b3e93", + "positionImpactPoolAmount": "0x0a2060ea89187db3328465d2bc785773c4b8dcc152bc4fc57b6e95a47e504086", + "swapImpactPoolAmountLong": "0x233f987515691f930df2a626538ce398922ad0da64c7d10bbd7358689321c3af", + "swapImpactPoolAmountShort": "0x322c63f0ff2848f25f6d2a4538fceb9db04b6e83d2c4aa565cf3d43c84ae84ac", + "longInterestUsingLongToken": "0x366ad27932e92134b9f10581ac520d05de620b36bdaf7dea61c67e56121bc74c", + "longInterestUsingShortToken": "0x05e9c38e53dc892732c2b817d74135fc9229c2f98d52bce9433778cf2a468e9b", + "shortInterestUsingLongToken": "0xa8eb5e1252507f4c8d2ac3b0368f62ca7ef978a305c63d4b25b4eae21a922f6f", + "shortInterestUsingShortToken": "0xaeaca5d0ca8eae5ef4afe4dcbe0efc6cb883bde66e059cf495df0786357ab119", + "longInterestInTokensUsingLongToken": "0x587d0d8409a46fa95470aafd91fde6c89b872f321fb839dd14f52c64408495ed", + "longInterestInTokensUsingShortToken": "0xac05607608380033b3b4356da109b71a10cf29bd62e14d5f0f5e52a584bf77eb", + "shortInterestInTokensUsingLongToken": "0xcf86f3b4d131437311906ed2d208eca8ed56411d2e654f28de2d8be3e138bce8", + "shortInterestInTokensUsingShortToken": "0xd26d263362d6035fa3b019af2e662c8b46321fc9b1a5c8d842b4c77b8985770d" + }, + "0x12fD1A4BdB96219E637180Ff5293409502b2951D": { + "longPoolAmount": "0xb32821fbf7feea34f18a6d23f5ee93a22c6f7101fbde0cc43acda7ed44b96a67", + "shortPoolAmount": "0xcfc4fb3d09178d1acdd43c646c3b6e5c248e643feb946bdc62d36072292f35ae", + "positionImpactPoolAmount": "0x081c97ecd9ea2f3edfbda30123b798a0ae15d024c89b491e23f33a37bc4ce426", + "swapImpactPoolAmountLong": "0x7f5f9bb45b9c275449ddaa5297b5ec384dfa838c2fc538308037bb2c8dd592f1", + "swapImpactPoolAmountShort": "0x72c2063dc100ba3837ac224e5135809efc8aa8e37367d59d9eec7ddfdb5c3541", + "longInterestUsingLongToken": "0x21f1d65e9cfcec6d7667a1dd0dfa05989dd55fc64dad2244b8a3ffaeede093cc", + "longInterestUsingShortToken": "0x7953f65c97266237a3bebba6edce9a73ca602ad98fa5b1af3ef8136924e0c5af", + "shortInterestUsingLongToken": "0xa1516716703fd8c2ae82cd9ced3220cf71c6e2e25f57c6793508337fa65ed98a", + "shortInterestUsingShortToken": "0xdfcf7133df28eb2582ccd3a0e5f89245a4c2127636ef05f1565ded7feb27ff5d", + "longInterestInTokensUsingLongToken": "0xb4b49b1f78b0b34846ca02c6bc47b2b00a88ccff7a2a5e1af36c535e4993eb69", + "longInterestInTokensUsingShortToken": "0x9d44a10613913549df27a04a2144c70dd7c090271a73325afc94d1e63df9a71a", + "shortInterestInTokensUsingLongToken": "0xb650ecfd1aeb7e38c21a0e52f55efcd9affd3fdb5b44bb9eb4a75e182a50e7a8", + "shortInterestInTokensUsingShortToken": "0xe76983281c0ac239e1ed1c3879c40e3db42233cdf621337bb90fb5ece9250b23" + }, + "0x9F159014CC218e942E9E9481742fE5BFa9ac5A2C": { + "longPoolAmount": "0x33696a1cc2e509be5f638ae154be5aa7ed6021392cd06b16ce6737b3dc3667ab", + "shortPoolAmount": "0x3a1da24e86cb6e6a6282396e80ee211c9b8aa2af9349433abc9cc0e464b8f655", + "positionImpactPoolAmount": "0x87e605de9985d58040acea6f2d667b774c68860f9dfc1e5d031fd0a7297ba22b", + "swapImpactPoolAmountLong": "0x2bf6a71edab345a8cfbaadae6de2d263fc8ba3c96c6f0ffaadabbfeb70fb66ac", + "swapImpactPoolAmountShort": "0x39ded1d5914f4fe0ea014d1c8e5b03084becb7bc5d8ad696e12e52f68a1de62f", + "longInterestUsingLongToken": "0x3176b42f4e12cea5a5f286c5155a4553c101cf2dd04a6dab916d51f89e3750d4", + "longInterestUsingShortToken": "0x5e3372ad933188919d28f8072a6fa0e1c4b89b2e2cef547577856cc9c975d6e4", + "shortInterestUsingLongToken": "0x4a70af7a8c7624981aa4256242db6bca9bf0a7f5d2501bae19d8f0def0e47d8e", + "shortInterestUsingShortToken": "0x6b82aa8ae3bd0ef79e5dd15eb2f86f65470b9901d9edd94df71f49b18b7529b7", + "longInterestInTokensUsingLongToken": "0xa9d73abf615e30ea9fcd87a4464bd63746de3c6fce31aa5f055bd85e8a6bae02", + "longInterestInTokensUsingShortToken": "0xb9c3a9477c1670bca2eb07feea70e17eac62bdf355cae3a3cd9c9bd9cfbb4524", + "shortInterestInTokensUsingLongToken": "0x4ee4b14ea376789f2c13b2ebf2b0553aafa93f1a474fdff95729bec79634e7d1", + "shortInterestInTokensUsingShortToken": "0x873b3434e1f40be00cdf1cd2bd632668797937ac8a1cd3a156cba0117eb09910" + }, + "0xD60f1BA6a76979eFfE706BF090372Ebc0A5bF169": { + "longPoolAmount": "0x2e968dbe5c24230a2ae86ab00aa28dd1712b36f05d23320cbe25706772f4ad93", + "shortPoolAmount": "0x2dcab505f325fb5e2310545b45e04cb7c6a3b7b67d2b922e8a8d28a4677af662", + "positionImpactPoolAmount": "0xa956c5480a4f53b7da50d2d81de36f48f2f827cf473306af15e5fd995472ac11", + "swapImpactPoolAmountLong": "0x0450082403a659c37528274fe2e231ddd22e6c85f4d9784831d3c60cdaea28db", + "swapImpactPoolAmountShort": "0xa6902c562648855ce1d987543ae32445ed24bc460b7ff277acfc37804e08aee0", + "longInterestUsingLongToken": "0x36c25110e5077ab5c9d19ab0d71d11c29bd91ab36ba9a66f47b7f02da5490279", + "longInterestUsingShortToken": "0x994a83db58be8742a09f5831298539040027096f21a5d16c2166aad193c353cd", + "shortInterestUsingLongToken": "0x972b87c9d1a4cf74bcb6876cc13bfaf1109c91707be51d597da1c48125629c4e", + "shortInterestUsingShortToken": "0xaf485bdb8468e4b6e2336ce459251452d8dd2af7aa24307c2af29f603896c29e", + "longInterestInTokensUsingLongToken": "0x802436cd7e36c7b74a5b8e7b398097eb6c7a479858534cf3db3428acf6b2f23a", + "longInterestInTokensUsingShortToken": "0x9cd8e29a7237ddc1ec549a9c860c7111910efd39adf613f40a7b0db6b36d5665", + "shortInterestInTokensUsingLongToken": "0xf62a5afb7091a2f8b12570cec798f32c2c1c6fbcb4f367171682acf97f646114", + "shortInterestInTokensUsingShortToken": "0x76e3acce664d64e0976a5a18709a885eda1d43524c5ba0ca74657fe86cff7e68" + }, + "0x5707673D95a8fD317e2745C4217aCD64ca021B68": { + "longPoolAmount": "0x0239025aeebf914b0bc76d79686a3e338719dd1829da3cd814c237c7b038a05a", + "shortPoolAmount": "0x34c9704179a5340d35deb5e35fa5cc42efe572759d28c8910e37f3257a493c56", + "positionImpactPoolAmount": "0x848c015126f7ca8289f8da1df2d491c12df2943bda0afa242dd1e9f8323cb965", + "swapImpactPoolAmountLong": "0x9e008ca9df39bd82a25a675ee2653c6f93105d0312eb957c216a9ebe87e39a5e", + "swapImpactPoolAmountShort": "0xb86a73b0cd7a436c58092366f60db4f4758a3e290c2c5f2744dafd4d006b3aa0", + "longInterestUsingLongToken": "0x13805a71f0819581e3437c6435c8f1c56b5d24fa0c459b8aff416911ff491d5c", + "longInterestUsingShortToken": "0xfd651aceb0f524187392629aa7910b224e517dd6130e34863ddab94ae4d10242", + "shortInterestUsingLongToken": "0xe82b96561dbfd2806aae2b10608cd14cd1492de8d4798a684b8238262681533b", + "shortInterestUsingShortToken": "0xd20e751f7ab1704419f7cfaf15468575521c2cac03143a4066b62b1e5d202330", + "longInterestInTokensUsingLongToken": "0x982cfb4d6d33733aa97952265e00f3e28363c912094cec7a5ad4808f955aa1bf", + "longInterestInTokensUsingShortToken": "0x2127de18eda99ea0d0791b323c452e5fb202c860bd4cbf41f05a728783dfa70e", + "shortInterestInTokensUsingLongToken": "0x4a9e5a67e155959099fd57ea7786b8f857383d7579bf35f89ab13e6ee5e00a9f", + "shortInterestInTokensUsingShortToken": "0x74c8ac7423d77afa101d4c945beb94b8bf41f4b5383567b54c8aefc852e7ba7f" + }, + "0xe2730Ffe2136aA549327EBce93D58160df7821CB": { + "longPoolAmount": "0x7bb052a0723d0ceb09f42146fa8e3f29d986cd37a9bb80cdc0187dd6d8751f22", + "shortPoolAmount": "0x3acd31503271d4cef1b05273b74327facb0a279f90003322660cbe26ca69d13c", + "positionImpactPoolAmount": "0xf2360947e9be406cedaa787861f849c082f143a49713eca1fcb13a45d9dae0c6", + "swapImpactPoolAmountLong": "0x9248afe4fca824e4b46ce3f30fb0c06766552cbb3b225ef02019f0dfa114aca0", + "swapImpactPoolAmountShort": "0xbd35684e60a2c561f87fa9a4127e6274c5cc8ce07afa5455fa1b3ea0cce72c17", + "longInterestUsingLongToken": "0xab31877e58f76414d09c6de5268ef14b7ffbf31022b83d75a47fea5a29d608f1", + "longInterestUsingShortToken": "0xf853edb55527ff2159bd439f0713eb679b70138393b5f639c41116018cd0f29d", + "shortInterestUsingLongToken": "0x79628a668dad119e6e2ddbf8d5058deeaa0a77c02a310004b1bd1431726257b5", + "shortInterestUsingShortToken": "0xe17944faa4c60b38bd52e0c68564fdefaa995a28aeee620aa4b395d0d0d791ad", + "longInterestInTokensUsingLongToken": "0x03b108918dc70c59579b0909992d3d62a3ac5fb5ce2e9cb5e2071550e175c038", + "longInterestInTokensUsingShortToken": "0x4e55b6204b9e180c53acfd18b5918bc427097f19ff2c7b83285bb24b490764b4", + "shortInterestInTokensUsingLongToken": "0x000cd2871e77012d7b506e4be838f5ac57c561ec9d693e7e0d0384830bf45cd4", + "shortInterestInTokensUsingShortToken": "0x9ae61c8ea2d344d1ce64388885eb99429ab2490e7f0ccc83c0e51f557054f6ff" + }, + "0x876Ff160d63809674e03f82DC4D3C3Ae8B0acF28": { + "longPoolAmount": "0x7b61146bead885d308677c01a5a373c405d5202d51678381dde4cf7c9588d39c", + "shortPoolAmount": "0x2cccbfb910277ffdc29279400f71c1c9a29cf220b13323bf3d3df3efc5f4f737", + "positionImpactPoolAmount": "0x23b5e1a1edc634f30f6648276d5fd55f0eac32b156da3aa772f5bd2e1762ef81", + "swapImpactPoolAmountLong": "0xfa92beac09e71ce5dbb10dd5632be161aaac40fd65e13878fd1b0eb4c1497ae2", + "swapImpactPoolAmountShort": "0xc52afaebb2cce78313e931ce4e87f544531c21756cb160547dfc2d82fdae0ddb", + "longInterestUsingLongToken": "0x3aa723543bbed87663812dcd1dc908ff1e4124b1f6b2aa362707d1b42b517e44", + "longInterestUsingShortToken": "0xab6824fa2f2272b8337adb6405216eb7dff44b8ba80d5720ff15fc163bb495e1", + "shortInterestUsingLongToken": "0x7c29207d7f756365c70d229e40ffc3580f073de78901beae59a4631a2fbd9a0f", + "shortInterestUsingShortToken": "0x494a61bf84883793ee9e177bbaac54b45cc0069d582629591055ea06edcff27d", + "longInterestInTokensUsingLongToken": "0x299a1d8849e653dd1af645bc556bb6ed5247d5ed0fe1bb5a575b258a1bd49585", + "longInterestInTokensUsingShortToken": "0xa6ebe0bbf1f8cf6fc27cd99e07db6dd2509e16d3827345e862f82bbef1e26b45", + "shortInterestInTokensUsingLongToken": "0x8aa5299d6319df2a3bede3244219aff37fdfbe6cf1cfe01a1de80adf4fb4acc0", + "shortInterestInTokensUsingShortToken": "0x44ff64b861babd0931a09fa182d6d719cd669408a790eac64419c3f60f53a93d" + }, + "0xE61e608Ba010fF48A7dcE8eDd8B906744263d33E": { + "longPoolAmount": "0x48476f0d961d1aff36832522429759e176c244e4fc7d7ff73e97d69178925341", + "shortPoolAmount": "0x2d8e462ad782ee3440b715dcbefc4881a9d78ce33db8813edbf16c2a2a32df8e", + "positionImpactPoolAmount": "0x7e6920cc09e95dc5eaefda2dee817607fc652a2bf907e5598063fc3a27e96355", + "swapImpactPoolAmountLong": "0xc33cd72a9fb301b135fc60165d0a407e218b7f1b173eab910d1adff1a1f9920f", + "swapImpactPoolAmountShort": "0x1e866acd6a627afe6a134c37d9588067ac189af3545f5a5b81a889f3f313d271", + "longInterestUsingLongToken": "0x644d0b79bbdb48ac786df1e4c3af353fdf0d115437089529c9009367ec6147b8", + "longInterestUsingShortToken": "0x6249463887e5b05c753605abab703ba8334888173600c7bfaa43452c2066d1cd", + "shortInterestUsingLongToken": "0xf17990beb9c9596690f659c2a46f211eb7331a5808998857abe947b7f66cb281", + "shortInterestUsingShortToken": "0x6fda26ddffaf7a5bc2189712fb3ae1b3d814235bef27f48b2f0d5949e54f3831", + "longInterestInTokensUsingLongToken": "0x2b91c41c881a6bb45c5dbf6abd1e02fc866ac407c6633fbf333b2485fac06bba", + "longInterestInTokensUsingShortToken": "0x2e22c237ddd43c939d56f6a0423ea1439dfb48b934864777f5e12e40a238fe39", + "shortInterestInTokensUsingLongToken": "0x7e13b579a920cc3c7f10f006f97d3e0960a0a16b06a98bcda13882acecd2e767", + "shortInterestInTokensUsingShortToken": "0x6d088fc7daeab4c9cf35076be0a1460f7accf37afb9fbd47624cb76f15e1eec2" + }, + "0x75F190E0Be6E8B933A01423EFE398c6C721A5CfF": { + "longPoolAmount": "0x55e252845b027a2fea99dcb4b80bf874e6558e905d2494f7ada2deaef2e0c6d2", + "shortPoolAmount": "0x5170b2b6df0d09d4f44d96effc6fea4223a550227f4ff929313bf10f8a3fee56", + "positionImpactPoolAmount": "0x3bbd02d02ab17e737f5b97834ef0e37d04e490dc5ab78265e46675b83e55ea97", + "swapImpactPoolAmountLong": "0xb84f6b8d605e48b9af4bb3e89c6a834c4257c665d902e69a5c5f71c27d86d70d", + "swapImpactPoolAmountShort": "0x7f96a4fbb97e75a35eb649fb753f527b257782eece6bb6eba89524e944b4de14", + "longInterestUsingLongToken": "0xc23522e4f9305d0d19194de44316e57fbaa15beaceef4e92c35413c547927417", + "longInterestUsingShortToken": "0xad6ced49ceb3aa52aefd5367232a202f0008115e93f8fd1e73f4cdea0afce02f", + "shortInterestUsingLongToken": "0x4b422e3dc919ccba2372836c864a3b018ae0344d8b44b6c21004472214cdf1ed", + "shortInterestUsingShortToken": "0xf097d279997295a5af945bfb65eaed640649173c31b2993330ce7e44b95571ef", + "longInterestInTokensUsingLongToken": "0x73b58cfc2d30ee95c7270d9f12fa4915edc66113a2df3eab6a27ce332feaa900", + "longInterestInTokensUsingShortToken": "0x191d30cd971e3af196473c12e8b676652eacb1c46fda9cd9e9c033fa5850e84f", + "shortInterestInTokensUsingLongToken": "0x5f5abf44399a86b753ce90d312af6f3f4231c5723e30a49143cee49827348569", + "shortInterestInTokensUsingShortToken": "0x6f9ab2affc57ff848c2d6c67c431da1568dfaee433d821cd8ae13416b781c130" + }, + "0x0c11Ed89889Fd03394E8d9d685cC5b85be569C99": { + "longPoolAmount": "0x90cbc19a480cbdf9097abedc331308034c1e7f39a7eb75efdb97d8d23af88a22", + "shortPoolAmount": "0x3c7170d20da15405d1f7e8901f76145a53b22aa9f5323287b04df96e09b95f76", + "positionImpactPoolAmount": "0xf7bbba8b190c3231bd1eb1648fed0bb52d68d80812484c67c085fdcef38eb4de", + "swapImpactPoolAmountLong": "0x33f7caf9fa6500e7886c1d6a9b61fa025f6c2fb8ac1a3a5cedeb49f514a70c2b", + "swapImpactPoolAmountShort": "0x93a8091fe1b952b5cff5c02bd6de2304a0d5d9e5c96a6fe7359fada4617a9266", + "longInterestUsingLongToken": "0x8479489989c0035b8c9647628815c1b46f3ab49808ca33fd2ea7c986426bf048", + "longInterestUsingShortToken": "0xef8b3b6dd9c3876db7c309ead64c63542502963218e5ea42911c1018ee1d0959", + "shortInterestUsingLongToken": "0xa24597b88d45c13d4d90dd4911a527e7ec72d9a4a7fa0adad0fa72a07b41419f", + "shortInterestUsingShortToken": "0xc5cca75255c9fd8f70a5bdacd299d48a7add3587edbe233bf02893fee9714e80", + "longInterestInTokensUsingLongToken": "0xa2367e2ba92fbe2d74bfc698ad987c54754994bb4c573db82d5e888eb6564455", + "longInterestInTokensUsingShortToken": "0x8eb401935737bc689895c21b9eb6409136e492bd187827b801dcc77a506675d6", + "shortInterestInTokensUsingLongToken": "0xc579e10e17695c2550a85def1d72b2d54de2f2a42a1d71445ba4a4b769f01da7", + "shortInterestInTokensUsingShortToken": "0x75927e89da3b2274c549e74b3eda2d27ddf89edaee61a7b2e1e831dd08af4981" + }, + "0xa8A455Ed94b315460CfF7d96966d91330f6A3bA0": { + "longPoolAmount": "0xb5ce7d097c813079a1e33a6818036c5992efaf94bab4bdf63b3e0230b88c5cf9", + "shortPoolAmount": "0xded4e9e84e1f8672e7ee27ac5e334cc4630e7e96bf419e79dd22c3ae60fc9e01", + "positionImpactPoolAmount": "0x16626d9db8d02e3d283972023642c81876ac5a0c3770dcbe84aef89a4179cd3d", + "swapImpactPoolAmountLong": "0x2dd793fd8cd0836d0932b7508e5132c5cd27e15a1e7465f53278204e1121b4b6", + "swapImpactPoolAmountShort": "0xb18472bf581be7408c4b8384b9050812808c830388207abda99f47433c306e7c", + "longInterestUsingLongToken": "0x11f07af9b65d2a96d1a9f7ede41e526fbf46f5245c4c5cd3f114f42a04dc4c25", + "longInterestUsingShortToken": "0xec5f199272ba225a625c9e4a7aeebea28e9f2085d22a0312392f5919f522623e", + "shortInterestUsingLongToken": "0xe3d8a6af149a2ed7319d9199b4dca4200d0616772bb58db1d4d560b28f57ef2d", + "shortInterestUsingShortToken": "0xf6b2554231a3213e72b076cf3408dcfe76b6b02cd08f647ab5a57f72c3509dd0", + "longInterestInTokensUsingLongToken": "0x5fd17b5711adc4c6da00a8bcad03fecaa7e24387701558980b8069328e698d6b", + "longInterestInTokensUsingShortToken": "0x3812542b0facbfbe2bdea622acdcf7c2cf003880bdb8948f4908cbe81649baf4", + "shortInterestInTokensUsingLongToken": "0xdf8ab6310dcd49910598d57d66ae8a06916ecb470456eec926b97ab601e04d39", + "shortInterestInTokensUsingShortToken": "0xb27044fee8a907e7e273cd59cfaa7ef384cd2bbdc70a81eaa9f42e670d7b36a3" + }, + "0x970e578fF01589Bb470CE38a2f1753152A009366": { + "longPoolAmount": "0xd35c99f96d4430ab664bbeb93ff6fd51d1e44652c464cb37fea7c5e99a048a0d", + "shortPoolAmount": "0x96d13ba0bec5bab2abb5a110ec9f27e47d45239a12efb4e9105132a834d3b4f9", + "positionImpactPoolAmount": "0xeea145c1e46b685627cd10ae41196b00ae8f66818f0a488fd2f39114abb64993", + "swapImpactPoolAmountLong": "0xf848384be2022558753e24c2c93cd370c1189abdb1170dcc8dcecd3181fdc7d4", + "swapImpactPoolAmountShort": "0x8ccb999254e58fb329fe84dc81ece17fa6652543f6b8f4a03a04889a887ac506", + "longInterestUsingLongToken": "0xd09e7700318c21676d6b2fc37c7485615b64615a807d93fbaf599e94c6519633", + "longInterestUsingShortToken": "0x9f5becf70aef69d777ac0758f23f086af1411c8821d63389699ab95802c3771b", + "shortInterestUsingLongToken": "0x588f43ee0441d770992fbb5280013b042152d46127f4d221d89a7d0c2c6cbf50", + "shortInterestUsingShortToken": "0xb77d4bad7d132f18adff2f21b072568cb5002cb3e4ffafe7dfbb8dec14771eb2", + "longInterestInTokensUsingLongToken": "0xf3b519540660fb9c8388026e68b86298b9124fddea18abff4c29915786475d5b", + "longInterestInTokensUsingShortToken": "0x226de1e73eee099468e7480b112b3c19cd272bcac030196f258a04dc877d4742", + "shortInterestInTokensUsingLongToken": "0x1d4ca05d3d0978d4beb9e0d7a1f6d2afb47a98ee56557424bd8a6712fc84cb92", + "shortInterestInTokensUsingShortToken": "0x1dacffdb819149e6510b99fe36273b7ac38c51dd9ce289a9d9e8887197b0e1c8" + }, + "0x04DecfB37e46075189324817df80a32D22b9eD8D": { + "longPoolAmount": "0x60dbc2c866f06c167a92d4c12c1cecbe908b1155ba5c08e0fedb18f7ea99a47a", + "shortPoolAmount": "0x46639910509fb842b85a519d74cbd0c657a5ca36bb08cf839d0eb395c22d8662", + "positionImpactPoolAmount": "0xedcd2682838de6a440300723af518bb6261ab37238ca09145df7f58c4b8d6759", + "swapImpactPoolAmountLong": "0x1048ca9ba63239b1d0b36f977dcdd4765d0aa2a0c2710f39ca0a0dfbd4f5f873", + "swapImpactPoolAmountShort": "0xe42d2c869a0a1daabcf20cb7543d81dad69ff03afd707c6530d84a72d2ef1112", + "longInterestUsingLongToken": "0x42d6474adf46f92da7b5342fc5b092e79ea5db9050fcd798064d5bc3e730c7ea", + "longInterestUsingShortToken": "0xc1d0a8f3040f1cf33171328544895145e4624044a6616b52b5f689dd416ca359", + "shortInterestUsingLongToken": "0xd7b5d716c593baa46bdf4cbc9f723963b71aa44b6dac3554c9a6ccea0dee2cf5", + "shortInterestUsingShortToken": "0xa922ad760f526e4db6c4d2ba1befe958562aa4b59aeb496424382f7e6fd21dae", + "longInterestInTokensUsingLongToken": "0x5e573aa806b81808442466c7a43331e1031a486587f3b185bb23163db221a13b", + "longInterestInTokensUsingShortToken": "0xa08e2fdf42a61d35c100fb2892907db9140fc46f4bf68c569c7dad0d6c67e4e1", + "shortInterestInTokensUsingLongToken": "0x036a2cdb164c9404e4c36dc930272754afd1d2866dc3982e723699976e0b6792", + "shortInterestInTokensUsingShortToken": "0x29ab622495b91ef3256726bfb7a21616e9c46615a21bae2f594f5d5943277eea" + }, + "0x4d9bA415649c4B3c703562770C8ff3033478Cea1": { + "longPoolAmount": "0x9d28d4463e08a2f08f09c89ed3d9c0f78165ea37386fe77ab91f5b064cee0289", + "shortPoolAmount": "0x1bea3741d9997cc564d1732c726698091d96c1cb617eaf2279d5f086769cc399", + "positionImpactPoolAmount": "0xcff6a6a283da2425b633ed360f0682a745e7b121c7fc7bc4e81bd6743cf4d115", + "swapImpactPoolAmountLong": "0x40ade4e05d88f60e1be36d97c54141bfc19da7677d97a7fe10a8a31234870e62", + "swapImpactPoolAmountShort": "0x8fbd02e3ed8fa15280aba3af56712b0b114189431bc3b6f04b83bbfa26edee06", + "longInterestUsingLongToken": "0x62d108c04badae9bb99137591f21a6e4e193d78135b2b11119210769642073d7", + "longInterestUsingShortToken": "0x27c7534c747a0cd07e2d9272f7469f47c3baa9a2e2461d66361d083d3447e33f", + "shortInterestUsingLongToken": "0x5974a8cdf91b05e756098c1a84c15d83a0c3cb5c6fd942ef63188562101518ef", + "shortInterestUsingShortToken": "0x3751046db7325c40baa24d2ea670cdbb1b2225a9f00594339bb9aeb884af8c2f", + "longInterestInTokensUsingLongToken": "0x9efff323452243c1a308c9272b5eb6579d7f98c152ca7d3e3ecc9af1bbb89e61", + "longInterestInTokensUsingShortToken": "0xe803ecd147f6dc3b5165805c435ce3d125145d06fc2d088cd70ccecff9e6d959", + "shortInterestInTokensUsingLongToken": "0xaf2d7eb82495f5431721a47e702c1d3df20f73f13d9c2bce9797207063b00ef9", + "shortInterestInTokensUsingShortToken": "0xd12724b1048295d7bc86f1bbb99acfd11fc2c1a4fddf1ff22553f305e393bb95" + }, + "0xdE967676db7b1ccdBA2bD94B01B5b19DE4b563e4": { + "longPoolAmount": "0x15d7f8004188988d56636eea71cdac7adf8d2106e1df2ae6a1605fc900e3370c", + "shortPoolAmount": "0x6af79332c55747fc717df8b1ae375fb7851ec7b666c9662ffb1cf01136e891cf", + "positionImpactPoolAmount": "0x29e6e7fa35c7ba46f87304030cb761fb0ca15545059eb2b5324553151d75c1c0", + "swapImpactPoolAmountLong": "0xf4da272e2de8bc33ccc331b12ab1e6268fc6e6aa40b700b75795fad0ad4b7e84", + "swapImpactPoolAmountShort": "0x1b1d42faedbd75549bd8112262a0bafa2e2e28a37ad8d2ee4d2658c187343be5", + "longInterestUsingLongToken": "0x2af1caf58e3aebf9c2b383007b16554a616667a0efe69506cb08827535c712a8", + "longInterestUsingShortToken": "0x3bd377f9da2331e1345f37fae90464b1f2c62929601133b1af23324b8f08b4fe", + "shortInterestUsingLongToken": "0xc0aea1b67879fb9acf71cb4f0f76fe00bc0eea53cd5c3496a31884a8381f5d21", + "shortInterestUsingShortToken": "0xb6c68164033d0f071c5c56f39235b6a1ad4d4301d20b7be03824292ba5009627", + "longInterestInTokensUsingLongToken": "0xb7e05f90e5f693a97ad5edfdec7ce6e3dcf72e5ab5606092dec0a17068746844", + "longInterestInTokensUsingShortToken": "0xdacf8d9b8bb616dd1b0566d9a21bc68b559ceadde2f238d0bd86bf796717d4e7", + "shortInterestInTokensUsingLongToken": "0xe7a599e4cf1c1cda5283c7c8665a3dde61b8596da0d2e69a7d60a81539cdc33a", + "shortInterestInTokensUsingShortToken": "0x20ffed2ff7f628c3b5a2af090a0efa387c896b70ec7b10605796e3987482aa92" + }, + "0xBcb8FE13d02b023e8f94f6881Cc0192fd918A5C0": { + "longPoolAmount": "0x89344371f08e2e38307f7a9bea89b8815d17be4b37c06c643aede4ecd5104f33", + "shortPoolAmount": "0x976a94f66745bc577a89171514cdced7fb4cefbb52afe0f7f59fd38c9e714880", + "positionImpactPoolAmount": "0x99635267596e6ed24477a5adcdaf69fa8ddea941a1eb17deada2349a60ff44e9", + "swapImpactPoolAmountLong": "0x29cec6dba9631d3251d562b8970b95937437818705426b10f19a10edd63b2510", + "swapImpactPoolAmountShort": "0xede86b2403f3d24bf0857aace54c6edb88703643f6216688ef34b8f6b267832e", + "longInterestUsingLongToken": "0x842c45cd546b6f77f697e96789fd340ec96c27c5f90c988450ad29954a8f9bbf", + "longInterestUsingShortToken": "0xfa0d7f51bcd7f347c7fba9b08e57de66f5ae6766c0ff824d2bfbd6e06f8daf4c", + "shortInterestUsingLongToken": "0x0735c792fe9c52ed6e5985ba34582e178be7fe15f1913c4ca892812bc2f8a95e", + "shortInterestUsingShortToken": "0x5a06ce303b26500a4148c4dafc2bae20ac2289e2865a3024974e81e137b34212", + "longInterestInTokensUsingLongToken": "0x591fb5504f7b38a07682733b4ddbf6566394a130759719c9f669ee26a632015c", + "longInterestInTokensUsingShortToken": "0x0f294d5a5311eb12e2cb0efeb9983bcd190e60d8a379a30c130757dc87a600f6", + "shortInterestInTokensUsingLongToken": "0xd36b7ddf6f7e9ce0bdb5162e551faa7a31fbd30ccefaa3f877ff89eb5d24ebe3", + "shortInterestInTokensUsingShortToken": "0x7458b134ae6a5777ceb24932c00fa2c8d7fede7952159ab6670427cad724fac9" + }, + "0x7DE8E1A1fbA845A330A6bD91118AfDA09610fB02": { + "longPoolAmount": "0xfa9a1f11d27a28370acc456aae1f0378f74b4e1b8f8b460d821738ebfffde76e", + "shortPoolAmount": "0x77ef98c9fdc267b6285ed0860abde6644bdd9b841fb3aa1af39698a03cdafc5c", + "positionImpactPoolAmount": "0x7f2252302412269032b7e417526635667f4daf222a8b9333a0567440310ff434", + "swapImpactPoolAmountLong": "0x9f76015ca27c3302d5f09ccd349a4dcabd8f9715e2161dd2ad2167b70a037152", + "swapImpactPoolAmountShort": "0x56cd7b0959878537221c99168804700df8ce41dae371d23ff94920bd3f8d146b", + "longInterestUsingLongToken": "0x6df77cccb9400b7df94e474d926d597ce49361129ef352c5b64b0c6511d4be8a", + "longInterestUsingShortToken": "0xf4ec35a7d7ae19824628592d2cb06fa4476bfd9e81cc87b348a1410db3fddee7", + "shortInterestUsingLongToken": "0x3bf5857f89cb09aac87054190e1f495c95e3bf08ea0dc1d661d6e058b094490b", + "shortInterestUsingShortToken": "0xfdb49c01e0baa66dc76255e8bd42fba0ef253fad4b1d07a1ddecbf4beee15567", + "longInterestInTokensUsingLongToken": "0x2a55df4bee69ec6b600c4c394b38d903596c996a7355fca87838b1577af902ee", + "longInterestInTokensUsingShortToken": "0xdf0cd8b169c7000b7fcbf2c37a1adf0fc9304370dd195475221e11d66ba34bbc", + "shortInterestInTokensUsingLongToken": "0x06dacf93505d858cec6992dd5c4cefe66fb149ffbd94be45df205c479facd2a8", + "shortInterestInTokensUsingShortToken": "0x02e949736baad7cc7f5127fde0eaead9aa0de07bf0b828fcf6aadc8b009d3b5c" + }, + "0x2aE5c5Cd4843cf588AA8D1289894318130acc823": { + "longPoolAmount": "0xc7f28df1562852f8059fe8b7e1b69fed717c6d50f7a68f297e79b0c21c4f9ff3", + "shortPoolAmount": "0x0b26bc1198c073902a00ba5c4c28a0e8ddb66056fda1390cd47b1f05ce9d411e", + "positionImpactPoolAmount": "0x6ae737720e9d284531c3259e002f8dad42d8b781259254131e042ebf269a821d", + "swapImpactPoolAmountLong": "0xee3e138941f6e353cdf1dcea2c898fe358a8d733ecd8498b9aaf082afabcbefd", + "swapImpactPoolAmountShort": "0x71c38d8d78cb223b2eb7df5d662d939be2a7cf7eb1eada606a72cd73be51b814", + "longInterestUsingLongToken": "0xff7bfb678c9be6ded2c40a216fb582605fec90da18106ac661d5eb89eafcb607", + "longInterestUsingShortToken": "0x00b0ace751f24f702b5405f33d3efc08a4aeab5dbf2a4a70774e9b643e5e6b2a", + "shortInterestUsingLongToken": "0xbffb6c8af18c3a72a321268cf3ada1e18539b361138a628cffdf172b94209e9b", + "shortInterestUsingShortToken": "0x1f5408cc30e817317ecd807c5146178ebace720b6e4e85bc72f4b7ed22541fed", + "longInterestInTokensUsingLongToken": "0x81d6599e211c56176e9932d672575926243e26929621a7a43f23086564a284fc", + "longInterestInTokensUsingShortToken": "0x03e915541a958950bbe282dceeeca0396c6857eae41d8a0b976c61180ece8b7b", + "shortInterestInTokensUsingLongToken": "0xc4450d0bbd5070380cc1b241dc29a8349f8b973a09548b5f4a81a5b9caef276e", + "shortInterestInTokensUsingShortToken": "0xc919cf1a06ccc7a389591a7e2f65a3fffa7fde1b628952e176a57b5ffd20569a" + }, + "0x89EB78679921499632fF16B1be3ee48295cfCD91": { + "longPoolAmount": "0xe2a0e67aafe2b69bff2a5ceae09fb53c98f45c9797c3d9deba786897ec8a3d80", + "shortPoolAmount": "0x15eb9d564e30e06a60601e8f5010f18f6474c55eec72ce99379b8590c592fda4", + "positionImpactPoolAmount": "0x89cf2776d628b2014e579c411325d36c1c185103552cf834ea5a0b4d17a46cee", + "swapImpactPoolAmountLong": "0x42ec584181a2f0d5d07cfc400a26c8ec13864c8f8eb9ba3f6d0b0b523b0f189a", + "swapImpactPoolAmountShort": "0xef2251dbccf1dc4d3aeea18fd2ceea579d7d67e714d83d83d4d02c8599c154af", + "longInterestUsingLongToken": "0x5f9083f617235c0d1a89cc7423adb6f23770327d80bbd6c8430f446885462594", + "longInterestUsingShortToken": "0x41f7cacb654bcadfae817cb23db92551bbdeb04402370682884259a9ac580675", + "shortInterestUsingLongToken": "0x70ae5a178fdb86f171f574faf5d50e85f42f2dc32b66cee960113d5cb824bd14", + "shortInterestUsingShortToken": "0xc7043969dc824642b49a6e995ecb01cafd7f1706d55b5be414048d1ff957cd9a", + "longInterestInTokensUsingLongToken": "0x26843df34ffb8ca5bb0c6ea2770114fa446de655bb3db5579674dcb5f61e94b9", + "longInterestInTokensUsingShortToken": "0x6f542fdc6addee4e75891c4bfb8860c6232b10e35d2cf34d56a31f6e37a073a4", + "shortInterestInTokensUsingLongToken": "0xbe1d49d8de9f15dd608c0ec6671808b8204838b14e8d31769b30489ee71e6e8e", + "shortInterestInTokensUsingShortToken": "0xb19e3d111bcebca624cd2077e9c21d2f53f98e22648b3625c51cdcaf1ca09ddd" + } + }, + "43113": { + "0xD996ff47A1F763E1e55415BC4437c59292D1F415": { + "longPoolAmount": "0x02d1ddebe0fb998ed2d8e53797212f0881ee86085581d0e81c58114150b4c549", + "shortPoolAmount": "0x18c3e19aa0b295204947632103894cd170ed3f173dba6d3ac8048e459bf4f569", + "positionImpactPoolAmount": "0x3c3632b71b83af1553ef1b0334da161288d75cd87bc86fc9e72acacbd44f40b1", + "swapImpactPoolAmountLong": "0xb76c8c5d6cc5bb70776021c5e5b544d5e8e16b9d3f71945a8d53ffafbfebe473", + "swapImpactPoolAmountShort": "0x4c5d4f5312ce14c5c85146560cf32582b2fb209aef1b71d8d2dad4195652497f", + "longInterestUsingLongToken": "0x19d25209ea1679537f628af42f6a18e25fec5fc20b20ce49168d5a3a507defc2", + "longInterestUsingShortToken": "0xa44a662070b19c8018715998a64e4b3032553ac9520b70a1784696cc5b5bd377", + "shortInterestUsingLongToken": "0xd893882d4de9e91091d451bacb61317d6a4e6e1d7435778320bb3835d1dda4f1", + "shortInterestUsingShortToken": "0x505d0c03f9347bcb52c0c68887c6d5e166ac3ef41f8a60cf2d0c57380651250c", + "longInterestInTokensUsingLongToken": "0x24157879a32503cf38fe871b9312a3a80584c87fbf2db057979adf4e0a5ad5f2", + "longInterestInTokensUsingShortToken": "0x3214d0241a6bcdb90a2b370655339ce621718d0bd7f5fd64005d31e09e068096", + "shortInterestInTokensUsingLongToken": "0x00729f1ef6de36e8d305a53c63332d33027355a452bfccd12029196ebf160984", + "shortInterestInTokensUsingShortToken": "0x967ddea542fff0ae0c3d52b1badd9cd06975123275ea4d614138868ae055ad8f" + }, + "0xbf338a6C595f06B7Cfff2FA8c958d49201466374": { + "longPoolAmount": "0x5c9e079c47cf6af9a904d2e89c3eec2822629df5445ddaa34d26eff1645b9573", + "shortPoolAmount": "0xd6b26fb61bfa92afbe97c5552448f664c2a8951ff3f7400bac647e0bbe4d2e89", + "positionImpactPoolAmount": "0xd899f74f31bbdaeb36b5399df4f589663737a60cc8eed5bfb1f00709bb798424", + "swapImpactPoolAmountLong": "0x309a03a57eeff1e9d67eff1c2d32f47a80f06f711d214a54f79013809ed41c97", + "swapImpactPoolAmountShort": "0xdc6cebe2ae3ce79aed5c8c3ab6b90286425562fca2abfb1f86425c03a4aa493c", + "longInterestUsingLongToken": "0xfd45dad11d5b090606f8a95e15718e2970c8942477c2f677e6e81e2603fcfaf1", + "longInterestUsingShortToken": "0xe0656d9f9b3054f9247b91d2e6229d605e4375ce1754f3785110f9eea346d90f", + "shortInterestUsingLongToken": "0x9c94d7f8a2216892b2f9908fac77e3850374cb2249c17e078eb7c5221a47d25b", + "shortInterestUsingShortToken": "0xb22f4b41b7fa66dc94ebd09120da943bc2dd010c0f79ac8a4a7505711a180df2", + "longInterestInTokensUsingLongToken": "0xaaf527b729ea26edc2be992e8ce4618a65ff7b37f7c708c47984d31a7a22735b", + "longInterestInTokensUsingShortToken": "0x3bd79cbd42679da3d2b4f15aace12fbb020b99a89e089b11fdfda13cb39a0d8c", + "shortInterestInTokensUsingLongToken": "0x2148e6076419029533a7f40def3ec342c402cc518f3257dbacb657b41d272f22", + "shortInterestInTokensUsingShortToken": "0xd8a34b8289773d6c42ace7c40cf0a9bac067785dda3556e4f84e3b0aee363e8e" + }, + "0xDdF708B284C5C26BE67Adf9C51DFa935b5035bF8": { + "longPoolAmount": "0x9247d03b6d08ac4679e29796a009021e0387b889f505949276fcba1c0cf9a69d", + "shortPoolAmount": "0x6268085592b9da9e6aad4cccf3dd7e8f7da9515ef527867607a8eaf01ce40df5", + "positionImpactPoolAmount": "0xf5ae415b53f93dcc2c1e97ff2020801b27da8f7515b9ecb8836bb1a2da774fe7", + "swapImpactPoolAmountLong": "0x56f9b5d1b7b51660c884cd93c19df170ed199439f813c39dc7d34ad0d9becf89", + "swapImpactPoolAmountShort": "0xc85f612e09648582b315aa6154c5eca7f5856e1ca309f2c9f1781a26c87773e0", + "longInterestUsingLongToken": "0xb45560e5997b29354bc675ad6bfb463fde820119380724610c60df53e2ffc720", + "longInterestUsingShortToken": "0xfb57bb5d145f21e7bcfb410d09519c52bd0bdd0345123fcf9e43a4870148c9ac", + "shortInterestUsingLongToken": "0xfb7b312c29d22948532a0a43ec57b482484605e81cc79bfc312ffea3c70f0bd5", + "shortInterestUsingShortToken": "0x13c171a89b847539ea78b5cdb6fe4173f33ca79af5dd419ee4e9af2861f15763", + "longInterestInTokensUsingLongToken": "0x61303d0f8ba1421b4149b45b567aba832537fed7f9d7595f326b53ed72e284fb", + "longInterestInTokensUsingShortToken": "0x46557ff61494862fb6f82bf325b3900555bfa6c64666b8b63be5acace0b72183", + "shortInterestInTokensUsingLongToken": "0x775bca085ac796b3af955c2452efcc8cddcde32feb491f5714e00ad442e2fb65", + "shortInterestInTokensUsingShortToken": "0xf1acc12622629806c4178d17d37222af2bf92e4a6c808d24d6cffbae7a3e21ac" + }, + "0xe28323955C05B75E25B56C1c996C1354Eb5Aa13D": { + "longPoolAmount": "0x7373fa22d1138c76bc52b8a14ec22fcd12aa810e83e214dbe0277266cda1fe7b", + "shortPoolAmount": "0x7373fa22d1138c76bc52b8a14ec22fcd12aa810e83e214dbe0277266cda1fe7b", + "positionImpactPoolAmount": "0x5be4889a86dc1d077645569b97fda40437a84616a1ffc9841182a168da9c6062", + "swapImpactPoolAmountLong": "0x6671c192665ce7d257c01930bfecf9a0e516a8eab589efd9bce107221f15ffc9", + "swapImpactPoolAmountShort": "0x6671c192665ce7d257c01930bfecf9a0e516a8eab589efd9bce107221f15ffc9", + "longInterestUsingLongToken": "0x18f44ee5ff0ee6bdad862ea4070c0e6e04dde0900a88be5343ec4627b3a587ee", + "longInterestUsingShortToken": "0x18f44ee5ff0ee6bdad862ea4070c0e6e04dde0900a88be5343ec4627b3a587ee", + "shortInterestUsingLongToken": "0xa51e63c92fb05f714970c1fc1c75ce8c3570d1221e9ba7eebc13686c4c7b02f2", + "shortInterestUsingShortToken": "0xa51e63c92fb05f714970c1fc1c75ce8c3570d1221e9ba7eebc13686c4c7b02f2", + "longInterestInTokensUsingLongToken": "0x600622887ff5059ef1a3e03d05ae998b2d78abb83cbaf22b413a7fc3a268f837", + "longInterestInTokensUsingShortToken": "0x600622887ff5059ef1a3e03d05ae998b2d78abb83cbaf22b413a7fc3a268f837", + "shortInterestInTokensUsingLongToken": "0x65b564ded08fa5bd166052434129cc10031be227cc01182c2aca1c97aa3e677f", + "shortInterestInTokensUsingShortToken": "0x65b564ded08fa5bd166052434129cc10031be227cc01182c2aca1c97aa3e677f" + }, + "0x79E6e0E454dE82fA98c02dB012a2A69103630B07": { + "longPoolAmount": "0x6e5939fe6f1106afc8f484cfd4a56ebd2b27f8f269e0df67ae0a31e15a380c60", + "shortPoolAmount": "0x0c5d1dab7d2363cea0a16bde6fe6097933f98eac53274ff31aefb5a8c617dc74", + "positionImpactPoolAmount": "0x6024d1e78729b84ce44a86557a540eb39859f8bad54610e3b9b27f0fd183235a", + "swapImpactPoolAmountLong": "0x53aeb0af6e201a911d0d04a92431340aed5496100eed7c01af506a7954d68ec1", + "swapImpactPoolAmountShort": "0x273e850b39b9a9768c37c19b3d0768a78121162dd9d8bdbdb62a819ff985c960", + "longInterestUsingLongToken": "0x39bb7d2beeb4875e81760c3df967e12ef4f83104624d4de82dc3168eee282135", + "longInterestUsingShortToken": "0x0a37e02e36ce13028cbb9a9bdc8f120487b87ddbea5c66e93fdfac3da5abb557", + "shortInterestUsingLongToken": "0x4682ac6f27889d23aae591e62e0d2454b01f6de98554c4ad779dcae3ef0ed39c", + "shortInterestUsingShortToken": "0x41dbad38cd53ef52d027e53f7d2b2a31efc5f1c53a41c15eb4054a378a55fae6", + "longInterestInTokensUsingLongToken": "0xacfb9beda82a01fedd8a4db8accc7d78265b76355fffc8c34d17e21dba62bf29", + "longInterestInTokensUsingShortToken": "0x4caedec62812ee33163fe897fc5c55edae923ae6ba4966f258cb4d1244818b4f", + "shortInterestInTokensUsingLongToken": "0xff3ed2e842d536a7726871189880aadbe89a5092e12f16f9ef23b438f16be9d9", + "shortInterestInTokensUsingShortToken": "0xcc187441f42c330f564130b9543a8744b7a84283b6213ceb3c30f434be03cd93" + }, + "0x4b6ccF6E429f038087A26b13DD6ab4304F7E5DF1": { + "longPoolAmount": "0x42976301f89cb456caa3084a3d6f7d06b44c138885c123d89edd1f67fa0d4898", + "shortPoolAmount": "0xb4e0d6f4915f9cabee5dcec4ff40d7f86b0561e19c0c8df1320ca512b1ba6149", + "positionImpactPoolAmount": "0xd90b73a3ac7c548dd9f588f84d0b5daccc4a68819e2a46dcab27f49ddc6dd699", + "swapImpactPoolAmountLong": "0xeeb129c864401b7bdc6c61670e0e23f829d5850ce0c57baf5d2746d2debda0a6", + "swapImpactPoolAmountShort": "0xebcaaddae19d82e66c3e8684a93a84e282e5a40e85920f5d901e11e182b99ab8", + "longInterestUsingLongToken": "0x0aaba63b5e247e319ce466fb084577bb59e1aafc971decf673d3c8d1b46ad40b", + "longInterestUsingShortToken": "0xd2d68b98f752a323175cacea45c7455a7e8fdbe458b279cef2bf77192f2fff29", + "shortInterestUsingLongToken": "0xb7a619ae6ffd753235228419de67afec12e2c358cc983fd71e68ba2946ee5a6d", + "shortInterestUsingShortToken": "0x75a5cdea17fb385d2ce9c9f648e2385c4a611f2488ee400c18d437b646393769", + "longInterestInTokensUsingLongToken": "0xdceb917a1a96276fd0154f18447df197ab9d340268d261e960ed513885a1061e", + "longInterestInTokensUsingShortToken": "0x9b1d255ab2749233eaf483f27a307a2c72a8334959583d81d4bfc53d6c5e7a04", + "shortInterestInTokensUsingLongToken": "0x025036d597621f7c15e23fadf0faaeb5507654953b8e048fc5ca3a7239863237", + "shortInterestInTokensUsingShortToken": "0x14cc9dab4ecdc277e53e7246a8997dc6f769afeeaff3612a319f87db98eacac7" + }, + "0xEDF9Be35bE84cD1e39Bda59Bd7ae8A704C12e06f": { + "longPoolAmount": "0x1ea9bfae90dd49ddf166918cb87dcfcec23e00b3fdffa00bde3a4911271b20db", + "shortPoolAmount": "0x18953aeb9c50365528fbdf0ae95ae798decfa308256139a0355b614a029d58d1", + "positionImpactPoolAmount": "0xbaca9bf33b0c88e8baa10d2376548ee3e308c3d0952c5546f0b5ba0e15636940", + "swapImpactPoolAmountLong": "0xf49edd973a736df370acac397bef6d66d6a1a653517bc6323ec261480d14d1f7", + "swapImpactPoolAmountShort": "0x1a232d037aa72bbc4d49445ee9699ec59d61f693fc5213eac54bfd7e43de0fcc", + "longInterestUsingLongToken": "0x6a83e3b8e7554fbfe2cac20814bafd6e7454b7bf8644c53fa7b58c3648aa724c", + "longInterestUsingShortToken": "0xf6332c3ff26c0ee195339008cf9cdf00fffb0385c018f16d24fdd9517f09ea9c", + "shortInterestUsingLongToken": "0xa3a045ee3cb698029ba0714627942b555ec6955e8442c34374df584094d6a2d6", + "shortInterestUsingShortToken": "0xb70af1262e29b7a7651cc086dfe1e8740eb44680b04892dd7e1e10d24746fd96", + "longInterestInTokensUsingLongToken": "0xaa4a3fa9ce359895a9d871f4ad9ccf639cc6103d9a6e06f924a7364ac1b7cb47", + "longInterestInTokensUsingShortToken": "0x94484334a11562d512b07fe72f8a57ecc5f448dd060fa1d198fa886e64d6299b", + "shortInterestInTokensUsingLongToken": "0xd551a47cf143aaa8273ac6992b0836c015dbba3fc16ed991c0bdc24ed2024d72", + "shortInterestInTokensUsingShortToken": "0x1d7582a89d7f99e80b16ec36915c5e1ff04a1a9d48f0eaf1c892fda30357885f" + }, + "0xeE8827D67C054cAa89C9d6058Fdddccd1C499c74": { + "longPoolAmount": "0x72bd71a68259df3304e2aeb816c62088e68c88b6ffff42f5888e01326aa20ac9", + "shortPoolAmount": "0xe7462016f27c0987a58c9e717b7294b71d0f7276355a0317fb94031a8638da7a", + "positionImpactPoolAmount": "0x47fe313a3f69aeaa32777b728664e0c560d185143eceaaed8f970b81ba4f54f7", + "swapImpactPoolAmountLong": "0x796caf990e63fe8b3a55978e42f1ae031182fe7ba9347d47924c7c497f98b154", + "swapImpactPoolAmountShort": "0xae50e69e6ef2c7ffb14f84fe29d86e5dd093987928ea22ead669aff1e0635272", + "longInterestUsingLongToken": "0x22b7a58be2f00c6fd4b571f11067fcb454524e2f7ed1f066719fcd06e577ab40", + "longInterestUsingShortToken": "0xf9a40412bec15c6dea96b117b5b6a19b7a59cba6c08f359c87be0d6b54c56326", + "shortInterestUsingLongToken": "0xeba142a37b7a3fce134b12816f3f31fb610d7702dd8c607454f0535da3239421", + "shortInterestUsingShortToken": "0x2253b7b3d4ff07d7c0a03e60dfac5dfe6fef8036e65ea35b0b488421120b4884", + "longInterestInTokensUsingLongToken": "0x0647101b2e3548b766d31e933b45829dc339840758efe97262c64d01f1aaf9bb", + "longInterestInTokensUsingShortToken": "0xeedde4aab3baa808ec7fc4ea21f21f69767cc3c99aad6d1a460c9734490925a8", + "shortInterestInTokensUsingLongToken": "0x9cc917768c1d01e22fce477dead6449774333df076a5c9b9e0caf01ae32426b7", + "shortInterestInTokensUsingShortToken": "0x536ea1be37d1ad019a5ca1918795972fac0c827bbe3b3395a90528b7b09dc822" + }, + "0xAC2c6C1b0cd1CabF78B4e8ad58aA9d43375318Cb": { + "longPoolAmount": "0x9c39eb0c13c25fb442dea82a9fecc73afcb9055ab493ed14ce21f64e59a63a3f", + "shortPoolAmount": "0xe24d5e8b964abb3bf1164aaa9a061ec2250c9088d7a7dfe9992c559a60837808", + "positionImpactPoolAmount": "0x525845a5a2b8833293d52c8dbc6f3b11fb01641068db3fc4f147ede26ce0f4b0", + "swapImpactPoolAmountLong": "0xe6a4b236b77f0cf02679d5244832bc3a4447f2f210b5c69477d26cff97ae642f", + "swapImpactPoolAmountShort": "0x8b9aa776a69db20739135c3ac1d0ebfe04306bcee2a4fb33235bfe5ecb7f304f", + "longInterestUsingLongToken": "0x9bb7257831623cb60e0fdbca106362f0930ffe244f2c9645f4c1afbf84e73142", + "longInterestUsingShortToken": "0x4abc2d3e27b262089b072a906bb659ca15a9c4c93943fa583c6e1066f57e0402", + "shortInterestUsingLongToken": "0x67c806122584b82eb52657c61dcbe7ad1aa511172222ca133a296e22d3527fac", + "shortInterestUsingShortToken": "0x52809d35fe6dbf34fa96d2b69c89c2c0cf7c11e068def3afc1f4f17d70081bde", + "longInterestInTokensUsingLongToken": "0x11907b15112de601dfad4309e1176604c239cc28e0827bc1d81a1566a7e2f766", + "longInterestInTokensUsingShortToken": "0xf6a7c83a5d9ee22027a4027f0a03f757ba558f4ab440e519e151977f701baf04", + "shortInterestInTokensUsingLongToken": "0x79be052b10398d6628aa6484cf836fccc72f19b1601d2b6dec22d943594d3e6b", + "shortInterestInTokensUsingShortToken": "0xf809d16129d3d55a2bfa8943f6bde1065a77d184c25691551ded167dca652168" + }, + "0xeDf53322e288F597436f5d5849771662AEe16A1C": { + "longPoolAmount": "0x2fee970177cbaae86b817a0091ca88e1917244ce9a225edf4f6e910f14914716", + "shortPoolAmount": "0x4bf5cfccc580ba8b1068a8ee6a7db9e6bdf36ec5a2b9211d1ab02e3bec7e474b", + "positionImpactPoolAmount": "0xed01309a94041c99f28badfd71e26942edef15d2264bcb62bc2b29a57ff58790", + "swapImpactPoolAmountLong": "0x8f7b6b51e3d32c3d33687d932da8de955d8e4773409358d12af764b28b4721c4", + "swapImpactPoolAmountShort": "0x1fb4def8d6cf822ab16b25d0a092632856b1a013f1aa63d140ecbb29ada3fcdb", + "longInterestUsingLongToken": "0xcc63ea0a5522e73ecaea2a77b2e4941a682d4ba9aff8407cc9fffc5f91ce6cf1", + "longInterestUsingShortToken": "0x7ced835f57d81ea1dcd182e6fc31330a250e4490a5b7c693b348b522bcb140e0", + "shortInterestUsingLongToken": "0x3af35fe329c3f9b07a299e0b11649cc9b4bab92a46ae5ed0ce790ff9c4c2878a", + "shortInterestUsingShortToken": "0x24dbfb26207e7ff58d32921ac69d0ca995e63d0ac1ad989408b08c3b017cdd0f", + "longInterestInTokensUsingLongToken": "0x29fb92be4cd57f94e832be2e7bfa54236745ab15cc42b748737bb8b5a9d8852c", + "longInterestInTokensUsingShortToken": "0x4aee18b40d61083126f9cc62eb94749926ce78954d3433d70a61b7533858778b", + "shortInterestInTokensUsingLongToken": "0xf37abeffa1faa0775795393aaedea4ce484d0881bd302aa767f33f87b513f0af", + "shortInterestInTokensUsingShortToken": "0x07fd85f89a01b1a19bce1780a1247f664e65bd05e9227f0878227735bacbd4d6" + }, + "0x017de90B0fa830C592805C6148c089191716f04c": { + "longPoolAmount": "0x155105d455b4c091f5b3836f135116842b7bd65791b12f2e28a3d210f9201834", + "shortPoolAmount": "0xab9732cceb70d5aaa86b06907e516747aaa9361e17728ae2d5ae7531e5202cc7", + "positionImpactPoolAmount": "0xf07fd3b6173b862efd6c5d7985133577567fa7dbe02d2b944f201658f1d0c426", + "swapImpactPoolAmountLong": "0xf9a4afb38cb34943df9c72b1205e79c39a0df9722a66899b51425ff731400c0f", + "swapImpactPoolAmountShort": "0xe3edf187977227a9f42eadb904de23b8634107336143d47163a4570c8221cea7", + "longInterestUsingLongToken": "0x0881b9f820b6d2d104a4bb6da9137dac4483131fee7db4020b24107ee8eb5794", + "longInterestUsingShortToken": "0x5b3379321c8178079b2e2d1903f4859598c21fed9d39aee1a53ccc7ea40e3bda", + "shortInterestUsingLongToken": "0x7589c91511e862156532313b785d9c188dcc9f06b5b6c8aa10179571739e9ee1", + "shortInterestUsingShortToken": "0xb4d47a34ffce54f632af50e43de64f1534a0324e2fb62b05a989455b3aa94a3a", + "longInterestInTokensUsingLongToken": "0xcec3227c9f8c17dcf9214df80af0d171597c360122580e5db0282c1907cdfe93", + "longInterestInTokensUsingShortToken": "0xf23b93b1b4cb2224d5692a047473b037746ed3f86e5e6255e34275ccf3fa242d", + "shortInterestInTokensUsingLongToken": "0xa3e2abf530a23c527d05c13e18ea7a8c2d9a7d8a12b98ac5590785b00aa2950d", + "shortInterestInTokensUsingShortToken": "0xa77f8b1cb79aaf93c764db20ef35589e5d5ddf7de2084436472be320654ef1fc" + }, + "0x695a07d3DD551b0E77A348cC6A873c1eb183FA98": { + "longPoolAmount": "0xc2a571b2717b2ea2c04ca2f347fa107333e4399330097be573ea178aae09ba2d", + "shortPoolAmount": "0x323a65aa07a4b75820f5eceb6b9d9cc8fc19b500bbffd934fdd571f384f0fc38", + "positionImpactPoolAmount": "0xdf595b5178f773d7e26cd8beb9522641f5189ca72659993da7bf26c7b4190043", + "swapImpactPoolAmountLong": "0x9440776b2cf5383539beb1512417976004bacb806f3762a61dec77b503d06556", + "swapImpactPoolAmountShort": "0x3f0e10c011d90548fd8a6cde3bc5a4df3710999e67618cbdd1c560539d1cf5cd", + "longInterestUsingLongToken": "0x48de8690a99b7ec6d37f81f0a1d612806aac0b242dff158ad45b65494d78250a", + "longInterestUsingShortToken": "0x1b9c5206d82babb877a1f668910da2e8000954cbdb9700b45206996f25c38aca", + "shortInterestUsingLongToken": "0x37f9e7710c6019e4fb9d3e214f909ca871aab75ca5a9982e447308e95948c145", + "shortInterestUsingShortToken": "0x08e794a40edefd29c07df4a4b779992c207e2c90127d7678a0af93c2e2322413", + "longInterestInTokensUsingLongToken": "0x7f11fee04a0252ace6452e70fd3f247a004a8073d79192d1114271abcc391bbf", + "longInterestInTokensUsingShortToken": "0x7c9f59ac54a72738ac486d8135a964e47a2fa9508649904aa6e14b927bd4bbca", + "shortInterestInTokensUsingLongToken": "0x5294cb3c8daad452a94e7f88461def350055a709cb6c092dce627238c13b97f6", + "shortInterestInTokensUsingShortToken": "0xde0535be9abb794ba5c539131c3b1a3ff72fba6c54e9d5c53cf28ce4bb151767" + }, + "0x927f31364b8836021e4F73B27a5d0EbB35C74679": { + "longPoolAmount": "0xc3d5c430777d6ad17fad755aa21bf1960f4f9a58478eaa88e518822cc23fe94b", + "shortPoolAmount": "0xfa9e90dc0a6238bda75dfc08c6d802ba5e168ca85d9cb55623a9bf61149c5593", + "positionImpactPoolAmount": "0x8248543207ea0241cb7ea6f5c795c822173ad3f642310e488c11834cd4d57c9f", + "swapImpactPoolAmountLong": "0x58be64165f1612cadc0c08845a86371e4a0d0331ff9455d05e7c2e72c2f847d0", + "swapImpactPoolAmountShort": "0xabde69f9043008d5834f08477c0052098fe4f185bb4ffecea8e9e63f464cc7fb", + "longInterestUsingLongToken": "0xb8caf324831e5a3727b9e495ef6613f492ee02294d82da2b290c4caad252c0a0", + "longInterestUsingShortToken": "0x5e8e9607f8be74a05d74f3404f89d02963513bd0a0084513088f24c5258f6937", + "shortInterestUsingLongToken": "0xea71e725dc167ee098f5896477512c9790242b499c31c31a98eaf8d386bdecc1", + "shortInterestUsingShortToken": "0xc0fb38f5744fd94b25aed9cd37623f73cb51112979f87340a9d5a58a97bb72c6", + "longInterestInTokensUsingLongToken": "0xa653dfd7f6d60b338a717273572166ae5c035b50f427881382fe2fdb5877fc27", + "longInterestInTokensUsingShortToken": "0x3c97231a6301d99a0f7e805212cf985b119d32e6a37582cc1e2c21ba443f209f", + "shortInterestInTokensUsingLongToken": "0x6ba7ddf864352f7d8a8b4e5e070c4cab60b506c62b8bbb212a1709b9b96ce90f", + "shortInterestInTokensUsingShortToken": "0xffa7cab2e985776180c358fda946cbc7e86362527ae558fb9f4d4d3a5777f7b6" + }, + "0x62408de4cB1a499842EC53296EF8dD99A825CcEb": { + "longPoolAmount": "0x70669c38db15b0ed0e80ad142e9ab9dfc9e23947465b48d8129552bca4f60381", + "shortPoolAmount": "0xd8654dbee5b39d8bed9d5082105033f05dbffa04acf199843a47d801fe367032", + "positionImpactPoolAmount": "0x6cd892829986541a6b38f5cc717b8e1b6ddaf8be79810af052ba5eb5cb8c66e3", + "swapImpactPoolAmountLong": "0x49a4dda0b1da82698fb6d00fd11d21628c84f4f72dfbdc6b046702f9f397831a", + "swapImpactPoolAmountShort": "0x1e44fa07d617c7440d59a44989c60f8eff14edbf1741b63516c0a1760659a3b0", + "longInterestUsingLongToken": "0x74cb13ccd1cc885b811e96ade67aa40c3295b89ed113f3f7dbb0d880972cf853", + "longInterestUsingShortToken": "0xfe7015868bca5937b201c5d492c27f590c384dc6c7d1311b1969ab93eb0d5d8e", + "shortInterestUsingLongToken": "0x7d5fce12f055f2d085211fe906672e2c125ddbdbef2b027277dc885c0f8aeb5f", + "shortInterestUsingShortToken": "0x7ce87baeaffe1c26dc1628c4f1257e70317d3b2d3e92f027ffd017907156b22f", + "longInterestInTokensUsingLongToken": "0x21d0dc6af61f328501db02a933595306b52c68f8c4b48098dd96a9fc4c71d4a4", + "longInterestInTokensUsingShortToken": "0x51cfe15695354655492b59e21a796a6421f99201e2f9dde6d2677913fe0eab96", + "shortInterestInTokensUsingLongToken": "0x3943e3710d73ad98293fd5a4f60961a8acfa34dda5a261ed9556ae6299229038", + "shortInterestInTokensUsingShortToken": "0x5b44d245dd06ad025b15aedc3b6b7d8c84df708999f3136760c9e4a7296c291b" + }, + "0xCc6AC193E1d1Ef102eCBBA864BBfE87E414a7A0D": { + "longPoolAmount": "0x1d484bfe2f776d851aa69a622ff76d7aee253f4bb58e107f9a4c2bbd69fa3730", + "shortPoolAmount": "0xf95f1efbfdb61cd56767ec2143ee4da88c942e47a5e889151038ce9a7d7d9d21", + "positionImpactPoolAmount": "0xcc50448c3a8af50b068036dceb8bf119c1a186b26fca205b8539b80b5f234e1e", + "swapImpactPoolAmountLong": "0x9bbf6e1beac50530d0188e1fb624fb3397b33f43f90c1590ab562ad368c32b5f", + "swapImpactPoolAmountShort": "0x855bf168d58786dd8166253e2a8ec52ed2c77ad89f3ff63a9ff874289d590196", + "longInterestUsingLongToken": "0xd743b2fa016d00fcecbdc0d6ff4343f97f8286c05f273b9711977ebe17b34a98", + "longInterestUsingShortToken": "0x3b1b3a12aaee118e38b449e5338cc03052f6cc11b18b6e7708e787bbc62fc3c8", + "shortInterestUsingLongToken": "0xc6189d61b1b0496be44d94e71d116ed07f3850201b4666e0d6d930f835066741", + "shortInterestUsingShortToken": "0x179cbcbb694a9c6f12a330d357c41cd73f178ba3bc85913ec16057e9fe7f41e4", + "longInterestInTokensUsingLongToken": "0x5d9893ac20f9b718300c6c099608bf216a206ed71aea3cda21c926ddfe894e7f", + "longInterestInTokensUsingShortToken": "0x89d45a282de14eaa869f2b8cf687750298a6d921f73dd79672a1d4749d7003d8", + "shortInterestInTokensUsingLongToken": "0x954490114fa239c7c96db8c3666a6b348b19d7acdce4b6ef39bb063f1fc96dd3", + "shortInterestInTokensUsingShortToken": "0x944f1483c3c28956558691c64a6adb3a54438f340b85b2259c71ac1ca3fa2eb4" + }, + "0xE446E8f7074c0A97bb7cd448fA2CC3346045F514": { + "longPoolAmount": "0x15ff6c4b3ffdc0e1b84732e04f55bb83e2b09b8388073859ec99a0e9f8d21b94", + "shortPoolAmount": "0x7a00a7d5423c30c365d7cea75efdeeb88f99a55a220ec72cf23d7c5b3e45cf40", + "positionImpactPoolAmount": "0x19a7398a6c56fc49e267ca66cac7206f7ec44a87cc8a38f726b817bfb6b2730a", + "swapImpactPoolAmountLong": "0xc06ff186c0fd78ba4f6d386f9b1d65eb45a51d2b1af5ad60c942398436e3d4fd", + "swapImpactPoolAmountShort": "0xfb2332fef471f984f9cf64cccc64896a161e34a54db6bd4dba6a358cc53222f9", + "longInterestUsingLongToken": "0x3264d4cc1d0c96451f64550438f626edda9fa0352a46d14fbf518dc113f4d163", + "longInterestUsingShortToken": "0xfab11ffcea39446c8f2924fd705177ef54aa11faf23713f0203f3096d29d8805", + "shortInterestUsingLongToken": "0x344c928170f0ebf6943d2ddad14860c125e31daed09c5582af4f6d1a858d314f", + "shortInterestUsingShortToken": "0x3d8e390aa277c4ba2c0377ae6c54d8dda929fa48a47c401a911e25fd36562bba", + "longInterestInTokensUsingLongToken": "0xaf18e809a4a9c428a5ea9ea6dee96035a1758f74284ec9d95701426a9ebd9caa", + "longInterestInTokensUsingShortToken": "0xaeb9f0c380c8c9c5ee8e64cd25b4e9a3d26d057e33ae498be08dd657ce087c4a", + "shortInterestInTokensUsingLongToken": "0x3cccbc00343813048d4382cea019a9fbbbba07c4876487f7963cb1a6f1b0e94b", + "shortInterestInTokensUsingShortToken": "0x5c7365bc5e0b24b0d5893cabff8b65eadab67a9304aa5e61214c131ff60dec6e" + }, + "0x1d9dC405CCEFA78b203BaD9CCe1b1623D2B25D9e": { + "longPoolAmount": "0x7b00d5a6c8137b37dad5d2486c907bb0e8b0867908b08733bac79e728de8124f", + "shortPoolAmount": "0xf92035033c4359bef043a7e17c66ce1ad49b9eef04f149dabeb5a1e563c12051", + "positionImpactPoolAmount": "0xc8f5b5dc670c829fbf2b637eb5503442c17050c14bb478158ca9d265df32dbd7", + "swapImpactPoolAmountLong": "0xcfd6cfc7dac0316c973158c04a1f2f6213dcabba22e830cd26d9abb3a1d73202", + "swapImpactPoolAmountShort": "0x1fbcd0c184eb07befc4ff9b1c504e4b6841eb8447fb0b468e1062f2fadc918c0", + "longInterestUsingLongToken": "0xc865f553311bce6a5265e20528fa87048111492693c70a1c374d547948ce9eaf", + "longInterestUsingShortToken": "0x88b307205784226a85d084e1bf0c3e06622df16ec059d2c692acefa550314f74", + "shortInterestUsingLongToken": "0xa475e8775389078c5ae6849a60d927f3d47e6d54e5441855b627491d2599f1a8", + "shortInterestUsingShortToken": "0x09ddec38ea468c7db1a56640555e0064eaeefe6bab4288d4380c32e07e559c06", + "longInterestInTokensUsingLongToken": "0xec193359134ccd38eee1f0b6bb1ab8d8a1a00dc4c07d6d76d9a53ff0b44be252", + "longInterestInTokensUsingShortToken": "0x8fad078335f9db5f4d7ae66b79b9dc82f0b2652d9abf59ad0fa7ec7b478d587d", + "shortInterestInTokensUsingLongToken": "0x0d7cf238dacc97315e94aee73fc376bcb231c25662f42f7273ada6633af3a31a", + "shortInterestInTokensUsingShortToken": "0xf3c83fd3c7e8aae1c0b68572465fb4b64f58863998d9ba7dcca2edc71ffbb419" + }, + "0xd783EB54407d6d3A4D5c94b634eC9BAE3F574098": { + "longPoolAmount": "0xa4f92ff9719a98bca9395286567b28f14c1ab38c8b9a5ab67de6d490d8f0928c", + "shortPoolAmount": "0x0a5eec5a5aaca59553263179b46ff86bb7d60ae853b73bcfdaf8cbb4df1d5a9c", + "positionImpactPoolAmount": "0xff9984ae3e3b877022e7a9427388f30308518c28ad3878cd8855a0d37a2dd6ef", + "swapImpactPoolAmountLong": "0x35a58b318d606a1126e5b1fb91d9a267d2c473b75fe754ee57175a681835ce01", + "swapImpactPoolAmountShort": "0xb3fdce367a9b13fb0096034e0121b2c8858707f63115d03a2428d77adca23c47", + "longInterestUsingLongToken": "0x557722d208cdc1337ab05352541d5966f6212e7dd678761b7de0ba8ca0fd8825", + "longInterestUsingShortToken": "0x1250eb0df815a6cb6a57c156c3be5819b83e4456526dfd4732c5eb9f8279cd7d", + "shortInterestUsingLongToken": "0x9e3a2212822dcb7e2a9598396aa02c0d59939fec35a3d7c8c12622bce58cddf9", + "shortInterestUsingShortToken": "0xe2cae0a2b3e08110b60c24b7aa882e7c8b1ecb163c2407befdb2800d3fe4262d", + "longInterestInTokensUsingLongToken": "0xfd6c517a460163a6ef42afdd2eb6b938cd7773647930bbc2051c385511a49535", + "longInterestInTokensUsingShortToken": "0x4597aa6d2bc02145af53babe603e4d6a213f5e3659dbe481eb1518af58af972c", + "shortInterestInTokensUsingLongToken": "0x343e2449b9670adf9deac3fa7cec7ac67811091543669ce5534079633655105e", + "shortInterestInTokensUsingShortToken": "0xc90cb8996482252e639eac413fee3a20f28a92a13fa9c7d7a5b635fd449e8060" + }, + "0x6d72D2787107c32a48bbA4687Eb8F9C19FE5e29C": { + "longPoolAmount": "0xfca694a02583e0b0a8512d582af09a482bfa4facd7ccd5a3cca57fd890c0ded5", + "shortPoolAmount": "0x815c3138a212de901566b5cba62001a50ea36b9839942d2b51224146bb777fc5", + "positionImpactPoolAmount": "0xb102e2419401b598395c7b32516e1693cc43929399be60b3c4fa42021e97340d", + "swapImpactPoolAmountLong": "0x9567abf153309ad088dd5d2a7e0fa532fe0bea4bde60a1a9326e5ec766ebd898", + "swapImpactPoolAmountShort": "0xe6a1012318663694132d4a77de251d8c9b90135215d791fd18657f62c0619722", + "longInterestUsingLongToken": "0xd2faa7f59966b8bb87b7f0632e32f066bca3a7ffb7f0cf1866fa7af9995b46d1", + "longInterestUsingShortToken": "0x9e0bc07500a1f70097e069df29d49ba975e403d8e229e0791a85b4f4da7978b8", + "shortInterestUsingLongToken": "0x86e2116c29caca0ee7bf5e89fc079f928ac029316792cea6d88755b1f5aa0109", + "shortInterestUsingShortToken": "0xbfe5ca8c8aadbf3dd305fe8e73d17d93d17ffa60b8659866a42797813c5c4f1b", + "longInterestInTokensUsingLongToken": "0x99ae28d61c0f6ec441ad0c547dc9c0836c9aa5a6beb96143cfe57e4a72c45af8", + "longInterestInTokensUsingShortToken": "0x4966ae240b0bd95bbd01a8cee6faa84ec28c39b0642d288519290da5fa2a63b5", + "shortInterestInTokensUsingLongToken": "0xa68a2eb008c616b1a5beac935e93dcac0e94d4ea2773875fb711cc64428700cd", + "shortInterestInTokensUsingShortToken": "0x04bd43f31cc3e99b29578b1d984629f6ebf7a573e7682a8d8bd6da11acbad722" + }, + "0x3b649015Fe0a4d15617e57aA11c0FbbfA03A9e11": { + "longPoolAmount": "0x1005e8746abd7433349ced0604f3a4a9eedea422bf1f120186faf0e475342e41", + "shortPoolAmount": "0x1005e8746abd7433349ced0604f3a4a9eedea422bf1f120186faf0e475342e41", + "positionImpactPoolAmount": "0x8cac9a8913051c208ff5824871c5d07ee1f0d8c7bc708fe65eaa02fcc088b437", + "swapImpactPoolAmountLong": "0xf50f38ac448a491ba65210609a1f0a7cda3268d3524d106ab36bd81efe459624", + "swapImpactPoolAmountShort": "0xf50f38ac448a491ba65210609a1f0a7cda3268d3524d106ab36bd81efe459624", + "longInterestUsingLongToken": "0xffe183fb3338ae8e7e1bff3b85fc39903e3767a8e205e2450f1d759e457e2cc7", + "longInterestUsingShortToken": "0xffe183fb3338ae8e7e1bff3b85fc39903e3767a8e205e2450f1d759e457e2cc7", + "shortInterestUsingLongToken": "0xbe88351d2039614aac1dc6e3e27a5a727ffe03e70712ddb2b05a0aa9e4753a9d", + "shortInterestUsingShortToken": "0xbe88351d2039614aac1dc6e3e27a5a727ffe03e70712ddb2b05a0aa9e4753a9d", + "longInterestInTokensUsingLongToken": "0x9d1ef5adb49317422989673690f51d68d0ec7c41357bb13f38488462aafdd083", + "longInterestInTokensUsingShortToken": "0x9d1ef5adb49317422989673690f51d68d0ec7c41357bb13f38488462aafdd083", + "shortInterestInTokensUsingLongToken": "0x6d2e2d0a9bd4003e5775729e41c6b5f04a5fe5760b518e5ba9f112b71572cec5", + "shortInterestInTokensUsingShortToken": "0x6d2e2d0a9bd4003e5775729e41c6b5f04a5fe5760b518e5ba9f112b71572cec5" + } + }, + "43114": { + "0xFb02132333A79C8B5Bd0b64E3AbccA5f7fAf2937": { + "longPoolAmount": "0x716814a6ac79c6e0320ed4fa50bd363d84c05a95a0af6f0905e02dc78cd11f95", + "shortPoolAmount": "0x85b97fa502c860436104f6ab7406500e0c09ebdbc52fa40ab0daf6b9d2c53ffe", + "positionImpactPoolAmount": "0x752e3f2c24d03c373282bd716285982d1e45a6aeb22a4c7662345e82221fe83c", + "swapImpactPoolAmountLong": "0xbbcabf0aaffda781b279fc380bd97f282aedad582bda16d028e37cd2ecfc31dd", + "swapImpactPoolAmountShort": "0x5ce83e31ed0e47c694dab6f2d33d1cfb21acd7c86b21f02ccc93c67ca611f4b6", + "longInterestUsingLongToken": "0x9eda78f16c37abaf780ef19288f64797f683d8467b13edbb4f14145fb8446708", + "longInterestUsingShortToken": "0x47782f01cc9c8230963609f9b3f18c9901b23bb690a44e8299a6a783ea0a41d6", + "shortInterestUsingLongToken": "0x61ac8701663b6fc4021c729e0dc2a8869757434c304b508658c49f979ac1a6cc", + "shortInterestUsingShortToken": "0x014a34d6fdf41318ec15ae02cee2314d96a61c4637c757839bcb92ec31395260", + "longInterestInTokensUsingLongToken": "0xeeb1399381a971bbf4a35cea3f164f348389602f80b87c5f898da96643acf5b7", + "longInterestInTokensUsingShortToken": "0x5a581982d107403e6343793682872545d83cf634056e7fb601580d8a2228f120", + "shortInterestInTokensUsingLongToken": "0x14f89091d80d651658a1a989157cc6a079919ba934661d97745ddf6196a145db", + "shortInterestInTokensUsingShortToken": "0x8ac98627c7989a9fb6e3c8bf3a2ce4e2105f238c80e39f3f5a23169bdf08cb2f" + }, + "0xB7e69749E3d2EDd90ea59A4932EFEa2D41E245d7": { + "longPoolAmount": "0x0177f1ce5a238a8780ca7c19ad0368d2b8b54438f57efc8b057bfd5814410838", + "shortPoolAmount": "0xe70f2293a7bab0c4819e2a463f15bf68071e8b8c0cb0e0c6772b3c0655d3b86a", + "positionImpactPoolAmount": "0x08ec11e59b6a00d3947e1a0cf6fe1ec3ac536a33dc6cdee13ce7a11a64e82362", + "swapImpactPoolAmountLong": "0xd5b34721a34fd1183943ade2c6386e2279f6149679d01cb8f65b5793b5e41da0", + "swapImpactPoolAmountShort": "0x2c794716a99a973cae9470aeab348639cf00e2bfb12101178f07bc0501556712", + "longInterestUsingLongToken": "0x42f03c42f5e51863356781238e9c5de04a49584f8b4f9ac7b685de8f5b11295b", + "longInterestUsingShortToken": "0x7427c3308620ea0893c34dedc6db8c4a462ceb0314626573a35d5cfc8ac8ee31", + "shortInterestUsingLongToken": "0xc88a5bcbfac241895c9c32a7e8cc962045db879af32169d269434e29795e84ab", + "shortInterestUsingShortToken": "0x84e2af4470808e68e84089d842287d0884fee1de5ab21ae5275ec1e9dfaf1d67", + "longInterestInTokensUsingLongToken": "0x2b034a6635f49d2011d0887289b16a2958daabeda55bd99536225ad092c1571b", + "longInterestInTokensUsingShortToken": "0xcd5407806ffe723a26b668e7ec3e676ec935eb9132369e642acccbe798179aa5", + "shortInterestInTokensUsingLongToken": "0xe2a06f8a93a7929661bdb0c83f903dddcfd73afeb5d148f0f91c4f2eacbf4c4e", + "shortInterestInTokensUsingShortToken": "0x75d8a25fe07dca8746049940132b9752c98537eca9b8a238a8e030e0a1f616a8" + }, + "0x8970B527E84aA17a33d38b65e9a5Ab5817FC0027": { + "longPoolAmount": "0x6ba8ae2e921dd0c724c4e2db44cfd0a4f2c963066d4592fe88430f4304f8e75d", + "shortPoolAmount": "0xaba4064d51657efbc89e1232b9f3625e458f2ba941d0265e301aa4050314d675", + "positionImpactPoolAmount": "0x594c22d2cd95bfeb5b511e4f1bfbd6f197133f38e8c20bff7d52429c0c40c370", + "swapImpactPoolAmountLong": "0xab3ecf8ae105da8e55461286e1fb97583f263be88dc834ba642ce66b7a9fcc35", + "swapImpactPoolAmountShort": "0x37149657a6c51fe1b5e30faa447890d55e64b786c2c11424e0d31670062ad362", + "longInterestUsingLongToken": "0x2b07d54f89b654f1be85f4a5b3a4f28dce9ffc82758bc3dc9506cf320b13b51e", + "longInterestUsingShortToken": "0x48249010fcfe88b9a647e0fb41da0847ab43732518d4b1698b65116140919f96", + "shortInterestUsingLongToken": "0xef3d64fbb6b073da9593c69cfe7f556a8719284926d8978a3d664d39670b96f8", + "shortInterestUsingShortToken": "0xfe3939d865c68de3549418dc659def9fdc1bfcf2ee4660cf3efdf5046e7a30d1", + "longInterestInTokensUsingLongToken": "0x406e721d82e972a4e1fe566c7e127151076d0afefaf17cbfc481d212e643b3f1", + "longInterestInTokensUsingShortToken": "0xf8573caeb77ecda80fd8daf62b57c0d1cf5375c51af59ada186f68cbd2a956c6", + "shortInterestInTokensUsingLongToken": "0x381df5eb9798bfbd527d25470112b708900c5bb5802679704f92b225f373e852", + "shortInterestInTokensUsingShortToken": "0x4198a2753f05279c23064da4ffb7c8d9d6491145c3de89a1ce5d1cd1d7d140c1" + }, + "0xd2eFd1eA687CD78c41ac262B3Bc9B53889ff1F70": { + "longPoolAmount": "0x3f46af607f8afd2fe2b409df651b4b682916a3abfb0c94dc552c29bb3893bf13", + "shortPoolAmount": "0x931f805d17605d4ea8d5990ff882e7b8a549adde19d9a61cb6a821826e4eeeb3", + "positionImpactPoolAmount": "0x907ba49f46f2bdfde23d79ccd65d49af16222c2e33b5ee14d1fac14ed7a387ab", + "swapImpactPoolAmountLong": "0x996ba822bce3712d294f2ce95545ef3cbf2fa5b921886ed1cf2b89204b2a785a", + "swapImpactPoolAmountShort": "0x412724d56ac97ad68f1ecb11f3b4d0fb724c9e75eb4838c15b82356914d806f8", + "longInterestUsingLongToken": "0xcde55df5d51210ee288084d2b58e1527c48c6dbe06586d657535f2c3991003e7", + "longInterestUsingShortToken": "0xb0869173c3d30ba6f01b35718440f2b0e57366d57b1f3757c01bec423ab391f4", + "shortInterestUsingLongToken": "0x5a156b912d3a2f777d1897e0a6318e2263322a53b0cd622ec5f8b827a039e67f", + "shortInterestUsingShortToken": "0xb4f073389f339cf6a4377f3d3496e93627da0ab0e5b84cd13b9ed5ad49051f38", + "longInterestInTokensUsingLongToken": "0xb63ab0df13823c542b934d4c96fbb8848c57bfd2326817ba0ff38d4b2fc4439d", + "longInterestInTokensUsingShortToken": "0x577c35a45350b8de34d5782ad3d3e74f51a7b615ce43abd5f3582097ee2cbf4a", + "shortInterestInTokensUsingLongToken": "0x416a1a1801e4c5dbaf66dcfd96dd870f3bff8ffac4740e002dbe84cf0755a1b4", + "shortInterestInTokensUsingShortToken": "0x88114709bd7026c864914bd140a2e8272b761c11b7a9ef30496c518598edb49f" + }, + "0xA74586743249243D3b77335E15FE768bA8E1Ec5A": { + "longPoolAmount": "0x53d28ede66276c45eca967b862248d26bd65ff246eedde80acf087abbbd95942", + "shortPoolAmount": "0x44eea209ec3f6ef357932e4f6f48d3cbe400d69379252127e7ba7820a50b6fd0", + "positionImpactPoolAmount": "0x7f5d3e8d1bf8737aa8df401a880c57ad28ba267381e4a8b85d4f557df3d4021e", + "swapImpactPoolAmountLong": "0x701262ad8faac6a1cff4bdb7f51dac51d281c6ef010573a3e83f15070ad837c5", + "swapImpactPoolAmountShort": "0xb25db1375430234332a262da4d18e13ad0fcfcff3498d92bfb4a3e6275b048ca", + "longInterestUsingLongToken": "0xb2c70fa1d548f75fae9088cccc6f649ce7ecd2acd4dbe3363c25386f8eda413e", + "longInterestUsingShortToken": "0xb9765be581c00be6c9c8abfac0ea0140493d83c8a4281f66116d4a8e4d797298", + "shortInterestUsingLongToken": "0x8424965975710a54384f26e8a1876ad17fae0312dfd3c26f80782d5d3a36ac9c", + "shortInterestUsingShortToken": "0xfc6bc7f9b53003fdf72ab52d8e23888f2d1b193bfb6a94a57ac9b0023cf65ee0", + "longInterestInTokensUsingLongToken": "0x031deb73811d331dd098c67cd0576989f05d89459d87972f99de2a1b149cebe2", + "longInterestInTokensUsingShortToken": "0x7880dfe01e8940c13a1b24b93059b50fc4d257053c503ae5b4c412fcafc017c9", + "shortInterestInTokensUsingLongToken": "0x8ca01430756a9e5ce3a00d17aea185d09642aa52f161f7498b8a8af20f035464", + "shortInterestInTokensUsingShortToken": "0x3f738471f4630df728fbbfb6a79cf40929ca69af9ec316ccccb8187d14b6d88a" + }, + "0x913C1F46b48b3eD35E7dc3Cf754d4ae8499F31CF": { + "longPoolAmount": "0x977d8e4c6a301b9d31f3784774724c045ad06033e666f687743de8cf61efce48", + "shortPoolAmount": "0x64b93649fd01c41f9e356ab55257f4d733adc7a6ba72885ea739ce91b1c7fa48", + "positionImpactPoolAmount": "0xed6551e61a9e1a04d735b40b41386dd9398307e9ff773bc8dd31b026edc2e5ef", + "swapImpactPoolAmountLong": "0xefbd1509845b40a1d59abc2fdab715ab8a91b085718a0500e418731d0eb61796", + "swapImpactPoolAmountShort": "0x60262b257fbd0c60d1be8d31e07b393d2439e7d77e719975c6ecf0975df67310", + "longInterestUsingLongToken": "0x482aaae8f5079e501fe18b0d19f7f50a74ec5475cbbc7067c408a8e1d931fead", + "longInterestUsingShortToken": "0x996dc0919e9aa4d2edc6f1c051052c81b243938a92d892aed9e77073c9ceee97", + "shortInterestUsingLongToken": "0xafb7293af44df829db7078903b878c64143ba7424c6128f27e0b7dd13d0987da", + "shortInterestUsingShortToken": "0x1ba8d75e09d834963f4f97914e32dfd1d3b86aa7eef5d48291243f35ac14fac0", + "longInterestInTokensUsingLongToken": "0xb31d2e30520cf81e8fd4a749be46e92d728820de3276ce3f741d8e19decf33e2", + "longInterestInTokensUsingShortToken": "0x04a6804a0fabe7bd68b538d772c24c613a8e4118c8660464c9518acd028887df", + "shortInterestInTokensUsingLongToken": "0xe3f5a53eeab64560ce52d6d5d771baeccedf2529e189c46ccf99ffd18814b4b7", + "shortInterestInTokensUsingShortToken": "0xf08714d7d0ff12d100c245dd3218a49656d4861a58e9691f6e578271b594cad5" + }, + "0xf3652Eba45DC761e7ADd4091627d5Cda21F61613": { + "longPoolAmount": "0x51ac64aa85af2a367a558ae86ee74b4dfe8b85041784ede67ddfe39196cc1050", + "shortPoolAmount": "0xc71225088443c2dab183a61df55fc1a9cda88901c52842c8ebb325b64e105f14", + "positionImpactPoolAmount": "0x836a7ec0edca17891d62eca91103547b06ede3383997082a8da37b77af2a14b6", + "swapImpactPoolAmountLong": "0xa1cb3975cb0ef93cbeea11226bb96f64b79362398f54b1d34bdc54e3ffe55f4b", + "swapImpactPoolAmountShort": "0xac7e59b002b35d20a6cec707f3b3def9b449d2787f17449c40c6887890269ea4", + "longInterestUsingLongToken": "0xa2225306bd161a9b5ca3439b98dc701ab28a96870947f97bb5e96588cf7250b1", + "longInterestUsingShortToken": "0xbe38ee8bdd7b44a97be40e9732f9b9fe1f5534d57b743ffa579b9292e5a20959", + "shortInterestUsingLongToken": "0x48842c4f19351ebc45bb50a8297a65190bc8651f627646dd6d16a27998041308", + "shortInterestUsingShortToken": "0xd25e2c0005dd0cb82d16b919cf96a404b96cc3c448b654e458d267fea2d806d2", + "longInterestInTokensUsingLongToken": "0x2c43c20acba6ac045c5ce652a43f83eda34a2079bfd030cca1ed50b6129e30a3", + "longInterestInTokensUsingShortToken": "0x73a4da3e67611ba922745515ffcb3d4021b2a958142359c2094753151226ef9e", + "shortInterestInTokensUsingLongToken": "0x0eb51f226f85b2eb7a56c4f9a95884fae09cffe79541161b34cb736aa462f739", + "shortInterestInTokensUsingShortToken": "0x8cea9cfefa008844cedff63a972a200f9df6755e720c1b6e35bf853d810ad051" + }, + "0x297e71A931C5825867E8Fb937Ae5cda9891C2E99": { + "longPoolAmount": "0x1431f8d023a8bef1e79a2c1f3eaa22cd089baa01ba229132ec0d1ef7218842c3", + "shortPoolAmount": "0x97d3a2cf6a70d7b6cfb10981731bf5ed097eb829d8ad8dea03199f3373ebb036", + "positionImpactPoolAmount": "0x33158f1d7b3d297cf6113ce724cd55bfe72d8d89ea8b5f2fa435c9586d0ce304", + "swapImpactPoolAmountLong": "0xa3a0de6e568c618aacd78d77ef1155041800e7c395a251cb55bf2d8d530993df", + "swapImpactPoolAmountShort": "0x1ee4d31bd0b43edf275e974f7365d7db98d154c4ff26234bd1bc966ccc173682", + "longInterestUsingLongToken": "0x14287a3e87265da2b3898304c738bfaa8a84d685e378431458118d12a51c6781", + "longInterestUsingShortToken": "0xe2e7e55129ad772ba0bad92d27350f37aa99c8c5317d8876c81430e5fd98b76a", + "shortInterestUsingLongToken": "0x567fb4789f69ba3b441020f100de0ab8e5be8e2f2845f9472a61cf2b574e0c77", + "shortInterestUsingShortToken": "0x21a76ecffe3c297c63f6c32d6d4254e9a40aae581db4cd889edf789d8d02ac5b", + "longInterestInTokensUsingLongToken": "0xd334f25cc0f417e56c428149b182d02ff239126cf2ca66d0bd4f698c36173655", + "longInterestInTokensUsingShortToken": "0x41b41f42ee2719b79d2a906379788fbf1b9f738a97e079b8d5c040d764d6919f", + "shortInterestInTokensUsingLongToken": "0xd2b5e7031c197729cb8b4e49fa70bf17b0368cdb5bb7d579a9e8513af67f4bea", + "shortInterestInTokensUsingShortToken": "0x198d3ecee49370c6cb7e4071452fad228ec13ad43f5ee76db81911a640dc69a0" + }, + "0xA7b768d6a1f746fd5a513D440DF2970ff099B0fc": { + "longPoolAmount": "0x99bfbea264923dcb47f7f261d2a3e511ce1a325dd5afb99973ce459c2c14c5ac", + "shortPoolAmount": "0x3850a3269b9fe0c4b5401c9e592a585821af973c10e4a46070d1066b8c3f924a", + "positionImpactPoolAmount": "0xb9009b0105999761a012e8dc39ac1c8049a299588a8b18b9ca6b60bc8d0942af", + "swapImpactPoolAmountLong": "0xd9bff165ce1fe3231a90695b55ff7d263a5e5598b25041cd49b0522ec2f5d69a", + "swapImpactPoolAmountShort": "0xd1a9895358ea6a52ec73ee516ec6aeb77c8bbf1e6d804f3cf8916cf25c2df8da", + "longInterestUsingLongToken": "0xb27e2599e70fafd41bbc4b8d52a9e4fd086ce44e41f2d4a7fa4757b8db196da6", + "longInterestUsingShortToken": "0xccb56f0d1c0f5206ddf1b5bcdab2f0f98eeebd50b666d83815017863cf9eb119", + "shortInterestUsingLongToken": "0x416c7caec347fc342d9fe2b8ac185b13d725ea2356a091747f71d083a04cdd3b", + "shortInterestUsingShortToken": "0x0fee3ed7c2ac0935bcd584b8bde4081ce8687c8a4eaa57e0d45f562108812d25", + "longInterestInTokensUsingLongToken": "0x81cd6b979cfbb3f7d88f17f2c0a1e320f0c3e3c27dc8291c13b865d01e287b8b", + "longInterestInTokensUsingShortToken": "0x0de165a505d602b8e9535037e38da944bc173addcf03482516b2649ce632f400", + "shortInterestInTokensUsingLongToken": "0x407be4ffb112593c1403da3e73160b4501304c727d3bd91b31eedfd9d653db30", + "shortInterestInTokensUsingShortToken": "0x1faa819022fc74d1c3e17cc95b4e51b00f9670b7bb9b584c0c93c957b8ae3980" + }, + "0xDf8c9BD26e7C1A331902758Eb013548B2D22ab3b": { + "longPoolAmount": "0x68a80300672e2b226ab3a9ce944b02978d998c8b4ff06090d9f2631a7a9a1d0a", + "shortPoolAmount": "0x575b96ad077f1dd1842b927b6f135bdfd4d22024cb259dad11890dc8bc05bce6", + "positionImpactPoolAmount": "0x8f80c1f6fb60a0097805d078f3f7fc36ba4f8ba3fba721361202a9d04644c55b", + "swapImpactPoolAmountLong": "0xa5efca8f6ba190b7cb51ffac97c05bf793775c4eb6562d0f73dc729cb96ca53c", + "swapImpactPoolAmountShort": "0x069199a6be24e87023b67854516bb9f0f38d57136e0f43f96fd92521b657f773", + "longInterestUsingLongToken": "0xd014a09bcfd92ba7937f63e2469eefed5e603b853ddb6043b5e175ea18fe258b", + "longInterestUsingShortToken": "0x952cce536203c3b3c85030a54fc3ac96d02a8decd54243312f1234509cf519d5", + "shortInterestUsingLongToken": "0x4ab2ce14b07c12b840c6e841c988ce457047531a30d241d22546c59cf0e62428", + "shortInterestUsingShortToken": "0x8e36c4cfb37bafaae24a84cbda0aa27e26a44c622d18035f0e49bc0a6e1e9219", + "longInterestInTokensUsingLongToken": "0x2d7557227fca93651958b2338080f195a195ac2a2b5093621e7b359be4cbd67e", + "longInterestInTokensUsingShortToken": "0xd7a8bdf7dfc036834452f9ea434341d02f90af321a91b287d149463c9a2e0921", + "shortInterestInTokensUsingLongToken": "0x907b9b4299b042832511059aa90ce22b6a1d73ed5521147af3765c0cd30f7b1b", + "shortInterestInTokensUsingShortToken": "0xd44076881044ab891106ffefe0d090d1db08d9011d77a0e672da3ce97bd5531a" + }, + "0xD1cf931fa12783c1dd5AbB77a0706c27CF352f25": { + "longPoolAmount": "0xfc5154bb1205943a6a3e7be6f56b7fa07e3ca961166bc5a018cbe6052f6c8ec9", + "shortPoolAmount": "0xe3d8b45013aec3076f050e63b7f686746868d9670ec2576fac99082501bbe949", + "positionImpactPoolAmount": "0xb771436c5bc67fc65dd80de3651ca16672d2bb8df229e91318f6027c0a1ce536", + "swapImpactPoolAmountLong": "0xaf0a4f698367eb9e52b0f993fe26590d3ebbbf856194671a4a6b3605b7c96cac", + "swapImpactPoolAmountShort": "0x0fd5ad178f184dfc5530d141f1b634e94aec8cb199a2c4d048dfc6543fa4def5", + "longInterestUsingLongToken": "0x39f44bb935ea80585daabfb14583901d4d768e43add616433a7b7c600fa7b171", + "longInterestUsingShortToken": "0x58ffb7e76d95438cdf82f0552c6ecb8d1805ca6a73b133917930dc4ad004a262", + "shortInterestUsingLongToken": "0xeef2ac9fae1bc5720c97aeb6c60743848a729721040a7eddd7826c7d8009d0ee", + "shortInterestUsingShortToken": "0xa11bc4426b79896146449031a837ae88c9246513fbdd2a1d7f90627aa85705c9", + "longInterestInTokensUsingLongToken": "0xc90df85d68a733c5d38217c3ab5b2822ef28adef5f5b0f702b633ffa80a14a33", + "longInterestInTokensUsingShortToken": "0xc0db03d6836d3b53af4d304557e04afc40c144819191c7380c0f7cdd73efe660", + "shortInterestInTokensUsingLongToken": "0x23d9a2abe72b333ce80d83787b763b13135d3cb072f1d87aac726d3d0a7537aa", + "shortInterestInTokensUsingShortToken": "0xac90db70c55a52e51e2ffca6c5244ef4fed9a8a016b3631d22a8624b0ec6acd0" + }, + "0x3ce7BCDB37Bf587d1C17B930Fa0A7000A0648D12": { + "longPoolAmount": "0x8bf0be07adbe510161d0070bddc4b69a465e71244201d4df105d2804cfdb3d6b", + "shortPoolAmount": "0x8bf0be07adbe510161d0070bddc4b69a465e71244201d4df105d2804cfdb3d6b", + "positionImpactPoolAmount": "0xfcb742b6a1ea0d437ef61ff7932928918ac32eb85a2c9d6cf7a2b02ea4e1e0d1", + "swapImpactPoolAmountLong": "0x87d914a411ff594aab84f7acd03b6ed874ea54a86187e58622142210e427c2f0", + "swapImpactPoolAmountShort": "0x87d914a411ff594aab84f7acd03b6ed874ea54a86187e58622142210e427c2f0", + "longInterestUsingLongToken": "0xe59e882d70c002d46731e370b398d0f978b8e138745acecbee4afeeb28455898", + "longInterestUsingShortToken": "0xe59e882d70c002d46731e370b398d0f978b8e138745acecbee4afeeb28455898", + "shortInterestUsingLongToken": "0x176b86891763cb0c660b3e8336c16f8fd57789818b9a113e5ded9ddbb8d1b453", + "shortInterestUsingShortToken": "0x176b86891763cb0c660b3e8336c16f8fd57789818b9a113e5ded9ddbb8d1b453", + "longInterestInTokensUsingLongToken": "0xf99a1d10c256dc8e91420500a3ad5160686ae48cfec8a21c1fd959bdc9a6bf18", + "longInterestInTokensUsingShortToken": "0xf99a1d10c256dc8e91420500a3ad5160686ae48cfec8a21c1fd959bdc9a6bf18", + "shortInterestInTokensUsingLongToken": "0xce397dad659289ad9465f505bc04ce9e1959a4729745233053256af4a7a28f16", + "shortInterestInTokensUsingShortToken": "0xce397dad659289ad9465f505bc04ce9e1959a4729745233053256af4a7a28f16" + }, + "0x2A3Cf4ad7db715DF994393e4482D6f1e58a1b533": { + "longPoolAmount": "0x01046459928de1748aaa96ee7e287fd339b9cd4174441c456865308c9750bf07", + "shortPoolAmount": "0x01046459928de1748aaa96ee7e287fd339b9cd4174441c456865308c9750bf07", + "positionImpactPoolAmount": "0xf0ea0d7426d5e55cc7a39e79dc9ee19ffb18cb5881a146465478633a09f1d96d", + "swapImpactPoolAmountLong": "0x36b459e6a75ccb3dfc65abe23aa47bdc33d752b3bff21a5b87549310a8babe7c", + "swapImpactPoolAmountShort": "0x36b459e6a75ccb3dfc65abe23aa47bdc33d752b3bff21a5b87549310a8babe7c", + "longInterestUsingLongToken": "0x054903aa3aec32995b0ca7342fe9384f694155615fb5bd9b762153aada5c997e", + "longInterestUsingShortToken": "0x054903aa3aec32995b0ca7342fe9384f694155615fb5bd9b762153aada5c997e", + "shortInterestUsingLongToken": "0x05a3ab83ed2f7927739bd36bbd324d25a0be71390f1d4c73fd5e41270bb2ab36", + "shortInterestUsingShortToken": "0x05a3ab83ed2f7927739bd36bbd324d25a0be71390f1d4c73fd5e41270bb2ab36", + "longInterestInTokensUsingLongToken": "0xdc73ca7dea52ed182830f2759f5e3f97bbbd86b7133001e7178384d1676d1a67", + "longInterestInTokensUsingShortToken": "0xdc73ca7dea52ed182830f2759f5e3f97bbbd86b7133001e7178384d1676d1a67", + "shortInterestInTokensUsingLongToken": "0x8b87a5cbdcb7605c030854a0df2906733ea89e975ffff22a2e9d81324c29a78e", + "shortInterestInTokensUsingShortToken": "0x8b87a5cbdcb7605c030854a0df2906733ea89e975ffff22a2e9d81324c29a78e" + }, + "0x08b25A2a89036d298D6dB8A74ace9d1ce6Db15E5": { + "longPoolAmount": "0xa0012718a3d547591594acf3d106cb7a185259bbce3dbf6ef161b00f9e3e4eb8", + "shortPoolAmount": "0xa0012718a3d547591594acf3d106cb7a185259bbce3dbf6ef161b00f9e3e4eb8", + "positionImpactPoolAmount": "0xb618194d235645883c2e4ea217f9ade6936a355434bd21b1eb363007f0f30ac1", + "swapImpactPoolAmountLong": "0x8fdd43d948aed57caa0b6b1921f639de6fd49d547fb983ea98dbd0d2530bdae9", + "swapImpactPoolAmountShort": "0x8fdd43d948aed57caa0b6b1921f639de6fd49d547fb983ea98dbd0d2530bdae9", + "longInterestUsingLongToken": "0x4081eb12642b41e2b0db8d864ae26993232cec97c6adf92a472dc968a4e21391", + "longInterestUsingShortToken": "0x4081eb12642b41e2b0db8d864ae26993232cec97c6adf92a472dc968a4e21391", + "shortInterestUsingLongToken": "0xbdd3dcdd3d2a177baefc26a7a77de3c5f4768f651bf18b9455337ac88edd6419", + "shortInterestUsingShortToken": "0xbdd3dcdd3d2a177baefc26a7a77de3c5f4768f651bf18b9455337ac88edd6419", + "longInterestInTokensUsingLongToken": "0xb7f3f037e09c16698a54b0dd3602b7c179985fb2489b3447b2be1939fffcbb2d", + "longInterestInTokensUsingShortToken": "0xb7f3f037e09c16698a54b0dd3602b7c179985fb2489b3447b2be1939fffcbb2d", + "shortInterestInTokensUsingLongToken": "0x8354ede027b1822d4509b9d00c915d4b016cdeb827fa331aee01da14cac86e64", + "shortInterestInTokensUsingShortToken": "0x8354ede027b1822d4509b9d00c915d4b016cdeb827fa331aee01da14cac86e64" + }, + "0xfB626c4e3E153947A6A94041814c25E449064dAD": { + "longPoolAmount": "0xdb41e477f9f2c58f74419e54873adca920c8c09bca080fcb453d9f544925a8a0", + "shortPoolAmount": "0xf2790cb0ebcd386130be0805626dbbf86f55def3e643da400eebeab7bd26d670", + "positionImpactPoolAmount": "0x07456fcd2b42abffad656c4326a09e7ae6882fa149485659b74e9dae770cda70", + "swapImpactPoolAmountLong": "0xb7852402c2fc9f0a5022c821b536365b11ad5a392dc1b4fc35f1e98121c8603f", + "swapImpactPoolAmountShort": "0xc086fbd44e41535eff0905f497fd419e83f2a1754ea7a3743eb4d39aca5f09bd", + "longInterestUsingLongToken": "0xbf03a9c446b558d1798349d274a330c6033d9cec2fbc5b24d32e23b608f15b33", + "longInterestUsingShortToken": "0xb78f4ca16d9f5284546089393f87cb2f7ab451007602a25d40666c6d70daea9c", + "shortInterestUsingLongToken": "0x2eff06d135647b07d4073af205904363b10dae13ab079242a2af295b9b28647c", + "shortInterestUsingShortToken": "0x020fdefe183d8395c277a5854a0a6f8658a612e30c065ad9e3980c6e93579d40", + "longInterestInTokensUsingLongToken": "0x76efcd7a1cbc8b172bffa86255e802efe23725a5f6a3803430eb0266411f6a5b", + "longInterestInTokensUsingShortToken": "0xe307718b388cc83cb46c28e3da33a165e0e2a769139e854f38aff534b5eb3a84", + "shortInterestInTokensUsingLongToken": "0x38f7ed606b75bf4a5a09e6b6d12fe3a249bd9bf727f4eaa32531095b53be72e0", + "shortInterestInTokensUsingShortToken": "0x8b12e3094cec1f77605d7161f758b27cfd9745521b33104ea66e999278946fd7" + }, + "0xe19da27Bf9733c429445E289B662bECDCa6ce10b": { + "longPoolAmount": "0x46ccffb18fc764abf84a9df3a470de2072f1ca891ee58a86c09d820e7ba60f9a", + "shortPoolAmount": "0x897403f9f1faeca64a7bc4754152cbeb1941358522de959b4e326b087e5cf00c", + "positionImpactPoolAmount": "0x3f053e231fd75b0e63a3cc5bdc91ff1b929904b4526a0b0dd7cc017c50799007", + "swapImpactPoolAmountLong": "0x045f8c8c6129d3d0aa4f2017ebcc8c4ce721927d3e295e19d9d542f1d08c6728", + "swapImpactPoolAmountShort": "0x4052d007055610ee7292ed825370f897d50d9102a3736a1ff1215274118d3b19", + "longInterestUsingLongToken": "0xf7a0d943fa74397edcccf178186a84a0031ed7cb8d2df1a33430439dd659fabc", + "longInterestUsingShortToken": "0x6825e04bb6514ebdebaf2f8fcb7f65242761b1adb1498017eec64120a1a42b58", + "shortInterestUsingLongToken": "0x1aa30f17231d4faa1582902cf7922561e93befe9c96b247b8ffa7b8a59681c47", + "shortInterestUsingShortToken": "0xd3dbed0489cd270df26efd40d6c36e3147d582722173c0ef7d960458b17ab9cb", + "longInterestInTokensUsingLongToken": "0xcfebfb7dfb13c2411f2448ffeaf01ffd16c16bc261a59ca7a69fe5bb7e3f115b", + "longInterestInTokensUsingShortToken": "0xaf01e4f4a7b0884f217695d374acc70a5904db6d460bc5c5d31591557300f689", + "shortInterestInTokensUsingLongToken": "0x562b9a09cca894aa54f6d4b17a72fe7e9c4ddc4686516dcfd15a597f3eec7ee3", + "shortInterestInTokensUsingShortToken": "0xc563cc005593b275e1c8e42f993a0b8df38c5d1634f6867ece778bea7be36823" + } + } +} \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/index.ts new file mode 100644 index 0000000..b00423f --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/prebuilt/index.ts @@ -0,0 +1,44 @@ +/** + * Json files in this directory are prebuild by scripts from the `scripts/prebuild` directory. + * No need to edit them manually, use `yarn run prebuild` command instead. + */ +import hashedMarketValuesKeysJson from "./hashedMarketValuesKeys.json" with { type: "json" }; +import hashedMarketConfigKeysJson from "./hashedMarketConfigKeys.json" with { type: "json" }; +import hashedKinkModelMarketRatesKeys from "./hashedKinkModelMarketRatesKeys.json" with { type: "json" }; +import { + KinkModelMarketRateMulticallRequestConfig, + MarketConfigMulticallRequestConfig, + MarketValuesMulticallRequestConfig, +} from "../modules/markets/types.js"; + +type HashedMarketValuesKeys = Omit< + Record, + "claimableFundingAmountLong" | "claimableFundingAmountShort" +>; + +const HASHED_MARKET_VALUES_KEYS: { + [chainId: number]: { + [marketToken: string]: HashedMarketValuesKeys; + }; +} = hashedMarketValuesKeysJson; + +type HashedMarketConfigKeys = Record; + +const HASHED_MARKET_CONFIG_KEYS: { + [chainId: number]: { + [marketToken: string]: HashedMarketConfigKeys; + }; +} = hashedMarketConfigKeysJson; + +type HashedKinkModelMarketRatesConfigKeys = Record< + keyof KinkModelMarketRateMulticallRequestConfig[`${string}-dataStore`]["calls"], + string +>; + +const HASHED_KINK_MODEL_MARKET_RATES_KEYS: { + [chainId: number]: { + [marketToken: string]: HashedKinkModelMarketRatesConfigKeys; + }; +} = hashedKinkModelMarketRatesKeys; + +export { HASHED_MARKET_VALUES_KEYS, HASHED_MARKET_CONFIG_KEYS, HASHED_KINK_MODEL_MARKET_RATES_KEYS }; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/common.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/common.ts new file mode 100644 index 0000000..cf01fb6 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/common.ts @@ -0,0 +1 @@ +export type BytesLike = string | Uint8Array; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/fees.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/fees.ts new file mode 100644 index 0000000..90d1f74 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/fees.ts @@ -0,0 +1,45 @@ +import { ExternalSwapAggregator } from "./trade.js"; +import { Token } from "./tokens.js"; + +export type ExecutionFee = { + feeUsd: bigint; + feeTokenAmount: bigint; + feeToken: Token; + gasLimit: bigint; + isFeeHigh: boolean; + isFeeVeryHigh: boolean; +}; + +export type FeeItem = { + deltaUsd: bigint; + bps: bigint; + precisePercentage: bigint; +}; + +export type SwapFeeItem = FeeItem & { + marketAddress: string; + tokenInAddress: string; + tokenOutAddress: string; +}; + +export type ExternalSwapFeeItem = FeeItem & { + aggregator: ExternalSwapAggregator; + tokenInAddress: string; + tokenOutAddress: string; +}; + +export type GasLimitsConfig = { + depositToken: bigint; + withdrawalMultiToken: bigint; + shift: bigint; + singleSwap: bigint; + swapOrder: bigint; + increaseOrder: bigint; + decreaseOrder: bigint; + estimatedGasFeeBaseAmount: bigint; + estimatedGasFeePerOraclePrice: bigint; + estimatedFeeMultiplierFactor: bigint; + glvDepositGasLimit: bigint; + glvWithdrawalGasLimit: bigint; + glvPerMarketGasLimit: bigint; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/markets.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/markets.ts new file mode 100644 index 0000000..a0d6b2f --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/markets.ts @@ -0,0 +1,174 @@ +import { TokenData } from "./tokens"; + +export type PnlFactorType = "FOR_DEPOSITS" | "FOR_WITHDRAWALS" | "FOR_TRADERS"; + +export type MarketSdkConfig = { + marketToken: string; + indexToken: string; + longToken: string; + shortToken: string; + isListed: boolean; +}; + +export type Market = { + marketTokenAddress: string; + indexTokenAddress: string; + longTokenAddress: string; + shortTokenAddress: string; + isSameCollaterals: boolean; + isSpotOnly: boolean; + name: string; + data: string; +}; + +export type MarketPoolTokens = { + longToken: TokenData; + shortToken: TokenData; + indexToken: TokenData; +}; + +export type MarketInfo = Market & + MarketPoolTokens & { + isDisabled: boolean; + + longPoolAmount: bigint; + shortPoolAmount: bigint; + + maxLongPoolAmount: bigint; + maxShortPoolAmount: bigint; + maxLongPoolUsdForDeposit: bigint; + maxShortPoolUsdForDeposit: bigint; + + longPoolAmountAdjustment: bigint; + shortPoolAmountAdjustment: bigint; + + poolValueMax: bigint; + poolValueMin: bigint; + + reserveFactorLong: bigint; + reserveFactorShort: bigint; + + openInterestReserveFactorLong: bigint; + openInterestReserveFactorShort: bigint; + + maxOpenInterestLong: bigint; + maxOpenInterestShort: bigint; + + borrowingFactorLong: bigint; + borrowingFactorShort: bigint; + borrowingExponentFactorLong: bigint; + borrowingExponentFactorShort: bigint; + + fundingFactor: bigint; + fundingExponentFactor: bigint; + fundingIncreaseFactorPerSecond: bigint; + fundingDecreaseFactorPerSecond: bigint; + thresholdForStableFunding: bigint; + thresholdForDecreaseFunding: bigint; + minFundingFactorPerSecond: bigint; + maxFundingFactorPerSecond: bigint; + + totalBorrowingFees: bigint; + + positionImpactPoolAmount: bigint; + minPositionImpactPoolAmount: bigint; + positionImpactPoolDistributionRate: bigint; + + minCollateralFactor: bigint; + minCollateralFactorForOpenInterestLong: bigint; + minCollateralFactorForOpenInterestShort: bigint; + + swapImpactPoolAmountLong: bigint; + swapImpactPoolAmountShort: bigint; + + maxPnlFactorForTradersLong: bigint; + maxPnlFactorForTradersShort: bigint; + + claimableFundingAmountLong?: bigint; + claimableFundingAmountShort?: bigint; + + longInterestUsd: bigint; + shortInterestUsd: bigint; + longInterestInTokens: bigint; + shortInterestInTokens: bigint; + + positionFeeFactorForPositiveImpact: bigint; + positionFeeFactorForNegativeImpact: bigint; + positionImpactFactorPositive: bigint; + positionImpactFactorNegative: bigint; + maxPositionImpactFactorPositive: bigint; + maxPositionImpactFactorNegative: bigint; + maxPositionImpactFactorForLiquidations: bigint; + positionImpactExponentFactor: bigint; + + swapFeeFactorForPositiveImpact: bigint; + swapFeeFactorForNegativeImpact: bigint; + swapImpactFactorPositive: bigint; + swapImpactFactorNegative: bigint; + swapImpactExponentFactor: bigint; + + borrowingFactorPerSecondForLongs: bigint; + borrowingFactorPerSecondForShorts: bigint; + + fundingFactorPerSecond: bigint; + longsPayShorts: boolean; + + virtualPoolAmountForLongToken: bigint; + virtualPoolAmountForShortToken: bigint; + virtualInventoryForPositions: bigint; + + virtualMarketId: string; + virtualLongTokenId: string; + virtualShortTokenId: string; + }; + +export type MarketsData = { + [marketTokenAddress: string]: Market; +}; + +export type MarketsInfoData = { + [marketAddress: string]: MarketInfo; +}; + +export type MarketTokensAPRData = { + [marketTokenAddress: string]: bigint; +}; + +export type UserEarningsData = { + byMarketAddress: { + [marketTokenAddress: string]: { + total: bigint; + recent: bigint; + }; + }; + + allMarkets: { + total: bigint; + recent: bigint; + expected365d: bigint; + }; +}; + +export type ContractMarketPrices = { + indexTokenPrice: { + min: bigint; + max: bigint; + }; + longTokenPrice: { + min: bigint; + max: bigint; + }; + shortTokenPrice: { + min: bigint; + max: bigint; + }; +}; + +export type ClaimableFunding = { + claimableFundingAmountLong: bigint; + claimableFundingAmountShort: bigint; +}; + +export type ClaimableFundingData = { + [marketAddress: string]: ClaimableFunding; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/orders.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/orders.ts new file mode 100644 index 0000000..c781906 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/orders.ts @@ -0,0 +1,94 @@ +import { MarketInfo } from "./markets"; +import { TokenData, TokensRatio, TokensRatioAndSlippage } from "./tokens"; +import { SwapPathStats, TriggerThresholdType } from "./trade"; + +export enum OrderType { + // the order will be cancelled if the minOutputAmount cannot be fulfilled + MarketSwap = 0, + // @dev LimitSwap: swap token A to token B if the minOutputAmount can be fulfilled + LimitSwap = 1, + // @dev MarketIncrease: increase position at the current market price + // the order will be cancelled if the position cannot be increased at the acceptablePrice + MarketIncrease = 2, + // @dev LimitIncrease: increase position if the triggerPrice is reached and the acceptablePrice can be fulfilled + LimitIncrease = 3, + // @dev MarketDecrease: decrease position at the curent market price + // the order will be cancelled if the position cannot be decreased at the acceptablePrice + MarketDecrease = 4, + // @dev LimitDecrease: decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled + LimitDecrease = 5, + // @dev StopLossDecrease: decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled + StopLossDecrease = 6, + // @dev Liquidation: allows liquidation of positions if the criteria for liquidation are met + Liquidation = 7, + // @dev StopIncrease: increase position if the triggerPrice is reached and the acceptablePrice can be fulfilled + StopIncrease = 8, +} + +export enum SwapPricingType { + TwoStep = 0, + Shift = 1, + Atomic = 2, +} + +export enum DecreasePositionSwapType { + NoSwap = 0, + SwapPnlTokenToCollateralToken = 1, + SwapCollateralTokenToPnlToken = 2, +} + +export type Order = { + key: string; + account: string; + callbackContract: string; + initialCollateralTokenAddress: string; + marketAddress: string; + decreasePositionSwapType: DecreasePositionSwapType; + receiver: string; + swapPath: string[]; + contractAcceptablePrice: bigint; + contractTriggerPrice: bigint; + callbackGasLimit: bigint; + executionFee: bigint; + initialCollateralDeltaAmount: bigint; + minOutputAmount: bigint; + sizeDeltaUsd: bigint; + updatedAtTime: bigint; + isFrozen: boolean; + isLong: boolean; + orderType: OrderType; + shouldUnwrapNativeToken: boolean; + autoCancel: boolean; + data: string; + title?: string; +}; + +export type SwapOrderInfo = Order & { + swapPathStats?: SwapPathStats; + triggerRatio?: TokensRatio | TokensRatioAndSlippage; + initialCollateralToken: TokenData; + targetCollateralToken: TokenData; +}; + +export type PositionOrderInfo = Order & { + marketInfo: MarketInfo; + swapPathStats?: SwapPathStats; + indexToken: TokenData; + initialCollateralToken: TokenData; + targetCollateralToken: TokenData; + acceptablePrice: bigint; + triggerPrice: bigint; + triggerThresholdType: TriggerThresholdType; +}; + +export type OrderInfo = SwapOrderInfo | PositionOrderInfo; + +export type OrdersData = { + [orderKey: string]: Order; +}; + +export type OrdersInfoData = { + [orderKey: string]: OrderInfo; +}; + +export type OrderTxnType = "create" | "update" | "cancel"; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/positions.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/positions.ts new file mode 100644 index 0000000..80e2b29 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/positions.ts @@ -0,0 +1,64 @@ +import { Market, MarketInfo } from "./markets"; +import { TokenData } from "./tokens"; + +export type Position = { + key: string; + contractKey: string; + account: string; + marketAddress: string; + collateralTokenAddress: string; + sizeInUsd: bigint; + sizeInTokens: bigint; + collateralAmount: bigint; + pendingBorrowingFeesUsd: bigint; + increasedAtTime: bigint; + decreasedAtTime: bigint; + isLong: boolean; + fundingFeeAmount: bigint; + claimableLongTokenAmount: bigint; + claimableShortTokenAmount: bigint; + isOpening?: boolean; + pnl: bigint; + positionFeeAmount: bigint; + traderDiscountAmount: bigint; + uiFeeAmount: bigint; + data: string; +}; + +export type PositionInfo = Position & { + marketInfo: MarketInfo | undefined; + market: Market; + indexToken: TokenData; + longToken: TokenData; + shortToken: TokenData; + indexName: string; + poolName: string; + collateralToken: TokenData; + pnlToken: TokenData; + markPrice: bigint; + entryPrice: bigint | undefined; + liquidationPrice: bigint | undefined; + collateralUsd: bigint; + remainingCollateralUsd: bigint; + remainingCollateralAmount: bigint; + hasLowCollateral: boolean; + pnl: bigint; + pnlPercentage: bigint; + pnlAfterFees: bigint; + pnlAfterFeesPercentage: bigint; + leverage: bigint | undefined; + leverageWithPnl: bigint | undefined; + netValue: bigint; + closingFeeUsd: bigint; + uiFeeUsd: bigint; + pendingFundingFeesUsd: bigint; + pendingClaimableFundingFeesUsd: bigint; +}; + +export type PositionsData = { + [positionKey: string]: Position; +}; + +export type PositionsInfoData = { + [positionKey: string]: PositionInfo; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/referrals.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/referrals.ts new file mode 100644 index 0000000..10b8223 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/referrals.ts @@ -0,0 +1,136 @@ +export type UserReferralInfo = { + userReferralCode: string; + userReferralCodeString: string; + referralCodeForTxn: string; + attachedOnChain: boolean; + affiliate: string; + tierId: number; + totalRebate: bigint; + totalRebateFactor: bigint; + discountShare: bigint; + discountFactor: bigint; + error?: Error; +}; + +export enum RebateDistributionType { + // V1 Airdrop for Affiliates + Rebate = "1", + // V2 Claim for Affiliates + Claim = "1000", + // V1 Airdrop for Traders + Discount = "2", +} + +export type RebateDistribution = { + typeId: RebateDistributionType; + receiver: string; + markets: string[]; + tokens: string[]; + amounts: bigint[]; + amountsInUsd: bigint[]; + timestamp: number; + transactionHash: string; + id: string; +}; + +export type CodeOwnershipInfo = { + code: string; + codeString: string; + owner?: string; + isTaken: boolean; + isTakenByCurrentUser: boolean; +}; + +export type ReferralCodeStats = { + referralCode: string; + trades: number; + tradedReferralsCount: number; + registeredReferralsCount: number; + /** + * This includes available testnets + */ + allOwnersOnOtherChains?: { + [chainId: number]: CodeOwnershipInfo; + }; + volume: bigint; + totalRebateUsd: bigint; + affiliateRebateUsd: bigint; + discountUsd: bigint; + v1Data: { + volume: bigint; + totalRebateUsd: bigint; + affiliateRebateUsd: bigint; + discountUsd: bigint; + }; + v2Data: { + volume: bigint; + totalRebateUsd: bigint; + affiliateRebateUsd: bigint; + discountUsd: bigint; + }; +}; + +export type AffiliateTotalStats = { + trades: number; + tradedReferralsCount: number; + registeredReferralsCount: number; + volume: bigint; + totalRebateUsd: bigint; + affiliateRebateUsd: bigint; + discountUsd: bigint; + v1Data: { + volume: bigint; + totalRebateUsd: bigint; + affiliateRebateUsd: bigint; + discountUsd: bigint; + }; + v2Data: { + volume: bigint; + totalRebateUsd: bigint; + affiliateRebateUsd: bigint; + discountUsd: bigint; + }; +}; + +export type TraderReferralTotalStats = { + volume: bigint; + discountUsd: bigint; + v1Data: { + volume: bigint; + discountUsd: bigint; + }; + v2Data: { + volume: bigint; + discountUsd: bigint; + }; +}; + +export type TierInfo = { + id: string; + tierId: number; + discountShare: bigint; +}; + +export type ReferralsStats = { + chainId: number; + affiliateDistributions: RebateDistribution[]; + traderDistributions: RebateDistribution[]; + affiliateReferralCodesStats: ReferralCodeStats[]; + affiliateTotalStats: AffiliateTotalStats; + traderReferralTotalStats: TraderReferralTotalStats; + codes: string[]; + affiliateTierInfo: TierInfo; +}; + +export type TotalReferralsStats = { + total: { + registeredReferralsCount: number; + affiliateVolume: bigint; + affiliateRebateUsd: bigint; + discountUsd: bigint; + traderVolume: bigint; + }; + chains: { + [chainId: number]: ReferralsStats; + }; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/sdk.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/sdk.ts new file mode 100644 index 0000000..6696258 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/sdk.ts @@ -0,0 +1,31 @@ +import type { PublicClient, WalletClient } from "viem"; +import type { Token } from "./tokens"; +import type { MarketSdkConfig } from "./markets"; + +export interface GmxSdkConfig { + /** Chain ID */ + chainId: number; + /** Account's address */ + account?: string; + /** GMX Oracle URL */ + oracleUrl: string; + /** Blockhain RPC URL */ + rpcUrl: string; + /** GMX Subsquid URL */ + subsquidUrl: string; + /** GMX Subgraph Synthetics Stats URL */ + subgraphUrl: string; + + /** Custom viem's public and private client */ + publicClient?: PublicClient; + walletClient?: WalletClient; + + /** Tokens override configurations */ + tokens?: Record>; + /** Markets override configurations */ + markets?: Record>; + + settings?: { + uiFeeReceiverAccount?: string; + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/sidecarOrders.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/sidecarOrders.ts new file mode 100644 index 0000000..6aac6bf --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/sidecarOrders.ts @@ -0,0 +1,65 @@ +import { OrderTxnType, PositionOrderInfo } from "./orders"; +import { DecreasePositionAmounts, IncreasePositionAmounts } from "./trade"; + +export type GroupPrefix = "sl" | "tp" | "limit"; + +export type EntryField = { + input: string; + value: bigint | null; + error: string | null; +}; + +export type InitialEntry = { + order: PositionOrderInfo | null; + sizeUsd: EntryField; + price: EntryField; +}; + +export type SidecarOrderEntryBase = { + id: string; + price: EntryField; + sizeUsd: EntryField; + percentage: EntryField; + txnType: OrderTxnType | null; + mode: "keepSize" | "keepPercentage" | "fitPercentage"; + order: null | PositionOrderInfo; +}; + +export type SidecarSlTpOrderEntry = SidecarOrderEntryBase & { + increaseAmounts: undefined; + decreaseAmounts?: DecreasePositionAmounts; +}; + +export type SidecarSlTpOrderEntryValid = SidecarSlTpOrderEntry & { + decreaseAmounts: DecreasePositionAmounts; +}; + +export type SidecarLimitOrderEntry = SidecarOrderEntryBase & { + increaseAmounts?: IncreasePositionAmounts; + decreaseAmounts: undefined; +}; + +export type SidecarLimitOrderEntryValid = SidecarLimitOrderEntry & { + increaseAmounts: IncreasePositionAmounts; +}; + +export type SidecarOrderEntry = SidecarSlTpOrderEntry | SidecarLimitOrderEntry; + +export type SidecarOrderEntryGroupBase = { + entries: T[]; + canAddEntry: boolean; + allowAddEntry: boolean; + addEntry: () => void; + updateEntry: (id: string, field: "price" | "sizeUsd" | "percentage", value: string) => void; + deleteEntry: (id: string) => void; + reset: () => void; +}; + +export type SidecarOrderEntryGroup = SidecarOrderEntryGroupBase & { + totalPnL: bigint; + totalPnLPercentage: bigint; + error?: null | { + price?: string; + percentage?: string; + }; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/tokens.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/tokens.ts new file mode 100644 index 0000000..a5dc4d3 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/tokens.ts @@ -0,0 +1,123 @@ +export type TokenCategory = "meme" | "layer1" | "layer2" | "defi"; + +export type Token = { + name: string; + symbol: string; + assetSymbol?: string; + baseSymbol?: string; + decimals: number; + address: string; + priceDecimals?: number; + visualMultiplier?: number; + visualPrefix?: string; + wrappedAddress?: string; + coingeckoUrl?: string; + coingeckoSymbol?: string; + metamaskSymbol?: string; + explorerSymbol?: string; + explorerUrl?: string; + reservesUrl?: string; + imageUrl?: string; + categories?: TokenCategory[]; + + isUsdg?: boolean; + isNative?: boolean; + isWrapped?: boolean; + isShortable?: boolean; + isStable?: boolean; + isSynthetic?: boolean; + isTempHidden?: boolean; + isChartDisabled?: boolean; + isV1Available?: boolean; + isPlatformToken?: boolean; + isPlatformTradingToken?: boolean; + shouldResetAllowance?: boolean; +}; + +export type TokenInfo = Token & { + hasMaxAvailableLong?: boolean; + hasMaxAvailableShort?: boolean; + + usdgAmount?: bigint; + maxUsdgAmount?: bigint; + + poolAmount?: bigint; + bufferAmount?: bigint; + managedAmount?: bigint; + managedUsd?: bigint; + availableAmount?: bigint; + availableUsd?: bigint; + guaranteedUsd?: bigint; + redemptionAmount?: bigint; + reservedAmount?: bigint; + + balance?: bigint; + + weight?: bigint; + + maxPrice?: bigint; + maxPrimaryPrice?: bigint; + + minPrice?: bigint; + minPrimaryPrice?: bigint; + + contractMaxPrice?: bigint; + contractMinPrice?: bigint; + + spread?: bigint; + + cumulativeFundingRate?: bigint; + fundingRate?: bigint; + + globalShortSize?: bigint; + + maxAvailableLong?: bigint; + maxAvailableShort?: bigint; + + maxGlobalLongSize?: bigint; + maxGlobalShortSize?: bigint; + + maxLongCapacity?: bigint; +}; + +export type InfoTokens = { + [key: string]: TokenInfo; +}; + +export type TokenPrices = { + minPrice: bigint; + maxPrice: bigint; +}; + +export type TokenData = Token & { + prices: TokenPrices; + balance?: bigint; + totalSupply?: bigint; +}; + +export type TokensRatio = { + ratio: bigint; + largestToken: Token; + smallestToken: Token; +}; + +export type TokensRatioAndSlippage = TokensRatio & { + allowedSwapSlippageBps: bigint; + acceptablePrice: bigint; +}; + +export type TokenBalancesData = { + [tokenAddress: string]: bigint; +}; + +export type TokenPricesData = { + [address: string]: TokenPrices; +}; + +export type TokensAllowanceData = { + [tokenAddress: string]: bigint; +}; + +export type TokensData = { + [address: string]: TokenData; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/trade.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/trade.ts new file mode 100644 index 0000000..86d48aa --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/trade.ts @@ -0,0 +1,319 @@ +import { ExternalSwapFeeItem, FeeItem, SwapFeeItem } from "./fees.js"; +import { DecreasePositionSwapType, OrderType } from "./orders.js"; +import { MarketInfo } from "./markets.js"; +export enum TradeType { + Long = "Long", + Short = "Short", + Swap = "Swap", +} + +export enum TradeMode { + Market = "Market", + Limit = "Limit", + StopMarket = "StopMarket", + Trigger = "Trigger", +} + +export enum TriggerThresholdType { + Above = ">", + Below = "<", +} + +export type TradeFlags = { + isLong: boolean; + isShort: boolean; + isSwap: boolean; + /** + * ```ts + * isLong || isShort + * ``` + */ + isPosition: boolean; + isIncrease: boolean; + isTrigger: boolean; + isMarket: boolean; + isLimit: boolean; +}; + +export type SwapAmounts = { + amountIn: bigint; + usdIn: bigint; + amountOut: bigint; + usdOut: bigint; + priceIn: bigint; + priceOut: bigint; + swapPathStats: SwapPathStats | undefined; + minOutputAmount: bigint; + uiFeeUsd?: bigint; +}; + +export type IncreasePositionAmounts = { + initialCollateralAmount: bigint; + initialCollateralUsd: bigint; + + collateralDeltaAmount: bigint; + collateralDeltaUsd: bigint; + + swapPathStats: SwapPathStats | undefined; + externalSwapQuote: ExternalSwapQuote | undefined; + indexTokenAmount: bigint; + + sizeDeltaUsd: bigint; + sizeDeltaInTokens: bigint; + + estimatedLeverage?: bigint; + + indexPrice: bigint; + initialCollateralPrice: bigint; + collateralPrice: bigint; + triggerPrice?: bigint; + limitOrderType?: OrderType.LimitIncrease | OrderType.StopIncrease; + triggerThresholdType?: TriggerThresholdType; + acceptablePrice: bigint; + acceptablePriceDeltaBps: bigint; + + positionFeeUsd: bigint; + uiFeeUsd: bigint; + swapUiFeeUsd: bigint; + feeDiscountUsd: bigint; + borrowingFeeUsd: bigint; + fundingFeeUsd: bigint; + positionPriceImpactDeltaUsd: bigint; +}; + +export type DecreasePositionAmounts = { + isFullClose: boolean; + sizeDeltaUsd: bigint; + sizeDeltaInTokens: bigint; + collateralDeltaUsd: bigint; + collateralDeltaAmount: bigint; + + indexPrice: bigint; + collateralPrice: bigint; + triggerPrice?: bigint; + acceptablePrice: bigint; + acceptablePriceDeltaBps: bigint; + recommendedAcceptablePriceDeltaBps: bigint; + + estimatedPnl: bigint; + estimatedPnlPercentage: bigint; + realizedPnl: bigint; + realizedPnlPercentage: bigint; + + positionFeeUsd: bigint; + uiFeeUsd: bigint; + swapUiFeeUsd: bigint; + feeDiscountUsd: bigint; + borrowingFeeUsd: bigint; + fundingFeeUsd: bigint; + swapProfitFeeUsd: bigint; + positionPriceImpactDeltaUsd: bigint; + priceImpactDiffUsd: bigint; + payedRemainingCollateralAmount: bigint; + + payedOutputUsd: bigint; + payedRemainingCollateralUsd: bigint; + + receiveTokenAmount: bigint; + receiveUsd: bigint; + + triggerOrderType?: OrderType.LimitDecrease | OrderType.StopLossDecrease; + triggerThresholdType?: TriggerThresholdType; + decreaseSwapType: DecreasePositionSwapType; +}; + +export type DepositAmounts = { + marketTokenAmount: bigint; + marketTokenUsd: bigint; + longTokenAmount: bigint; + longTokenUsd: bigint; + glvTokenAmount: bigint; + glvTokenUsd: bigint; + shortTokenAmount: bigint; + shortTokenUsd: bigint; + swapFeeUsd: bigint; + uiFeeUsd: bigint; + swapPriceImpactDeltaUsd: bigint; +}; + +export type WithdrawalAmounts = { + marketTokenAmount: bigint; + marketTokenUsd: bigint; + longTokenAmount: bigint; + shortTokenAmount: bigint; + longTokenUsd: bigint; + shortTokenUsd: bigint; + glvTokenAmount: bigint; + glvTokenUsd: bigint; + swapFeeUsd: bigint; + uiFeeUsd: bigint; + swapPriceImpactDeltaUsd: bigint; +}; + +export type NextPositionValues = { + nextLeverage?: bigint; + nextLiqPrice?: bigint; + nextCollateralUsd?: bigint; + nextSizeUsd?: bigint; + nextPnl?: bigint; + nextPnlPercentage?: bigint; + nextEntryPrice?: bigint; + remainingCollateralFeesUsd?: bigint; +}; + +export type SwapStats = { + marketAddress: string; + tokenInAddress: string; + tokenOutAddress: string; + isWrap: boolean; + isUnwrap: boolean; + isOutLiquidity?: boolean; + isOutCapacity?: boolean; + swapFeeAmount: bigint; + swapFeeUsd: bigint; + priceImpactDeltaUsd: bigint; + amountIn: bigint; + amountInAfterFees: bigint; + usdIn: bigint; + amountOut: bigint; + usdOut: bigint; +}; + +export type SwapPathStats = { + swapPath: string[]; + swapSteps: SwapStats[]; + targetMarketAddress?: string; + totalSwapPriceImpactDeltaUsd: bigint; + totalSwapFeeUsd: bigint; + totalFeesDeltaUsd: bigint; + tokenInAddress: string; + tokenOutAddress: string; + usdOut: bigint; + amountOut: bigint; +}; + +export type MarketEdge = { + marketAddress: string; + marketInfo: MarketInfo; + // from token + from: string; + // to token + to: string; +}; + +export type SwapRoute = { + edges: MarketEdge[]; + path: string[]; + liquidity: bigint; +}; + +export type MarketsGraph = { + abjacencyList: { [token: string]: MarketEdge[] }; + edges: MarketEdge[]; +}; + +export type SwapEstimator = ( + e: MarketEdge, + usdIn: bigint +) => { + usdOut: bigint; +}; + +export type FindSwapPath = (usdIn: bigint, opts: { order?: ("liquidity" | "length")[] }) => SwapPathStats | undefined; + +export type TradeFeesType = "swap" | "increase" | "decrease" | "edit"; + +export enum ExternalSwapAggregator { + OpenOcean = "openOcean", +} + +export type ExternalSwapOutput = { + aggregator: ExternalSwapAggregator; + inTokenAddress: string; + outTokenAddress: string; + amountIn: bigint; + amountOut: bigint; + usdIn: bigint | undefined; + usdOut: bigint | undefined; + priceIn: bigint | undefined; + priceOut: bigint | undefined; + feesUsd: bigint | undefined; + needSpenderApproval?: boolean; + txnData: { + to: string; + data: string; + value: bigint; + estimatedGas: bigint; + }; +}; + +export type ExternalSwapQuote = { + aggregator: ExternalSwapAggregator; + inTokenAddress: string; + outTokenAddress: string; + amountIn: bigint; + amountOut: bigint; + usdIn: bigint; + usdOut: bigint; + priceIn: bigint; + priceOut: bigint; + feesUsd: bigint; + needSpenderApproval?: boolean; + txnData: { + to: string; + data: string; + value: bigint; + estimatedGas: bigint; + }; +}; + +export type ExternalSwapCalculationStrategy = "byFromValue" | "leverageBySize"; + +export type ExternalSwapInputs = { + amountIn: bigint; + priceIn: bigint; + priceOut: bigint; + usdIn: bigint; + usdOut: bigint; + strategy: ExternalSwapCalculationStrategy; + internalSwapTotalFeesDeltaUsd?: bigint; + internalSwapTotalFeeItem?: FeeItem; + internalSwapAmounts: SwapAmounts; +}; + +export type TradeFees = { + totalFees?: FeeItem; + payTotalFees?: FeeItem; + swapFees?: SwapFeeItem[]; + positionFee?: FeeItem; + swapPriceImpact?: FeeItem; + positionPriceImpact?: FeeItem; + priceImpactDiff?: FeeItem; + positionCollateralPriceImpact?: FeeItem; + collateralPriceImpactDiff?: FeeItem; + positionFeeFactor?: bigint; + borrowFee?: FeeItem; + fundingFee?: FeeItem; + uiFee?: FeeItem; + uiSwapFee?: FeeItem; + feeDiscountUsd?: bigint; + swapProfitFee?: FeeItem; + externalSwapFee?: ExternalSwapFeeItem; +}; + +export type GmSwapFees = { + totalFees?: FeeItem; + swapFee?: FeeItem; + swapPriceImpact?: FeeItem; + uiFee?: FeeItem; + shiftFee?: FeeItem; +}; + +export type TradeSearchParams = { + from?: string; + to?: string; + mode?: string; + pool?: string; + collateral?: string; + market?: string; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/types/tradeHistory.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/tradeHistory.ts new file mode 100644 index 0000000..c36db96 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/types/tradeHistory.ts @@ -0,0 +1,126 @@ +import { BytesLike } from "./common"; +import { MarketInfo } from "./markets"; +import { OrderType } from "./orders"; +import { TokenData } from "./tokens"; + +export enum TradeActionType { + OrderCreated = "OrderCreated", + OrderExecuted = "OrderExecuted", + OrderCancelled = "OrderCancelled", + OrderUpdated = "OrderUpdated", + OrderFrozen = "OrderFrozen", +} + +export type RawTradeAction = { + id: string; + eventName: TradeActionType; + + account: string; + marketAddress?: string; + swapPath?: string[]; + initialCollateralTokenAddress?: string; + + initialCollateralDeltaAmount?: string; + sizeDeltaUsd?: string; + triggerPrice?: string; + acceptablePrice?: string; + executionPrice?: string; + minOutputAmount?: string; + executionAmountOut?: string; + + priceImpactDiffUsd?: string; + priceImpactUsd?: string; + positionFeeAmount?: string; + borrowingFeeAmount?: string; + fundingFeeAmount?: string; + liquidationFeeAmount?: string; + pnlUsd?: string; + basePnlUsd?: string; + + collateralTokenPriceMax?: string; + collateralTokenPriceMin?: string; + + indexTokenPriceMin?: string; + indexTokenPriceMax?: string; + + orderType: OrderType; + orderKey: string; + isLong?: boolean; + shouldUnwrapNativeToken?: boolean; + + reason?: string; + reasonBytes?: BytesLike; + + transaction: { + timestamp: number; + hash: string; + }; +}; + +export type PositionTradeAction = { + id: string; + eventName: TradeActionType; + marketInfo: MarketInfo; + marketAddress: string; + account: string; + initialCollateralTokenAddress: string; + initialCollateralToken: TokenData; + targetCollateralToken: TokenData; + indexToken: TokenData; + swapPath: string[]; + initialCollateralDeltaAmount: bigint; + sizeDeltaUsd: bigint; + indexTokenPriceMin?: bigint; + indexTokenPriceMax?: bigint; + triggerPrice?: bigint; + acceptablePrice: bigint; + executionPrice?: bigint; + collateralTokenPriceMin?: bigint; + collateralTokenPriceMax?: bigint; + minOutputAmount: bigint; + priceImpactUsd?: bigint; + priceImpactDiffUsd?: bigint; + positionFeeAmount?: bigint; + borrowingFeeAmount?: bigint; + fundingFeeAmount?: bigint; + pnlUsd?: bigint; + basePnlUsd?: bigint; + orderType: OrderType; + orderKey: string; + isLong: boolean; + reason?: string; + reasonBytes?: string | Uint8Array; + shouldUnwrapNativeToken: boolean; + liquidationFeeAmount?: bigint; + + transaction: { + timestamp: number; + hash: string; + }; +}; + +export type SwapTradeAction = { + id: string; + account: string; + eventName: TradeActionType; + initialCollateralTokenAddress: string; + initialCollateralToken: TokenData; + targetCollateralToken: TokenData; + shouldUnwrapNativeToken: boolean; + swapPath: string[]; + initialCollateralDeltaAmount: bigint; + minOutputAmount: bigint; + executionAmountOut?: bigint; + orderType: OrderType; + orderKey: string; + + reason?: string; + reasonBytes?: string | Uint8Array; + + transaction: { + timestamp: number; + hash: string; + }; +}; + +export type TradeAction = PositionTradeAction | SwapTradeAction; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/LruCache.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/LruCache.ts new file mode 100644 index 0000000..c6010d3 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/LruCache.ts @@ -0,0 +1,53 @@ +export class LRUCache { + private capacity: number; + private cache: Map; + private recentKeys: string[]; + + constructor(capacity: number) { + this.capacity = capacity; + this.cache = new Map(); + this.recentKeys = []; + } + + has(key: string): boolean { + return this.cache.has(key); + } + + get(key: string): T | undefined { + if (this.cache.has(key)) { + // Update recentKeys to reflect the usage + this.updateRecentKeys(key); + return this.cache.get(key); + } + return undefined; + } + + set(key: string, value: T): void { + if (typeof key !== "string") { + throw new Error("Key must be a string"); + } + + // If key exists, update its value and move it to the front of recentKeys + if (this.cache.has(key)) { + this.cache.set(key, value); + this.updateRecentKeys(key); + } else { + // If capacity is reached, remove least recently used item + if (this.cache.size === this.capacity) { + const lruKey = this.recentKeys.shift(); + if (lruKey) { + this.cache.delete(lruKey); + } + } + // Add the new key-value pair to the cache and recentKeys + this.cache.set(key, value); + this.recentKeys.push(key); + } + } + + private updateRecentKeys(key: string): void { + // Move the key to the end (most recently used) of recentKeys + this.recentKeys = this.recentKeys.filter((k) => k !== key); + this.recentKeys.push(key); + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/LruCache.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/LruCache.spec.ts new file mode 100644 index 0000000..b7b3ccd --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/LruCache.spec.ts @@ -0,0 +1,49 @@ +import {describe, expect, it} from "vitest"; +import {LRUCache} from "../LruCache.js"; + +describe("LruCache", () => { + it("should store and retrieve values", () => { + const cache = new LRUCache(2); + cache.set("a", 1); + expect(cache.get("a")).toBe(1); + }); + + it("should return undefined for non-existing keys", () => { + const cache = new LRUCache(2); + expect(cache.get("x")).toBeUndefined(); + }); + + it("should update recent usage when getting a key", () => { + const cache = new LRUCache(2); + cache.set("a", 1); + cache.set("b", 2); + cache.get("a"); // 'a' is now the most recently used + cache.set("c", 3); // 'b' should be evicted + expect(cache.has("b")).toBe(false); + expect(cache.has("a")).toBe(true); + }); + + it("should evict the least recently used key when capacity is exceeded", () => { + const cache = new LRUCache(2); + cache.set("a", 1); + cache.set("b", 2); + cache.set("c", 3); // 'a' is removed + expect(cache.has("a")).toBe(false); + expect(cache.has("b")).toBe(true); + expect(cache.get("c")).toBe(3); + }); + + it("should update existing keys without eviction", () => { + const cache = new LRUCache(2); + cache.set("a", 1); + cache.set("b", 2); + cache.set("a", 10); // update 'a' + expect(cache.get("a")).toBe(10); + expect(cache.has("b")).toBe(true); + }); + + it("should throw error if key is not a string", () => { + const cache = new LRUCache(2); + expect(() => cache.set(123 as any, 1)).toThrow("Key must be a string"); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/bigmath.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/bigmath.spec.ts new file mode 100644 index 0000000..df42f9c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/bigmath.spec.ts @@ -0,0 +1,44 @@ +import {bigMath} from "../bigmath.js"; +import {describe, expect, it} from "vitest"; + +describe("bigMath", () => { + describe("abs", () => { + it("should return the absolute value of a number", () => { + expect(bigMath.abs(10n)).toBe(10n); + expect(bigMath.abs(-10n)).toBe(10n); + }); + }); + + describe("mulDiv", () => { + it("should return the result of multiplying two numbers and dividing by a third", () => { + expect(bigMath.mulDiv(10n, 10n, 2n)).toBe(50n); + expect(bigMath.mulDiv(10n, 10n, 3n)).toBe(33n); + }); + }); + + describe("max", () => { + it("should return the maximum value of a list of numbers", () => { + expect(bigMath.max(10n, 20n, -30n)).toBe(20n); + expect(bigMath.max(30n, 20n, 10n)).toBe(30n); + }); + }); + + describe("min", () => { + it("should return the minimum value of a list of numbers", () => { + expect(bigMath.min(10n, 20n, -30n)).toBe(-30n); + expect(bigMath.min(30n, 20n, 10n)).toBe(10n); + }); + }); + + describe("avg", () => { + it("should return the average value of a list of numbers", () => { + expect(bigMath.avg(10n, 20n, 30n)).toBe(20n); + expect(bigMath.avg(10n, 20n, 30n, 40n, undefined)).toBe(25n); + }); + + it("should return undefined if no values are provided", () => { + expect(bigMath.avg()).toBe(undefined); + expect(bigMath.avg(undefined, undefined)).toBe(undefined); + }); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/fees.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/fees.spec.ts new file mode 100644 index 0000000..2f31364 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/fees.spec.ts @@ -0,0 +1,79 @@ +import {describe, expect, it} from "vitest"; + +import {USD_DECIMALS} from "../../configs/factors.js"; +import type {MarketInfo} from "../../types/markets.js"; +import {numberToBigint} from "../numbers.js"; +import {getFundingFactorPerPeriod} from "../fees/index.js"; + +const dollar = 10n ** BigInt(USD_DECIMALS); +const eightMillion = 8_000_000n; +const tenMillion = 10_000_000n; + +function toFactor(percent: `${number}%`) { + const value = parseFloat(percent.replace("%", "")); + return numberToBigint(value, 30 - 2); +} + +const second = 1; + +describe("getFundingFactorPerPeriod", () => { + it("works when short pay, shorts OI bigger", () => { + const marketInfo = { + fundingFactorPerSecond: toFactor("50%"), + longsPayShorts: false, + longInterestUsd: eightMillion * dollar, + shortInterestUsd: tenMillion * dollar, + } as MarketInfo; + + const forLongs = getFundingFactorPerPeriod(marketInfo, true, second); + expect(forLongs.toString()).toBe(toFactor("62.5%").toString()); + + const forShorts = getFundingFactorPerPeriod(marketInfo, false, second); + expect(forShorts.toString()).toBe(toFactor("-50%").toString()); + }); + + it("works when short pay, longs OI bigger", () => { + const marketInfo = { + fundingFactorPerSecond: toFactor("50%"), + longsPayShorts: false, + longInterestUsd: tenMillion * dollar, + shortInterestUsd: eightMillion * dollar, + } as MarketInfo; + + const forLongs = getFundingFactorPerPeriod(marketInfo, true, second); + expect(forLongs.toString()).toBe(toFactor("50%").toString()); + + const forShorts = getFundingFactorPerPeriod(marketInfo, false, second); + expect(forShorts.toString()).toBe(toFactor("-62.5%").toString()); + }); + + it("works when long pay, shorts OI bigger", () => { + const marketInfo = { + fundingFactorPerSecond: toFactor("50%"), + longsPayShorts: true, + longInterestUsd: eightMillion * dollar, + shortInterestUsd: tenMillion * dollar, + } as MarketInfo; + + const forLongs = getFundingFactorPerPeriod(marketInfo, true, second); + expect(forLongs.toString()).toBe(toFactor("-62.5%").toString()); + + const forShorts = getFundingFactorPerPeriod(marketInfo, false, second); + expect(forShorts.toString()).toBe(toFactor("50%").toString()); + }); + + it("works when long pay, longs OI bigger", () => { + const marketInfo = { + fundingFactorPerSecond: toFactor("50%"), + longsPayShorts: true, + longInterestUsd: tenMillion * dollar, + shortInterestUsd: eightMillion * dollar, + } as MarketInfo; + + const forLongs = getFundingFactorPerPeriod(marketInfo, true, second); + expect(forLongs.toString()).toBe(toFactor("-50%").toString()); + + const forShorts = getFundingFactorPerPeriod(marketInfo, false, second); + expect(forShorts.toString()).toBe(toFactor("62.5%").toString()); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/hash.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/hash.spec.ts new file mode 100644 index 0000000..2a1960b --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/hash.spec.ts @@ -0,0 +1,48 @@ +import {describe, expect, it} from "vitest"; +import {hashData, hashDataMap, hashString} from "../hash.js"; +import {LRUCache} from "../LruCache.js"; +// Change from Vitest to Jest imports +// import { describe, expect, it } from "vitest"; + +describe("hashData", () => { + it("returns a valid hash and caches it", () => { + const inputTypes = ["uint256", "string"]; + const inputValues = [123n, "hello"]; + const result = hashData(inputTypes, inputValues); + expect(result).toBe("0x18a25ed45d79546dfca2565caa2ee3102fb46159dea4fde1d0a9c0cc78ce94e3"); + + // Check cache + const key = JSON.stringify({ dataTypes: inputTypes, dataValues: ["123", "hello"] }); + expect(new LRUCache(10_000).has(key)).toBe(false); + }); + + it("returns cached hash if already computed", () => { + const inputTypes = ["bool"]; + const inputValues = [true]; + const result1 = hashData(inputTypes, inputValues); + const result2 = hashData(inputTypes, inputValues); + expect(result1).toBe(result2); + }); +}); + +describe("hashString", () => { + it("returns a valid hash for a string and caches it", () => { + const str = "test-string"; + const hash1 = hashString(str); + const hash2 = hashString(str); + expect(hash1).toBe(hash2); + }); +}); + +describe("hashDataMap", () => { + it("returns hashes for a given record map", () => { + const result = hashDataMap({ + first: [["string"], ["hello"]], + second: [["uint256"], [42n]], + empty: undefined, + }); + expect(Object.keys(result)).toContain("first"); + expect(Object.keys(result)).toContain("second"); + expect(Object.keys(result)).not.toContain("empty"); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/markets.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/markets.spec.ts new file mode 100644 index 0000000..e315d33 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/markets.spec.ts @@ -0,0 +1,335 @@ +import {describe, expect, it} from "vitest"; + +import { + getAvailableUsdLiquidityForCollateral, + getCappedPoolPnl, + getContractMarketPrices, + getMarketDivisor, + getMarketFullName, + getMarketIndexName, + getMarketPnl, + getMarketPoolName, + getMaxAllowedLeverageByMinCollateralFactor, + getMaxLeverageByMinCollateralFactor, + getOpenInterestInTokens, + getOpenInterestUsd, + getOppositeCollateral, + getPoolUsdWithoutPnl, + getPriceForPnl, + getReservedUsd, + getTokenPoolType, +} from "../markets.js"; +import {MarketInfo} from "../../types/markets.js"; +import {Token, TokensData} from "../../types/tokens.js"; +import {TOKENS} from "../../configs/tokens.js"; +import {ARBITRUM} from "../../configs/chains.js"; +import {expandDecimals} from "../numbers.js"; + +function getToken(symbol: string) { + return TOKENS[ARBITRUM].find((token) => token.symbol === symbol) as Token; +} + +describe("getMarketFullName", () => { + it("returns proper full name", () => { + const longToken = getToken("ETH"); + const shortToken = getToken("USDC"); + const indexToken = getToken("BTC"); + + const name = getMarketFullName({ + longToken, + shortToken, + indexToken, + isSpotOnly: false, + }); + expect(name).toBe("BTC/USD [ETH-USDC]"); + }); + + it("returns swap-only name", () => { + const indexToken = { symbol: "ETH", address: "0xeth", decimals: 18 } as Token; + const name = getMarketFullName({ + longToken: indexToken, + shortToken: indexToken, + indexToken, + isSpotOnly: true, + }); + expect(name).toBe("SWAP-ONLY [ETH-ETH]"); + }); +}); + +describe("getMarketIndexName", () => { + it("returns 'SWAP-ONLY' if isSpotOnly is true", () => { + expect( + getMarketIndexName({ + indexToken: getToken("ETH"), + isSpotOnly: true, + }) + ).toBe("SWAP-ONLY"); + }); + + it("returns prefix + baseSymbol/symbol + /USD", () => { + const eth = getToken("ETH"); + expect(getMarketIndexName({ indexToken: eth, isSpotOnly: false })).toBe("ETH/USD"); + + const pepe = getToken("PEPE"); + expect(getMarketIndexName({ indexToken: pepe, isSpotOnly: false })).toBe("kPEPE/USD"); + }); +}); + +describe("getMarketPoolName", () => { + it("returns single token symbol if long and short are the same", () => { + const token = getToken("ETH"); + expect(getMarketPoolName({ longToken: token, shortToken: token })).toBe("ETH-ETH"); + }); + + it("returns combined symbol otherwise", () => { + const longToken = getToken("ETH"); + const shortToken = getToken("USDC"); + expect(getMarketPoolName({ longToken, shortToken })).toBe("ETH-USDC"); + }); +}); + +describe("getContractMarketPrices", () => { + it("returns undefined if any token is missing", () => { + const market = { + indexTokenAddress: "0xbtc", + longTokenAddress: "0xeth", + shortTokenAddress: "0xusdc", + }; + expect(getContractMarketPrices({}, market as any)).toBeUndefined(); + }); + + it("returns converted contract prices if all tokens exist", () => { + const tokensData = { + "0xbtc": { decimals: 8, prices: { minPrice: 1000n, maxPrice: 2000n } }, + "0xeth": { decimals: 18, prices: { minPrice: 3000n, maxPrice: 4000n } }, + "0xusdc": { decimals: 6, prices: { minPrice: 1n, maxPrice: 2n } }, + } as unknown as TokensData; + const market = { + indexTokenAddress: "0xbtc", + longTokenAddress: "0xeth", + shortTokenAddress: "0xusdc", + }; + const result = getContractMarketPrices(tokensData, market as any); + expect(result).toBeDefined(); + expect(result?.indexTokenPrice?.min).toBeDefined(); + }); +}); + +describe("getTokenPoolType", () => { + it("returns 'long' for single-token markets if matches address", () => { + const token = getToken("ETH"); + expect(getTokenPoolType({ longToken: token, shortToken: token }, token.address)).toBe("long"); + }); + + it("returns 'short' for shortToken match", () => { + const longToken = getToken("ETH"); + const shortToken = getToken("USDC"); + expect(getTokenPoolType({ longToken, shortToken }, shortToken.address)).toBe("short"); + }); +}); + +describe("getPoolUsdWithoutPnl", () => { + const marketInfo = { + longPoolAmount: 1n, + shortPoolAmount: 1n, + longToken: { decimals: 18, prices: { minPrice: expandDecimals(5, 30), maxPrice: expandDecimals(15, 30) } }, + shortToken: { decimals: 18, prices: { minPrice: expandDecimals(2, 30), maxPrice: expandDecimals(4, 30) } }, + } as MarketInfo; + + it("calculates poolUsd for isLong = true", () => { + expect(getPoolUsdWithoutPnl(marketInfo, true, "minPrice")).toBe(5000000000000n); + expect(getPoolUsdWithoutPnl(marketInfo, true, "maxPrice")).toBe(15000000000000n); + }); + + it("calculates poolUsd for isLong = false", () => { + expect(getPoolUsdWithoutPnl(marketInfo, false, "minPrice")).toBe(2000000000000n); + expect(getPoolUsdWithoutPnl(marketInfo, false, "maxPrice")).toBe(4000000000000n); + }); +}); + +describe("getCappedPoolPnl", () => { + it("returns capped pnl if poolPnl > maxPnl", () => { + const marketInfo = { + maxPnlFactorForTradersLong: 20000n, + maxPnlFactorForTradersShort: 10000n, + } as MarketInfo; + const result = getCappedPoolPnl({ + marketInfo, + poolUsd: expandDecimals(1000, 30), + poolPnl: 30000n, + isLong: true, + }); + expect(result).toBe(30000n); + }); + + it("returns poolPnl if below maxPnl", () => { + const marketInfo = { maxPnlFactorForTradersLong: 20000n } as MarketInfo; + expect( + getCappedPoolPnl({ + marketInfo, + poolUsd: expandDecimals(1000, 30), + poolPnl: 5000n, + isLong: true, + }) + ).toBe(5000n); + }); +}); + +describe("getMaxLeverageByMinCollateralFactor", () => { + it("returns default if minCollateralFactor is undefined", () => { + expect(getMaxLeverageByMinCollateralFactor(undefined)).toBe(1000000); + }); + + it("returns correct leverage for a given factor", () => { + expect(getMaxLeverageByMinCollateralFactor(1000000000000000000n)).toBe(10000000000000000); + }); +}); + +describe("getMaxAllowedLeverageByMinCollateralFactor", () => { + it("returns half of max leverage", () => { + expect(getMaxAllowedLeverageByMinCollateralFactor(1000000000000000000n)).toBe(5000000000000000); + }); +}); + +describe("getOppositeCollateral", () => { + const marketInfo = { + longToken: getToken("ETH"), + shortToken: getToken("USDC"), + } as MarketInfo; + it("returns shortToken if token is long", () => { + expect(getOppositeCollateral(marketInfo, marketInfo.longToken.address)).toEqual(marketInfo.shortToken); + }); + + it("returns undefined if pool type is not found", () => { + expect(getOppositeCollateral(marketInfo, "0xbtc")).toBeUndefined(); + }); +}); + +describe("getAvailableUsdLiquidityForCollateral", () => { + it("returns poolUsd if isSpotOnly", () => { + const marketInfo = { + isSpotOnly: true, + longPoolAmount: 1n, + indexToken: { + ...getToken("ETH"), + prices: { minPrice: expandDecimals(10, 18), maxPrice: expandDecimals(15, 18) }, + }, + longToken: { decimals: 18, prices: { minPrice: expandDecimals(1, 18), maxPrice: expandDecimals(2, 18) } }, + } as MarketInfo; + expect(getAvailableUsdLiquidityForCollateral(marketInfo, true)).toBe(1n); + }); + + it("calculates liquidity if not spot only", () => { + const marketInfo = { + isSpotOnly: false, + reserveFactorLong: 1n, + longPoolAmount: expandDecimals(5, 30), + longInterestInTokens: 1n, + indexToken: { + ...getToken("ETH"), + prices: { minPrice: expandDecimals(10, 18), maxPrice: expandDecimals(15, 18) }, + }, + longToken: { decimals: 18, prices: { minPrice: expandDecimals(10, 18), maxPrice: expandDecimals(15, 18) } }, + } as MarketInfo; + expect(getAvailableUsdLiquidityForCollateral(marketInfo, true)).toBe(expandDecimals(35, 30)); + }); +}); + +describe("getReservedUsd", () => { + it("calculates reservedUsd for long side", () => { + const marketInfo = { + longInterestInTokens: 100n, + indexToken: { + decimals: 18, + prices: { maxPrice: expandDecimals(10, 18) }, + }, + } as MarketInfo; + expect(getReservedUsd(marketInfo, true)).toBe(1000n); + }); + + it("returns shortInterestUsd if isLong=false", () => { + const marketInfo = { shortInterestUsd: 9999n } as MarketInfo; + expect(getReservedUsd(marketInfo, false)).toBe(9999n); + }); +}); + +describe("getMarketDivisor", () => { + it("returns 2n if longTokenAddress equals shortTokenAddress", () => { + expect( + getMarketDivisor({ + longTokenAddress: "0xsame", + shortTokenAddress: "0xsame", + }) + ).toBe(2n); + }); + + it("returns 1n otherwise", () => { + expect( + getMarketDivisor({ + longTokenAddress: "0xeth", + shortTokenAddress: "0xusdc", + }) + ).toBe(1n); + }); +}); + +describe("getMarketPnl", () => { + it("returns 0n if openInterest is 0", () => { + const marketInfo = { + indexToken: { + decimals: 18, + prices: { minPrice: expandDecimals(1000, 18), maxPrice: expandDecimals(2000, 18) }, + }, + longInterestUsd: 0n, + longInterestInTokens: 0n, + } as MarketInfo; + expect(getMarketPnl(marketInfo, true, false)).toBe(0n); + }); + + it("calculates pnl for long positions", () => { + const marketInfo = { + indexToken: { + decimals: 18, + prices: { minPrice: expandDecimals(1000, 18), maxPrice: expandDecimals(2000, 18) }, + }, + longInterestUsd: 1000n, + longInterestInTokens: 1n, + } as MarketInfo; + // maximize = false => use minPrice for long + expect(getMarketPnl(marketInfo, true, true)).toBe(0n); // openInterestValue(1000n) - openInterestUsd(1000n) = 0 + }); +}); + +describe("getOpenInterestUsd", () => { + it("returns longInterestUsd for isLong", () => { + expect(getOpenInterestUsd({ longInterestUsd: 1234n, shortInterestUsd: 9999n } as MarketInfo, true)).toBe(1234n); + }); + + it("returns shortInterestUsd for !isLong", () => { + expect(getOpenInterestUsd({ longInterestUsd: 1234n, shortInterestUsd: 9999n } as MarketInfo, false)).toBe(9999n); + }); +}); + +describe("getOpenInterestInTokens", () => { + it("returns longInterestInTokens for isLong", () => { + expect( + getOpenInterestInTokens({ longInterestInTokens: 100n, shortInterestInTokens: 200n } as MarketInfo, true) + ).toBe(100n); + }); + + it("returns shortInterestInTokens for !isLong", () => { + expect( + getOpenInterestInTokens({ longInterestInTokens: 100n, shortInterestInTokens: 200n } as MarketInfo, false) + ).toBe(200n); + }); +}); + +describe("getPriceForPnl", () => { + it("uses maxPrice for long when maximize=true", () => { + expect(getPriceForPnl({ minPrice: 1000n, maxPrice: 2000n }, true, true)).toBe(2000n); + }); + + it("uses maxPrice for short when maximize=false", () => { + expect(getPriceForPnl({ minPrice: 1000n, maxPrice: 2000n }, false, false)).toBe(2000n); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/numbers.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/numbers.spec.ts new file mode 100644 index 0000000..a777278 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/numbers.spec.ts @@ -0,0 +1,107 @@ +import {describe, expect, it} from "vitest"; + +import {BASIS_POINTS_DIVISOR_BIGINT} from "../../configs/factors.js"; +import { + applyFactor, + basisPointsToFloat, + bigintToNumber, + BN_NEGATIVE_ONE, + BN_ONE, + BN_ZERO, + expandDecimals, + getBasisPoints, + numberToBigint, + PRECISION, + roundUpMagnitudeDivision, +} from "../numbers.js"; + +describe("numbers utils", () => { + it("constants", () => { + // Just to confirm they exist and have no unexpected changes + expect(PRECISION).toBe(expandDecimals(1, 30)); + expect(BN_ZERO).toBe(0n); + expect(BN_ONE).toBe(1n); + expect(BN_NEGATIVE_ONE).toBe(-1n); + }); + + describe("expandDecimals", () => { + it("multiplies by 10^decimals", () => { + expect(expandDecimals(1, 0)).toBe(1n); + expect(expandDecimals(1, 1)).toBe(10n); + expect(expandDecimals(1, 2)).toBe(100n); + expect(expandDecimals(5, 3)).toBe(5000n); + }); + it("handles zero gracefully", () => { + expect(expandDecimals(0, 5)).toBe(0n); + }); + }); + + describe("basisPointsToFloat", () => { + it("converts basis points to scaled big int float using PRECISION", () => { + const result = basisPointsToFloat(100n); + expect(result).toBe(expandDecimals(1, 28)); + }); + }); + + describe("getBasisPoints", () => { + it("calculates basis points as (numerator * 10000) / denominator", () => { + expect(getBasisPoints(2n, 1n)).toBe(2n * BASIS_POINTS_DIVISOR_BIGINT); + expect(getBasisPoints(1n, 2n)).toBe(5000n); + }); + + it("rounds up if remainder != 0 and shouldRoundUp=true", () => { + expect(getBasisPoints(7n, 3n, true)).toBe(23334n); + }); + + it("returns same result if remainder=0, even if shouldRoundUp=true", () => { + expect(getBasisPoints(2n, 1n, true)).toBe(20000n); + }); + }); + + describe("roundUpMagnitudeDivision", () => { + it("rounds positive numbers up", () => { + expect(roundUpMagnitudeDivision(10n, 3n)).toBe(4n); + expect(roundUpMagnitudeDivision(9n, 3n)).toBe(3n); + }); + + it("rounds negative numbers up in magnitude", () => { + expect(roundUpMagnitudeDivision(-10n, 3n)).toBe(-4n); + }); + }); + + describe("applyFactor", () => { + it("applies factor by (value * factor)/PRECISION", () => { + const value = expandDecimals(100, 30); + const factor = 200n; + expect(applyFactor(value, factor)).toBe(20000n); + }); + }); + + it("bigintToNumber", () => { + expect(bigintToNumber(0n, 30)).toEqual(0); + expect(bigintToNumber(1n, 30)).toEqual(1e-30); + expect(bigintToNumber(PRECISION, 30)).toEqual(1); + expect(bigintToNumber(PRECISION * 100n, 30)).toEqual(100); + expect(bigintToNumber(PRECISION * 2n, 30)).toEqual(2); + expect(bigintToNumber(PRECISION / 2n, 30)).toEqual(0.5); + + expect(bigintToNumber(1123456n, 6)).toEqual(1.123456); + expect(bigintToNumber(-1123456n, 6)).toEqual(-1.123456); + }); + + it("numberToBigint", () => { + expect(numberToBigint(0, 30)).toEqual(0n); + expect(numberToBigint(1e-30, 30)).toEqual(1n); + expect(numberToBigint(-1e-30, 30)).toEqual(-1n); + expect(numberToBigint(1, 30)).toEqual(PRECISION); + expect(numberToBigint(100, 30)).toEqual(PRECISION * 100n); + expect(numberToBigint(2, 30)).toEqual(PRECISION * 2n); + expect(numberToBigint(0.5, 30)).toEqual(PRECISION / 2n); + expect(numberToBigint(-0.5, 30)).toEqual(-PRECISION / 2n); + + expect(numberToBigint(1.1234567, 6)).toEqual(1123456n); + expect(numberToBigint(1.12345678, 6)).toEqual(1123456n); + expect(numberToBigint(1.123456789, 6)).toEqual(1123456n); + expect(numberToBigint(-1.123456789, 6)).toEqual(-1123456n); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/objects.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/objects.spec.ts new file mode 100644 index 0000000..6feaefd --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/objects.spec.ts @@ -0,0 +1,78 @@ +import {describe, expect, it} from "vitest"; + +import {getByKey, setByKey, updateByKey} from "../objects.js"; + +describe("setByKey", () => { + it("should set a key in an object", () => { + const obj = { a: 1, b: 2 }; + const key = "c"; + const data = 3; + + expect(setByKey(obj, key, data)).toEqual({ a: 1, b: 2, c: 3 }); + }); + + it("should set a key in an empty object", () => { + const obj = {}; + const key = "c"; + const data = 3; + + expect(setByKey(obj, key, data)).toEqual({ c: 3 }); + }); + + it("should set a key in an object with existing key", () => { + const obj = { a: 1, b: 2 }; + const key = "b"; + const data = 3; + + expect(setByKey(obj, key, data)).toEqual({ a: 1, b: 3 }); + }); +}); + +describe("updateByKey", () => { + it("should update a key in an object", () => { + const obj = { a: { x: 1, y: 2 }, b: { x: 3, y: 4 } }; + const key = "b"; + const data = { y: 5 }; + + expect(updateByKey(obj, key, data)).toEqual({ a: { x: 1, y: 2 }, b: { x: 3, y: 5 } }); + }); + + it("should update a key in an empty object", () => { + const obj = {}; + const key = "b"; + const data = { y: 5 }; + + expect(updateByKey(obj, key, data)).toEqual({}); + }); + + it("should update a key in an object with non-existing key", () => { + const obj = { a: { x: 1, y: 2 }, b: { x: 3, y: 4 } }; + const key = "c"; + const data = { y: 5 }; + + expect(updateByKey(obj, key, data)).toEqual({ a: { x: 1, y: 2 }, b: { x: 3, y: 4 } }); + }); +}); + +describe("getByKey", () => { + it("should get a key in an object", () => { + const obj = { a: 1, b: 2 }; + const key = "b"; + + expect(getByKey(obj, key)).toEqual(2); + }); + + it("should get a key in an empty object", () => { + const obj = {}; + const key = "b"; + + expect(getByKey(obj, key)).toEqual(undefined); + }); + + it("should get a non-existing key in an object", () => { + const obj = { a: 1, b: 2 }; + const key = "c"; + + expect(getByKey(obj, key)).toEqual(undefined); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/positions.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/positions.spec.ts new file mode 100644 index 0000000..47c5e73 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/positions.spec.ts @@ -0,0 +1,213 @@ +import {beforeEach, describe, expect, it, Mock, vi} from "vitest"; +import {MarketInfo} from "../../types/markets.js"; +import {Token} from "../../types/tokens.js"; +import {bigMath} from "../bigmath.js"; +import {getPositionFee, getPriceImpactForPosition} from "../fees/index.js"; +import {getCappedPoolPnl, getMarketPnl, getPoolUsdWithoutPnl} from "../markets.js"; +import { + getEntryPrice, + getLeverage, + getLiquidationPrice, + getPositionKey, + getPositionNetValue, + getPositionPendingFeesUsd, + getPositionPnlUsd, + getPositionValueUsd, + parsePositionKey, +} from "../positions.js"; +import {convertToUsd, getIsEquivalentTokens} from "../tokens.js"; + +vi.mock("../markets", () => ({ + ...vi.importActual("../markets"), + getMarketPnl: vi.fn(), + getPoolUsdWithoutPnl: vi.fn(), + getCappedPoolPnl: vi.fn(), +})); + +vi.mock("../tokens", () => ({ + ...vi.importActual("../tokens"), + convertToUsd: vi.fn(), + getIsEquivalentTokens: vi.fn(), +})); + +vi.mock("../fees", () => ({ + getPositionFee: vi.fn(), + getPriceImpactForPosition: vi.fn(), +})); + +describe("getPositionKey", () => { + it("returns key in expected format", () => { + expect(getPositionKey("0xabc", "0xmarket", "0xcollateral", true)).toBe("0xabc:0xmarket:0xcollateral:true"); + }); +}); + +describe("parsePositionKey", () => { + it("parses position key string into an object", () => { + const result = parsePositionKey("0xabc:0xmarket:0xcollateral:false"); + expect(result).toEqual({ + account: "0xabc", + marketAddress: "0xmarket", + collateralAddress: "0xcollateral", + isLong: false, + }); + }); +}); + +describe("getEntryPrice", () => { + it("returns undefined if sizeInTokens <= 0", () => { + const token = { decimals: 18 } as Token; + expect(getEntryPrice({ sizeInUsd: 1000n, sizeInTokens: 0n, indexToken: token })).toBeUndefined(); + }); + + it("returns mulDiv of sizeInUsd if sizeInTokens > 0", () => { + const token = { decimals: 2 } as Token; + const result = getEntryPrice({ sizeInUsd: 1000n, sizeInTokens: 100n, indexToken: token }); + expect(result).toBe(1000n); + }); +}); + +describe("getPositionValueUsd", () => { + it("uses convertToUsd under the hood", () => { + (convertToUsd as Mock).mockReturnValueOnce(5000n); + const token = { decimals: 18 } as Token; + const result = getPositionValueUsd({ indexToken: token, sizeInTokens: 100n, markPrice: 10n }); + expect(convertToUsd).toHaveBeenCalledWith(100n, 18, 10n); + expect(result).toBe(5000n); + }); +}); + +describe("getPositionPnlUsd", () => { + const marketInfo = { indexToken: {}, maxPositionImpactFactorForLiquidations: 2n } as MarketInfo; + + beforeEach(() => { + (getMarketPnl as Mock).mockReturnValue(1000n); + (getPoolUsdWithoutPnl as Mock).mockReturnValue(5000n); + (getCappedPoolPnl as Mock).mockReturnValue(800n); + }); + + it("returns negative PnL if positionValueUsd < sizeInUsd for a long", () => { + (convertToUsd as Mock).mockReturnValueOnce(900n); // positionValueUsd + const result = getPositionPnlUsd({ + marketInfo, + sizeInUsd: 1000n, + sizeInTokens: 100n, + markPrice: 10n, + isLong: true, + }); + expect(result).toBe(900n - 1000n); // -100n + }); +}); + +describe("getPositionPendingFeesUsd", () => { + it("sums up funding and borrowing fees", () => { + expect(getPositionPendingFeesUsd({ pendingFundingFeesUsd: 10n, pendingBorrowingFeesUsd: 15n })).toBe(25n); + }); +}); + +describe("getPositionNetValue", () => { + it("calculates net position value", () => { + const result = getPositionNetValue({ + collateralUsd: 1000n, + pendingFundingFeesUsd: 10n, + pendingBorrowingFeesUsd: 15n, + closingFeeUsd: 5n, + uiFeeUsd: 20n, + pnl: 200n, + }); + // netValue = 1000n - (10n+15n) -5n -20n + 200n = 1000n -25n -5n -20n +200n=1150n + expect(result).toBe(1150n); + }); +}); + +describe("getLeverage", () => { + it("returns undefined if remainingCollateralUsd <= 0", () => { + const result = getLeverage({ + sizeInUsd: 1000n, + collateralUsd: 100n, + pnl: -200n, + pendingFundingFeesUsd: 100n, + pendingBorrowingFeesUsd: 0n, + }); + // remainingCollateralUsd=100n +(-200n)-100n= -200n + expect(result).toBeUndefined(); + }); + + it("returns correct leverage if collateralUsd > 0", () => { + const result = getLeverage({ + sizeInUsd: 2000n, + collateralUsd: 1000n, + pnl: 200n, + pendingFundingFeesUsd: 50n, + pendingBorrowingFeesUsd: 50n, + }); + // remainingCollateralUsd=1000n +200n -100n=1100n + // leverage= mulDiv(2000n, 10000n, 1100n)= (2000n*10000n)/1100n= ~18181n + expect(result).toBe(bigMath.mulDiv(2000n, 10000n, 1100n)); + }); +}); + +describe("getLiquidationPrice", () => { + beforeEach(() => { + (getPositionFee as Mock).mockReturnValue({ positionFeeUsd: 50n }); + (getPriceImpactForPosition as Mock).mockReturnValue(-100n); + (getIsEquivalentTokens as Mock).mockReturnValue(false); + }); + + it("returns undefined if sizeInUsd <= 0 or sizeInTokens <= 0", () => { + const marketInfo = { indexToken: { decimals: 18 } } as unknown as MarketInfo; + expect( + getLiquidationPrice({ + sizeInUsd: 0n, + sizeInTokens: 100n, + collateralAmount: 10n, + collateralUsd: 1000n, + collateralToken: {} as any, + marketInfo, + pendingFundingFeesUsd: 0n, + pendingBorrowingFeesUsd: 0n, + minCollateralUsd: 100n, + isLong: true, + userReferralInfo: undefined, + }) + ).toBeUndefined(); + expect( + getLiquidationPrice({ + sizeInUsd: 100n, + sizeInTokens: 0n, + collateralAmount: 10n, + collateralUsd: 1000n, + collateralToken: {} as any, + marketInfo, + pendingFundingFeesUsd: 0n, + pendingBorrowingFeesUsd: 0n, + minCollateralUsd: 100n, + isLong: true, + userReferralInfo: undefined, + }) + ).toBeUndefined(); + }); + + it("computes liquidation price for non-equivalent tokens and isLong=true", () => { + (getIsEquivalentTokens as Mock).mockReturnValue(false); + const marketInfo = { + indexToken: { decimals: 8 }, + minCollateralFactor: 1000n, // 0.001 + maxPositionImpactFactorForLiquidations: 500n, // 0.005 + } as unknown as MarketInfo; + + const result = getLiquidationPrice({ + sizeInUsd: 1000n, + sizeInTokens: 100n, + collateralAmount: 50n, // not used if tokens not equivalent + collateralToken: {} as any, + collateralUsd: 400n, + marketInfo, + pendingFundingFeesUsd: 0n, + pendingBorrowingFeesUsd: 0n, + minCollateralUsd: 200n, + isLong: true, + userReferralInfo: undefined, + }); + expect(result).toBeDefined(); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/prices.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/prices.spec.ts new file mode 100644 index 0000000..b4c0b57 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/prices.spec.ts @@ -0,0 +1,84 @@ +import {describe, expect, it} from "vitest"; + +import {getMarkPrice, getOrderThresholdType, getShouldUseMaxPrice} from "../prices.js"; +import {OrderType} from "../../types/orders.js"; +import {TokenPrices} from "../../types/tokens.js"; +import {TriggerThresholdType} from "../../types/trade.js"; + +describe("getMarkPrice", () => { + it("returns maxPrice if getShouldUseMaxPrice => true", () => { + const prices: TokenPrices = { minPrice: 1000n, maxPrice: 1500n }; + // isIncrease=true, isLong=true => getShouldUseMaxPrice => true + const result = getMarkPrice({ prices, isIncrease: true, isLong: true }); + expect(result).toBe(1500n); + }); + + it("returns minPrice if getShouldUseMaxPrice => false", () => { + const prices: TokenPrices = { minPrice: 1000n, maxPrice: 1500n }; + // isIncrease=false, isLong=true => getShouldUseMaxPrice => false + const result = getMarkPrice({ prices, isIncrease: false, isLong: true }); + expect(result).toBe(1000n); + }); +}); + +describe("getShouldUseMaxPrice", () => { + it("returns isLong if isIncrease=true", () => { + // isIncrease=true => return isLong + expect(getShouldUseMaxPrice(true, true)).toBe(true); + expect(getShouldUseMaxPrice(true, false)).toBe(false); + }); + + it("returns !isLong if isIncrease=false", () => { + // isIncrease=false => return !isLong + expect(getShouldUseMaxPrice(false, true)).toBe(false); + expect(getShouldUseMaxPrice(false, false)).toBe(true); + }); +}); + +describe("getTriggerThresholdType", () => { + it("returns Below for LimitIncrease when isLong=true", () => { + const result = getOrderThresholdType(OrderType.LimitIncrease, true); + expect(result).toBe(TriggerThresholdType.Below); + }); + + it("returns Above for LimitIncrease when isLong=false", () => { + const result = getOrderThresholdType(OrderType.LimitIncrease, false); + expect(result).toBe(TriggerThresholdType.Above); + }); + + it("returns Above for LimitDecrease when isLong=true", () => { + const result = getOrderThresholdType(OrderType.LimitDecrease, true); + expect(result).toBe(TriggerThresholdType.Above); + }); + + it("returns Below for LimitDecrease when isLong=false", () => { + const result = getOrderThresholdType(OrderType.LimitDecrease, false); + expect(result).toBe(TriggerThresholdType.Below); + }); + + it("returns Below for StopLossDecrease when isLong=true", () => { + const result = getOrderThresholdType(OrderType.StopLossDecrease, true); + expect(result).toBe(TriggerThresholdType.Below); + }); + + it("returns Above for StopLossDecrease when isLong=false", () => { + const result = getOrderThresholdType(OrderType.StopLossDecrease, false); + expect(result).toBe(TriggerThresholdType.Above); + }); + + it("returns Above for StopMarketIncrease when isLong=true", () => { + const result = getOrderThresholdType(OrderType.StopIncrease, true); + expect(result).toBe(TriggerThresholdType.Above); + }); + + it("returns Below for StopMarketIncrease when isLong=false", () => { + const result = getOrderThresholdType(OrderType.StopIncrease, false); + expect(result).toBe(TriggerThresholdType.Below); + }); + + it("throws error for invalid order type", () => { + expect(() => getOrderThresholdType("SomeInvalidType" as unknown as OrderType, true)).toThrow( + "Invalid trigger order type" + ); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/referrals.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/referrals.spec.ts new file mode 100644 index 0000000..e31f80d --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/referrals.spec.ts @@ -0,0 +1,22 @@ +import {describe, expect, it} from "vitest"; + +import {decodeReferralCode, encodeReferralCode, MAX_REFERRAL_CODE_LENGTH} from "../referrals.js"; +import {zeroHash} from "viem"; + +describe("utils/referrals", () => { + it("decode(encode(x)) === x", () => { + const code = "test"; + const encoded = encodeReferralCode(code); + const decoded = decodeReferralCode(encoded); + expect(decoded).toEqual(code); + }); + + it("decodeReferralCode defaults", () => { + expect(decodeReferralCode()).toEqual(""); + expect(decodeReferralCode(zeroHash)).toEqual(""); + }); + + it("encodeReferralCode defaults", () => { + expect(encodeReferralCode(new Array(MAX_REFERRAL_CODE_LENGTH + 1).fill("0").join(""))).toEqual(zeroHash); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/subgraph.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/subgraph.spec.ts new file mode 100644 index 0000000..1167608 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/subgraph.spec.ts @@ -0,0 +1,211 @@ +import {describe, expect, it} from "vitest"; + +import {buildFiltersBody, GraphQlFilters} from "../subgraph.js"; + +describe("buildFiltersBody", () => { + it("should return empty object if no filters", () => { + const input: GraphQlFilters = {}; + + const result = buildFiltersBody(input); + + expect(result).toEqual("{}"); + }); + + it("should return correct filter string with single filter", () => { + const input: GraphQlFilters = { + foo: "bar", + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual('{foo:"bar"}'); + }); + + it("should return correct filter string with multiple filters", () => { + const input: GraphQlFilters = { + foo: "bar", + baz: "qux", + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual('{foo:"bar",baz:"qux"}'); + }); + + it("should return correct filter string with nested filter", () => { + const input: GraphQlFilters = { + foo: { + bar: { + baz: "qux", + }, + }, + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual('{foo_:{bar_:{baz:"qux"}}}'); + }); + + it("should return correct filter string with or filter", () => { + const input: GraphQlFilters = { + or: [ + { + foo: "bar", + }, + { + baz: "qux", + }, + ], + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual('{or:[{foo:"bar"},{baz:"qux"}]}'); + }); + + it("should return correct filter string with and filter", () => { + const input: GraphQlFilters = { + and: [ + { + foo: "bar", + }, + { + baz: "qux", + }, + ], + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual('{and:[{foo:"bar"},{baz:"qux"}]}'); + }); + + it("should strip out undefined filters", () => { + const input: GraphQlFilters = { + foo: "bar", + baz: undefined, + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual('{foo:"bar"}'); + }); + + it("should strip out empty or", () => { + const input: GraphQlFilters = { + or: [], + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual("{}"); + }); + + it("should strip out or with empty", () => { + const input: GraphQlFilters = { + or: [ + {}, + { + foo: undefined, + }, + ], + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual("{}"); + }); + + it("should throw error if or is mixed with other filters", () => { + const input: GraphQlFilters = { + or: [ + { + foo: "bar", + }, + ], + baz: "qux", + }; + + const getResult = () => buildFiltersBody(input); + + expect(getResult).toThrowError(); + }); + + it("should throw error if and is mixed with other filters", () => { + const input: GraphQlFilters = { + and: [ + { + foo: "bar", + }, + ], + baz: "qux", + }; + + const getResult = () => buildFiltersBody(input); + + expect(getResult).toThrowError(); + }); + + it("should throw not error if empty or is mixed with other filters", () => { + const input: GraphQlFilters = { + or: [], + baz: "qux", + }; + + const getResult = () => buildFiltersBody(input); + + expect(getResult).not.toThrowError(); + }); + + it("should throw not error if empty and is mixed with other filters", () => { + const input: GraphQlFilters = { + and: [], + baz: "qux", + }; + + const getResult = () => buildFiltersBody(input); + + expect(getResult).not.toThrowError(); + }); + + it("should format string values correctly", () => { + const input: GraphQlFilters = { + foo: "bar", + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual('{foo:"bar"}'); + }); + + it("should format number values correctly", () => { + const input: GraphQlFilters = { + foo: 123, + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual("{foo:123}"); + }); + + it("should format boolean values correctly", () => { + const input: GraphQlFilters = { + foo: true, + bar: false, + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual("{foo:true,bar:false}"); + }); + + it("should format null values correctly", () => { + const input: GraphQlFilters = { + foo: null, + }; + + const result = buildFiltersBody(input); + + expect(result).toEqual("{foo:null}"); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/tokens.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/tokens.spec.ts new file mode 100644 index 0000000..eb76917 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/tokens.spec.ts @@ -0,0 +1,144 @@ +import {describe, expect, it} from "vitest"; + +import { + convertToContractPrice, + convertToContractTokenPrices, + convertToTokenAmount, + convertToUsd, + getIsEquivalentTokens, + getMidPrice, + getTokenData, + getTokensRatioByAmounts, + getTokensRatioByMinOutputAmountAndTriggerPrice, + parseContractPrice, +} from "../tokens.js"; +import {expandDecimals, PRECISION} from "../numbers.js"; +import {TOKENS} from "../../configs/tokens.js"; +import {ARBITRUM} from "../../configs/chains.js"; +import {Token, TokensData} from "../../types/tokens.js"; + +function getToken(symbol: string) { + return TOKENS[ARBITRUM].find((token) => token.symbol === symbol) as Token; +} + +describe("parseContractPrice", () => { + it("multiplies price by 10^decimals", () => { + expect(parseContractPrice(100n, 2)).toBe(100n * expandDecimals(1, 2)); + }); +}); + +describe("convertToContractPrice", () => { + it("divides price by 10^decimals", () => { + expect(convertToContractPrice(10000n, 2)).toBe(10000n / expandDecimals(1, 2)); + }); +}); + +describe("convertToContractTokenPrices", () => { + it("returns min and max contract prices", () => { + const result = convertToContractTokenPrices({ minPrice: 1000n, maxPrice: 2000n }, 2); + expect(result.min).toBe(1000n / expandDecimals(1, 2)); + expect(result.max).toBe(2000n / expandDecimals(1, 2)); + }); +}); + +describe("convertToTokenAmount", () => { + it("returns undefined if inputs are invalid", () => { + expect(convertToTokenAmount(undefined, 18, 100n)).toBeUndefined(); + expect(convertToTokenAmount(1000n, undefined, 100n)).toBeUndefined(); + expect(convertToTokenAmount(1000n, 18, 0n)).toBeUndefined(); + }); + it("converts usd to token amount", () => { + expect(convertToTokenAmount(1000n, 2, 100n)).toBe((1000n * expandDecimals(1, 2)) / 100n); + }); +}); + +describe("convertToUsd", () => { + it("returns undefined if inputs are invalid", () => { + expect(convertToUsd(undefined, 18, 100n)).toBeUndefined(); + expect(convertToUsd(1000n, undefined, 100n)).toBeUndefined(); + }); + it("converts token amount to usd", () => { + expect(convertToUsd(1000n, 2, 100n)).toBe((1000n * 100n) / expandDecimals(1, 2)); + }); +}); + +describe("getMidPrice", () => { + it("returns the average of min and max price", () => { + expect(getMidPrice({ minPrice: 10n, maxPrice: 20n })).toBe(15n); + }); +}); + +describe("getIsEquivalentTokens", () => { + it("checks address, wrappedAddress, synthetic, and symbol", () => { + expect(getIsEquivalentTokens(getToken("ETH"), getToken("WETH"))).toBe(true); + expect(getIsEquivalentTokens(getToken("ETH"), getToken("ETH"))).toBe(true); + expect( + getIsEquivalentTokens( + { address: "0xA", isSynthetic: true, symbol: "SYN" } as Token, + { address: "0xB", isSynthetic: true, symbol: "SYN" } as Token + ) + ).toBe(true); + expect(getIsEquivalentTokens(getToken("ETH"), getToken("BTC"))).toBe(false); + }); +}); + +describe("getTokenData", () => { + it("returns undefined if no token data", () => { + expect(getTokenData()).toBeUndefined(); + }); + it("returns wrapped if convertTo=wrapped and token isNative", () => { + const tokensData = { + "0xnative": { address: "0xnative", isNative: true, wrappedAddress: "0xwrap" }, + "0xwrap": { address: "0xwrap", isWrapped: true }, + } as unknown as TokensData; + expect(getTokenData(tokensData, "0xnative", "wrapped")).toEqual(tokensData["0xwrap"]); + }); +}); + +describe("getTokensRatioByAmounts", () => { + it("returns ratio of two token amounts", () => { + const fromToken = { decimals: 2 } as Token; + const toToken = { decimals: 2 } as Token; + const result = getTokensRatioByAmounts({ + fromToken, + toToken, + fromTokenAmount: 1000n, + toTokenAmount: 500n, + }); + expect(result.largestToken).toEqual(fromToken); + expect(result.ratio).toBe( + (((1000n * PRECISION) / expandDecimals(1, 2)) * PRECISION) / ((500n * PRECISION) / expandDecimals(1, 2)) + ); + }); +}); + +describe("getTokensRatioByMinOutputAmountAndTriggerPrice", () => { + it("returns ratio of two token amounts in case if triggerPrice is 0n", () => { + const fromToken = { decimals: 2 } as Token; + const toToken = { decimals: 2 } as Token; + const result = getTokensRatioByMinOutputAmountAndTriggerPrice({ + fromToken, + toToken, + fromTokenAmount: 1000n, + toTokenAmount: 500n, + triggerPrice: 0n, + minOutputAmount: 100n, + }); + expect(result.ratio).toBe(10000000000000000000000000000000n); + expect(result.allowedSwapSlippageBps).toBe(100n); + }); + it("returns ratio of two token amounts in case if triggerPrice is not 0n", () => { + const fromToken = { decimals: 2 } as Token; + const toToken = { decimals: 2 } as Token; + const result = getTokensRatioByMinOutputAmountAndTriggerPrice({ + fromToken, + toToken, + fromTokenAmount: 1000n, + toTokenAmount: 500n, + triggerPrice: 100n, + minOutputAmount: 100n, + }); + expect(result.ratio).toBe(100n); + expect(result.allowedSwapSlippageBps).toBe(9999n); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/trade.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/trade.spec.ts new file mode 100644 index 0000000..1b1f4a0 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/__tests__/trade.spec.ts @@ -0,0 +1,41 @@ +import {describe, expect, it} from "vitest"; + +import {applySlippageToMinOut, applySlippageToPrice} from "../../utils/trade/index.js"; + +describe("applySlippageToPrice", () => { + it("applies positive slippage if getShouldUseMaxPrice is true", () => { + // isIncrease=true and isLong=true => getShouldUseMaxPrice => true + const allowedSlippage = 100; // 1% + const price = 1000n; + const result = applySlippageToPrice(allowedSlippage, price, true, true); + // expected: price * (10000+100)/10000 = 1000n * 10100n / 10000n = 1010n + expect(result).toBe(1010n); + }); + + it("applies negative slippage if getShouldUseMaxPrice is false", () => { + // isIncrease=true or isLong=false => getShouldUseMaxPrice => false + const allowedSlippage = 100; // 1% + const price = 1000n; + const result = applySlippageToPrice(allowedSlippage, price, true, false); + // expected: price * (10000-100)/10000 = 1000n * 9900n / 10000n = 990n + expect(result).toBe(990n); + }); +}); + +describe("applySlippageToMinOut", () => { + it("reduces minOutputAmount by allowed slippage", () => { + const allowedSlippage = 100; // 1% + const minOutputAmount = 10_000n; + const result = applySlippageToMinOut(allowedSlippage, minOutputAmount); + // expected: minOut * (10000 - 100) / 10000 = 10_000n * 9900n / 10000n = 9900n + expect(result).toBe(9900n); + }); + + it("does nothing if slippage is zero", () => { + const allowedSlippage = 0; + const minOutputAmount = 10_000n; + const result = applySlippageToMinOut(allowedSlippage, minOutputAmount); + // expected: 10_000n * (10000 - 0) / 10000n = 10_000n + expect(result).toBe(10_000n); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/bigmath.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/bigmath.ts new file mode 100644 index 0000000..7e389e2 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/bigmath.ts @@ -0,0 +1,33 @@ +export const bigMath = { + abs(x: bigint) { + return x < 0n ? -x : x; + }, + mulDiv(x: bigint, y: bigint, z: bigint) { + return (x * y) / z; + }, + max(max: bigint, ...rest: bigint[]) { + return rest.reduce((currentMax, val) => (currentMax < val ? val : currentMax), max); + }, + min(min: bigint, ...rest: bigint[]) { + return rest.reduce((currentMin, val) => (currentMin > val ? val : currentMin), min); + }, + avg(...values: (bigint | undefined)[]) { + let sum = 0n; + let count = 0n; + for (const value of values) { + if (value !== undefined) { + sum += value; + count += 1n; + } + } + + if (count === 0n) { + return undefined; + } + + return sum / count; + }, + divRound(x: bigint, y: bigint) { + return x / y + ((x % y) * 2n > y ? 1n : 0n); + }, +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/buildUrl.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/buildUrl.ts new file mode 100644 index 0000000..77d5fa9 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/buildUrl.ts @@ -0,0 +1,7 @@ +import queryString from "query-string"; + +export function buildUrl(baseUrl: string, path: string, query?: Record) { + const qs = query ? `?${queryString.stringify(query)}` : ""; + + return `${baseUrl}${path}${qs}`; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/callContract.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/callContract.ts new file mode 100644 index 0000000..c510723 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/callContract.ts @@ -0,0 +1,201 @@ +import { Abi, Address, encodeFunctionData, PublicClient, withRetry } from "viem"; +import { getPrivyClient, getChainName } from '../../../plugins/custom/privy.js'; + +import type { GmxSdk } from "../index.js"; +import { bigMath } from "./bigmath.js"; +import { GAS_PRICE_BUFFER_MAP, GAS_PRICE_PREMIUM_MAP, MAX_FEE_PER_GAS_MAP, MAX_PRIORITY_FEE_PER_GAS_MAP } from "../configs/chains.js"; + +import { getChain } from "../configs/chains.js"; +import { BASIS_POINTS_DIVISOR_BIGINT } from "../configs/factors.js"; + +export async function getGasPrice(client: PublicClient, chainId: number) { + let maxFeePerGas = MAX_FEE_PER_GAS_MAP[chainId]; + const premium: bigint = GAS_PRICE_PREMIUM_MAP[chainId] || 0n; + + const feeData = await withRetry( + () => + client.estimateFeesPerGas({ + type: "legacy", + chain: getChain(chainId), + }), + { + delay: 200, + retryCount: 2, + shouldRetry: ({ error }) => { + const isInvalidBlockError = error?.message?.includes("invalid value for value.hash"); + + return isInvalidBlockError; + }, + } + ); + + const gasPrice = feeData.gasPrice; + + if (maxFeePerGas) { + if (gasPrice !== undefined && gasPrice !== null) { + maxFeePerGas = bigMath.max(gasPrice, maxFeePerGas); + } + + // Fetch the latest block to get baseFeePerGas for EIP-1559 fee data + const block = await client.getBlock({ blockTag: "pending" }); + if (block.baseFeePerGas !== undefined && block.baseFeePerGas !== null) { + const baseFeePerGas = block.baseFeePerGas; + + const maxPriorityFeePerGas = bigMath.max(MAX_PRIORITY_FEE_PER_GAS_MAP[chainId] ?? 0n, premium); + + // Calculate maxFeePerGas + const calculatedMaxFeePerGas = baseFeePerGas + maxPriorityFeePerGas + premium; + + return { + maxFeePerGas: bigMath.max(maxFeePerGas, calculatedMaxFeePerGas), + maxPriorityFeePerGas: maxPriorityFeePerGas + premium, + }; + } + } + + if (gasPrice === null || gasPrice === undefined) { + throw new Error("Can't fetch gas price"); + } + + const bufferBps: bigint = GAS_PRICE_BUFFER_MAP[chainId] || 0n; + const buffer = bigMath.mulDiv(gasPrice, bufferBps, BASIS_POINTS_DIVISOR_BIGINT); + + return { + gasPrice: gasPrice + buffer + premium, + }; +} + +export async function getGasLimit( + client: PublicClient, + account: Address, + contractAddress: Address, + abi: Abi, + method: string, + params: any[] = [], + value?: bigint | number +) { + const defaultValue = 0n; + + if (value === undefined || value === null) { + value = defaultValue; + } + + let gasLimit = 0n; + const data = encodeFunctionData({ + abi, + functionName: method, + args: params, + }); + + try { + const estimateGasParams = { + to: contractAddress, + data, + value: BigInt(value), + account, + }; + gasLimit = await client.estimateGas(estimateGasParams); + } catch (error) { + // This call should throw another error instead of the `error` + const callParams: any = { + to: contractAddress, + data, + value: BigInt(value), + }; + if (client.account) { + callParams.account = client.account; + } + await client.call(callParams); + // If not, we throw the original estimateGas error + throw error; + } + + if (gasLimit < 22000n) { + gasLimit = 22000n; + } + + // Add a 10% buffer to the gas limit + return (gasLimit * 11n) / 10n; +} + +export interface CallContractOpts { + value?: bigint | number; + gasLimit?: bigint | number; +} + +export async function callContract( + sdk: GmxSdk, + contractAddress: Address, + abi: Abi, + method: string, + params: any[], + opts: CallContractOpts = {} +): Promise { + const txnOpts: any = {}; + + if (opts.value) { + txnOpts.value = BigInt(opts.value); + } + + const client = sdk.publicClient; + + + try { + const txnInstance = { ...txnOpts }; + + // Get gas limit + const gasLimit = opts.gasLimit + ? BigInt(opts.gasLimit) + : await getGasLimit( + client, + sdk.config.account as Address, + contractAddress, + abi, + method, + params, + opts.value !== undefined ? BigInt(opts.value) : undefined + ); + txnInstance.gas = gasLimit; + + // Get gas price + const gasPriceData = await getGasPrice(sdk.publicClient, sdk.chainId); + if (gasPriceData.gasPrice !== undefined) { + txnInstance.gasPrice = gasPriceData.gasPrice; + } else { + txnInstance.maxFeePerGas = gasPriceData.maxFeePerGas; + txnInstance.maxPriorityFeePerGas = gasPriceData.maxPriorityFeePerGas; + } + + // Initialize Privy client and send transaction + const privy = getPrivyClient(); + const networkName = getChainName(sdk.chainId); + + const data = encodeFunctionData({ + abi, + functionName: method, + args: params, + }); + + const param = { + address: sdk.config.account as Address, + chainType: 'ethereum', + caip2: networkName, + transaction: { + to: contractAddress, + data: data, + chainId: sdk.chainId, + value: opts.value ? Number(opts.value) : undefined, + gasLimit: Number(gasLimit) + } + }; + + console.log('param', param) + + const response = await privy.walletApi.ethereum.sendTransaction(param as any); + + return response.hash; + } catch (error) { + console.error("Transaction failed:", error); + throw error; + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/common.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/common.ts new file mode 100644 index 0000000..d33c5ce --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/common.ts @@ -0,0 +1,19 @@ +declare global { + interface AbortSignal { + addEventListener(type: "abort", listener: () => void): void; + } +} + +export const sleep = (ms: number, abortSignal?: AbortSignal) => + new Promise((resolve) => { + const timeout = setTimeout(resolve, ms); + + if (abortSignal) { + abortSignal.addEventListener("abort", () => { + clearTimeout(timeout); + resolve(undefined); + }); + } + }); + +export const TIMEZONE_OFFSET_SEC = -new Date().getTimezoneOffset() * 60; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/contracts.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/contracts.ts new file mode 100644 index 0000000..48b4bbe --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/contracts.ts @@ -0,0 +1,104 @@ +export enum TxErrorType { + NotEnoughFunds = "NOT_ENOUGH_FUNDS", + UserDenied = "USER_DENIED", + Slippage = "SLIPPAGE", + RpcError = "RPC_ERROR", + NetworkChanged = "NETWORK_CHANGED", + Expired = "EXPIRED", +} + +export type ErrorPattern = { msg?: string; code?: number }; + +const TX_ERROR_PATTERNS: { [key in TxErrorType]: ErrorPattern[] } = { + [TxErrorType.NotEnoughFunds]: [ + { msg: "insufficient funds for gas" }, + { msg: "not enough funds for gas" }, + { msg: "failed to execute call with revert code InsufficientGasFunds" }, + ], + [TxErrorType.UserDenied]: [ + { msg: "User denied transaction signature" }, + { msg: "User rejected" }, + { msg: "user rejected action" }, + { msg: "ethers-user-denied" }, + { msg: "User canceled" }, + { msg: "Signing aborted by user" }, + ], + [TxErrorType.Slippage]: [ + { msg: "Router: mark price lower than limit" }, + { msg: "Router: mark price higher than limit" }, + ], + [TxErrorType.NetworkChanged]: [{ msg: "network changed" }, { msg: "Invalid network" }], + [TxErrorType.Expired]: [{ msg: "Request expired" }], + [TxErrorType.RpcError]: [ + // @see https://eips.ethereum.org/EIPS/eip-1474#error-codes + { code: -32700 }, // Parse error: Invalid JSON + { code: -32600 }, // Invalid request: JSON is not a valid request object + { code: -32601 }, // Method not found: Method does not exist + { code: -32602 }, // Invalid params: Invalid method parameters + { code: -32603 }, // Internal error: Internal JSON-RPC error + { code: -32000 }, // Invalid input: Missing or invalid parameters non-standard + { code: -32001 }, // Resource not found: Requested resource not found + { code: -32002 }, // Resource unavailable: Requested resource not available + { code: -32003 }, // Transaction rejected: Transaction creation failed + { code: -32004 }, // Method not supported: Method is not implemented + { code: -32005 }, // Limit exceeded: Request exceeds defined limit + { code: -32006 }, // JSON-RPC version not supported: Version of JSON-RPC protocol is not supported + { msg: "Non-200 status code" }, + { msg: "Request limit exceeded" }, + { msg: "Internal JSON-RPC error" }, + { msg: "Response has no error or result" }, + { msg: "we can't execute this request" }, + { msg: "couldn't connect to the network" }, + ], +}; + +export type TxError = { + message?: string; + code?: number; + data?: any; + error?: any; +}; + +export function extractError(ex: TxError): [string, TxErrorType | null, any] | [] { + if (!ex) { + return []; + } + + // ethers v6 moved error to `.info` field 🤷‍♂️, + // we also fallback to `ex` cos we might catch errors from ethers v5 + // from some outdated dependency like @davatar/react + ex = (ex as any)?.info ?? ex; + let message = ex.error?.message || ex.data?.message || ex.message; + let code = ex.error?.code || ex.code; + + if (ex.error?.body) { + try { + const parsed = JSON.parse(ex.error?.body); + if (parsed?.error?.message) { + message = parsed.error.message; + } + if (parsed?.error?.code) { + code = parsed.error.code; + } + } catch (e) { + // do nothing + } + } + + if (!message && !code) { + return []; + } + + for (const [type, patterns] of Object.entries(TX_ERROR_PATTERNS)) { + for (const pattern of patterns) { + const matchCode = pattern.code && code === pattern.code; + const matchMessage = pattern.msg && message && message.includes(pattern.msg); + + if (matchCode || matchMessage) { + return [message, type as TxErrorType, ex.data]; + } + } + } + + return [message, null, ex.data]; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/estimateOraclePriceCount.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/estimateOraclePriceCount.ts new file mode 100644 index 0000000..b1d7c58 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/estimateOraclePriceCount.ts @@ -0,0 +1,24 @@ +// @see https://github.com/gmx-io/gmx-synthetics/blob/6ed9be061d8fcc0dc7bc5d34dee3bf091408a1bf/contracts/gas/GasUtils.sol#L218-L234 +export function estimateDepositOraclePriceCount(swapsCount: number): bigint { + return 3n + BigInt(swapsCount); +} + +export function estimateWithdrawalOraclePriceCount(swapsCount: number): bigint { + return 3n + BigInt(swapsCount); +} + +export function estimateOrderOraclePriceCount(swapsCount: number): bigint { + return 3n + BigInt(swapsCount); +} + +export function estimateShiftOraclePriceCount(): bigint { + return 4n; +} + +export function estimateGlvDepositOraclePriceCount(marketCount: bigint, swapsCount = 0n) { + return 2n + marketCount + swapsCount; +} + +export function estimateGlvWithdrawalOraclePriceCount(marketCount: bigint, swapsCount = 0n) { + return 2n + marketCount + swapsCount; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/executionFee.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/executionFee.spec.ts new file mode 100644 index 0000000..03cc618 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/executionFee.spec.ts @@ -0,0 +1,75 @@ +import {describe, expect, it} from "vitest"; + +import {NATIVE_TOKEN_ADDRESS} from "../../configs/tokens.js"; + +import type {GasLimitsConfig} from "../../types/fees.js"; +import type {TokensData} from "../../types/tokens.js"; + +import {getExecutionFee} from "./executionFee.js"; +import {expandDecimals} from "../numbers.js"; +import {ARBITRUM} from "../../configs/chains.js"; + +describe("getExecutionFee", () => { + const chainId = ARBITRUM; + const gasLimits = { + estimatedGasFeeBaseAmount: 600000n, + estimatedGasFeePerOraclePrice: 250000n, + estimatedFeeMultiplierFactor: 1000000000000000000000000000000n, + } as GasLimitsConfig; + + const tokensData = { + "0xAddress": { + decimals: 18, + prices: { + minPrice: expandDecimals(5, 18), + }, + }, + [NATIVE_TOKEN_ADDRESS]: { + decimals: 18, + prices: { + minPrice: expandDecimals(2, 18), + }, + }, + } as unknown as TokensData; + + it("should return undefined if native token is not found", () => { + const result = getExecutionFee(chainId, gasLimits, {}, 0n, 0n, 0n); + expect(result).toBeUndefined(); + }); + + it("should return feeUsd for native token 1-2 price", () => { + const result = getExecutionFee(chainId, gasLimits, tokensData, 5000000n, 2750000001n, 4n); + expect(result).toEqual({ + feeUsd: 36300000013200000n, + feeTokenAmount: 18150000006600000n, + gasLimit: 6600000n, + feeToken: tokensData[NATIVE_TOKEN_ADDRESS], + isFeeHigh: false, + isFeeVeryHigh: false, + }); + }); + + it("should return isFeeHigh", () => { + const result = getExecutionFee(chainId, gasLimits, tokensData, 5000000n, expandDecimals(5, 23), 4n); + expect(result).toEqual({ + feeUsd: 6600000000000000000000000000000n, + gasLimit: 6600000n, + feeTokenAmount: 3300000000000000000000000000000n, + feeToken: tokensData[NATIVE_TOKEN_ADDRESS], + isFeeHigh: true, + isFeeVeryHigh: false, + }); + }); + + it("should return isFeeHigh", () => { + const result = getExecutionFee(chainId, gasLimits, tokensData, 5000000n, expandDecimals(1, 25), 4n); + expect(result).toEqual({ + feeUsd: 132000000000000000000000000000000n, + feeTokenAmount: 66000000000000000000000000000000n, + gasLimit: 6600000n, + feeToken: tokensData[NATIVE_TOKEN_ADDRESS], + isFeeHigh: true, + isFeeVeryHigh: true, + }); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/executionFee.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/executionFee.ts new file mode 100644 index 0000000..c83b70c --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/executionFee.ts @@ -0,0 +1,171 @@ +import {getExcessiveExecutionFee, getHighExecutionFee} from "../../configs/chains.js"; +import {USD_DECIMALS} from "../../configs/factors.js"; +import {NATIVE_TOKEN_ADDRESS} from "../../configs/tokens.js"; +import {ExecutionFee, GasLimitsConfig} from "../../types/fees.js"; +import {DecreasePositionSwapType} from "../../types/orders.js"; +import {TokensData} from "../../types/tokens.js"; +import {applyFactor, expandDecimals} from "../numbers.js"; +import {convertToUsd, getTokenData} from "../tokens.js"; + + +export function getExecutionFee( + chainId: number, + gasLimits: GasLimitsConfig, + tokensData: TokensData, + estimatedGasLimit: bigint, + gasPrice: bigint, + oraclePriceCount: bigint +): ExecutionFee | undefined { + const nativeToken = getTokenData(tokensData, NATIVE_TOKEN_ADDRESS); + + if (!nativeToken) return undefined; + + // #region adjustGasLimitForEstimate. Copy from contract. + let baseGasLimit = gasLimits.estimatedGasFeeBaseAmount; + baseGasLimit += gasLimits.estimatedGasFeePerOraclePrice * oraclePriceCount; + const multiplierFactor = gasLimits.estimatedFeeMultiplierFactor; + const gasLimit = baseGasLimit + applyFactor(estimatedGasLimit, multiplierFactor); + // #endregion + + const feeTokenAmount = gasLimit * gasPrice; + + const feeUsd = convertToUsd(feeTokenAmount, nativeToken.decimals, nativeToken.prices.minPrice)!; + + const isFeeHigh = feeUsd > expandDecimals(getHighExecutionFee(chainId), USD_DECIMALS); + const isFeeVeryHigh = feeUsd > expandDecimals(getExcessiveExecutionFee(chainId), USD_DECIMALS); + + return { + feeUsd, + feeTokenAmount, + feeToken: nativeToken, + gasLimit, + isFeeHigh, + isFeeVeryHigh, + }; +} + +/** + * Copy from contract: `estimateExecuteIncreaseOrderGasLimit` + */ +export function estimateExecuteIncreaseOrderGasLimit( + gasLimits: GasLimitsConfig, + order: { swapsCount?: number; callbackGasLimit?: bigint } +) { + const gasPerSwap = gasLimits.singleSwap; + const swapsCount = BigInt(order.swapsCount ?? 0); + + return gasLimits.increaseOrder + gasPerSwap * swapsCount + (order.callbackGasLimit ?? 0n); +} + +/** + * Copy from contract: `estimateExecuteDecreaseOrderGasLimit` + */ +export function estimateExecuteDecreaseOrderGasLimit( + gasLimits: GasLimitsConfig, + order: { swapsCount: number; callbackGasLimit?: bigint; decreaseSwapType?: DecreasePositionSwapType } +) { + const gasPerSwap = gasLimits.singleSwap; + let swapsCount = BigInt(order.swapsCount); + + if (order.decreaseSwapType !== DecreasePositionSwapType.NoSwap) { + swapsCount += 1n; + } + + return gasLimits.decreaseOrder + gasPerSwap * swapsCount + (order.callbackGasLimit ?? 0n); +} + +export function estimateExecuteSwapOrderGasLimit( + gasLimits: GasLimitsConfig, + order: { swapsCount: number; callbackGasLimit?: bigint } +) { + const gasPerSwap = gasLimits.singleSwap; + const swapsCount = BigInt(order.swapsCount); + + return gasLimits.swapOrder + gasPerSwap * swapsCount + (order.callbackGasLimit ?? 0n); +} + +/** + * Only GM deposits. Do not confuse with increase with zero delta size. + * + * Copy from contract: `estimateExecuteDepositGasLimit` + */ +export function estimateExecuteDepositGasLimit( + gasLimits: GasLimitsConfig, + deposit: { + // We do not use this yet + longTokenSwapsCount?: number; + // We do not use this yet + shortTokenSwapsCount?: number; + callbackGasLimit?: bigint; + } +) { + const gasPerSwap = gasLimits.singleSwap; + const swapsCount = BigInt((deposit.longTokenSwapsCount ?? 0) + (deposit.shortTokenSwapsCount ?? 0)); + const gasForSwaps = swapsCount * gasPerSwap; + + return gasLimits.depositToken + (deposit.callbackGasLimit ?? 0n) + gasForSwaps; +} + +export function estimateExecuteGlvDepositGasLimit( + gasLimits: GasLimitsConfig, + { + marketsCount, + isMarketTokenDeposit, + }: { + isMarketTokenDeposit; + marketsCount: bigint; + initialLongTokenAmount: bigint; + initialShortTokenAmount: bigint; + } +) { + const gasPerGlvPerMarket = gasLimits.glvPerMarketGasLimit; + const gasForGlvMarkets = gasPerGlvPerMarket * marketsCount; + const glvDepositGasLimit = gasLimits.glvDepositGasLimit; + const gasLimit = glvDepositGasLimit + gasForGlvMarkets; + + if (isMarketTokenDeposit) { + return gasLimit; + } + + return gasLimit + gasLimits.depositToken; +} + +export function estimateExecuteGlvWithdrawalGasLimit( + gasLimits: GasLimitsConfig, + { + marketsCount, + }: { + marketsCount: bigint; + } +) { + const gasPerGlvPerMarket = gasLimits.glvPerMarketGasLimit; + const gasForGlvMarkets = gasPerGlvPerMarket * marketsCount; + const glvWithdrawalGasLimit = gasLimits.glvWithdrawalGasLimit; + const gasLimit = glvWithdrawalGasLimit + gasForGlvMarkets; + + return gasLimit + gasLimits.withdrawalMultiToken; +} + +/** + * Only GM withdrawals. Do not confuse with decrease with zero delta size. + * + * Copy from contract: `estimateExecuteWithdrawalGasLimit` + */ +export function estimateExecuteWithdrawalGasLimit( + gasLimits: GasLimitsConfig, + withdrawal: { callbackGasLimit?: bigint } +) { + // Swap is not used but supported in the contract. + // const gasPerSwap = gasLimits.singleSwap; + // const swapsCount = 0n; + // const gasForSwaps = swapsCount * gasPerSwap; + + return gasLimits.withdrawalMultiToken + (withdrawal.callbackGasLimit ?? 0n); +} + +/** + * Copy from contract: `estimateExecuteShiftGasLimit` + */ +export function estimateExecuteShiftGasLimit(gasLimits: GasLimitsConfig, shift: { callbackGasLimit?: bigint }) { + return gasLimits.shift + (shift.callbackGasLimit ?? 0n); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/index.ts new file mode 100644 index 0000000..3f00caf --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/index.ts @@ -0,0 +1,149 @@ +import { HIGH_PRICE_IMPACT_BPS } from "../../configs/factors.js"; +import { FeeItem } from "../../types/fees.js"; +import { MarketInfo } from "../../types/markets.js"; +import { SwapStats } from "../../types/trade.js"; +import { bigMath } from "../bigmath.js"; +import { applyFactor, getBasisPoints, PRECISION } from "../numbers.js"; + +export * from "./estimateOraclePriceCount.js"; +export * from "./executionFee.js"; +export * from "./priceImpact.js"; + +export function getSwapFee(marketInfo: MarketInfo, swapAmount: bigint, forPositiveImpact: boolean) { + const factor = forPositiveImpact + ? marketInfo.swapFeeFactorForPositiveImpact + : marketInfo.swapFeeFactorForNegativeImpact; + + return applyFactor(swapAmount, factor); +} + +export function getPositionFee( + marketInfo: MarketInfo, + sizeDeltaUsd: bigint, + forPositiveImpact: boolean, + referralInfo: { totalRebateFactor: bigint; discountFactor: bigint } | undefined, + uiFeeFactor?: bigint +) { + const factor = forPositiveImpact + ? marketInfo.positionFeeFactorForPositiveImpact + : marketInfo.positionFeeFactorForNegativeImpact; + + let positionFeeUsd = applyFactor(sizeDeltaUsd, factor); + const uiFeeUsd = applyFactor(sizeDeltaUsd, uiFeeFactor ?? 0n); + + if (!referralInfo) { + return { positionFeeUsd, discountUsd: 0n, totalRebateUsd: 0n }; + } + + const totalRebateUsd = applyFactor(positionFeeUsd, referralInfo.totalRebateFactor); + const discountUsd = applyFactor(totalRebateUsd, referralInfo.discountFactor); + + positionFeeUsd = positionFeeUsd - discountUsd; + + return { + positionFeeUsd, + discountUsd, + totalRebateUsd, + uiFeeUsd, + }; +} + +export function getFundingFactorPerPeriod(marketInfo: MarketInfo, isLong: boolean, periodInSeconds: number) { + const { fundingFactorPerSecond, longsPayShorts, longInterestUsd, shortInterestUsd } = marketInfo; + + const largerInterestUsd = bigMath.max(longInterestUsd, shortInterestUsd); + + const payingInterestUsd = longsPayShorts ? longInterestUsd : shortInterestUsd; + const receivingInterestUsd = longsPayShorts ? shortInterestUsd : longInterestUsd; + + let fundingForPayingSide = 0n; + if (payingInterestUsd !== 0n) { + fundingForPayingSide = bigMath.mulDiv(fundingFactorPerSecond, largerInterestUsd, payingInterestUsd); + } + let fundingForReceivingSide = 0n; + if (receivingInterestUsd !== 0n) { + fundingForReceivingSide = bigMath.mulDiv(fundingForPayingSide, payingInterestUsd, receivingInterestUsd); + } + + if ((longsPayShorts && isLong) || (!longsPayShorts && !isLong)) { + // paying side + return fundingForPayingSide * BigInt(periodInSeconds) * -1n; + } else { + // receiving side + return fundingForReceivingSide * BigInt(periodInSeconds); + } +} + +export function getFundingFeeRateUsd( + marketInfo: MarketInfo, + isLong: boolean, + sizeInUsd: bigint, + periodInSeconds: number +) { + const factor = getFundingFactorPerPeriod(marketInfo, isLong, periodInSeconds); + + return applyFactor(sizeInUsd, factor); +} + +export function getBorrowingFactorPerPeriod(marketInfo: MarketInfo, isLong: boolean, periodInSeconds: number) { + const factorPerSecond = isLong + ? marketInfo.borrowingFactorPerSecondForLongs + : marketInfo.borrowingFactorPerSecondForShorts; + + return factorPerSecond * BigInt(periodInSeconds || 1); +} + +export function getBorrowingFeeRateUsd( + marketInfo: MarketInfo, + isLong: boolean, + sizeInUsd: bigint, + periodInSeconds: number +) { + const factor = getBorrowingFactorPerPeriod(marketInfo, isLong, periodInSeconds); + + return applyFactor(sizeInUsd, factor); +} + +export function getIsHighPriceImpact(positionPriceImpact?: FeeItem, swapPriceImpact?: FeeItem) { + const totalPriceImpact = getTotalFeeItem([positionPriceImpact, swapPriceImpact]); + return totalPriceImpact.deltaUsd < 0 && bigMath.abs(totalPriceImpact.bps) >= HIGH_PRICE_IMPACT_BPS; +} + +export function getFeeItem( + feeDeltaUsd?: bigint, + basis?: bigint, + opts: { shouldRoundUp?: boolean } = {} +): FeeItem | undefined { + const { shouldRoundUp = false } = opts; + if (feeDeltaUsd === undefined) return undefined; + + return { + deltaUsd: feeDeltaUsd, + bps: basis !== undefined && basis > 0 ? getBasisPoints(feeDeltaUsd, basis, shouldRoundUp) : 0n, + precisePercentage: basis !== undefined && basis > 0 ? bigMath.mulDiv(feeDeltaUsd, PRECISION, basis) : 0n, + }; +} + +export function getTotalFeeItem(feeItems: (FeeItem | undefined)[]): FeeItem { + const totalFeeItem: FeeItem = { + deltaUsd: 0n, + bps: 0n, + precisePercentage: 0n, + }; + + (feeItems.filter(Boolean) as FeeItem[]).forEach((feeItem) => { + totalFeeItem.deltaUsd = totalFeeItem.deltaUsd + feeItem.deltaUsd; + totalFeeItem.bps = totalFeeItem.bps + feeItem.bps; + totalFeeItem.precisePercentage = totalFeeItem.precisePercentage + feeItem.precisePercentage; + }); + + return totalFeeItem; +} + +export function getTotalSwapVolumeFromSwapStats(swapSteps?: SwapStats[]) { + if (!swapSteps) return 0n; + + return swapSteps.reduce((acc, curr) => { + return acc + curr.usdIn; + }, 0n); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/priceImpact.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/priceImpact.ts new file mode 100644 index 0000000..e563bd6 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/fees/priceImpact.ts @@ -0,0 +1,426 @@ +import { bigNumberify } from "../../modules/trades/trades.js"; +import { MarketInfo } from "../../types/markets.js"; +import { TokenData } from "../../types/tokens.js"; +import { bigMath } from "../bigmath.js"; +import { getTokenPoolType } from "../markets.js"; +import { applyFactor, expandDecimals, getBasisPoints, roundUpMagnitudeDivision } from "../numbers.js"; +import { convertToTokenAmount, convertToUsd, getMidPrice } from "../tokens.js"; + +export function getPriceImpactByAcceptablePrice(p: { + sizeDeltaUsd: bigint; + acceptablePrice: bigint; + indexPrice: bigint; + isLong: boolean; + isIncrease: boolean; +}) { + const { sizeDeltaUsd, acceptablePrice, indexPrice: markPrice, isLong, isIncrease } = p; + + const shouldFlipPriceDiff = isIncrease ? !isLong : isLong; + + const priceDelta = (markPrice - acceptablePrice) * (shouldFlipPriceDiff ? -1n : 1n); + const acceptablePriceDeltaBps = markPrice === 0n ? 0n : getBasisPoints(priceDelta, markPrice); + + const priceImpactDeltaUsd = acceptablePrice === 0n ? 0n : (sizeDeltaUsd * priceDelta) / acceptablePrice; + + const priceImpactDeltaAmount = markPrice === 0n ? 0n : priceImpactDeltaUsd / markPrice; + + return { + priceImpactDeltaUsd, + priceImpactDeltaAmount, + priceDelta, + acceptablePriceDeltaBps, + }; +} + +export function applySwapImpactWithCap(marketInfo: MarketInfo, token: TokenData, priceImpactDeltaUsd: bigint) { + const tokenPoolType = getTokenPoolType(marketInfo, token.address); + + if (!tokenPoolType) { + throw new Error(`Token ${token.address} is not a collateral of the market ${marketInfo.marketTokenAddress}`); + } + + const isLongCollateral = tokenPoolType === "long"; + const price = priceImpactDeltaUsd > 0 ? token.prices.maxPrice : token.prices.minPrice; + + let impactDeltaAmount: bigint; + let cappedDiffUsd = 0n; + + if (priceImpactDeltaUsd > 0) { + // round positive impactAmount down, this will be deducted from the swap impact pool for the user + impactDeltaAmount = convertToTokenAmount(priceImpactDeltaUsd, token.decimals, price)!; + + const maxImpactAmount = isLongCollateral + ? marketInfo.swapImpactPoolAmountLong + : marketInfo.swapImpactPoolAmountShort; + + if (impactDeltaAmount > maxImpactAmount) { + cappedDiffUsd = bigMath.mulDiv(impactDeltaAmount - maxImpactAmount, price, expandDecimals(1, token.decimals)); + impactDeltaAmount = maxImpactAmount; + } + } else { + // round negative impactAmount up, this will be deducted from the user + impactDeltaAmount = roundUpMagnitudeDivision(priceImpactDeltaUsd * expandDecimals(1, token.decimals), price); + } + + return { impactDeltaAmount, cappedDiffUsd }; +} + +export function getCappedPositionImpactUsd( + marketInfo: MarketInfo, + sizeDeltaUsd: bigint, + isLong: boolean, + opts: { fallbackToZero?: boolean } = {} +) { + const priceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, sizeDeltaUsd, isLong, opts); + + if (priceImpactDeltaUsd < 0) { + return priceImpactDeltaUsd; + } + + const { indexToken } = marketInfo; + + const impactPoolAmount = marketInfo?.positionImpactPoolAmount; + + const maxPriceImpactUsdBasedOnImpactPool = convertToUsd( + impactPoolAmount, + indexToken.decimals, + indexToken.prices.minPrice + )!; + + let cappedImpactUsd = priceImpactDeltaUsd; + + if (cappedImpactUsd > maxPriceImpactUsdBasedOnImpactPool) { + cappedImpactUsd = maxPriceImpactUsdBasedOnImpactPool; + } + + const maxPriceImpactFactor = marketInfo.maxPositionImpactFactorPositive; + const maxPriceImpactUsdBasedOnMaxPriceImpactFactor = applyFactor(bigMath.abs(sizeDeltaUsd), maxPriceImpactFactor); + + if (cappedImpactUsd > maxPriceImpactUsdBasedOnMaxPriceImpactFactor) { + cappedImpactUsd = maxPriceImpactUsdBasedOnMaxPriceImpactFactor; + } + + return cappedImpactUsd; +} + +export function getPriceImpactForPosition( + marketInfo: MarketInfo, + sizeDeltaUsd: bigint, + isLong: boolean, + opts: { fallbackToZero?: boolean } = {} +) { + const { longInterestUsd, shortInterestUsd } = marketInfo; + + const { currentLongUsd, currentShortUsd, nextLongUsd, nextShortUsd } = getNextOpenInterestParams({ + currentLongUsd: longInterestUsd, + currentShortUsd: shortInterestUsd, + usdDelta: sizeDeltaUsd, + isLong: isLong!, + }); + + const priceImpactUsd = getPriceImpactUsd({ + currentLongUsd, + currentShortUsd, + nextLongUsd, + nextShortUsd, + factorPositive: marketInfo.positionImpactFactorPositive, + factorNegative: marketInfo.positionImpactFactorNegative, + exponentFactor: marketInfo.positionImpactExponentFactor, + fallbackToZero: opts.fallbackToZero, + }); + + if (priceImpactUsd > 0) { + return priceImpactUsd; + } + + if (bigMath.abs(marketInfo.virtualInventoryForPositions) <= 0) { + return priceImpactUsd; + } + + const virtualInventoryParams = getNextOpenInterestForVirtualInventory({ + virtualInventory: marketInfo.virtualInventoryForPositions, + usdDelta: sizeDeltaUsd, + isLong: isLong!, + }); + + const priceImpactUsdForVirtualInventory = getPriceImpactUsd({ + currentLongUsd: virtualInventoryParams.currentLongUsd, + currentShortUsd: virtualInventoryParams.currentShortUsd, + nextLongUsd: virtualInventoryParams.nextLongUsd, + nextShortUsd: virtualInventoryParams.nextShortUsd, + factorPositive: marketInfo.positionImpactFactorPositive, + factorNegative: marketInfo.positionImpactFactorNegative, + exponentFactor: marketInfo.positionImpactExponentFactor, + fallbackToZero: opts.fallbackToZero, + }); + + return priceImpactUsdForVirtualInventory < priceImpactUsd! ? priceImpactUsdForVirtualInventory : priceImpactUsd; +} + +export function getPriceImpactForSwap( + marketInfo: MarketInfo, + tokenA: TokenData, + tokenB: TokenData, + usdDeltaTokenA: bigint, + usdDeltaTokenB: bigint, + opts: { fallbackToZero?: boolean } = {} +) { + const tokenAPoolType = getTokenPoolType(marketInfo, tokenA.address); + const tokenBPoolType = getTokenPoolType(marketInfo, tokenB.address); + + if ( + tokenAPoolType === undefined || + tokenBPoolType === undefined || + (tokenAPoolType === tokenBPoolType && !marketInfo.isSameCollaterals) + ) { + throw new Error(`Invalid tokens to swap ${marketInfo.marketTokenAddress} ${tokenA.address} ${tokenB.address}`); + } + + const [longToken, shortToken] = tokenAPoolType === "long" ? [tokenA, tokenB] : [tokenB, tokenA]; + const [longDeltaUsd, shortDeltaUsd] = + tokenAPoolType === "long" ? [usdDeltaTokenA, usdDeltaTokenB] : [usdDeltaTokenB, usdDeltaTokenA]; + + const { longPoolUsd, shortPoolUsd, nextLongPoolUsd, nextShortPoolUsd } = getNextPoolAmountsParams({ + marketInfo, + longToken, + shortToken, + longPoolAmount: marketInfo.longPoolAmount, + shortPoolAmount: marketInfo.shortPoolAmount, + longDeltaUsd, + shortDeltaUsd, + }); + + const priceImpactUsd = getPriceImpactUsd({ + currentLongUsd: longPoolUsd, + currentShortUsd: shortPoolUsd, + nextLongUsd: nextLongPoolUsd, + nextShortUsd: nextShortPoolUsd, + factorPositive: marketInfo.swapImpactFactorPositive, + factorNegative: marketInfo.swapImpactFactorNegative, + exponentFactor: marketInfo.swapImpactExponentFactor, + fallbackToZero: opts.fallbackToZero, + }); + + if (priceImpactUsd > 0) { + return priceImpactUsd; + } + + const virtualInventoryLong = marketInfo.virtualPoolAmountForLongToken; + const virtualInventoryShort = marketInfo.virtualPoolAmountForShortToken; + + if (virtualInventoryLong <= 0 || virtualInventoryShort <= 0) { + return priceImpactUsd; + } + + const virtualInventoryParams = getNextPoolAmountsParams({ + marketInfo, + longToken, + shortToken, + longPoolAmount: virtualInventoryLong, + shortPoolAmount: virtualInventoryShort, + longDeltaUsd, + shortDeltaUsd, + }); + + const priceImpactUsdForVirtualInventory = getPriceImpactUsd({ + currentLongUsd: virtualInventoryParams.longPoolUsd, + currentShortUsd: virtualInventoryParams.shortPoolUsd, + nextLongUsd: virtualInventoryParams.nextLongPoolUsd, + nextShortUsd: virtualInventoryParams.nextShortPoolUsd, + factorPositive: marketInfo.swapImpactFactorPositive, + factorNegative: marketInfo.swapImpactFactorNegative, + exponentFactor: marketInfo.swapImpactExponentFactor, + fallbackToZero: opts.fallbackToZero, + }); + + return priceImpactUsdForVirtualInventory < priceImpactUsd! ? priceImpactUsdForVirtualInventory : priceImpactUsd; +} + +function getNextOpenInterestForVirtualInventory(p: { virtualInventory: bigint; usdDelta: bigint; isLong: boolean }) { + const { virtualInventory, usdDelta, isLong } = p; + + let currentLongUsd = 0n; + let currentShortUsd = 0n; + + if (virtualInventory > 0) { + currentShortUsd = virtualInventory; + } else { + currentLongUsd = virtualInventory * -1n; + } + + if (usdDelta < 0) { + const offset = bigMath.abs(usdDelta); + currentLongUsd = currentLongUsd + offset; + currentShortUsd = currentShortUsd + offset; + } + + return getNextOpenInterestParams({ + currentLongUsd, + currentShortUsd, + usdDelta, + isLong, + }); +} + +function getNextOpenInterestParams(p: { + currentLongUsd: bigint; + currentShortUsd: bigint; + usdDelta: bigint; + isLong: boolean; +}) { + const { currentLongUsd, currentShortUsd, usdDelta, isLong } = p; + + let nextLongUsd = currentLongUsd; + let nextShortUsd = currentShortUsd; + + if (isLong) { + nextLongUsd = (currentLongUsd ?? 0n) + (usdDelta ?? 0n); + } else { + nextShortUsd = (currentShortUsd ?? 0n) + (usdDelta ?? 0n); + } + + return { + currentLongUsd, + currentShortUsd, + nextLongUsd, + nextShortUsd, + }; +} + +export function getNextPoolAmountsParams(p: { + marketInfo: MarketInfo; + longToken: TokenData; + shortToken: TokenData; + longPoolAmount: bigint; + shortPoolAmount: bigint; + longDeltaUsd: bigint; + shortDeltaUsd: bigint; +}) { + const { marketInfo, longToken, shortToken, longPoolAmount, shortPoolAmount, longDeltaUsd, shortDeltaUsd } = p; + + const longPrice = getMidPrice(longToken.prices); + const shortPrice = getMidPrice(shortToken.prices); + + const longPoolUsd = convertToUsd(longPoolAmount, longToken.decimals, longPrice)!; + const shortPoolUsd = convertToUsd(shortPoolAmount, shortToken.decimals, shortPrice)!; + + const longPoolUsdAdjustment = convertToUsd(marketInfo.longPoolAmountAdjustment, longToken.decimals, longPrice)!; + const shortPoolUsdAdjustment = convertToUsd(marketInfo.shortPoolAmountAdjustment, shortToken.decimals, shortPrice)!; + + const nextLongPoolUsd = longPoolUsd + longDeltaUsd + longPoolUsdAdjustment; + const nextShortPoolUsd = shortPoolUsd + shortDeltaUsd + shortPoolUsdAdjustment; + + return { + longPoolUsd, + shortPoolUsd, + nextLongPoolUsd, + nextShortPoolUsd, + }; +} + +/** + * @see https://github.com/gmx-io/gmx-synthetics/blob/updates/contracts/pricing/SwapPricingUtils.sol + */ +export function getPriceImpactUsd(p: { + currentLongUsd: bigint; + currentShortUsd: bigint; + nextLongUsd: bigint; + nextShortUsd: bigint; + factorPositive: bigint; + factorNegative: bigint; + exponentFactor: bigint; + fallbackToZero?: boolean; +}) { + const { nextLongUsd, nextShortUsd } = p; + + if (nextLongUsd < 0 || nextShortUsd < 0) { + if (p.fallbackToZero) { + return 0n; + } else { + throw new Error("Negative pool amount"); + } + } + + const currentDiff = bigMath.abs(p.currentLongUsd - p.currentShortUsd); + const nextDiff = bigMath.abs(nextLongUsd - nextShortUsd); + + const isSameSideRebalance = p.currentLongUsd < p.currentShortUsd === nextLongUsd < nextShortUsd; + + let impactUsd: bigint; + + if (isSameSideRebalance) { + const hasPositiveImpact = nextDiff < currentDiff; + const factor = hasPositiveImpact ? p.factorPositive : p.factorNegative; + + impactUsd = calculateImpactForSameSideRebalance({ + currentDiff, + nextDiff, + hasPositiveImpact, + factor, + exponentFactor: p.exponentFactor, + }); + } else { + impactUsd = calculateImpactForCrossoverRebalance({ + currentDiff, + nextDiff, + factorPositive: p.factorPositive, + factorNegative: p.factorNegative, + exponentFactor: p.exponentFactor, + }); + } + + return impactUsd; +} + +/** + * @see https://github.com/gmx-io/gmx-synthetics/blob/5fd9991ff2c37ae5f24f03bc9c132730b012ebf2/contracts/pricing/PricingUtils.sol + */ +export function calculateImpactForSameSideRebalance(p: { + currentDiff: bigint; + nextDiff: bigint; + hasPositiveImpact: boolean; + factor: bigint; + exponentFactor: bigint; +}) { + const { currentDiff, nextDiff, hasPositiveImpact, factor, exponentFactor } = p; + + const currentImpact = applyImpactFactor(currentDiff, factor, exponentFactor); + const nextImpact = applyImpactFactor(nextDiff, factor, exponentFactor); + + const deltaDiff = bigMath.abs(currentImpact - nextImpact); + + return hasPositiveImpact ? deltaDiff : -deltaDiff; +} + +/** + * @see https://github.com/gmx-io/gmx-synthetics/blob/5fd9991ff2c37ae5f24f03bc9c132730b012ebf2/contracts/pricing/PricingUtils.sol + */ +export function calculateImpactForCrossoverRebalance(p: { + currentDiff: bigint; + nextDiff: bigint; + factorPositive: bigint; + factorNegative: bigint; + exponentFactor: bigint; +}) { + const { currentDiff, nextDiff, factorNegative, factorPositive, exponentFactor } = p; + + const positiveImpact = applyImpactFactor(currentDiff, factorPositive, exponentFactor); + const negativeImpactUsd = applyImpactFactor(nextDiff, factorNegative, exponentFactor); + + const deltaDiffUsd = bigMath.abs(positiveImpact - negativeImpactUsd); + + return positiveImpact > negativeImpactUsd ? deltaDiffUsd : -deltaDiffUsd; +} + +export function applyImpactFactor(diff: bigint, factor: bigint, exponent: bigint) { + // Convert diff and exponent to float js numbers + const _diff = Number(diff) / 10 ** 30; + const _exponent = Number(exponent) / 10 ** 30; + + // Pow and convert back to BigInt with 30 decimals + let result = bigNumberify(BigInt(Math.round(_diff ** _exponent * 10 ** 30)))!; + + result = (result * factor) / expandDecimals(1, 30); + + return result; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/graphqlFetcher.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/graphqlFetcher.ts new file mode 100644 index 0000000..9f28d5e --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/graphqlFetcher.ts @@ -0,0 +1,24 @@ +import fetch from "cross-fetch"; + +export default async function graphqlFetcher( + endpoint: string, + query: string, + variables?: object +): Promise { + try { + const response = await fetch(endpoint, { + body: JSON.stringify({ query, variables }), + headers: { "Content-type": "application/json" }, + method: "POST", + }); + + if (!response.ok) { + throw new Error(`HTTP error: ${response.status}`); + } + + const { data } = await response.json(); + return data; + } catch (error) { + throw new Error(`Error fetching GraphQL query: ${error}`); + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/hash.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/hash.ts new file mode 100644 index 0000000..64499f2 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/hash.ts @@ -0,0 +1,57 @@ +import {encodeAbiParameters, keccak256} from "viem"; +import {LRUCache} from "./LruCache.js"; + +const dataCache = new LRUCache(10_000); + +export function hashData(dataTypes, dataValues) { + const key = JSON.stringify({ dataTypes, dataValues }, (_, val) => (typeof val === "bigint" ? String(val) : val)); + + if (dataCache.has(key)) { + return dataCache.get(key)!; + } + + // Convert dataTypes from array of strings to array of objects with 'type' property + const abiParameters = dataTypes.map((type) => ({ type })); + const bytes = encodeAbiParameters(abiParameters, dataValues); + const hash = keccak256(bytes); + + dataCache.set(key, hash); + + return hash; +} + +const stringCache = new LRUCache(10_000); + +export function hashString(string: string) { + if (stringCache.has(string)) { + return stringCache.get(string)!; + } + + const hash = hashData(["string"], [string]); + stringCache.set(string, hash); + + return hash; +} + +export function hashDataMap< + R extends Record, +>( + map: R +): { + [K in keyof R]: string; +} { + const result = {}; + for (const key of Object.keys(map)) { + if (!map[key]) { + continue; + } + + const [dataTypes, dataValues] = map[key]!; + + result[key] = hashData(dataTypes, dataValues); + } + + return result as { + [K in keyof R]: string; + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/marketKeysAndConfigs.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/marketKeysAndConfigs.ts new file mode 100644 index 0000000..7dd7812 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/marketKeysAndConfigs.ts @@ -0,0 +1,301 @@ +import {hashDataMap} from "./hash.js"; + +import { + BORROWING_EXPONENT_FACTOR_KEY, + BORROWING_FACTOR_KEY, + FUNDING_DECREASE_FACTOR_PER_SECOND, + FUNDING_EXPONENT_FACTOR_KEY, + FUNDING_FACTOR_KEY, + FUNDING_INCREASE_FACTOR_PER_SECOND, + IS_MARKET_DISABLED_KEY, + MAX_FUNDING_FACTOR_PER_SECOND, + MAX_OPEN_INTEREST_KEY, + MAX_PNL_FACTOR_FOR_TRADERS_KEY, + MAX_PNL_FACTOR_KEY, + MAX_POOL_AMOUNT_KEY, + MAX_POOL_USD_FOR_DEPOSIT_KEY, + MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY, + MAX_POSITION_IMPACT_FACTOR_KEY, + MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY, + MIN_COLLATERAL_FACTOR_KEY, + MIN_FUNDING_FACTOR_PER_SECOND, + MIN_POSITION_IMPACT_POOL_AMOUNT_KEY, + OPEN_INTEREST_IN_TOKENS_KEY, + OPEN_INTEREST_KEY, + OPEN_INTEREST_RESERVE_FACTOR_KEY, + POOL_AMOUNT_ADJUSTMENT_KEY, + POOL_AMOUNT_KEY, + POSITION_FEE_FACTOR_KEY, + POSITION_IMPACT_EXPONENT_FACTOR_KEY, + POSITION_IMPACT_FACTOR_KEY, + POSITION_IMPACT_POOL_AMOUNT_KEY, + POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY, + RESERVE_FACTOR_KEY, + SWAP_FEE_FACTOR_KEY, + SWAP_IMPACT_EXPONENT_FACTOR_KEY, + SWAP_IMPACT_FACTOR_KEY, + SWAP_IMPACT_POOL_AMOUNT_KEY, + THRESHOLD_FOR_DECREASE_FUNDING, + THRESHOLD_FOR_STABLE_FUNDING, + VIRTUAL_MARKET_ID_KEY, + VIRTUAL_TOKEN_ID_KEY, +} from "../configs/dataStore.js"; +import {MarketConfig} from "../configs/markets.js"; + +export function hashMarketConfigKeys(market: MarketConfig) { + const marketAddress = market.marketTokenAddress; + return hashDataMap({ + isDisabled: [ + ["bytes32", "address"], + [IS_MARKET_DISABLED_KEY, marketAddress], + ], + maxLongPoolAmount: [ + ["bytes32", "address", "address"], + [MAX_POOL_AMOUNT_KEY, marketAddress, market.longTokenAddress], + ], + maxShortPoolAmount: [ + ["bytes32", "address", "address"], + [MAX_POOL_AMOUNT_KEY, marketAddress, market.shortTokenAddress], + ], + maxLongPoolUsdForDeposit: [ + ["bytes32", "address", "address"], + [MAX_POOL_USD_FOR_DEPOSIT_KEY, marketAddress, market.longTokenAddress], + ], + maxShortPoolUsdForDeposit: [ + ["bytes32", "address", "address"], + [MAX_POOL_USD_FOR_DEPOSIT_KEY, marketAddress, market.shortTokenAddress], + ], + longPoolAmountAdjustment: [ + ["bytes32", "address", "address"], + [POOL_AMOUNT_ADJUSTMENT_KEY, marketAddress, market.longTokenAddress], + ], + shortPoolAmountAdjustment: [ + ["bytes32", "address", "address"], + [POOL_AMOUNT_ADJUSTMENT_KEY, marketAddress, market.shortTokenAddress], + ], + reserveFactorLong: [ + ["bytes32", "address", "bool"], + [RESERVE_FACTOR_KEY, marketAddress, true], + ], + reserveFactorShort: [ + ["bytes32", "address", "bool"], + [RESERVE_FACTOR_KEY, marketAddress, false], + ], + openInterestReserveFactorLong: [ + ["bytes32", "address", "bool"], + [OPEN_INTEREST_RESERVE_FACTOR_KEY, marketAddress, true], + ], + openInterestReserveFactorShort: [ + ["bytes32", "address", "bool"], + [OPEN_INTEREST_RESERVE_FACTOR_KEY, marketAddress, false], + ], + maxOpenInterestLong: [ + ["bytes32", "address", "bool"], + [MAX_OPEN_INTEREST_KEY, marketAddress, true], + ], + maxOpenInterestShort: [ + ["bytes32", "address", "bool"], + [MAX_OPEN_INTEREST_KEY, marketAddress, false], + ], + minPositionImpactPoolAmount: [ + ["bytes32", "address"], + [MIN_POSITION_IMPACT_POOL_AMOUNT_KEY, marketAddress], + ], + positionImpactPoolDistributionRate: [ + ["bytes32", "address"], + [POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY, marketAddress], + ], + borrowingFactorLong: [ + ["bytes32", "address", "bool"], + [BORROWING_FACTOR_KEY, marketAddress, true], + ], + borrowingFactorShort: [ + ["bytes32", "address", "bool"], + [BORROWING_FACTOR_KEY, marketAddress, false], + ], + borrowingExponentFactorLong: [ + ["bytes32", "address", "bool"], + [BORROWING_EXPONENT_FACTOR_KEY, marketAddress, true], + ], + borrowingExponentFactorShort: [ + ["bytes32", "address", "bool"], + [BORROWING_EXPONENT_FACTOR_KEY, marketAddress, false], + ], + fundingFactor: [ + ["bytes32", "address"], + [FUNDING_FACTOR_KEY, marketAddress], + ], + fundingExponentFactor: [ + ["bytes32", "address"], + [FUNDING_EXPONENT_FACTOR_KEY, marketAddress], + ], + fundingIncreaseFactorPerSecond: [ + ["bytes32", "address"], + [FUNDING_INCREASE_FACTOR_PER_SECOND, marketAddress], + ], + fundingDecreaseFactorPerSecond: [ + ["bytes32", "address"], + [FUNDING_DECREASE_FACTOR_PER_SECOND, marketAddress], + ], + thresholdForStableFunding: [ + ["bytes32", "address"], + [THRESHOLD_FOR_STABLE_FUNDING, marketAddress], + ], + thresholdForDecreaseFunding: [ + ["bytes32", "address"], + [THRESHOLD_FOR_DECREASE_FUNDING, marketAddress], + ], + minFundingFactorPerSecond: [ + ["bytes32", "address"], + [MIN_FUNDING_FACTOR_PER_SECOND, marketAddress], + ], + maxFundingFactorPerSecond: [ + ["bytes32", "address"], + [MAX_FUNDING_FACTOR_PER_SECOND, marketAddress], + ], + maxPnlFactorForTradersLong: [ + ["bytes32", "bytes32", "address", "bool"], + [MAX_PNL_FACTOR_KEY, MAX_PNL_FACTOR_FOR_TRADERS_KEY, marketAddress, true], + ], + maxPnlFactorForTradersShort: [ + ["bytes32", "bytes32", "address", "bool"], + [MAX_PNL_FACTOR_KEY, MAX_PNL_FACTOR_FOR_TRADERS_KEY, marketAddress, false], + ], + positionFeeFactorForPositiveImpact: [ + ["bytes32", "address", "bool"], + [POSITION_FEE_FACTOR_KEY, marketAddress, true], + ], + positionFeeFactorForNegativeImpact: [ + ["bytes32", "address", "bool"], + [POSITION_FEE_FACTOR_KEY, marketAddress, false], + ], + positionImpactFactorPositive: [ + ["bytes32", "address", "bool"], + [POSITION_IMPACT_FACTOR_KEY, marketAddress, true], + ], + positionImpactFactorNegative: [ + ["bytes32", "address", "bool"], + [POSITION_IMPACT_FACTOR_KEY, marketAddress, false], + ], + maxPositionImpactFactorPositive: [ + ["bytes32", "address", "bool"], + [MAX_POSITION_IMPACT_FACTOR_KEY, marketAddress, true], + ], + maxPositionImpactFactorNegative: [ + ["bytes32", "address", "bool"], + [MAX_POSITION_IMPACT_FACTOR_KEY, marketAddress, false], + ], + maxPositionImpactFactorForLiquidations: [ + ["bytes32", "address"], + [MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY, marketAddress], + ], + minCollateralFactor: [ + ["bytes32", "address"], + [MIN_COLLATERAL_FACTOR_KEY, marketAddress], + ], + minCollateralFactorForOpenInterestLong: [ + ["bytes32", "address", "bool"], + [MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY, marketAddress, true], + ], + minCollateralFactorForOpenInterestShort: [ + ["bytes32", "address", "bool"], + [MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY, marketAddress, false], + ], + positionImpactExponentFactor: [ + ["bytes32", "address"], + [POSITION_IMPACT_EXPONENT_FACTOR_KEY, marketAddress], + ], + swapFeeFactorForPositiveImpact: [ + ["bytes32", "address", "bool"], + [SWAP_FEE_FACTOR_KEY, marketAddress, true], + ], + swapFeeFactorForNegativeImpact: [ + ["bytes32", "address", "bool"], + [SWAP_FEE_FACTOR_KEY, marketAddress, false], + ], + swapImpactFactorPositive: [ + ["bytes32", "address", "bool"], + [SWAP_IMPACT_FACTOR_KEY, marketAddress, true], + ], + swapImpactFactorNegative: [ + ["bytes32", "address", "bool"], + [SWAP_IMPACT_FACTOR_KEY, marketAddress, false], + ], + swapImpactExponentFactor: [ + ["bytes32", "address"], + [SWAP_IMPACT_EXPONENT_FACTOR_KEY, marketAddress], + ], + virtualMarketId: [ + ["bytes32", "address"], + [VIRTUAL_MARKET_ID_KEY, marketAddress], + ], + virtualLongTokenId: [ + ["bytes32", "address"], + [VIRTUAL_TOKEN_ID_KEY, market.longTokenAddress], + ], + virtualShortTokenId: [ + ["bytes32", "address"], + [VIRTUAL_TOKEN_ID_KEY, market.shortTokenAddress], + ], + }); +} + +export function hashMarketValuesKeys(market: MarketConfig) { + const marketAddress = market.marketTokenAddress; + const marketKeys = hashDataMap({ + longPoolAmount: [ + ["bytes32", "address", "address"], + [POOL_AMOUNT_KEY, marketAddress, market.longTokenAddress], + ], + shortPoolAmount: [ + ["bytes32", "address", "address"], + [POOL_AMOUNT_KEY, marketAddress, market.shortTokenAddress], + ], + positionImpactPoolAmount: [ + ["bytes32", "address"], + [POSITION_IMPACT_POOL_AMOUNT_KEY, marketAddress], + ], + swapImpactPoolAmountLong: [ + ["bytes32", "address", "address"], + [SWAP_IMPACT_POOL_AMOUNT_KEY, marketAddress, market.longTokenAddress], + ], + swapImpactPoolAmountShort: [ + ["bytes32", "address", "address"], + [SWAP_IMPACT_POOL_AMOUNT_KEY, marketAddress, market.shortTokenAddress], + ], + longInterestUsingLongToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_KEY, marketAddress, market.longTokenAddress, true], + ], + longInterestUsingShortToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_KEY, marketAddress, market.shortTokenAddress, true], + ], + shortInterestUsingLongToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_KEY, marketAddress, market.longTokenAddress, false], + ], + shortInterestUsingShortToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_KEY, marketAddress, market.shortTokenAddress, false], + ], + longInterestInTokensUsingLongToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_IN_TOKENS_KEY, marketAddress, market.longTokenAddress, true], + ], + longInterestInTokensUsingShortToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_IN_TOKENS_KEY, marketAddress, market.shortTokenAddress, true], + ], + shortInterestInTokensUsingLongToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_IN_TOKENS_KEY, marketAddress, market.longTokenAddress, false], + ], + shortInterestInTokensUsingShortToken: [ + ["bytes32", "address", "address", "bool"], + [OPEN_INTEREST_IN_TOKENS_KEY, marketAddress, market.shortTokenAddress, false], + ], + }); + + return marketKeys; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/markets.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/markets.ts new file mode 100644 index 0000000..3d9d327 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/markets.ts @@ -0,0 +1,215 @@ +import {BASIS_POINTS_DIVISOR} from "../configs/factors.js"; +import {getTokenVisualMultiplier, NATIVE_TOKEN_ADDRESS} from "../configs/tokens.js"; + +import {ContractMarketPrices, Market, MarketInfo} from "../types/markets.js"; +import {Token, TokenPrices, TokensData} from "../types/tokens.js"; + +import {applyFactor, PRECISION} from "./numbers.js"; +import {getByKey} from "./objects.js"; +import {convertToContractTokenPrices, convertToUsd, getMidPrice} from "./tokens.js"; + +export function getMarketFullName(p: { longToken: Token; shortToken: Token; indexToken: Token; isSpotOnly: boolean }) { + const { indexToken, longToken, shortToken, isSpotOnly } = p; + + return `${getMarketIndexName({ indexToken, isSpotOnly })} [${getMarketPoolName({ longToken, shortToken })}]`; +} + +export function getMarketIndexName(p: ({ indexToken: Token } | { glvToken: Token }) & { isSpotOnly: boolean }) { + const { isSpotOnly } = p; + + const firstToken = "indexToken" in p ? p.indexToken : p.glvToken; + + if (isSpotOnly) { + return `SWAP-ONLY`; + } + + const prefix = getTokenVisualMultiplier(firstToken); + + return `${prefix}${firstToken.baseSymbol || firstToken.symbol}/USD`; +} + +export function getMarketPoolName(p: { longToken: Token; shortToken: Token }) { + const { longToken, shortToken } = p; + + return `${longToken.symbol}-${shortToken.symbol}`; +} + +export function getContractMarketPrices(tokensData: TokensData, market: Market): ContractMarketPrices | undefined { + const indexToken = getByKey(tokensData, market.indexTokenAddress); + const longToken = getByKey(tokensData, market.longTokenAddress); + const shortToken = getByKey(tokensData, market.shortTokenAddress); + + if (!indexToken || !longToken || !shortToken) { + return undefined; + } + + return { + indexTokenPrice: indexToken && convertToContractTokenPrices(indexToken.prices, indexToken.decimals), + longTokenPrice: longToken && convertToContractTokenPrices(longToken.prices, longToken.decimals), + shortTokenPrice: shortToken && convertToContractTokenPrices(shortToken.prices, shortToken.decimals), + }; +} + +/** + * Apart from usual cases, returns `long` for single token backed markets. + */ +export function getTokenPoolType( + marketInfo: { + longToken: Token; + shortToken: Token; + }, + tokenAddress: string +): "long" | "short" | undefined { + const { longToken, shortToken } = marketInfo; + + if (longToken.address === shortToken.address && tokenAddress === longToken.address) { + return "long"; + } + + if (tokenAddress === longToken.address || (tokenAddress === NATIVE_TOKEN_ADDRESS && longToken.isWrapped)) { + return "long"; + } + + if (tokenAddress === shortToken.address || (tokenAddress === NATIVE_TOKEN_ADDRESS && shortToken.isWrapped)) { + return "short"; + } + + return undefined; +} + +export function getPoolUsdWithoutPnl( + marketInfo: MarketInfo, + isLong: boolean, + priceType: "minPrice" | "maxPrice" | "midPrice" +) { + const poolAmount = isLong ? marketInfo.longPoolAmount : marketInfo.shortPoolAmount; + const token = isLong ? marketInfo.longToken : marketInfo.shortToken; + + let price: bigint | undefined; + + if (priceType === "minPrice") { + price = token.prices?.minPrice; + } else if (priceType === "maxPrice") { + price = token.prices?.maxPrice; + } else { + price = getMidPrice(token.prices); + } + + return convertToUsd(poolAmount, token.decimals, price)!; +} + +export function getCappedPoolPnl(p: { marketInfo: MarketInfo; poolUsd: bigint; poolPnl: bigint; isLong: boolean }) { + const { marketInfo, poolUsd, poolPnl, isLong } = p; + + if (poolPnl < 0) { + return poolPnl; + } + + const maxPnlFactor: bigint = isLong ? marketInfo.maxPnlFactorForTradersLong : marketInfo.maxPnlFactorForTradersShort; + const maxPnl = applyFactor(poolUsd, maxPnlFactor); + + return poolPnl > maxPnl ? maxPnl : poolPnl; +} + +export function getMaxLeverageByMinCollateralFactor(minCollateralFactor: bigint | undefined) { + if (minCollateralFactor === undefined) return 100 * BASIS_POINTS_DIVISOR; + if (minCollateralFactor === 0n) return 100 * BASIS_POINTS_DIVISOR; + + const x = Number(PRECISION / minCollateralFactor); + const rounded = Math.round(x / 10) * 10; + return rounded * BASIS_POINTS_DIVISOR; +} + +export function getMaxAllowedLeverageByMinCollateralFactor(minCollateralFactor: bigint | undefined) { + return getMaxLeverageByMinCollateralFactor(minCollateralFactor) / 2; +} + +export function getOppositeCollateral(marketInfo: MarketInfo, tokenAddress: string) { + const poolType = getTokenPoolType(marketInfo, tokenAddress); + + if (poolType === "long") { + return marketInfo.shortToken; + } + + if (poolType === "short") { + return marketInfo.longToken; + } + + return undefined; +} + +export function getAvailableUsdLiquidityForCollateral(marketInfo: MarketInfo, isLong: boolean) { + const poolUsd = getPoolUsdWithoutPnl(marketInfo, isLong, "minPrice"); + + if (marketInfo.isSpotOnly) { + return poolUsd; + } + + const reservedUsd = getReservedUsd(marketInfo, isLong); + const maxReserveFactor = isLong ? marketInfo.reserveFactorLong : marketInfo.reserveFactorShort; + + if (maxReserveFactor === 0n) { + return 0n; + } + + const minPoolUsd = (reservedUsd * PRECISION) / maxReserveFactor; + + const liquidity = poolUsd - minPoolUsd; + + return liquidity; +} + +export function getReservedUsd(marketInfo: MarketInfo, isLong: boolean) { + const { indexToken } = marketInfo; + + if (isLong) { + return convertToUsd(marketInfo.longInterestInTokens, marketInfo.indexToken.decimals, indexToken.prices.maxPrice)!; + } else { + return marketInfo.shortInterestUsd; + } +} + +export function getMarketDivisor({ + longTokenAddress, + shortTokenAddress, +}: { + longTokenAddress: string; + shortTokenAddress: string; +}) { + return longTokenAddress === shortTokenAddress ? 2n : 1n; +} + +export function getMarketPnl(marketInfo: MarketInfo, isLong: boolean, forMaxPoolValue: boolean) { + const maximize = !forMaxPoolValue; + const openInterestUsd = getOpenInterestUsd(marketInfo, isLong); + const openInterestInTokens = getOpenInterestInTokens(marketInfo, isLong); + + if (openInterestUsd === 0n || openInterestInTokens === 0n) { + return 0n; + } + + const price = getPriceForPnl(marketInfo.indexToken.prices, isLong, maximize); + + const openInterestValue = convertToUsd(openInterestInTokens, marketInfo.indexToken.decimals, price)!; + const pnl = isLong ? openInterestValue - openInterestUsd : openInterestUsd - openInterestValue; + + return pnl; +} + +export function getOpenInterestUsd(marketInfo: MarketInfo, isLong: boolean) { + return isLong ? marketInfo.longInterestUsd : marketInfo.shortInterestUsd; +} + +export function getOpenInterestInTokens(marketInfo: MarketInfo, isLong: boolean) { + return isLong ? marketInfo.longInterestInTokens : marketInfo.shortInterestInTokens; +} + +export function getPriceForPnl(prices: TokenPrices, isLong: boolean, maximize: boolean) { + // for long positions, pick the larger price to maximize pnl + // for short positions, pick the smaller price to maximize pnl + if (isLong) { + return maximize ? prices.maxPrice : prices.minPrice; + } + + return maximize ? prices.minPrice : prices.maxPrice; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/multicall.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/multicall.ts new file mode 100644 index 0000000..01d09b1 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/multicall.ts @@ -0,0 +1,217 @@ +import { AbiId, abis as allAbis } from "../abis/index.js"; +import { GmxSdk } from "../index.js"; +import { sleep } from "./common.js"; + +export const MAX_TIMEOUT = 20000; + +export type MulticallProviderUrls = { + primary: string; + secondary: string; +}; + +export class Multicall { + static instances: { + [chainId: number]: Multicall | undefined; + } = {}; + + static async getInstance(sdk: GmxSdk) { + const chainId = sdk.chainId; + let instance = Multicall.instances[chainId]; + + if (!instance || instance.chainId !== chainId) { + instance = new Multicall(sdk); + + Multicall.instances[chainId] = instance; + } + + return instance; + } + + constructor(public sdk: GmxSdk) {} + + get chainId() { + return this.sdk.chainId; + } + + async call(request: MulticallRequestConfig, maxTimeout: number) { + const client = this.sdk.publicClient; + + if (!client) { + throw new Error("Public client is not initialized"); + } + + const originalKeys: { + contractKey: string; + callKey: string; + }[] = []; + + const abis: any = {}; + + const encodedPayload: { address: string; abi: any; functionName: string; args: any }[] = []; + + const contractKeys = Object.keys(request); + + contractKeys.forEach((contractKey) => { + const contractCallConfig = request[contractKey]; + + if (!contractCallConfig) { + return; + } + + Object.keys(contractCallConfig.calls).forEach((callKey) => { + const call = contractCallConfig.calls[callKey]; + + if (!call) { + return; + } + + // Add Errors ABI to each contract ABI to correctly parse errors + abis[contractCallConfig.contractAddress] = abis[contractCallConfig.contractAddress] || [ + ...allAbis[contractCallConfig.abiId], + ...allAbis.CustomErrors, + ]; + const abi = abis[contractCallConfig.contractAddress]; + + originalKeys.push({ + contractKey, + callKey, + }); + + encodedPayload.push({ + address: contractCallConfig.contractAddress, + functionName: call.methodName, + args: call.params, + abi, + }); + }); + }); + + const processResponse = (response: any) => { + const multicallResult: MulticallResult = { + success: true, + errors: {}, + data: {}, + }; + + response.forEach(({ result, status, error }, i) => { + const { contractKey, callKey } = originalKeys[i]; + + if (status === "success") { + let values: any; + + if (Array.isArray(result) || typeof result === "object") { + values = result; + } else { + values = [result]; + } + + multicallResult.data[contractKey] = multicallResult.data[contractKey] || {}; + multicallResult.data[contractKey][callKey] = { + contractKey, + callKey, + returnValues: values, + success: true, + }; + } else { + multicallResult.success = false; + + multicallResult.errors[contractKey] = multicallResult.errors[contractKey] || {}; + multicallResult.errors[contractKey][callKey] = error; + + multicallResult.data[contractKey] = multicallResult.data[contractKey] || {}; + multicallResult.data[contractKey][callKey] = { + contractKey, + callKey, + returnValues: [], + success: false, + error: error, + }; + } + }); + + return multicallResult; + }; + + const timeoutController = new AbortController(); + + const result = await Promise.race([ + // @ts-ignore + client.multicall({ contracts: encodedPayload as any }), + sleep(maxTimeout, timeoutController.signal).then(() => Promise.reject(new Error("multicall timeout"))), + ]) + .then((response) => { + timeoutController.abort(); + return processResponse(response); + }) + .catch((_viemError) => { + timeoutController.abort(); + const e = new Error(_viemError.message.slice(0, 150)); + + /* eslint-disable-next-line */ + console.error(e); + + throw e; + }); + + if (result.success) { + return result; + } + + /* eslint-disable-next-line */ + console.error(result.errors); + + return result; + } +} + +export type SkipKey = null | undefined | false; + +export type ContractCallConfig = { + methodName: string; + params: any[]; +}; + +export type ContractCallsConfig = { + contractAddress: string; + abiId: AbiId; + calls: { + [callKey in keyof T["calls"]]: ContractCallConfig | SkipKey; + }; +}; + +export type MulticallRequestConfig = { + [contractKey in keyof T]: ContractCallsConfig; +}; + +export type ContractCallResult = { + returnValues: { + [key: string | number]: any; + }; + contractKey: string; + callKey: string; + success?: boolean; + error?: string; +}; + +export type MulticallErrors> = { + [contractKey in keyof T]: { + [callKey in keyof T[contractKey]["calls"]]: { + message: string; + shortMessage: string; + functionName: string; + contractAddress: string; + }; + }; +}; + +export type ContractCallsResult> = { + [callKey in keyof T["calls"]]: ContractCallResult; +}; + +export type MulticallResult> = { + success: boolean; + errors: MulticallErrors; + data: { + [contractKey in keyof T]: ContractCallsResult; + }; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers.ts new file mode 100644 index 0000000..aa8a647 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers.ts @@ -0,0 +1,78 @@ +import {BASIS_POINTS_DIVISOR_BIGINT} from "../configs/factors.js"; + +export const PRECISION = expandDecimals(1, 30); +export const PRECISION_DECIMALS = 30; + +export const BN_ZERO = 0n; +export const BN_ONE = 1n; +export const BN_NEGATIVE_ONE = -1n; + +export function expandDecimals(n: bigint | number, decimals: number): bigint { + return BigInt(n) * 10n ** BigInt(decimals); +} + +export function basisPointsToFloat(basisPoints: bigint) { + return (basisPoints * PRECISION) / BASIS_POINTS_DIVISOR_BIGINT; +} + +export function getBasisPoints(numerator: bigint, denominator: bigint, shouldRoundUp = false) { + const result = (numerator * BASIS_POINTS_DIVISOR_BIGINT) / denominator; + + if (shouldRoundUp) { + const remainder = (numerator * BASIS_POINTS_DIVISOR_BIGINT) % denominator; + if (remainder !== 0n) { + return result < 0n ? result - 1n : result + 1n; + } + } + + return result; +} + +export function roundUpMagnitudeDivision(a: bigint, b: bigint) { + if (a < 0n) { + return (a - b + 1n) / b; + } + + return (a + b - 1n) / b; +} + +export function applyFactor(value: bigint, factor: bigint) { + return (value * factor) / PRECISION; +} + +export function numberToBigint(value: number, decimals: number) { + const negative = value < 0; + if (negative) value *= -1; + + const int = Math.trunc(value); + let frac = value - int; + + let res = BigInt(int); + + for (let i = 0; i < decimals; i++) { + res *= 10n; + if (frac !== 0) { + frac *= 10; + const fracInt = Math.trunc(frac); + res += BigInt(fracInt); + frac -= fracInt; + } + } + + return negative ? -res : res; +} + +export function bigintToNumber(value: bigint, decimals: number) { + const negative = value < 0; + if (negative) value *= -1n; + const precision = 10n ** BigInt(decimals); + const int = value / precision; + const frac = value % precision; + + const num = parseFloat(`${int}.${frac.toString().padStart(decimals, "0")}`); + return negative ? -num : num; +} + +export function adjustForDecimals(amount: bigint, divDecimals: number, mulDecimals: number) { + return (amount * expandDecimals(1, mulDecimals)) / expandDecimals(1, divDecimals); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/formatting.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/formatting.spec.ts new file mode 100644 index 0000000..bbaac3b --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/formatting.spec.ts @@ -0,0 +1,152 @@ +import { describe, expect, it } from "vitest"; + +import { USD_DECIMALS } from "../../configs/factors.js"; + +import { PERCENT_PRECISION_DECIMALS, toBigNumberWithDecimals } from "./index.js"; +import { + formatAmountHuman, + formatBalanceAmount, + formatBalanceAmountWithUsd, + formatFactor, + formatUsdPrice, + formatPercentage, +} from "./formatting.js"; + +const ONE_USD = 1000000000000000000000000000000n; + +describe("formatUsdPrice", () => { + it("should tolerate undefined", () => { + expect(formatUsdPrice()).toBeUndefined(); + }); + + it("should return NA if negative", () => { + expect(formatUsdPrice(-1n)).toBe("NA"); + }); + + it("should calculate correct decimals if displayDecimals not passed", () => + // prettier-ignore + { + expect(formatUsdPrice(ONE_USD * 10000n)).toBe( "$10,000.00"); + expect(formatUsdPrice(ONE_USD * 1000n)).toBe( "$1,000.00"); + expect(formatUsdPrice(ONE_USD * 100n)).toBe( "$100.000"); + expect(formatUsdPrice(ONE_USD * 10n)).toBe( "$10.0000"); + expect(formatUsdPrice(ONE_USD)).toBe( "$1.0000"); + expect(formatUsdPrice(ONE_USD / 10n)).toBe( "$0.10000"); + expect(formatUsdPrice(ONE_USD / 100n)).toBe( "$0.010000"); + expect(formatUsdPrice(ONE_USD / 1000n)).toBe( "$0.0010000"); + expect(formatUsdPrice(ONE_USD / 10_000n)).toBe( "$0.0001000"); + expect(formatUsdPrice(ONE_USD / 100_000n)).toBe( "$0.00001000"); + expect(formatUsdPrice(ONE_USD / 1_000_000_000n)).toBe( "$0.000000001"); + expect(formatUsdPrice(ONE_USD / 10_000_000_000n)).toBe( "< $0.000000001"); + }); +}); + +describe("formatAmountHuman", () => { + it("positive", () => { + expect(formatAmountHuman(ONE_USD, USD_DECIMALS)).toBe("1.0"); + expect(formatAmountHuman(ONE_USD * 1000n, USD_DECIMALS)).toBe("1.0k"); + expect(formatAmountHuman(ONE_USD * 1000000n, USD_DECIMALS)).toBe("1.0m"); + }); + + it("negative", () => { + expect(formatAmountHuman(-1n * ONE_USD, USD_DECIMALS)).toBe("-1.0"); + expect(formatAmountHuman(-1n * ONE_USD * 1000n, USD_DECIMALS)).toBe("-1.0k"); + expect(formatAmountHuman(-1n * ONE_USD * 1000000n, USD_DECIMALS)).toBe("-1.0m"); + }); + + it("should display dollar sign", () => { + expect(formatAmountHuman(ONE_USD, USD_DECIMALS, true)).toBe("$1.0"); + expect(formatAmountHuman(-1n * ONE_USD, USD_DECIMALS, true)).toBe("-$1.0"); + }); + + it("should display decimals", () => { + expect(formatAmountHuman(ONE_USD * 1000n, USD_DECIMALS, false, 2)).toBe("1.00k"); + expect(formatAmountHuman(ONE_USD * 1500000n, USD_DECIMALS, false, 2)).toBe("1.50m"); + expect(formatAmountHuman(ONE_USD * 1000n, USD_DECIMALS, false, 0)).toBe("1k"); + expect(formatAmountHuman(ONE_USD * 1500000n, USD_DECIMALS, false, 0)).toBe("2m"); + }); +}); + +describe("formatBalanceAmount", () => { + it("should display balance amount", () => + // prettier-ignore + { + expect(formatBalanceAmount(ONE_USD * 1000n, USD_DECIMALS)).toBe( "1,000.0000"); + expect(formatBalanceAmount(0n, USD_DECIMALS)).toBe( "-"); + expect(formatBalanceAmount(0n, USD_DECIMALS, undefined, true)).toBe( "0.0000"); + expect(formatBalanceAmount(ONE_USD * 1n, USD_DECIMALS)).toBe( "1.0000"); + expect(formatBalanceAmount(ONE_USD / 10n, USD_DECIMALS)).toBe( "0.10000"); + expect(formatBalanceAmount(ONE_USD / 100n, USD_DECIMALS)).toBe( "0.010000"); + expect(formatBalanceAmount(ONE_USD / 1_000n, USD_DECIMALS)).toBe( "0.0010000"); + expect(formatBalanceAmount(ONE_USD / 10_000n, USD_DECIMALS)).toBe( "0.00010000"); + expect(formatBalanceAmount(ONE_USD / 100_000n, USD_DECIMALS)).toBe( "0.00001000"); + expect(formatBalanceAmount(ONE_USD / 1_000_000n, USD_DECIMALS)).toBe( "0.00000100"); + expect(formatBalanceAmount(ONE_USD / 10_000_000n, USD_DECIMALS)).toBe( "0.00000010"); + expect(formatBalanceAmount(ONE_USD / 100_000_000n, USD_DECIMALS)).toBe( "0.00000001"); + expect(formatBalanceAmount(ONE_USD / 1_000_000_000n, USD_DECIMALS)).toBe( "1.00e-9"); + expect(formatBalanceAmount(ONE_USD / 1_000_000_000_000n, USD_DECIMALS)).toBe("1.00e-12"); + expect(formatBalanceAmount(ONE_USD * -1n, USD_DECIMALS)).toBe( "-1.0000"); + + }); + + it("should display balance amount with symbol", () => { + expect(formatBalanceAmount(ONE_USD, USD_DECIMALS, "USDC")).toBe("1.0000 USDC"); + expect(formatBalanceAmount(0n, USD_DECIMALS, "USDC", true)).toBe("0.0000 USDC"); + expect(formatBalanceAmount(0n, USD_DECIMALS, "USDC", false)).toBe("-"); + }); + + it("should display balance amount with usd", () => { + expect(formatBalanceAmountWithUsd(ONE_USD, ONE_USD, USD_DECIMALS)).toBe("1.0000 ($1.00)"); + expect(formatBalanceAmountWithUsd(ONE_USD, ONE_USD, USD_DECIMALS, "USDC")).toBe("1.0000 USDC ($1.00)"); + expect(formatBalanceAmountWithUsd(0n, 0n, USD_DECIMALS, "USDC")).toBe("-"); + expect(formatBalanceAmountWithUsd(0n, 0n, USD_DECIMALS, "USDC", true)).toBe("0.0000 USDC ($0.00)"); + }); +}); + +describe("formatFactor", () => { + it("should format factor", () => { + expect(formatFactor(0n)).toBe("0"); + expect(formatFactor(1n)).toBe("0.000000000000000000000000000001"); + expect(formatFactor(1000n)).toBe("0.000000000000000000000000001"); + expect(formatFactor(1000000n)).toBe("0.000000000000000000000001"); + expect(formatFactor(1000000000n)).toBe("0.000000000000000000001"); + expect(formatFactor(1000000000000n)).toBe("0.000000000000000001"); + expect(formatFactor(1000000000000000n)).toBe("0.000000000000001"); + expect(formatFactor(1000000000000000000n)).toBe("0.000000000001"); + expect(formatFactor(1000000000000000000000n)).toBe("0.000000001"); + expect(formatFactor(1000000000000000000000000n)).toBe("0.000001"); + expect(formatFactor(1000000000000000000000000000n)).toBe("0.001"); + expect(formatFactor(1000000000000000000000000000000n)).toBe("1"); + }); +}); + +describe("formatPercentage", () => { + it("should format a basic percentage", () => { + expect(formatPercentage(100n, { displayDecimals: 4 })).toBe("1.0000%"); + expect(formatPercentage(2500n)).toBe("25.00%"); + expect(formatPercentage(123456n)).toBe("1234.56%"); + }); + + it("should handle undefined input with fallbackToZero", () => { + expect(formatPercentage(undefined, { fallbackToZero: true })).toBe("0.00%"); + }); + + it("should display signed percentage", () => { + expect(formatPercentage(100n, { signed: true })).toBe("+1.00%"); + expect(formatPercentage(-100n, { signed: true })).toBe("-1.00%"); + }); + + it("should format with different displayDecimals", () => { + expect(formatPercentage(100n, { displayDecimals: 2 })).toBe("1.00%"); + expect(formatPercentage(123456n, { displayDecimals: 1 })).toBe("1234.6%"); + }); + + it("should handle basis points (bps) formatting", () => { + expect( + formatPercentage(toBigNumberWithDecimals("1", PERCENT_PRECISION_DECIMALS), { bps: false, displayDecimals: 4 }) + ).toBe("1.0000%"); + expect( + formatPercentage(toBigNumberWithDecimals("0.999", PERCENT_PRECISION_DECIMALS), { bps: false, displayDecimals: 5 }) + ).toBe("0.99900%"); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/formatting.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/formatting.ts new file mode 100644 index 0000000..8fe4559 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/formatting.ts @@ -0,0 +1,414 @@ +import { BigNumberish, ethers } from "ethers"; + +import { USD_DECIMALS } from "../../configs/factors.js"; +import { bigMath } from "../../utils/bigmath.js"; + +import { bigintToNumber, PRECISION } from "../numbers.js"; +import { getLimitedDisplay, PERCENT_PRECISION_DECIMALS, calculateDisplayDecimals, roundBigNumberWithDecimals, limitDecimals, padDecimals, trimZeroDecimals } from "./index.js"; + +function getPlusOrMinusSymbol(value?: bigint, opts: { showPlusForZero?: boolean } = {}): string { + if (value === undefined) { + return ""; + } + + const { showPlusForZero = false } = opts; + return value === 0n ? (showPlusForZero ? "+" : "") : value < 0n ? "-" : "+"; +} + +export function formatUsd( + usd?: bigint, + opts: { + fallbackToZero?: boolean; + displayDecimals?: number; + maxThreshold?: string | null; + minThreshold?: string; + displayPlus?: boolean; + visualMultiplier?: number; + } = {} +) { + const { fallbackToZero = false, displayDecimals = 2 } = opts; + + if (typeof usd !== "bigint") { + if (fallbackToZero) { + usd = 0n; + } else { + return undefined; + } + } + + if (opts.visualMultiplier) { + usd *= BigInt(opts.visualMultiplier); + } + + const defaultMinThreshold = displayDecimals > 1 ? "0." + "0".repeat(displayDecimals - 1) + "1" : undefined; + + const exceedingInfo = getLimitedDisplay(usd, USD_DECIMALS, { + maxThreshold: opts.maxThreshold, + minThreshold: opts.minThreshold ?? defaultMinThreshold, + }); + + const maybePlus = opts.displayPlus ? "+" : ""; + const sign = usd < 0n ? "-" : maybePlus; + const symbol = exceedingInfo.symbol ? `${exceedingInfo.symbol} ` : ""; + const displayUsd = formatAmount(exceedingInfo.value, USD_DECIMALS, displayDecimals, true); + return `${symbol}${sign}$${displayUsd}`; +} + +export function formatDeltaUsd( + deltaUsd?: bigint, + percentage?: bigint, + opts: { fallbackToZero?: boolean; showPlusForZero?: boolean } = {} +) { + if (typeof deltaUsd !== "bigint") { + if (opts.fallbackToZero) { + return `${formatUsd(0n)} (${formatAmount(0n, 2, 2)}%)`; + } + + return undefined; + } + + const sign = getPlusOrMinusSymbol(deltaUsd, { showPlusForZero: opts.showPlusForZero }); + + const exceedingInfo = getLimitedDisplay(deltaUsd, USD_DECIMALS); + const percentageStr = percentage !== undefined ? ` (${sign}${formatPercentage(bigMath.abs(percentage))})` : ""; + const deltaUsdStr = formatAmount(exceedingInfo.value, USD_DECIMALS, 2, true); + const symbol = exceedingInfo.symbol ? `${exceedingInfo.symbol} ` : ""; + + return `${symbol}${sign}$${deltaUsdStr}${percentageStr}`; +} + +export function formatPercentage( + percentage?: bigint, + opts: { fallbackToZero?: boolean; signed?: boolean; displayDecimals?: number; bps?: boolean } = {} +) { + const { fallbackToZero = false, signed = false, displayDecimals = 2, bps = true } = opts; + + if (percentage === undefined) { + if (fallbackToZero) { + return `${formatAmount(0n, PERCENT_PRECISION_DECIMALS, displayDecimals)}%`; + } + + return undefined; + } + + const sign = signed ? getPlusOrMinusSymbol(percentage) : ""; + + return `${sign}${formatAmount(bigMath.abs(percentage), bps ? 2 : PERCENT_PRECISION_DECIMALS, displayDecimals)}%`; +} + +export function formatTokenAmount( + amount?: bigint, + tokenDecimals?: number, + symbol?: string, + opts: { + showAllSignificant?: boolean; + displayDecimals?: number; + fallbackToZero?: boolean; + useCommas?: boolean; + minThreshold?: string; + maxThreshold?: string; + displayPlus?: boolean; + } = {} +) { + const { + displayDecimals = 4, + showAllSignificant = false, + fallbackToZero = false, + useCommas = false, + minThreshold = "0", + maxThreshold, + } = opts; + + const symbolStr = symbol ? ` ${symbol}` : ""; + + if (typeof amount !== "bigint" || !tokenDecimals) { + if (fallbackToZero) { + amount = 0n; + tokenDecimals = displayDecimals; + } else { + return undefined; + } + } + + let amountStr: string; + + const maybePlus = opts.displayPlus ? "+" : ""; + const sign = amount < 0n ? "-" : maybePlus; + + if (showAllSignificant) { + amountStr = formatAmountFree(amount, tokenDecimals, tokenDecimals); + } else { + const exceedingInfo = getLimitedDisplay(amount, tokenDecimals, { maxThreshold, minThreshold }); + const symbol = exceedingInfo.symbol ? `${exceedingInfo.symbol} ` : ""; + amountStr = `${symbol}${sign}${formatAmount(exceedingInfo.value, tokenDecimals, displayDecimals, useCommas)}`; + } + + return `${amountStr}${symbolStr}`; +} + +export function formatTokenAmountWithUsd( + tokenAmount?: bigint, + usdAmount?: bigint, + tokenSymbol?: string, + tokenDecimals?: number, + opts: { + fallbackToZero?: boolean; + displayDecimals?: number; + displayPlus?: boolean; + } = {} +) { + if (typeof tokenAmount !== "bigint" || typeof usdAmount !== "bigint" || !tokenSymbol || !tokenDecimals) { + if (!opts.fallbackToZero) { + return undefined; + } + } + + const tokenStr = formatTokenAmount(tokenAmount, tokenDecimals, tokenSymbol, { + ...opts, + useCommas: true, + displayPlus: opts.displayPlus, + }); + + const usdStr = formatUsd(usdAmount, { + fallbackToZero: opts.fallbackToZero, + displayPlus: opts.displayPlus, + }); + + return `${tokenStr} (${usdStr})`; +} + +/** + * + * @param opts.signed - Default `true`. whether to display a `+` or `-` sign for all non-zero values. + */ +export function formatRatePercentage(rate?: bigint, opts?: { displayDecimals?: number; signed?: boolean }) { + if (typeof rate !== "bigint") { + return "-"; + } + + const signed = opts?.signed ?? true; + const plurOrMinus = signed ? getPlusOrMinusSymbol(rate) : ""; + + const amount = bigMath.abs(rate * 100n); + return `${plurOrMinus}${formatAmount(amount, 30, opts?.displayDecimals ?? 4)}%`; +} + +export function formatUsdPrice(price?: bigint, opts: Parameters[1] = {}) { + if (price === undefined) { + return; + } + + if (price < 0n) { + return "NA"; + } + + const decimals = calculateDisplayDecimals(price, undefined, opts.visualMultiplier); + + return formatUsd(price, { + ...opts, + displayDecimals: decimals, + }); +} + +export function formatPercentageDisplay(percentage: number, hideThreshold?: number) { + if (hideThreshold && percentage < hideThreshold) { + return ""; + } + + return `${percentage}%`; +} + +export function formatAmountHuman( + amount: BigNumberish | undefined, + tokenDecimals: number, + showDollar = false, + displayDecimals = 1 +) { + if (amount === undefined) { + return "..."; + } + + let n = Number(formatAmount(amount, tokenDecimals)); + // For large numbers, we can neglect the decimals to avoid decimals in cases like 9999999.99999 + if (n >= 1_000_000) { + n = Math.round(n); + } + const isNegative = n < 0; + const absN = Math.abs(n); + const sign = showDollar ? "$" : ""; + + if (absN >= 1_000_000_000) { + return `${isNegative ? "-" : ""}${sign}${(absN / 1_000_000_000).toFixed(displayDecimals)}b`; + } + + if (absN >= 1_000_000) { + return `${isNegative ? "-" : ""}${sign}${(absN / 1_000_000).toFixed(displayDecimals)}m`; + } + + if (absN >= 1000) { + return `${isNegative ? "-" : ""}${sign}${(absN / 1_000).toFixed(displayDecimals)}k`; + } + + return `${isNegative ? "-" : ""}${sign}${absN.toFixed(displayDecimals)}`; +} + +export function formatBalanceAmount( + amount: bigint, + tokenDecimals: number, + tokenSymbol?: string, + showZero = false, + toExponential = true +): string { + if (amount === undefined) return "-"; + + if (amount === 0n) { + if (showZero === true) { + if (tokenSymbol) { + return `0.0000 ${tokenSymbol}`; + } + return "0.0000"; + } + + return "-"; + } + + const absAmount = bigMath.abs(amount); + const absAmountFloat = bigintToNumber(absAmount, tokenDecimals); + + let value = ""; + + if (absAmountFloat >= 1) value = formatAmount(amount, tokenDecimals, 4, true); + else if (absAmountFloat >= 0.1) value = formatAmount(amount, tokenDecimals, 5, true); + else if (absAmountFloat >= 0.01) value = formatAmount(amount, tokenDecimals, 6, true); + else if (absAmountFloat >= 0.001) value = formatAmount(amount, tokenDecimals, 7, true); + else if (absAmountFloat >= 1e-8) value = formatAmount(amount, tokenDecimals, 8, true); + else { + if (toExponential) { + value = bigintToNumber(amount, tokenDecimals).toExponential(2); + } else { + value = bigintToNumber(amount, tokenDecimals).toFixed(8); + } + } + + if (tokenSymbol) { + // Non-breaking space + return `${value} ${tokenSymbol}`; + } + + return value; +} + +export function formatBalanceAmountWithUsd( + amount: bigint, + amountUsd: bigint, + tokenDecimals: number, + tokenSymbol?: string, + showZero = false +) { + if (showZero === false && amount === 0n) { + return "-"; + } + + const value = formatBalanceAmount(amount, tokenDecimals, tokenSymbol, showZero); + + const usd = formatUsd(amountUsd); + + // Regular space + return `${value} (${usd})`; +} + +export function formatFactor(factor: bigint) { + if (factor == 0n) { + return "0"; + } + + if (bigMath.abs(factor) > PRECISION * 1000n) { + return (factor / PRECISION).toString(); + } + + const trailingZeroes = + bigMath + .abs(factor) + .toString() + .match(/^(.+?)(?0*)$/)?.groups?.zeroes?.length || 0; + const factorDecimals = 30 - trailingZeroes; + return formatAmount(factor, 30, factorDecimals); +} +export function numberWithCommas(x: BigNumberish) { + if (x === undefined || x === null) { + return "..."; + } + + const parts = x.toString().split("."); + parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); + return parts.join("."); +} +export const formatAmount = ( + amount: BigNumberish | undefined, + tokenDecimals: number, + displayDecimals?: number, + useCommas?: boolean, + defaultValue?: string, + visualMultiplier?: number +) => { + if (defaultValue === undefined || defaultValue === null) { + defaultValue = "..."; + } + if (amount === undefined || amount === null || amount === "") { + return defaultValue; + } + if (displayDecimals === undefined) { + displayDecimals = 4; + } + const amountBigInt = roundBigNumberWithDecimals(BigInt(amount) * BigInt(visualMultiplier ?? 1), { + displayDecimals, + tokenDecimals, + }); + let amountStr = ethers.formatUnits(amountBigInt, tokenDecimals); + amountStr = limitDecimals(amountStr, displayDecimals); + if (displayDecimals !== 0) { + amountStr = padDecimals(amountStr, displayDecimals); + } + if (useCommas) { + return numberWithCommas(amountStr); + } + return amountStr; +}; + +export const formatKeyAmount = ( + map: T | undefined, + key: keyof T, + tokenDecimals: number, + displayDecimals: number, + useCommas?: boolean +) => { + const value = map ? map[key] ?? undefined : undefined; + if (value === undefined || value === null) { + return "..."; + } + + return formatAmount(value as bigint, tokenDecimals, displayDecimals, useCommas); +}; + +export const formatArrayAmount = ( + arr: any[], + index: number, + tokenDecimals: number, + displayDecimals?: number, + useCommas?: boolean +) => { + if (!arr || arr[index] === undefined || arr[index] === null) { + return "..."; + } + + return formatAmount(arr[index], tokenDecimals, displayDecimals, useCommas); +}; + +export const formatAmountFree = (amount: BigNumberish, tokenDecimals: number, displayDecimals?: number) => { + if (amount === undefined || amount === null) { + return "..."; + } + let amountStr = ethers.formatUnits(amount, tokenDecimals); + amountStr = limitDecimals(amountStr, displayDecimals); + return trimZeroDecimals(amountStr); +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/index.ts new file mode 100644 index 0000000..15bff78 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/index.ts @@ -0,0 +1,290 @@ +import { BigNumberish, ethers } from "ethers"; + +import { BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "../../configs/factors.js"; +import { TRIGGER_PREFIX_ABOVE, TRIGGER_PREFIX_BELOW } from "../../configs/ui.js"; +import { bigMath } from "../../utils/bigmath.js"; +import { bigintToNumber, PRECISION_DECIMALS } from "../../utils/numbers.js"; + +export const PERCENT_PRECISION_DECIMALS = PRECISION_DECIMALS - 2; + +const MAX_EXCEEDING_THRESHOLD = "1000000000"; +const MIN_EXCEEDING_THRESHOLD = "0.01"; + +export const BN_ZERO = 0n; +export const BN_ONE = 1n; +export const BN_NEGATIVE_ONE = -1n; + +/** + * + * @deprecated Use BigInt instead + */ +export function bigNumberify(n?: BigNumberish | null | undefined) { + try { + if (n === undefined) throw new Error("n is undefined"); + if (n === null) throw new Error("n is null"); + + return BigInt(n); + } catch (e) { + // eslint-disable-next-line no-console + console.error("bigNumberify error", e); + return undefined; + } +} + +export function expandDecimals(n: BigNumberish, decimals: number): bigint { + return BigInt(n) * 10n ** BigInt(decimals); +} + +export function getLimitedDisplay( + amount: bigint, + tokenDecimals: number, + opts: { maxThreshold?: string | null; minThreshold?: string } = {} +) { + const { maxThreshold = MAX_EXCEEDING_THRESHOLD, minThreshold = MIN_EXCEEDING_THRESHOLD } = opts; + const max = maxThreshold === null ? null : expandDecimals(maxThreshold, tokenDecimals); + const min = ethers.parseUnits(minThreshold, tokenDecimals); + const absAmount = bigMath.abs(amount); + + if (absAmount == 0n) { + return { + symbol: "", + value: absAmount, + }; + } + + const symbol = max !== null && absAmount > max ? TRIGGER_PREFIX_ABOVE : absAmount < min ? TRIGGER_PREFIX_BELOW : ""; + const value = max !== null && absAmount > max ? max : absAmount < min ? min : absAmount; + + return { + symbol, + value, + }; +} + +export const trimZeroDecimals = (amount: string) => { + if (parseFloat(amount) === parseInt(amount)) { + return parseInt(amount).toString(); + } + return amount; +}; + +export const limitDecimals = (amount: BigNumberish, maxDecimals?: number) => { + let amountStr = amount.toString(); + if (maxDecimals === undefined) { + return amountStr; + } + if (maxDecimals === 0) { + return amountStr.split(".")[0]; + } + const dotIndex = amountStr.indexOf("."); + if (dotIndex !== -1) { + let decimals = amountStr.length - dotIndex - 1; + if (decimals > maxDecimals) { + amountStr = amountStr.substr(0, amountStr.length - (decimals - maxDecimals)); + } + } + + return amountStr; +}; + +export const padDecimals = (amount: BigNumberish, minDecimals: number) => { + let amountStr = amount.toString(); + const dotIndex = amountStr.indexOf("."); + if (dotIndex !== -1) { + const decimals = amountStr.length - dotIndex - 1; + if (decimals < minDecimals) { + amountStr = amountStr.padEnd(amountStr.length + (minDecimals - decimals), "0"); + } + } else { + amountStr = amountStr + ".0000"; + } + return amountStr; +}; + +export const parseValue = (value: string, tokenDecimals: number) => { + const pValue = parseFloat(value); + + if (isNaN(pValue)) { + return undefined; + } + value = limitDecimals(value, tokenDecimals); + const amount = ethers.parseUnits(value, tokenDecimals); + return bigNumberify(amount); +}; + +export function roundUpDivision(a: bigint, b: bigint) { + return (a + b - 1n) / b; +} + +export function roundToTwoDecimals(n: number) { + return Math.round(n * 100) / 100; +} + +export function roundToOrder(n: bigint, significantDigits = 1) { + const decimals = Math.max(n.toString().length - significantDigits, 0); + return (n / expandDecimals(1, decimals)) * expandDecimals(1, decimals); +} + +export function minBigNumber(...args: bigint[]) { + if (!args.length) return undefined; + + return args.reduce((acc, num) => (num < acc ? num : acc), args[0]); +} + +export function maxbigint(...args: bigint[]) { + if (!args.length) return undefined; + + return args.reduce((acc, num) => (num > acc ? num : acc), args[0]); +} + +export function removeTrailingZeros(amount: string | number) { + const amountWithoutZeros = Number(amount); + if (!amountWithoutZeros) return amount; + return amountWithoutZeros; +} + +type SerializedBigIntsInObject = { + [P in keyof T]: T[P] extends bigint + ? { type: "bigint"; value: bigint } + : T[P] extends object + ? SerializedBigIntsInObject + : T[P]; +}; + +type DeserializeBigIntInObject = { + [P in keyof T]: T[P] extends { type: "bigint"; value: bigint } + ? bigint + : T[P] extends object + ? DeserializeBigIntInObject + : T[P]; +}; + +export function serializeBigIntsInObject(obj: T): SerializedBigIntsInObject { + const result: any = Array.isArray(obj) ? [] : {}; + for (const key in obj) { + const value = obj[key]; + if (typeof value === "bigint") { + result[key] = { type: "bigint", value: String(value) }; + } else if (value && typeof value === "object") { + result[key] = serializeBigIntsInObject(value); + } else { + result[key] = value; + } + } + return result; +} + +export function deserializeBigIntsInObject(obj: T): DeserializeBigIntInObject { + const result: any = Array.isArray(obj) ? [] : {}; + for (const key in obj) { + const value = obj[key]; + if ( + typeof value === "object" && + value !== null && + (("type" in value && value.type === "bigint") || ("_type" in value && value._type === "BigNumber")) + ) { + if ("value" in value && typeof value.value === "string") { + result[key] = BigInt(value.value); + } else if ("hex" in value && typeof value.hex === "string") { + if (value.hex.startsWith("-")) { + result[key] = BigInt(value.hex.slice(1)) * -1n; + } else { + result[key] = BigInt(value.hex); + } + } + } else if (value && typeof value === "object") { + result[key] = deserializeBigIntsInObject(value); + } else { + result[key] = value; + } + } + return result; +} + +export function calculateDisplayDecimals(price?: bigint, decimals = USD_DECIMALS, visualMultiplier = 1) { + if (price === undefined || price === 0n) return 2; + const priceNumber = bigintToNumber(bigMath.abs(price) * BigInt(visualMultiplier), decimals); + + if (isNaN(priceNumber)) return 2; + if (priceNumber >= 1000) return 2; + if (priceNumber >= 100) return 3; + if (priceNumber >= 1) return 4; + if (priceNumber >= 0.1) return 5; + if (priceNumber >= 0.01) return 6; + if (priceNumber >= 0.0001) return 7; + if (priceNumber >= 0.00001) return 8; + + return 9; +} + +export function clamp(value: number, min: number, max: number): number { + return Math.max(min, Math.min(value, max)); +} + +export function absDiffBps(value: bigint, base: bigint) { + if ((value === 0n && base !== 0n) || (value !== 0n && base === 0n)) { + return BASIS_POINTS_DIVISOR_BIGINT; + } + + if (value === 0n && base === 0n) { + return 0n; + } + + return bigMath.mulDiv(bigMath.abs(value - base), BASIS_POINTS_DIVISOR_BIGINT, base); +} + +export function roundBigNumberWithDecimals( + value: BigNumberish, + opts: { displayDecimals: number; tokenDecimals: number } +): BigNumberish { + if (opts.displayDecimals === opts.tokenDecimals) { + return value; + } + + let valueString = value.toString(); + let isNegative = false; + + if (valueString[0] === "-") { + valueString = valueString.slice(1); + isNegative = true; + } + + if (valueString.length < opts.tokenDecimals) { + valueString = valueString.padStart(opts.tokenDecimals, "0"); + } + + const mainPart = valueString.slice(0, valueString.length - opts.tokenDecimals + opts.displayDecimals); + const partToRound = valueString.slice(valueString.length - opts.tokenDecimals + opts.displayDecimals); + + let mainPartBigInt = BigInt(mainPart); + + let returnValue = mainPartBigInt; + + if (partToRound.length !== 0) { + if (Number(partToRound[0]) >= 5) { + mainPartBigInt += 1n; + } + + returnValue = BigInt(mainPartBigInt.toString() + new Array(partToRound.length).fill("0").join("")); + } + + return isNegative ? returnValue * -1n : returnValue; +} + +export function toBigNumberWithDecimals(value: string, decimals: number): bigint { + if (!value) return BN_ZERO; + + const parts = value.split("."); + const integerPart = parts[0]; + const decimalPart = parts.length > 1 ? parts[1] : ""; + + const paddingZeros = decimals - decimalPart.length; + + if (paddingZeros >= 0) { + const result = integerPart + decimalPart + "0".repeat(paddingZeros); + return BigInt(result); + } else { + const result = integerPart + decimalPart.substring(0, decimals); + return BigInt(result); + } +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/numbers.spec.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/numbers.spec.ts new file mode 100644 index 0000000..beea9c5 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/numbers/numbers.spec.ts @@ -0,0 +1,153 @@ +import { describe, expect, it } from "vitest"; + +import { USD_DECIMALS } from "../../configs/factors.js"; + +import { formatAmount } from "./formatting.js"; +import { roundBigNumberWithDecimals, toBigNumberWithDecimals } from "./index.js"; +import { PRECISION_DECIMALS } from "../numbers.js"; + +describe("toBigNumberWithDecimals", () => { + it("should convert string to big number with decimals", () => { + expect(toBigNumberWithDecimals("0", PRECISION_DECIMALS)).toBe(0n); + expect(toBigNumberWithDecimals("1", PRECISION_DECIMALS)).toBe(1000000000000000000000000000000n); + expect(toBigNumberWithDecimals("123.456", PRECISION_DECIMALS)).toBe(123456000000000000000000000000000n); + expect(toBigNumberWithDecimals("123.456789", PRECISION_DECIMALS)).toBe(123456789000000000000000000000000n); + expect(toBigNumberWithDecimals("-1.5", PRECISION_DECIMALS)).toBe(-1500000000000000000000000000000n); + expect(toBigNumberWithDecimals("0.000001", PRECISION_DECIMALS)).toBe(1000000000000000000000000n); + }); + + it("should handle strings with more decimals than token decimals parameter", () => { + expect(toBigNumberWithDecimals("0.123456789012345678901234567890", 5)).toBe(12345n); + }); + + it("should handle cases with different token decimals ", () => { + expect(toBigNumberWithDecimals("0.1234567890123456789012345678901", 18)).toBe(123456789012345678n); + expect(toBigNumberWithDecimals("0.12345", 5)).toBe(12345n); + expect(toBigNumberWithDecimals("0.1", 1)).toBe(1n); + }); + + it("should be compatible with formatAmount", () => { + expect(formatAmount(toBigNumberWithDecimals("123.456", PRECISION_DECIMALS), USD_DECIMALS, 3)).toBe("123.456"); + expect(formatAmount(toBigNumberWithDecimals("0.789", PRECISION_DECIMALS), USD_DECIMALS, 2)).toBe("0.79"); + }); +}); + +describe("roundBigNumberWithDecimals", () => { + it("should round small numbers correctly", () => { + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("0.0000001", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 0, + }) + ).toBe(0n); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("0.5", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 0, + }) + ).toBe(toBigNumberWithDecimals("1", PRECISION_DECIMALS)); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("0.499", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 0, + }) + ).toBe(0n); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("1", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 1, + }) + ).toBe(toBigNumberWithDecimals("1", PRECISION_DECIMALS)); + }); + + it("should round numbers at specific decimal places", () => { + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("1.49", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 1, + }) + ).toBe(toBigNumberWithDecimals("1.5", PRECISION_DECIMALS)); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("1.44", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 1, + }) + ).toBe(toBigNumberWithDecimals("1.4", PRECISION_DECIMALS)); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("1.499", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 2, + }) + ).toBe(toBigNumberWithDecimals("1.50", PRECISION_DECIMALS)); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("1.495", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 2, + }) + ).toBe(toBigNumberWithDecimals("1.50", PRECISION_DECIMALS)); + }); + + it("should round large numbers correctly", () => { + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("499.999999", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 5, + }) + ).toBe(toBigNumberWithDecimals("500.00000", PRECISION_DECIMALS)); + }); + + it("should handle complex rounding cases", () => { + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("0.0000000000000000000000000001", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 25, + }) + ).toBe(0n); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("0.4999999999999999999999999999", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 25, + }) + ).toBe(toBigNumberWithDecimals("0.5", PRECISION_DECIMALS)); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("123.456789", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 4, + }) + ).toBe(toBigNumberWithDecimals("123.4568", PRECISION_DECIMALS)); + }); + + it("should round numbers with different token decimals correctly", () => { + const differentTokenDecimals = [18, 5, 1, 22]; + for (const tokenDecimals of differentTokenDecimals) { + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("123.456789", tokenDecimals), { + tokenDecimals, + displayDecimals: 4, + }) + ).toBe(toBigNumberWithDecimals("123.4568", tokenDecimals)); + } + }); + + it("should handle edge cases", () => { + expect(roundBigNumberWithDecimals(0n, { tokenDecimals: PRECISION_DECIMALS, displayDecimals: 10 })).toBe(0n); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("-1.5", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 0, + }) + ).toBe(toBigNumberWithDecimals("-2", PRECISION_DECIMALS)); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("-1.4", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 0, + }) + ).toBe(toBigNumberWithDecimals("-1", PRECISION_DECIMALS)); + expect( + roundBigNumberWithDecimals(toBigNumberWithDecimals("0.0000001", PRECISION_DECIMALS), { + tokenDecimals: PRECISION_DECIMALS, + displayDecimals: 5, + }) + ).toBe(0n); + }); +}); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/objects.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/objects.ts new file mode 100644 index 0000000..c513f73 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/objects.ts @@ -0,0 +1,21 @@ +export function setByKey(obj: { [key: string]: T }, key: string, data: T) { + return { ...obj, [key]: data }; +} + +export function updateByKey(obj: { [key: string]: T }, key: string, data: Partial) { + if (!obj[key]) return obj; + + return { ...obj, [key]: { ...obj[key], ...data } }; +} + +export function getByKey(obj?: { [key: string]: T }, key?: string): T | undefined { + if (!obj || !key) return undefined; + + return obj[key]; +} + +export function deleteByKey(obj: { [key: string]: T }, key: string) { + const newObj = { ...obj }; + delete newObj[key]; + return newObj; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/orders.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/orders.ts new file mode 100644 index 0000000..0c9ca88 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/orders.ts @@ -0,0 +1,271 @@ +import {BASIS_POINTS_DIVISOR_BIGINT, DEFAULT_ALLOWED_SWAP_SLIPPAGE_BPS} from "../configs/factors.js"; +import {MarketsInfoData} from "../types/markets.js"; +import {Order, OrderInfo, OrderType, PositionOrderInfo, SwapOrderInfo} from "../types/orders.js"; +import {Token, TokensData} from "../types/tokens.js"; +import {bigMath} from "./bigmath.js"; +import {getByKey} from "./objects.js"; +import {parsePositionKey} from "./positions.js"; +import {getOrderThresholdType} from "./prices.js"; +import { getSwapPathOutputAddresses, getSwapPathStats } from "./swap/index.js"; +import { + convertToTokenAmount, + convertToUsd, + getTokensRatioByAmounts, + getTokensRatioByMinOutputAmountAndTriggerPrice, + parseContractPrice, +} from "./tokens.js"; + +export function isMarketOrderType(orderType: OrderType) { + return [OrderType.MarketDecrease, OrderType.MarketIncrease, OrderType.MarketSwap].includes(orderType); +} + +export function isLimitOrderType(orderType: OrderType) { + return [OrderType.LimitIncrease, OrderType.LimitSwap, OrderType.StopIncrease].includes(orderType); +} + +export function isTriggerDecreaseOrderType(orderType: OrderType) { + return [OrderType.LimitDecrease, OrderType.StopLossDecrease].includes(orderType); +} + +export function isDecreaseOrderType(orderType: OrderType) { + return [OrderType.MarketDecrease, OrderType.LimitDecrease, OrderType.StopLossDecrease].includes(orderType); +} + +export function isIncreaseOrderType(orderType: OrderType) { + return [OrderType.MarketIncrease, OrderType.LimitIncrease, OrderType.StopIncrease].includes(orderType); +} + +export function isSwapOrderType(orderType: OrderType) { + return [OrderType.MarketSwap, OrderType.LimitSwap].includes(orderType); +} + +export function isLimitSwapOrderType(orderType: OrderType) { + return orderType === OrderType.LimitSwap; +} + +export function isLiquidationOrderType(orderType: OrderType) { + return orderType === OrderType.Liquidation; +} + +export function isStopLossOrderType(orderType: OrderType) { + return orderType === OrderType.StopLossDecrease; +} + +export function isLimitDecreaseOrderType(orderType: OrderType) { + return orderType === OrderType.LimitDecrease; +} + +export function isLimitIncreaseOrderType(orderType: OrderType) { + return orderType === OrderType.LimitIncrease; +} + +export function isStopIncreaseOrderType(orderType: OrderType) { + return orderType === OrderType.StopIncrease; +} + +export function getOrderInfo(p: { + marketsInfoData: MarketsInfoData; + tokensData: TokensData; + wrappedNativeToken: Token; + order: Order; +}) { + const { marketsInfoData, tokensData, wrappedNativeToken, order } = p; + + if (isSwapOrderType(order.orderType)) { + const initialCollateralToken = getByKey(tokensData, order.initialCollateralTokenAddress); + const { outTokenAddress } = getSwapPathOutputAddresses({ + marketsInfoData, + swapPath: order.swapPath, + initialCollateralAddress: order.initialCollateralTokenAddress, + wrappedNativeTokenAddress: wrappedNativeToken.address, + shouldUnwrapNativeToken: order.shouldUnwrapNativeToken, + isIncrease: false, + }); + + const targetCollateralToken = getByKey(tokensData, outTokenAddress); + + if (!initialCollateralToken || !targetCollateralToken) { + return undefined; + } + + const swapPathStats = getSwapPathStats({ + marketsInfoData, + swapPath: order.swapPath, + initialCollateralAddress: order.initialCollateralTokenAddress, + wrappedNativeTokenAddress: wrappedNativeToken.address, + usdIn: convertToUsd( + order.initialCollateralDeltaAmount, + initialCollateralToken.decimals, + initialCollateralToken.prices.minPrice + )!, + shouldUnwrapNativeToken: order.shouldUnwrapNativeToken, + shouldApplyPriceImpact: true, + }); + + const priceImpactAmount = convertToTokenAmount( + swapPathStats?.totalSwapPriceImpactDeltaUsd, + targetCollateralToken.decimals, + targetCollateralToken.prices.minPrice + ); + + const swapFeeAmount = convertToTokenAmount( + swapPathStats?.totalSwapFeeUsd, + targetCollateralToken.decimals, + targetCollateralToken.prices.minPrice + ); + + let toAmount; + let triggerRatio; + + const isLimitSwapOrder = isLimitSwapOrderType(order.orderType); + + if (isLimitSwapOrder) { + if (order.contractTriggerPrice === 0n) { + /** + * If not stored trigger price in contract, we use the min output amount with default slippage + * @see https://app.asana.com/0/1207525044994982/1209109731071143 + */ + toAmount = + order.minOutputAmount - + bigMath.mulDiv(order.minOutputAmount, DEFAULT_ALLOWED_SWAP_SLIPPAGE_BPS, BASIS_POINTS_DIVISOR_BIGINT); + } + triggerRatio = getTokensRatioByMinOutputAmountAndTriggerPrice({ + fromToken: initialCollateralToken, + toToken: targetCollateralToken, + fromTokenAmount: order.initialCollateralDeltaAmount, + toTokenAmount: toAmount, + triggerPrice: order.contractTriggerPrice, + minOutputAmount: order.minOutputAmount, + }); + } else { + toAmount = order.minOutputAmount - (priceImpactAmount ?? 0n) + (swapFeeAmount ?? 0n); + triggerRatio = getTokensRatioByAmounts({ + fromToken: initialCollateralToken, + toToken: targetCollateralToken, + fromTokenAmount: order.initialCollateralDeltaAmount, + toTokenAmount: toAmount, + }); + } + + const orderInfo: SwapOrderInfo = { + ...order, + swapPathStats, + triggerRatio, + initialCollateralToken, + targetCollateralToken, + }; + + return orderInfo; + } else { + const marketInfo = getByKey(marketsInfoData, order.marketAddress); + const indexToken = marketInfo?.indexToken; + + const initialCollateralToken = getByKey(tokensData, order.initialCollateralTokenAddress); + const { outTokenAddress } = getSwapPathOutputAddresses({ + marketsInfoData, + swapPath: order.swapPath, + initialCollateralAddress: order.initialCollateralTokenAddress, + wrappedNativeTokenAddress: wrappedNativeToken.address, + shouldUnwrapNativeToken: order.shouldUnwrapNativeToken, + isIncrease: isIncreaseOrderType(order.orderType), + }); + + const targetCollateralToken = getByKey(tokensData, outTokenAddress); + + if (!marketInfo || !indexToken || !initialCollateralToken || !targetCollateralToken) { + return undefined; + } + + const acceptablePrice = parseContractPrice(order.contractAcceptablePrice, indexToken.decimals); + const triggerPrice = parseContractPrice(order.contractTriggerPrice, indexToken.decimals); + + const swapPathStats = getSwapPathStats({ + marketsInfoData, + swapPath: order.swapPath, + initialCollateralAddress: order.initialCollateralTokenAddress, + wrappedNativeTokenAddress: wrappedNativeToken.address, + usdIn: convertToUsd( + order.initialCollateralDeltaAmount, + initialCollateralToken.decimals, + initialCollateralToken.prices.minPrice + )!, + shouldUnwrapNativeToken: order.shouldUnwrapNativeToken, + shouldApplyPriceImpact: true, + }); + + const triggerThresholdType = getOrderThresholdType(order.orderType, order.isLong); + + const orderInfo: PositionOrderInfo = { + ...order, + swapPathStats, + marketInfo, + indexToken, + initialCollateralToken, + targetCollateralToken, + acceptablePrice, + triggerPrice, + triggerThresholdType, + }; + + return orderInfo; + } +} + +export function isVisibleOrder(orderType: OrderType) { + return isLimitOrderType(orderType) || isTriggerDecreaseOrderType(orderType) || isLimitSwapOrderType(orderType); +} + +export function isOrderForPosition(order: OrderInfo, positionKey: string): order is PositionOrderInfo { + const { account, marketAddress, collateralAddress, isLong } = parsePositionKey(positionKey); + + let isMatch = + !isSwapOrderType(order.orderType) && + order.account === account && + order.marketAddress === marketAddress && + order.isLong === isLong; + + // For limit orders, we need to check the target collateral token + if (isLimitOrderType(order.orderType)) { + const targetCollateralTokenAddress = order.targetCollateralToken.isNative + ? order.targetCollateralToken.wrappedAddress + : order.targetCollateralToken.address; + isMatch = isMatch && targetCollateralTokenAddress === collateralAddress; + } else if (isTriggerDecreaseOrderType(order.orderType)) { + isMatch = isMatch && order.initialCollateralTokenAddress === collateralAddress; + } + + return isMatch; +} + +export function isOrderForPositionByData( + order: OrderInfo, + { + account, + marketAddress, + collateralAddress, + isLong, + }: { + account: string; + marketAddress: string; + collateralAddress: string; + isLong: boolean; + } +): order is PositionOrderInfo { + let isMatch = + !isSwapOrderType(order.orderType) && + order.account === account && + order.marketAddress === marketAddress && + order.isLong === isLong; + + // For limit orders, we need to check the target collateral token + if (isLimitOrderType(order.orderType)) { + const targetCollateralTokenAddress = order.targetCollateralToken.isNative + ? order.targetCollateralToken.wrappedAddress + : order.targetCollateralToken.address; + isMatch = isMatch && targetCollateralTokenAddress === collateralAddress; + } else if (isTriggerDecreaseOrderType(order.orderType)) { + isMatch = isMatch && order.initialCollateralTokenAddress === collateralAddress; + } + + return isMatch; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/positions.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/positions.ts new file mode 100644 index 0000000..aabf0ed --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/positions.ts @@ -0,0 +1,225 @@ +import {bigMath} from "./bigmath.js"; +import {applyFactor, expandDecimals} from "./numbers.js"; +import {getCappedPoolPnl, getMarketPnl, getPoolUsdWithoutPnl} from "./markets.js"; +import {convertToUsd, getIsEquivalentTokens} from "./tokens.js"; +import {BASIS_POINTS_DIVISOR_BIGINT} from "../configs/factors.js"; +import {Token, TokenData} from "../types/tokens.js"; +import {UserReferralInfo} from "../types/referrals.js"; +import {MarketInfo} from "../types/markets.js"; +import {getPriceImpactForPosition} from "./fees/priceImpact.js"; +import {getPositionFee} from "./fees/index.js"; + +export function getPositionKey(account: string, marketAddress: string, collateralAddress: string, isLong: boolean) { + return `${account}:${marketAddress}:${collateralAddress}:${isLong}`; +} + +export function parsePositionKey(positionKey: string) { + const [account, marketAddress, collateralAddress, isLong] = positionKey.split(":"); + + return { account, marketAddress, collateralAddress, isLong: isLong === "true" }; +} + +export function getEntryPrice(p: { sizeInUsd: bigint; sizeInTokens: bigint; indexToken: Token }) { + const { sizeInUsd, sizeInTokens, indexToken } = p; + + if (sizeInTokens <= 0) { + return undefined; + } + + return bigMath.mulDiv(sizeInUsd, expandDecimals(1, indexToken.decimals), sizeInTokens); +} + +export function getPositionPnlUsd(p: { + marketInfo: MarketInfo; + sizeInUsd: bigint; + sizeInTokens: bigint; + markPrice: bigint; + isLong: boolean; +}) { + const { marketInfo, sizeInUsd, sizeInTokens, markPrice, isLong } = p; + + const positionValueUsd = getPositionValueUsd({ indexToken: marketInfo.indexToken, sizeInTokens, markPrice }); + + let totalPnl = isLong ? positionValueUsd - sizeInUsd : sizeInUsd - positionValueUsd; + + if (totalPnl <= 0) { + return totalPnl; + } + + const poolPnl = getMarketPnl(marketInfo, isLong, true); + const poolUsd = getPoolUsdWithoutPnl(marketInfo, isLong, "minPrice"); + + const cappedPnl = getCappedPoolPnl({ + marketInfo, + poolUsd, + poolPnl, + isLong, + }); + + const WEI_PRECISION = expandDecimals(1, 18); + + if (cappedPnl !== poolPnl && cappedPnl > 0 && poolPnl > 0) { + totalPnl = bigMath.mulDiv(totalPnl, cappedPnl / WEI_PRECISION, poolPnl / WEI_PRECISION); + } + + return totalPnl; +} + +export function getPositionValueUsd(p: { indexToken: Token; sizeInTokens: bigint; markPrice: bigint }) { + const { indexToken, sizeInTokens, markPrice } = p; + + return convertToUsd(sizeInTokens, indexToken.decimals, markPrice)!; +} + +export function getPositionPendingFeesUsd(p: { pendingFundingFeesUsd: bigint; pendingBorrowingFeesUsd: bigint }) { + const { pendingFundingFeesUsd, pendingBorrowingFeesUsd } = p; + + return pendingBorrowingFeesUsd + pendingFundingFeesUsd; +} + +export function getPositionNetValue(p: { + collateralUsd: bigint; + pendingFundingFeesUsd: bigint; + pendingBorrowingFeesUsd: bigint; + pnl: bigint; + closingFeeUsd: bigint; + uiFeeUsd: bigint; +}) { + const { pnl, closingFeeUsd, collateralUsd, uiFeeUsd } = p; + + const pendingFeesUsd = getPositionPendingFeesUsd(p); + + return collateralUsd - pendingFeesUsd - closingFeeUsd - uiFeeUsd + pnl; +} + +export function getLeverage(p: { + sizeInUsd: bigint; + collateralUsd: bigint; + pnl: bigint | undefined; + pendingFundingFeesUsd: bigint; + pendingBorrowingFeesUsd: bigint; +}) { + const { pnl, sizeInUsd, collateralUsd, pendingBorrowingFeesUsd, pendingFundingFeesUsd } = p; + + const totalPendingFeesUsd = getPositionPendingFeesUsd({ pendingFundingFeesUsd, pendingBorrowingFeesUsd }); + + const remainingCollateralUsd = collateralUsd + (pnl ?? 0n) - totalPendingFeesUsd; + + if (remainingCollateralUsd <= 0) { + return undefined; + } + + return bigMath.mulDiv(sizeInUsd, BASIS_POINTS_DIVISOR_BIGINT, remainingCollateralUsd); +} + +export function getLiquidationPrice(p: { + sizeInUsd: bigint; + sizeInTokens: bigint; + collateralAmount: bigint; + collateralUsd: bigint; + collateralToken: TokenData; + marketInfo: MarketInfo; + pendingFundingFeesUsd: bigint; + pendingBorrowingFeesUsd: bigint; + minCollateralUsd: bigint; + isLong: boolean; + useMaxPriceImpact?: boolean; + userReferralInfo: UserReferralInfo | undefined; +}) { + const { + sizeInUsd, + sizeInTokens, + collateralUsd, + collateralAmount, + marketInfo, + collateralToken, + pendingFundingFeesUsd, + pendingBorrowingFeesUsd, + minCollateralUsd, + isLong, + userReferralInfo, + useMaxPriceImpact, + } = p; + + if (sizeInUsd <= 0 || sizeInTokens <= 0) { + return undefined; + } + + const { indexToken } = marketInfo; + + const closingFeeUsd = getPositionFee(marketInfo, sizeInUsd, false, userReferralInfo).positionFeeUsd; + const totalPendingFeesUsd = getPositionPendingFeesUsd({ pendingFundingFeesUsd, pendingBorrowingFeesUsd }); + const totalFeesUsd = totalPendingFeesUsd + closingFeeUsd; + + const maxNegativePriceImpactUsd = -1n * applyFactor(sizeInUsd, marketInfo.maxPositionImpactFactorForLiquidations); + + let priceImpactDeltaUsd = 0n; + + if (useMaxPriceImpact) { + priceImpactDeltaUsd = maxNegativePriceImpactUsd; + } else { + priceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, -sizeInUsd, isLong, { fallbackToZero: true }); + + if (priceImpactDeltaUsd < maxNegativePriceImpactUsd) { + priceImpactDeltaUsd = maxNegativePriceImpactUsd; + } + + // Ignore positive price impact + if (priceImpactDeltaUsd > 0) { + priceImpactDeltaUsd = 0n; + } + } + + let liquidationCollateralUsd = applyFactor(sizeInUsd, marketInfo.minCollateralFactor); + if (liquidationCollateralUsd < minCollateralUsd) { + liquidationCollateralUsd = minCollateralUsd; + } + + let liquidationPrice: bigint; + + if (getIsEquivalentTokens(collateralToken, indexToken)) { + if (isLong) { + const denominator = sizeInTokens + collateralAmount; + + if (denominator == 0n) { + return undefined; + } + + liquidationPrice = + ((sizeInUsd + liquidationCollateralUsd - priceImpactDeltaUsd + totalFeesUsd) / denominator) * + expandDecimals(1, indexToken.decimals); + } else { + const denominator = sizeInTokens - collateralAmount; + + if (denominator == 0n) { + return undefined; + } + + liquidationPrice = + ((sizeInUsd - liquidationCollateralUsd + priceImpactDeltaUsd - totalFeesUsd) / denominator) * + expandDecimals(1, indexToken.decimals); + } + } else { + if (sizeInTokens == 0n) { + return undefined; + } + + const remainingCollateralUsd = collateralUsd + priceImpactDeltaUsd - totalPendingFeesUsd - closingFeeUsd; + + if (isLong) { + liquidationPrice = + ((liquidationCollateralUsd - remainingCollateralUsd + sizeInUsd) / sizeInTokens) * + expandDecimals(1, indexToken.decimals); + } else { + liquidationPrice = + ((liquidationCollateralUsd - remainingCollateralUsd - sizeInUsd) / -sizeInTokens) * + expandDecimals(1, indexToken.decimals); + } + } + + if (liquidationPrice <= 0) { + return undefined; + } + + return liquidationPrice; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/prices.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/prices.ts new file mode 100644 index 0000000..98e45ca --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/prices.ts @@ -0,0 +1,206 @@ +import { BASIS_POINTS_DIVISOR_BIGINT, DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER } from "../configs/factors.js"; +import { MarketInfo } from "../types/markets.js"; +import { OrderType } from "../types/orders.js"; +import { TokenPrices } from "../types/tokens.js"; +import { getPriceImpactByAcceptablePrice } from "./fees/index.js"; +import { bigMath } from "./bigmath.js"; +import { getCappedPositionImpactUsd } from "./fees/index.js"; +import { convertToTokenAmount } from "./tokens.js"; +import { expandDecimals, getBasisPoints } from "./numbers.js"; +import { roundUpMagnitudeDivision } from "./numbers.js"; +import { applyFactor } from "./numbers.js"; +import { TriggerThresholdType } from "../types/trade.js"; + +export function getMarkPrice(p: { prices: TokenPrices; isIncrease: boolean; isLong: boolean }) { + const { prices, isIncrease, isLong } = p; + + const shouldUseMaxPrice = getShouldUseMaxPrice(isIncrease, isLong); + + return shouldUseMaxPrice ? prices.maxPrice : prices.minPrice; +} + +export function getShouldUseMaxPrice(isIncrease: boolean, isLong: boolean) { + return isIncrease ? isLong : !isLong; +} + +export function getOrderThresholdType(orderType: OrderType, isLong: boolean) { + // limit increase order + if (orderType === OrderType.LimitIncrease) { + return isLong ? TriggerThresholdType.Below : TriggerThresholdType.Above; + } + + // stop market order + if (orderType === OrderType.StopIncrease) { + return isLong ? TriggerThresholdType.Above : TriggerThresholdType.Below; + } + + // take profit order + if (orderType === OrderType.LimitDecrease) { + return isLong ? TriggerThresholdType.Above : TriggerThresholdType.Below; + } + + // stop loss order + if (orderType === OrderType.StopLossDecrease) { + return isLong ? TriggerThresholdType.Below : TriggerThresholdType.Above; + } + + throw new Error("Invalid trigger order type"); +} + +export function getAcceptablePriceInfo(p: { + marketInfo: MarketInfo; + isIncrease: boolean; + isLong: boolean; + indexPrice: bigint; + sizeDeltaUsd: bigint; + maxNegativePriceImpactBps?: bigint; +}) { + const { marketInfo, isIncrease, isLong, indexPrice, sizeDeltaUsd, maxNegativePriceImpactBps } = p; + const { indexToken } = marketInfo; + + const values = { + acceptablePrice: 0n, + acceptablePriceDeltaBps: 0n, + priceImpactDeltaAmount: 0n, + priceImpactDeltaUsd: 0n, + priceImpactDiffUsd: 0n, + }; + + if (sizeDeltaUsd <= 0 || indexPrice == 0n) { + return values; + } + + const shouldFlipPriceImpact = getShouldUseMaxPrice(p.isIncrease, p.isLong); + + // For Limit / Trigger orders + if (maxNegativePriceImpactBps !== undefined && maxNegativePriceImpactBps > 0) { + let priceDelta = bigMath.mulDiv(indexPrice, maxNegativePriceImpactBps, BASIS_POINTS_DIVISOR_BIGINT); + priceDelta = shouldFlipPriceImpact ? priceDelta * -1n : priceDelta; + + values.acceptablePrice = indexPrice - priceDelta; + values.acceptablePriceDeltaBps = maxNegativePriceImpactBps * -1n; + + const priceImpact = getPriceImpactByAcceptablePrice({ + sizeDeltaUsd, + acceptablePrice: values.acceptablePrice, + indexPrice, + isLong, + isIncrease, + }); + + values.priceImpactDeltaUsd = priceImpact.priceImpactDeltaUsd; + values.priceImpactDeltaAmount = priceImpact.priceImpactDeltaAmount; + + return values; + } + + values.priceImpactDeltaUsd = getCappedPositionImpactUsd( + marketInfo, + isIncrease ? sizeDeltaUsd : sizeDeltaUsd * -1n, + isLong, + { + fallbackToZero: !isIncrease, + } + ); + + if (!isIncrease && values.priceImpactDeltaUsd < 0) { + const minPriceImpactUsd = applyFactor(sizeDeltaUsd, marketInfo.maxPositionImpactFactorNegative) * -1n; + + if (values.priceImpactDeltaUsd < minPriceImpactUsd) { + values.priceImpactDiffUsd = minPriceImpactUsd - values.priceImpactDeltaUsd; + values.priceImpactDeltaUsd = minPriceImpactUsd; + } + } + + if (values.priceImpactDeltaUsd > 0) { + values.priceImpactDeltaAmount = convertToTokenAmount( + values.priceImpactDeltaUsd, + indexToken.decimals, + indexToken.prices.maxPrice + )!; + } else { + values.priceImpactDeltaAmount = roundUpMagnitudeDivision( + values.priceImpactDeltaUsd * expandDecimals(1, indexToken.decimals), + indexToken.prices.minPrice + ); + } + + const acceptablePriceValues = getAcceptablePriceByPriceImpact({ + isIncrease, + isLong, + indexPrice, + sizeDeltaUsd, + priceImpactDeltaUsd: values.priceImpactDeltaUsd, + }); + + values.acceptablePrice = acceptablePriceValues.acceptablePrice; + values.acceptablePriceDeltaBps = acceptablePriceValues.acceptablePriceDeltaBps; + + return values; +} + +export function getAcceptablePriceByPriceImpact(p: { + isIncrease: boolean; + isLong: boolean; + indexPrice: bigint; + sizeDeltaUsd: bigint; + priceImpactDeltaUsd: bigint; +}) { + const { indexPrice, sizeDeltaUsd, priceImpactDeltaUsd } = p; + + if (sizeDeltaUsd <= 0 || indexPrice == 0n) { + return { + acceptablePrice: indexPrice, + acceptablePriceDeltaBps: 0n, + priceDelta: 0n, + }; + } + + const shouldFlipPriceImpact = getShouldUseMaxPrice(p.isIncrease, p.isLong); + + const priceImpactForPriceAdjustment = shouldFlipPriceImpact ? priceImpactDeltaUsd * -1n : priceImpactDeltaUsd; + const acceptablePrice = bigMath.mulDiv(indexPrice, sizeDeltaUsd + priceImpactForPriceAdjustment, sizeDeltaUsd); + + const priceDelta = (indexPrice - acceptablePrice) * (shouldFlipPriceImpact ? 1n : -1n); + const acceptablePriceDeltaBps = getBasisPoints(priceDelta, p.indexPrice); + + return { + acceptablePrice, + acceptablePriceDeltaBps, + priceDelta, + }; +} + +export function getDefaultAcceptablePriceImpactBps(p: { + isIncrease: boolean; + isLong: boolean; + indexPrice: bigint; + sizeDeltaUsd: bigint; + priceImpactDeltaUsd: bigint; + acceptablePriceImapctBuffer?: number; +}) { + const { + indexPrice, + sizeDeltaUsd, + priceImpactDeltaUsd, + acceptablePriceImapctBuffer = DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER, + } = p; + + if (priceImpactDeltaUsd > 0) { + return BigInt(acceptablePriceImapctBuffer); + } + + const baseAcceptablePriceValues = getAcceptablePriceByPriceImpact({ + isIncrease: p.isIncrease, + isLong: p.isLong, + indexPrice, + sizeDeltaUsd, + priceImpactDeltaUsd, + }); + + if (baseAcceptablePriceValues.acceptablePriceDeltaBps < 0) { + return bigMath.abs(baseAcceptablePriceValues.acceptablePriceDeltaBps) + BigInt(acceptablePriceImapctBuffer); + } + + return BigInt(acceptablePriceImapctBuffer); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/referrals.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/referrals.ts new file mode 100644 index 0000000..1384b26 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/referrals.ts @@ -0,0 +1,31 @@ +export const MAX_REFERRAL_CODE_LENGTH = 20; + +import { Hash, padHex, stringToHex, zeroHash } from "viem"; +import { bytesToString, hexToBytes } from "viem/utils"; + +export function decodeReferralCode(hexCode?: Hash) { + if (!hexCode || hexCode === zeroHash) { + return ""; + } + + try { + const bytes = hexToBytes(hexCode); + if (bytes.length !== 32) throw new Error(); + return bytesToString(bytes).replace(/\0+$/, ""); + } catch (ex) { + let code = ""; + const cleaned = hexCode.substring(2); + for (let i = 0; i < 32; i++) { + code += String.fromCharCode(parseInt(cleaned.substring(i * 2, i * 2 + 2), 16)); + } + return code.trim(); + } +} + +export function encodeReferralCode(code: string) { + let final = code.replace(/[^\w_]/g, ""); // replace everything other than numbers, string and underscor to '' + if (final.length > MAX_REFERRAL_CODE_LENGTH) { + return zeroHash; + } + return padHex(stringToHex(final), { size: 32, dir: "right" }); +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/simulateExecuteOrder.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/simulateExecuteOrder.ts new file mode 100644 index 0000000..fbbf057 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/simulateExecuteOrder.ts @@ -0,0 +1,184 @@ +import { Abi, Address, decodeErrorResult, encodeFunctionData, withRetry } from "viem"; + + +import { getContract } from "../configs/contracts.js"; +import { convertTokenAddress } from "../configs/tokens.js"; + +import { SwapPricingType } from "../types/orders.js"; +import { TokenPrices, TokensData } from "../types/tokens.js"; +import { convertToContractPrice, getTokenData } from "./tokens.js"; + +import type { GmxSdk } from "../index.js"; +import { extractError } from "./contracts.js"; +import { abis } from "../abis/index.js"; + +export type PriceOverrides = { + [address: string]: TokenPrices | undefined; +}; + +type SimulateExecuteParams = { + createMulticallPayload: string[]; + primaryPriceOverrides: PriceOverrides; + tokensData: TokensData; + value: bigint; + swapPricingType?: SwapPricingType; +}; + +export async function simulateExecuteOrder(sdk: GmxSdk, p: SimulateExecuteParams) { + const chainId = sdk.chainId; + const client = sdk.publicClient; + + const account = sdk.config.account; + + if (!account) { + throw new Error("Account is not defined"); + } + + const multicallAddress = getContract(chainId, "Multicall"); + const exchangeRouterAddress = getContract(chainId, "ExchangeRouter"); + + const blockTimestamp = await client.readContract({ + address: multicallAddress, + abi: abis.Multicall as Abi, + functionName: "getCurrentBlockTimestamp", + args: [], + }); + + const blockNumber = await client.getBlockNumber(); + + const { primaryTokens, primaryPrices } = getSimulationPrices(chainId, p.tokensData, p.primaryPriceOverrides); + const priceTimestamp = (blockTimestamp as bigint) + 10n; + + const simulationPriceParams = { + primaryTokens: primaryTokens, + primaryPrices: primaryPrices, + minTimestamp: priceTimestamp, + maxTimestamp: priceTimestamp, + }; + + let simulationPayloadData = [...p.createMulticallPayload]; + + const routerAbi = abis.ExchangeRouter as Abi; + const routerAddress = exchangeRouterAddress; + + let encodedFunctionData: string; + + encodedFunctionData = encodeFunctionData({ + abi: routerAbi, + functionName: "simulateExecuteLatestOrder", + args: [simulationPriceParams], + }); + simulationPayloadData.push(encodedFunctionData); + + try { + await withRetry( + async () => { + return await client.simulateContract({ + address: routerAddress, + abi: routerAbi, + functionName: "multicall", + args: [simulationPayloadData], + value: p.value, + account: account as Address, + blockNumber, + }); + }, + { + retryCount: 2, + delay: 200, + shouldRetry: (error) => { + const [message] = extractError(error); + return message?.toLocaleLowerCase()?.includes("unsupported block number") ?? false; + }, + } + ); + } catch (txnError) { + let msg: string | undefined = undefined; + try { + const errorData = extractDataFromError(txnError?.info?.error?.message) ?? extractDataFromError(txnError?.message); + + const error = new Error("No data found in error."); + error.cause = txnError; + if (!errorData) throw error; + + const decodedError = decodeErrorResult({ + abi: abis.CustomErrors as Abi, + data: errorData as Address, + }); + + const isSimulationPassed = decodedError.errorName === "EndOfOracleSimulation"; + + if (isSimulationPassed) { + return; + } + + const parsedArgs = Object.keys(decodedError.args ?? {}).reduce( + (acc, k) => { + acc[k] = decodedError.args?.[k].toString(); + return acc; + }, + {} as Record + ); + + msg = `${txnError?.info?.error?.message ?? decodedError.errorName ?? txnError?.message} ${JSON.stringify(parsedArgs, null, 2)}`; + } catch (parsingError) { + /* eslint-disable-next-line */ + console.error(parsingError); + msg = `Execute order simulation failed`; + throw new Error(msg); + } + + throw txnError; + } +} + +export function extractDataFromError(errorMessage: unknown) { + if (typeof errorMessage !== "string") return null; + + const pattern = /Unable to decode signature "([^"]+)"/; + const match = errorMessage.match(pattern); + + if (match && match[1]) { + return match[1]; + } + return null; +} + +function getSimulationPrices(chainId: number, tokensData: TokensData, primaryPricesMap: PriceOverrides) { + const tokenAddresses = Object.keys(tokensData); + + const primaryTokens: string[] = []; + const primaryPrices: { min: bigint; max: bigint }[] = []; + + for (const address of tokenAddresses) { + const token = getTokenData(tokensData, address); + const convertedAddress = convertTokenAddress(chainId, address, "wrapped"); + + if (!token?.prices || primaryTokens.includes(convertedAddress)) { + continue; + } + + primaryTokens.push(convertedAddress); + + const currentPrice = { + min: convertToContractPrice(token.prices.minPrice, token.decimals), + max: convertToContractPrice(token.prices.maxPrice, token.decimals), + }; + + const primaryOverriddenPrice = primaryPricesMap[address]; + + if (primaryOverriddenPrice) { + primaryPrices.push({ + min: convertToContractPrice(primaryOverriddenPrice.minPrice, token.decimals), + max: convertToContractPrice(primaryOverriddenPrice.maxPrice, token.decimals), + }); + } else { + primaryPrices.push(currentPrice); + } + } + + return { + primaryTokens, + primaryPrices, + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/subgraph.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/subgraph.ts new file mode 100644 index 0000000..c1b8aae --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/subgraph.ts @@ -0,0 +1,109 @@ +export type GraphQlFilters = + | { + or: GraphQlFilters[]; + } + | { + and: GraphQlFilters[]; + } + | { + /** + * `or` must be a single key-value pair in the object. + */ + or?: never; + /** + * `and` must be a single key-value pair in the object. + */ + and?: never; + /** + * Key must not start with an `_`. If you want to use nested filtering add `_` to the parent key itself if possible. + * Otherwise, if for some reason the field name itself starts with an `_`, change these types. + */ + [key: `_${string}`]: never; + [key: string]: + | string + | number + | boolean + | undefined + | GraphQlFilters + | string[] + | number[] + | GraphQlFilters[] + | null; + }; + +export function buildFiltersBody(filters: GraphQlFilters): string { + const res = {}; + + let hadOr = false; + let hadAnd = false; + + for (const [key, value] of Object.entries(filters)) { + if (value === undefined) { + continue; + } + + if (typeof value === "string") { + res[key] = `"${value}"`; + } else if (typeof value === "number") { + res[key] = `${value}`; + } else if (typeof value === "boolean") { + res[key] = `${value}`; + } else if (Array.isArray(value)) { + const valueStr = + "[" + + value + .map((el: string | number | GraphQlFilters) => { + if (typeof el === "string") { + return `"${el}"`; + } else if (typeof el === "number") { + return `${el}`; + } else { + const elemStr = buildFiltersBody(el); + + if (elemStr === "{}") { + return ""; + } else { + return elemStr; + } + } + }) + .filter((el) => el !== "") + .join(",") + + "]"; + + if (valueStr !== "[]") { + res[key] = valueStr; + } + } else if (value === null) { + res[key] = null; + } else { + const valueStr = buildFiltersBody(value); + if (valueStr !== "{}") { + res[key + "_"] = buildFiltersBody(value); + } + } + + if (hadOr) { + throw new Error("Or must be a single key-value pair in the object."); + } + + if (key === "or" && res[key] !== undefined) { + hadOr = true; + } + + if (hadAnd) { + throw new Error("And must be a single key-value pair in the object."); + } + + if (key === "and" && res[key] !== undefined) { + hadAnd = true; + } + } + + const str = Object.entries(res).reduce((previous, [key, value], index) => { + const maybeComma = index === 0 ? "" : ","; + return `${previous}${maybeComma}${key}:${value}`; + }, ""); + + return `{${str}}`; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/index.ts new file mode 100644 index 0000000..8b1dc2d --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/index.ts @@ -0,0 +1,2 @@ +export * from "./swapStats.js"; +export * from "./swapValues.js"; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapPath.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapPath.ts new file mode 100644 index 0000000..5260aaf --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapPath.ts @@ -0,0 +1,81 @@ +import { convertTokenAddress, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "../../configs/tokens.js"; +import { MarketsInfoData } from "../../types/markets.js"; +import { FindSwapPath, MarketsGraph, SwapEstimator, SwapRoute } from "../../types/trade.js"; +import { findAllPaths, getBestSwapPath } from "./swapRouting.js"; +import { getSwapPathStats } from "./swapStats.js"; +import { getSwapPathComparator } from "./swapValues.js"; + +export const getWrappedAddress = (chainId: number, address: string | undefined) => { + return address ? convertTokenAddress(chainId, address, "wrapped") : undefined; +}; + +export const findAllSwapPaths = (params: { + chainId: number; + fromTokenAddress: string | undefined; + toTokenAddress: string | undefined; + marketsInfoData: MarketsInfoData; + graph: MarketsGraph | undefined; + wrappedFromAddress: string | undefined; + wrappedToAddress: string | undefined; +}) => { + const { chainId, fromTokenAddress, toTokenAddress, marketsInfoData, graph, wrappedFromAddress, wrappedToAddress } = + params; + + if (!marketsInfoData) return undefined; + + const wrappedToken = getWrappedToken(chainId); + const isWrap = fromTokenAddress === NATIVE_TOKEN_ADDRESS && toTokenAddress === wrappedToken.address; + const isUnwrap = fromTokenAddress === wrappedToken.address && toTokenAddress === NATIVE_TOKEN_ADDRESS; + const isSameToken = fromTokenAddress === toTokenAddress; + + if (!graph || !wrappedFromAddress || !wrappedToAddress || isWrap || isUnwrap || isSameToken) { + return undefined; + } + + return findAllPaths(marketsInfoData, graph, wrappedFromAddress, wrappedToAddress)?.sort((a, b) => + b.liquidity - a.liquidity > 0 ? 1 : -1 + ); +}; + +export const createFindSwapPath = (params: { + chainId: number; + fromTokenAddress: string | undefined; + toTokenAddress: string | undefined; + marketsInfoData: MarketsInfoData | undefined; + estimator: SwapEstimator | undefined; + allPaths: SwapRoute[] | undefined; +}): FindSwapPath => { + const { chainId, fromTokenAddress, toTokenAddress, marketsInfoData, estimator, allPaths } = params; + const wrappedToken = getWrappedToken(chainId); + + const findSwapPath: FindSwapPath = (usdIn: bigint, opts: { order?: ("liquidity" | "length")[] }) => { + if (!allPaths?.length || !estimator || !marketsInfoData || !fromTokenAddress) { + return undefined; + } + + let swapPath: string[] | undefined = undefined; + const sortedPaths = opts.order ? [...allPaths].sort(getSwapPathComparator(opts.order ?? [])) : allPaths; + + if (opts.order) { + swapPath = sortedPaths[0].path; + } else { + swapPath = getBestSwapPath(allPaths, usdIn, estimator); + } + + if (!swapPath) { + return undefined; + } + + return getSwapPathStats({ + marketsInfoData, + swapPath, + initialCollateralAddress: fromTokenAddress, + wrappedNativeTokenAddress: wrappedToken.address, + shouldUnwrapNativeToken: toTokenAddress === NATIVE_TOKEN_ADDRESS, + shouldApplyPriceImpact: true, + usdIn, + }); + }; + + return findSwapPath; +}; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapRouting.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapRouting.ts new file mode 100644 index 0000000..5218b5b --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapRouting.ts @@ -0,0 +1,215 @@ +import { MarketInfo, MarketsInfoData } from "../../types/markets.js"; +import { MarketEdge, SwapEstimator, SwapRoute } from "../../types/trade.js"; +import { MarketsGraph } from "../../types/trade.js"; +import { bigMath } from "../bigmath.js"; +import { getAvailableUsdLiquidityForCollateral } from "../markets.js"; +import { getMaxSwapPathLiquidity, getSwapCapacityUsd, getSwapStats } from "./swapStats.js"; +import { SWAP_GRAPH_MAX_MARKETS_PER_TOKEN } from "../../configs/markets.js"; + +export function limitMarketsPerTokens( + markets: MarketInfo[], + limit: number = SWAP_GRAPH_MAX_MARKETS_PER_TOKEN +): MarketInfo[] { + const marketsByTokens: { [token: string]: MarketInfo[] } = {}; + + for (const market of markets) { + if (market.isSameCollaterals || market.isDisabled) { + continue; + } + + const { longTokenAddress, shortTokenAddress } = market; + + marketsByTokens[longTokenAddress] = marketsByTokens[longTokenAddress] || []; + marketsByTokens[longTokenAddress].push(market); + + marketsByTokens[shortTokenAddress] = marketsByTokens[shortTokenAddress] || []; + marketsByTokens[shortTokenAddress].push(market); + } + + const resultMarkets: { [marketAddress: string]: MarketInfo } = {}; + + const tokenAddresses = Object.keys(marketsByTokens); + + for (const tokenAddress of tokenAddresses) { + const markets = marketsByTokens[tokenAddress]; + + const sortedMarkets = markets.sort((m1, m2) => { + const liq1 = getAvailableUsdLiquidityForCollateral(m1, m1.longTokenAddress === tokenAddress); + const cap1 = getSwapCapacityUsd(m1, m1.longTokenAddress === tokenAddress); + + const limit1 = bigMath.min(liq1, cap1); + + const liq2 = getAvailableUsdLiquidityForCollateral(m2, m2.longTokenAddress === tokenAddress); + const cap2 = getSwapCapacityUsd(m2, m2.longTokenAddress === tokenAddress); + + const limit2 = bigMath.min(liq2, cap2); + + return Number(limit2 - limit1); + }); + + let marketsPerTokenCount = 0; + + for (const market of sortedMarkets) { + if (marketsPerTokenCount >= limit) { + break; + } + + if (resultMarkets[market.marketTokenAddress]) { + marketsPerTokenCount++; + continue; + } + + marketsPerTokenCount++; + resultMarkets[market.marketTokenAddress] = market; + } + } + + return Object.values(resultMarkets); +} + +export function getMarketsGraph(markets: MarketInfo[]): MarketsGraph { + const graph: MarketsGraph = { + abjacencyList: {}, + edges: [], + }; + + const limitedMarkets = limitMarketsPerTokens(markets); + + for (const market of limitedMarkets) { + const { longTokenAddress, shortTokenAddress, marketTokenAddress, isSameCollaterals, isDisabled } = market; + + if (isSameCollaterals || isDisabled) { + continue; + } + + const longShortEdge: MarketEdge = { + marketInfo: market, + marketAddress: marketTokenAddress, + from: longTokenAddress, + to: shortTokenAddress, + }; + + const shortLongEdge: MarketEdge = { + marketInfo: market, + marketAddress: marketTokenAddress, + from: shortTokenAddress, + to: longTokenAddress, + }; + + graph.abjacencyList[longTokenAddress] = graph.abjacencyList[longTokenAddress] || []; + graph.abjacencyList[longTokenAddress].push(longShortEdge); + graph.abjacencyList[shortTokenAddress] = graph.abjacencyList[shortTokenAddress] || []; + graph.abjacencyList[shortTokenAddress].push(shortLongEdge); + + graph.edges.push(longShortEdge, shortLongEdge); + } + + return graph; +} + +export const createSwapEstimator = (marketsInfoData: MarketsInfoData): SwapEstimator => { + return (e: MarketEdge, usdIn: bigint) => { + const marketInfo = marketsInfoData[e.marketAddress]; + + const swapStats = getSwapStats({ + marketInfo, + usdIn, + tokenInAddress: e.from, + tokenOutAddress: e.to, + shouldApplyPriceImpact: true, + }); + + const isOutLiquidity = swapStats?.isOutLiquidity; + const isOutCapacity = swapStats?.isOutCapacity; + const usdOut = swapStats?.usdOut; + + if (usdOut === undefined || isOutLiquidity || isOutCapacity) { + return { + usdOut: 0n, + }; + } + + return { + usdOut, + }; + }; +}; + +export function getBestSwapPath(routes: SwapRoute[], usdIn: bigint, estimator: SwapEstimator) { + if (routes.length === 0) { + return undefined; + } + + let bestPath = routes[0].path; + let bestUsdOut = 0n; + + for (const route of routes) { + try { + const pathUsdOut = route.edges.reduce((prevUsdOut, edge) => { + const { usdOut } = estimator(edge, prevUsdOut); + return usdOut; + }, usdIn); + + if (pathUsdOut > bestUsdOut) { + bestPath = route.path; + bestUsdOut = pathUsdOut; + } + } catch (e) { + continue; + } + } + + return bestPath; +} + +export function findAllPaths( + marketsInfoData: MarketsInfoData, + graph: MarketsGraph, + from: string, + to: string, + maxDepth = 3 +): SwapRoute[] | undefined { + const routes: SwapRoute[] = []; + + const edges = graph.abjacencyList[from]; + + if (!edges?.length) { + return undefined; + } + + for (const e of edges) { + dfs(e, [], [], {}); + } + + function dfs(edge: MarketEdge, path: string[], pathEdges: MarketEdge[], visited: { [edgeId: string]: boolean }) { + // avoid too deep paths and cycles + if (path.length >= maxDepth || visited[edge.marketAddress]) { + return; + } + + visited[edge.marketAddress] = true; + pathEdges.push(edge); + path.push(edge.marketAddress); + + if (edge.to === to) { + routes.push({ + edges: pathEdges, + path: path, + liquidity: getMaxSwapPathLiquidity({ marketsInfoData, swapPath: path, initialCollateralAddress: from }), + }); + return; + } + + const edges = graph.abjacencyList[edge.to]; + + if (!edges?.length) { + return; + } + + for (const e of edges) { + dfs(e, [...path], [...pathEdges], { ...visited }); + } + } + + return routes; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapStats.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapStats.ts new file mode 100644 index 0000000..2f5b7d7 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapStats.ts @@ -0,0 +1,360 @@ +import { NATIVE_TOKEN_ADDRESS } from "../../configs/tokens.js"; +import { MarketInfo, MarketsInfoData } from "../../types/markets.js"; +import { getByKey } from "../objects.js"; +import { getAvailableUsdLiquidityForCollateral, getOppositeCollateral, getTokenPoolType } from "../markets.js"; +import { SwapPathStats, SwapStats } from "../../types/trade.js"; +import { convertToTokenAmount, convertToUsd, getMidPrice } from "../tokens.js"; +import { applySwapImpactWithCap, getPriceImpactForSwap, getSwapFee } from "../fees/index.js"; +import { maxUint256 } from "viem"; + +export function getSwapCapacityUsd(marketInfo: MarketInfo, isLong: boolean) { + const poolAmount = isLong ? marketInfo.longPoolAmount : marketInfo.shortPoolAmount; + const maxPoolAmount = isLong ? marketInfo.maxLongPoolAmount : marketInfo.maxShortPoolAmount; + + const capacityAmount = maxPoolAmount - poolAmount; + const token = isLong ? marketInfo.longToken : marketInfo.shortToken; + + const capacityUsd = convertToUsd(capacityAmount, token.decimals, getMidPrice(token.prices))!; + + return capacityUsd; +} + +export function getSwapPathOutputAddresses(p: { + marketsInfoData: MarketsInfoData; + initialCollateralAddress: string; + swapPath: string[]; + wrappedNativeTokenAddress: string; + shouldUnwrapNativeToken: boolean; + isIncrease: boolean; +}) { + const { + marketsInfoData, + initialCollateralAddress, + swapPath, + wrappedNativeTokenAddress, + shouldUnwrapNativeToken, + isIncrease, + } = p; + + if (swapPath.length === 0) { + // Increase + if (isIncrease) { + // During increase target collateral token is always ERC20 token, it can not be native token. + // Thus we do not need to check if initial collateral token is wrapped token to unwrap it. + // So we can safely return initial collateral token address as out token address, when there is no swap path. + + return { + outTokenAddress: initialCollateralAddress, + outMarketAddress: undefined, + }; + } + + // Decrease + if (shouldUnwrapNativeToken && initialCollateralAddress === wrappedNativeTokenAddress) { + return { + outTokenAddress: NATIVE_TOKEN_ADDRESS, + outMarketAddress: undefined, + }; + } + + return { + outTokenAddress: initialCollateralAddress, + outMarketAddress: undefined, + }; + } + + const [firstMarketAddress, ...marketAddresses] = swapPath; + + let outMarket = getByKey(marketsInfoData, firstMarketAddress); + + if (!outMarket) { + return { + outTokenAddress: undefined, + outMarketAddress: undefined, + }; + } + + let outTokenType = getTokenPoolType(outMarket, initialCollateralAddress); + let outToken = outTokenType === "long" ? outMarket.shortToken : outMarket.longToken; + + for (const marketAddress of marketAddresses) { + outMarket = getByKey(marketsInfoData, marketAddress); + + if (!outMarket) { + return { + outTokenAddress: undefined, + outMarketAddress: undefined, + }; + } + + outTokenType = outMarket.longTokenAddress === outToken.address ? "short" : "long"; + outToken = outTokenType === "long" ? outMarket.longToken : outMarket.shortToken; + } + + let outTokenAddress: string; + if (isIncrease) { + // Here swap path is not empty, this means out token came from swapping tokens, + // thus it can not be native token by design. + outTokenAddress = outToken.address; + } else { + if (shouldUnwrapNativeToken && outToken.address === wrappedNativeTokenAddress) { + outTokenAddress = NATIVE_TOKEN_ADDRESS; + } else { + outTokenAddress = outToken.address; + } + } + + return { + outTokenAddress, + outMarketAddress: outMarket.marketTokenAddress, + }; +} + +export function getSwapPathStats(p: { + marketsInfoData: MarketsInfoData; + swapPath: string[]; + initialCollateralAddress: string; + wrappedNativeTokenAddress: string; + usdIn: bigint; + shouldUnwrapNativeToken: boolean; + shouldApplyPriceImpact: boolean; +}): SwapPathStats | undefined { + const { + marketsInfoData, + swapPath, + initialCollateralAddress, + usdIn, + shouldUnwrapNativeToken, + shouldApplyPriceImpact, + wrappedNativeTokenAddress, + } = p; + + if (swapPath.length === 0) { + return undefined; + } + + const swapSteps: SwapStats[] = []; + + let usdOut = usdIn; + + let tokenInAddress = initialCollateralAddress; + let tokenOutAddress = initialCollateralAddress; + + let totalSwapPriceImpactDeltaUsd = 0n; + let totalSwapFeeUsd = 0n; + + for (let i = 0; i < swapPath.length; i++) { + const marketAddress = swapPath[i]; + const marketInfo = marketsInfoData[marketAddress]; + + tokenOutAddress = getOppositeCollateral(marketInfo, tokenInAddress)!.address; + + if (i === swapPath.length - 1 && shouldUnwrapNativeToken && tokenOutAddress === wrappedNativeTokenAddress) { + tokenOutAddress = NATIVE_TOKEN_ADDRESS; + } + + const swapStep = getSwapStats({ + marketInfo, + tokenInAddress, + tokenOutAddress, + usdIn: usdOut, + shouldApplyPriceImpact, + }); + + tokenInAddress = swapStep.tokenOutAddress; + usdOut = swapStep.usdOut; + + totalSwapPriceImpactDeltaUsd = totalSwapPriceImpactDeltaUsd + swapStep.priceImpactDeltaUsd; + totalSwapFeeUsd = totalSwapFeeUsd + swapStep.swapFeeUsd; + + swapSteps.push(swapStep); + } + + const lastStep = swapSteps[swapSteps.length - 1]; + const targetMarketAddress = lastStep.marketAddress; + const amountOut = lastStep.amountOut; + + const totalFeesDeltaUsd = 0n - totalSwapFeeUsd + totalSwapPriceImpactDeltaUsd; + + return { + swapPath, + tokenInAddress, + tokenOutAddress, + targetMarketAddress, + swapSteps, + usdOut, + amountOut, + totalSwapFeeUsd, + totalSwapPriceImpactDeltaUsd, + totalFeesDeltaUsd, + }; +} + +export function getSwapStats(p: { + marketInfo: MarketInfo; + tokenInAddress: string; + tokenOutAddress: string; + usdIn: bigint; + shouldApplyPriceImpact: boolean; +}): SwapStats { + const { marketInfo, tokenInAddress, tokenOutAddress, usdIn, shouldApplyPriceImpact } = p; + + const isWrap = tokenInAddress === NATIVE_TOKEN_ADDRESS; + const isUnwrap = tokenOutAddress === NATIVE_TOKEN_ADDRESS; + + const tokenIn = + getTokenPoolType(marketInfo, tokenInAddress) === "long" ? marketInfo.longToken : marketInfo.shortToken; + + const tokenOut = + getTokenPoolType(marketInfo, tokenOutAddress) === "long" ? marketInfo.longToken : marketInfo.shortToken; + + const priceIn = tokenIn.prices.minPrice; + const priceOut = tokenOut.prices.maxPrice; + + const amountIn = convertToTokenAmount(usdIn, tokenIn.decimals, priceIn)!; + + let priceImpactDeltaUsd: bigint; + + try { + priceImpactDeltaUsd = getPriceImpactForSwap(marketInfo, tokenIn, tokenOut, usdIn, usdIn * -1n); + } catch (e) { + return { + swapFeeUsd: 0n, + swapFeeAmount: 0n, + isWrap, + isUnwrap, + marketAddress: marketInfo.marketTokenAddress, + tokenInAddress, + tokenOutAddress, + priceImpactDeltaUsd: 0n, + amountIn, + amountInAfterFees: amountIn, + usdIn, + amountOut: 0n, + usdOut: 0n, + isOutLiquidity: true, + }; + } + + const swapFeeAmount = getSwapFee(marketInfo, amountIn, priceImpactDeltaUsd > 0); + const swapFeeUsd = getSwapFee(marketInfo, usdIn, priceImpactDeltaUsd > 0); + + const amountInAfterFees = amountIn - swapFeeAmount; + const usdInAfterFees = usdIn - swapFeeUsd; + + let usdOut = usdInAfterFees; + let amountOut = convertToTokenAmount(usdOut, tokenOut.decimals, priceOut)!; + + let cappedImpactDeltaUsd: bigint; + + if (priceImpactDeltaUsd > 0) { + const { impactDeltaAmount: positiveImpactAmountTokenOut, cappedDiffUsd } = applySwapImpactWithCap( + marketInfo, + tokenOut, + priceImpactDeltaUsd + ); + cappedImpactDeltaUsd = convertToUsd(positiveImpactAmountTokenOut, tokenOut.decimals, priceOut)!; + + // https://github.com/gmx-io/gmx-synthetics/blob/3df10f1eab2734cf1b5f0a5dff12b79cbb19907d/contracts/swap/SwapUtils.sol#L290-L291 + if (cappedDiffUsd > 0) { + const { impactDeltaAmount: positiveImpactAmountTokenIn } = applySwapImpactWithCap( + marketInfo, + tokenIn, + cappedDiffUsd + ); + if (positiveImpactAmountTokenIn > 0) { + cappedImpactDeltaUsd += convertToUsd(positiveImpactAmountTokenIn, tokenIn.decimals, priceIn)!; + } + } + } else { + const { impactDeltaAmount: negativeImpactAmount } = applySwapImpactWithCap( + marketInfo, + tokenIn, + priceImpactDeltaUsd + ); + cappedImpactDeltaUsd = convertToUsd(negativeImpactAmount, tokenIn.decimals, priceIn)!; + } + + if (shouldApplyPriceImpact) { + usdOut = usdOut + cappedImpactDeltaUsd; + } + + if (usdOut < 0) { + usdOut = 0n; + } + + amountOut = convertToTokenAmount(usdOut, tokenOut.decimals, priceOut)!; + + const capacityUsd = getSwapCapacityUsd(marketInfo, getTokenPoolType(marketInfo, tokenInAddress) === "long"); + + const isOutCapacity = capacityUsd < usdInAfterFees; + + const liquidity = getAvailableUsdLiquidityForCollateral( + marketInfo, + getTokenPoolType(marketInfo, tokenOutAddress) === "long" + ); + + const isOutLiquidity = liquidity < usdOut; + + return { + swapFeeUsd, + swapFeeAmount, + isWrap, + isUnwrap, + marketAddress: marketInfo.marketTokenAddress, + tokenInAddress, + tokenOutAddress, + priceImpactDeltaUsd: cappedImpactDeltaUsd, + amountIn, + amountInAfterFees, + usdIn, + amountOut, + usdOut, + isOutLiquidity, + isOutCapacity, + }; +} + +export function getMaxSwapPathLiquidity(p: { + marketsInfoData: MarketsInfoData; + swapPath: string[]; + initialCollateralAddress: string; +}) { + const { marketsInfoData, swapPath, initialCollateralAddress } = p; + + if (swapPath.length === 0) { + return 0n; + } + + let minMarketLiquidity = maxUint256; + let tokenInAddress = initialCollateralAddress; + + for (const marketAddress of swapPath) { + const marketInfo = getByKey(marketsInfoData, marketAddress); + + if (!marketInfo) { + return 0n; + } + + const tokenOut = getOppositeCollateral(marketInfo, tokenInAddress); + + if (!tokenOut) { + return 0n; + } + + const isTokenOutLong = getTokenPoolType(marketInfo, tokenOut.address) === "long"; + const liquidity = getAvailableUsdLiquidityForCollateral(marketInfo, isTokenOutLong); + + if (liquidity < minMarketLiquidity) { + minMarketLiquidity = liquidity; + } + + tokenInAddress = tokenOut.address; + } + + if (minMarketLiquidity === maxUint256) { + return 0n; + } + + return minMarketLiquidity; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapValues.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapValues.ts new file mode 100644 index 0000000..b672140 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/swap/swapValues.ts @@ -0,0 +1,264 @@ +import { SwapRoute } from "../../types/trade.js"; + +import type { SwapAmounts } from "../../types/trade.js"; +import type { FindSwapPath } from "../../types/trade.js"; +import type { TokenData } from "../../types/tokens.js"; +import type { TokensRatio } from "../../types/tokens.js"; + +import { BASIS_POINTS_DIVISOR_BIGINT } from "../../configs/factors.js"; + +import { applyFactor } from "../numbers.js"; +import { bigMath } from "../bigmath.js"; +import { convertToUsd, getIsEquivalentTokens, convertToTokenAmount, getAmountByRatio } from "../tokens.js"; +import { getTotalSwapVolumeFromSwapStats } from "../fees/index.js"; + +export function getSwapAmountsByFromValue(p: { + tokenIn: TokenData; + tokenOut: TokenData; + amountIn: bigint; + triggerRatio?: TokensRatio; + isLimit: boolean; + swapOptimizationOrder?: Parameters[1]["order"]; + allowedSwapSlippageBps?: bigint; + findSwapPath: FindSwapPath; + uiFeeFactor: bigint; +}): SwapAmounts { + const { + tokenIn, + tokenOut, + amountIn, + triggerRatio, + isLimit, + swapOptimizationOrder, + findSwapPath, + uiFeeFactor, + allowedSwapSlippageBps, + } = p; + + const priceIn = tokenIn.prices.minPrice; + const priceOut = tokenOut.prices.maxPrice; + + const usdIn = convertToUsd(amountIn, tokenIn.decimals, priceIn)!; + + let amountOut = 0n; + let usdOut = 0n; + let minOutputAmount = 0n; + + const defaultAmounts: SwapAmounts = { + amountIn, + usdIn, + amountOut, + usdOut, + minOutputAmount, + priceIn, + priceOut, + swapPathStats: undefined, + }; + + if (amountIn <= 0) { + return defaultAmounts; + } + + if (getIsEquivalentTokens(tokenIn, tokenOut)) { + amountOut = amountIn; + usdOut = usdIn; + minOutputAmount = amountOut; + + return { + amountIn, + usdIn, + amountOut, + usdOut, + minOutputAmount, + priceIn, + priceOut, + swapPathStats: undefined, + }; + } + + const swapPathStats = findSwapPath(defaultAmounts.usdIn, { order: swapOptimizationOrder }); + + const totalSwapVolume = getTotalSwapVolumeFromSwapStats(swapPathStats?.swapSteps); + const swapUiFeeUsd = applyFactor(totalSwapVolume, uiFeeFactor); + const swapUiFeeAmount = convertToTokenAmount(swapUiFeeUsd, tokenOut.decimals, priceOut)!; + + if (!swapPathStats) { + return defaultAmounts; + } + + if (isLimit) { + if (!triggerRatio) { + return defaultAmounts; + } + + amountOut = getAmountByRatio({ + fromToken: tokenIn, + toToken: tokenOut, + fromTokenAmount: amountIn, + ratio: triggerRatio.ratio, + shouldInvertRatio: triggerRatio.largestToken.address === tokenOut.address, + allowedSwapSlippageBps, + }); + + usdOut = convertToUsd(amountOut, tokenOut.decimals, priceOut)!; + amountOut = convertToTokenAmount(usdOut, tokenOut.decimals, priceOut)!; + minOutputAmount = amountOut; + } else { + usdOut = swapPathStats.usdOut - swapUiFeeUsd; + amountOut = swapPathStats.amountOut - swapUiFeeAmount; + minOutputAmount = amountOut; + } + + if (amountOut < 0) { + amountOut = 0n; + usdOut = 0n; + minOutputAmount = 0n; + } + + return { + amountIn, + usdIn, + amountOut, + usdOut, + priceIn, + priceOut, + minOutputAmount, + swapPathStats, + }; +} + +export function getSwapAmountsByToValue(p: { + tokenIn: TokenData; + tokenOut: TokenData; + amountOut: bigint; + triggerRatio?: TokensRatio; + isLimit: boolean; + findSwapPath: FindSwapPath; + swapOptimizationOrder?: Parameters[1]["order"]; + allowedSwapSlippageBps?: bigint; + uiFeeFactor: bigint; +}): SwapAmounts { + const { + tokenIn, + tokenOut, + amountOut, + triggerRatio, + isLimit, + findSwapPath, + uiFeeFactor, + swapOptimizationOrder, + allowedSwapSlippageBps, + } = p; + + const priceIn = tokenIn.prices.minPrice; + const priceOut = tokenOut.prices.maxPrice; + + const usdOut = convertToUsd(amountOut, tokenOut.decimals, priceOut)!; + const uiFeeUsd = applyFactor(usdOut, uiFeeFactor); + + let minOutputAmount = amountOut; + + let amountIn = 0n; + let usdIn = 0n; + + const defaultAmounts: SwapAmounts = { + amountIn, + usdIn, + amountOut, + usdOut, + minOutputAmount, + priceIn, + priceOut, + swapPathStats: undefined, + }; + + if (amountOut <= 0) { + return defaultAmounts; + } + + if (getIsEquivalentTokens(tokenIn, tokenOut)) { + amountIn = amountOut; + usdIn = usdOut; + + return { + amountIn, + usdIn, + amountOut, + usdOut, + minOutputAmount, + priceIn, + priceOut, + swapPathStats: undefined, + }; + } + + const baseUsdIn = usdOut; + const swapPathStats = findSwapPath(baseUsdIn, { order: swapOptimizationOrder }); + + if (!swapPathStats) { + return defaultAmounts; + } + + if (isLimit) { + if (!triggerRatio) { + return defaultAmounts; + } + + amountIn = getAmountByRatio({ + fromToken: tokenOut, + toToken: tokenIn, + fromTokenAmount: amountOut, + ratio: triggerRatio.ratio, + shouldInvertRatio: triggerRatio.largestToken.address === tokenIn.address, + }); + + usdIn = convertToUsd(amountIn, tokenIn.decimals, priceIn)!; + if (allowedSwapSlippageBps !== undefined) { + usdIn += bigMath.mulDiv(usdIn, allowedSwapSlippageBps ?? 0n, BASIS_POINTS_DIVISOR_BIGINT); + } else { + usdIn = usdIn + swapPathStats.totalSwapFeeUsd + uiFeeUsd - swapPathStats.totalSwapPriceImpactDeltaUsd; + } + amountIn = convertToTokenAmount(usdIn, tokenIn.decimals, priceIn)!; + } else { + const adjustedUsdIn = swapPathStats.usdOut > 0 ? bigMath.mulDiv(baseUsdIn, usdOut, swapPathStats.usdOut) : 0n; + + usdIn = adjustedUsdIn + uiFeeUsd; + amountIn = convertToTokenAmount(usdIn, tokenIn.decimals, priceIn)!; + } + + if (amountIn < 0) { + amountIn = 0n; + usdIn = 0n; + } + + return { + amountIn, + usdIn, + amountOut, + usdOut, + minOutputAmount, + priceIn, + priceOut, + swapPathStats, + }; +} + +export function getSwapPathComparator(order: Parameters[1]["order"]) { + return function (a: SwapRoute, b: SwapRoute) { + for (const field of order || []) { + const isLiquidity = field === "liquidity"; + const aVal = isLiquidity ? a.liquidity : a.path.length; + const bVal = isLiquidity ? b.liquidity : b.path.length; + + if (aVal !== bVal) { + if (isLiquidity) { + return aVal < bVal ? 1 : -1; + } else { + return aVal < bVal ? -1 : 1; + } + } + } + + return 0; + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/testUtil.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/testUtil.ts new file mode 100644 index 0000000..dac3589 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/testUtil.ts @@ -0,0 +1,25 @@ +import {createTestClient, http, publicActions, walletActions} from "viem"; + +import {ARBITRUM, getChain} from "../configs/chains.js"; + +import {GmxSdk} from "../index.js"; + +const client = createTestClient({ + chain: getChain(ARBITRUM), + mode: "hardhat", + transport: http(), +}) + .extend(publicActions) + .extend(walletActions); + +export const arbitrumSdkConfig = { + chainId: ARBITRUM, + account: "0x9f7198eb1b9Ccc0Eb7A07eD228d8FbC12963ea33", + oracleUrl: "https://arbitrum-api.gmxinfra.io", + rpcUrl: "https://arb1.arbitrum.io/rpc", + walletClient: client, + subsquidUrl: "https://gmx.squids.live/gmx-synthetics-arbitrum:live/api/graphql", + subgraphUrl: "https://subgraph.satsuma-prod.com/3b2ced13c8d9/gmx/synthetics-arbitrum-stats/api", +}; + +export const arbitrumSdk = new GmxSdk(arbitrumSdkConfig); diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/tokens.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/tokens.ts new file mode 100644 index 0000000..ffdea0f --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/tokens.ts @@ -0,0 +1,204 @@ +import {Token, TokenPrices, TokensData, TokensRatio, TokensRatioAndSlippage} from "../types/tokens.js"; +import {adjustForDecimals, expandDecimals, PRECISION} from "./numbers.js"; +import {NATIVE_TOKEN_ADDRESS} from "../configs/tokens.js"; +import {BASIS_POINTS_DIVISOR_BIGINT, DEFAULT_ALLOWED_SWAP_SLIPPAGE_BPS} from "../configs/factors.js"; +import {bigMath} from "./bigmath.js"; + +export function parseContractPrice(price: bigint, tokenDecimals: number) { + return price * expandDecimals(1, tokenDecimals); +} + +export function convertToContractPrice(price: bigint, tokenDecimals: number) { + return price / expandDecimals(1, tokenDecimals); +} + +export function convertToContractTokenPrices(prices: TokenPrices, tokenDecimals: number) { + return { + min: convertToContractPrice(prices.minPrice, tokenDecimals), + max: convertToContractPrice(prices.maxPrice, tokenDecimals), + }; +} + +export function convertToTokenAmount( + usd: bigint | undefined, + tokenDecimals: number | undefined, + price: bigint | undefined +) { + if (usd === undefined || typeof tokenDecimals !== "number" || price === undefined || price <= 0) { + return undefined; + } + + return (usd * expandDecimals(1, tokenDecimals)) / price; +} + +export function convertToUsd( + tokenAmount: bigint | undefined, + tokenDecimals: number | undefined, + price: bigint | undefined +) { + if (tokenAmount == undefined || typeof tokenDecimals !== "number" || price === undefined) { + return undefined; + } + + return (tokenAmount * price) / expandDecimals(1, tokenDecimals); +} + +export function getMidPrice(prices: TokenPrices) { + return (prices.minPrice + prices.maxPrice) / 2n; +} + +export function getIsEquivalentTokens(token1: Token, token2: Token) { + if (token1.address === token2.address) { + return true; + } + + if (token1.wrappedAddress === token2.address || token2.wrappedAddress === token1.address) { + return true; + } + + if ((token1.isSynthetic || token2.isSynthetic) && token1.symbol === token2.symbol) { + return true; + } + + return false; +} + +export function getTokenData(tokensData?: TokensData, address?: string, convertTo?: "wrapped" | "native") { + if (!address || !tokensData?.[address]) { + return undefined; + } + + const token = tokensData[address]; + + if (convertTo === "wrapped" && token.isNative && token.wrappedAddress) { + return tokensData[token.wrappedAddress]; + } + + if (convertTo === "native" && token.isWrapped) { + return tokensData[NATIVE_TOKEN_ADDRESS]; + } + + return token; +} + +/** + * Even though its not a generic function, it return the same type as the input. + * If `TokenData` is passed, it returns `TokenData`, if `Token` is passed, it returns `Token`. + */ +export function getTokensRatioByAmounts(p: { + fromToken: Token; + toToken: Token; + fromTokenAmount: bigint; + toTokenAmount: bigint; +}): TokensRatio { + const { fromToken, toToken, fromTokenAmount, toTokenAmount } = p; + + const adjustedFromAmount = (fromTokenAmount * PRECISION) / expandDecimals(1, fromToken.decimals); + const adjustedToAmount = (toTokenAmount * PRECISION) / expandDecimals(1, toToken.decimals); + + const [smallestToken, largestToken, largestAmount, smallestAmount] = + adjustedFromAmount > adjustedToAmount + ? [fromToken, toToken, adjustedFromAmount, adjustedToAmount] + : [toToken, fromToken, adjustedToAmount, adjustedFromAmount]; + + const ratio = smallestAmount > 0 ? (largestAmount * PRECISION) / smallestAmount : 0n; + + return { ratio, largestToken, smallestToken }; +} + +export function getTokensRatioByMinOutputAmountAndTriggerPrice(p: { + fromToken: Token; + toToken: Token; + fromTokenAmount: bigint; + toTokenAmount: bigint; + triggerPrice: bigint; + minOutputAmount: bigint; +}): TokensRatioAndSlippage { + const { fromToken, toToken, fromTokenAmount, toTokenAmount, triggerPrice, minOutputAmount } = p; + + let allowedSwapSlippageBps = DEFAULT_ALLOWED_SWAP_SLIPPAGE_BPS; + let smallestToken = fromToken; + let largestToken = toToken; + let largestAmount = fromTokenAmount; + let smallestAmount = toTokenAmount; + let acceptablePrice = 0n; + let ratio = 0n; + + const adjustedFromAmount = (fromTokenAmount * PRECISION) / expandDecimals(1, fromToken.decimals); + const adjustedToAmount = (minOutputAmount * PRECISION) / expandDecimals(1, toToken.decimals); + const adjustedMinOutputAmount = (minOutputAmount * PRECISION) / expandDecimals(1, toToken.decimals); + + [smallestToken, largestToken, largestAmount, smallestAmount] = + adjustedFromAmount > adjustedToAmount + ? [fromToken, toToken, adjustedFromAmount, adjustedToAmount] + : [toToken, fromToken, adjustedToAmount, adjustedFromAmount]; + ratio = smallestAmount > 0 ? (largestAmount * PRECISION) / smallestAmount : 0n; + + if (triggerPrice === 0n) { + allowedSwapSlippageBps = DEFAULT_ALLOWED_SWAP_SLIPPAGE_BPS; + acceptablePrice = ratio; + } else { + const outputAtTriggerPrice = + adjustedFromAmount > adjustedToAmount + ? (adjustedFromAmount * PRECISION) / triggerPrice + : (adjustedFromAmount * triggerPrice) / PRECISION; + + allowedSwapSlippageBps = + ((outputAtTriggerPrice - adjustedMinOutputAmount) * BASIS_POINTS_DIVISOR_BIGINT) / outputAtTriggerPrice; + acceptablePrice = ratio; + ratio = triggerPrice; + } + + return { ratio, largestToken, smallestToken, allowedSwapSlippageBps, acceptablePrice }; +} + +export function getAmountByRatio(p: { + fromToken: Token; + toToken: Token; + fromTokenAmount: bigint; + ratio: bigint; + shouldInvertRatio?: boolean; + allowedSwapSlippageBps?: bigint; +}) { + const { fromToken, toToken, fromTokenAmount, ratio, shouldInvertRatio, allowedSwapSlippageBps } = p; + + if (getIsEquivalentTokens(fromToken, toToken) || fromTokenAmount === 0n) { + return p.fromTokenAmount; + } + + const _ratio = shouldInvertRatio ? (PRECISION * PRECISION) / ratio : ratio; + + const adjustedDecimalsRatio = adjustForDecimals(_ratio, fromToken.decimals, toToken.decimals); + const amount = (p.fromTokenAmount * adjustedDecimalsRatio) / PRECISION; + + const swapSlippageAmount = + allowedSwapSlippageBps !== undefined + ? bigMath.mulDiv(amount, allowedSwapSlippageBps, BASIS_POINTS_DIVISOR_BIGINT) + : 0n; + + return amount - swapSlippageAmount; +} + +export function getIsWrap(token1: Token, token2: Token) { + return token1.isNative && token2.isWrapped; +} + +export function getIsUnwrap(token1: Token, token2: Token) { + return token1.isWrapped && token2.isNative; +} + +export function getTokensRatioByPrice(p: { + fromToken: Token; + toToken: Token; + fromPrice: bigint; + toPrice: bigint; +}): TokensRatio { + const { fromToken, toToken, fromPrice, toPrice } = p; + + const [largestToken, smallestToken, largestPrice, smallestPrice] = + fromPrice > toPrice ? [fromToken, toToken, fromPrice, toPrice] : [toToken, fromToken, toPrice, fromPrice]; + + const ratio = (largestPrice * PRECISION) / smallestPrice; + + return { ratio, largestToken, smallestToken }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/amounts.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/amounts.ts new file mode 100644 index 0000000..91cab5e --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/amounts.ts @@ -0,0 +1,517 @@ +import { ExternalSwapQuote, FindSwapPath, TriggerThresholdType } from "../../types/trade.js"; + +import { TokenData, TokensRatio } from "../../types/tokens.js"; + +import { BASIS_POINTS_DIVISOR_BIGINT } from "../../configs/factors.js"; +import { MarketInfo } from "../../types/markets.js"; +import { OrderType } from "../../types/orders.js"; +import { PositionInfo } from "../../types/positions.js"; +import { UserReferralInfo } from "../../types/referrals.js"; +import { IncreasePositionAmounts } from "../../types/trade.js"; +import { bigMath } from "../bigmath.js"; +import { getPositionFee, getPriceImpactForPosition, getTotalSwapVolumeFromSwapStats } from "../fees/index.js"; +import { applyFactor } from "../numbers.js"; +import { getLeverage } from "../positions.js"; +import { + getAcceptablePriceInfo, + getDefaultAcceptablePriceImpactBps, + getMarkPrice, + getOrderThresholdType, +} from "../prices.js"; +import { getSwapAmountsByFromValue, getSwapAmountsByToValue } from "../swap/index.js"; +import { convertToTokenAmount, convertToUsd, getIsEquivalentTokens, getTokensRatioByPrice } from "../tokens.js"; +import { maxUint256 } from "viem"; + +type IncreasePositionParams = { + marketInfo: MarketInfo; + indexToken: TokenData; + initialCollateralToken: TokenData; + collateralToken: TokenData; + isLong: boolean; + initialCollateralAmount: bigint | undefined; + position: PositionInfo | undefined; + externalSwapQuote: ExternalSwapQuote | undefined; + indexTokenAmount: bigint | undefined; + leverage?: bigint; + triggerPrice?: bigint; + limitOrderType?: IncreasePositionAmounts["limitOrderType"]; + fixedAcceptablePriceImpactBps?: bigint; + acceptablePriceImpactBuffer?: number; + userReferralInfo: UserReferralInfo | undefined; + strategy: "leverageBySize" | "leverageByCollateral" | "independent"; + findSwapPath: FindSwapPath; + uiFeeFactor: bigint; +}; + +export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreasePositionAmounts { + const { + marketInfo, + indexToken, + initialCollateralToken, + collateralToken, + initialCollateralAmount, + indexTokenAmount, + isLong, + leverage, + triggerPrice, + limitOrderType, + position, + fixedAcceptablePriceImpactBps, + acceptablePriceImpactBuffer, + externalSwapQuote, + findSwapPath, + userReferralInfo, + uiFeeFactor, + strategy, + } = p; + + const values: IncreasePositionAmounts = { + initialCollateralAmount: 0n, + initialCollateralUsd: 0n, + + collateralDeltaAmount: 0n, + collateralDeltaUsd: 0n, + + swapPathStats: undefined, + externalSwapQuote: undefined, + + indexTokenAmount: 0n, + + sizeDeltaUsd: 0n, + sizeDeltaInTokens: 0n, + + estimatedLeverage: 0n, + + indexPrice: 0n, + initialCollateralPrice: 0n, + collateralPrice: 0n, + triggerPrice: 0n, + acceptablePrice: 0n, + acceptablePriceDeltaBps: 0n, + + positionFeeUsd: 0n, + uiFeeUsd: 0n, + swapUiFeeUsd: 0n, + feeDiscountUsd: 0n, + borrowingFeeUsd: 0n, + fundingFeeUsd: 0n, + positionPriceImpactDeltaUsd: 0n, + + limitOrderType: limitOrderType, + triggerThresholdType: undefined, + }; + + const isLimit = limitOrderType !== undefined; + + const swapOptimizationOrder: Parameters[1]["order"] = isLimit ? ["length", "liquidity"] : undefined; + + const prices = getIncreasePositionPrices({ + triggerPrice, + indexToken, + initialCollateralToken, + collateralToken, + limitOrderType, + isLong, + }); + + values.indexPrice = prices.indexPrice; + values.initialCollateralPrice = prices.initialCollateralPrice; + values.collateralPrice = prices.collateralPrice; + values.triggerPrice = prices.triggerPrice; + values.triggerThresholdType = prices.triggerThresholdType; + + values.borrowingFeeUsd = position?.pendingBorrowingFeesUsd || 0n; + values.fundingFeeUsd = position?.pendingFundingFeesUsd || 0n; + + if (values.indexPrice <= 0 || values.initialCollateralPrice <= 0 || values.collateralPrice <= 0) { + return values; + } + + // Size and collateral + if ( + strategy === "leverageByCollateral" && + leverage !== undefined && + initialCollateralAmount !== undefined && + initialCollateralAmount > 0 + ) { + values.estimatedLeverage = leverage; + + values.initialCollateralAmount = initialCollateralAmount; + values.initialCollateralUsd = convertToUsd( + initialCollateralAmount, + initialCollateralToken.decimals, + values.initialCollateralPrice + )!; + + values.externalSwapQuote = externalSwapQuote; + const swapAmounts = getSwapAmountsByFromValue({ + tokenIn: initialCollateralToken, + tokenOut: collateralToken, + amountIn: initialCollateralAmount, + isLimit: false, + findSwapPath, + uiFeeFactor, + swapOptimizationOrder, + }); + values.swapPathStats = swapAmounts.swapPathStats; + + const swapAmountOut = values.externalSwapQuote?.amountOut ?? swapAmounts.amountOut; + const baseCollateralUsd = convertToUsd(swapAmountOut, collateralToken.decimals, values.collateralPrice)!; + const baseSizeDeltaUsd = bigMath.mulDiv(baseCollateralUsd, leverage, BASIS_POINTS_DIVISOR_BIGINT); + const basePriceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, baseSizeDeltaUsd, isLong); + const basePositionFeeInfo = getPositionFee( + marketInfo, + baseSizeDeltaUsd, + basePriceImpactDeltaUsd > 0, + userReferralInfo + ); + const baseUiFeeUsd = applyFactor(baseSizeDeltaUsd, uiFeeFactor); + const totalSwapVolumeUsd = !values.externalSwapQuote + ? getTotalSwapVolumeFromSwapStats(values.swapPathStats?.swapSteps) + : 0n; + values.swapUiFeeUsd = applyFactor(totalSwapVolumeUsd, uiFeeFactor); + + values.sizeDeltaUsd = bigMath.mulDiv( + baseCollateralUsd - basePositionFeeInfo.positionFeeUsd - baseUiFeeUsd - values.swapUiFeeUsd, + leverage, + BASIS_POINTS_DIVISOR_BIGINT + ); + + values.indexTokenAmount = convertToTokenAmount(values.sizeDeltaUsd, indexToken.decimals, values.indexPrice)!; + + const positionFeeInfo = getPositionFee( + marketInfo, + values.sizeDeltaUsd, + basePriceImpactDeltaUsd > 0, + userReferralInfo + ); + values.positionFeeUsd = positionFeeInfo.positionFeeUsd; + values.feeDiscountUsd = positionFeeInfo.discountUsd; + values.uiFeeUsd = applyFactor(values.sizeDeltaUsd, uiFeeFactor); + + values.collateralDeltaUsd = + baseCollateralUsd - + values.positionFeeUsd - + values.borrowingFeeUsd - + values.fundingFeeUsd - + values.uiFeeUsd - + values.swapUiFeeUsd; + + values.collateralDeltaAmount = convertToTokenAmount( + values.collateralDeltaUsd, + collateralToken.decimals, + values.collateralPrice + )!; + } else if ( + strategy === "leverageBySize" && + leverage !== undefined && + indexTokenAmount !== undefined && + indexTokenAmount > 0 + ) { + values.estimatedLeverage = leverage; + values.indexTokenAmount = indexTokenAmount; + values.sizeDeltaUsd = convertToUsd(indexTokenAmount, indexToken.decimals, values.indexPrice)!; + + const basePriceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, values.sizeDeltaUsd, isLong); + + const positionFeeInfo = getPositionFee( + marketInfo, + values.sizeDeltaUsd, + basePriceImpactDeltaUsd > 0, + userReferralInfo + ); + + values.positionFeeUsd = positionFeeInfo.positionFeeUsd; + values.feeDiscountUsd = positionFeeInfo.discountUsd; + values.uiFeeUsd = applyFactor(values.sizeDeltaUsd, uiFeeFactor); + + const { collateralDeltaUsd, collateralDeltaAmount, baseCollateralAmount } = leverageBySizeValues({ + collateralToken, + leverage, + sizeDeltaUsd: values.sizeDeltaUsd, + collateralPrice: values.collateralPrice, + uiFeeFactor, + positionFeeUsd: values.positionFeeUsd, + borrowingFeeUsd: values.borrowingFeeUsd, + fundingFeeUsd: values.fundingFeeUsd, + uiFeeUsd: values.uiFeeUsd, + swapUiFeeUsd: values.swapUiFeeUsd, + }); + + values.collateralDeltaUsd = collateralDeltaUsd; + values.collateralDeltaAmount = collateralDeltaAmount; + + values.externalSwapQuote = externalSwapQuote; + + const swapAmounts = getSwapAmountsByToValue({ + tokenIn: initialCollateralToken, + tokenOut: collateralToken, + amountOut: baseCollateralAmount, + isLimit: false, + findSwapPath, + uiFeeFactor, + }); + values.swapPathStats = swapAmounts.swapPathStats; + const swapAmountIn = values.externalSwapQuote?.amountIn ?? swapAmounts.amountIn; + + values.initialCollateralAmount = swapAmountIn; + values.initialCollateralUsd = convertToUsd( + values.initialCollateralAmount, + initialCollateralToken.decimals, + values.initialCollateralPrice + )!; + } else if (strategy === "independent") { + if (indexTokenAmount !== undefined && indexTokenAmount > 0) { + values.indexTokenAmount = indexTokenAmount; + values.sizeDeltaUsd = convertToUsd(indexTokenAmount, indexToken.decimals, values.indexPrice)!; + + const basePriceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, values.sizeDeltaUsd, isLong); + + const positionFeeInfo = getPositionFee( + marketInfo, + values.sizeDeltaUsd, + basePriceImpactDeltaUsd > 0, + userReferralInfo + ); + + values.positionFeeUsd = positionFeeInfo.positionFeeUsd; + values.feeDiscountUsd = positionFeeInfo.discountUsd; + values.uiFeeUsd = applyFactor(values.sizeDeltaUsd, uiFeeFactor); + } + + if (initialCollateralAmount !== undefined && initialCollateralAmount > 0) { + values.initialCollateralAmount = initialCollateralAmount; + values.initialCollateralUsd = convertToUsd( + initialCollateralAmount, + initialCollateralToken.decimals, + values.initialCollateralPrice + )!; + + values.externalSwapQuote = externalSwapQuote; + + const swapAmounts = getSwapAmountsByFromValue({ + tokenIn: initialCollateralToken, + tokenOut: collateralToken, + amountIn: initialCollateralAmount, + isLimit: false, + findSwapPath, + uiFeeFactor, + swapOptimizationOrder, + }); + + values.swapPathStats = swapAmounts.swapPathStats; + const swapAmountIn = values.externalSwapQuote?.amountIn ?? swapAmounts.amountIn; + const baseCollateralUsd = convertToUsd(swapAmountIn, collateralToken.decimals, values.collateralPrice)!; + + values.collateralDeltaUsd = + baseCollateralUsd - + values.positionFeeUsd - + values.borrowingFeeUsd - + values.fundingFeeUsd - + values.uiFeeUsd - + values.swapUiFeeUsd; + + values.collateralDeltaAmount = convertToTokenAmount( + values.collateralDeltaUsd, + collateralToken.decimals, + values.collateralPrice + )!; + } + + values.estimatedLeverage = getLeverage({ + sizeInUsd: values.sizeDeltaUsd, + collateralUsd: values.collateralDeltaUsd, + pnl: 0n, + pendingBorrowingFeesUsd: 0n, + pendingFundingFeesUsd: 0n, + }); + } + + const acceptablePriceInfo = getAcceptablePriceInfo({ + marketInfo, + isIncrease: true, + isLong, + indexPrice: values.indexPrice, + sizeDeltaUsd: values.sizeDeltaUsd, + }); + + values.positionPriceImpactDeltaUsd = acceptablePriceInfo.priceImpactDeltaUsd; + values.acceptablePrice = acceptablePriceInfo.acceptablePrice; + values.acceptablePriceDeltaBps = acceptablePriceInfo.acceptablePriceDeltaBps; + + if (isLimit) { + if (limitOrderType === OrderType.StopIncrease) { + if (isLong) { + values.acceptablePrice = maxUint256; + } else { + values.acceptablePrice = 0n; + } + } else { + let maxNegativePriceImpactBps = fixedAcceptablePriceImpactBps; + if (maxNegativePriceImpactBps === undefined) { + maxNegativePriceImpactBps = getDefaultAcceptablePriceImpactBps({ + isIncrease: true, + isLong, + indexPrice: values.indexPrice, + sizeDeltaUsd: values.sizeDeltaUsd, + priceImpactDeltaUsd: values.positionPriceImpactDeltaUsd, + acceptablePriceImapctBuffer: acceptablePriceImpactBuffer, + }); + } + + const limitAcceptablePriceInfo = getAcceptablePriceInfo({ + marketInfo, + isIncrease: true, + isLong, + indexPrice: values.indexPrice, + sizeDeltaUsd: values.sizeDeltaUsd, + maxNegativePriceImpactBps, + }); + + values.acceptablePrice = limitAcceptablePriceInfo.acceptablePrice; + values.acceptablePriceDeltaBps = limitAcceptablePriceInfo.acceptablePriceDeltaBps; + } + } + + let priceImpactAmount = 0n; + + if (values.positionPriceImpactDeltaUsd > 0) { + const price = triggerPrice !== undefined && triggerPrice > 0 ? triggerPrice : indexToken.prices.maxPrice; + priceImpactAmount = convertToTokenAmount(values.positionPriceImpactDeltaUsd, indexToken.decimals, price)!; + } else { + const price = triggerPrice !== undefined && triggerPrice > 0 ? triggerPrice : indexToken.prices.minPrice; + priceImpactAmount = convertToTokenAmount(values.positionPriceImpactDeltaUsd, indexToken.decimals, price)!; + } + + values.sizeDeltaInTokens = convertToTokenAmount(values.sizeDeltaUsd, indexToken.decimals, values.indexPrice)!; + + if (isLong) { + values.sizeDeltaInTokens = values.sizeDeltaInTokens + priceImpactAmount; + } else { + values.sizeDeltaInTokens = values.sizeDeltaInTokens - priceImpactAmount; + } + + return values; +} + +export function getTokensRatio({ + fromToken, + toToken, + triggerRatioValue, + markPrice, +}: { + fromToken: TokenData; + toToken: TokenData; + triggerRatioValue: bigint; + markPrice: bigint; +}) { + const fromTokenPrice = fromToken?.prices.minPrice; + + const markRatio = getTokensRatioByPrice({ + fromToken, + toToken, + fromPrice: fromTokenPrice, + toPrice: markPrice, + }); + + if (triggerRatioValue === undefined) { + return { markRatio }; + } + + const triggerRatio: TokensRatio = { + ratio: triggerRatioValue > 0 ? triggerRatioValue : markRatio.ratio, + largestToken: markRatio.largestToken, + smallestToken: markRatio.smallestToken, + }; + + return { + markRatio, + triggerRatio, + }; +} + +export function leverageBySizeValues({ + collateralToken, + leverage, + sizeDeltaUsd, + collateralPrice, + positionFeeUsd, + borrowingFeeUsd, + uiFeeUsd, + swapUiFeeUsd, + fundingFeeUsd, +}: { + collateralToken: TokenData; + leverage: bigint; + sizeDeltaUsd: bigint; + collateralPrice: bigint; + uiFeeFactor: bigint; + positionFeeUsd: bigint; + fundingFeeUsd: bigint; + borrowingFeeUsd: bigint; + uiFeeUsd: bigint; + swapUiFeeUsd: bigint; +}) { + const collateralDeltaUsd = bigMath.mulDiv(sizeDeltaUsd, BASIS_POINTS_DIVISOR_BIGINT, leverage); + const collateralDeltaAmount = convertToTokenAmount(collateralDeltaUsd, collateralToken.decimals, collateralPrice)!; + + const baseCollateralUsd = + collateralDeltaUsd !== 0n + ? collateralDeltaUsd + positionFeeUsd + borrowingFeeUsd + fundingFeeUsd + uiFeeUsd + swapUiFeeUsd + : 0n; + + const baseCollateralAmount = convertToTokenAmount(baseCollateralUsd, collateralToken.decimals, collateralPrice)!; + + return { + collateralDeltaUsd, + collateralDeltaAmount, + baseCollateralUsd, + baseCollateralAmount, + }; +} + +export function getIncreasePositionPrices({ + triggerPrice, + indexToken, + initialCollateralToken, + collateralToken, + limitOrderType, + isLong, +}: { + triggerPrice?: bigint; + indexToken: TokenData; + initialCollateralToken: TokenData; + collateralToken: TokenData; + isLong: boolean; + limitOrderType?: IncreasePositionAmounts["limitOrderType"]; +}) { + let indexPrice: bigint; + let initialCollateralPrice: bigint; + let triggerThresholdType: TriggerThresholdType | undefined; + let collateralPrice: bigint; + + if (triggerPrice !== undefined && triggerPrice > 0 && limitOrderType !== undefined) { + indexPrice = triggerPrice; + initialCollateralPrice = getIsEquivalentTokens(indexToken, initialCollateralToken) + ? triggerPrice + : initialCollateralToken.prices.minPrice; + + collateralPrice = getIsEquivalentTokens(indexToken, collateralToken) + ? triggerPrice + : collateralToken.prices.minPrice; + + triggerThresholdType = getOrderThresholdType(limitOrderType, isLong); + } else { + indexPrice = getMarkPrice({ prices: indexToken.prices, isIncrease: true, isLong }); + initialCollateralPrice = initialCollateralToken.prices.minPrice; + collateralPrice = collateralToken.prices.minPrice; + } + + return { + indexPrice, + initialCollateralPrice, + collateralPrice, + triggerThresholdType, + triggerPrice, + }; +} diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/index.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/index.ts new file mode 100644 index 0000000..f401b51 --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/index.ts @@ -0,0 +1 @@ +export * from "./trade.js"; diff --git a/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/trade.ts b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/trade.ts new file mode 100644 index 0000000..f6dcedc --- /dev/null +++ b/src/Managing.Web3Proxy/src/generated/gmxsdk/utils/trade/trade.ts @@ -0,0 +1,77 @@ +import { BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT } from "../../configs/factors.js"; +import { DecreasePositionSwapType } from "../../types/orders.js"; +import { + DecreasePositionAmounts, + IncreasePositionAmounts, + SwapAmounts, + TradeFlags, + TradeMode, + TradeType, +} from "../../types/trade.js"; +import { bigMath } from "../bigmath.js"; +import { getShouldUseMaxPrice } from "../prices.js"; + +export function applySlippageToPrice(allowedSlippage: number, price: bigint, isIncrease: boolean, isLong: boolean) { + const shouldIncreasePrice = getShouldUseMaxPrice(isIncrease, isLong); + + const slippageBasisPoints = shouldIncreasePrice + ? BASIS_POINTS_DIVISOR + allowedSlippage + : BASIS_POINTS_DIVISOR - allowedSlippage; + + return bigMath.mulDiv(price, BigInt(slippageBasisPoints), BASIS_POINTS_DIVISOR_BIGINT); +} + +export function applySlippageToMinOut(allowedSlippage: number, minOutputAmount: bigint) { + const slippageBasisPoints = BASIS_POINTS_DIVISOR - allowedSlippage; + + return bigMath.mulDiv(minOutputAmount, BigInt(slippageBasisPoints), BASIS_POINTS_DIVISOR_BIGINT); +} + +export function getSwapCount({ + isSwap, + isIncrease, + increaseAmounts, + decreaseAmounts, + swapAmounts, +}: { + isSwap: boolean; + isIncrease: boolean; + swapAmounts?: SwapAmounts; + increaseAmounts?: IncreasePositionAmounts; + decreaseAmounts?: DecreasePositionAmounts; +}) { + if (isSwap) { + if (!swapAmounts) return undefined; + return swapAmounts.swapPathStats?.swapPath.length ?? 0; + } else if (isIncrease) { + if (!increaseAmounts) return undefined; + return increaseAmounts.swapPathStats?.swapPath.length ?? 0; + } else { + if (decreaseAmounts?.decreaseSwapType === undefined) return undefined; + return decreaseAmounts.decreaseSwapType !== DecreasePositionSwapType.NoSwap ? 1 : 0; + } +} + +export const createTradeFlags = (tradeType: TradeType, tradeMode: TradeMode): TradeFlags => { + const isLong = tradeType === TradeType.Long; + const isShort = tradeType === TradeType.Short; + const isSwap = tradeType === TradeType.Swap; + const isPosition = isLong || isShort; + const isMarket = tradeMode === TradeMode.Market; + const isLimit = tradeMode === TradeMode.Limit || tradeMode === TradeMode.StopMarket; + const isTrigger = tradeMode === TradeMode.Trigger; + const isIncrease = isPosition && (isMarket || isLimit); + + const tradeFlags: TradeFlags = { + isLong, + isShort, + isSwap, + isPosition, + isIncrease, + isMarket, + isLimit, + isTrigger, + }; + + return tradeFlags; +}; diff --git a/src/Managing.Web3Proxy/src/plugins/README.md b/src/Managing.Web3Proxy/src/plugins/README.md new file mode 100644 index 0000000..1c0af33 --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/README.md @@ -0,0 +1,11 @@ +# Plugins Folder + +Plugins define behavior that is common to all the routes in your application. Authentication, caching, templates, and all the other cross cutting concerns should be handled by plugins placed in this folder. + +Files in this folder are typically defined through the [`fastify-plugin`](https://github.com/fastify/fastify-plugin) module, making them non-encapsulated. They can define decorators and set hooks that will then be used in the rest of your application. + +Check out: + +- [The hitchhiker's guide to plugins](https://fastify.dev/docs/latest/Guides/Plugins-Guide/) +- [Fastify decorators](https://fastify.dev/docs/latest/Reference/Decorators/). +- [Fastify lifecycle](https://fastify.dev/docs/latest/Reference/Lifecycle/). diff --git a/src/Managing.Web3Proxy/src/plugins/custom/gmx.ts b/src/Managing.Web3Proxy/src/plugins/custom/gmx.ts new file mode 100644 index 0000000..46cd80e --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/custom/gmx.ts @@ -0,0 +1,832 @@ +import fp from 'fastify-plugin' +import { FastifyReply, FastifyRequest } from 'fastify' +import { z } from 'zod' +import { GmxSdk } from '../../generated/gmxsdk/index.js' + +import { arbitrum } from 'viem/chains'; +import { getTokenBySymbol } from '../../generated/gmxsdk/configs/tokens.js'; +import { Trade, TradeDirection, TradeStatus, TradeType, Position, PositionStatus } from '../../generated/ManagingApiTypes.js'; +import { MarketInfo, MarketsInfoData } from '../../generated/gmxsdk/types/markets.js'; +import { MarketConfig, MARKETS } from '../../generated/gmxsdk/configs/markets.js' +import { ARBITRUM } from '../../generated/gmxsdk/configs/chains.js' +import { TokenData, TokensData } from '../../generated/gmxsdk/types/tokens.js'; +import { getByKey } from '../../generated/gmxsdk/utils/objects.js'; +import { GmxSdkConfig } from '../../generated/gmxsdk/types/sdk.js'; +import { PositionIncreaseParams } from '../../generated/gmxsdk/modules/orders/helpers.js'; +import { numberToBigint, PRECISION_DECIMALS } from '../../generated/gmxsdk/utils/numbers.js'; +import { DecreasePositionSwapType, PositionOrderInfo } from '../../generated/gmxsdk/types/orders.js'; +import { OrderType } from '../../generated/gmxsdk/types/orders.js'; +import { DecreasePositionAmounts } from '../../generated/gmxsdk/types/trade.js'; +import { encodeReferralCode } from '../../generated/gmxsdk/utils/referrals.js'; +import { convertToUsd } from '../../generated/gmxsdk/utils/tokens.js'; +import { toNumber } from 'ethers'; +import { bigintToNumber } from '../../generated/gmxsdk/utils/numbers.js'; +import { formatUsd } from '../../generated/gmxsdk/utils/numbers/formatting.js'; +import { calculateDisplayDecimals } from '../../generated/gmxsdk/utils/numbers/index.js'; + +/** + * GMX Plugin + * + * This plugin adds functionality for interacting with the GMX trading platform, + * including opening positions, checking positions, and more. + * + * Position Opening Process: + * 1. Client sends a request to /open-position with: + * - account: The user's wallet address + * - tradeType: Market or Limit + * - ticker: The token ticker or enum value (as string) + * - direction: Long or Short + * - price: The price limit (optional for market orders) + * - quantity: The quantity to trade + * - leverage: The leverage multiplier (e.g., 2x, 10x) + * + * 2. The server handles the request by: + * - Validating the input parameters + * - Getting market and token data from GMX SDK + * - Creating and executing an increase position order + * - Returning the transaction hash to the client + */ + +declare module 'fastify' { + export interface FastifyRequest { + openGmxPosition: typeof openGmxPosition; + getClientForAddress: typeof getClientForAddress; + cancelGmxOrders: typeof cancelGmxOrders; + closeGmxPosition: typeof closeGmxPosition; + getGmxTrade: typeof getGmxTrade; + getGmxPositions: typeof getGmxPositions; + } +} + +// Schema for open-position request +const openPositionSchema = z.object({ + account: z.string().nonempty(), + tradeType: z.enum(['market', 'limit']), + ticker: z.string().nonempty(), + direction: z.enum(Object.keys(TradeDirection) as [string, ...string[]]), + price: z.number().positive().optional(), + quantity: z.number().positive(), + leverage: z.number().positive() +}); + +// Schema for cancel-orders request +const cancelOrdersSchema = z.object({ + account: z.string().nonempty(), + ticker: z.string().nonempty() +}); + +/** + * Gets a GMX SDK client initialized for the given address + * If a walletId is provided, it will be used with Privy for signing + * @param this The FastifyRequest instance + * @param account The wallet address to use + * @returns An initialized GMX SDK client + */ +export function getClientForAddress( + account: string, +): GmxSdk { + try { + // Create SDK instance + const arbitrumSdkConfig: GmxSdkConfig = { + chainId: arbitrum.id, + account: account, + oracleUrl: "https://arbitrum-api.gmxinfra.io", + rpcUrl: "https://arb1.arbitrum.io/rpc", + subsquidUrl: "https://gmx.squids.live/gmx-synthetics-arbitrum:live/api/graphql", + subgraphUrl: "https://subgraph.satsuma-prod.com/3b2ced13c8d9/gmx/synthetics-arbitrum-stats/api", + }; + + const sdk = new GmxSdk(arbitrumSdkConfig) + + return sdk; + } catch (error) { + console.error(`Error getting GMX client: ${error instanceof Error ? error.message : 'Unknown error'}`); + throw error; + } +} + + +/** + * Implementation function to open a position on GMX + * @param sdk The GMX SDK client + * @param tradeType The type of trade (market or limit) + * @param ticker The ticker symbol of the token + * @param direction The direction of the trade (long or short) + * @param price The price limit (optional for market orders) + * @param quantity The quantity to trade + * @param leverage The leverage multiplier + * @param takeProfitPrice The take profit price (optional for market orders) + * @param stopLossPrice The stop loss price (optional for market orders) + * @returns The transaction hash + */ +export const openGmxPositionImpl = async ( + sdk: GmxSdk, + ticker: string, + direction: TradeDirection, + quantity: number, + leverage: number, + price?: number, + takeProfitPrice?: number, + stopLossPrice?: number +): Promise => { + try { + // Get markets and tokens data from GMX SDK + const { marketsInfoData, tokensData } = await sdk.markets.getMarketsInfo(); + + if (!marketsInfoData || !tokensData) { + throw new Error("No markets or tokens info data"); + } + + console.log('price', price) + + const marketInfo = getMarketInfoFromTicker(ticker, marketsInfoData); + const collateralToken = getTokenDataFromTicker("USDC", tokensData); // Using USDC as collateral + console.log('collateralToken', collateralToken) + + // Calculate the collateral amount in USDC (quantity * price) + const collateralAmount = BigInt(Math.floor((quantity || 0) * (price || 0) * 1e6)); // USDC has 6 decimals + console.log('collateralAmount', collateralAmount); + + // Calculate leverage in basis points (1x = 10000) + const leverageBps = BigInt((leverage || 1) * 10000); + const limitPrice = price ? numberToBigint(price, 30) : undefined; + + const params: PositionIncreaseParams = { + payAmount: collateralAmount, + marketAddress: marketInfo.marketTokenAddress, + payTokenAddress: collateralToken.address, + collateralTokenAddress: collateralToken.address, + allowedSlippageBps: 100, // 1% slippage + leverage: leverageBps, + skipSimulation: true, + limitPrice: limitPrice, + referralCodeForTxn: encodeReferralCode("kaigen_ai"), + stopLossPrice: stopLossPrice ? numberToBigint(stopLossPrice, 30) : undefined, + takeProfitPrice: takeProfitPrice ? numberToBigint(takeProfitPrice, 30) : undefined + }; + + console.log('params', params) + + // Execute the main position order + if (direction === TradeDirection.Long) { + await sdk.orders.long(params); + } else { + await sdk.orders.short(params); + } + + return ""; + } catch (error) { + console.error('Error opening GMX position:', error); + throw new Error(`Failed to open position: ${error instanceof Error ? error.message : 'Unknown error'}`); + } +}; + + +/** + * Opens a position on GMX + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param account The wallet address of the user + * @param tradeType The type of trade (market or limit) + * @param ticker The ticker symbol of the token + * @param direction The direction of the trade (long or short) + * @param price The price limit (optional for market orders) + * @param quantity The quantity to trade + * @param leverage The leverage multiplier + * @param takeProfitPrice The take profit price (optional for market orders) + * @param stopLossPrice The stop loss price (optional for market orders) + * @param walletId The Privy wallet ID (optional, for identification only) + * @returns The response object with success status and transaction hash + */ +export async function openGmxPosition( + this: FastifyRequest, + reply: FastifyReply, + account: string, + tradeType: string, + ticker: string, + direction: TradeDirection, + price?: number, + quantity?: number, + leverage?: number, + takeProfitPrice?: number, + stopLossPrice?: number + ) { + try { + // Validate the request parameters + openPositionSchema.parse({ + account, + tradeType, + ticker, + direction, + price, + quantity, + leverage, + takeProfitPrice, + stopLossPrice + }); + + // Get client for the address + const sdk = await this.getClientForAddress(account); + + // Call the implementation function + const hash = await openGmxPositionImpl( + sdk, + ticker, + direction, + quantity, + leverage, + price, + takeProfitPrice, + stopLossPrice + ); + + return { + success: true, + hash + }; + } catch (error) { + this.log.error(error); + + // Return appropriate error response + reply.status(error instanceof z.ZodError ? 400 : 500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + }; + } + } + +/** + * Implementation function to cancel all GMX orders for a ticker + * @param sdk The GMX SDK client + * @param account The wallet address of the user + * @param ticker The ticker symbol for which to cancel orders + * @returns Whether the cancellation was successful + */ +export const cancelGmxOrdersImpl = async ( + sdk: GmxSdk, + ticker: string +): Promise => { + try { + // Get markets and tokens data first + const { marketsInfoData, tokensData } = await sdk.markets.getMarketsInfo(); + + if (!marketsInfoData || !tokensData) { + throw new Error("No markets or tokens info data"); + } + + // Get active orders for the account with required parameters + const ordersData = await sdk.orders.getOrders({ + account: sdk.account, + marketsInfoData, + tokensData + }); + + console.log('ordersData', ordersData) + + // Extract order keys for the specified ticker + const orderKeys = Object.values(ordersData.ordersInfoData) + .filter(order => { + if ('marketInfo' in order) { + return order.marketInfo.indexToken.symbol.toUpperCase() === ticker.toUpperCase(); + } + return false; + }) + .map(order => order.key); + + if (orderKeys.length === 0) { + return true; // No orders to cancel + } + + console.log('orderKeys', orderKeys) + + // Cancel orders using the batch method + await sdk.orders.cancelOrders(orderKeys); + + return true; + } catch (error) { + console.error('Error canceling GMX orders:', error); + throw new Error(`Failed to cancel orders: ${error instanceof Error ? error.message : 'Unknown error'}`); + } +}; + + +/** + * Cancels all GMX orders for a ticker + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param account The wallet address of the user + * @param ticker The ticker symbol for which to cancel orders + * @param walletId The Privy wallet ID (optional, for identification only) + * @returns The response object with success status + */ +export async function cancelGmxOrders( + this: FastifyRequest, + reply: FastifyReply, + account: string, + ticker: string, +) { + try { + // Validate the request parameters + cancelOrdersSchema.parse({ + account, + ticker + }); + + // Get client for the address + const sdk = await this.getClientForAddress(account); + + // Call the implementation function + const success = await cancelGmxOrdersImpl(sdk, ticker); + + return { + success + }; + } catch (error) { + this.log.error(error); + + // Return appropriate error response + reply.status(error instanceof z.ZodError ? 400 : 500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + }; + } +} + +function getMarketInfoFromTicker(ticker: string, marketsInfoData: MarketsInfoData): MarketInfo { + const token = getTokenBySymbol(arbitrum.id, ticker); + const marketInfo = getMarketByIndexToken(token.address); + const marketInfoData = marketsInfoData[marketInfo.marketTokenAddress]; + if (!marketInfo) { + throw new Error(`Market info not found for ticker: ${ticker}`); + } + return marketInfoData; +} + +export function getTokenDataFromTicker(ticker: string, tokensData: TokensData): TokenData { + const token = getTokenBySymbol(arbitrum.id, ticker); + return getByKey(tokensData, token.address); +} + +/** + * Gets a market configuration based on the index token address + * @param indexTokenAddress The address of the index token + * @returns The market configuration if found, undefined otherwise + */ +export function getMarketByIndexToken(indexTokenAddress: string): MarketConfig | undefined { + // Convert the input address to lowercase for case-insensitive comparison + const normalizedIndexToken = indexTokenAddress.toLowerCase() + + // Get the markets for Arbitrum chain + const arbitrumMarkets = MARKETS[ARBITRUM] + + // Find the market where the indexTokenAddress matches + const marketKey = Object.keys(arbitrumMarkets).find(key => { + const market = arbitrumMarkets[key] + return market.indexTokenAddress.toLowerCase() === normalizedIndexToken + }) + + return marketKey ? arbitrumMarkets[marketKey] : undefined +} + +/** + * Implementation function to close a position on GMX + * @param sdk The GMX SDK client + * @param ticker The ticker symbol of the token + * @param direction The direction of the trade (long or short) + * @returns The transaction hash + */ +export const closeGmxPositionImpl = async ( + sdk: GmxSdk, + ticker: string, + direction: TradeDirection +): Promise => { + try { + // Get markets and tokens data from GMX SDK + const { marketsInfoData, tokensData } = await sdk.markets.getMarketsInfo(); + + if (!marketsInfoData || !tokensData) { + throw new Error("No markets or tokens info data"); + } + + const marketInfo = getMarketInfoFromTicker(ticker, marketsInfoData); + + // Get the user's position + const positionsInfo = await sdk.positions.getPositionsInfo({ + marketsInfoData, + tokensData, + showPnlInLeverage: true + }); + + console.log('positionsInfo', positionsInfo) + console.log('direction', direction) + // Find the specific position to close + const positionKey = Object.keys(positionsInfo).find(key => { + const position = positionsInfo[key]; + return position.marketInfo.indexToken.symbol === ticker && position.isLong === (direction === TradeDirection.Short); + }); + + if (!positionKey) { + throw new Error(`No open ${direction} position found for ${ticker}`); + } + + const position = positionsInfo[positionKey]; + + const decreaseAmounts: DecreasePositionAmounts ={ + isFullClose: true, + sizeDeltaUsd: position.sizeInUsd, + sizeDeltaInTokens: position.sizeInTokens, + collateralDeltaUsd: position.remainingCollateralAmount, + collateralDeltaAmount: position.remainingCollateralAmount, + acceptablePriceDeltaBps: 0n, + recommendedAcceptablePriceDeltaBps: 0n, + estimatedPnl: 0n, + estimatedPnlPercentage: 0n, + realizedPnl: 0n, + realizedPnlPercentage: 0n, + positionFeeUsd: 0n, + uiFeeUsd: 0n, + swapUiFeeUsd: 0n, + feeDiscountUsd: 0n, + borrowingFeeUsd: 0n, + fundingFeeUsd: 0n, + swapProfitFeeUsd: 0n, + positionPriceImpactDeltaUsd: 0n, + priceImpactDiffUsd: 0n, + payedRemainingCollateralAmount: 0n, + payedOutputUsd: 0n, + payedRemainingCollateralUsd: 0n, + receiveTokenAmount: 0n, + receiveUsd: 0n, + decreaseSwapType: DecreasePositionSwapType.NoSwap, + indexPrice: 0n, + collateralPrice: 0n, + acceptablePrice: position.markPrice, + triggerOrderType: OrderType.LimitDecrease, + triggerPrice: position.markPrice, + } + + //console.log('params', params) + + const params2 = { + marketInfo, + marketsInfoData, + tokensData, + isLong: direction === TradeDirection.Short, + allowedSlippage: 0, + decreaseAmounts, + collateralToken: position.marketInfo.shortToken, + referralCodeForTxn: encodeReferralCode("kaigen_ai"), + } + + // Execute the close position order + await sdk.orders.createDecreaseOrder(params2); + + return "hash"; + } catch (error) { + console.error('Error closing GMX position:', error); + throw new Error(`Failed to close position: ${error instanceof Error ? error.message : 'Unknown error'}`); + } +}; + +/** + * Closes a position on GMX + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param account The wallet address of the user + * @param ticker The ticker symbol of the token + * @param direction The direction of the trade (long or short) + * @returns The response object with success status and transaction hash + */ +export async function closeGmxPosition( + this: FastifyRequest, + reply: FastifyReply, + account: string, + ticker: string, + direction: TradeDirection +) { + try { + // Get client for the address + const sdk = await this.getClientForAddress(account); + + // Call the implementation function + const hash = await closeGmxPositionImpl( + sdk, + ticker, + direction + ); + + return { + success: true, + hash + }; + } catch (error) { + this.log.error(error); + + // Return appropriate error response + reply.status(500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + }; + } +} + +/** + * Implementation function to get trades on GMX + * @param sdk The GMX SDK client + * @param ticker The ticker symbol of the token + * @returns Array of trades + */ +export const getGmxTradeImpl = async ( + sdk: GmxSdk, + ticker: string +): Promise => { + + const { marketsInfoData, tokensData } = await sdk.markets.getMarketsInfo(); + + const orders = await sdk.orders.getOrders({ + account: sdk.account, + marketsInfoData, + tokensData + }); + + + // Filter orders for the specific ticker and transform them to trades + const trades = Object.values(orders.ordersInfoData) + .filter(order => { + // Ensure marketInfo exists before accessing its properties + return 'marketInfo' in order && order.marketInfo.indexToken.symbol.toUpperCase() === ticker.toUpperCase(); + }) + .map(order => { + const positionOrder = order as PositionOrderInfo; + + const priceDecimals = calculateDisplayDecimals( + positionOrder.indexToken.prices?.minPrice, + undefined, + positionOrder.indexToken.visualMultiplier + ); + + // Default values for potentially undefined fields + const triggerPrice = order.contractTriggerPrice ?? 0n; + const sizeDelta = order.sizeDeltaUsd ?? 0n; + const initialCollateral = order.initialCollateralDeltaAmount ?? 0n; + + + // Calculate leverage directly from the division of bigint values + // and convert to standard leverage number (like 2 for 2x) + let leverage = 2; // Default to 2x leverage + + if (initialCollateral !== 0n) { + // Convert values to regular numbers but preserve precision + const size = Number(sizeDelta) / 1e30; // Convert from PRECISION_DECIMALS + const collateral = Number(initialCollateral) / 1e6; // USDC has 6 decimals + + if (collateral > 0) { + leverage = Math.round(size / collateral); + console.log('Calculated leverage:', leverage, 'from size:', size, 'collateral:', collateral); + } + } + + // Price should be converted to the proper format (e.g. 0.0008631855060000001 to 8631855) + const displayPrice = formatUsd(positionOrder.triggerPrice, { + displayDecimals: priceDecimals, + visualMultiplier: positionOrder.indexToken?.visualMultiplier, + }); + + // Remove currency symbol and convert to number + const numericPrice = Number(displayPrice.replace(/[^0-9.]/g, '')); + + // Calculate size in tokens instead of USD based on the collateral and the trigger price + const sizeInTokens = Number(sizeDelta) / Number(triggerPrice); + + // Apply proper scaling for token amount + // This converts from the large bigint value to the actual token amount + const scaledTokenSize = sizeInTokens * 1e-30; + + return { + id: order.key, + ticker: ticker, + direction: order.isLong ? TradeDirection.Short : TradeDirection.Long, + price: numericPrice, // Numeric price without currency symbol + quantity: scaledTokenSize, // Properly scaled size in tokens + leverage: leverage, // Fixed leverage value + status: TradeStatus.PendingOpen, // Assuming these are pending orders + tradeType: order.orderType == OrderType.LimitIncrease ? TradeType.Limit : TradeType.Market, + date: new Date(Number(order.updatedAtTime) * 1000), + exchangeOrderId: order.key + } as Trade; + }); + + return trades; +} + +/** + * Gets trades on GMX + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param account The wallet address of the user + * @param ticker The ticker symbol of the token + * @returns The response object with success status and trades array + */ +export async function getGmxTrade( + this: FastifyRequest, + reply: FastifyReply, + account: string, + ticker: string +) { + try { + // Get client for the address + const sdk = await this.getClientForAddress(account); + + // Call the implementation function + const trades = await getGmxTradeImpl(sdk, ticker); + + return { + success: true, + trades + }; + } catch (error) { + this.log.error(error); + + // Return appropriate error response + reply.status(500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + }; + } +} + +/** + * Implementation function to get positions on GMX + * @param sdk The GMX SDK client + * @returns Array of positions + */ +export const getGmxPositionsImpl = async ( + sdk: GmxSdk +): Promise => { + const { marketsInfoData, tokensData } = await sdk.markets.getMarketsInfo(); + + const positionsInfo = await sdk.positions.getPositionsInfo({ + marketsInfoData, + tokensData, + showPnlInLeverage: true, + }); + + const positions = Object.values(positionsInfo).map(async (pos) => { + // Fix leverage calculation to avoid exponential notation issues + let leverage = 2; // Default to 2x leverage + + if (pos.collateralAmount > 0n) { + // Manual calculation of leverage from raw values + // For positions, we already have the leverage value from GMX, but we want to ensure it's properly formatted + if (pos.sizeInUsd > 0n && pos.collateralAmount > 0n) { + // Use a simplified approach to calculate leverage directly + leverage = Math.round(Number(pos.sizeInUsd) / Number(pos.collateralAmount)); + } + } + + const collateralDecimals = pos.isLong ? pos.marketInfo.shortToken.decimals : pos.marketInfo.longToken.decimals; + + const ticker = pos.marketInfo.indexToken.symbol; + // get SL and TP from the position + const trades = await getGmxTradeImpl(sdk, ticker); + + // Calculate proper price display decimals + const priceDecimals = calculateDisplayDecimals( + pos.indexToken.prices?.minPrice, + undefined, + pos.indexToken.visualMultiplier + ); + + // Format prices using the same helper as trades for consistency + const displayEntryPrice = formatUsd(pos.entryPrice, { + displayDecimals: priceDecimals, + visualMultiplier: pos.indexToken?.visualMultiplier, + }); + + const displayMarkPrice = formatUsd(pos.markPrice, { + displayDecimals: priceDecimals, + visualMultiplier: pos.indexToken?.visualMultiplier, + }); + + let displayLiquidationPrice = undefined; + if (pos.liquidationPrice) { + displayLiquidationPrice = formatUsd(pos.liquidationPrice, { + displayDecimals: priceDecimals, + visualMultiplier: pos.indexToken?.visualMultiplier, + }); + } + + // Remove currency symbols and convert to numbers + const numericEntryPrice = Number(displayEntryPrice.replace(/[^0-9.]/g, '')); + const numericMarkPrice = Number(displayMarkPrice.replace(/[^0-9.]/g, '')); + let numericLiquidationPrice = undefined; + if (displayLiquidationPrice) { + numericLiquidationPrice = Number(displayLiquidationPrice.replace(/[^0-9.]/g, '')); + } + + // Make sure we scale the token quantity properly + const tokenSize = bigintToNumber(pos.sizeInTokens, pos.marketInfo.indexToken.decimals); + + let stopLoss: Trade | undefined; + let takeProfit: Trade | undefined; + + if (pos.isLong) { + stopLoss = trades.find(t => t.price < numericEntryPrice); + takeProfit = trades.find(t => t.price > numericEntryPrice); + } else { + stopLoss = trades.find(t => t.price > numericEntryPrice); + takeProfit = trades.find(t => t.price < numericEntryPrice); + } + + let position = { + id: pos.key, + ticker: ticker, + direction: pos.isLong ? TradeDirection.Long : TradeDirection.Short, + price: numericEntryPrice, // Numeric entry price without currency symbol + quantity: tokenSize, // Position Size in tokens with correct decimals + leverage: leverage, // Fixed leverage value + status: PositionStatus.Filled, // Represents an open/active position + tradeType: TradeType.Market, // Placeholder + date: new Date(Number(pos.increasedAtTime) * 1000), // Position open time + exchangeOrderId: pos.key, // Position key + pnl: bigintToNumber(pos.pnlAfterFees, PRECISION_DECIMALS), // PnL after fees (USD), assuming 30 decimals + collateral: bigintToNumber(pos.collateralAmount, collateralDecimals), // Collateral (in Collateral Token units) + markPrice: numericMarkPrice, // Numeric mark price without currency symbol + liquidationPrice: numericLiquidationPrice, // Numeric liquidation price without currency symbol + } as unknown as Position; // Use unknown assertion due to missing fields in target Position type + + if (stopLoss) { + position.stopLoss = stopLoss; + } + + if (takeProfit) { + position.takeProfit1 = takeProfit; + } + + // build the open trade base on the current position object + const open = { + direction: pos.isLong ? TradeDirection.Long : TradeDirection.Short, + price: numericEntryPrice, + quantity: tokenSize, + leverage: leverage, + status: TradeStatus.PendingOpen, + } as Trade; + + position.open = open; + + return position; + }); + + + return Promise.all(positions); +}; + +/** + * Gets positions on GMX + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param account The wallet address of the user + * @returns The response object with success status and positions array + */ +export async function getGmxPositions( + this: FastifyRequest, + reply: FastifyReply, + account: string +) { + try { + const sdk = await this.getClientForAddress(account); + const positions = await getGmxPositionsImpl(sdk); + return { + success: true, + positions, + }; + } catch (error) { + this.log.error(error); + reply.status(500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred', + }; + } +} + +/** + * The use of fastify-plugin is required to be able + * to export the decorators to the outer scope + * + * @see {@link https://github.com/fastify/fastify-plugin} + */ +export default fp(async (fastify) => { + fastify.decorateRequest('openGmxPosition', openGmxPosition) + fastify.decorateRequest('cancelGmxOrders', cancelGmxOrders) + fastify.decorateRequest('getClientForAddress', getClientForAddress) + fastify.decorateRequest('getTokenDataFromTicker', getTokenDataFromTicker) + fastify.decorateRequest('closeGmxPosition', closeGmxPosition) + fastify.decorateRequest('getGmxTrade', getGmxTrade) + fastify.decorateRequest('getGmxPositions', getGmxPositions) + }) + diff --git a/src/Managing.Web3Proxy/src/plugins/custom/privy.ts b/src/Managing.Web3Proxy/src/plugins/custom/privy.ts new file mode 100644 index 0000000..586c448 --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/custom/privy.ts @@ -0,0 +1,677 @@ +import fp from 'fastify-plugin' +import {FastifyReply, FastifyRequest, FastifyInstance} from 'fastify' +import {z} from 'zod' +import canonicalize from 'canonicalize' +import crypto from 'crypto' +import {PrivyClient} from '@privy-io/server-auth' +import {ethers} from 'ethers' +import dotenv from 'dotenv' + +// Load environment variables +dotenv.config() + +import Token from '../../generated/gmxsdk/abis/Token.json' with { type: 'json' } +import { ARBITRUM } from '../../generated/gmxsdk/configs/chains.js' +import { TOKENS } from '../../generated/gmxsdk/configs/tokens.js' +import { CONTRACTS } from '../../generated/gmxsdk/configs/contracts.js' +import { getClientForAddress, getTokenDataFromTicker } from './gmx.js' +import { Ticker } from '../../generated/ManagingApiTypes.js' +import { Address } from 'viem' + +/** + * Privy Plugin + * + * This plugin adds functionality for interacting with the Privy API, + * including signing messages and token approvals. + * + * Token Approval Process: + * 1. Client sends a request to /approve-token with: + * - walletId: The user's wallet ID + * - address: The user's wallet address + * - ticker: The token ticker or enum value (as string) + * - amount: The amount to approve (optional, defaults to max amount) + * - chainId: The chain ID where the approval will take place + * + * 2. The server handles the request by: + * - Validating the input parameters + * - Getting the token data based on the ticker + * - Creating and sending an ERC20 approval transaction using ethers.js and Privy + * - Returning the transaction hash to the client + */ + + +declare module 'fastify' { + export interface FastifyRequest { + signPrivyMessage: typeof signPrivyMessage; + approveToken: typeof approveToken; + initAddress: typeof initAddress; + } +} + +/** + * Returns an initialized PrivyClient instance with configuration from environment variables + * @returns The configured PrivyClient instance + */ +export const getPrivyClient = (fastify?: FastifyInstance): PrivyClient => { + const appId = fastify?.config?.PRIVY_APP_ID || process.env.PRIVY_APP_ID; + const appSecret = fastify?.config?.PRIVY_APP_SECRET || process.env.PRIVY_APP_SECRET; + const authKey = fastify?.config?.PRIVY_AUTHORIZATION_KEY || process.env.PRIVY_AUTHORIZATION_KEY; + + if (!appId || !appSecret || !authKey) { + console.error('Missing Privy environment variables:'); + console.error('PRIVY_APP_ID:', appId ? 'present' : 'missing'); + console.error('PRIVY_APP_SECRET:', appSecret ? 'present' : 'missing'); + console.error('PRIVY_AUTHORIZATION_KEY:', authKey ? 'present' : 'missing'); + throw new Error('Missing required Privy environment variables'); + } + + return new PrivyClient( + appId, + appSecret, + { + walletApi: { + authorizationPrivateKey: authKey + } + } + ); +}; + +/** + * Authentication function for Privy API calls + * @param url The URL for the API endpoint + * @param body The request body + * @returns The authorization signature + */ +export function getAuthorizationSignature({url, body}: {url: string; body: object}) { + const payload = { + version: 1, + method: 'POST', + url, + body, + headers: { + 'privy-app-id': process.env.PRIVY_APP_ID + } + }; + + // JSON-canonicalize the payload and convert it to a buffer + // @ts-ignore - canonicalize is a callable function despite TypeScript error + const serializedPayload = canonicalize(payload) as string; + const serializedPayloadBuffer = Buffer.from(serializedPayload); + + // Get the authorization key from environment variables + const privateKeyAsString = (process.env.PRIVY_AUTHORIZATION_KEY ?? "").replace('wallet-auth:', ''); + + // Convert private key to PEM format and create a key object + const privateKeyAsPem = `-----BEGIN PRIVATE KEY-----\n${privateKeyAsString}\n-----END PRIVATE KEY-----`; + const privateKey = crypto.createPrivateKey({ + key: privateKeyAsPem, + format: 'pem', + }); + + // Sign the payload buffer with the private key + const signatureBuffer = crypto.sign('sha256', serializedPayloadBuffer, privateKey); + const signature = signatureBuffer.toString('base64'); + return signature; +} + +/** + * Makes a request to the Privy API with proper authentication and headers. + * @param url - The full URL for the API endpoint. + * @param body - The request body. + * @param requiresAuth - Whether the request requires authentication. + * @returns The response data. + */ +export const makePrivyRequest = async (url: string, body: object, requiresAuth = true): Promise => { + try { + let headers: Record = { + 'Content-Type': 'application/json', + 'privy-app-id': process.env.PRIVY_APP_ID ?? "", + }; + + if (requiresAuth) { + // Generate authorization signature + const authSig = await getAuthorizationSignature({ + url, + body + }); + + // Create authentication string for basic auth + const basicAuthString = `${process.env.PRIVY_APP_ID}:${process.env.PRIVY_APP_SECRET}`; + const base64Auth = Buffer.from(basicAuthString).toString('base64'); + + headers = { + ...headers, + 'privy-authorization-signature': authSig, + 'Authorization': `Basic ${base64Auth}` + }; + } + + const request = { + method: 'POST', + headers, + body: JSON.stringify(body) + }; + + // Make the API request + const response = await fetch(url, request).then(res => { + return res; + }).catch(err => { + console.log("error", err); + throw err; + }); + + if (!response.ok) { + throw new Error(`Privy API request failed: ${response.status}`); + } + + return await response.json() as T; + } catch (error) { + console.error('Error making Privy API request:', error); + throw new Error('Failed to make Privy API request'); + } +}; + +// Schema for sign-message request +const signMessageSchema = z.object({ + walletId: z.string().nonempty(), + message: z.string().nonempty(), + address: z.string().nonempty() +}); + +// Schema for token-approval request +const tokenApprovalSchema = z.object({ + walletId: z.string().nonempty(), + address: z.string().nonempty(), + ticker: z.string().nonempty(), + amount: z.bigint().positive().optional(), + chainId: z.number().positive().optional() +}); + +/** + * Gets the chain name based on chain ID + * @param chainId The chain ID + * @returns The CAIP-2 identifier for the chain + */ +export const getChainName = (chainId: number): string => { + switch (chainId) { + case 1: + return 'eip155:1'; // Ethereum Mainnet + case 42161: + return 'eip155:42161'; // Arbitrum One + case 421613: + return 'eip155:421613'; // Arbitrum Goerli + case 8453: + return 'eip155:8453'; // Base + case 84531: + return 'eip155:84531'; // Base Goerli + default: + return `eip155:${chainId}`; + } +}; + +/** + * Signs a message using a Privy embedded wallet. + * @param walletId - The ID of the wallet to use for signing. + * @param message - The message to sign. + * @param address - The wallet address to use for signing. + * @returns The signature for the message. + */ +export const signMessage = async (walletId: string, message: string, address: string): Promise => { + try { + const privy = getPrivyClient(); + + const {signature} = await privy.walletApi.ethereum.signMessage({ + address: address, + chainType: 'ethereum', + message: message, + }); + + return signature; + } catch (error) { + console.error('Error signing message:', error); + throw new Error('Failed to sign message with embedded wallet'); + } +}; + +/** + * Approves a token for spending using Privy wallet (implementation) + * @param walletId The wallet ID to use + * @param walletAddress The wallet address + * @param ticker The token ticker or enum value + * @param amount The amount to approve (optional, defaults to max amount) + * @param chainId The chain ID + * @param spenderAddress The address that will be allowed to spend the tokens + * @returns The transaction hash + */ +export const approveTokenImpl = async ( + walletAddress: string, + ticker: string, + chainId?: number, + amount?: bigint, +): Promise => { + try { + + // Get token data from ticker + const tokenData = GetToken(ticker); + + // Create contract interface for ERC20 token + const contractInterface = new ethers.Interface(Token.abi); + + // Max uint256 value for unlimited approval + const approveAmount = amount ? + ethers.parseUnits(amount.toString(), tokenData.decimals) : + ethers.MaxUint256; + + // Encode the approve function call + const data = contractInterface.encodeFunctionData("approve", [walletAddress, approveAmount]); + + chainId = chainId ?? ARBITRUM; + + // Get chain name in CAIP-2 format + const networkName = getChainName(chainId); + const privy = getPrivyClient(); + + // Send the transaction + const { hash } = await privy.walletApi.ethereum.sendTransaction({ + address: walletAddress as Address, + chainType: 'ethereum', + caip2: networkName as string, + transaction: { + to: tokenData.address as Address, + data: data, + chainId: chainId, + }, + } as any); + + return hash; + } catch (error) { + console.error('Error approving token:', error); + throw new Error(`Failed to approve token: ${error instanceof Error ? error.message : 'Unknown error'}`); + } +}; + +function GetToken(symbol: string) { + return TOKENS[ARBITRUM].find(token => token.symbol === symbol) +} + +/** + * Approves a token for spending using Privy wallet + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param address The wallet address + * @param ticker The token ticker or enum value + * @param chainId The chain ID + * @param amount The amount to approve (optional, defaults to max amount) + * @returns The response object with success status and transaction hash + */ +export async function approveToken( + this: FastifyRequest, + reply: FastifyReply, + address: string, + ticker: string, + chainId: number, + amount?: bigint +) { + try { + // Validate the request parameters + tokenApprovalSchema.parse({ + address, + ticker, + amount, + chainId + }); + + if (!address) { + throw new Error('Wallet address is required for token approval'); + } + + if (!chainId) { + throw new Error('Chain ID is required for token approval'); + } + + // Call the approveTokenImpl function + const hash = await approveTokenImpl(address, ticker, chainId, amount); + + return { + success: true, + hash: hash + }; + } catch (error) { + this.log.error(error); + + // Return appropriate error response + reply.status(error instanceof z.ZodError ? 400 : 500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + }; + } +} + +/** + * Signs a message using Privy embedded wallet + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param walletId The wallet ID + * @param message The message to sign + * @param address The wallet address + * @returns The signature of the signed message + */ +export async function signPrivyMessage( + this: FastifyRequest, + reply: FastifyReply, + walletId: string, + message: string, + address: string +) { + try { + // Validate the request parameters + signMessageSchema.parse({ walletId, message, address }); + + // Call the signMessage function + const signature = await signMessage(walletId, message, address); + + return { + success: true, + signature: signature + }; + } catch (error) { + this.log.error(error); + + // Return appropriate error response + reply.status(error instanceof z.ZodError ? 400 : 500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + }; + } +} + +/** + * Approves a specific contract address for spending using Privy wallet + * @param walletAddress The wallet address + * @param tokenAddress The token address to approve + * @param spenderAddress The contract address to approve + * @param chainId The chain ID + * @param amount The amount to approve (optional, defaults to max amount) + * @returns The transaction hash + */ +export const approveContractImpl = async ( + walletAddress: string, + tokenAddress: string, + spenderAddress: string, + chainId?: number, + amount?: bigint, +): Promise => { + try { + // Create contract interface for ERC20 token + const contractInterface = new ethers.Interface(Token.abi); + + // Max uint256 value for unlimited approval + const approveAmount = amount ?? ethers.MaxUint256; + + // Encode the approve function call + const data = contractInterface.encodeFunctionData("approve", [spenderAddress, approveAmount]); + + chainId = chainId ?? ARBITRUM; + + // Get chain name in CAIP-2 format + const networkName = getChainName(chainId); + const privy = getPrivyClient(); + + // Send the transaction + const { hash } = await privy.walletApi.ethereum.sendTransaction({ + address: walletAddress as Address, + chainType: 'ethereum', + caip2: networkName as string, + transaction: { + to: tokenAddress as Address, + data: data, + chainId: chainId, + }, + } as any); + + return hash; + } catch (error) { + console.error('Error approving contract:', error); + throw new Error(`Failed to approve contract: ${error instanceof Error ? error.message : 'Unknown error'}`); + } +}; + +/** + * Gets the current allowance for a token for the GMX OrderVault contract + * @param ownerAddress The address of the token owner + * @param tokenAddress The address of the token contract + * @returns The current allowance as a BigNumber + */ +export const getTokenAllowance = async ( + ownerAddress: string, + tokenAddress: string, + spenderAddress: string +): Promise => { + try { + // use gmx sdk to get allowance + const sdk = await getClientForAddress(ownerAddress); + const allowance = await sdk.executeMulticall({ + token: { + contractAddress: tokenAddress, + abiId: "ERC20", + calls: { + allowance: { + methodName: "allowance", + params: [ownerAddress, spenderAddress] + } + } + } + }). + then(res => { + return res.data.token.allowance.returnValues[0]; + }); + + return allowance; + } catch (error) { + console.error('Error getting token allowance:', error); + throw new Error(`Failed to get token allowance: ${error instanceof Error ? error.message : 'Unknown error'}`); + } +}; + +/** + * Initializes a wallet address by approving USDC for GMX trading and GMX OrderVault + * @param address The wallet address to initialize + * @returns The transaction hashes for both approvals + */ +export const initAddressImpl = async ( + address: string, +): Promise<{ usdcHash: string, orderVaultHash: string, exchangeRouterHash: string }> => { + try { + const sdk = await getClientForAddress(address); + + const {tokensData} = await sdk.tokens.getTokensData(); + const usdcTokenData = getTokenDataFromTicker(Ticker.USDC, tokensData); + const wrapperEtherData = getTokenDataFromTicker("WETH", tokensData); + let approveAmount = usdcTokenData.prices.maxPrice; // Large enough amount for trading + + // Check approval for USDC + const usdcToken = GetToken('USDC'); + const usdcAllowance = await getTokenAllowance(address, usdcToken.address, address); + + let usdcHash = ""; + if (usdcAllowance < approveAmount) { + // First approve USDC token for GMX trading + const usdcToken = GetToken('USDC'); + usdcHash = await approveTokenImpl( + address, + usdcToken.symbol, + ARBITRUM, + usdcTokenData.prices.maxPrice + ); + }else{ + usdcHash = "Already allowed :" + usdcAllowance; + } + + const orderVaultAllowance = await getTokenAllowance(address, usdcToken.address, CONTRACTS[ARBITRUM].OrderVault); + + // Then approve GMX OrderVault with the correct amount + let orderVaultHash = ""; + if (orderVaultAllowance < approveAmount) { + orderVaultHash = await approveContractImpl( + address, + usdcToken.address, + CONTRACTS[ARBITRUM].OrderVault, + ARBITRUM, + approveAmount + ); + }else{ + orderVaultHash = "Already allowed :" + orderVaultAllowance; + } + + const wrapperEtherAllowance = await getTokenAllowance(address, wrapperEtherData.address, CONTRACTS[ARBITRUM].OrderVault); + + let wrapperEtherHash = ""; + if (wrapperEtherAllowance < approveAmount) { + wrapperEtherHash = await approveContractImpl( + address, + wrapperEtherData.address, + CONTRACTS[ARBITRUM].OrderVault, + ARBITRUM, + approveAmount + ); + }else{ + wrapperEtherHash = "Already allowed :" + wrapperEtherAllowance; + } + + console.log('wrapperEtherAllowance', wrapperEtherAllowance) + + const exchangeRouterAllowance = await getTokenAllowance(address, usdcToken.address, CONTRACTS[ARBITRUM].ExchangeRouter); + + console.log('exchangeRouterAllowance', exchangeRouterAllowance) + + let exchangeRouterHash = ""; + if (exchangeRouterAllowance < approveAmount) { + exchangeRouterHash = await approveContractImpl( + address, + usdcToken.address, + CONTRACTS[ARBITRUM].ExchangeRouter, + ARBITRUM, + approveAmount + ); + }else{ + exchangeRouterHash = "Already allowed :" + exchangeRouterAllowance; + } + + const wrapperEtherExchangeAllowance = await getTokenAllowance(address, wrapperEtherData.address, CONTRACTS[ARBITRUM].ExchangeRouter); + + let wrapperEtherExchangeHash = ""; + if (wrapperEtherExchangeAllowance < approveAmount) { + wrapperEtherExchangeHash = await approveContractImpl( + address, + wrapperEtherData.address, + CONTRACTS[ARBITRUM].ExchangeRouter, + ARBITRUM, + approveAmount + ); + }else{ + wrapperEtherExchangeHash = "Already allowed :" + wrapperEtherExchangeAllowance; + } + + console.log('wrapperEtherExchangeAllowance', wrapperEtherExchangeAllowance) + + const usdcSyntheticRouterAllowance = await getTokenAllowance(address, usdcToken.address, CONTRACTS[ARBITRUM].SyntheticsRouter); + + let usdcSyntheticRouterHash = ""; + if (usdcSyntheticRouterAllowance < approveAmount) { + usdcSyntheticRouterHash = await approveContractImpl( + address, + usdcToken.address, + CONTRACTS[ARBITRUM].SyntheticsRouter, + ARBITRUM, + approveAmount + ); + }else{ + usdcSyntheticRouterHash = "Already allowed :" + usdcSyntheticRouterAllowance; + } + + console.log('usdcSyntheticRouterAllowance', usdcSyntheticRouterAllowance) + + console.log('usdcHash', usdcHash) + console.log('orderVaultHash', orderVaultHash) + console.log('exchangeRouterHash', exchangeRouterHash) + + return { + usdcHash, + orderVaultHash, + exchangeRouterHash + }; + } catch (error) { + console.error('Error initializing address:', error); + throw new Error(`Failed to initialize address: ${error instanceof Error ? error.message : 'Unknown error'}`); + } +}; + +/** + * Initializes a wallet address for GMX trading + * @param this The FastifyRequest instance + * @param reply The FastifyReply instance + * @param address The wallet address to initialize + * @returns The response object with success status and transaction hashes + */ +export async function initAddress( + this: FastifyRequest, + reply: FastifyReply, + address: string +) { + try { + if (!address) { + throw new Error('Wallet address is required for initialization'); + } + + const { usdcHash, orderVaultHash } = await initAddressImpl(address); + + return { + success: true, + usdcHash, + orderVaultHash + }; + } catch (error) { + this.log.error(error); + + reply.status(500); + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + }; + } +} + +/** + * The use of fastify-plugin is required to be able + * to export the decorators to the outer scope + * + * @see {@link https://github.com/fastify/fastify-plugin} + */ +export default fp(async (fastify) => { + // Decorate request with methods that use the Fastify instance + fastify.decorateRequest('signPrivyMessage', async function(this: FastifyRequest, reply: FastifyReply, walletId: string, message: string, address: string) { + return signPrivyMessage.call(this, reply, walletId, message, address); + }); + + fastify.decorateRequest('approveToken', async function(this: FastifyRequest, reply: FastifyReply, address: string, ticker: string, chainId: number, amount?: bigint) { + return approveToken.call(this, reply, address, ticker, chainId, amount); + }); + + fastify.decorateRequest('initAddress', async function(this: FastifyRequest, reply: FastifyReply, address: string) { + return initAddress.call(this, reply, address); + }); + + // Test the Privy client initialization + try { + const testClient = getPrivyClient(fastify); + fastify.log.info('Privy client initialized successfully'); + } catch (error) { + fastify.log.error('Failed to initialize Privy client:', error); + throw error; + } +}, { + name: 'privy-plugin' +}); + diff --git a/src/Managing.Web3Proxy/src/plugins/custom/swagger.ts b/src/Managing.Web3Proxy/src/plugins/custom/swagger.ts new file mode 100644 index 0000000..3a56961 --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/custom/swagger.ts @@ -0,0 +1,30 @@ +import fp from 'fastify-plugin' +import fastifySwaggerUi from '@fastify/swagger-ui' +import fastifySwagger from '@fastify/swagger' + +export default fp(async function (fastify) { + /** + * A Fastify plugin for serving Swagger (OpenAPI v2) or OpenAPI v3 schemas + * + * @see {@link https://github.com/fastify/fastify-swagger} + */ + await fastify.register(fastifySwagger, { + hideUntagged: true, + openapi: { + info: { + title: 'Fastify demo API', + description: 'The official Fastify demo API', + version: '0.0.0' + } + } + }) + + /** + * A Fastify plugin for serving Swagger UI. + * + * @see {@link https://github.com/fastify/fastify-swagger-ui} + */ + await fastify.register(fastifySwaggerUi, { + routePrefix: '/api/docs' + }) +}) diff --git a/src/Managing.Web3Proxy/src/plugins/external/cors.ts b/src/Managing.Web3Proxy/src/plugins/external/cors.ts new file mode 100644 index 0000000..7eaaa6b --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/cors.ts @@ -0,0 +1,12 @@ +import cors, { FastifyCorsOptions } from '@fastify/cors' + +export const autoConfig: FastifyCorsOptions = { + methods: ['GET', 'POST', 'PUT', 'DELETE'] +} + +/** + * This plugins enables the use of CORS. + * + * @see {@link https://github.com/fastify/fastify-cors} + */ +export default cors diff --git a/src/Managing.Web3Proxy/src/plugins/external/env.ts b/src/Managing.Web3Proxy/src/plugins/external/env.ts new file mode 100644 index 0000000..3650349 --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/env.ts @@ -0,0 +1,99 @@ +import fp from 'fastify-plugin' +import fastifyEnv from '@fastify/env' + +declare module 'fastify' { + export interface FastifyInstance { + config: { + PORT: number; + COOKIE_SECRET: string; + COOKIE_NAME: string; + COOKIE_SECURED: boolean; + RATE_LIMIT_MAX: number; + PRIVY_APP_ID: string; + PRIVY_APP_SECRET: string; + PRIVY_AUTHORIZATION_KEY: string; + }; + } +} + +const schema = { + type: 'object', + required: [ + 'PORT', + ], + properties: { + PORT: { + type: 'number', + default: 4111 + }, + COOKIE_SECRET: { + type: 'string' + }, + COOKIE_NAME: { + type: 'string' + }, + COOKIE_SECURED: { + type: 'boolean', + default: true + }, + RATE_LIMIT_MAX: { + type: 'number', + default: 100 + } + } +} + +export const autoConfig = { + // Decorate Fastify instance with `config` key + // Optional, default: 'config' + confKey: 'config', + + // Schema to validate + schema, + + // Needed to read .env in root folder + dotenv: true, + // or, pass config options available on dotenv module + // dotenv: { + // path: `${import.meta.dirname}/.env`, + // debug: true + // } + + // Source for the configuration data + // Optional, default: process.env + data: process.env +} + +/** + * This plugins helps to check environment variables. + * + * @see {@link https://github.com/fastify/fastify-env} + */ +export default fp(async (fastify) => { + const schema = { + type: 'object', + required: ['PRIVY_APP_ID', 'PRIVY_APP_SECRET', 'PRIVY_AUTHORIZATION_KEY'], + properties: { + PRIVY_APP_ID: { + type: 'string' + }, + PRIVY_APP_SECRET: { + type: 'string' + }, + PRIVY_AUTHORIZATION_KEY: { + type: 'string' + } + } + } + + const options = { + confKey: 'config', + schema: schema, + dotenv: true, + data: process.env + } + + await fastify.register(fastifyEnv, options) +}, { + name: 'env-config' +}) diff --git a/src/Managing.Web3Proxy/src/plugins/external/helmet.ts b/src/Managing.Web3Proxy/src/plugins/external/helmet.ts new file mode 100644 index 0000000..77d6112 --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/helmet.ts @@ -0,0 +1,12 @@ +import helmet from '@fastify/helmet' + +export const autoConfig = { + // Set plugin options here +} + +/** + * This plugins sets the basic security headers. + * + * @see {@link https://github.com/fastify/fastify-helmet} + */ +export default helmet diff --git a/src/Managing.Web3Proxy/src/plugins/external/multipart.ts b/src/Managing.Web3Proxy/src/plugins/external/multipart.ts new file mode 100644 index 0000000..10dd03a --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/multipart.ts @@ -0,0 +1,19 @@ +import fastifyMultipart from '@fastify/multipart' + +export const autoConfig = { + limits: { + fieldNameSize: 100, // Max field name size in bytes + fieldSize: 100, // Max field value size in bytes + fields: 10, // Max number of non-file fields + fileSize: 1 * 1024 * 1024, // Max file size in bytes (5 MB) + files: 1, // Max number of file fields + parts: 1000 // Max number of parts + } +} + +/** + * This plugins allows to parse the multipart content-type + * + * @see {@link https://github.com/fastify/fastify-multipart} + */ +export default fastifyMultipart diff --git a/src/Managing.Web3Proxy/src/plugins/external/rate-limit.ts b/src/Managing.Web3Proxy/src/plugins/external/rate-limit.ts new file mode 100644 index 0000000..a5f77fb --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/rate-limit.ts @@ -0,0 +1,14 @@ +import rateLimit from '@fastify/rate-limit' + +export const autoConfig = { + max: 3, + timeWindow: '1 minute', + allowList: ['127.0.0.1'] +} + +/** + * This plugin adds rate limiting to protect against brute force attacks + * + * @see {@link https://github.com/fastify/fastify-rate-limit} + */ +export default rateLimit \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/plugins/external/sensible.ts b/src/Managing.Web3Proxy/src/plugins/external/sensible.ts new file mode 100644 index 0000000..213e09d --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/sensible.ts @@ -0,0 +1,12 @@ +import sensible from '@fastify/sensible' + +export const autoConfig = { + // Set plugin options here +} + +/** + * This plugin adds some utilities to handle http errors + * + * @see {@link https://github.com/fastify/fastify-sensible} + */ +export default sensible diff --git a/src/Managing.Web3Proxy/src/plugins/external/session.ts b/src/Managing.Web3Proxy/src/plugins/external/session.ts new file mode 100644 index 0000000..d435ed0 --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/session.ts @@ -0,0 +1,30 @@ +import fastifySession from '@fastify/session' +import fp from 'fastify-plugin' +import { Auth } from '../../schemas/auth.js' +import fastifyCookie from '@fastify/cookie' + +declare module 'fastify' { + interface Session { + user: Auth + } +} + +/** + * This plugins enables the use of session. + * + * @see {@link https://github.com/fastify/session} + */ +export default fp(async (fastify) => { + fastify.register(fastifyCookie) + fastify.register(fastifySession, { + secret: fastify.config.COOKIE_SECRET, + cookieName: fastify.config.COOKIE_NAME, + cookie: { + secure: fastify.config.COOKIE_SECURED, + httpOnly: true, + maxAge: 1800000 + } + }) +}, { + name: 'session' +}) diff --git a/src/Managing.Web3Proxy/src/plugins/external/swagger.ts b/src/Managing.Web3Proxy/src/plugins/external/swagger.ts new file mode 100644 index 0000000..3a56961 --- /dev/null +++ b/src/Managing.Web3Proxy/src/plugins/external/swagger.ts @@ -0,0 +1,30 @@ +import fp from 'fastify-plugin' +import fastifySwaggerUi from '@fastify/swagger-ui' +import fastifySwagger from '@fastify/swagger' + +export default fp(async function (fastify) { + /** + * A Fastify plugin for serving Swagger (OpenAPI v2) or OpenAPI v3 schemas + * + * @see {@link https://github.com/fastify/fastify-swagger} + */ + await fastify.register(fastifySwagger, { + hideUntagged: true, + openapi: { + info: { + title: 'Fastify demo API', + description: 'The official Fastify demo API', + version: '0.0.0' + } + } + }) + + /** + * A Fastify plugin for serving Swagger UI. + * + * @see {@link https://github.com/fastify/fastify-swagger-ui} + */ + await fastify.register(fastifySwaggerUi, { + routePrefix: '/api/docs' + }) +}) diff --git a/src/Managing.Web3Proxy/src/routes/README.md b/src/Managing.Web3Proxy/src/routes/README.md new file mode 100644 index 0000000..0d4c681 --- /dev/null +++ b/src/Managing.Web3Proxy/src/routes/README.md @@ -0,0 +1,30 @@ +# Routes Folder + +Routes define the pathways within your application. +Fastify's structure supports the modular monolith approach, where your +application is organized into distinct, self-contained modules. +This facilitates easier scaling and future transition to a microservice architecture. +Each module can evolve independently, and in the future, you might want to deploy +some of these modules separately. + +In this folder you should define all the routes that define the endpoints +of your web application. +Each service is a [Fastify +plugin](https://fastify.dev/docs/latest/Reference/Plugins/), it is +encapsulated (it can have its own independent plugins) and it is +typically stored in a file; be careful to group your routes logically, +e.g. all `/users` routes in a `users.js` file. We have added +a `root.js` file for you with a '/' root added. + +If a single file become too large, create a folder and add a `index.js` file there: +this file must be a Fastify plugin, and it will be loaded automatically +by the application. You can now add as many files as you want inside that folder. +In this way you can create complex routes within a single monolith, +and eventually extract them. + +If you need to share functionality between routes, place that +functionality into the `plugins` folder, and share it via +[decorators](https://fastify.dev/docs/latest/Reference/Decorators/). + +If you're a bit confused about using `async/await` to write routes, you would +better take a look at [Promise resolution](https://fastify.dev/docs/latest/Reference/Routes/#promise-resolution) for more details. diff --git a/src/Managing.Web3Proxy/src/routes/api/autohooks.ts b/src/Managing.Web3Proxy/src/routes/api/autohooks.ts new file mode 100644 index 0000000..6b072af --- /dev/null +++ b/src/Managing.Web3Proxy/src/routes/api/autohooks.ts @@ -0,0 +1,9 @@ +import { FastifyInstance } from 'fastify' + +export default async function (fastify: FastifyInstance) { + fastify.addHook('onRequest', async (request, reply) => { + if (request.url.startsWith('/api/auth/login')) { + return + } + }) +} diff --git a/src/Managing.Web3Proxy/src/routes/api/gmx/index.ts b/src/Managing.Web3Proxy/src/routes/api/gmx/index.ts new file mode 100644 index 0000000..5463b6b --- /dev/null +++ b/src/Managing.Web3Proxy/src/routes/api/gmx/index.ts @@ -0,0 +1,205 @@ +import {FastifyPluginAsyncTypebox} from '@fastify/type-provider-typebox' +import {Type} from '@sinclair/typebox' +import { TradeDirection } from '../../../generated/ManagingApiTypes' + +const plugin: FastifyPluginAsyncTypebox = async (fastify) => { + // Define route to open a position + fastify.post('/open-position', { + schema: { + body: Type.Object({ + account: Type.String(), + tradeType: Type.String(), + ticker: Type.String(), + direction: Type.String(), + price: Type.Optional(Type.Number()), + quantity: Type.Number(), + leverage: Type.Number(), + stopLossPrice: Type.Optional(Type.Number()), + takeProfitPrice: Type.Optional(Type.Number()) + }), + response: { + 200: Type.Object({ + success: Type.Boolean(), + hash: Type.Optional(Type.String()), + error: Type.Optional(Type.String()) + }) + } + } + }, async (request, reply) => { + const { account, tradeType, ticker, direction, price, quantity, leverage, stopLossPrice, takeProfitPrice } = request.body + + try { + // Call the openPosition method from the GMX plugin + const result = await request.openGmxPosition( + reply, + account, + tradeType, + ticker, + direction as TradeDirection, + price, + quantity, + leverage, + stopLossPrice, + takeProfitPrice + ) + + return result + } catch (error) { + fastify.log.error(error) + reply.status(500) + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + } + } + }) + + // Define route to cancel orders + fastify.post('/cancel-orders', { + schema: { + body: Type.Object({ + account: Type.String(), + ticker: Type.String() + }), + response: { + 200: Type.Object({ + success: Type.Boolean(), + error: Type.Optional(Type.String()) + }) + } + } + }, async (request, reply) => { + const { account, ticker } = request.body + + try { + // Call the cancelGmxOrders method from the GMX plugin + const result = await request.cancelGmxOrders( + reply, + account, + ticker, + ) + + return result + } catch (error) { + fastify.log.error(error) + reply.status(500) + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + } + } + }) + + // Define route to close a position + fastify.post('/close-position', { + schema: { + body: Type.Object({ + account: Type.String(), + ticker: Type.String(), + direction: Type.String() + }), + response: { + 200: Type.Object({ + success: Type.Boolean(), + hash: Type.Optional(Type.String()), + error: Type.Optional(Type.String()) + }) + } + } + }, async (request, reply) => { + const { account, ticker, direction } = request.body + + try { + // Call the closePosition method from the GMX plugin + const result = await request.closeGmxPosition( + reply, + account, + ticker, + direction as TradeDirection + ); + + return result; + } catch (error) { + fastify.log.error(error) + reply.status(500) + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + } + } + }) + + // Define route to get a trade + fastify.get('/trade', { + schema: { + querystring: Type.Object({ + account: Type.String(), + ticker: Type.String() + }), + response: { + 200: Type.Object({ + success: Type.Boolean(), + trades: Type.Optional(Type.Array(Type.Any())), + error: Type.Optional(Type.String()) + }) + } + } + }, async (request, reply) => { + const { account, ticker } = request.query + + try { + // Call the getGmxTrade method from the GMX plugin + const result = await request.getGmxTrade( + reply, + account, + ticker + ) + + return result + } catch (error) { + fastify.log.error(error) + reply.status(500) + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + } + } + }) + + // Define route to get positions + fastify.get('/positions', { + schema: { + querystring: Type.Object({ + account: Type.String() + }), + response: { + 200: Type.Object({ + success: Type.Boolean(), + positions: Type.Optional(Type.Array(Type.Any())), // Using Type.Any() for now + error: Type.Optional(Type.String()) + }) + } + } + }, async (request, reply) => { + const { account } = request.query + + try { + // Call the getGmxPositions method from the GMX plugin + const result = await request.getGmxPositions( + reply, + account + ) + + return result + } catch (error) { + fastify.log.error(error) + reply.status(500) + return { + success: false, + error: error instanceof Error ? error.message : 'An unknown error occurred' + } + } + }) +} + +export default plugin \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/routes/api/index.ts b/src/Managing.Web3Proxy/src/routes/api/index.ts new file mode 100644 index 0000000..30a81ec --- /dev/null +++ b/src/Managing.Web3Proxy/src/routes/api/index.ts @@ -0,0 +1,10 @@ +import { FastifyInstance } from 'fastify' + +export default async function (fastify: FastifyInstance) { + fastify.get('/', ({ protocol, hostname }) => { + return { + message: + `Hello ! See documentation at ${protocol}://${hostname}/documentation` + } + }) +} diff --git a/src/Managing.Web3Proxy/src/routes/api/privy/index.ts b/src/Managing.Web3Proxy/src/routes/api/privy/index.ts new file mode 100644 index 0000000..e18ac5f --- /dev/null +++ b/src/Managing.Web3Proxy/src/routes/api/privy/index.ts @@ -0,0 +1,71 @@ +import {FastifyPluginAsyncTypebox, Type} from '@fastify/type-provider-typebox' + +const plugin: FastifyPluginAsyncTypebox = async (fastify) => { + fastify.post( + '/sign-message', + { + schema: { + body: Type.Object({ + walletId: Type.String(), + message: Type.String(), + address: Type.String() + }), + response: { + 200: Type.Object({ + success: Type.Boolean(), + signature: Type.Optional(Type.String()), + error: Type.Optional(Type.String()) + }), + 400: Type.Object({ + success: Type.Boolean(), + error: Type.String() + }), + 500: Type.Object({ + success: Type.Boolean(), + error: Type.String() + }) + }, + tags: ['Privy'] + } + }, + async function (request, reply) { + const { walletId, message, address } = request.body; + return request.signPrivyMessage(reply, walletId, message, address); + } + ) + + fastify.post( + '/init-address', + { + schema: { + body: Type.Object({ + address: Type.String() + }), + response: { + 200: Type.Object({ + success: Type.Boolean(), + usdcHash: Type.Optional(Type.String()), + orderVaultHash: Type.Optional(Type.String()), + exchangeRouterHash: Type.Optional(Type.String()), + error: Type.Optional(Type.String()) + }), + 400: Type.Object({ + success: Type.Boolean(), + error: Type.String() + }), + 500: Type.Object({ + success: Type.Boolean(), + error: Type.String() + }) + }, + tags: ['Privy'] + } + }, + async function (request, reply) { + const { address } = request.body; + return request.initAddress(reply, address); + } + ) +} + +export default plugin \ No newline at end of file diff --git a/src/Managing.Web3Proxy/src/routes/home.ts b/src/Managing.Web3Proxy/src/routes/home.ts new file mode 100644 index 0000000..50710ec --- /dev/null +++ b/src/Managing.Web3Proxy/src/routes/home.ts @@ -0,0 +1,21 @@ +import {FastifyPluginAsyncTypebox, Type} from '@fastify/type-provider-typebox' + +const plugin: FastifyPluginAsyncTypebox = async (fastify) => { + fastify.get( + '/', + { + schema: { + response: { + 200: Type.Object({ + message: Type.String() + }) + } + } + }, + async function () { + return { message: 'Welcome to the official Web3 Proxy API!' } + } + ) +} + +export default plugin diff --git a/src/Managing.Web3Proxy/src/schemas/auth.ts b/src/Managing.Web3Proxy/src/schemas/auth.ts new file mode 100644 index 0000000..9f9ca5e --- /dev/null +++ b/src/Managing.Web3Proxy/src/schemas/auth.ts @@ -0,0 +1,16 @@ +import { Static, Type } from '@sinclair/typebox' +import { EmailSchema, StringSchema } from './common.js' + +export const CredentialsSchema = Type.Object({ + email: EmailSchema, + password: StringSchema +}) + +export interface Credentials extends Static {} + +export interface Auth { + id: number; + username: string; + email: string, + roles: string[] +} diff --git a/src/Managing.Web3Proxy/src/schemas/common.ts b/src/Managing.Web3Proxy/src/schemas/common.ts new file mode 100644 index 0000000..2a46d35 --- /dev/null +++ b/src/Managing.Web3Proxy/src/schemas/common.ts @@ -0,0 +1,16 @@ +import { Type } from '@sinclair/typebox' + +export const StringSchema = Type.String({ + minLength: 1, + maxLength: 255 +}) + +export const EmailSchema = Type.String({ + format: 'email', + minLength: 1, + maxLength: 255 +}) + +export const DateTimeSchema = Type.String({ format: 'date-time' }) + +export const IdSchema = Type.Integer({ minimum: 1 }) diff --git a/src/Managing.Web3Proxy/src/schemas/tasks.ts b/src/Managing.Web3Proxy/src/schemas/tasks.ts new file mode 100644 index 0000000..ca414f7 --- /dev/null +++ b/src/Managing.Web3Proxy/src/schemas/tasks.ts @@ -0,0 +1,63 @@ +import { Static, Type } from '@sinclair/typebox' +import { DateTimeSchema, IdSchema, StringSchema } from './common.js' + +export const TaskStatusEnum = { + New: 'new', + InProgress: 'in-progress', + OnHold: 'on-hold', + Completed: 'completed', + Canceled: 'canceled', + Archived: 'archived' +} as const + +export type TaskStatusType = typeof TaskStatusEnum[keyof typeof TaskStatusEnum] + +export interface Task extends Static { + filename?: string | null +} + +const TaskStatusSchema = Type.Union([ + Type.Literal('new'), + Type.Literal('in-progress'), + Type.Literal('on-hold'), + Type.Literal('completed'), + Type.Literal('canceled'), + Type.Literal('archived') +]) + +export const TaskSchema = Type.Object({ + id: IdSchema, + name: StringSchema, + author_id: IdSchema, + assigned_user_id: Type.Optional(IdSchema), + status: TaskStatusSchema, + created_at: DateTimeSchema, + updated_at: DateTimeSchema +}) + +export const CreateTaskSchema = Type.Object({ + name: StringSchema, + assigned_user_id: Type.Optional(IdSchema) +}) + +export const UpdateTaskSchema = Type.Object({ + name: Type.Optional(StringSchema), + assigned_user_id: Type.Optional(IdSchema) +}) + +export const QueryTaskPaginationSchema = Type.Object({ + page: Type.Integer({ minimum: 1, default: 1 }), + limit: Type.Integer({ minimum: 1, maximum: 100, default: 10 }), + author_id: Type.Optional(IdSchema), + assigned_user_id: Type.Optional(IdSchema), + status: Type.Optional(TaskStatusSchema), + order: Type.Optional(Type.Union([ + Type.Literal('asc'), + Type.Literal('desc') + ], { default: 'desc' })) +}) + +export const TaskPaginationResultSchema = Type.Object({ + total: Type.Integer({ minimum: 0, default: 0 }), + tasks: Type.Array(TaskSchema) +}) diff --git a/src/Managing.Web3Proxy/src/schemas/users.ts b/src/Managing.Web3Proxy/src/schemas/users.ts new file mode 100644 index 0000000..fc25112 --- /dev/null +++ b/src/Managing.Web3Proxy/src/schemas/users.ts @@ -0,0 +1,13 @@ +import { Type } from '@sinclair/typebox' + +const passwordPattern = '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).*$' + +const PasswordSchema = Type.String({ + pattern: passwordPattern, + minLength: 8 +}) + +export const UpdateCredentialsSchema = Type.Object({ + currentPassword: PasswordSchema, + newPassword: PasswordSchema +}) diff --git a/src/Managing.Web3Proxy/src/server.ts b/src/Managing.Web3Proxy/src/server.ts new file mode 100644 index 0000000..1046115 --- /dev/null +++ b/src/Managing.Web3Proxy/src/server.ts @@ -0,0 +1,77 @@ +/** + * This file is here only to show you how to proceed if you would + * like to run your application as a standalone executable. + * + * You can launch it with the command `npm run standalone` + */ + +import Fastify from 'fastify' +import fp from 'fastify-plugin' + +// Import library to exit fastify process, gracefully (if possible) +import closeWithGrace from 'close-with-grace' + +// Import your application as a normal plugin. +import serviceApp from './app.js' + +/** + * Do not use NODE_ENV to determine what logger (or any env related feature) to use + * @see {@link https://www.youtube.com/watch?v=HMM7GJC5E2o} + */ +function getLoggerOptions () { + // Only if the program is running in an interactive terminal + if (process.stdout.isTTY) { + return { + level: 'info', + transport: { + target: 'pino-pretty', + options: { + translateTime: 'HH:MM:ss Z', + ignore: 'pid,hostname' + } + } + } + } + + return { level: process.env.LOG_LEVEL ?? 'silent' } +} + +const app = Fastify({ + logger: getLoggerOptions(), + ajv: { + customOptions: { + coerceTypes: 'array', // change type of data to match type keyword + removeAdditional: 'all' // Remove additional body properties + } + } +}) + +async function init () { + // Register your application as a normal plugin. + // fp must be used to override default error handler + app.register(fp(serviceApp)) + + // Delay is the number of milliseconds for the graceful close to finish + closeWithGrace( + { delay: process.env.FASTIFY_CLOSE_GRACE_DELAY ?? 500 }, + async ({ err }) => { + if (err != null) { + app.log.error(err) + } + + await app.close() + } + ) + + await app.ready() + + try { + // Start listening. + await app.listen({ port: 4111 }) + } catch (err) { + app.log.error(err) + process.exit(1) + } +} + +init() diff --git a/src/Managing.Web3Proxy/test/app/cors.test.ts b/src/Managing.Web3Proxy/test/app/cors.test.ts new file mode 100644 index 0000000..024f7cd --- /dev/null +++ b/src/Managing.Web3Proxy/test/app/cors.test.ts @@ -0,0 +1,20 @@ +import { it } from 'node:test' +import { build } from '../helper.js' +import assert from 'node:assert' + +it('should correctly handle CORS preflight requests', async (t) => { + const app = await build(t) + + const res = await app.inject({ + method: 'OPTIONS', + url: '/', + headers: { + Origin: 'http://example.com', + 'Access-Control-Request-Method': 'GET', + 'Access-Control-Request-Headers': 'Content-Type' + } + }) + + assert.strictEqual(res.statusCode, 204) + assert.strictEqual(res.headers['access-control-allow-methods'], 'GET, POST, PUT, DELETE') +}) diff --git a/src/Managing.Web3Proxy/test/app/env.test.ts b/src/Managing.Web3Proxy/test/app/env.test.ts new file mode 100644 index 0000000..7da83a5 --- /dev/null +++ b/src/Managing.Web3Proxy/test/app/env.test.ts @@ -0,0 +1,29 @@ +import { it } from 'node:test' +import Fastify from 'fastify' +import assert from 'node:assert' +import Env, { autoConfig } from '../../src/plugins/external/env.js' + +it('UPLOAD_DIRNAME should not contain ..', async (t) => { + const { confKey, schema: { type, properties: { UPLOAD_DIRNAME } } } = autoConfig + + const failPath = ['/../', '../', '/..'] + for (let i = 0; i < failPath.length; i++) { + const fastify = Fastify() + await assert.rejects(async () => { + await fastify.register(Env, { confKey, dotenv: false, data: {}, schema: { type, properties: { UPLOAD_DIRNAME: { ...UPLOAD_DIRNAME, default: failPath[i] } } } }) + }, { message: `env/UPLOAD_DIRNAME must match pattern "${UPLOAD_DIRNAME.pattern}"` }).finally(async () => { + await fastify.close() + }) + } +}) + +it('UPLOAD_DIRNAME.default should be a valid dirname', async (t) => { + const { confKey, schema: { type, properties: { UPLOAD_DIRNAME } } } = autoConfig + + const fastify = Fastify() + await assert.doesNotReject(async () => { + await fastify.register(Env, { confKey, dotenv: false, data: {}, schema: { type, properties: { UPLOAD_DIRNAME: { ...UPLOAD_DIRNAME, default: UPLOAD_DIRNAME.default } } } }) + }).finally(async () => { + await fastify.close() + }) +}) diff --git a/src/Managing.Web3Proxy/test/app/error-handler.test.ts b/src/Managing.Web3Proxy/test/app/error-handler.test.ts new file mode 100644 index 0000000..76113d8 --- /dev/null +++ b/src/Managing.Web3Proxy/test/app/error-handler.test.ts @@ -0,0 +1,27 @@ +import { it } from 'node:test' +import assert from 'node:assert' +import fastify from 'fastify' +import serviceApp from '../../src/app.js' +import fp from 'fastify-plugin' + +it('should call errorHandler', async (t) => { + const app = fastify() + await app.register(fp(serviceApp)) + + app.get('/error', () => { + throw new Error('Kaboom!') + }) + + await app.ready() + + t.after(() => app.close()) + + const res = await app.inject({ + method: 'GET', + url: '/error' + }) + + assert.deepStrictEqual(JSON.parse(res.payload), { + message: 'Internal Server Error' + }) +}) diff --git a/src/Managing.Web3Proxy/test/app/not-found-handler.test.ts b/src/Managing.Web3Proxy/test/app/not-found-handler.test.ts new file mode 100644 index 0000000..2805583 --- /dev/null +++ b/src/Managing.Web3Proxy/test/app/not-found-handler.test.ts @@ -0,0 +1,35 @@ +import { it } from 'node:test' +import assert from 'node:assert' +import { build } from '../helper.js' + +it('should call notFoundHandler', async (t) => { + const app = await build(t) + + const res = await app.inject({ + method: 'GET', + url: '/this-route-does-not-exist' + }) + + assert.strictEqual(res.statusCode, 404) + assert.deepStrictEqual(JSON.parse(res.payload), { message: 'Not Found' }) +}) + +it('should be rate limited', async (t) => { + const app = await build(t) + + for (let i = 0; i < 3; i++) { + const res = await app.inject({ + method: 'GET', + url: '/this-route-does-not-exist' + }) + + assert.strictEqual(res.statusCode, 404, `Iteration ${i}`) + } + + const res = await app.inject({ + method: 'GET', + url: '/this-route-does-not-exist' + }) + + assert.strictEqual(res.statusCode, 429, 'Expected 429') +}) diff --git a/src/Managing.Web3Proxy/test/app/rate-limit.test.ts b/src/Managing.Web3Proxy/test/app/rate-limit.test.ts new file mode 100644 index 0000000..fd5fc41 --- /dev/null +++ b/src/Managing.Web3Proxy/test/app/rate-limit.test.ts @@ -0,0 +1,23 @@ +import { it } from 'node:test' +import { build } from '../helper.js' +import assert from 'node:assert' + +it('should be rate limited', async (t) => { + const app = await build(t) + + for (let i = 0; i < 4; i++) { + const res = await app.inject({ + method: 'GET', + url: '/' + }) + + assert.strictEqual(res.statusCode, 200) + } + + const res = await app.inject({ + method: 'GET', + url: '/' + }) + + assert.strictEqual(res.statusCode, 429) +}) diff --git a/src/Managing.Web3Proxy/test/helper.ts b/src/Managing.Web3Proxy/test/helper.ts new file mode 100644 index 0000000..ee89fe7 --- /dev/null +++ b/src/Managing.Web3Proxy/test/helper.ts @@ -0,0 +1,93 @@ +import { FastifyInstance, InjectOptions, LightMyRequestResponse } from 'fastify' +import { build as buildApplication } from 'fastify-cli/helper.js' +import path from 'node:path' +import { TestContext } from 'node:test' +import { options as serverOptions } from '../src/app.js' +import assert from 'node:assert' + +declare module 'fastify' { + interface FastifyInstance { + login: typeof login; + injectWithLogin: typeof injectWithLogin; + } +} + +const AppPath = path.join(import.meta.dirname, '../src/app.ts') + +// Fill in this config with all the configurations +// needed for testing the application +export function config () { + return { + skipOverride: true // Register our application with fastify-plugin + } +} + +export function expectValidationError (res: LightMyRequestResponse, expectedMessage: string) { + assert.strictEqual(res.statusCode, 400) + const { message } = JSON.parse(res.payload) + assert.strictEqual(message, expectedMessage) +} + +async function login (this: FastifyInstance, email: string) { + const res = await this.inject({ + method: 'POST', + url: '/api/auth/login', + payload: { + email, + password: 'Password123$' + } + }) + + const cookie = res.cookies.find( + (c) => c.name === this.config.COOKIE_NAME + ) + + if (!cookie) { + throw new Error('Failed to retrieve session cookie.') + } + + return cookie.value +} + +async function injectWithLogin ( + this: FastifyInstance, + email: string, + opts: InjectOptions +) { + const cookieValue = await this.login(email) + + opts.cookies = { + ...opts.cookies, + [this.config.COOKIE_NAME]: cookieValue + } + + return this.inject({ + ...opts + }) +} + +// automatically build and tear down our instance +export async function build (t?: TestContext) { + // you can set all the options supported by the fastify CLI command + const argv = [AppPath] + + // fastify-plugin ensures that all decorators + // are exposed for testing purposes, this is + // different from the production setup + const app = (await buildApplication( + argv, + config(), + serverOptions + )) as FastifyInstance + + // This is after start, so we can't decorate the instance using `.decorate` + app.login = login + app.injectWithLogin = injectWithLogin + + // If we pass the test contest, it will close the app after we are done + if (t) { + t.after(() => app.close()) + } + + return app +} diff --git a/src/Managing.Web3Proxy/test/plugins/close-orders.test.ts b/src/Managing.Web3Proxy/test/plugins/close-orders.test.ts new file mode 100644 index 0000000..76c0444 --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/close-orders.test.ts @@ -0,0 +1,17 @@ +import { test } from 'node:test' +import assert from 'node:assert' +import { getClientForAddress, cancelGmxOrdersImpl } from '../../src/plugins/custom/gmx' +import { Ticker } from '../../src/generated/ManagingApiTypes' + +test('GMX Orders Closing', async (t) => { + await t.test('should close all orders for BTC', async () => { + const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78') + + const result = await cancelGmxOrdersImpl( + sdk, + Ticker.BTC + ) + console.log('Orders closing result:', result) + assert.ok(result, 'Orders closing result should be defined') + }) +}) diff --git a/src/Managing.Web3Proxy/test/plugins/close-position.test.ts b/src/Managing.Web3Proxy/test/plugins/close-position.test.ts new file mode 100644 index 0000000..36a879d --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/close-position.test.ts @@ -0,0 +1,18 @@ +import { test } from 'node:test' +import assert from 'node:assert' +import { getClientForAddress, closeGmxPositionImpl } from '../../src/plugins/custom/gmx' +import { TradeDirection } from '../../src/generated/ManagingApiTypes' + +test('GMX Position Closing', async (t) => { + await t.test('should close a long position for BTC', async () => { + const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78') + + const result = await closeGmxPositionImpl( + sdk, + 'BTC', + TradeDirection.Long + ) + console.log('Position closing result:', result) + assert.ok(result, 'Position closing result should be defined') + }) +}) diff --git a/src/Managing.Web3Proxy/test/plugins/get-positions.test.ts b/src/Managing.Web3Proxy/test/plugins/get-positions.test.ts new file mode 100644 index 0000000..695c668 --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/get-positions.test.ts @@ -0,0 +1,15 @@ +import { test } from 'node:test' +import assert from 'node:assert' +import { getClientForAddress, getGmxPositionsImpl } from '../../src/plugins/custom/gmx' + +test('GMX get positions', async (t) => { + await t.test('should get positions', async () => { + const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78') + + const result = await getGmxPositionsImpl( + sdk + ) + console.log('Positions result:', result) + assert.ok(result, 'Positions result should be defined') + }) +}) diff --git a/src/Managing.Web3Proxy/test/plugins/get-trade.test.ts b/src/Managing.Web3Proxy/test/plugins/get-trade.test.ts new file mode 100644 index 0000000..179f588 --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/get-trade.test.ts @@ -0,0 +1,17 @@ +import { test } from 'node:test' +import assert from 'node:assert' +import { getClientForAddress, getGmxTradeImpl } from '../../src/plugins/custom/gmx' +import { Ticker } from '../../src/generated/ManagingApiTypes' + +test('GMX get trade', async (t) => { + await t.test('should get trade for BTC', async () => { + const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78') + + const result = await getGmxTradeImpl( + sdk, + Ticker.BTC + ) + console.log('Orders result:', result) + assert.ok(result, 'Orders closing result should be defined') + }) +}) diff --git a/src/Managing.Web3Proxy/test/plugins/open-position.test.ts b/src/Managing.Web3Proxy/test/plugins/open-position.test.ts new file mode 100644 index 0000000..b067ca8 --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/open-position.test.ts @@ -0,0 +1,24 @@ +import { test } from 'node:test' +import assert from 'node:assert' +import { getClientForAddress, openGmxPositionImpl } from '../../src/plugins/custom/gmx' +import { Ticker, TradeDirection } from '../../src/generated/ManagingApiTypes' + +test('GMX Position Opening', async (t) => { + await t.test('should open a long position for BTC', async () => { + const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78') + + const result = await openGmxPositionImpl( + sdk, + Ticker.BTC, + TradeDirection.Long, + 0.0002, + 2, + 50003, + 96001, + 35002 + ) + console.log('Position opening result:', result) + assert.ok(result, 'Position opening result should be defined') + }) +}) + diff --git a/src/Managing.Web3Proxy/test/plugins/privy.test.ts b/src/Managing.Web3Proxy/test/plugins/privy.test.ts new file mode 100644 index 0000000..c2565f7 --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/privy.test.ts @@ -0,0 +1,49 @@ +import Fastify from 'fastify' +import privyPlugin, {getAuthorizationSignature} from '../../src/plugins/custom/privy.js' +import assert from 'node:assert' +import test from 'node:test' + +// Set environment variables needed for the test +process.env.PRIVY_APP_ID = 'cm4db8x9t000ccn87pctvcg9j' +process.env.PRIVY_APP_SECRET = 'test-secret' +process.env.PRIVY_AUTHORIZATION_KEY = 'wallet-auth:MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqOBE+hZld+PCaj051uOl0XpEwe3tKBC5tsYsKdnPymGhRANCAAQ2HyYUbLRcfj9obpViwjYU/S7FdNUehkcfjYdd+R2gH/1q0ZJx7mOF1zpiEbbBNRLuXzP0NPN6nonkI8umzLXZ' + +test('getAuthorizationSignature generates valid signatures', async () => { + const url = 'https://api.privy.io/v1/wallets' + const body = { chain_type: 'ethereum' } + + const signature = getAuthorizationSignature({ url, body }) + + // Basic validation - check if it's a non-empty string that looks like a base64 value + assert.ok(signature && typeof signature === 'string', 'Signature should be a string') + assert.ok(signature.length > 0, 'Signature should not be empty') + + // Check if signature matches base64 pattern + const base64Regex = /^[A-Za-z0-9+/]+={0,2}$/ + assert.ok(base64Regex.test(signature), 'Signature should be a valid base64 string') +}) + +test('privy plugin decorates request with signPrivyMessage', async (t) => { + const app = Fastify() + + t.after(() => { + app.close() + }) + + await app.register(privyPlugin) + + app.get('/', (request) => { + return { + decorated: { + signPrivyMessage: !!request.signPrivyMessage, + } + } + }) + + const result = await app.inject({ + method: 'GET', + url: '/' + }).then(r => r.json()) + + assert.equal(result.decorated.signPrivyMessage, true, 'Request should be decorated with signPrivyMessage method') +}) diff --git a/src/Managing.Web3Proxy/test/plugins/scrypt.test.ts b/src/Managing.Web3Proxy/test/plugins/scrypt.test.ts new file mode 100644 index 0000000..09d0371 --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/scrypt.test.ts @@ -0,0 +1,29 @@ +import { test } from 'node:test' +import Fastify from 'fastify' +import scryptPlugin from '../../src/plugins/custom/scrypt.js' +import assert from 'node:assert' + +test('scrypt works standalone', async t => { + const app = Fastify() + + t.after(() => app.close()) + + app.register(scryptPlugin) + + await app.ready() + + const password = 'test_password' + const hash = await app.hash(password) + assert.ok(typeof hash === 'string') + + const isValid = await app.compare(password, hash) + assert.ok(isValid, 'compare should return true for correct password') + + const isInvalid = await app.compare('wrong_password', hash) + assert.ok(!isInvalid, 'compare should return false for incorrect password') + + await assert.rejects( + () => app.compare(password, 'malformed_hash'), + 'compare should throw an error for malformed hash' + ) +}) diff --git a/src/Managing.Web3Proxy/test/plugins/token-approval.test.ts b/src/Managing.Web3Proxy/test/plugins/token-approval.test.ts new file mode 100644 index 0000000..8f897c7 --- /dev/null +++ b/src/Managing.Web3Proxy/test/plugins/token-approval.test.ts @@ -0,0 +1,97 @@ +import {describe, it} from 'node:test' +import assert from 'node:assert' +import {ethers} from 'ethers' + +describe('Token Approval Functionality', () => { + // Define a mock for the Privy client + const mockPrivyClient = { + walletApi: { + ethereum: { + sendTransaction: async (params: any) => { + // Verify parameters + assert.equal(params.address, 'test-address') + assert.equal(params.chainType, 'ethereum') + assert.equal(params.caip2, 'eip155:42161') + assert.ok(params.transaction.data.startsWith('0x095ea7b3'), 'Data should be the approve function signature') + + // Return mock transaction hash + return { hash: 'mock-tx-hash' } + } + } + } + } + + it('should encode approval data correctly', () => { + // Create contract interface for ERC20 token + const tokenABI = ["function approve(address spender, uint256 amount) public returns (bool)"] + const contractInterface = new ethers.Interface(tokenABI) + + // Set up parameters + const spenderAddress = '0xTestSpender' + const amount = 100 + const decimals = 8 + + // Encode with specific amount + const approveAmount = ethers.parseUnits(amount.toString(), decimals) + const data = contractInterface.encodeFunctionData("approve", [spenderAddress, approveAmount]) + + // Verify the data starts with the approve function selector + assert.ok(data.startsWith('0x095ea7b3'), 'Should start with the approve function selector') + + // Test with max amount + const maxData = contractInterface.encodeFunctionData("approve", [spenderAddress, ethers.MaxUint256]) + assert.ok(maxData.startsWith('0x095ea7b3'), 'Should start with the approve function selector') + }) + + it('should format token data correctly for different tickers', () => { + // Test a few mappings similar to getTokenDataFromTicker + const testCases = [ + { + ticker: 'BTC', + expected: { + address: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', + decimals: 8 + } + }, + { + ticker: 'ETH', + expected: { + address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', + decimals: 18 + } + } + ] + + for (const testCase of testCases) { + let result = { address: '', decimals: 0 } + + // Simple implementation of the ticker mapping logic + if (testCase.ticker === 'BTC') { + result = { + address: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', + decimals: 8 + } + } else if (testCase.ticker === 'ETH') { + result = { + address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', + decimals: 18 + } + } + + assert.deepEqual(result, testCase.expected, `Token data for ${testCase.ticker} should match expected values`) + } + }) + + it('should generate chain name correctly', () => { + // Test chain name generation + const testCases = [ + { chainId: 1, expected: 'eip155:1' }, + { chainId: 42161, expected: 'eip155:42161' } + ] + + for (const testCase of testCases) { + const result = `eip155:${testCase.chainId}` + assert.equal(result, testCase.expected, `Chain name for ${testCase.chainId} should match expected value`) + } + }) +}) \ No newline at end of file diff --git a/src/Managing.Web3Proxy/test/routes/api/api.test.ts b/src/Managing.Web3Proxy/test/routes/api/api.test.ts new file mode 100644 index 0000000..e5d82d7 --- /dev/null +++ b/src/Managing.Web3Proxy/test/routes/api/api.test.ts @@ -0,0 +1,26 @@ +import { test } from 'node:test' +import assert from 'node:assert' +import { build } from '../../helper.js' + +test('GET /api with no login', async (t) => { + const app = await build(t) + + const res = await app.inject({ + url: '/api' + }) + + assert.deepStrictEqual(JSON.parse(res.payload), { + message: 'You must be authenticated to access this route.' + }) +}) + +test('GET /api with cookie', async (t) => { + const app = await build(t) + + const res = await app.injectWithLogin('basic@example.com', { + url: '/api' + }) + + assert.equal(res.statusCode, 200) + assert.ok(JSON.parse(res.payload).message.startsWith('Hello basic!')) +}) diff --git a/src/Managing.Web3Proxy/test/routes/api/auth/auth.test.ts b/src/Managing.Web3Proxy/test/routes/api/auth/auth.test.ts new file mode 100644 index 0000000..7eb1c0f --- /dev/null +++ b/src/Managing.Web3Proxy/test/routes/api/auth/auth.test.ts @@ -0,0 +1,117 @@ +import { describe, it } from 'node:test' +import assert from 'node:assert' +import { build, expectValidationError } from '../../../helper.js' + +describe('Auth api', () => { + describe('POST /api/auth/login', () => { + it('Transaction should rollback on error', async (t) => { + const app = await build(t) + + const { mock: mockCompare } = t.mock.method(app, 'compare') + mockCompare.mockImplementationOnce((value: string, hash: string) => { + throw new Error() + }) + + const { mock: mockLogError } = t.mock.method(app.log, 'error') + + const res = await app.inject({ + method: 'POST', + url: '/api/auth/login', + payload: { + email: 'basic@example.com', + password: 'Password123$' + } + }) + + assert.strictEqual(mockCompare.callCount(), 1) + + const arg = mockLogError.calls[0].arguments[0] as unknown as { + err: Error; + } + + assert.strictEqual(res.statusCode, 500) + assert.deepStrictEqual(arg.err.message, 'Transaction failed.') + }) + + it('should return 400 if credentials payload is invalid', async (t) => { + const app = await build(t) + + const invalidPayload = { + email: '', + password: 'Password123$' + } + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: '/api/auth/login', + payload: invalidPayload + }) + + expectValidationError( + res, + 'body/email must NOT have fewer than 1 characters' + ) + }) + + it('should authenticate with valid credentials', async (t) => { + const app = await build(t) + + const res = await app.inject({ + method: 'POST', + url: '/api/auth/login', + payload: { + email: 'basic@example.com', + password: 'Password123$' + } + }) + + assert.strictEqual(res.statusCode, 200) + assert.ok( + res.cookies.some((cookie) => cookie.name === app.config.COOKIE_NAME) + ) + }) + + it('should not authneticate with invalid credentials', async (t) => { + const app = await build(t) + + const testCases = [ + { + email: 'invalid@email.com', + password: 'password', + description: 'invalid email' + }, + { + email: 'basic@example.com', + password: 'wrong_password', + description: 'invalid password' + }, + { + email: 'invalid@email.com', + password: 'wrong_password', + description: 'both invalid' + } + ] + + for (const testCase of testCases) { + const res = await app.inject({ + method: 'POST', + url: '/api/auth/login', + payload: { + email: testCase.email, + password: testCase.password + } + }) + + assert.strictEqual( + res.statusCode, + 401, + `Failed for case: ${testCase.description}` + ) + + assert.deepStrictEqual(JSON.parse(res.payload), { + message: 'Invalid email or password.' + }) + } + }) + }) +}) diff --git a/src/Managing.Web3Proxy/test/routes/api/tasks/fixtures/one_line.csv b/src/Managing.Web3Proxy/test/routes/api/tasks/fixtures/one_line.csv new file mode 100644 index 0000000..0b6fa70 --- /dev/null +++ b/src/Managing.Web3Proxy/test/routes/api/tasks/fixtures/one_line.csv @@ -0,0 +1,2 @@ +Line +This is a very small CSV with one line. diff --git a/src/Managing.Web3Proxy/test/routes/api/tasks/fixtures/short-logo.png b/src/Managing.Web3Proxy/test/routes/api/tasks/fixtures/short-logo.png new file mode 100644 index 0000000..8041e33 Binary files /dev/null and b/src/Managing.Web3Proxy/test/routes/api/tasks/fixtures/short-logo.png differ diff --git a/src/Managing.Web3Proxy/test/routes/api/tasks/tasks.test.ts b/src/Managing.Web3Proxy/test/routes/api/tasks/tasks.test.ts new file mode 100644 index 0000000..5db6fd9 --- /dev/null +++ b/src/Managing.Web3Proxy/test/routes/api/tasks/tasks.test.ts @@ -0,0 +1,861 @@ +import { after, before, beforeEach, describe, it } from 'node:test' +import assert from 'node:assert' +import { build, expectValidationError } from '../../../helper.js' +import { + Task, + TaskStatusEnum, + TaskPaginationResultSchema +} from '../../../../src/schemas/tasks.js' +import { FastifyInstance } from 'fastify' +import { Static } from '@sinclair/typebox' +import fs from 'node:fs' +import { pipeline } from 'node:stream/promises' +import path from 'node:path' +import FormData from 'form-data' +import os from 'node:os' +import { gunzipSync } from 'node:zlib' + +async function createUser ( + app: FastifyInstance, + userData: Partial<{ email: string; username: string; password: string }> +) { + const [id] = await app.knex('users').insert(userData) + return id +} + +async function createTask (app: FastifyInstance, taskData: Partial) { + const [id] = await app.knex('tasks').insert(taskData) + + return id +} + +async function uploadImageForTask ( + app: FastifyInstance, + taskId: number, + filePath: string, + uploadDir: string +) { + await app + .knex('tasks') + .where({ id: taskId }) + .update({ filename: `${taskId}_short-logo.png` }) + + const file = fs.createReadStream(filePath) + const filename = `${taskId}_short-logo.png` + + const writeStream = fs.createWriteStream(path.join(uploadDir, filename)) + + await pipeline(file, writeStream) +} + +describe('Tasks api (logged user only)', () => { + describe('GET /api/tasks', () => { + let app: FastifyInstance + let userId1: number + let userId2: number + + let firstTaskId: number + + before(async () => { + app = await build() + + userId1 = await createUser(app, { + username: 'user1', + email: 'user1@example.com', + password: 'password1' + }) + userId2 = await createUser(app, { + username: 'user2', + email: 'user2@example.com', + password: 'password2' + }) + + firstTaskId = await createTask(app, { + name: 'Task 1', + author_id: userId1, + status: TaskStatusEnum.New + }) + await createTask(app, { + name: 'Task 2', + author_id: userId1, + assigned_user_id: userId2, + status: TaskStatusEnum.InProgress + }) + await createTask(app, { + name: 'Task 3', + author_id: userId2, + status: TaskStatusEnum.Completed + }) + await createTask(app, { + name: 'Task 4', + author_id: userId1, + assigned_user_id: userId1, + status: TaskStatusEnum.OnHold + }) + + app.close() + }) + + it('should return a list of tasks with no pagination filter', async (t) => { + app = await build(t) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks' + }) + + assert.strictEqual(res.statusCode, 200) + const { tasks, total } = JSON.parse(res.payload) as Static< + typeof TaskPaginationResultSchema + > + const firstTask = tasks.find((task) => task.id === firstTaskId) + + assert.ok(firstTask, 'Created task should be in the response') + assert.deepStrictEqual(firstTask.name, 'Task 1') + assert.strictEqual(firstTask.author_id, userId1) + assert.strictEqual(firstTask.status, TaskStatusEnum.New) + + assert.strictEqual(total, 4) + }) + + it('should paginate by page and limit', async (t) => { + app = await build(t) + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks', + query: { page: '2', limit: '1' } + }) + + assert.strictEqual(res.statusCode, 200) + const { tasks, total } = JSON.parse(res.payload) as Static< + typeof TaskPaginationResultSchema + > + + assert.strictEqual(total, 4) + assert.strictEqual(tasks.length, 1) + assert.strictEqual(tasks[0].name, 'Task 2') + assert.strictEqual(tasks[0].author_id, userId1) + assert.strictEqual(tasks[0].status, TaskStatusEnum.InProgress) + }) + + it('should filter tasks by assigned_user_id', async (t) => { + app = await build(t) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks', + query: { assigned_user_id: userId2.toString() } + }) + + assert.strictEqual(res.statusCode, 200) + const { tasks, total } = JSON.parse(res.payload) as Static< + typeof TaskPaginationResultSchema + > + + assert.strictEqual(total, 1) + tasks.forEach((task) => + assert.strictEqual(task.assigned_user_id, userId2) + ) + }) + + it('should filter tasks by status', async (t) => { + app = await build(t) + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks', + query: { status: TaskStatusEnum.Completed } + }) + + assert.strictEqual(res.statusCode, 200) + const { tasks, total } = JSON.parse(res.payload) as Static< + typeof TaskPaginationResultSchema + > + + assert.strictEqual(total, 1) + tasks.forEach((task) => + assert.strictEqual(task.status, TaskStatusEnum.Completed) + ) + }) + + it('should paginate and filter tasks by author_id and status', async (t) => { + app = await build(t) + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks', + query: { + author_id: userId1.toString(), + status: TaskStatusEnum.OnHold, + page: '1', + limit: '1' + } + }) + + assert.strictEqual(res.statusCode, 200) + const { tasks, total } = JSON.parse(res.payload) as Static< + typeof TaskPaginationResultSchema + > + + assert.strictEqual(total, 1) + assert.strictEqual(tasks.length, 1) + assert.strictEqual(tasks[0].name, 'Task 4') + assert.strictEqual(tasks[0].author_id, userId1) + assert.strictEqual(tasks[0].status, TaskStatusEnum.OnHold) + }) + + it('should return empty array and total = 0 if no tasks', async (t) => { + app = await build(t) + + await app.knex('tasks').delete() + + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks' + }) + + assert.strictEqual(res.statusCode, 200) + const { tasks, total } = JSON.parse(res.payload) as Static< + typeof TaskPaginationResultSchema + > + + assert.strictEqual(total, 0) + assert.strictEqual(tasks.length, 0) + }) + }) + + describe('GET /api/tasks/:id', () => { + it('should return a task', async (t) => { + const app = await build(t) + + const taskData = { + name: 'Single Task', + author_id: 1, + status: TaskStatusEnum.New + } + + const newTaskId = await createTask(app, taskData) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: `/api/tasks/${newTaskId}` + }) + + assert.strictEqual(res.statusCode, 200) + const task = JSON.parse(res.payload) as Task + assert.equal(task.id, newTaskId) + }) + + it('should return 404 if task is not found', async (t) => { + const app = await build(t) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks/9999' + }) + + assert.strictEqual(res.statusCode, 404) + const payload = JSON.parse(res.payload) + assert.strictEqual(payload.message, 'Task not found') + }) + }) + + describe('POST /api/tasks', () => { + it('should return 400 if task creation payload is invalid', async (t) => { + const app = await build(t) + + const invalidTaskData = { + name: '' + } + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: '/api/tasks', + payload: invalidTaskData + }) + + expectValidationError(res, 'body/name must NOT have fewer than 1 characters') + }) + + it('should create a new task', async (t) => { + const app = await build(t) + + const taskData = { + name: 'New Task' + } + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: '/api/tasks', + payload: taskData + }) + + assert.strictEqual(res.statusCode, 201) + const { id } = JSON.parse(res.payload) + + const createdTask = await app.knex('tasks').where({ id }).first() + assert.equal(createdTask?.name, taskData.name) + }) + }) + + describe('PATCH /api/tasks/:id', () => { + it('should return 400 if task update payload is invalid', async (t) => { + const app = await build(t) + + const invalidUpdateData = { + name: 'Updated task', + assigned_user_id: 'abc' + } + + const res = await app.injectWithLogin('basic@example.com', { + method: 'PATCH', + url: '/api/tasks/1', + payload: invalidUpdateData + }) + + expectValidationError(res, 'body/assigned_user_id must be integer') + }) + + it('should update an existing task', async (t) => { + const app = await build(t) + + const taskData = { + name: 'Task to Update', + author_id: 1, + status: TaskStatusEnum.New + } + const newTaskId = await createTask(app, taskData) + + const updatedData = { + name: 'Updated Task' + } + + const res = await app.injectWithLogin('basic@example.com', { + method: 'PATCH', + url: `/api/tasks/${newTaskId}`, + payload: updatedData + }) + + assert.strictEqual(res.statusCode, 200) + const updatedTask = await app + .knex('tasks') + .where({ id: newTaskId }) + .first() + assert.equal(updatedTask?.name, updatedData.name) + }) + + it('should return 404 if task is not found for update', async (t) => { + const app = await build(t) + + const updatedData = { + name: 'Updated Task' + } + + const res = await app.injectWithLogin('basic@example.com', { + method: 'PATCH', + url: '/api/tasks/9999', + payload: updatedData + }) + + assert.strictEqual(res.statusCode, 404) + const payload = JSON.parse(res.payload) + assert.strictEqual(payload.message, 'Task not found') + }) + }) + + describe('DELETE /api/tasks/:id', () => { + const taskData = { + name: 'Task to Delete', + author_id: 1, + status: TaskStatusEnum.New + } + + it('should delete an existing task', async (t) => { + const app = await build(t) + const newTaskId = await createTask(app, taskData) + + const res = await app.injectWithLogin('admin@example.com', { + method: 'DELETE', + url: `/api/tasks/${newTaskId}` + }) + + assert.strictEqual(res.statusCode, 204) + + const deletedTask = await app + .knex('tasks') + .where({ id: newTaskId }) + .first() + assert.strictEqual(deletedTask, undefined) + }) + + it('should return 404 if task is not found for deletion', async (t) => { + const app = await build(t) + + const res = await app.injectWithLogin('admin@example.com', { + method: 'DELETE', + url: '/api/tasks/9999' + }) + + assert.strictEqual(res.statusCode, 404) + const payload = JSON.parse(res.payload) + assert.strictEqual(payload.message, 'Task not found') + }) + }) + + describe('POST /api/tasks/:id/assign', () => { + it('should return 400 if task assignment payload is invalid', async (t) => { + const app = await build(t) + + const invalidPayload = { + userId: 'not-a-number' + } + + const res = await app.injectWithLogin('moderator@example.com', { + method: 'POST', + url: '/api/tasks/1/assign', + payload: invalidPayload + }) + + expectValidationError(res, 'body/userId must be number') + }) + + it('should assign a task to a user and persist the changes', async (t) => { + const app = await build(t) + + for (const email of ['moderator@example.com', 'admin@example.com']) { + const taskData = { + name: 'Task to Assign', + author_id: 1, + status: TaskStatusEnum.New + } + const newTaskId = await createTask(app, taskData) + + const res = await app.injectWithLogin(email, { + method: 'POST', + url: `/api/tasks/${newTaskId}/assign`, + payload: { + userId: 2 + } + }) + + assert.strictEqual(res.statusCode, 200) + + const updatedTask = await app + .knex('tasks') + .where({ id: newTaskId }) + .first() + assert.strictEqual(updatedTask?.assigned_user_id, 2) + } + }) + + it('should unassign a task from a user and persist the changes', async (t) => { + const app = await build(t) + + for (const email of ['moderator@example.com', 'admin@example.com']) { + const taskData = { + name: 'Task to Unassign', + author_id: 1, + assigned_user_id: 2, + status: TaskStatusEnum.New + } + const newTaskId = await createTask(app, taskData) + + const res = await app.injectWithLogin(email, { + method: 'POST', + url: `/api/tasks/${newTaskId}/assign`, + payload: {} + }) + + assert.strictEqual(res.statusCode, 200) + + const updatedTask = await app + .knex('tasks') + .where({ id: newTaskId }) + .first() + assert.strictEqual(updatedTask?.assigned_user_id, null) + } + }) + + it('should return 403 if not a moderator', async (t) => { + const app = await build(t) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: '/api/tasks/1/assign', + payload: {} + }) + + assert.strictEqual(res.statusCode, 403) + }) + + it('should return 404 if task is not found', async (t) => { + const app = await build(t) + + const res = await app.injectWithLogin('moderator@example.com', { + method: 'POST', + url: '/api/tasks/9999/assign', + payload: { + userId: 2 + } + }) + + assert.strictEqual(res.statusCode, 404) + const payload = JSON.parse(res.payload) + assert.strictEqual(payload.message, 'Task not found') + }) + }) + + describe('Task image upload, retrieval and delete', () => { + let app: FastifyInstance + let taskId: number + const filename = 'short-logo.png' + const fixturesDir = path.join(import.meta.dirname, './fixtures') + const testImagePath = path.join(fixturesDir, filename) + const testCsvPath = path.join(fixturesDir, 'one_line.csv') + let uploadDir: string + let uploadDirTask: string + + before(async () => { + app = await build() + uploadDir = path.join(import.meta.dirname, '../../../../', app.config.UPLOAD_DIRNAME) + uploadDirTask = path.join(uploadDir, app.config.UPLOAD_TASKS_DIRNAME) + assert.ok(fs.existsSync(uploadDir)) + + taskId = await createTask(app, { + name: 'Task with image', + author_id: 1, + status: TaskStatusEnum.New + }) + + app.close() + }) + + after(async () => { + const files = fs.readdirSync(uploadDirTask) + files.forEach((file) => { + const filePath = path.join(uploadDirTask, file) + fs.rmSync(filePath, { recursive: true }) + }) + + await app.close() + }) + + describe('Upload', () => { + it('should create upload directories at boot if not exist', async (t) => { + fs.rmSync(uploadDir, { recursive: true }) + assert.ok(!fs.existsSync(uploadDir)) + + app = await build(t) + + assert.ok(fs.existsSync(uploadDir)) + assert.ok(fs.existsSync(uploadDirTask)) + }) + + it('should upload a valid image for a task', async (t) => { + app = await build(t) + + const form = new FormData() + form.append('file', fs.createReadStream(testImagePath)) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: `/api/tasks/${taskId}/upload`, + payload: form, + headers: form.getHeaders() + }) + + assert.strictEqual(res.statusCode, 200) + + const { message } = JSON.parse(res.payload) + assert.strictEqual(message, 'File uploaded successfully') + }) + + it('should return 404 if task not found', async (t) => { + app = await build(t) + + const form = new FormData() + form.append('file', fs.createReadStream(testImagePath)) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: '/api/tasks/100000/upload', + payload: form, + headers: form.getHeaders() + }) + + assert.strictEqual(res.statusCode, 404) + + const { message } = JSON.parse(res.payload) + assert.strictEqual(message, 'Task not found') + }) + + it('should return 404 if file not found', async (t) => { + app = await build(t) + + const form = new FormData() + form.append('file', fs.createReadStream(testImagePath)) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: `/api/tasks/${taskId}/upload`, + payload: undefined, + headers: form.getHeaders() + }) + + assert.strictEqual(res.statusCode, 404) + + const { message } = JSON.parse(res.payload) + assert.strictEqual(message, 'File not found') + }) + + it('should reject an invalid file type', async (t) => { + app = await build(t) + + const form = new FormData() + form.append('file', fs.createReadStream(testCsvPath)) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: `/api/tasks/${taskId}/upload`, + payload: form, + headers: form.getHeaders() + }) + + expectValidationError(res, 'Invalid file type') + }) + + it('should reject if file size exceeds limit (truncated)', async (t) => { + app = await build(t) + + const tmpDir = os.tmpdir() + const largeTestImagePath = path.join(tmpDir, 'large-test-image.jpg') + + const largeBuffer = Buffer.alloc(1024 * 1024 * 1.5, 'a') // Max file size in bytes is 1 MB + fs.writeFileSync(largeTestImagePath, largeBuffer) + + const form = new FormData() + form.append('file', fs.createReadStream(largeTestImagePath)) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: `/api/tasks/${taskId}/upload`, + payload: form, + headers: form.getHeaders() + }) + + expectValidationError(res, 'File size limit exceeded') + }) + + it('File upload transaction should rollback on error', async (t) => { + const app = await build(t) + + const { mock: mockPipeline } = t.mock.method(fs, 'createWriteStream') + mockPipeline.mockImplementationOnce(() => { + throw new Error() + }) + + const { mock: mockLogError } = t.mock.method(app.log, 'error') + + const form = new FormData() + form.append('file', fs.createReadStream(testImagePath)) + const res = await app.injectWithLogin('basic@example.com', { + method: 'POST', + url: `/api/tasks/${taskId}/upload`, + payload: form, + headers: form.getHeaders() + }) + + assert.strictEqual(res.statusCode, 500) + assert.strictEqual(mockLogError.callCount(), 1) + + const arg = mockLogError.calls[0].arguments[0] as unknown as { + err: Error; + } + + assert.deepStrictEqual(arg.err.message, 'Transaction failed.') + }) + }) + + describe('Retrieval', () => { + it('should retrieve the uploaded image based on task id and filename', async (t) => { + app = await build(t) + + const taskFilename = encodeURIComponent(`${taskId}_${filename}`) + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: `/api/tasks/${taskFilename}/image` + }) + + assert.strictEqual(res.statusCode, 200) + assert.strictEqual(res.headers['content-type'], 'image/png') + + const originalFile = fs.readFileSync(testImagePath) + + assert.deepStrictEqual(originalFile, res.rawPayload) + }) + + it('should return 404 error for non-existant filename', async (t) => { + app = await build(t) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks/non-existant/image' + }) + + assert.strictEqual(res.statusCode, 404) + const { message } = JSON.parse(res.payload) + assert.strictEqual(message, 'No task has filename "non-existant"') + }) + }) + + describe('Deletion', () => { + before(async () => { + app = await build() + + await app.knex('tasks').where({ id: taskId }).update({ filename: null }) + + const files = fs.readdirSync(uploadDirTask) + files.forEach((file) => { + const filePath = path.join(uploadDirTask, file) + fs.rmSync(filePath, { recursive: true }) + }) + + await app.close() + }) + + beforeEach(async () => { + app = await build() + await uploadImageForTask(app, taskId, testImagePath, uploadDirTask) + await app.close() + }) + + after(async () => { + const files = fs.readdirSync(uploadDirTask) + files.forEach((file) => { + const filePath = path.join(uploadDirTask, file) + fs.rmSync(filePath, { recursive: true }) + }) + }) + + it('should remove an existing image for a task', async (t) => { + app = await build(t) + + const taskFilename = encodeURIComponent(`${taskId}_${filename}`) + const res = await app.injectWithLogin('basic@example.com', { + method: 'DELETE', + url: `/api/tasks/${taskFilename}/image` + }) + + assert.strictEqual(res.statusCode, 204) + + const files = fs.readdirSync(uploadDirTask) + assert.strictEqual(files.length, 0) + }) + + it('should return 404 for non-existant task with filename for deletion', async (t) => { + app = await build(t) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'DELETE', + url: '/api/tasks/non-existant/image' + }) + + assert.strictEqual(res.statusCode, 404) + const { message } = JSON.parse(res.payload) + assert.strictEqual(message, 'No task has filename "non-existant"') + }) + + it('should return 204 for non-existant file in upload dir', async (t) => { + const app = await build(t) + + await createTask(app, { + name: 'Task with image', + author_id: 1, + status: TaskStatusEnum.New, + filename: 'does_not_exist.png' + }) + + const { mock: mockLogWarn } = t.mock.method(app.log, 'warn') + + const res = await app.injectWithLogin('basic@example.com', { + method: 'DELETE', + url: '/api/tasks/does_not_exist.png/image' + }) + + assert.strictEqual(res.statusCode, 204) + + const arg = mockLogWarn.calls[0].arguments[0] + + assert.strictEqual(mockLogWarn.callCount(), 1) + assert.deepStrictEqual(arg, 'File path \'does_not_exist.png\' not found') + }) + + it('File deletion transaction should rollback on error', async (t) => { + const app = await build(t) + const { mock: mockPipeline } = t.mock.method(fs.promises, 'unlink') + mockPipeline.mockImplementationOnce(() => { + return Promise.reject(new Error()) + }) + + const { mock: mockLogError } = t.mock.method(app.log, 'error') + + const taskFilename = encodeURIComponent(`${taskId}_${filename}`) + const res = await app.injectWithLogin('basic@example.com', { + method: 'DELETE', + url: `/api/tasks/${taskFilename}/image` + }) + + assert.strictEqual(res.statusCode, 500) + assert.strictEqual(mockLogError.callCount(), 1) + + const arg = mockLogError.calls[0].arguments[0] as unknown as { + err: Error; + } + + assert.deepStrictEqual(arg.err.message, 'Transaction failed.') + }) + }) + }) + + describe('GET /api/tasks/download/csv', () => { + before(async () => { + const app = await build() + await app.knex('tasks').del() + await app.close() + }) + + it('should stream a gzipped CSV file', async (t) => { + const app = await build(t) + + const tasks = [] + for (let i = 0; i < 1000; i++) { + tasks.push({ + name: `Task ${i + 1}`, + author_id: 1, + assigned_user_id: 2, + filename: 'task.png', + status: TaskStatusEnum.InProgress + }) + } + + await app.knex('tasks').insert(tasks) + + const res = await app.injectWithLogin('basic@example.com', { + method: 'GET', + url: '/api/tasks/download/csv' + }) + + assert.strictEqual(res.statusCode, 200) + assert.strictEqual(res.headers['content-type'], 'application/gzip') + assert.strictEqual( + res.headers['content-disposition'], + 'attachment; filename="tasks.csv.gz"' + ) + + const decompressed = gunzipSync(res.rawPayload).toString('utf-8') + const lines = decompressed.split('\n') + assert.equal(lines.length - 1, 1001) + + assert.ok(lines[1].includes('Task 1,1,2,task.png,in-progress')) + assert.equal(lines[0], 'id,name,author_id,assigned_user_id,filename,status,created_at,updated_at') + }) + }) +}) diff --git a/src/Managing.Web3Proxy/test/routes/api/users/users.test.ts b/src/Managing.Web3Proxy/test/routes/api/users/users.test.ts new file mode 100644 index 0000000..11b989f --- /dev/null +++ b/src/Managing.Web3Proxy/test/routes/api/users/users.test.ts @@ -0,0 +1,192 @@ +import { it, describe, beforeEach, afterEach } from 'node:test' +import assert from 'node:assert' +import { build } from '../../../helper.js' +import { FastifyInstance } from 'fastify' +import { scryptHash } from '../../../../src/plugins/custom/scrypt.js' + +async function createUser (app: FastifyInstance, userData: Partial<{ username: string; email: string; password: string }>) { + const [id] = await app.knex('users').insert(userData) + return id +} + +async function deleteUser (app: FastifyInstance, username: string) { + await app.knex('users').delete().where({ username }) +} + +async function updatePasswordWithLoginInjection (app: FastifyInstance, username: string, payload: { currentPassword: string; newPassword: string }) { + return app.injectWithLogin(`${username}@example.com`, { + method: 'PUT', + url: '/api/users/update-password', + payload + }) +} + +describe('Users API', async () => { + const hash = await scryptHash('Password123$') + let app: FastifyInstance + + beforeEach(async () => { + app = await build() + }) + + afterEach(async () => { + await app.close() + }) + + it('Should enforce rate limiting by returning a 429 status after exceeding 3 password update attempts within 1 minute', async () => { + await createUser(app, { username: 'random-user-0', email: 'random-user-0@example.com', password: hash }) + + const loginResponse = await app.injectWithLogin('random-user-0@example.com', { + method: 'POST', + url: '/api/auth/login', + payload: { + email: 'random-user-0@example.com', + password: 'Password123$' + } + }) + + app.config = { + ...app.config, + COOKIE_SECRET: loginResponse.cookies[0].value + } + + for (let i = 0; i < 3; i++) { + const resInner = await app.inject({ + method: 'PUT', + url: '/api/users/update-password', + payload: { + currentPassword: 'Password1234$', + newPassword: 'Password123$' + }, + cookies: { + [app.config.COOKIE_NAME]: loginResponse.cookies[0].value + } + }) + + assert.strictEqual(resInner.statusCode, 401) + } + + const res = await app.inject({ + method: 'PUT', + url: '/api/users/update-password', + payload: { + currentPassword: 'Password1234$', + newPassword: 'Password123$' + }, + cookies: { + [app.config.COOKIE_NAME]: loginResponse.cookies[0].value + } + }) + + assert.strictEqual(res.statusCode, 429) + await deleteUser(app, 'random-user-0') + }) + + it('Should update the password successfully', async () => { + await createUser(app, { username: 'random-user-1', email: 'random-user-1@example.com', password: hash }) + const res = await updatePasswordWithLoginInjection(app, 'random-user-1', { + currentPassword: 'Password123$', + newPassword: 'NewPassword123$' + }) + + assert.strictEqual(res.statusCode, 200) + assert.deepStrictEqual(JSON.parse(res.payload), { message: 'Password updated successfully' }) + + await deleteUser(app, 'random-user-1') + }) + + it('Should return 400 if the new password is the same as current password', async () => { + await createUser(app, { username: 'random-user-2', email: 'random-user-2@example.com', password: hash }) + const res = await updatePasswordWithLoginInjection(app, 'random-user-2', { + currentPassword: 'Password123$', + newPassword: 'Password123$' + }) + + assert.strictEqual(res.statusCode, 400) + assert.deepStrictEqual(JSON.parse(res.payload), { message: 'New password cannot be the same as the current password.' }) + + await deleteUser(app, 'random-user-2') + }) + + it('Should return 400 if the newPassword password not match the required pattern', async () => { + await createUser(app, { username: 'random-user-3', email: 'random-user-3@example.com', password: hash }) + const res = await updatePasswordWithLoginInjection(app, 'random-user-3', { + currentPassword: 'Password123$', + newPassword: 'password123$' + }) + + assert.strictEqual(res.statusCode, 400) + assert.deepStrictEqual(JSON.parse(res.payload), { message: 'body/newPassword must match pattern "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).*$"' }) + + await deleteUser(app, 'random-user-3') + }) + + it('Should return 401 the current password is incorrect', async () => { + await createUser(app, { username: 'random-user-4', email: 'random-user-4@example.com', password: hash }) + const res = await updatePasswordWithLoginInjection(app, 'random-user-4', { + currentPassword: 'WrongPassword123$', + newPassword: 'Password123$' + }) + + assert.strictEqual(res.statusCode, 401) + assert.deepStrictEqual(JSON.parse(res.payload), { message: 'Invalid current password.' }) + + await deleteUser(app, 'random-user-4') + }) + + it('Should return 401 if user does not exist in the database', async () => { + await createUser(app, { username: 'random-user-5', email: 'random-user-5@example.com', password: hash }) + const loginResponse = await app.injectWithLogin('random-user-5@example.com', { + method: 'POST', + url: '/api/auth/login', + payload: { + email: 'random-user-5@example.com', + password: 'Password123$' + } + }) + + assert.strictEqual(loginResponse.statusCode, 200) + + await deleteUser(app, 'random-user-5') + + app.config = { + ...app.config, + COOKIE_SECRET: loginResponse.cookies[0].value + } + + const res = await app.inject({ + method: 'PUT', + url: '/api/users/update-password', + payload: { + currentPassword: 'Password123$', + newPassword: 'NewPassword123$' + }, + cookies: { + [app.config.COOKIE_NAME]: loginResponse.cookies[0].value + } + }) + + assert.strictEqual(res.statusCode, 401) + assert.deepStrictEqual(JSON.parse(res.payload), { message: 'User does not exist.' }) + await deleteUser(app, 'random-user-5') + }) + + it('Should handle errors gracefully and return 500 Internal Server Error when an unexpected error occurs', async (t) => { + const { mock: mockKnex } = t.mock.method(app, 'hash') + mockKnex.mockImplementation(() => { + throw new Error() + }) + + await createUser(app, { username: 'random-user-6', email: 'random-user-6@example.com', password: hash }) + + const res = await updatePasswordWithLoginInjection(app, 'random-user-6', { + currentPassword: 'Password123$', + newPassword: 'NewPassword123$' + }) + + assert.strictEqual(res.statusCode, 500) + assert.deepStrictEqual(JSON.parse(res.payload), { message: 'Internal Server Error' }) + + await deleteUser(app, 'random-user-6') + }) +}) diff --git a/src/Managing.Web3Proxy/test/routes/home.test.ts b/src/Managing.Web3Proxy/test/routes/home.test.ts new file mode 100644 index 0000000..41fc3a1 --- /dev/null +++ b/src/Managing.Web3Proxy/test/routes/home.test.ts @@ -0,0 +1,14 @@ +import { test } from 'node:test' +import assert from 'node:assert' +import { build } from '../helper.js' + +test('GET /', async (t) => { + const app = await build(t) + const res = await app.inject({ + url: '/' + }) + + assert.deepStrictEqual(JSON.parse(res.payload), { + message: 'Welcome to the official fastify demo!' + }) +}) diff --git a/src/Managing.Web3Proxy/tsconfig.json b/src/Managing.Web3Proxy/tsconfig.json new file mode 100644 index 0000000..b24d913 --- /dev/null +++ b/src/Managing.Web3Proxy/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "lib": ["esnext", "dom"], + "target": "ES2020", + "allowJs": true, + "strict": false, + "esModuleInterop": true, + "skipLibCheck": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "outDir": "dist", + "rootDir": "src", + "sourceMap": false + }, + "include": ["@types", "src/**/*.ts"], + "ts-node": { + "esm": true, + "experimentalSpecifierResolution": "node", +} +} diff --git a/src/Managing.WebApp/package.json b/src/Managing.WebApp/package.json index 359333e..53686e9 100644 --- a/src/Managing.WebApp/package.json +++ b/src/Managing.WebApp/package.json @@ -18,7 +18,7 @@ "dependencies": { "@heroicons/react": "^1.0.6", "@microsoft/signalr": "^6.0.5", - "@privy-io/react-auth": "^2.6.1", + "@privy-io/react-auth": "^2.7.2", "@privy-io/wagmi": "^1.0.3", "@tailwindcss/typography": "^0.5.0", "@tanstack/react-query": "^5.67.1", @@ -28,9 +28,13 @@ "@walletconnect/universal-provider": "^2.8.6", "autoprefixer": "^10.4.7", "axios": "^0.27.2", + "base64-js": "^1.5.1", + "canonicalize": "^2.0.0", "classnames": "^2.3.1", "connectkit": "^1.8.2", + "crypto": "^1.0.1", "date-fns": "^2.30.0", + "elliptic": "^6.6.1", "jotai": "^1.6.7", "latest-version": "^9.0.0", "lightweight-charts": "git+https://github.com/ntf/lightweight-charts.git", @@ -52,12 +56,14 @@ "react-toastify": "^9.0.1", "reactflow": "^11.8.3", "tailwindcss": "^3.0.23", - "viem": "2.x", + "viem": "2.24.2", "wagmi": "^2.14.12", "web3": "^4.16.0", - "zustand": "^4.4.1" + "zustand": "^4.4.1", + "@gmx-io/sdk": "0.2.0" }, "devDependencies": { + "@types/elliptic": "^6.4.18", "@types/react": "^18.0.9", "@types/react-dom": "^18.0.4", "@types/react-grid-layout": "^1.3.2", diff --git a/src/Managing.WebApp/src/components/mollecules/LogIn/LogIn.tsx b/src/Managing.WebApp/src/components/mollecules/LogIn/LogIn.tsx index d73d948..3442586 100644 --- a/src/Managing.WebApp/src/components/mollecules/LogIn/LogIn.tsx +++ b/src/Managing.WebApp/src/components/mollecules/LogIn/LogIn.tsx @@ -25,7 +25,7 @@ const LogIn = () => { } try { - const message = 'wagmi' + const message = 'KaigenTeamXCowchain' const t = new Toast('Signing message...') // Use Privy's signMessage function - returns { signature: string } diff --git a/src/Managing.WebApp/src/components/mollecules/Modal/BotNameModal.tsx b/src/Managing.WebApp/src/components/mollecules/Modal/BotNameModal.tsx new file mode 100644 index 0000000..82db356 --- /dev/null +++ b/src/Managing.WebApp/src/components/mollecules/Modal/BotNameModal.tsx @@ -0,0 +1,106 @@ +import React, { useState, useEffect } from 'react' + +import type { Backtest, MoneyManagement } from '../../../generated/ManagingApi' +import type { IModalProps } from '../../../global/type' + +import Modal from './Modal' + +interface IBotNameModalProps extends IModalProps { + backtest: Backtest + isForWatchOnly: boolean + onSubmitBotName: (botName: string, backtest: Backtest, isForWatchOnly: boolean, moneyManagementName: string) => void + moneyManagements: MoneyManagement[] + selectedMoneyManagement: string + setSelectedMoneyManagement: (name: string) => void +} + +const BotNameModal: React.FC = ({ + showModal, + onClose, + backtest, + isForWatchOnly, + onSubmitBotName, + moneyManagements, + selectedMoneyManagement, + setSelectedMoneyManagement, +}) => { + const [botName, setBotName] = useState('') + + // Initialize botName when backtest changes + useEffect(() => { + if (backtest) { + setBotName(`${backtest.ticker}-${backtest.timeframe}`) + } + }, [backtest]) + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault() + if (botName.trim()) { + onSubmitBotName(botName, backtest, isForWatchOnly, selectedMoneyManagement) + } + } + + const handleMoneyManagementChange = (e: React.ChangeEvent) => { + setSelectedMoneyManagement(e.target.value) + } + + const titleHeader = isForWatchOnly ? 'Run Bot in Watch Mode' : 'Run Bot' + + return ( + +
+ + setBotName(e.target.value)} + required + /> +
+ +
+ + +
+ +

+ {isForWatchOnly + ? 'The bot will run in watch-only mode and will not execute trades.' + : 'The bot will run and execute trades based on signals.'} +

+ +
+ + +
+
+ ) +} + +export default BotNameModal \ No newline at end of file diff --git a/src/Managing.WebApp/src/components/organism/Backtest/backtestModal.tsx b/src/Managing.WebApp/src/components/organism/Backtest/backtestModal.tsx index a294407..64ef1ed 100644 --- a/src/Managing.WebApp/src/components/organism/Backtest/backtestModal.tsx +++ b/src/Managing.WebApp/src/components/organism/Backtest/backtestModal.tsx @@ -32,16 +32,33 @@ const BacktestModal: React.FC = ({ setBacktests, showLoopSlider = false, }) => { - const [selectedAccount, setSelectedAccount] = React.useState() - const [selectedTimeframe, setSelectedTimeframe] = React.useState() + // Get date 15 days ago for start date + const defaultStartDate = new Date(); + defaultStartDate.setDate(defaultStartDate.getDate() - 15); + const defaultStartDateString = defaultStartDate.toISOString().split('T')[0]; + + // Today for end date + const defaultEndDate = new Date(); + const defaultEndDateString = defaultEndDate.toISOString().split('T')[0]; + + const [startDate, setStartDate] = useState(defaultStartDateString); + const [endDate, setEndDate] = useState(defaultEndDateString); + + const { register, handleSubmit, setValue } = useForm({ + defaultValues: { + startDate: defaultStartDateString, + endDate: defaultEndDateString + } + }); + const [selectedAccount, setSelectedAccount] = useState('') + const [selectedTimeframe, setSelectedTimeframe] = useState(Timeframe.OneHour) const [selectedLoopQuantity, setLoopQuantity] = React.useState( showLoopSlider ? 3 : 1 ) - const [balance, setBalance] = React.useState(10000) - const [days, setDays] = React.useState(-17) - + const [balance, setBalance] = useState(10000) + const [customMoneyManagement, setCustomMoneyManagement] = - React.useState() + React.useState(undefined) const [selectedMoneyManagement, setSelectedMoneyManagement] = useState() const [showCustomMoneyManagement, setShowCustomMoneyManagement] = @@ -55,21 +72,20 @@ const BacktestModal: React.FC = ({ const moneyManagementClient = new MoneyManagementClient({}, apiUrl) const backtestClient = new BacktestClient({}, apiUrl) - const { register, handleSubmit } = useForm() const onSubmit: SubmitHandler = async (form) => { - const { scenarioName, tickers } = form - console.log(customMoneyManagement) - closeModal() - for (let sIndex = 0; sIndex < scenarioName.length; sIndex++) { - for (let tIndex = 0; tIndex < tickers.length; tIndex++) { - await runBacktest( - form, - form.tickers[tIndex], - form.scenarioName[sIndex], - customMoneyManagement, - 1 - ) - } + if (!form.scenarioName) { + const t = new Toast('Please select a scenario', false); + return; + } + + if (!form.tickers || form.tickers.length === 0) { + const t = new Toast('Please select at least one ticker', false); + return; + } + + for (const ticker of form.tickers) { + const scenarioName = form.scenarioName; + await runBacktest(form, ticker, scenarioName, customMoneyManagement, 0); } } @@ -81,19 +97,23 @@ const BacktestModal: React.FC = ({ loopCount: number ) { const t = new Toast(ticker + ' is running') - await backtestClient + // Use the name of the money management strategy if custom is not provided + const moneyManagementName = customMoneyManagement ? undefined : selectedMoneyManagement + + backtestClient .backtest_Run( form.accountName, form.botType, ticker as Ticker, scenarioName, form.timeframe, - false, - days, + false, // watchOnly balance, - selectedMoneyManagement, + moneyManagementName, + new Date(form.startDate), // startDate + new Date(form.endDate), // endDate form.save, - showCustomMoneyManagement ? customMoneyManagement : undefined + customMoneyManagement ) .then((backtest: Backtest) => { t.update('success', `${backtest.ticker} Backtest Succeeded`) @@ -113,7 +133,7 @@ const BacktestModal: React.FC = ({ } }) .catch((err) => { - t.update('error', 'Error :' + err) + t.update('error', 'Error: ' + err) }) } @@ -126,28 +146,34 @@ const BacktestModal: React.FC = ({ } function onMoneyManagementChange(e: any) { - if (e.target.value == 'custom') { + if (e.target.value === 'custom') { setShowCustomMoneyManagement(true) } else { setShowCustomMoneyManagement(false) setCustomMoneyManagement(undefined) setSelectedMoneyManagement(e.target.value) - } } + const { data: accounts } = useQuery({ + queryFn: () => accountClient.account_GetAccounts(), + queryKey: ['accounts'], + }) + const { data: scenarios } = useQuery({ queryFn: () => scenarioClient.scenario_GetScenarios(), queryKey: ['scenarios'], }) - const { data: accounts } = useQuery({ - queryFn: async () => { return await accountClient.account_GetAccounts() }, - queryKey: ['accounts'], - }) + // Set the first scenario as default when scenarios are loaded + useEffect(() => { + if (scenarios && scenarios.length > 0 && scenarios[0].name) { + setValue('scenarioName', scenarios[0].name); + } + }, [scenarios, setValue]); useEffect(() => { - if (accounts) { + if (accounts && accounts.length > 0) { setSelectedAccount(accounts[0].name) setSelectedTimeframe(Timeframe.FiveMinutes) } @@ -164,16 +190,16 @@ const BacktestModal: React.FC = ({ }) const { data: moneyManagements } = useQuery({ - enabled: !!selectedTimeframe, queryFn: async () => { return await moneyManagementClient.moneyManagement_GetMoneyManagements(); }, - queryKey: ['moneyManagements', selectedTimeframe], + queryKey: ['moneyManagements'], }) useEffect(() => { - if (moneyManagements){ + if (moneyManagements && moneyManagements.length > 0){ setSelectedMoneyManagement(moneyManagements[0].name) + setCustomMoneyManagement(undefined) } }, [moneyManagements]) @@ -189,28 +215,33 @@ const BacktestModal: React.FC = ({ return ( - - + - ))} - - + {accounts.map((item) => ( + + ))} + + + - - + {moneyManagements.map((item) => ( + + ))} + - - + + - + {showCustomMoneyManagement && ( +
+ +
+ )} - + - - setDays(e.target.value)} - step="1" - min="-360" - max="-1" - > - - - setBalance(e.target.value)} - step="1000" - min="1000" - max="100000" - > - + + + - - - - - - + {tickers?.map((item) => ( - )) - ) : ( - - )} - - - - {/* Loop Quantity */} - {showLoopSlider ? ( - - setLoopQuantity(e.target.value)} - step="1" - min="1" - max="20" - > + ))} + - ) : null} -
- +
+ + setBalance(Number(e.target.value))} + /> + + + + + +
+ +
+ + { + setStartDate(e.target.value); + setValue('startDate', e.target.value); + }} + /> + + + + { + setEndDate(e.target.value); + setValue('endDate', e.target.value); + }} + /> + +
+ + {showLoopSlider && ( + + setLoopQuantity(Number(e.target.value))} + > + + )}
+
- //
- // - // ), - // Header: '', - // accessor: 'watcher', - // disableFilters: true, - // }, + { + Cell: ({ cell }: any) => ( + <> +
+ +
+ + ), + Header: '', + accessor: 'watcher', + disableFilters: true, + }, { Cell: ({ cell }: any) => ( <>
), Header: '', - accessor: 'bot', + accessor: 'runner', disableFilters: true, - }, + } ], }, ], @@ -264,76 +309,72 @@ const BacktestTable: React.FC = ({ list, isFetching }) => { ) useEffect(() => { - setRows(list!) - - if (list!.length > 0) { - // const optimized = list![0].optimizedMoneyManagement - // setOptimizedMoneyManagement({ - // stopLoss: optimized.stopLoss, - // takeProfit: optimized.takeProfit, - // }) - - // Get average optimized money management for every backtest - const optimized = list!.map((b) => b.optimizedMoneyManagement) - const stopLoss = optimized.reduce((acc, curr) => acc + (curr?.stopLoss ?? 0), 0) - const takeProfit = optimized.reduce( - (acc, curr) => acc + (curr?.takeProfit ?? 0), - 0 - ) - - setOptimizedMoneyManagement({ - stopLoss: stopLoss / optimized.length, - takeProfit: takeProfit / optimized.length, - }) + if (list) { + setRows(list) + + // Calculate average optimized money management + if (list.length > 0) { + const optimized = list.map((b) => b.optimizedMoneyManagement); + const stopLoss = optimized.reduce((acc, curr) => acc + (curr?.stopLoss ?? 0), 0); + const takeProfit = optimized.reduce((acc, curr) => acc + (curr?.takeProfit ?? 0), 0); + + setOptimizedMoneyManagement({ + stopLoss: stopLoss / optimized.length, + takeProfit: takeProfit / optimized.length, + }); + } } - }, [list]) - const renderRowSubComponent = React.useCallback( - ({ row }: any) => ( - <> - - - ), - [] - ) - + return ( -
+ <> {isFetching ? ( - - ) : (<> -
- +
+
- + ) : ( + <> + {list && list.length > 0 && ( +
+ +
+ )} +
( + + )} + /> + {showBotNameModal && currentBacktest && moneyManagements && ( + + handleSubmitBotName(botName, backtest, isForWatchOnly, moneyManagementName) + } + moneyManagements={moneyManagements} + selectedMoneyManagement={selectedMoneyManagement} + setSelectedMoneyManagement={setSelectedMoneyManagement} + /> + )} )} - + ) } diff --git a/src/Managing.WebApp/src/components/organism/Trading/TradeChart/TradeChart.tsx b/src/Managing.WebApp/src/components/organism/Trading/TradeChart/TradeChart.tsx index 4c63e42..075e5a3 100644 --- a/src/Managing.WebApp/src/components/organism/Trading/TradeChart/TradeChart.tsx +++ b/src/Managing.WebApp/src/components/organism/Trading/TradeChart/TradeChart.tsx @@ -556,7 +556,7 @@ const TradeChart = ({ paneCount++ } - if (walletBalances != null) { + if (walletBalances != null && walletBalances.length > 0) { const walletSeries = chart.current.addBaselineSeries({ baseValue: {price: walletBalances[0].value, type: 'price'}, pane: paneCount, diff --git a/src/Managing.WebApp/src/config/privy.ts b/src/Managing.WebApp/src/config/privy.ts index a0a1790..27e9bd5 100644 --- a/src/Managing.WebApp/src/config/privy.ts +++ b/src/Managing.WebApp/src/config/privy.ts @@ -10,8 +10,8 @@ export const privyWagmiConfig = createConfig({ chains: [mainnet, arbitrum], transports: { // You can customize RPC providers here if needed - [mainnet.id]: http(`https://ethereum.publicnode.com`), - [arbitrum.id]: http(`https://arbitrum-one.publicnode.com`), + [mainnet.id]: http(), + [arbitrum.id]: http(), }, }) diff --git a/src/Managing.WebApp/src/generated/ManagingApi.ts b/src/Managing.WebApp/src/generated/ManagingApi.ts index dacfe7e..d782fb5 100644 --- a/src/Managing.WebApp/src/generated/ManagingApi.ts +++ b/src/Managing.WebApp/src/generated/ManagingApi.ts @@ -299,6 +299,44 @@ export class BacktestClient extends AuthorizedApiBase { return Promise.resolve(null as any); } + backtest_Backtest(id: string): Promise { + let url_ = this.baseUrl + "/Backtest/{id}"; + if (id === undefined || id === null) + throw new Error("The parameter 'id' must be defined."); + url_ = url_.replace("{id}", encodeURIComponent("" + id)); + url_ = url_.replace(/[?&]$/, ""); + + let options_: RequestInit = { + method: "GET", + headers: { + "Accept": "application/json" + } + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.http.fetch(url_, transformedOptions_); + }).then((_response: Response) => { + return this.processBacktest_Backtest(_response); + }); + } + + protected processBacktest_Backtest(response: Response): Promise { + const status = response.status; + let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; + if (status === 200) { + return response.text().then((_responseText) => { + let result200: any = null; + result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as Backtest; + return result200; + }); + } else if (status !== 200 && status !== 204) { + return response.text().then((_responseText) => { + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + }); + } + return Promise.resolve(null as any); + } + backtest_DeleteBacktests(): Promise { let url_ = this.baseUrl + "/Backtest/deleteAll"; url_ = url_.replace(/[?&]$/, ""); @@ -339,7 +377,7 @@ export class BacktestClient extends AuthorizedApiBase { return Promise.resolve(null as any); } - backtest_Run(accountName: string | null | undefined, botType: BotType | undefined, ticker: Ticker | undefined, scenarioName: string | null | undefined, timeframe: Timeframe | undefined, watchOnly: boolean | undefined, days: number | undefined, balance: number | undefined, moneyManagementName: string | null | undefined, save: boolean | undefined, moneyManagement: MoneyManagement | undefined): Promise { + backtest_Run(accountName: string | null | undefined, botType: BotType | undefined, ticker: Ticker | undefined, scenarioName: string | null | undefined, timeframe: Timeframe | undefined, watchOnly: boolean | undefined, balance: number | undefined, moneyManagementName: string | null | undefined, startDate: Date | undefined, endDate: Date | undefined, save: boolean | undefined, moneyManagement: MoneyManagement | undefined): Promise { let url_ = this.baseUrl + "/Backtest/Run?"; if (accountName !== undefined && accountName !== null) url_ += "accountName=" + encodeURIComponent("" + accountName) + "&"; @@ -361,16 +399,20 @@ export class BacktestClient extends AuthorizedApiBase { throw new Error("The parameter 'watchOnly' cannot be null."); else if (watchOnly !== undefined) url_ += "watchOnly=" + encodeURIComponent("" + watchOnly) + "&"; - if (days === null) - throw new Error("The parameter 'days' cannot be null."); - else if (days !== undefined) - url_ += "days=" + encodeURIComponent("" + days) + "&"; if (balance === null) throw new Error("The parameter 'balance' cannot be null."); else if (balance !== undefined) url_ += "balance=" + encodeURIComponent("" + balance) + "&"; if (moneyManagementName !== undefined && moneyManagementName !== null) url_ += "moneyManagementName=" + encodeURIComponent("" + moneyManagementName) + "&"; + if (startDate === null) + throw new Error("The parameter 'startDate' cannot be null."); + else if (startDate !== undefined) + url_ += "startDate=" + encodeURIComponent(startDate ? "" + startDate.toISOString() : "") + "&"; + if (endDate === null) + throw new Error("The parameter 'endDate' cannot be null."); + else if (endDate !== undefined) + url_ += "endDate=" + encodeURIComponent(endDate ? "" + endDate.toISOString() : "") + "&"; if (save === null) throw new Error("The parameter 'save' cannot be null."); else if (save !== undefined) @@ -542,11 +584,11 @@ export class BotClient extends AuthorizedApiBase { } bot_StopAll(): Promise { - let url_ = this.baseUrl + "/Bot/StopAll"; + let url_ = this.baseUrl + "/Bot/stop-all"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { - method: "GET", + method: "POST", headers: { "Accept": "application/json" } @@ -618,11 +660,11 @@ export class BotClient extends AuthorizedApiBase { } bot_RestartAll(): Promise { - let url_ = this.baseUrl + "/Bot/RestartAll"; + let url_ = this.baseUrl + "/Bot/restart-all"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { - method: "GET", + method: "POST", headers: { "Accept": "application/json" } @@ -1488,6 +1530,41 @@ export class SettingsClient extends AuthorizedApiBase { } return Promise.resolve(null as any); } + + settings_CreateDefaultConfiguration(): Promise { + let url_ = this.baseUrl + "/Settings/create-default-config"; + url_ = url_.replace(/[?&]$/, ""); + + let options_: RequestInit = { + method: "POST", + headers: { + "Accept": "application/json" + } + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.http.fetch(url_, transformedOptions_); + }).then((_response: Response) => { + return this.processSettings_CreateDefaultConfiguration(_response); + }); + } + + protected processSettings_CreateDefaultConfiguration(response: Response): Promise { + const status = response.status; + let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; + if (status === 200) { + return response.text().then((_responseText) => { + let result200: any = null; + result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as boolean; + return result200; + }); + } else if (status !== 200 && status !== 204) { + return response.text().then((_responseText) => { + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + }); + } + return Promise.resolve(null as any); + } } export class TradingClient extends AuthorizedApiBase { @@ -1999,11 +2076,14 @@ export interface Backtest { botType: BotType; accountName: string; candles: Candle[]; + startDate: Date; + endDate: Date; statistics: PerformanceMetrics; fees: number; walletBalances: KeyValuePairOfDateTimeAndDecimal[]; optimizedMoneyManagement: MoneyManagement; moneyManagement: MoneyManagement; + user: User; strategiesValues: { [key in keyof typeof StrategyType]?: StrategiesResultBase; }; score: number; } @@ -2086,6 +2166,7 @@ export interface Position { signalIdentifier?: string | null; identifier: string; initiator: PositionInitiator; + user?: User | null; } export enum TradeDirection { @@ -2101,6 +2182,7 @@ export interface MoneyManagement { stopLoss: number; takeProfit: number; leverage: number; + user?: User | null; } export enum Timeframe { @@ -2189,6 +2271,7 @@ export interface Signal extends ValueObject { exchange: TradingExchanges; strategyType: StrategyType; signalType: SignalType; + user?: User | null; } export enum SignalStatus { @@ -2372,26 +2455,17 @@ export interface TradingBot { signals: Signal[]; positions: Position[]; candles: Candle[]; - riskLevel: RiskLevel; winRate: number; profitAndLoss: number; timeframe: Timeframe; ticker: Ticker; scenario: string; - exchange: TradingExchanges; isForWatchingOnly: boolean; botType: BotType; accountName: string; moneyManagement: MoneyManagement; } -export enum RiskLevel { - Low = "Low", - Medium = "Medium", - High = "High", - Adaptive = "Adaptive", -} - export interface SpotlightOverview { spotlights: Spotlight[]; dateTime: Date; @@ -2408,6 +2482,7 @@ export interface Scenario { name?: string | null; strategies?: Strategy[] | null; loopbackPeriod?: number | null; + user?: User | null; } export interface Strategy { @@ -2423,6 +2498,7 @@ export interface Strategy { smoothPeriods?: number | null; stochPeriods?: number | null; cyclePeriods?: number | null; + user?: User | null; } export interface TickerSignal { @@ -2434,6 +2510,13 @@ export interface TickerSignal { oneDay: Signal[]; } +export enum RiskLevel { + Low = "Low", + Medium = "Medium", + High = "High", + Adaptive = "Adaptive", +} + export interface LoginRequest { name: string; address: string; diff --git a/src/Managing.WebApp/src/global/type.tsx b/src/Managing.WebApp/src/global/type.tsx index 794114a..0d7933a 100644 --- a/src/Managing.WebApp/src/global/type.tsx +++ b/src/Managing.WebApp/src/global/type.tsx @@ -99,17 +99,18 @@ export type ISpotlightBadge = { price?: number | undefined } -export type IBacktestsFormInput = { +export type IBacktestsFormInput = { accountName: string tickers: string[] botType: BotType timeframe: Timeframe scenarioName: string - days: number save: boolean balance: number moneyManagement: MoneyManagement loop: number + startDate: string + endDate: string } export type IBacktestCards = { @@ -159,11 +160,12 @@ export type IBacktestFormInput = { botType: BotType ticker: Ticker timeframe: Timeframe - days: number save: boolean scenarioName: string balance: number moneyManagement: MoneyManagement + startDate: string + endDate: string } export type IOpenPositionFormInput = { @@ -219,7 +221,7 @@ export type IPropsComponent = { value?: string | number href?: string as?: 'navlink' | 'link' | 'newtab' - className?: string | ((prop: = { isActive: boolean }) => string) + className?: string | ((prop: { isActive: boolean }) => string) onClick?: () => void onChange: (e: React.ChangeEvent) => void id: string @@ -239,7 +241,7 @@ export type IMyLinkProps = { href: string children: React.ReactNode as?: 'navlink' | 'link' | 'newtab' - className?: string | ((prop: = { isActive: boolean }) => string) + className?: string | ((prop: { isActive: boolean }) => string) onClick?: () => void } diff --git a/src/Managing.WebApp/src/pages/botsPage/botList.tsx b/src/Managing.WebApp/src/pages/botsPage/botList.tsx index 99eea1b..d758914 100644 --- a/src/Managing.WebApp/src/pages/botsPage/botList.tsx +++ b/src/Managing.WebApp/src/pages/botsPage/botList.tsx @@ -29,7 +29,7 @@ function baseBadgeClass(isOutlined = false) { function cardClasses(botStatus: string) { const classes = - 'card bg-base-300 shadow-md' + (botStatus == 'Up' ? ' shadow-primary' : '') + 'card bg-base-300 shadow-md ' + (botStatus == 'Up' ? 'shadow-success' : '') return classes } @@ -196,12 +196,6 @@ const BotList: React.FC = ({ list }) => { content={bot.scenario} > -
- -
diff --git a/src/Managing.WebApp/src/pages/settingsPage/account/GmxPositionModal.tsx b/src/Managing.WebApp/src/pages/settingsPage/account/GmxPositionModal.tsx new file mode 100644 index 0000000..eddaf8d --- /dev/null +++ b/src/Managing.WebApp/src/pages/settingsPage/account/GmxPositionModal.tsx @@ -0,0 +1,196 @@ +import React, { useState } from 'react' +import type { SubmitHandler } from 'react-hook-form' +import { useForm } from 'react-hook-form' +import { + Account, + RiskLevel, + Ticker, + TradeDirection, + TradingClient, +} from '../../../generated/ManagingApi' +import Modal from '../../../components/mollecules/Modal/Modal' +import useApiUrlStore from '../../../app/store/apiStore' +import { FormInput, Toast } from '../../../components/mollecules' +import type { IOpenPositionFormInput } from '../../../global/type' + +interface GmxPositionModalProps { + isOpen: boolean + onClose: () => void + account: Account +} + +const GmxPositionModal: React.FC = ({ + isOpen, + onClose, + account, +}) => { + + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + const { apiUrl } = useApiUrlStore() + const client = new TradingClient({}, apiUrl) + const [selectedTicker, setSelectedTicker] = useState(Ticker.BTC) + const [selectedDirection, setSelectedDirection] = useState( + TradeDirection.Long + ) + const { register, handleSubmit } = useForm() + + function setSelectedDirectionEvent(e: React.ChangeEvent) { + setSelectedDirection(e.target.value as TradeDirection) + } + + function setSelectedTickerEvent(e: React.ChangeEvent) { + setSelectedTicker(e.target.value as Ticker) + } + + const onSubmit: SubmitHandler = async (form) => { + const t = new Toast(`Opening ${form.direction} ${form.ticker} on ${account.name}`) + setIsLoading(true) + setError(null) + + try { + await client.trading_Trade( + account.name, + null, // moneyManagementName - assuming none selected + form.direction, + form.ticker, + form.riskLevel, + false, // isForPaperTrading - adjust if needed + form.stopLoss, // Pass stopLoss price to openPrice parameter + undefined // moneyManagement - not passing the full object + ) + t.update('success', 'Position opened successfully') + onClose() // Close modal on success + } catch (err) { + const errorMessage = + err instanceof Error ? err.message : 'An unknown error occurred' + setError(errorMessage) + t.update('error', `Error: ${errorMessage}`) + } finally { + setIsLoading(false) + } + } + + const modalContent = ( + <> + {isLoading ? ( +
+ +

Opening GMX position...

+
+ ) : error ? ( +
+

{error}

+
+ ) : ( + <> +
+

+ Account: {account.name} +

+
+ +
+
+ + + + + + + + + +
+ +
+ Add TP/SL +
+
+ + + +
+
+ +
+ + +
+ {/* Optionally keep or adjust info message */} + {/*
*/} + {/*

*/} + {/* Note: Ensure account has sufficient margin.*/} + {/*

*/} + {/*
*/} +
+ + )} + + ) + + return ( + + {modalContent} + + ) +} + +export default GmxPositionModal \ No newline at end of file diff --git a/src/Managing.WebApp/src/pages/settingsPage/account/PrivyDelegationModal.tsx b/src/Managing.WebApp/src/pages/settingsPage/account/PrivyDelegationModal.tsx new file mode 100644 index 0000000..92b67e0 --- /dev/null +++ b/src/Managing.WebApp/src/pages/settingsPage/account/PrivyDelegationModal.tsx @@ -0,0 +1,465 @@ +import React, { useState, useEffect } from 'react' +import { useDelegatedActions, usePrivy, useWallets, WalletWithMetadata } from '@privy-io/react-auth' +import { Account, AccountType } from '../../../generated/ManagingApi' +import canonicalize from 'canonicalize' // Support JSON canonicalization +import elliptic from 'elliptic' // Elliptic curve cryptography for browsers +import * as base64 from 'base64-js' // Base64 encoding/decoding +import Modal from '../../../components/mollecules/Modal/Modal' + +// Replace with your app configuration - these should come from environment variables in a real app +const PRIVY_APP_ID = 'insert-your-app-id' +const PRIVY_APP_SECRET = 'insert-your-app-secret' // Don't hardcode in production! +const PRIVY_AUTHORIZATION_KEY = 'wallet-auth:insert-your-private-key-here' // Don't hardcode in production! + +// Initialize elliptic curve - P-256 is the curve used by Privy (NIST P-256) +const EC = new elliptic.ec('p256') + +interface PrivyDelegationModalProps { + isOpen: boolean + onClose: () => void + account: Account +} + +// Use Web Crypto API to hash the message with SHA-256 +async function sha256Hash(message: Uint8Array): Promise { + const hashBuffer = await crypto.subtle.digest('SHA-256', message) + return new Uint8Array(hashBuffer) +} + +async function generateAuthorizationSignature({url, body}: {url: string; body: object}) { + try { + // First, canonicalize the request body - this is crucial for consistent signatures + const canonicalizedBody = JSON.parse(canonicalize(body) as string); + + // Create the payload object that follows Privy's specification + const payload = { + version: 1, + method: 'POST', + url, + body: canonicalizedBody, // Use the canonicalized body here + headers: { + 'privy-app-id': PRIVY_APP_ID + } + }; + + // JSON-canonicalize the payload to ensure deterministic serialization + const serializedPayload = canonicalize(payload) as string; + + console.log('Canonicalized payload:', serializedPayload); + + // Extract private key from the authorization key by removing the prefix + const privateKeyBase64 = PRIVY_AUTHORIZATION_KEY.replace('wallet-auth:', ''); + + // Decode the base64 private key to get the raw bytes + const privateKeyBytes = base64.toByteArray(privateKeyBase64); + + // Import the private key into elliptic + const privateKey = EC.keyFromPrivate(privateKeyBytes); + + // Convert the serialized payload to UTF-8 bytes + const messageBytes = new TextEncoder().encode(serializedPayload); + + // Hash the message using SHA-256 with Web Crypto API + const messageHash = await sha256Hash(messageBytes); + + // Sign the hash with the private key - use Uint8Array instead of Buffer + // Using the array directly instead of creating a Buffer + const signature = privateKey.sign(Array.from(messageHash)); + + // Convert signature to the DER format and then to base64 + const signatureDer = signature.toDER(); + const signatureBase64 = base64.fromByteArray(new Uint8Array(signatureDer)); + + return { + payload: serializedPayload, + signature: signatureBase64, + body: canonicalizedBody, // Return the canonicalized body + canonicalizedBodyString: canonicalize(canonicalizedBody) as string // Return the string form too + }; + } catch (err) { + console.error('Error generating signature:', err); + throw err; + } +} + +// Function to send the actual request with the generated signature +async function sendPrivyRequest(url: string, body: any, signature: string): Promise { + try { + // Create basic auth token for Privy API + const authToken = btoa(`${PRIVY_APP_ID}:${PRIVY_APP_SECRET}`); + + // Set up the request headers + const headers = { + 'Authorization': `Basic ${authToken}`, + 'privy-app-id': PRIVY_APP_ID, + 'privy-authorization-signature': signature, + 'Content-Type': 'application/json' + }; + + console.log('Sending request with headers:', headers); + console.log('Body:', body); + + // Make the API call + const response = await fetch(url, { + method: 'POST', + headers: headers, + body: body // Use the exact same canonicalized body string + }); + + // Get the response body + const responseText = await response.text(); + + // Try to parse as JSON if possible + try { + const responseJson = JSON.parse(responseText); + + if (!response.ok) { + throw new Error(`API error (${response.status}): ${JSON.stringify(responseJson)}`); + } + + return responseJson; + } catch (parseError) { + // If not valid JSON, return as text + if (!response.ok) { + throw new Error(`API error (${response.status}): ${responseText}`); + } + + return { text: responseText }; + } + } catch (error) { + console.error('Error sending Privy request:', error); + throw error; + } +} + +const PrivyDelegationModal: React.FC = ({ + isOpen, + onClose, + account, +}) => { + const [isDelegated, setIsDelegated] = useState(false) + const [isLoading, setIsLoading] = useState(true) + const [error, setError] = useState(null) + const [signatureResult, setSignatureResult] = useState<{ + payload: string, + signature: string, + body?: any, + canonicalizedBodyString?: string + } | null>(null) + const [isSigningMessage, setIsSigningMessage] = useState(false) + const [isSendingRequest, setIsSendingRequest] = useState(false) + const [messageToSign, setMessageToSign] = useState('Hello, Ethereum') + const [apiResponse, setApiResponse] = useState(null) + + const { delegateWallet, revokeWallets } = useDelegatedActions() + const { user } = usePrivy() + const { ready, wallets } = useWallets() + + // Find the embedded wallet to delegate from the array of the user's wallets + const walletToDelegate = wallets.find( + (wallet) => wallet.walletClientType === 'privy' && wallet.address === account.key + ) + + useEffect(() => { + if (user && ready) { + checkDelegationStatus() + } + }, [user, ready]) + + const checkDelegationStatus = () => { + setIsLoading(true) + setError(null) + + try { + // Check if the wallet is already delegated by inspecting the user's linked accounts + const delegatedWallet = user?.linkedAccounts.find( + (linkedAccount): linkedAccount is WalletWithMetadata => + linkedAccount.type === 'wallet' && + linkedAccount.delegated && + linkedAccount.address.toLowerCase() === account.key?.toLowerCase() + ) + + setIsDelegated(!!delegatedWallet) + } catch (err: any) { + console.error('Error checking delegation status:', err) + setError(`Failed to check delegation status: ${err.message}`) + } finally { + setIsLoading(false) + } + } + + const handleRequestDelegation = async () => { + try { + setIsLoading(true) + setError(null) + + if (!walletToDelegate) { + throw new Error('No embedded wallet found to delegate') + } + + // Fixes the linter error by using the correct parameter type + await delegateWallet({ + address: walletToDelegate.address, + chainType: 'ethereum' + }) + + setIsDelegated(true) + } catch (err: any) { + console.error('Error requesting delegation:', err) + setError(`Failed to request delegation: ${err.message}`) + } finally { + setIsLoading(false) + } + } + + const handleRevokeDelegation = async () => { + try { + setIsLoading(true) + setError(null) + + if (!walletToDelegate) { + throw new Error('No embedded wallet found to revoke delegation') + } + + // Fix for linter error - revokeWallets doesn't take parameters + await revokeWallets() + + setIsDelegated(false) + } catch (err: any) { + console.error('Error revoking delegation:', err) + setError(`Failed to revoke delegation: ${err.message}`) + } finally { + setIsLoading(false) + } + } + + const handleSignMessage = async () => { + try { + setIsSigningMessage(true) + setSignatureResult(null) + setApiResponse(null) + setError(null) + + if (!walletToDelegate) { + throw new Error('No embedded wallet found to sign with') + } + + // Prepare the request body + const body = { + address: walletToDelegate.address, + chain_type: 'ethereum', + method: 'personal_sign', + params: { + message: messageToSign, + encoding: 'utf-8' + } + } + + // Generate the signature using browser crypto + const result = await generateAuthorizationSignature({ + url: 'https://auth.privy.io/api/v1/wallets/rpc', + body + }) + + setSignatureResult(result) + + // For debugging in the console + console.log("Generated Authorization Signature:", result.signature); + console.log("Payload:", result.payload); + console.log("Body:", result.body); + console.log("Canonicalized Body String:", result.canonicalizedBodyString); + + // Create a curl command that could be used to make the request + // Note: We're using the canonicalized body from the result to ensure it matches what was signed + const curlCommand = `curl --request POST https://auth.privy.io/api/v1/wallets/rpc \\ +-u "${PRIVY_APP_ID}:YOUR_APP_SECRET" \\ +-H "privy-app-id: ${PRIVY_APP_ID}" \\ +-H "privy-authorization-signature: ${result.signature}" \\ +-H 'Content-Type: application/json' \\ +-d '${result.canonicalizedBodyString}'`; + + console.log("Curl command for testing:"); + console.log(curlCommand); + + } catch (err: any) { + console.error('Error signing message:', err) + setError(`Failed to sign message: ${err.message}`) + } finally { + setIsSigningMessage(false) + } + } + + const handleSendRequest = async () => { + if (!signatureResult?.canonicalizedBodyString || !signatureResult?.signature) { + setError('No signature available. Please generate a signature first.'); + return; + } + + try { + setIsSendingRequest(true); + setApiResponse(null); + setError(null); + + // Send the actual request using the same canonicalized body that was used for signature + const response = await sendPrivyRequest( + 'https://auth.privy.io/api/v1/wallets/rpc', + signatureResult.canonicalizedBodyString, + signatureResult.signature + ); + + setApiResponse(response); + console.log('API Response:', response); + } catch (err: any) { + console.error('Error sending request:', err); + setError(`Failed to send request: ${err.message}`); + } finally { + setIsSendingRequest(false); + } + }; + + // Modal content to be passed to the Modal component + const modalContent = ( + <> + {isLoading ? ( +
+ +

Checking delegation status...

+
+ ) : error ? ( +
+

{error}

+
+ ) : ( + <> +
+

+ Wallet Address: {account.key} +

+

+ Delegation Status:{' '} + + {isDelegated ? 'Enabled' : 'Disabled'} + +

+
+ +
+ {isDelegated ? ( + + ) : ( + + )} +
+ +
Message Signing
+ +
+ +
+ +
+ + + {signatureResult && ( + + )} +
+ + {signatureResult && ( +
+
+ Generated Signature: +
+
+
{signatureResult.signature}
+
+
+ )} + + {apiResponse && ( +
+
+ API Response: +
+
+
+                  {JSON.stringify(apiResponse, null, 2)}
+                
+
+
+ )} + +
+
+

+ Note: This component ensures that the exact same canonicalized payload is used + for both signature generation and request sending, maintaining signature integrity. +

+
+
+ + )} + + ) + + return ( + + {modalContent} + + ) +} + +export default PrivyDelegationModal \ No newline at end of file diff --git a/src/Managing.WebApp/src/pages/settingsPage/account/accountTable.tsx b/src/Managing.WebApp/src/pages/settingsPage/account/accountTable.tsx index 5574e3c..2f2fc90 100644 --- a/src/Managing.WebApp/src/pages/settingsPage/account/accountTable.tsx +++ b/src/Managing.WebApp/src/pages/settingsPage/account/accountTable.tsx @@ -5,6 +5,8 @@ import { TrashIcon, } from '@heroicons/react/solid' import React, { useEffect, useState, useMemo } from 'react' +import { useNavigate } from 'react-router-dom' +import { FiPlus, FiTrash2, FiKey, FiTrendingUp } from 'react-icons/fi' import useApiUrlStore from '../../../app/store/apiStore' import { @@ -13,9 +15,11 @@ import { Toast, } from '../../../components/mollecules' import type { Account } from '../../../generated/ManagingApi' -import { AccountClient } from '../../../generated/ManagingApi' +import { AccountClient, AccountType } from '../../../generated/ManagingApi' import AccountRowDetails from './accountRowDetails' +import PrivyDelegationModal from './PrivyDelegationModal' +import GmxPositionModal from './GmxPositionModal' interface IAccountList { list: Account[] @@ -25,6 +29,10 @@ interface IAccountList { const AccountTable: React.FC = ({ list, isFetching }) => { const [rows, setRows] = useState([]) const { apiUrl } = useApiUrlStore() + const navigate = useNavigate() + const [modalAccount, setModalAccount] = useState(null) + const [isDelegationModalOpen, setIsDelegationModalOpen] = useState(false) + const [isGmxPositionModalOpen, setIsGmxPositionModalOpen] = useState(false) async function deleteAcount(accountName: string) { const t = new Toast('Deleting money management') @@ -93,28 +101,46 @@ const AccountTable: React.FC = ({ list, isFetching }) => { disableFilters: true, }, { - Cell: ({ cell }: any) => ( - <> -
+ Cell: ({ row }: any) => { + const account = row.original + + return ( +
+ + {account.type === AccountType.Privy && ( + + )} + + {account.type === AccountType.Privy && ( + + )}
-
- -
- - ), + ) + }, Header: 'Actions', accessor: 'id', disableFilters: true, @@ -128,18 +154,21 @@ const AccountTable: React.FC = ({ list, isFetching }) => { }, [list]) const renderRowSubComponent = React.useCallback( - ({ row }: any) => ( - <> - {row.original.balances != undefined ? ( - - ) : ( -
No balances
- )} - - ), + ({ row }: { row: any }) => { + const { balances } = row.original + return ( + <> + {balances && balances.length > 0 ? ( + + ) : ( +
No balances
+ )} + + ) + }, [] ) @@ -156,6 +185,27 @@ const AccountTable: React.FC = ({ list, isFetching }) => { renderRowSubCompontent={renderRowSubComponent} /> )} + + {modalAccount && ( + <> + { + setIsDelegationModalOpen(false) + setModalAccount(null) + }} + account={modalAccount} + /> + { + setIsGmxPositionModalOpen(false) + setModalAccount(null) + }} + account={modalAccount} + /> + + )} ) } diff --git a/src/Managing.WebApp/src/pages/settingsPage/defaultConfig/defaultConfig.tsx b/src/Managing.WebApp/src/pages/settingsPage/defaultConfig/defaultConfig.tsx new file mode 100644 index 0000000..dc66092 --- /dev/null +++ b/src/Managing.WebApp/src/pages/settingsPage/defaultConfig/defaultConfig.tsx @@ -0,0 +1,115 @@ +import React, { useState } from 'react' +import { toast } from 'react-toastify' +import { SettingsClient } from '../../../generated/ManagingApi' +import useApiUrlStore from '../../../app/store/apiStore' +import { GmxSdk } from '@gmx-io/sdk' +import { createClient, createTestClient, createWalletClient, http, publicActions, walletActions } from 'viem' +import { getClient, getConnectorClient } from '@wagmi/core' +import { privyWagmiConfig } from '../../../config/privy' +import { arbitrum } from 'viem/chains' +import { GmxSdkConfig } from '@gmx-io/sdk/build/src/types/sdk' + +const DefaultConfig: React.FC = () => { + const [isCreating, setIsCreating] = useState(false) + const { apiUrl } = useApiUrlStore() + + const client = createWalletClient({ + account: "0x9f7198eb1b9Ccc0Eb7A07eD228d8FbC12963ea33", + chain: arbitrum, + transport: http(), + }) + + const testClient = createTestClient({ + chain: arbitrum, + mode: "hardhat", + transport: http(), + }) + .extend(publicActions) + .extend(walletActions); + + + const arbitrumSdkConfig: GmxSdkConfig = { + chainId: arbitrum.id, + account: "0x9f7198eb1b9Ccc0Eb7A07eD228d8FbC12963ea33", + oracleUrl: "https://arbitrum-api.gmxinfra.io", + rpcUrl: "https://arb1.arbitrum.io/rpc", + walletClient: client, + subsquidUrl: "https://gmx.squids.live/gmx-synthetics-arbitrum:live/api/graphql", + subgraphUrl: "https://subgraph.satsuma-prod.com/3b2ced13c8d9/gmx/synthetics-arbitrum-stats/api", + }; + + const sdk = new GmxSdk(arbitrumSdkConfig) + + console.log(sdk) + + const createDefaultConfig = async () => { + try { + const client = new SettingsClient({}, apiUrl) + setIsCreating(true) + const response = await client.settings_CreateDefaultConfiguration() + .then((response) => { + if (response) { + toast.success('Default configuration created successfully!') + } else { + toast.error(`Failed to create default configuration`) + } + }) + } catch (error) { + toast.error(`Error: ${error instanceof Error ? error.message : String(error)}`) + } finally { + setIsCreating(false) + } + } + + return ( +
+
+

Default Configuration

+ +
+

Create a default configuration to get started quickly with backtesting:

+ +
+

Money Management:

+
    +
  • Name: Default Hourly
  • +
  • Timeframe: 1 Hour
  • +
  • Balance at Risk: 25%
  • +
  • Stop Loss: 2%
  • +
  • Take Profit: 4%
  • +
  • Leverage: 1x
  • +
+ +

Strategy:

+
    +
  • Type: StcTrend
  • +
  • Name: Default StcTrend
  • +
  • SignalType: Both
  • +
  • FastPeriods: 23
  • +
  • SlowPeriods: 50
  • +
  • StochPeriods: 10
  • +
+ +

Scenario:

+
    +
  • Name: Default Scenario
  • +
  • Contains: Default StcTrend strategy
  • +
+
+
+ +
+ +
+
+
+ ) +} + +export default DefaultConfig diff --git a/src/Managing.WebApp/src/pages/settingsPage/settings.tsx b/src/Managing.WebApp/src/pages/settingsPage/settings.tsx index 404d069..c1c6fba 100644 --- a/src/Managing.WebApp/src/pages/settingsPage/settings.tsx +++ b/src/Managing.WebApp/src/pages/settingsPage/settings.tsx @@ -5,6 +5,7 @@ import { Tabs } from '../../components/mollecules' import AccountSettings from './account/accountSettings' import MoneyManagementSettings from './moneymanagement/moneyManagement' import Theme from './theme' +import DefaultConfig from './defaultConfig/defaultConfig' type TabsType = { label: string @@ -29,6 +30,11 @@ const tabs: TabsType = [ index: 3, label: 'Theme', }, + { + Component: DefaultConfig, + index: 4, + label: 'Quick Start Config', + }, ] const Settings: React.FC = () => { diff --git a/test/plugins/token-approval.test.ts b/test/plugins/token-approval.test.ts new file mode 100644 index 0000000..e69de29